From 5ce1dbf2e328b8bf9987746bbd9ea10e6db58760 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 26 Apr 2010 15:46:37 +1000 Subject: 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 --- source4/dsdb/samdb/ldb_modules/new_partition.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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); } -- cgit