From 29320bc6e0f364047686b76f26dbd8135ab87377 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 2 Sep 2009 16:55:57 +1000 Subject: add the partition_control control to replication requests We know the partition DN from the DRS objects, we need to pass this down the modules below us to ensure they operate on the right partition --- source4/dsdb/samdb/ldb_modules/repl_meta_data.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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; -- cgit