summaryrefslogtreecommitdiff
path: root/source4/dsdb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-09-02 16:55:57 +1000
committerAndrew Tridgell <tridge@samba.org>2009-09-02 18:19:55 +1000
commit29320bc6e0f364047686b76f26dbd8135ab87377 (patch)
tree3dfbe415b482ee4e52ea91d0e3ebaaf1236ea53e /source4/dsdb
parent79255a9384e16a37602028fb0960acf9fc1eb257 (diff)
downloadsamba-29320bc6e0f364047686b76f26dbd8135ab87377.tar.gz
samba-29320bc6e0f364047686b76f26dbd8135ab87377.tar.bz2
samba-29320bc6e0f364047686b76f26dbd8135ab87377.zip
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
Diffstat (limited to 'source4/dsdb')
-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;