From: Douglas Bagnall Date: Tue, 11 Jun 2024 23:42:27 +0000 (+1200) Subject: samba-tool ldapcmp: remove a dodgy unused method X-Git-Tag: tdb-1.4.11~370 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=982dab893263b60609bf47a7138c91aefb41a038;p=thirdparty%2Fsamba.git samba-tool ldapcmp: remove a dodgy unused method We have bindings for stringifying GUIDs, so I intended to replace this rather complicated code with that, but it turns out that this method has been unused since 5d42260eecfd4f26cc82637ce1bc989083c9eb9d in 2013. Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/netcmd/ldapcmp.py b/python/samba/netcmd/ldapcmp.py index ff7d8be780e..b074c642128 100644 --- a/python/samba/netcmd/ldapcmp.py +++ b/python/samba/netcmd/ldapcmp.py @@ -227,32 +227,6 @@ class LDAPBase(object): desc = ndr_unpack(security.descriptor, desc) return desc.as_sddl(self.domain_sid) - def guid_as_string(self, guid_blob): - """ Translate binary representation of schemaIDGUID to standard string representation. - @gid_blob: binary schemaIDGUID - """ - blob = "%s" % guid_blob - stops = [4, 2, 2, 2, 6] - index = 0 - res = "" - x = 0 - while x < len(stops): - tmp = "" - y = 0 - while y < stops[x]: - c = hex(ord(blob[index])).replace("0x", "") - c = [None, "0" + c, c][len(c)] - if 2 * index < len(blob): - tmp = c + tmp - else: - tmp += c - index += 1 - y += 1 - res += tmp + " " - x += 1 - assert index == len(blob) - return res.strip().replace(" ", "-") - def get_sid_map(self): """ Build dictionary that maps GUID to 'name' attribute found in Schema or Extended-Rights. """