summaryrefslogtreecommitdiffstats
path: root/source4/scripting/python/samba/netcmd/rodc.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/rodc.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/rodc.py')
-rw-r--r--source4/scripting/python/samba/netcmd/rodc.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/source4/scripting/python/samba/netcmd/rodc.py b/source4/scripting/python/samba/netcmd/rodc.py
index 411221e24f7..75c326f950d 100644
--- a/source4/scripting/python/samba/netcmd/rodc.py
+++ b/source4/scripting/python/samba/netcmd/rodc.py
@@ -52,7 +52,7 @@ class cmd_rodc_preload(Command):
expression="objectclass=user",
scope=ldb.SCOPE_BASE, attrs=[])
else:
- res = samdb.search(expression="(&(samAccountName=%s)(objectclass=user))" % account,
+ res = samdb.search(expression="(&(samAccountName=%s)(objectclass=user))" % ldb.binary_encode(account),
scope=ldb.SCOPE_SUBTREE, attrs=[])
if len(res) != 1:
raise Exception("Failed to find account '%s'" % account)