summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-06-14 13:19:43 +1000
committerAndrew Bartlett <abartlet@samba.org>2010-06-15 10:54:09 +1000
commitb16e602660e9fcfe7a0e46633e81c898b2053238 (patch)
tree5f4c84ed4e052d5f80985bd4b928ada2b8077da1 /source4/dsdb/samdb
parent8ea411847262fec592b48d1a5a3bf4809653a420 (diff)
downloadsamba-b16e602660e9fcfe7a0e46633e81c898b2053238.tar.gz
samba-b16e602660e9fcfe7a0e46633e81c898b2053238.tar.bz2
samba-b16e602660e9fcfe7a0e46633e81c898b2053238.zip
s4:dsdb Move linked attribute restrictions to objectclass_attrs
This puts more of the schema restrictions in one place. Andrew Bartlett
Diffstat (limited to 'source4/dsdb/samdb')
-rw-r--r--source4/dsdb/samdb/ldb_modules/objectclass_attrs.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/objectclass_attrs.c b/source4/dsdb/samdb/ldb_modules/objectclass_attrs.c
index 5b76a0b946..36bd86072d 100644
--- a/source4/dsdb/samdb/ldb_modules/objectclass_attrs.c
+++ b/source4/dsdb/samdb/ldb_modules/objectclass_attrs.c
@@ -105,6 +105,15 @@ static int attr_handler(struct oc_context *ac)
return LDB_ERR_NO_SUCH_ATTRIBUTE;
}
+ if ((attr->linkID & 1) == 1) {
+ /* Odd is for the target. Illegal to modify */
+ ldb_asprintf_errstring(ldb,
+ "objectclass_attrs: attribute '%s' on entry '%s' must not be modified directly, it is a linked attribute",
+ msg->elements[i].name,
+ ldb_dn_get_linearized(msg->dn));
+ return LDB_ERR_UNWILLING_TO_PERFORM;
+ }
+
werr = attr->syntax->validate_ldb(ldb, ac->schema, attr,
&msg->elements[i]);
if (!W_ERROR_IS_OK(werr)) {