diff options
author | Andrew Bartlett <abartlet@samba.org> | 2014-08-08 19:26:46 +1200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2014-09-01 00:36:42 +0200 |
commit | c9f613f60ddf61f27ff67a7bbef8b93022099335 (patch) | |
tree | c4abbef7e17542841a0e854f656862ca51d5de5c | |
parent | 204337f454d1225fb7bf8525448000f2c30e0011 (diff) | |
download | samba-c9f613f60ddf61f27ff67a7bbef8b93022099335.tar.gz |
dsdb: Permit creation of partitions of type INSTANCE_TYPE_UNINSTANT
This is only allowed when we are creating the objects from a DsAddEntry call, not over LDAP.
Change-Id: Ieec6b07556d58741ec04fede8bf9940811f12a62
Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-By: Jelmer Vernooij <jelmer@samba.org>
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/instancetype.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/instancetype.c b/source4/dsdb/samdb/ldb_modules/instancetype.c index d700adf69ac..9a3fd1141fc 100644 --- a/source4/dsdb/samdb/ldb_modules/instancetype.c +++ b/source4/dsdb/samdb/ldb_modules/instancetype.c @@ -79,11 +79,22 @@ static int instancetype_add(struct ldb_module *module, struct ldb_request *req) * If we have a NC add operation then we need also the * "TYPE_WRITE" flag in order to succeed, * unless this NC is not instantiated - */ - if (!(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; + */ + if (ldb_request_get_control(req, DSDB_CONTROL_PARTIAL_REPLICA)) { + if (!(instanceType & INSTANCE_TYPE_UNINSTANT)) { + ldb_set_errstring(ldb, "instancetype: if TYPE_IS_NC_HEAD " + "was set, and we are creating a new NC " + "over DsAddEntry then also TYPE_UNINSTANT is requested!"); + return LDB_ERR_UNWILLING_TO_PERFORM; + } + } else { + if (!(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; + } } + /* * TODO: Confirm we are naming master or start * a remote call to the naming master to |