1 /* bind.c - decode an ldap bind operation and pass it to a backend db */
4 * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
5 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
9 * Copyright (c) 1995 Regents of the University of Michigan.
10 * All rights reserved.
12 * Redistribution and use in source and binary forms are permitted
13 * provided that this notice is preserved and that due credit is given
14 * to the University of Michigan at Ann Arbor. The name of the University
15 * may not be used to endorse or promote products derived from this
16 * software without specific prior written permission. This software
17 * is provided ``as is'' without express or implied warranty.
24 #include <ac/string.h>
25 #include <ac/socket.h>
40 BerElement *ber = op->o_ber;
43 struct berval mech = { 0, NULL };
44 struct berval dn = { 0, NULL };
49 Slapi_PBlock *pb = op->o_pb;
54 LDAP_LOG( OPERATION, ENTRY, "do_bind: conn %d\n", op->o_connid, 0, 0 );
56 Debug( LDAP_DEBUG_TRACE, "do_bind\n", 0, 0, 0 );
60 * Force to connection to "anonymous" until bind succeeds.
62 ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
63 if ( op->o_conn->c_sasl_bind_in_progress ) {
64 be = op->o_conn->c_authz_backend;
66 if ( op->o_conn->c_dn.bv_len ) {
67 /* log authorization identity demotion */
68 Statslog( LDAP_DEBUG_STATS,
69 "conn=%lu op=%lu BIND anonymous mech=implicit ssf=0\n",
70 op->o_connid, op->o_opid, 0, 0, 0 );
72 connection2anonymous( op->o_conn );
73 if ( op->o_conn->c_sasl_bind_in_progress ) {
74 op->o_conn->c_authz_backend = be;
76 ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
77 if ( op->o_dn.bv_val != NULL ) {
78 free( op->o_dn.bv_val );
79 op->o_dn.bv_val = ch_strdup( "" );
82 if ( op->o_ndn.bv_val != NULL ) {
83 free( op->o_ndn.bv_val );
84 op->o_ndn.bv_val = ch_strdup( "" );
89 * Parse the bind request. It looks like this:
91 * BindRequest ::= SEQUENCE {
92 * version INTEGER, -- version
93 * name DistinguishedName, -- dn
94 * authentication CHOICE {
95 * simple [0] OCTET STRING -- passwd
96 * krbv42ldap [1] OCTET STRING
97 * krbv42dsa [2] OCTET STRING
98 * SASL [3] SaslCredentials
102 * SaslCredentials ::= SEQUENCE {
103 * mechanism LDAPString,
104 * credentials OCTET STRING OPTIONAL
108 tag = ber_scanf( ber, "{imt" /*}*/, &version, &dn, &method );
110 if ( tag == LBER_ERROR ) {
112 LDAP_LOG( OPERATION, ERR,
113 "do_bind: conn %d ber_scanf failed\n", op->o_connid, 0, 0 );
115 Debug( LDAP_DEBUG_ANY, "bind: ber_scanf failed\n", 0, 0, 0 );
117 send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" );
122 op->o_protocol = version;
124 if( method != LDAP_AUTH_SASL ) {
125 tag = ber_scanf( ber, /*{*/ "m}", &op->orb_cred );
128 tag = ber_scanf( ber, "{m" /*}*/, &mech );
130 if ( tag != LBER_ERROR ) {
132 tag = ber_peek_tag( ber, &len );
134 if ( tag == LDAP_TAG_LDAPCRED ) {
135 tag = ber_scanf( ber, "m", &op->orb_cred );
137 tag = LDAP_TAG_LDAPCRED;
138 op->orb_cred.bv_val = NULL;
139 op->orb_cred.bv_len = 0;
142 if ( tag != LBER_ERROR ) {
143 tag = ber_scanf( ber, /*{{*/ "}}" );
148 if ( tag == LBER_ERROR ) {
149 send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" );
150 rs->sr_err = SLAPD_DISCONNECT;
154 if( get_ctrls( op, rs, 1 ) != LDAP_SUCCESS ) {
156 LDAP_LOG( OPERATION, INFO,
157 "do_bind: conn %d get_ctrls failed\n", op->o_connid, 0, 0 );
159 Debug( LDAP_DEBUG_ANY, "do_bind: get_ctrls failed\n", 0, 0, 0 );
164 /* We use the tmpmemctx here because it speeds up normalization.
165 * However, we must dup with regular malloc when storing any
166 * resulting DNs in the op or conn structures.
168 rs->sr_err = dnPrettyNormal( NULL, &dn, &op->o_req_dn, &op->o_req_ndn,
170 if ( rs->sr_err != LDAP_SUCCESS ) {
172 LDAP_LOG( OPERATION, INFO,
173 "do_bind: conn %d invalid dn (%s)\n",
174 op->o_connid, dn.bv_val, 0 );
176 Debug( LDAP_DEBUG_ANY, "bind: invalid dn (%s)\n",
179 send_ldap_error( op, rs, LDAP_INVALID_DN_SYNTAX, "invalid DN" );
183 if( method == LDAP_AUTH_SASL ) {
185 LDAP_LOG( OPERATION, DETAIL1,
186 "do_sasl_bind: conn %d dn (%s) mech %s\n",
187 op->o_connid, op->o_req_dn.bv_val, mech.bv_val );
189 Debug( LDAP_DEBUG_TRACE, "do_sasl_bind: dn (%s) mech %s\n",
190 op->o_req_dn.bv_val, mech.bv_val, NULL );
195 LDAP_LOG( OPERATION, DETAIL1,
196 "do_bind: version=%ld dn=\"%s\" method=%ld\n",
197 (unsigned long) version, op->o_req_dn.bv_val,
198 (unsigned long) method );
200 Debug( LDAP_DEBUG_TRACE,
201 "do_bind: version=%ld dn=\"%s\" method=%ld\n",
202 (unsigned long) version, op->o_req_dn.bv_val,
203 (unsigned long) method );
207 Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu BIND dn=\"%s\" method=%ld\n",
208 op->o_connid, op->o_opid, op->o_req_dn.bv_val, (unsigned long) method,
211 if ( version < LDAP_VERSION_MIN || version > LDAP_VERSION_MAX ) {
213 LDAP_LOG( OPERATION, INFO,
214 "do_bind: conn %d unknown version = %ld\n",
215 op->o_connid, (unsigned long)version, 0 );
217 Debug( LDAP_DEBUG_ANY, "do_bind: unknown version=%ld\n",
218 (unsigned long) version, 0, 0 );
220 send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR,
221 "requested protocol version not supported" );
224 } else if (!( global_allows & SLAP_ALLOW_BIND_V2 ) &&
225 version < LDAP_VERSION3 )
227 send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR,
228 "historical protocol version requested, use LDAPv3 instead" );
233 * we set connection version regardless of whether bind succeeds or not.
235 ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
236 op->o_conn->c_protocol = version;
237 ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
239 /* check for inappropriate controls */
240 if( get_manageDSAit( op ) == SLAP_CRITICAL_CONTROL ) {
241 send_ldap_error( op, rs,
242 LDAP_UNAVAILABLE_CRITICAL_EXTENSION,
243 "manageDSAit control inappropriate" );
247 /* Set the bindop for the benefit of in-directory SASL lookups */
248 op->o_conn->c_sasl_bindop = op;
250 if ( method == LDAP_AUTH_SASL ) {
251 if ( version < LDAP_VERSION3 ) {
253 LDAP_LOG( OPERATION, INFO,
254 "do_bind: conn %d sasl with LDAPv%ld\n",
255 op->o_connid, (unsigned long)version , 0 );
257 Debug( LDAP_DEBUG_ANY, "do_bind: sasl with LDAPv%ld\n",
258 (unsigned long) version, 0, 0 );
260 send_ldap_discon( op, rs,
261 LDAP_PROTOCOL_ERROR, "SASL bind requires LDAPv3" );
262 rs->sr_err = SLAPD_DISCONNECT;
266 if( mech.bv_len == 0 ) {
268 LDAP_LOG( OPERATION, INFO,
269 "do_bind: conn %d no SASL mechanism provided\n",
270 op->o_connid, 0, 0 );
272 Debug( LDAP_DEBUG_ANY,
273 "do_bind: no sasl mechanism provided\n",
276 send_ldap_error( op, rs, LDAP_AUTH_METHOD_NOT_SUPPORTED,
277 "no SASL mechanism provided" );
281 /* check restrictions */
282 if( backend_check_restrictions( op, rs, &mech ) != LDAP_SUCCESS ) {
283 send_ldap_result( op, rs );
287 ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
288 if ( op->o_conn->c_sasl_bind_in_progress ) {
289 if( !bvmatch( &op->o_conn->c_sasl_bind_mech, &mech ) ) {
290 /* mechanism changed between bind steps */
291 slap_sasl_reset(op->o_conn);
294 ber_dupbv(&op->o_conn->c_sasl_bind_mech, &mech);
296 ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
298 rs->sr_err = slap_sasl_bind( op, rs );
300 ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
301 if( rs->sr_err == LDAP_SUCCESS ) {
302 ber_dupbv(&op->o_conn->c_dn, &op->orb_edn);
303 if( op->orb_edn.bv_len != 0 ) {
304 /* edn is always normalized already */
305 ber_dupbv( &op->o_conn->c_ndn, &op->o_conn->c_dn );
307 op->o_tmpfree( op->orb_edn.bv_val, op->o_tmpmemctx );
308 op->orb_edn.bv_val = NULL;
309 op->orb_edn.bv_len = 0;
310 op->o_conn->c_authmech = op->o_conn->c_sasl_bind_mech;
311 op->o_conn->c_sasl_bind_mech.bv_val = NULL;
312 op->o_conn->c_sasl_bind_mech.bv_len = 0;
313 op->o_conn->c_sasl_bind_in_progress = 0;
315 op->o_conn->c_sasl_ssf = op->orb_ssf;
316 if( op->orb_ssf > op->o_conn->c_ssf ) {
317 op->o_conn->c_ssf = op->orb_ssf;
320 if( op->o_conn->c_dn.bv_len != 0 ) {
321 ber_len_t max = sockbuf_max_incoming_auth;
322 ber_sockbuf_ctrl( op->o_conn->c_sb,
323 LBER_SB_OPT_SET_MAX_INCOMING, &max );
326 /* log authorization identity */
327 Statslog( LDAP_DEBUG_STATS,
328 "conn=%lu op=%lu BIND dn=\"%s\" mech=%s ssf=%d\n",
329 op->o_connid, op->o_opid,
330 op->o_conn->c_dn.bv_val ? op->o_conn->c_dn.bv_val : "<empty>",
331 op->o_conn->c_authmech.bv_val, op->orb_ssf );
334 LDAP_LOG( OPERATION, DETAIL1,
335 "do_bind: SASL/%s bind: dn=\"%s\" ssf=%d\n",
336 op->o_conn->c_authmech.bv_val,
337 op->o_conn->c_dn.bv_val ? op->o_conn->c_dn.bv_val : "<empty>",
340 Debug( LDAP_DEBUG_TRACE,
341 "do_bind: SASL/%s bind: dn=\"%s\" ssf=%d\n",
342 op->o_conn->c_authmech.bv_val,
343 op->o_conn->c_dn.bv_val ? op->o_conn->c_dn.bv_val : "<empty>",
347 } else if ( rs->sr_err == LDAP_SASL_BIND_IN_PROGRESS ) {
348 op->o_conn->c_sasl_bind_in_progress = 1;
351 if ( op->o_conn->c_sasl_bind_mech.bv_val ) {
352 free( op->o_conn->c_sasl_bind_mech.bv_val );
353 op->o_conn->c_sasl_bind_mech.bv_val = NULL;
354 op->o_conn->c_sasl_bind_mech.bv_len = 0;
356 op->o_conn->c_sasl_bind_in_progress = 0;
361 * Normally post-operation plugins are called only after the
362 * backend operation. Because the front-end performs SASL
363 * binds on behalf of the backend, we'll make a special
364 * exception to call the post-operation plugins after a
367 slapi_x_pblock_set_operation( pb, op );
368 slapi_pblock_set( pb, SLAPI_BIND_TARGET, (void *)dn.bv_val );
369 slapi_pblock_set( pb, SLAPI_BIND_METHOD, (void *)method );
370 slapi_pblock_set( pb, SLAPI_BIND_CREDENTIALS, (void *)&op->orb_cred );
371 slapi_pblock_set( pb, SLAPI_MANAGEDSAIT, (void *)(0) );
372 (void) doPluginFNs( op->o_bd, SLAPI_PLUGIN_POST_BIND_FN, pb );
373 #endif /* LDAP_SLAPI */
375 ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
380 /* Not SASL, cancel any in-progress bind */
381 ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
383 if ( op->o_conn->c_sasl_bind_mech.bv_val != NULL ) {
384 free(op->o_conn->c_sasl_bind_mech.bv_val);
385 op->o_conn->c_sasl_bind_mech.bv_val = NULL;
386 op->o_conn->c_sasl_bind_mech.bv_len = 0;
388 op->o_conn->c_sasl_bind_in_progress = 0;
390 slap_sasl_reset( op->o_conn );
391 ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
394 if ( method == LDAP_AUTH_SIMPLE ) {
395 /* accept "anonymous" binds */
396 if ( op->orb_cred.bv_len == 0 || op->o_req_ndn.bv_len == 0 ) {
397 rs->sr_err = LDAP_SUCCESS;
399 if( op->orb_cred.bv_len &&
400 !( global_allows & SLAP_ALLOW_BIND_ANON_CRED ))
402 /* cred is not empty, disallow */
403 rs->sr_err = LDAP_INVALID_CREDENTIALS;
405 } else if ( op->o_req_ndn.bv_len &&
406 !( global_allows & SLAP_ALLOW_BIND_ANON_DN ))
408 /* DN is not empty, disallow */
409 rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
411 "unauthenticated bind (DN with no password) disallowed";
413 } else if ( global_disallows & SLAP_DISALLOW_BIND_ANON ) {
415 rs->sr_err = LDAP_INAPPROPRIATE_AUTH;
416 rs->sr_text = "anonymous bind disallowed";
419 backend_check_restrictions( op, rs, &mech );
423 * we already forced connection to "anonymous",
424 * just need to send success
426 send_ldap_result( op, rs );
428 LDAP_LOG( OPERATION, DETAIL1,
429 "do_bind: conn %d v%d anonymous bind\n",
430 op->o_connid, version , 0 );
432 Debug( LDAP_DEBUG_TRACE, "do_bind: v%d anonymous bind\n",
437 } else if ( global_disallows & SLAP_DISALLOW_BIND_SIMPLE ) {
438 /* disallow simple authentication */
439 rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
440 rs->sr_text = "unwilling to perform simple authentication";
442 send_ldap_result( op, rs );
444 LDAP_LOG( OPERATION, INFO,
445 "do_bind: conn %d v%d simple bind(%s) disallowed\n",
446 op->o_connid, version, op->o_req_ndn.bv_val );
448 Debug( LDAP_DEBUG_TRACE,
449 "do_bind: v%d simple bind(%s) disallowed\n",
450 version, op->o_req_ndn.bv_val, 0 );
455 #ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND
456 } else if ( method == LDAP_AUTH_KRBV41 || method == LDAP_AUTH_KRBV42 ) {
457 if ( global_disallows & SLAP_DISALLOW_BIND_KRBV4 ) {
458 /* disallow simple authentication */
459 rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
460 rs->sr_text = "unwilling to perform Kerberos V4 bind";
462 send_ldap_result( op, rs );
464 LDAP_LOG( OPERATION, DETAIL1,
465 "do_bind: conn %d v%d Kerberos V4 bind\n",
466 op->o_connid, version , 0 );
468 Debug( LDAP_DEBUG_TRACE, "do_bind: v%d Kerberos V4 bind\n",
476 rs->sr_err = LDAP_AUTH_METHOD_NOT_SUPPORTED;
477 rs->sr_text = "unknown authentication method";
479 send_ldap_result( op, rs );
481 LDAP_LOG( OPERATION, INFO,
482 "do_bind: conn %ld v%d unknown authentication method (%ld)\n",
483 op->o_connid, version, method );
485 Debug( LDAP_DEBUG_TRACE,
486 "do_bind: v%d unknown authentication method (%ld)\n",
487 version, method, 0 );
493 * We could be serving multiple database backends. Select the
494 * appropriate one, or send a referral to our "referral server"
495 * if we don't hold it.
498 if ( (op->o_bd = select_backend( &op->o_req_ndn, 0, 0 )) == NULL ) {
499 if ( default_referral ) {
500 rs->sr_ref = referral_rewrite( default_referral,
501 NULL, &op->o_req_dn, LDAP_SCOPE_DEFAULT );
502 if (!rs->sr_ref) rs->sr_ref = default_referral;
504 rs->sr_err = LDAP_REFERRAL;
505 send_ldap_result( op, rs );
507 if (rs->sr_ref != default_referral) ber_bvarray_free( rs->sr_ref );
510 /* noSuchObject is not allowed to be returned by bind */
511 rs->sr_err = LDAP_INVALID_CREDENTIALS;
512 send_ldap_result( op, rs );
518 /* check restrictions */
519 if( backend_check_restrictions( op, rs, NULL ) != LDAP_SUCCESS ) {
520 send_ldap_result( op, rs );
524 #if defined( LDAP_SLAPI )
525 slapi_x_pblock_set_operation( pb, op );
526 slapi_pblock_set( pb, SLAPI_BIND_TARGET, (void *)dn.bv_val );
527 slapi_pblock_set( pb, SLAPI_BIND_METHOD, (void *)method );
528 slapi_pblock_set( pb, SLAPI_BIND_CREDENTIALS, (void *)&op->orb_cred );
529 slapi_pblock_set( pb, SLAPI_MANAGEDSAIT, (void *)(0) );
530 slapi_pblock_set( pb, SLAPI_CONN_DN, (void *)(0) );
532 rc = doPluginFNs( op->o_bd, SLAPI_PLUGIN_PRE_BIND_FN, pb );
535 LDAP_LOG( OPERATION, INFO,
536 "do_bind: Bind preoperation plugin returned %d\n",
539 Debug(LDAP_DEBUG_TRACE,
540 "do_bind: Bind preoperation plugin returned %d.\n",
545 case SLAPI_BIND_SUCCESS:
546 /* Continue with backend processing */
548 case SLAPI_BIND_FAIL:
549 /* Failure, server sends result */
550 rs->sr_err = LDAP_INVALID_CREDENTIALS;
551 send_ldap_result( op, rs );
554 case SLAPI_BIND_ANONYMOUS:
555 /* SLAPI_BIND_ANONYMOUS is undocumented XXX */
557 /* Authoritative, plugin sent result, or no plugins called. */
558 if ( slapi_pblock_get( op->o_pb, SLAPI_RESULT_CODE,
559 (void *)&rs->sr_err) != 0 )
561 rs->sr_err = LDAP_OTHER;
564 op->orb_edn.bv_val = NULL;
565 op->orb_edn.bv_len = 0;
567 if ( rs->sr_err == LDAP_SUCCESS ) {
568 slapi_pblock_get( pb, SLAPI_CONN_DN, (void *)&op->orb_edn.bv_val );
569 if ( op->orb_edn.bv_val == NULL ) {
571 /* No plugins were called; continue. */
575 op->orb_edn.bv_len = strlen( op->orb_edn.bv_val );
577 rs->sr_err = dnPrettyNormal( NULL, &op->orb_edn,
578 &op->o_req_dn, &op->o_req_ndn, op->o_tmpmemctx );
579 ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
580 ber_dupbv(&op->o_conn->c_dn, &op->o_req_dn);
581 ber_dupbv(&op->o_conn->c_ndn, &op->o_req_ndn);
582 op->o_tmpfree( op->o_req_dn.bv_val, op->o_tmpmemctx );
583 op->o_req_dn.bv_val = NULL;
584 op->o_req_dn.bv_len = 0;
585 op->o_tmpfree( op->o_req_ndn.bv_val, op->o_tmpmemctx );
586 op->o_req_ndn.bv_val = NULL;
587 op->o_req_ndn.bv_len = 0;
588 if ( op->o_conn->c_dn.bv_len != 0 ) {
589 ber_len_t max = sockbuf_max_incoming_auth;
590 ber_sockbuf_ctrl( op->o_conn->c_sb,
591 LBER_SB_OPT_SET_MAX_INCOMING, &max );
593 /* log authorization identity */
594 Statslog( LDAP_DEBUG_STATS,
595 "conn=%lu op=%lu BIND dn=\"%s\" mech=simple (SLAPI) ssf=0\n",
596 op->o_connid, op->o_opid,
597 op->o_conn->c_dn.bv_val ? op->o_conn->c_dn.bv_val : "<empty>",
599 ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
604 #endif /* defined( LDAP_SLAPI ) */
606 if( op->o_bd->be_bind ) {
607 op->orb_method = method;
608 rs->sr_err = (op->o_bd->be_bind)( op, rs );
610 if ( rs->sr_err == 0 ) {
611 ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
613 if( op->o_conn->c_authz_backend == NULL ) {
614 op->o_conn->c_authz_backend = op->o_bd;
617 /* be_bind returns regular/global edn */
618 if( op->orb_edn.bv_len ) {
619 op->o_conn->c_dn = op->orb_edn;
621 ber_dupbv(&op->o_conn->c_dn, &op->o_req_dn);
624 ber_dupbv( &op->o_conn->c_ndn, &op->o_req_ndn );
626 if( op->o_conn->c_dn.bv_len != 0 ) {
627 ber_len_t max = sockbuf_max_incoming_auth;
628 ber_sockbuf_ctrl( op->o_conn->c_sb,
629 LBER_SB_OPT_SET_MAX_INCOMING, &max );
632 /* log authorization identity */
633 Statslog( LDAP_DEBUG_STATS,
634 "conn=%lu op=%lu BIND dn=\"%s\" mech=simple ssf=0\n",
635 op->o_connid, op->o_opid,
636 op->o_conn->c_dn.bv_val, 0, 0 );
639 LDAP_LOG( OPERATION, DETAIL1,
640 "do_bind: v%d bind: \"%s\" to \"%s\" \n",
641 version, op->o_conn->c_dn.bv_val, op->o_conn->c_dn.bv_val );
643 Debug( LDAP_DEBUG_TRACE,
644 "do_bind: v%d bind: \"%s\" to \"%s\"\n",
645 version, dn.bv_val, op->o_conn->c_dn.bv_val );
648 ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
650 /* send this here to avoid a race condition */
651 send_ldap_result( op, rs );
653 } else if (op->orb_edn.bv_val != NULL) {
654 free( op->orb_edn.bv_val );
658 send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
659 "operation not supported within naming context" );
662 #if defined( LDAP_SLAPI )
663 if ( doPluginFNs( op->o_bd, SLAPI_PLUGIN_POST_BIND_FN, pb ) < 0 ) {
665 LDAP_LOG( OPERATION, INFO,
666 "do_bind: Bind postoperation plugins failed\n",
669 Debug(LDAP_DEBUG_TRACE,
670 "do_bind: Bind postoperation plugins failed.\n",
674 #endif /* defined( LDAP_SLAPI ) */
678 op->o_conn->c_sasl_bindop = NULL;
680 if( op->o_req_dn.bv_val != NULL ) {
681 sl_free( op->o_req_dn.bv_val, op->o_tmpmemctx );
682 op->o_req_dn.bv_val = NULL;
684 if( op->o_req_ndn.bv_val != NULL ) {
685 sl_free( op->o_req_ndn.bv_val, op->o_tmpmemctx );
686 op->o_req_ndn.bv_val = NULL;