dsdb:repl_meta_data: allow CONTROL_DBCHECK_FIX_LINK_DN_NAME to by pass rename
authorStefan Metzmacher <metze@samba.org>
Mon, 11 Mar 2019 21:38:38 +0000 (22:38 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 14 Mar 2019 02:12:19 +0000 (02:12 +0000)
We need a way to rename an object without updating the replication meta
data.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13816

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/samdb/ldb_modules/repl_meta_data.c

index 754f909467a7dba55c9fefc0174b294153266c83..7440e9b50f18fd893f97f2f3a40b845b2b7434d2 100644 (file)
@@ -3741,6 +3741,7 @@ static int replmd_rename_callback(struct ldb_request *req, struct ldb_reply *are
 static int replmd_rename(struct ldb_module *module, struct ldb_request *req)
 {
        struct ldb_context *ldb;
+       struct ldb_control *fix_dn_name_control = NULL;
        struct replmd_replicated_request *ac;
        int ret;
        struct ldb_request *down_req;
@@ -3750,6 +3751,12 @@ static int replmd_rename(struct ldb_module *module, struct ldb_request *req)
                return ldb_next_request(module, req);
        }
 
+       fix_dn_name_control = ldb_request_get_control(req,
+                                       DSDB_CONTROL_DBCHECK_FIX_LINK_DN_NAME);
+       if (fix_dn_name_control != NULL) {
+               return ldb_next_request(module, req);
+       }
+
        ldb = ldb_module_get_ctx(module);
 
        ldb_debug(ldb, LDB_DEBUG_TRACE, "replmd_rename\n");