summaryrefslogtreecommitdiffstats
path: root/source4/dsdb
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2014-03-26 12:46:57 +1300
committerAndrew Bartlett <abartlet@samba.org>2014-03-27 00:36:31 +0100
commit74a83be540c8fa0dd0f91da25b1f9d7ccc4ec568 (patch)
tree4d2eeacfda7fdcf0c82678e38563284f6e38ec76 /source4/dsdb
parentdf2ef57584aab81c75012ec5d878322ff0691608 (diff)
downloadsamba-74a83be540c8fa0dd0f91da25b1f9d7ccc4ec568.tar.gz
samba-74a83be540c8fa0dd0f91da25b1f9d7ccc4ec568.tar.xz
samba-74a83be540c8fa0dd0f91da25b1f9d7ccc4ec568.zip
dsdb: Improve missing objectClass handling
This attempts to permit deletion of objects that have no objectClass to allow dbcheck to clean up a corrupt database. It is not complete, the replmd_replPropertyMetaDataCtr1_sort_and_verify() call will still fail, but this is as much as is safe to do without a way to replicate the original issue. Andrew Bartlett Change-Id: If0b6c7f18e8aee587e6b3b4af878a0145f5eac37 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.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
index 4f276b39910..4e5d8f0597c 100644
--- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
+++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
@@ -1523,19 +1523,19 @@ static int replmd_update_rpmd(struct ldb_module *module,
* corruption if we don't have this!
*/
objectclass_el = ldb_msg_find_element(res->msgs[0], "objectClass");
- if (objectclass_el == NULL) {
- ldb_debug_set(ldb, LDB_DEBUG_FATAL,
- __location__ ": objectClass missing on %s\n",
- ldb_dn_get_linearized(msg->dn));
- return LDB_ERR_OPERATIONS_ERROR;
- }
-
- /*
- * Now check if this objectClass means we need to do urgent replication
- */
- if (!*is_urgent && replmd_check_urgent_objectclass(objectclass_el,
- situation)) {
- *is_urgent = true;
+ if (objectclass_el != NULL) {
+ /*
+ * Now check if this objectClass means we need to do urgent replication
+ */
+ if (!*is_urgent && replmd_check_urgent_objectclass(objectclass_el,
+ situation)) {
+ *is_urgent = true;
+ }
+ } else if (!ldb_request_get_control(req, DSDB_CONTROL_DBCHECK)) {
+ ldb_asprintf_errstring(ldb, __location__
+ ": objectClass missing on %s\n",
+ ldb_dn_get_linearized(msg->dn));
+ return LDB_ERR_OBJECT_CLASS_VIOLATION;
}
/*