summaryrefslogtreecommitdiffstats
path: root/source4/scripting/python/samba/netcmd/domain.py
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-07-28 17:14:28 +1000
committerAndrew Tridgell <tridge@samba.org>2011-07-29 18:17:44 +1000
commit03f92508ef2ebb4e7790f612e3f833382c691051 (patch)
tree74c7d7cf500e7861547c620035c68f4c80128a72 /source4/scripting/python/samba/netcmd/domain.py
parent8dda0ef57fa908c94c14d2521ded883ceb253b2f (diff)
downloadsamba-03f92508ef2ebb4e7790f612e3f833382c691051.tar.gz
samba-03f92508ef2ebb4e7790f612e3f833382c691051.tar.xz
samba-03f92508ef2ebb4e7790f612e3f833382c691051.zip
samba-tool: use ldb.binary_encode() on search expression elements
this allows us to deal with search elements containing characters that must be escaped in LDAP Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org> Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'source4/scripting/python/samba/netcmd/domain.py')
-rw-r--r--source4/scripting/python/samba/netcmd/domain.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/source4/scripting/python/samba/netcmd/domain.py b/source4/scripting/python/samba/netcmd/domain.py
index 8dffbd2b566..50b5d803952 100644
--- a/source4/scripting/python/samba/netcmd/domain.py
+++ b/source4/scripting/python/samba/netcmd/domain.py
@@ -317,7 +317,7 @@ class cmd_domain_machinepassword(Command):
secretsdb = Ldb(url=url, session_info=system_session(),
credentials=creds, lp=lp)
result = secretsdb.search(attrs=["secret"],
- expression="(&(objectclass=primaryDomain)(samaccountname=%s))" % secret)
+ expression="(&(objectclass=primaryDomain)(samaccountname=%s))" % ldb.binary_encode(secret))
if len(result) != 1:
raise CommandError("search returned %d records, expected 1" % len(result))