summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/partition_init.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-09-28 11:04:29 +1000
committerAndrew Tridgell <tridge@samba.org>2011-10-04 15:08:57 +1100
commit60cbc98051b430fc09358a09866c69a54cc726bc (patch)
tree7b8568e7fbc1b1b32396ba537d952192f55631ff /source4/dsdb/samdb/ldb_modules/partition_init.c
parentfb937afbecb61896e8e8e56c19bbc193fc573e15 (diff)
downloadsamba-60cbc98051b430fc09358a09866c69a54cc726bc.tar.gz
samba-60cbc98051b430fc09358a09866c69a54cc726bc.tar.bz2
samba-60cbc98051b430fc09358a09866c69a54cc726bc.zip
s4-dsdb: added new control DSDB_MODIFY_PARTIAL_REPLICA
this control tells the partition module that the DN being created is a partial replica, so it should modify the @PARTITION object to add the partialReplica attribute Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/partition_init.c')
-rw-r--r--source4/dsdb/samdb/ldb_modules/partition_init.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/partition_init.c b/source4/dsdb/samdb/ldb_modules/partition_init.c
index 0dd3a472c2..030f592d3a 100644
--- a/source4/dsdb/samdb/ldb_modules/partition_init.c
+++ b/source4/dsdb/samdb/ldb_modules/partition_init.c
@@ -770,6 +770,18 @@ int partition_create(struct ldb_module *module, struct ldb_request *req)
if (ret != LDB_SUCCESS) {
return ret;
}
+
+ if (ldb_request_get_control(req, DSDB_CONTROL_PARTIAL_REPLICA)) {
+ /* this new partition is a partial replica */
+ ret = ldb_msg_add_empty(mod_msg, "partialReplica", LDB_FLAG_MOD_ADD, NULL);
+ if (ret != LDB_SUCCESS) {
+ return ret;
+ }
+ ret = ldb_msg_add_fmt(mod_msg, "partialReplica", "%s", ldb_dn_get_linearized(dn));
+ if (ret != LDB_SUCCESS) {
+ return ret;
+ }
+ }
/* Perform modify on @PARTITION record */
ret = ldb_build_mod_req(&mod_req, ldb, req, mod_msg, NULL, NULL,