summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-07-28 17:03:57 +1000
committerAndrew Tridgell <tridge@samba.org>2011-07-29 18:17:44 +1000
commit8dda0ef57fa908c94c14d2521ded883ceb253b2f (patch)
treea176577a696fab57b7735d6853df80cd6f5aa907 /source4/scripting
parent7ce4aca029473b219d053221ced1e3686ce2d3ad (diff)
downloadsamba-8dda0ef57fa908c94c14d2521ded883ceb253b2f.tar.gz
samba-8dda0ef57fa908c94c14d2521ded883ceb253b2f.tar.bz2
samba-8dda0ef57fa908c94c14d2521ded883ceb253b2f.zip
samba-tool: fixed binary encoding of usernames in setpassword
Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com> Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/python/samba/netcmd/user.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/source4/scripting/python/samba/netcmd/user.py b/source4/scripting/python/samba/netcmd/user.py
index 96a198a523..e92276b093 100644
--- a/source4/scripting/python/samba/netcmd/user.py
+++ b/source4/scripting/python/samba/netcmd/user.py
@@ -21,7 +21,7 @@
#
import samba.getopt as options
-import sys
+import sys, ldb
from getpass import getpass
from samba.auth import system_session
from samba.samdb import SamDB
@@ -258,7 +258,7 @@ class cmd_user_setpassword(Command):
password = getpass("New Password: ")
if filter is None:
- filter = "(&(objectClass=user)(sAMAccountName=%s))" % (username)
+ filter = "(&(objectClass=user)(sAMAccountName=%s))" % (ldb.binary_encode(username))
lp = sambaopts.get_loadparm()
creds = credopts.get_credentials(lp)