From: Jong Hyuk Choi Date: Tue, 15 Jul 2003 00:33:49 +0000 (+0000) Subject: SyncRepl updates for back-bdb / back-ldbm X-Git-Tag: OPENLDAP_REL_ENG_2_1_MP~823 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b3e62ef604ea36d1bd91f19cc47066b88a975d29;p=openldap SyncRepl updates for back-bdb / back-ldbm --- diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index ef8de6149f..81f726ac35 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -976,7 +976,7 @@ syncrepl_entry( cb.sc_response = dn_callback; cb.sc_private = si; - be->be_search( op, &rs ); + rc = be->be_search( op, &rs ); ch_free( op->o_req_dn.bv_val ); ch_free( op->o_req_ndn.bv_val ); @@ -986,15 +986,17 @@ syncrepl_entry( cb.sc_response = null_callback; cb.sc_private = si; - rc = LDAP_SUCCESS; - - if ( si->syncUUID_ndn ) { + if ( rc == LDAP_SUCCESS && si->syncUUID_ndn ) { op->o_req_dn = *si->syncUUID_ndn; op->o_req_ndn = *si->syncUUID_ndn; op->o_tag = LDAP_REQ_DELETE; rc = be->be_delete( op, &rs ); } + if ( si->syncUUID_ndn ) { + ber_bvfree( si->syncUUID_ndn ); + } + switch ( syncstate ) { case LDAP_SYNC_ADD : case LDAP_SYNC_MODIFY : @@ -1044,6 +1046,7 @@ syncrepl_entry( } } else { si->e = NULL; + be_entry_release_w( op, e ); return 0; } } else { @@ -1392,6 +1395,12 @@ syncrepl_updateCookie( rc = slap_mods_opattrs( op, modlist, modtail, &text,txtbuf, textlen ); + for ( ml = modlist; ml != NULL; ml = mlnext ) { + mlnext = ml->sml_next; + if ( ml->sml_desc == slap_schema.si_ad_structuralObjectClass ) + ml->sml_op = LDAP_MOD_REPLACE; + } + if( rc != LDAP_SUCCESS ) { #ifdef NEW_LOGGING LDAP_LOG( OPERATION, ERR, @@ -1467,6 +1476,7 @@ update_cookie_retry: #endif } } else { + be_entry_release_w( op, e ); goto done; } } else { @@ -1535,7 +1545,7 @@ dn_callback( syncinfo_t *si = op->o_callback->sc_private; if ( rs->sr_type == REP_SEARCH ) { - si->syncUUID_ndn = &rs->sr_entry->e_nname; + si->syncUUID_ndn = ber_dupbv( NULL, &rs->sr_entry->e_nname ); } return LDAP_SUCCESS;