From: Douglas Bagnall Date: Thu, 26 Jun 2025 00:45:24 +0000 (+1200) Subject: dbcheck: make deleted_objects check case-insensitive X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=c9e814b3a4aa9de44698ac45f9542432256910e8;p=thirdparty%2Fsamba.git dbcheck: make deleted_objects check case-insensitive 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 Reviewed-by: Gary Lockyer --- diff --git a/python/samba/dbchecker.py b/python/samba/dbchecker.py index fe1a3cd73d0..ff9dca6391b 100644 --- a/python/samba/dbchecker.py +++ b/python/samba/dbchecker.py @@ -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"""