}
if ( rc_efree && entry ) {
entry_free( entry );
+ entry = NULL;
}
break;
return rc;
}
+static struct berval uuidbva[] = {
+ BER_BVNULL,
+ BER_BVNULL
+};
+
int
syncrepl_entry(
syncinfo_t* si,
int ret = LDAP_SUCCESS;
const char *text;
+ struct berval pdn = { 0, NULL };
+ struct berval org_req_dn = { 0, NULL };
+ struct berval org_req_ndn = { 0, NULL };
+ struct berval org_dn = { 0, NULL };
+ struct berval org_ndn = { 0, NULL };
+ int org_managedsait;
+
if (( syncstate == LDAP_SYNC_PRESENT || syncstate == LDAP_SYNC_ADD ))
{
syncuuid_bv = ber_dupbv( NULL, syncUUID );
syncUUID->bv_val, syncUUID->bv_len );
op->ors_filterstr.bv_val[op->ors_filterstr.bv_len] = '\0';
+ op->o_tag = LDAP_REQ_SEARCH;
op->ors_scope = LDAP_SCOPE_SUBTREE;
/* get syncrepl cookie of shadow replica from subentry */
si->si_syncUUID_ndn.bv_val = NULL;
- rc = be->be_search( op, &rs );
+ if ( limits_check( op, &rs ) == 0 ) {
+ rc = be->be_search( op, &rs );
+ }
if ( op->ors_filterstr.bv_val ) {
sl_free( op->ors_filterstr.bv_val, op->o_tmpmemctx );
op->o_req_ndn = si->si_syncUUID_ndn;
op->o_tag = LDAP_REQ_DELETE;
rc = be->be_delete( op, &rs );
+
+ org_req_dn = op->o_req_dn;
+ org_req_ndn = op->o_req_ndn;
+ org_dn = op->o_dn;
+ org_ndn = op->o_ndn;
+ org_managedsait = get_manageDSAit( op );
+ op->o_dn = op->o_bd->be_rootdn;
+ op->o_ndn = op->o_bd->be_rootndn;
+ op->o_managedsait = 1;
+
+ while ( rs.sr_err == LDAP_SUCCESS &&
+ op->o_delete_glue_parent ) {
+ op->o_delete_glue_parent = 0;
+ if ( !be_issuffix( op->o_bd, &op->o_req_ndn )) {
+ slap_callback cb = { NULL };
+ cb.sc_response = slap_null_cb;
+ dnParent( &op->o_req_ndn, &pdn );
+ op->o_req_dn = pdn;
+ op->o_req_ndn = pdn;
+ op->o_callback = &cb;
+ op->o_bd->be_delete( op, &rs );
+ } else {
+ break;
+ }
+ }
+
+ op->o_managedsait = org_managedsait;
+ op->o_dn = org_dn;
+ op->o_ndn = org_ndn;
+ op->o_req_dn = org_req_dn;
+ op->o_req_ndn = org_req_ndn;
+ op->o_delete_glue_parent = 0;
+
op->o_no_psearch = 0;
}
if ( rc != LDAP_SUCCESS ) {
if ( rc == LDAP_ALREADY_EXISTS ) {
+ Modifications *mod;
+ Modifications *modtail;
+
+ for ( mod = modlist; mod != NULL; mod = mod->sml_next ) {
+ modtail = mod;
+ }
+
+ mod = (Modifications *)ch_calloc(1, sizeof(Modifications));
+ ber_dupbv( &uuidbva[0], syncUUID );
+ mod->sml_op = LDAP_MOD_REPLACE;
+ mod->sml_desc = slap_schema.si_ad_entryUUID;
+ mod->sml_type = mod->sml_desc->ad_cname;
+ mod->sml_bvalues = uuidbva;
+ modtail->sml_next = mod;
+
op->o_tag = LDAP_REQ_MODIFY;
op->orm_modlist = modlist;
op->o_req_dn = e->e_name;
op->o_req_ndn = e->e_nname;
+
rc = be->be_modify( op, &rs );
if ( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
case LDAP_SYNC_DELETE :
/* Already deleted */
- ret = 1;
+ ret = 0;
goto done;
default :
Modifications **modtail = &modlist;
Attribute *attr;
+ struct berval pdn = { 0, NULL };
+ struct berval org_req_dn = { 0, NULL };
+ struct berval org_req_ndn = { 0, NULL };
+ struct berval org_dn = { 0, NULL };
+ struct berval org_ndn = { 0, NULL };
+ int org_managedsait;
+
op->o_req_dn = si->si_base;
op->o_req_ndn = si->si_base;
op->o_nocaching = 1;
op->o_managedsait = 0;
- be->be_search( op, &rs );
+
+ if ( limits_check( op, &rs ) == 0 ) {
+ be->be_search( op, &rs );
+ }
+
op->o_managedsait = 1;
op->o_nocaching = 0;
}
}
+ org_req_dn = op->o_req_dn;
+ org_req_ndn = op->o_req_ndn;
+ org_dn = op->o_dn;
+ org_ndn = op->o_ndn;
+ org_managedsait = get_manageDSAit( op );
+ op->o_dn = op->o_bd->be_rootdn;
+ op->o_ndn = op->o_bd->be_rootndn;
+ op->o_managedsait = 1;
+
+ while ( rs.sr_err == LDAP_SUCCESS &&
+ op->o_delete_glue_parent ) {
+ op->o_delete_glue_parent = 0;
+ if ( !be_issuffix( op->o_bd, &op->o_req_ndn )) {
+ slap_callback cb = { NULL };
+ cb.sc_response = slap_null_cb;
+ dnParent( &op->o_req_ndn, &pdn );
+ op->o_req_dn = pdn;
+ op->o_req_ndn = pdn;
+ op->o_callback = &cb;
+ /* give it a root privil ? */
+ op->o_bd->be_delete( op, &rs );
+ } else {
+ break;
+ }
+ }
+
+ op->o_managedsait = org_managedsait;
+ op->o_dn = org_dn;
+ op->o_ndn = org_ndn;
+ op->o_req_dn = org_req_dn;
+ op->o_req_ndn = org_req_ndn;
+ op->o_delete_glue_parent = 0;
+
ber_bvfree( np_prev->npe_name );
ber_bvfree( np_prev->npe_nname );
op->o_req_dn.bv_val = NULL;
if ( rs->sr_err != LDAP_SUCCESS &&
rs->sr_err != LDAP_REFERRAL &&
rs->sr_err != LDAP_ALREADY_EXISTS &&
- rs->sr_err != LDAP_NO_SUCH_OBJECT )
+ rs->sr_err != LDAP_NO_SUCH_OBJECT &&
+ rs->sr_err != LDAP_NOT_ALLOWED_ON_NONLEAF )
{
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ERR,