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)
committerKarolin Seeger <kseeger@samba.org>
Tue, 2 Apr 2019 09:10:51 +0000 (09:10 +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>
(cherry picked from commit 3e8a435d27da899d0e3dab7cbc0a1c738067eba3)

source4/dsdb/samdb/ldb_modules/repl_meta_data.c

index cfa63af706690befa2886e22aa1e20f5ce62c485..3f00dcb06c949c9a9c7da636adc3a58c4ebb54bc 100644 (file)
@@ -3758,6 +3758,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;
@@ -3767,6 +3768,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");