s4-dsdb: allow uninstantiated NC heads
authorAndrew Tridgell <tridge@samba.org>
Tue, 27 Sep 2011 23:29:09 +0000 (09:29 +1000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 4 Oct 2011 04:08:56 +0000 (15:08 +1100)
this allows INSTANCE_TYPE_WRITE to be not set if
INSTANCE_TYPE_UNINSTANT is set

source4/dsdb/samdb/ldb_modules/instancetype.c

index e008deb02b39d08df2ab395d7ca7d2fc8ffe9163..d743d4fb30ec72d4b716a21f145c167fc889a697 100644 (file)
@@ -77,9 +77,11 @@ static int instancetype_add(struct ldb_module *module, struct ldb_request *req)
                } else {
                        /*
                         * If we have a NC add operation then we need also the
-                        * "TYPE_WRITE" flag in order to succeed.
+                        * "TYPE_WRITE" flag in order to succeed,
+                        * unless this NC is not instantiated
                        */
-                       if (!(instanceType & INSTANCE_TYPE_WRITE)) {
+                       if (!(instanceType & INSTANCE_TYPE_UNINSTANT) &&
+                           !(instanceType & INSTANCE_TYPE_WRITE)) {
                                ldb_set_errstring(ldb, "instancetype: if TYPE_IS_NC_HEAD was set, then also TYPE_WRITE is requested!");
                                return LDB_ERR_UNWILLING_TO_PERFORM;
                        }