summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-04-26 15:46:37 +1000
committerAndrew Tridgell <tridge@samba.org>2010-04-26 19:06:07 +1000
commit5ce1dbf2e328b8bf9987746bbd9ea10e6db58760 (patch)
tree3c4f5c0ecc16a7faad7c25002e4194de46803a30 /source4/dsdb/samdb/ldb_modules
parenta31c711ba7dcd7516fd7b4de8c602a2fc30672db (diff)
downloadsamba-5ce1dbf2e328b8bf9987746bbd9ea10e6db58760.tar.gz
samba-5ce1dbf2e328b8bf9987746bbd9ea10e6db58760.tar.bz2
samba-5ce1dbf2e328b8bf9987746bbd9ea10e6db58760.zip
s4-ddb: don't create partitions with the UNINSTANT flag set
these partitions and not on the server we are replicating from. Also check for deleted partitions. Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules')
-rw-r--r--source4/dsdb/samdb/ldb_modules/new_partition.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/new_partition.c b/source4/dsdb/samdb/ldb_modules/new_partition.c
index 47394f4e06..a7de846f6c 100644
--- a/source4/dsdb/samdb/ldb_modules/new_partition.c
+++ b/source4/dsdb/samdb/ldb_modules/new_partition.c
@@ -154,7 +154,20 @@ static int new_partition_add(struct ldb_module *module, struct ldb_request *req)
/* This needs to be 'static' to ensure it does not move, and is not on the stack */
static const char *no_attrs[] = { NULL };
unsigned int instanceType = ldb_msg_find_attr_as_uint(req->op.add.message, "instanceType", 0);
- if (!(instanceType & INSTANCE_TYPE_IS_NC_HEAD)) {
+ if (!(instanceType & INSTANCE_TYPE_IS_NC_HEAD) ||
+ (instanceType & INSTANCE_TYPE_UNINSTANT)) {
+ return ldb_next_request(module, req);
+ }
+
+ if (instanceType & INSTANCE_TYPE_UNINSTANT) {
+ DEBUG(0,(__location__ ": Skipping uninstantiated partition %s\n",
+ ldb_dn_get_linearized(req->op.add.message->dn)));
+ return ldb_next_request(module, req);
+ }
+
+ if (ldb_msg_find_attr_as_bool(req->op.add.message, "isDeleted", false)) {
+ DEBUG(0,(__location__ ": Skipping deleted partition %s\n",
+ ldb_dn_get_linearized(req->op.add.message->dn)));
return ldb_next_request(module, req);
}