samba-tool: dbcheck avoid problems with deleted objects
authorMatthieu Patou <mat@matws.net>
Sun, 13 Nov 2011 12:15:47 +0000 (13:15 +0100)
committerMatthieu Patou <mat@matws.net>
Sun, 13 Nov 2011 13:10:05 +0000 (14:10 +0100)
We have to search for deleted objects as well as the previous search
might have been done with the show_deleted control. If not samba-tool
fails with no such DN error while fetching the object.

source4/scripting/python/samba/dbchecker.py

index 7d85adfd16dbba0d7dca9b2317d3be062d9dc3e4..384e5d96c14decbb701a050cf0581cd540e4fb5c 100644 (file)
@@ -407,7 +407,7 @@ class dbcheck(object):
             attrs.append("replPropertyMetaData")
 
         res = self.samdb.search(base=dn, scope=ldb.SCOPE_BASE,
-                                controls=["extended_dn:1:1", "show_recycled:1"],
+                controls=["extended_dn:1:1", "show_recycled:1", "show_deleted:1"],
                                 attrs=attrs)
         if len(res) != 1:
             self.report("Object %s disappeared during check" % dn)