summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2019-02-25 15:35:22 +0100
committerKarolin Seeger <kseeger@samba.org>2019-03-28 12:19:12 +0000
commit0473eab6862b41a68e980d451f3008568ce634f2 (patch)
tree6c58b545359efc26223d5a22f58b0463fe3141b6 /python
parent0fd3f38c1cfa717c1e9a2d320030ee29102e5005 (diff)
downloadsamba-0473eab6862b41a68e980d451f3008568ce634f2.tar.gz
dbcheck: don't remove dangling one-way links on already deleted objects
This would typically happen when the garbage collection removed a parent object before a child object (both with the DISALLOW_MOVE_ON_DELETE bit set in systemFlags), while dbcheck is running at the same time as the garbage collection. In this case the lastKnownParent attributes points a non existing object. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13816 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit e388e599495b6d7c38b8b6966332e27f8b958783)
Diffstat (limited to 'python')
-rw-r--r--python/samba/dbchecker.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/python/samba/dbchecker.py b/python/samba/dbchecker.py
index 560ad5485a2..a11e76038e5 100644
--- a/python/samba/dbchecker.py
+++ b/python/samba/dbchecker.py
@@ -544,6 +544,19 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base)))
def err_missing_target_dn_or_GUID(self, dn, attrname, val, dsdb_dn):
"""handle a missing target DN (if specified, GUID form can't be found,
and otherwise DN string form can't be found)"""
+
+ # Don't change anything if the object itself is deleted
+ if str(dn).find('\\0ADEL') != -1:
+ # We don't bump the error count as Samba produces these
+ # in normal operation
+ self.report("WARNING: no target object found for GUID "
+ "component link %s in deleted object "
+ "%s - %s" % (attrname, dn, val))
+ self.report("Not removing dangling one-way "
+ "link on deleted object "
+ "(tombstone garbage collection in progress?)")
+ return 0
+
# check if its a backlink
linkID, _ = self.get_attr_linkID_and_reverse_name(attrname)
if (linkID & 1 == 0) and str(dsdb_dn).find('\\0ADEL') == -1: