summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2018-01-25 14:36:52 +0100
committerKarolin Seeger <kseeger@samba.org>2018-02-09 09:30:21 +0100
commitc17794d5c7a6080c6a41ddd38cc59a7f5c94f7dc (patch)
treeb48184b7751adb491b51177017920caed4d77263 /python
parent9971ea32e27775c36d5a87e9ab92b5c619d91818 (diff)
downloadsamba-c17794d5c7a6080c6a41ddd38cc59a7f5c94f7dc.tar.gz
dbcheck: rename err_duplicate_links() to err_recover_forward_links() and adjust the output message
It's really a fatal error to have duplicate values as it's very likely that some forward links got lost. 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 ec433f8531a822dd40b343fbf3244157a5ecd544)
Diffstat (limited to 'python')
-rw-r--r--python/samba/dbchecker.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/python/samba/dbchecker.py b/python/samba/dbchecker.py
index 1ab3eb0356e..308e4bf0a76 100644
--- a/python/samba/dbchecker.py
+++ b/python/samba/dbchecker.py
@@ -65,7 +65,7 @@ class dbcheck(object):
self.fix_undead_linked_attributes = False
self.fix_all_missing_backlinks = False
self.fix_all_orphaned_backlinks = False
- self.fix_all_duplicate_links = False
+ self.recover_all_forward_links = False
self.fix_rmd_flags = False
self.fix_ntsecuritydescriptor = False
self.fix_ntsecuritydescriptor_owner_group = False
@@ -722,11 +722,14 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base)))
"Failed to fix orphaned backlink %s" % backlink_attr):
self.report("Fixed orphaned backlink %s" % (backlink_attr))
- def err_duplicate_links(self, obj, forward_attr, forward_vals):
+ def err_recover_forward_links(self, obj, forward_attr, forward_vals):
'''handle a duplicate links value'''
- if not self.confirm_all("Remove duplicate links in attribute '%s'" % forward_attr, 'fix_all_duplicate_links'):
- self.report("Not removing duplicate links in attribute '%s'" % forward_attr)
+ self.report("RECHECK: 'Duplicate/Correct link' lines above for attribute '%s' in '%s'" % (forward_attr, obj.dn))
+
+ if not self.confirm_all("Commit fixes for (duplicate) forward links in attribute '%s'" % forward_attr, 'recover_all_forward_links'):
+ self.report("Not fixing corrupted (duplicate) forward links in attribute '%s' of '%s'" % (
+ forward_attr, obj.dn))
return
m = ldb.Message()
m.dn = obj.dn
@@ -963,7 +966,7 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base)))
for keystr in unique_list:
dsdb_dn = unique_dict[keystr]
vals.append(str(dsdb_dn))
- self.err_duplicate_links(obj, attrname, vals)
+ self.err_recover_forward_links(obj, attrname, vals)
# We should continue with the fixed values
obj[attrname] = ldb.MessageElement(vals, ldb.FLAG_MOD_REPLACE, attrname)