1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-03 01:18:10 +03:00

scripting: Correct parsing of binary DN

The DN is of the form B:8:01020304:DC=samba,DC=example,DC=com.  We need
to account for the case where the 8 is actually (say) 16, and so not just
one character.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
Andrew Bartlett 2013-03-01 17:29:09 +11:00 committed by Stefan Metzmacher
parent 0180a027cb
commit 97389c3ec2

View File

@ -81,7 +81,7 @@ class dsdb_Dn(object):
raise RuntimeError("Invalid DN %s" % dnstring)
prefix_len = 4 + len(colons[1]) + int(colons[1])
self.prefix = dnstring[0:prefix_len]
self.binary = self.prefix[4:-1]
self.binary = self.prefix[3+len(colons[1]):-1]
self.dnstring = dnstring[prefix_len:]
else:
self.dnstring = dnstring