s4:new_partition LDB module - splitting up an "if" operation
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Sat, 5 Mar 2011 16:15:55 +0000 (17:15 +0100)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Thu, 10 Mar 2011 10:12:05 +0000 (11:12 +0100)
- let the first "if" in place
- uninstantiated partitions are handled by the second "if" (previously
  they have been handled twice)

Has been corrected by request of tridge.

source4/dsdb/samdb/ldb_modules/new_partition.c

index 59743cd765428338c4a9d03994334d95cac1ebb6..3d94bbed816ae74102bd0a1008747a31bc257d56 100644 (file)
@@ -150,9 +150,9 @@ static int new_partition_add(struct ldb_module *module, struct ldb_request *req)
        if (ldb_msg_find_element(req->op.add.message, "instanceType")) {
                /* 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) ||
-                   (instanceType & INSTANCE_TYPE_UNINSTANT)) {
+               uint32_t instanceType = ldb_msg_find_attr_as_uint(req->op.add.message, "instanceType", 0);
+
+               if (!(instanceType & INSTANCE_TYPE_IS_NC_HEAD)) {
                        return ldb_next_request(module, req);
                }