struct sync_cookie * );
static struct berval * slap_uuidstr_from_normalized(
struct berval *, struct berval *, void * );
+static int syncrepl_add_glue_ancestors(
+ Operation* op, Entry *e );
/* callback functions */
static int dn_callback( Operation *, SlapReply * );
mod->sml_next = m2;
}
op->o_bd = si->si_wbe;
+retry_modrdn:;
rc = op->o_bd->be_modrdn( op, &rs_modify );
+
+ /* NOTE: noSuchObject should result because the new superior
+ * has not been added yet (ITS#6472) */
+ if ( rc == LDAP_NO_SUCH_OBJECT && !BER_BVISNULL( op->orr_nnewSup )) {
+ rc = syncrepl_add_glue_ancestors( op, entry );
+ if ( rc == LDAP_SUCCESS ) {
+ goto retry_modrdn;
+ }
+ }
+
op->o_tmpfree( op->orr_nnewrdn.bv_val, op->o_tmpmemctx );
op->o_tmpfree( op->orr_newrdn.bv_val, op->o_tmpmemctx );
return;
}
-int
-syncrepl_add_glue(
+static int
+syncrepl_add_glue_ancestors(
Operation* op,
Entry *e )
{
ndn.bv_len = e->e_nname.bv_len - (ndn.bv_val - e->e_nname.bv_val);
}
+ return rc;
+}
+
+int
+syncrepl_add_glue(
+ Operation* op,
+ Entry *e )
+{
+ int rc;
+ Backend *be = op->o_bd;
+ SlapReply rs_add = {REP_RESULT};
+
+ rc = syncrepl_add_glue_ancestors( op, e );
+ if ( rc != LDAP_SUCCESS ) {
+ return rc;
+ }
+
op->o_req_dn = e->e_name;
op->o_req_ndn = e->e_nname;
op->ora_e = e;