diff options
author | Andrew Bartlett <abartlet@samba.org> | 2014-03-26 12:48:17 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2014-03-27 00:36:31 +0100 |
commit | df2ef57584aab81c75012ec5d878322ff0691608 (patch) | |
tree | f08a620cc9844150a2aee81fe30b3a307357d6aa /source4/dsdb | |
parent | dac1411b9ef9863152932698ce8c4e0a8cc79b1c (diff) | |
download | samba-df2ef57584aab81c75012ec5d878322ff0691608.tar.gz samba-df2ef57584aab81c75012ec5d878322ff0691608.tar.xz samba-df2ef57584aab81c75012ec5d878322ff0691608.zip |
dsdb: Improve errors and checks for missing objectClass values
Change-Id: I8c4ac679accc90748d20c9c86986b127c939fa75
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source4/dsdb')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/repl_meta_data.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c index 6abd27ef08..4f276b3991 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -1138,7 +1138,7 @@ static int replmd_add(struct ldb_module *module, struct ldb_request *req) ": objectClass missing on %s\n", ldb_dn_get_linearized(msg->dn)); talloc_free(ac); - return LDB_ERR_OPERATIONS_ERROR; + return LDB_ERR_OBJECT_CLASS_VIOLATION; } is_urgent = replmd_check_urgent_objectclass(objectclass_el, REPL_URGENT_ON_CREATE); @@ -3937,6 +3937,13 @@ static int replmd_replicated_apply_add(struct replmd_replicated_request *ar) struct ldb_message_element *el = &msg->elements[i]; if (el->num_values == 0) { + if (ldb_attr_cmp(msg->elements[i].name, "objectClass") == 0) { + ldb_asprintf_errstring(ldb, __location__ + ": empty objectClass sent on %s, aborting replication\n", + ldb_dn_get_linearized(msg->dn)); + return replmd_replicated_request_error(ar, LDB_ERR_OBJECT_CLASS_VIOLATION); + } + DEBUG(4,(__location__ ": Removing attribute %s with num_values==0\n", el->name)); memmove(el, el+1, sizeof(*el)*(msg->num_elements - (i+1))); @@ -4570,7 +4577,7 @@ static int replmd_replicated_apply_merge(struct replmd_replicated_request *ar) ldb_asprintf_errstring(ldb, __location__ ": objectClass removed on %s, aborting replication\n", ldb_dn_get_linearized(msg->dn)); - return replmd_replicated_request_error(ar, LDB_ERR_OPERATIONS_ERROR); + return replmd_replicated_request_error(ar, LDB_ERR_OBJECT_CLASS_VIOLATION); } } } |