summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2013-03-01 17:29:09 +1100
committerStefan Metzmacher <metze@samba.org>2013-03-04 08:24:02 +0100
commit97389c3ec24526837e91fcfcaf7439491fcdb214 (patch)
treed6ddcd3b6492ab619cff49d603fa932afa68dce8 /python
parent0180a027cbc9725ae13023ddfdb8079f147864c5 (diff)
downloadsamba-97389c3ec24526837e91fcfcaf7439491fcdb214.tar.gz
samba-97389c3ec24526837e91fcfcaf7439491fcdb214.tar.bz2
samba-97389c3ec24526837e91fcfcaf7439491fcdb214.zip
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>
Diffstat (limited to 'python')
-rw-r--r--python/samba/common.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/python/samba/common.py b/python/samba/common.py
index e47f276f81..c2a3584732 100644
--- a/python/samba/common.py
+++ b/python/samba/common.py
@@ -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