summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/objectclass.c
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2009-10-03 10:52:53 +0200
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2009-10-03 10:52:53 +0200
commit90828cc7022807a6036700d0edc8061c408ef8a7 (patch)
treee433c5d7e16aaab7164784970d2cbd7e34b75e23 /source4/dsdb/samdb/ldb_modules/objectclass.c
parentdeb268f7facd05a10607c5290138b5c0ec33ff49 (diff)
downloadsamba-90828cc7022807a6036700d0edc8061c408ef8a7.tar.gz
samba-90828cc7022807a6036700d0edc8061c408ef8a7.tar.bz2
samba-90828cc7022807a6036700d0edc8061c408ef8a7.zip
s4:dsdb Don't allow creation of systemOnly objectclasses
(except as part of the provision, which specifies the 'relax' control) Andrew Bartlett
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/objectclass.c')
-rw-r--r--source4/dsdb/samdb/ldb_modules/objectclass.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/objectclass.c b/source4/dsdb/samdb/ldb_modules/objectclass.c
index 6d22141a3b..b3d54612dd 100644
--- a/source4/dsdb/samdb/ldb_modules/objectclass.c
+++ b/source4/dsdb/samdb/ldb_modules/objectclass.c
@@ -561,6 +561,12 @@ static int objectclass_do_add(struct oc_context *ac)
return LDB_ERR_NAMING_VIOLATION;
}
+ if (current->objectclass->systemOnly && !ldb_request_get_control(ac->req, LDB_CONTROL_RELAX_OID)) {
+ ldb_asprintf_errstring(ldb, "objectClass %s is systemOnly, rejecting creation of %s",
+ current->objectclass->lDAPDisplayName, ldb_dn_get_linearized(msg->dn));
+ return LDB_ERR_UNWILLING_TO_PERFORM;
+ }
+
if (!ldb_msg_find_element(msg, "objectCategory")) {
value = talloc_strdup(msg, current->objectclass->defaultObjectCategory);
if (value == NULL) {