]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
samba-tool ldapcmp: remove a dodgy unused method
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Tue, 11 Jun 2024 23:42:27 +0000 (11:42 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 12 Jun 2024 08:14:34 +0000 (08:14 +0000)
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 <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/netcmd/ldapcmp.py

index ff7d8be780e65f6c067ce54bdbabe3663836f802..b074c64212856ef52c8cdadf44fb61366fdd572a 100644 (file)
@@ -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.
         """