summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2018-01-25 10:34:29 +0100
committerKarolin Seeger <kseeger@samba.org>2018-02-09 09:30:22 +0100
commitf4cb28b18e1a2c39101554570451dfb0614cd5db (patch)
tree4b6c97ce19fd693841305375c40d7933f905f153 /python
parent84519065f0a1f45b5e69c7fa06ade389d8ce32a9 (diff)
downloadsamba-f4cb28b18e1a2c39101554570451dfb0614cd5db.tar.gz
dbcheck: add a dict where we remember attributes with duplicate links
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13228 Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Ralph Boehme <slow@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit e4cc062fa98f65369f3bde24a987c2651632cb06)
Diffstat (limited to 'python')
-rw-r--r--python/samba/dbchecker.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/python/samba/dbchecker.py b/python/samba/dbchecker.py
index 9185a1d1bed..787cea2de48 100644
--- a/python/samba/dbchecker.py
+++ b/python/samba/dbchecker.py
@@ -65,6 +65,7 @@ class dbcheck(object):
self.fix_undead_linked_attributes = False
self.fix_all_missing_backlinks = False
self.fix_all_orphaned_backlinks = False
+ self.duplicate_link_cache = dict()
self.recover_all_forward_links = False
self.fix_rmd_flags = False
self.fix_ntsecuritydescriptor = False
@@ -904,6 +905,10 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base)))
if backlink_attr is None:
return (error_count, duplicate_dict, unique_dict)
+ duplicate_cache_key = "%s:%s" % (str(obj.dn), forward_attr)
+ if duplicate_cache_key not in self.duplicate_link_cache:
+ self.duplicate_link_cache[duplicate_cache_key] = False
+
for val in obj[forward_attr]:
dsdb_dn = dsdb_Dn(self.samdb, val, forward_syntax)
@@ -945,6 +950,8 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base)))
duplicate_dict[keystr]["delete"].append(unique_dict[keystr])
unique_dict[keystr] = dsdb_dn
+ if error_count != 0:
+ self.duplicate_link_cache[duplicate_cache_key] = True
return (error_count, duplicate_dict, unique_dict)