[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Wed Oct 18 22:51:04 UTC 2017


The branch, master has been updated
       via  962a1b3 dbcheck: Allow removal of one-way links to missing objects
      from  09104dc unittests: Fix missing include of signal.h

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 962a1b32201fce0a49c6be55943d4fbb57ed781e
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Tue Oct 17 23:01:51 2017 +1300

    dbcheck: Allow removal of one-way links to missing objects
    
    If dbcheck is not run within the tombstone lifetime, these links can
    persist in the database forever.  The risk of unintentional information loss
    is why these links are only removed within the same partition.  A
    replication may be in progress which has created only one end of
    the link, so we must keep that.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Rowland Penny <rpenny at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Thu Oct 19 00:50:19 CEST 2017 on sn-devel-144

-----------------------------------------------------------------------

Summary of changes:
 python/samba/dbchecker.py | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/python/samba/dbchecker.py b/python/samba/dbchecker.py
index 1a73fe0..82088a0 100644
--- a/python/samba/dbchecker.py
+++ b/python/samba/dbchecker.py
@@ -523,8 +523,26 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base)))
         # 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:
-            self.report("Not removing dangling forward link")
-            return
+
+            linkID, reverse_link_name \
+                = self.get_attr_linkID_and_reverse_name(attrname)
+            if reverse_link_name is not None:
+                self.report("Not removing dangling forward link")
+                return
+
+            nc_root = self.samdb.get_nc_root(dn)
+            target_nc_root = self.samdb.get_nc_root(dsdb_dn.dn)
+            if nc_root != target_nc_root:
+                self.report("Not removing dangling one-way "
+                            "cross-partition link "
+                            "(we might be mid-replication)")
+                return
+
+            # Due to our link handling one-way links pointing to
+            # missing objects are plausible.
+            self.err_deleted_dn(dn, attrname, val,
+                                dsdb_dn, dsdb_dn, True)
+
         self.err_deleted_dn(dn, attrname, val, dsdb_dn, dsdb_dn, False)
 
     def err_missing_dn_GUID_component(self, dn, attrname, val, dsdb_dn, errstr):


-- 
Samba Shared Repository



More information about the samba-cvs mailing list