From 8dda0ef57fa908c94c14d2521ded883ceb253b2f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 28 Jul 2011 17:03:57 +1000 Subject: samba-tool: fixed binary encoding of usernames in setpassword Pair-Programmed-With: Amitay Isaacs Pair-Programmed-With: Andrew Bartlett --- source4/scripting/python/samba/netcmd/user.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/scripting') 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) -- cgit