summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/dsdb/samdb/ldb_modules/repl_meta_data.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
index 4508882dd5..822bcb3468 100644
--- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
+++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
@@ -1423,6 +1423,7 @@ static int replmd_extended_replicated_objects(struct ldb_module *module, struct
struct replmd_replicated_request *ar;
struct ldb_control **ctrls;
int ret;
+ struct dsdb_control_current_partition *partition_ctrl;
ldb = ldb_module_get_ctx(module);
@@ -1465,6 +1466,27 @@ static int replmd_extended_replicated_objects(struct ldb_module *module, struct
return ret;
}
+ /*
+ add the DSDB_CONTROL_CURRENT_PARTITION_OID control. This
+ tells the partition module which partition this request is
+ directed at. That is important as the partition roots appear
+ twice in the directory, once as mount points in the top
+ level store, and once as the roots of each partition. The
+ replication code wants to operate on the root of the
+ partitions, not the top level mount points
+ */
+ partition_ctrl = talloc(req, struct dsdb_control_current_partition);
+ if (partition_ctrl == NULL) {
+ if (!partition_ctrl) return replmd_replicated_request_werror(ar, WERR_NOMEM);
+ }
+ partition_ctrl->version = DSDB_CONTROL_CURRENT_PARTITION_VERSION;
+ partition_ctrl->dn = objs->partition_dn;
+
+ ret = ldb_request_add_control(req, DSDB_CONTROL_CURRENT_PARTITION_OID, false, partition_ctrl);
+ if (ret != LDB_SUCCESS) {
+ return ret;
+ }
+
ar->controls = req->controls;
req->controls = ctrls;