From c9e814b3a4aa9de44698ac45f9542432256910e8 Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Thu, 26 Jun 2025 12:45:24 +1200 Subject: [PATCH] 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 --- python/samba/dbchecker.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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""" -- 2.47.2