1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-02 00:22:11 +03:00

dbcheck: Allow a dangling forward link outside our known NCs

If we do not have the NC of the target object we can not be really sure
that the object is redundent and so we want to keep it for now
and not (as happened until now) break the dbcheck run made during the
replication stage of a "samba-tool domain backup rename".

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14450

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
This commit is contained in:
Andrew Bartlett
2020-07-27 11:37:29 +12:00
committed by Douglas Bagnall
parent 4baa7cc8e4
commit 05228c4e07
2 changed files with 62 additions and 1 deletions

View File

@ -621,7 +621,29 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base)))
return 0
nc_root = self.samdb.get_nc_root(dn)
target_nc_root = self.samdb.get_nc_root(dsdb_dn.dn)
try:
target_nc_root = self.samdb.get_nc_root(dsdb_dn.dn)
except ldb.LdbError as e:
(enum, estr) = e.args
if enum != ldb.ERR_NO_SUCH_OBJECT:
raise
target_nc_root = None
if target_nc_root is None:
# We don't bump the error count as Samba produces
# these in normal operation creating a lab domain (due
# to the way the rename is handled, links to
# now-expunged objects will never be fixed to stay
# inside the NC
self.report("WARNING: no target object found for GUID "
"component for link "
"%s in object to %s outside our NCs"
"%s - %s" % (attrname, dsdb_dn.dn, dn, val))
self.report("Not removing dangling one-way "
"left-over link outside our NCs "
"(we might be building a renamed/lab domain)")
return 0
if nc_root != target_nc_root:
# We don't bump the error count as Samba produces these
# in normal operation