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;
53 LDAP_LOG( OPERATION, ENTRY, "do_bind: conn %d\n", op->o_connid, 0, 0 );
55 Debug( LDAP_DEBUG_TRACE, "do_bind\n", 0, 0, 0 );
59 * Force to connection to "anonymous" until bind succeeds.
61 ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
62 if ( op->o_conn->c_sasl_bind_in_progress ) {
63 be = op->o_conn->c_authz_backend;
65 if ( op->o_conn->c_dn.bv_len ) {
66 /* log authorization identity demotion */
67 Statslog( LDAP_DEBUG_STATS,
68 "conn=%lu op=%lu BIND anonymous mech=implicit ssf=0\n",
69 op->o_connid, op->o_opid, 0, 0, 0 );
71 connection2anonymous( op->o_conn );
72 if ( op->o_conn->c_sasl_bind_in_progress ) {
73 op->o_conn->c_authz_backend = be;
75 ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
76 if ( op->o_dn.bv_val != NULL ) {
77 free( op->o_dn.bv_val );
78 op->o_dn.bv_val = ch_strdup( "" );
81 if ( op->o_ndn.bv_val != NULL ) {
82 free( op->o_ndn.bv_val );
83 op->o_ndn.bv_val = ch_strdup( "" );
88 * Parse the bind request. It looks like this:
90 * BindRequest ::= SEQUENCE {
91 * version INTEGER, -- version
92 * name DistinguishedName, -- dn
93 * authentication CHOICE {
94 * simple [0] OCTET STRING -- passwd
95 * krbv42ldap [1] OCTET STRING
96 * krbv42dsa [2] OCTET STRING
97 * SASL [3] SaslCredentials
101 * SaslCredentials ::= SEQUENCE {
102 * mechanism LDAPString,
103 * credentials OCTET STRING OPTIONAL
107 tag = ber_scanf( ber, "{imt" /*}*/, &version, &dn, &method );
109 if ( tag == LBER_ERROR ) {
111 LDAP_LOG( OPERATION, ERR,
112 "do_bind: conn %d ber_scanf failed\n", op->o_connid, 0, 0 );
114 Debug( LDAP_DEBUG_ANY, "bind: ber_scanf failed\n", 0, 0, 0 );
116 send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" );
121 op->o_protocol = version;
123 if( method != LDAP_AUTH_SASL ) {
124 tag = ber_scanf( ber, /*{*/ "m}", &op->orb_cred );
127 tag = ber_scanf( ber, "{m" /*}*/, &mech );
129 if ( tag != LBER_ERROR ) {
131 tag = ber_peek_tag( ber, &len );
133 if ( tag == LDAP_TAG_LDAPCRED ) {
134 tag = ber_scanf( ber, "m", &op->orb_cred );
136 tag = LDAP_TAG_LDAPCRED;
137 op->orb_cred.bv_val = NULL;
138 op->orb_cred.bv_len = 0;
141 if ( tag != LBER_ERROR ) {
142 tag = ber_scanf( ber, /*{{*/ "}}" );
147 if ( tag == LBER_ERROR ) {
148 send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" );
149 rs->sr_err = SLAPD_DISCONNECT;
153 if( get_ctrls( op, rs, 1 ) != LDAP_SUCCESS ) {
155 LDAP_LOG( OPERATION, INFO,
156 "do_bind: conn %d get_ctrls failed\n", op->o_connid, 0, 0 );
158 Debug( LDAP_DEBUG_ANY, "do_bind: get_ctrls failed\n", 0, 0, 0 );
163 /* We use the tmpmemctx here because it speeds up normalization.
164 * However, we must dup with regular malloc when storing any
165 * resulting DNs in the op or conn structures.
167 rs->sr_err = dnPrettyNormal( NULL, &dn, &op->o_req_dn, &op->o_req_ndn,
169 if ( rs->sr_err != LDAP_SUCCESS ) {
171 LDAP_LOG( OPERATION, INFO,
172 "do_bind: conn %d invalid dn (%s)\n",
173 op->o_connid, dn.bv_val, 0 );
175 Debug( LDAP_DEBUG_ANY, "bind: invalid dn (%s)\n",
178 send_ldap_error( op, rs, LDAP_INVALID_DN_SYNTAX, "invalid DN" );
182 if( method == LDAP_AUTH_SASL ) {
184 LDAP_LOG( OPERATION, DETAIL1,
185 "do_sasl_bind: conn %d dn (%s) mech %s\n",
186 op->o_connid, op->o_req_dn.bv_val, mech.bv_val );
188 Debug( LDAP_DEBUG_TRACE, "do_sasl_bind: dn (%s) mech %s\n",
189 op->o_req_dn.bv_val, mech.bv_val, NULL );
194 LDAP_LOG( OPERATION, DETAIL1,
195 "do_bind: version=%ld dn=\"%s\" method=%ld\n",
196 (unsigned long) version, op->o_req_dn.bv_val,
197 (unsigned long) method );
199 Debug( LDAP_DEBUG_TRACE,
200 "do_bind: version=%ld dn=\"%s\" method=%ld\n",
201 (unsigned long) version, op->o_req_dn.bv_val,
202 (unsigned long) method );
206 Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu BIND dn=\"%s\" method=%ld\n",
207 op->o_connid, op->o_opid, op->o_req_dn.bv_val, (unsigned long) method,
210 if ( version < LDAP_VERSION_MIN || version > LDAP_VERSION_MAX ) {
212 LDAP_LOG( OPERATION, INFO,
213 "do_bind: conn %d unknown version = %ld\n",
214 op->o_connid, (unsigned long)version, 0 );
216 Debug( LDAP_DEBUG_ANY, "do_bind: unknown version=%ld\n",
217 (unsigned long) version, 0, 0 );
219 send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR,
220 "requested protocol version not supported" );
223 } else if (!( global_allows & SLAP_ALLOW_BIND_V2 ) &&
224 version < LDAP_VERSION3 )
226 send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR,
227 "historical protocol version requested, use LDAPv3 instead" );
232 * we set connection version regardless of whether bind succeeds or not.
234 ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
235 op->o_conn->c_protocol = version;
236 ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
238 /* check for inappropriate controls */
239 if( get_manageDSAit( op ) == SLAP_CRITICAL_CONTROL ) {
240 send_ldap_error( op, rs,
241 LDAP_UNAVAILABLE_CRITICAL_EXTENSION,
242 "manageDSAit control inappropriate" );
246 /* Set the bindop for the benefit of in-directory SASL lookups */
247 op->o_conn->c_sasl_bindop = op;
249 if ( method == LDAP_AUTH_SASL ) {
250 if ( version < LDAP_VERSION3 ) {
252 LDAP_LOG( OPERATION, INFO,
253 "do_bind: conn %d sasl with LDAPv%ld\n",
254 op->o_connid, (unsigned long)version , 0 );
256 Debug( LDAP_DEBUG_ANY, "do_bind: sasl with LDAPv%ld\n",
257 (unsigned long) version, 0, 0 );
259 send_ldap_discon( op, rs,
260 LDAP_PROTOCOL_ERROR, "SASL bind requires LDAPv3" );
261 rs->sr_err = SLAPD_DISCONNECT;
265 if( mech.bv_len == 0 ) {
267 LDAP_LOG( OPERATION, INFO,
268 "do_bind: conn %d no SASL mechanism provided\n",
269 op->o_connid, 0, 0 );
271 Debug( LDAP_DEBUG_ANY,
272 "do_bind: no sasl mechanism provided\n",
275 send_ldap_error( op, rs, LDAP_AUTH_METHOD_NOT_SUPPORTED,
276 "no SASL mechanism provided" );
280 /* check restrictions */
281 if( backend_check_restrictions( op, rs, &mech ) != LDAP_SUCCESS ) {
282 send_ldap_result( op, rs );
286 ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
287 if ( op->o_conn->c_sasl_bind_in_progress ) {
288 if( !bvmatch( &op->o_conn->c_sasl_bind_mech, &mech ) ) {
289 /* mechanism changed between bind steps */
290 slap_sasl_reset(op->o_conn);
293 ber_dupbv(&op->o_conn->c_sasl_bind_mech, &mech);
295 ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
297 rs->sr_err = slap_sasl_bind( op, rs );
299 ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
300 if( rs->sr_err == LDAP_SUCCESS ) {
301 ber_dupbv(&op->o_conn->c_dn, &op->orb_edn);
302 if( op->orb_edn.bv_len != 0 ) {
303 /* edn is always normalized already */
304 ber_dupbv( &op->o_conn->c_ndn, &op->o_conn->c_dn );
306 op->o_tmpfree( op->orb_edn.bv_val, op->o_tmpmemctx );
307 op->orb_edn.bv_val = NULL;
308 op->orb_edn.bv_len = 0;
309 op->o_conn->c_authmech = op->o_conn->c_sasl_bind_mech;
310 op->o_conn->c_sasl_bind_mech.bv_val = NULL;
311 op->o_conn->c_sasl_bind_mech.bv_len = 0;
312 op->o_conn->c_sasl_bind_in_progress = 0;
314 op->o_conn->c_sasl_ssf = op->orb_ssf;
315 if( op->orb_ssf > op->o_conn->c_ssf ) {
316 op->o_conn->c_ssf = op->orb_ssf;
319 if( op->o_conn->c_dn.bv_len != 0 ) {
320 ber_len_t max = sockbuf_max_incoming_auth;
321 ber_sockbuf_ctrl( op->o_conn->c_sb,
322 LBER_SB_OPT_SET_MAX_INCOMING, &max );
325 /* log authorization identity */
326 Statslog( LDAP_DEBUG_STATS,
327 "conn=%lu op=%lu BIND dn=\"%s\" mech=%s ssf=%d\n",
328 op->o_connid, op->o_opid,
329 op->o_conn->c_dn.bv_val ? op->o_conn->c_dn.bv_val : "<empty>",
330 op->o_conn->c_authmech.bv_val, op->orb_ssf );
333 LDAP_LOG( OPERATION, DETAIL1,
334 "do_bind: SASL/%s bind: dn=\"%s\" ssf=%d\n",
335 op->o_conn->c_authmech.bv_val,
336 op->o_conn->c_dn.bv_val ? op->o_conn->c_dn.bv_val : "<empty>",
339 Debug( LDAP_DEBUG_TRACE,
340 "do_bind: SASL/%s bind: dn=\"%s\" ssf=%d\n",
341 op->o_conn->c_authmech.bv_val,
342 op->o_conn->c_dn.bv_val ? op->o_conn->c_dn.bv_val : "<empty>",
346 } else if ( rs->sr_err == LDAP_SASL_BIND_IN_PROGRESS ) {
347 op->o_conn->c_sasl_bind_in_progress = 1;
350 if ( op->o_conn->c_sasl_bind_mech.bv_val ) {
351 free( op->o_conn->c_sasl_bind_mech.bv_val );
352 op->o_conn->c_sasl_bind_mech.bv_val = NULL;
353 op->o_conn->c_sasl_bind_mech.bv_len = 0;
355 op->o_conn->c_sasl_bind_in_progress = 0;
360 * Normally post-operation plugins are called only after the
361 * backend operation. Because the front-end performs SASL
362 * binds on behalf of the backend, we'll make a special
363 * exception to call the post-operation plugins after a
366 slapi_x_pblock_set_operation( pb, op );
367 slapi_pblock_set( pb, SLAPI_BIND_TARGET, (void *)dn.bv_val );
368 slapi_pblock_set( pb, SLAPI_BIND_METHOD, (void *)method );
369 slapi_pblock_set( pb, SLAPI_BIND_CREDENTIALS, (void *)&op->orb_cred );
370 slapi_pblock_set( pb, SLAPI_MANAGEDSAIT, (void *)(0) );
371 (void) doPluginFNs( op->o_bd, SLAPI_PLUGIN_POST_BIND_FN, pb );
372 #endif /* LDAP_SLAPI */
374 ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
379 /* Not SASL, cancel any in-progress bind */
380 ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
382 if ( op->o_conn->c_sasl_bind_mech.bv_val != NULL ) {
383 free(op->o_conn->c_sasl_bind_mech.bv_val);
384 op->o_conn->c_sasl_bind_mech.bv_val = NULL;
385 op->o_conn->c_sasl_bind_mech.bv_len = 0;
387 op->o_conn->c_sasl_bind_in_progress = 0;
389 slap_sasl_reset( op->o_conn );
390 ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
393 if ( method == LDAP_AUTH_SIMPLE ) {
394 /* accept "anonymous" binds */
395 if ( op->orb_cred.bv_len == 0 || op->o_req_ndn.bv_len == 0 ) {
396 rs->sr_err = LDAP_SUCCESS;
398 if( op->orb_cred.bv_len &&
399 !( global_allows & SLAP_ALLOW_BIND_ANON_CRED ))
401 /* cred is not empty, disallow */
402 rs->sr_err = LDAP_INVALID_CREDENTIALS;
404 } else if ( op->o_req_ndn.bv_len &&
405 !( global_allows & SLAP_ALLOW_BIND_ANON_DN ))
407 /* DN is not empty, disallow */
408 rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
410 "unauthenticated bind (DN with no password) disallowed";
412 } else if ( global_disallows & SLAP_DISALLOW_BIND_ANON ) {
414 rs->sr_err = LDAP_INAPPROPRIATE_AUTH;
415 rs->sr_text = "anonymous bind disallowed";
418 backend_check_restrictions( op, rs, &mech );
422 * we already forced connection to "anonymous",
423 * just need to send success
425 send_ldap_result( op, rs );
427 LDAP_LOG( OPERATION, DETAIL1,
428 "do_bind: conn %d v%d anonymous bind\n",
429 op->o_connid, version , 0 );
431 Debug( LDAP_DEBUG_TRACE, "do_bind: v%d anonymous bind\n",
436 } else if ( global_disallows & SLAP_DISALLOW_BIND_SIMPLE ) {
437 /* disallow simple authentication */
438 rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
439 rs->sr_text = "unwilling to perform simple authentication";
441 send_ldap_result( op, rs );
443 LDAP_LOG( OPERATION, INFO,
444 "do_bind: conn %d v%d simple bind(%s) disallowed\n",
445 op->o_connid, version, op->o_req_ndn.bv_val );
447 Debug( LDAP_DEBUG_TRACE,
448 "do_bind: v%d simple bind(%s) disallowed\n",
449 version, op->o_req_ndn.bv_val, 0 );
454 #ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND
455 } else if ( method == LDAP_AUTH_KRBV41 || method == LDAP_AUTH_KRBV42 ) {
456 if ( global_disallows & SLAP_DISALLOW_BIND_KRBV4 ) {
457 /* disallow simple authentication */
458 rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
459 rs->sr_text = "unwilling to perform Kerberos V4 bind";
461 send_ldap_result( op, rs );
463 LDAP_LOG( OPERATION, DETAIL1,
464 "do_bind: conn %d v%d Kerberos V4 bind\n",
465 op->o_connid, version , 0 );
467 Debug( LDAP_DEBUG_TRACE, "do_bind: v%d Kerberos V4 bind\n",
475 rs->sr_err = LDAP_AUTH_METHOD_NOT_SUPPORTED;
476 rs->sr_text = "unknown authentication method";
478 send_ldap_result( op, rs );
480 LDAP_LOG( OPERATION, INFO,
481 "do_bind: conn %ld v%d unknown authentication method (%ld)\n",
482 op->o_connid, version, method );
484 Debug( LDAP_DEBUG_TRACE,
485 "do_bind: v%d unknown authentication method (%ld)\n",
486 version, method, 0 );
492 * We could be serving multiple database backends. Select the
493 * appropriate one, or send a referral to our "referral server"
494 * if we don't hold it.
497 if ( (op->o_bd = select_backend( &op->o_req_ndn, 0, 0 )) == NULL ) {
498 if ( default_referral ) {
499 rs->sr_ref = referral_rewrite( default_referral,
500 NULL, &op->o_req_dn, LDAP_SCOPE_DEFAULT );
501 if (!rs->sr_ref) rs->sr_ref = default_referral;
503 rs->sr_err = LDAP_REFERRAL;
504 send_ldap_result( op, rs );
506 if (rs->sr_ref != default_referral) ber_bvarray_free( rs->sr_ref );
509 /* noSuchObject is not allowed to be returned by bind */
510 rs->sr_err = LDAP_INVALID_CREDENTIALS;
511 send_ldap_result( op, rs );
517 /* check restrictions */
518 if( backend_check_restrictions( op, rs, NULL ) != LDAP_SUCCESS ) {
519 send_ldap_result( op, rs );
523 #if defined( LDAP_SLAPI )
524 slapi_x_pblock_set_operation( pb, op );
525 slapi_pblock_set( pb, SLAPI_BIND_TARGET, (void *)dn.bv_val );
526 slapi_pblock_set( pb, SLAPI_BIND_METHOD, (void *)method );
527 slapi_pblock_set( pb, SLAPI_BIND_CREDENTIALS, (void *)&op->orb_cred );
528 slapi_pblock_set( pb, SLAPI_MANAGEDSAIT, (void *)(0) );
530 rs->sr_err = doPluginFNs( op->o_bd, SLAPI_PLUGIN_PRE_BIND_FN, pb );
533 LDAP_LOG( OPERATION, INFO,
534 "do_bind: Bind preoperation plugin returned %d\n",
537 Debug(LDAP_DEBUG_TRACE,
538 "do_bind: Bind preoperation plugin returned %d.\n",
542 switch ( rs->sr_err ) {
543 case SLAPI_BIND_SUCCESS:
544 /* Continue with backend processing */
546 case SLAPI_BIND_FAIL:
547 /* Failure, server sends result */
548 rs->sr_err = LDAP_INVALID_CREDENTIALS;
549 send_ldap_result( op, rs );
552 case SLAPI_BIND_ANONYMOUS:
553 /* SLAPI_BIND_ANONYMOUS is undocumented XXX */
555 /* Authoritative, plugin sent result */
556 if ( slapi_pblock_get( op->o_pb, SLAPI_RESULT_CODE,
557 (void *)&rs->sr_err) != 0 )
559 rs->sr_err = LDAP_OTHER;
562 op->orb_edn.bv_val = NULL;
563 op->orb_edn.bv_len = 0;
565 if ( rs->sr_err == LDAP_SUCCESS ) {
566 slapi_pblock_get( pb, SLAPI_CONN_DN, (void *)&op->orb_edn.bv_val );
567 if ( op->orb_edn.bv_val != NULL ) {
568 op->orb_edn.bv_len = strlen( op->orb_edn.bv_val );
570 rs->sr_err = dnPrettyNormal( NULL, &op->orb_edn,
571 &op->o_req_dn, &op->o_req_ndn, op->o_tmpmemctx );
572 ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
573 ber_dupbv(&op->o_conn->c_dn, &op->o_req_dn);
574 ber_dupbv(&op->o_conn->c_ndn, &op->o_req_ndn);
575 op->o_tmpfree( op->o_req_dn.bv_val, op->o_tmpmemctx );
576 op->o_req_dn.bv_val = NULL;
577 op->o_req_dn.bv_len = 0;
578 op->o_tmpfree( op->o_req_ndn.bv_val, op->o_tmpmemctx );
579 op->o_req_ndn.bv_val = NULL;
580 op->o_req_ndn.bv_len = 0;
581 if ( op->o_conn->c_dn.bv_len != 0 ) {
582 ber_len_t max = sockbuf_max_incoming_auth;
583 ber_sockbuf_ctrl( op->o_conn->c_sb,
584 LBER_SB_OPT_SET_MAX_INCOMING, &max );
586 /* log authorization identity */
587 Statslog( LDAP_DEBUG_STATS,
588 "conn=%lu op=%lu BIND dn=\"%s\" mech=simple (SLAPI) ssf=0\n",
589 op->o_connid, op->o_opid,
590 op->o_conn->c_dn.bv_val ? op->o_conn->c_dn.bv_val : "<empty>",
592 ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
597 #endif /* defined( LDAP_SLAPI ) */
599 if( op->o_bd->be_bind ) {
600 op->orb_method = method;
601 rs->sr_err = (op->o_bd->be_bind)( op, rs );
603 if ( rs->sr_err == 0 ) {
604 ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
606 if( op->o_conn->c_authz_backend == NULL ) {
607 op->o_conn->c_authz_backend = op->o_bd;
610 /* be_bind returns regular/global edn */
611 if( op->orb_edn.bv_len ) {
612 op->o_conn->c_dn = op->orb_edn;
614 ber_dupbv(&op->o_conn->c_dn, &op->o_req_dn);
617 ber_dupbv( &op->o_conn->c_ndn, &op->o_req_ndn );
619 if( op->o_conn->c_dn.bv_len != 0 ) {
620 ber_len_t max = sockbuf_max_incoming_auth;
621 ber_sockbuf_ctrl( op->o_conn->c_sb,
622 LBER_SB_OPT_SET_MAX_INCOMING, &max );
625 /* log authorization identity */
626 Statslog( LDAP_DEBUG_STATS,
627 "conn=%lu op=%lu BIND dn=\"%s\" mech=simple ssf=0\n",
628 op->o_connid, op->o_opid,
629 op->o_conn->c_dn.bv_val, 0, 0 );
632 LDAP_LOG( OPERATION, DETAIL1,
633 "do_bind: v%d bind: \"%s\" to \"%s\" \n",
634 version, op->o_conn->c_dn.bv_val, op->o_conn->c_dn.bv_val );
636 Debug( LDAP_DEBUG_TRACE,
637 "do_bind: v%d bind: \"%s\" to \"%s\"\n",
638 version, dn.bv_val, op->o_conn->c_dn.bv_val );
641 ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
643 /* send this here to avoid a race condition */
644 send_ldap_result( op, rs );
646 } else if (op->orb_edn.bv_val != NULL) {
647 free( op->orb_edn.bv_val );
651 send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
652 "operation not supported within naming context" );
655 #if defined( LDAP_SLAPI )
656 if ( doPluginFNs( op->o_bd, SLAPI_PLUGIN_POST_BIND_FN, pb ) < 0 ) {
658 LDAP_LOG( OPERATION, INFO,
659 "do_bind: Bind postoperation plugins failed\n",
662 Debug(LDAP_DEBUG_TRACE,
663 "do_bind: Bind postoperation plugins failed.\n",
667 #endif /* defined( LDAP_SLAPI ) */
671 op->o_conn->c_sasl_bindop = NULL;
673 if( op->o_req_dn.bv_val != NULL ) {
674 sl_free( op->o_req_dn.bv_val, op->o_tmpmemctx );
675 op->o_req_dn.bv_val = NULL;
677 if( op->o_req_ndn.bv_val != NULL ) {
678 sl_free( op->o_req_ndn.bv_val, op->o_tmpmemctx );
679 op->o_req_ndn.bv_val = NULL;