]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
dbcheck: make deleted_objects check case-insensitive
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Thu, 26 Jun 2025 00:45:24 +0000 (12:45 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Thu, 7 Aug 2025 23:28:33 +0000 (23:28 +0000)
While a BinaryDn.prefix is generated in upper-case, and
dsdb.DS_GUID_DELETED_OBJECTS_CONTAINER is upper-case, we can avoid
having to think about that by comparing the actual bytes.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
python/samba/dbchecker.py

index fe1a3cd73d0c08df02c36b3d4c874b36a0b2053c..ff9dca6391b02fbc0f658568add9318af2960d80 100644 (file)
@@ -602,9 +602,10 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base)))
                           validate=False):
             self.report("Removed duplicate value on attribute %s" % attrname)
 
-    def is_deleted_objects_dn(self, dsdb_dn):
-        """see if a dsdb_Dn is the special Deleted Objects DN"""
-        return dsdb_dn.prefix == "B:32:%s:" % dsdb.DS_GUID_DELETED_OBJECTS_CONTAINER
+    def is_deleted_objects_dn(self, binary_dn):
+        """see if a BinaryDn is the special Deleted Objects DN"""
+        deleted_objects_guid = bytes.fromhex(dsdb.DS_GUID_DELETED_OBJECTS_CONTAINER)
+        return binary_dn.binary == deleted_objects_guid
 
     def err_missing_objectclass(self, dn):
         """handle object without objectclass"""