summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/objectclass_attrs.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-11-04 12:37:29 +0100
committerStefan Metzmacher <metze@samba.org>2010-11-04 17:01:59 +0000
commit8516fad3b49f6ac87e9e17dc2929433116dcb04d (patch)
tree1b518ac59120b51ec51d7427501f6ae444517187 /source4/dsdb/samdb/ldb_modules/objectclass_attrs.c
parent60691c13224656e6a889eb01246582f10c056b7b (diff)
downloadsamba-8516fad3b49f6ac87e9e17dc2929433116dcb04d.tar.gz
samba-8516fad3b49f6ac87e9e17dc2929433116dcb04d.tar.bz2
samba-8516fad3b49f6ac87e9e17dc2929433116dcb04d.zip
s4:dsdb/objectclass_attrs: not all objects have delete protected attributes as must contain
Before we got the following error, while starting samba after a 'samba-tool vampire': Failed to store repsFrom - objectclass_attrs: delete protected attribute 'objectSid' on entry 'DC=ForestDnsZones,DC=alpha,DC=sz,DC=salzgitter-ag,DC=lab' missing! metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Thu Nov 4 17:01:59 UTC 2010 on sn-devel-104
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/objectclass_attrs.c')
-rw-r--r--source4/dsdb/samdb/ldb_modules/objectclass_attrs.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/objectclass_attrs.c b/source4/dsdb/samdb/ldb_modules/objectclass_attrs.c
index ed193491d1..26eaaeaae5 100644
--- a/source4/dsdb/samdb/ldb_modules/objectclass_attrs.c
+++ b/source4/dsdb/samdb/ldb_modules/objectclass_attrs.c
@@ -43,6 +43,8 @@ struct oc_context {
struct ldb_request *req;
const struct dsdb_schema *schema;
+ struct ldb_message *msg;
+
struct ldb_reply *search_res;
struct ldb_reply *mod_ares;
};
@@ -107,6 +109,7 @@ static int attr_handler(struct oc_context *ac)
if (msg == NULL) {
return ldb_oom(ldb);
}
+ ac->msg = msg;
/* initialize syntax checking context */
dsdb_syntax_ctx_init(&syntax_ctx, ldb, ac->schema);
@@ -275,6 +278,17 @@ static int attr_handler2(struct oc_context *ac)
/* Check the delete-protected attributes list */
msg = ac->search_res->message;
for (l = del_prot_attributes; *l != NULL; l++) {
+ struct ldb_message_element *el;
+
+ el = ldb_msg_find_element(ac->msg, *l);
+ if (el == NULL) {
+ /*
+ * It was not specified in the add or modify,
+ * so it doesn't need to be in the stored record
+ */
+ continue;
+ }
+
found = str_list_check_ci(must_contain, *l);
if (!found) {
found = str_list_check_ci(may_contain, *l);