1 /* modrdn.c - bdb backend modrdn routine */
4 * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
5 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
11 #include <ac/string.h>
23 struct berval *newrdn,
24 struct berval *nnewrdn,
26 struct berval *newSuperior,
27 struct berval *nnewSuperior )
29 struct bdb_info *bdb = (struct bdb_info *) be->be_private;
30 AttributeDescription *children = slap_schema.si_ad_children;
31 AttributeDescription *entry = slap_schema.si_ad_entry;
32 struct berval p_dn, p_ndn;
33 struct berval new_dn = {0, NULL}, new_ndn = {0, NULL};
38 /* LDAP v2 supporting correct attribute handling. */
39 LDAPRDN *new_rdn = NULL;
40 LDAPRDN *old_rdn = NULL;
43 char textbuf[SLAP_TEXT_BUFLEN];
44 size_t textlen = sizeof textbuf;
46 struct bdb_op_info opinfo;
50 Entry *np = NULL; /* newSuperior Entry */
51 struct berval *np_dn = NULL; /* newSuperior dn */
52 struct berval *np_ndn = NULL; /* newSuperior ndn */
53 struct berval *new_parent_dn = NULL; /* np_dn, p_dn, or NULL */
55 /* Used to interface with bdb_modify_internal() */
56 Modifications *mod = NULL; /* Used to delete old rdn */
58 int manageDSAit = get_manageDSAit( op );
65 #if defined(LDAP_CLIENT_UPDATE) || defined(LDAP_SYNC)
67 struct psid_entry* pm_list;
68 struct psid_entry* pm_prev;
72 LDAP_LOG ( OPERATION, ENTRY, "==>bdb_modrdn(%s,%s,%s)\n",
73 dn->bv_val,newrdn->bv_val, newSuperior ? newSuperior->bv_val : "NULL" );
75 Debug( LDAP_DEBUG_TRACE, "==>bdb_modrdn(%s,%s,%s)\n",
76 dn->bv_val, newrdn->bv_val,
77 newSuperior ? newSuperior->bv_val : "NULL" );
81 retry: /* transaction retry */
83 bdb_cache_delete_entry(&bdb->bi_cache, e);
84 bdb_unlocked_cache_return_entry_w(&bdb->bi_cache, e);
87 bdb_unlocked_cache_return_entry_r(&bdb->bi_cache, p);
90 bdb_unlocked_cache_return_entry_r(&bdb->bi_cache, np);
93 LDAP_LOG ( OPERATION, DETAIL1, "==>bdb_modrdn: retrying...\n", 0, 0, 0);
95 Debug( LDAP_DEBUG_TRACE, "==>bdb_modrdn: retrying...\n", 0, 0, 0 );
98 #if defined(LDAP_CLIENT_UPDATE) || defined(LDAP_SYNC)
99 pm_list = LDAP_LIST_FIRST(&op->premodify_list);
100 while ( pm_list != NULL ) {
101 LDAP_LIST_REMOVE ( pm_list, link );
103 pm_list = LDAP_LIST_NEXT ( pm_list, link );
108 rc = TXN_ABORT( ltid );
110 op->o_private = NULL;
111 op->o_do_not_cache = opinfo.boi_acl_cache;
114 text = "internal error";
117 ldap_pvt_thread_yield();
120 /* begin transaction */
121 rc = TXN_BEGIN( bdb->bi_dbenv, NULL, <id,
122 bdb->bi_db_opflags );
126 LDAP_LOG ( OPERATION, ERR,
127 "==>bdb_modrdn: txn_begin failed: %s (%d)\n",
128 db_strerror(rc), rc, 0 );
130 Debug( LDAP_DEBUG_TRACE,
131 "bdb_delete: txn_begin failed: %s (%d)\n",
132 db_strerror(rc), rc, 0 );
135 text = "internal error";
139 locker = TXN_ID ( ltid );
142 opinfo.boi_txn = ltid;
143 opinfo.boi_locker = locker;
145 opinfo.boi_acl_cache = op->o_do_not_cache;
146 op->o_private = &opinfo;
149 rc = bdb_dn2entry_w( be, ltid, ndn, &e, &matched, DB_RMW, locker, &lock );
155 case DB_LOCK_DEADLOCK:
156 case DB_LOCK_NOTGRANTED:
159 text = "ldap server busy";
163 text = "internal error";
168 char* matched_dn = NULL;
171 if( matched != NULL ) {
172 matched_dn = ch_strdup( matched->e_dn );
173 refs = is_entry_referral( matched )
174 ? get_entry_referrals( be, conn, op, matched )
176 bdb_unlocked_cache_return_entry_r( &bdb->bi_cache, matched);
180 refs = referral_rewrite( default_referral,
181 NULL, dn, LDAP_SCOPE_DEFAULT );
184 send_ldap_result( conn, op, rc = LDAP_REFERRAL,
185 matched_dn, NULL, refs, NULL );
187 ber_bvarray_free( refs );
193 /* check write on old entry */
194 rc = access_allowed( be, conn, op, e, entry, NULL, ACL_WRITE, NULL );
196 switch( opinfo.boi_err ) {
197 case DB_LOCK_DEADLOCK:
198 case DB_LOCK_NOTGRANTED:
204 LDAP_LOG ( OPERATION, ERR,
205 "==>bdb_modrdn: no access to entry\n", 0, 0, 0 );
207 Debug( LDAP_DEBUG_TRACE, "no access to entry\n", 0,
210 text = "no write access to old entry";
211 rc = LDAP_INSUFFICIENT_ACCESS;
215 if (!manageDSAit && is_entry_referral( e ) ) {
216 /* parent is a referral, don't allow add */
217 /* parent is an alias, don't allow add */
218 BerVarray refs = get_entry_referrals( be,
222 LDAP_LOG ( OPERATION, DETAIL1,
223 "==>bdb_modrdn: entry %s is referral \n", e->e_dn, 0, 0 );
225 Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: entry %s is referral\n",
229 send_ldap_result( conn, op, rc = LDAP_REFERRAL,
230 e->e_dn, NULL, refs, NULL );
232 ber_bvarray_free( refs );
236 if ( be_issuffix( be, &e->e_nname ) ) {
237 p_ndn = slap_empty_bv;
239 dnParent( &e->e_nname, &p_ndn );
242 if ( p_ndn.bv_len != 0 ) {
243 /* Make sure parent entry exist and we can write its
246 rc = bdb_dn2entry_r( be, ltid, &p_ndn, &p, NULL, 0, locker, &lock );
252 case DB_LOCK_DEADLOCK:
253 case DB_LOCK_NOTGRANTED:
256 text = "ldap server busy";
260 text = "internal error";
266 LDAP_LOG ( OPERATION, ERR,
267 "==>bdb_modrdn: parent does not exist\n", 0, 0, 0 );
269 Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: parent does not exist\n",
273 text = "old entry's parent does not exist";
277 /* check parent for "children" acl */
278 rc = access_allowed( be, conn, op, p,
279 children, NULL, ACL_WRITE, NULL );
281 switch( opinfo.boi_err ) {
282 case DB_LOCK_DEADLOCK:
283 case DB_LOCK_NOTGRANTED:
288 rc = LDAP_INSUFFICIENT_ACCESS;
290 LDAP_LOG ( OPERATION, ERR,
291 "==>bdb_modrdn: no access to parent\n", 0, 0, 0 );
293 Debug( LDAP_DEBUG_TRACE, "no access to parent\n", 0,
296 text = "no write access to old parent's children";
301 LDAP_LOG ( OPERATION, DETAIL1,
302 "==>bdb_modrdn: wr to children %s is OK\n", p_ndn.bv_val, 0, 0 );
304 Debug( LDAP_DEBUG_TRACE,
305 "bdb_modrdn: wr to children of entry %s OK\n",
306 p_ndn.bv_val, 0, 0 );
309 if ( p_ndn.bv_val == slap_empty_bv.bv_val ) {
310 p_dn = slap_empty_bv;
312 dnParent( &e->e_name, &p_dn );
316 LDAP_LOG ( OPERATION, DETAIL1,
317 "==>bdb_modrdn: parent dn=%s\n", p_dn.bv_val, 0, 0 );
319 Debug( LDAP_DEBUG_TRACE,
320 "bdb_modrdn: parent dn=%s\n",
325 /* no parent, modrdn entry directly under root */
326 isroot = be_isroot( be, &op->o_ndn );
328 if ( be_issuffix( be, (struct berval *)&slap_empty_bv )
329 || be_isupdate( be, &op->o_ndn ) ) {
331 p = (Entry *)&slap_entry_root;
333 /* check parent for "children" acl */
334 rc = access_allowed( be, conn, op, p,
335 children, NULL, ACL_WRITE, NULL );
337 switch( opinfo.boi_err ) {
338 case DB_LOCK_DEADLOCK:
339 case DB_LOCK_NOTGRANTED:
346 rc = LDAP_INSUFFICIENT_ACCESS;
348 LDAP_LOG ( OPERATION, ERR,
349 "==>bdb_modrdn: no access to parent\n", 0, 0, 0 );
351 Debug( LDAP_DEBUG_TRACE,
352 "no access to parent\n",
355 text = "no write access to old parent";
360 LDAP_LOG ( OPERATION, DETAIL1,
361 "==>bdb_modrdn: wr to children of entry \"%s\" OK\n",
364 Debug( LDAP_DEBUG_TRACE,
365 "bdb_modrdn: wr to children of entry \"\" OK\n",
373 LDAP_LOG ( OPERATION, DETAIL1,
374 "==>bdb_modrdn: parent dn=\"\" \n", 0, 0, 0 );
376 Debug( LDAP_DEBUG_TRACE,
377 "bdb_modrdn: parent dn=\"\"\n",
383 LDAP_LOG ( OPERATION, ERR,
384 "==>bdb_modrdn: no parent, not root &\"\" is not "
385 "suffix\n", 0, 0, 0 );
387 Debug( LDAP_DEBUG_TRACE,
388 "bdb_modrdn: no parent, not root "
389 "& \"\" is not suffix\n",
392 text = "no write access to old parent";
393 rc = LDAP_INSUFFICIENT_ACCESS;
399 new_parent_dn = &p_dn; /* New Parent unless newSuperior given */
401 if ( newSuperior != NULL ) {
403 LDAP_LOG ( OPERATION, DETAIL1,
404 "==>bdb_modrdn: new parent \"%s\" requested...\n",
405 newSuperior->bv_val, 0, 0 );
407 Debug( LDAP_DEBUG_TRACE,
408 "bdb_modrdn: new parent \"%s\" requested...\n",
409 newSuperior->bv_val, 0, 0 );
412 /* newSuperior == oldParent? */
413 if( dn_match( &p_ndn, nnewSuperior ) ) {
415 LDAP_LOG( BACK_LDBM, INFO, "bdb_back_modrdn: "
416 "new parent \"%s\" same as the old parent \"%s\"\n",
417 newSuperior->bv_val, p_dn.bv_val, 0 );
419 Debug( LDAP_DEBUG_TRACE, "bdb_back_modrdn: "
420 "new parent \"%s\" same as the old parent \"%s\"\n",
421 newSuperior->bv_val, p_dn.bv_val, 0 );
423 newSuperior = NULL; /* ignore newSuperior */
427 if ( newSuperior != NULL ) {
428 if ( newSuperior->bv_len ) {
430 np_ndn = nnewSuperior;
432 /* newSuperior == oldParent?, if so ==> ERROR */
433 /* newSuperior == entry being moved?, if so ==> ERROR */
434 /* Get Entry with dn=newSuperior. Does newSuperior exist? */
436 rc = bdb_dn2entry_r( be,
437 ltid, nnewSuperior, &np, NULL, 0, locker, &lock );
443 case DB_LOCK_DEADLOCK:
444 case DB_LOCK_NOTGRANTED:
447 text = "ldap server busy";
451 text = "internal error";
457 LDAP_LOG ( OPERATION, DETAIL1,
458 "==>bdb_modrdn: newSup(ndn=%s) not here!\n",
459 np_ndn->bv_val, 0, 0 );
461 Debug( LDAP_DEBUG_TRACE,
462 "bdb_modrdn: newSup(ndn=%s) not here!\n",
463 np_ndn->bv_val, 0, 0);
465 text = "new superior not found";
471 LDAP_LOG ( OPERATION, DETAIL1,
472 "==>bdb_modrdn: wr to new parent OK np=%p, id=%ld\n",
473 np, (long) np->e_id, 0 );
475 Debug( LDAP_DEBUG_TRACE,
476 "bdb_modrdn: wr to new parent OK np=%p, id=%ld\n",
477 np, (long) np->e_id, 0 );
480 /* check newSuperior for "children" acl */
481 rc = access_allowed( be, conn, op, np, children,
482 NULL, ACL_WRITE, NULL );
484 switch( opinfo.boi_err ) {
485 case DB_LOCK_DEADLOCK:
486 case DB_LOCK_NOTGRANTED:
492 LDAP_LOG ( OPERATION, DETAIL1,
493 "==>bdb_modrdn: no wr to newSup children\n", 0, 0, 0 );
495 Debug( LDAP_DEBUG_TRACE,
496 "bdb_modrdn: no wr to newSup children\n",
499 text = "no write access to new superior's children";
500 rc = LDAP_INSUFFICIENT_ACCESS;
505 if ( is_entry_alias( np ) ) {
506 /* parent is an alias, don't allow add */
508 LDAP_LOG ( OPERATION, DETAIL1,
509 "==>bdb_modrdn: entry is alias\n", 0, 0, 0 );
511 Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: entry is alias\n",
514 text = "new superior is an alias";
515 rc = LDAP_ALIAS_PROBLEM;
520 if ( is_entry_referral( np ) ) {
521 /* parent is a referral, don't allow add */
523 LDAP_LOG ( OPERATION, DETAIL1,
524 "==>bdb_modrdn: entry is referral\n", 0, 0, 0 );
526 Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: entry is referral\n",
529 text = "new superior is a referral";
535 if ( isroot == -1 ) {
536 isroot = be_isroot( be, &op->o_ndn );
541 /* no parent, modrdn entry directly under root */
543 if ( be_issuffix( be, (struct berval *)&slap_empty_bv )
544 || be_isupdate( be, &op->o_ndn ) ) {
545 np = (Entry *)&slap_entry_root;
547 /* check parent for "children" acl */
548 rc = access_allowed( be, conn, op, np,
549 children, NULL, ACL_WRITE, NULL );
551 switch( opinfo.boi_err ) {
552 case DB_LOCK_DEADLOCK:
553 case DB_LOCK_NOTGRANTED:
560 rc = LDAP_INSUFFICIENT_ACCESS;
562 LDAP_LOG ( OPERATION, ERR,
563 "==>bdb_modrdn: no access to superior\n", 0, 0, 0 );
565 Debug( LDAP_DEBUG_TRACE,
566 "no access to new superior\n",
569 text = "no write access to new superior's children";
574 LDAP_LOG ( OPERATION, DETAIL1,
575 "bdb_modrdn: wr to children entry \"\" OK\n", 0, 0, 0 );
577 Debug( LDAP_DEBUG_TRACE,
578 "bdb_modrdn: wr to children of entry \"\" OK\n",
584 LDAP_LOG ( OPERATION, ERR,
585 "bdb_modrdn: new superior=\"\", not root & \"\" "
586 "is not suffix\n", 0, 0, 0 );
588 Debug( LDAP_DEBUG_TRACE,
589 "bdb_modrdn: new superior=\"\", not root "
590 "& \"\" is not suffix\n",
593 text = "no write access to new superior's children";
594 rc = LDAP_INSUFFICIENT_ACCESS;
600 LDAP_LOG ( OPERATION, DETAIL1,
601 "bdb_modrdn: new superior=\"\"\n", 0, 0, 0 );
603 Debug( LDAP_DEBUG_TRACE,
604 "bdb_modrdn: new superior=\"\"\n",
610 LDAP_LOG ( OPERATION, DETAIL1,
611 "bdb_modrdn: wr to new parent's children OK\n", 0, 0, 0 );
613 Debug( LDAP_DEBUG_TRACE,
614 "bdb_modrdn: wr to new parent's children OK\n",
618 new_parent_dn = np_dn;
621 /* Build target dn and make sure target entry doesn't exist already. */
622 build_new_dn( &new_dn, new_parent_dn, newrdn );
624 dnNormalize2( NULL, &new_dn, &new_ndn );
627 LDAP_LOG ( OPERATION, RESULTS,
628 "bdb_modrdn: new ndn=%s\n", new_ndn.bv_val, 0, 0 );
630 Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: new ndn=%s\n",
631 new_ndn.bv_val, 0, 0 );
634 rc = bdb_dn2id ( be, ltid, &new_ndn, &id, 0 );
636 case DB_LOCK_DEADLOCK:
637 case DB_LOCK_NOTGRANTED:
642 rc = LDAP_ALREADY_EXISTS;
646 text = "internal error";
651 LDAP_LOG ( OPERATION, ERR,
652 "bdb_modrdn: new ndn=%s does not exist\n", new_ndn.bv_val, 0, 0 );
654 Debug( LDAP_DEBUG_TRACE,
655 "bdb_modrdn: new ndn=%s does not exist\n",
656 new_ndn.bv_val, 0, 0 );
659 /* Get attribute type and attribute value of our new rdn, we will
660 * need to add that to our new entry
662 if ( ldap_bv2rdn( newrdn, &new_rdn, (char **)&text,
663 LDAP_DN_FORMAT_LDAP ) )
666 LDAP_LOG ( OPERATION, ERR,
667 "bdb_modrdn: can't figure out "
668 "type(s)/values(s) of newrdn\n",
671 Debug( LDAP_DEBUG_TRACE,
672 "bdb_modrdn: can't figure out "
673 "type(s)/values(s) of newrdn\n",
676 rc = LDAP_INVALID_DN_SYNTAX;
677 text = "unknown type(s) used in RDN";
682 LDAP_LOG ( OPERATION, RESULTS,
683 "bdb_modrdn: new_rdn_type=\"%s\", "
684 "new_rdn_val=\"%s\"\n",
685 new_rdn[ 0 ][ 0 ]->la_attr.bv_val,
686 new_rdn[ 0 ][ 0 ]->la_value.bv_val, 0 );
688 Debug( LDAP_DEBUG_TRACE,
689 "bdb_modrdn: new_rdn_type=\"%s\", "
690 "new_rdn_val=\"%s\"\n",
691 new_rdn[ 0 ][ 0 ]->la_attr.bv_val,
692 new_rdn[ 0 ][ 0 ]->la_value.bv_val, 0 );
695 if ( deleteoldrdn ) {
696 if ( ldap_bv2rdn( dn, &old_rdn, (char **)&text,
697 LDAP_DN_FORMAT_LDAP ) )
700 LDAP_LOG ( OPERATION, ERR,
701 "bdb_modrdn: can't figure out "
702 "type(s)/values(s) of old_rdn\n",
705 Debug( LDAP_DEBUG_TRACE,
706 "bdb_modrdn: can't figure out "
707 "the old_rdn type(s)/value(s)\n",
711 text = "cannot parse RDN from old DN";
716 /* prepare modlist of modifications from old/new rdn */
717 rc = slap_modrdn2mods( be, conn, op, e, old_rdn, new_rdn,
718 deleteoldrdn, &mod );
719 if ( rc != LDAP_SUCCESS ) {
724 rc = bdb_dn2id_delete( be, ltid, p_ndn.bv_val, e );
727 case DB_LOCK_DEADLOCK:
728 case DB_LOCK_NOTGRANTED:
732 text = "DN index delete fail";
736 (void) bdb_cache_delete_entry(&bdb->bi_cache, e);
738 /* Binary format uses a single contiguous block, cannot
739 * free individual fields. Leave new_dn/new_ndn set so
740 * they can be individually freed later.
743 e->e_nname = new_ndn;
745 new_dn.bv_val = NULL;
746 new_ndn.bv_val = NULL;
749 rc = bdb_dn2id_add( be, ltid, np_ndn, e );
752 case DB_LOCK_DEADLOCK:
753 case DB_LOCK_NOTGRANTED:
757 text = "DN index add failed";
761 #if defined(LDAP_CLIENT_UPDATE) || defined(LDAP_SYNC)
762 if ( rc == LDAP_SUCCESS && !op->o_noop ) {
763 LDAP_LIST_FOREACH ( ps_list, &bdb->psearch_list, link ) {
764 bdb_psearch(be, conn, op, ps_list, e, LDAP_PSEARCH_BY_PREMODIFY );
770 rc = bdb_modify_internal( be, conn, op, ltid, &mod[0], e,
771 &text, textbuf, textlen );
773 if( rc != LDAP_SUCCESS ) {
775 case DB_LOCK_DEADLOCK:
776 case DB_LOCK_NOTGRANTED:
783 rc = bdb_id2entry_update( be, ltid, e );
786 case DB_LOCK_DEADLOCK:
787 case DB_LOCK_NOTGRANTED:
791 text = "entry update failed";
796 if(( rc=TXN_ABORT( ltid )) != 0 ) {
797 text = "txn_abort (no-op) failed";
804 char gid[DB_XIDDATASIZE];
806 snprintf( gid, sizeof( gid ), "%s-%08lx-%08lx",
807 bdb_uuid.bv_val, (long) op->o_connid, (long) op->o_opid );
809 if(( rc=TXN_PREPARE( ltid, gid )) != 0 ) {
810 text = "txn_prepare failed";
812 if( bdb_cache_update_entry(&bdb->bi_cache, e) == -1 ) {
813 if(( rc=TXN_ABORT( ltid )) != 0 ) {
814 text ="cache update & txn_abort failed";
817 text = "cache update failed";
821 if(( rc=TXN_COMMIT( ltid, 0 )) != 0 ) {
822 text = "txn_commit failed";
831 op->o_private = NULL;
833 if( rc == LDAP_SUCCESS ) {
835 LDAP_LOG ( OPERATION, RESULTS,
836 "bdb_modrdn: rdn modified%s id=%08lx dn=\"%s\"\n",
837 op->o_noop ? " (no-op)" : "", e->e_id, e->e_dn );
839 Debug(LDAP_DEBUG_TRACE,
840 "bdb_modrdn: rdn modified%s id=%08lx dn=\"%s\"\n",
841 op->o_noop ? " (no-op)" : "", e->e_id, e->e_dn );
845 bdb_cache_entry_commit( e );
850 LDAP_LOG ( OPERATION, RESULTS, "bdb_modrdn: %s : %s (%d)\n",
851 text, db_strerror(rc), rc );
853 Debug( LDAP_DEBUG_TRACE, "bdb_add: %s : %s (%d)\n",
854 text, db_strerror(rc), rc );
860 send_ldap_result( conn, op, rc,
861 NULL, text, NULL, NULL );
863 #if defined(LDAP_CLIENT_UPDATE) || defined(LDAP_SYNC)
864 if ( rc == LDAP_SUCCESS && !op->o_noop ) {
865 /* Loop through in-scope entries for each psearch spec */
866 LDAP_LIST_FOREACH ( ps_list, &bdb->psearch_list, link ) {
867 bdb_psearch( be, conn, op, ps_list, e, LDAP_PSEARCH_BY_MODIFY );
869 pm_list = LDAP_LIST_FIRST(&op->premodify_list);
870 while ( pm_list != NULL ) {
871 bdb_psearch(be, conn, op, pm_list->ps->op,
872 e, LDAP_PSEARCH_BY_SCOPEOUT);
873 LDAP_LIST_REMOVE ( pm_list, link );
875 pm_list = LDAP_LIST_NEXT ( pm_list, link );
881 if( rc == LDAP_SUCCESS && bdb->bi_txn_cp ) {
882 ldap_pvt_thread_yield();
883 TXN_CHECKPOINT( bdb->bi_dbenv,
884 bdb->bi_txn_cp_kbyte, bdb->bi_txn_cp_min, 0 );
888 if( new_dn.bv_val != NULL ) free( new_dn.bv_val );
889 if( new_ndn.bv_val != NULL ) free( new_ndn.bv_val );
891 /* LDAP v2 supporting correct attribute handling. */
892 if ( new_rdn != NULL ) {
893 ldap_rdnfree( new_rdn );
895 if ( old_rdn != NULL ) {
896 ldap_rdnfree( old_rdn );
900 for (; mod; mod=tmp ) {
906 /* LDAP v3 Support */
908 /* free new parent and reader lock */
909 bdb_unlocked_cache_return_entry_r(&bdb->bi_cache, np);
913 /* free parent and reader lock */
914 bdb_unlocked_cache_return_entry_r(&bdb->bi_cache, p);
919 bdb_unlocked_cache_return_entry_w( &bdb->bi_cache, e);
923 #if defined(LDAP_CLIENT_UPDATE) || defined(LDAP_SYNC)
924 pm_list = LDAP_LIST_FIRST(&op->premodify_list);
925 while ( pm_list != NULL ) {
926 LDAP_LIST_REMOVE ( pm_list, link );
928 pm_list = LDAP_LIST_NEXT ( pm_list, link );
933 op->o_private = NULL;
936 return ( ( rc == LDAP_SUCCESS ) ? noop : rc );