diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-06-05 20:19:31 +0200 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-06-07 14:47:24 +0200 |
commit | 566d13c5d11ae832285c09f74d25ffdcf0397735 (patch) | |
tree | 1c2975427b5c5561ab4f8ffd996366d97edcf578 | |
parent | e7eef53fe543c940f7a792b16d037fed8d7743ec (diff) | |
download | samba-566d13c5d11ae832285c09f74d25ffdcf0397735.tar.gz samba-566d13c5d11ae832285c09f74d25ffdcf0397735.tar.bz2 samba-566d13c5d11ae832285c09f74d25ffdcf0397735.zip |
s4:acl LDB module - adaption for "objectclass_attrs" module
Since the attribute schema checking code moved back we need to give here the
"LDB_ERR_NO_SUCH_ATTRIBUTE" error.
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/acl.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/acl.c b/source4/dsdb/samdb/ldb_modules/acl.c index 1b84e8a02f..46644daeb3 100644 --- a/source4/dsdb/samdb/ldb_modules/acl.c +++ b/source4/dsdb/samdb/ldb_modules/acl.c @@ -736,15 +736,25 @@ static int acl_modify(struct ldb_module *module, struct ldb_request *req) attr = dsdb_attribute_by_lDAPDisplayName(schema, req->op.mod.message->elements[i].name); } + + /* This basic attribute existence check with the right errorcode + * is needed since this module is the first one which requests + * schema attribute informations. + * The complete attribute checking is done in the + * "objectclass_attrs" module behind this one. + */ + if (!attr) { + ldb_asprintf_errstring(ldb, "acl_modify: attribute '%s' on entry '%s' was not found in the schema!", + req->op.mod.message->elements[i].name, + ldb_dn_get_linearized(req->op.mod.message->dn)); + talloc_free(tmp_ctx); + return LDB_ERR_NO_SUCH_ATTRIBUTE; + } + if (strcmp("nTSecurityDescriptor", req->op.mod.message->elements[i].name) == 0) { modify_sd = true; } else { - if (!attr) { - DEBUG(10, ("acl_modify: cannot find attribute %s\n", - req->op.mod.message->elements[i].name)); - goto fail; - } if (!insert_in_object_tree(tmp_ctx, &attr->attributeSecurityGUID, SEC_ADS_WRITE_PROP, &new_node, &new_node)) { |