1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-15 16:59:09 +03:00

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>
This commit is contained in:
Andrew Tridgell
2011-07-28 17:03:57 +10:00
parent 7ce4aca029
commit 8dda0ef57f

View File

@ -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)