return LDB_ERR_OPERATIONS_ERROR;
}
- ret = replmd_add_backlink(module, schema, guid, &target_guid, true, sa, true);
+ ret = replmd_add_backlink(module, schema, guid, &target_guid, true, sa, false);
if (ret != LDB_SUCCESS) {
talloc_free(tmp_ctx);
return ret;
return LDB_ERR_OPERATIONS_ERROR;
}
- /* New DN name generated, renaming the original DN */
- ret = dsdb_module_rename(module, old_dn, new_dn, 0);
- if (ret != LDB_SUCCESS){
- DEBUG(0,(__location__ ": Failed to rename object from '%s' to '%s'\n",
- ldb_dn_get_linearized(old_dn),
- ldb_dn_get_linearized(new_dn)));
- talloc_free(tmp_ctx);
- return ret;
- }
-
/*
now we need to modify the object in the following ways:
return LDB_ERR_OPERATIONS_ERROR;
}
- msg->dn = new_dn;
+ msg->dn = old_dn;
ret = ldb_msg_add_string(msg, "isDeleted", "TRUE");
if (ret != LDB_SUCCESS) {
return ret;
}
+ /* now rename onto the new DN */
+ ret = dsdb_module_rename(module, old_dn, new_dn, 0);
+ if (ret != LDB_SUCCESS){
+ DEBUG(0,(__location__ ": Failed to rename object from '%s' to '%s' - %s\n",
+ ldb_dn_get_linearized(old_dn),
+ ldb_dn_get_linearized(new_dn),
+ ldb_errstring(ldb)));
+ talloc_free(tmp_ctx);
+ return ret;
+ }
+
talloc_free(tmp_ctx);
return ldb_module_done(req, NULL, NULL, LDB_SUCCESS);