mirror of
https://github.com/samba-team/samba.git
synced 2025-07-29 15:42:04 +03:00
s4:scripting/python: add support for utf-8 passwords from the command line
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
This commit is contained in:
committed by
Michael Adam
parent
ff65500f2b
commit
d60be8167b
@ -473,12 +473,13 @@ member: %s
|
||||
if len(res) > 1:
|
||||
raise Exception('Matched %u multiple users with filter "%s"' % (len(res), search_filter))
|
||||
user_dn = res[0].dn
|
||||
pw = unicode('"' + password + '"', 'utf-8').encode('utf-16-le')
|
||||
setpw = """
|
||||
dn: %s
|
||||
changetype: modify
|
||||
replace: unicodePwd
|
||||
unicodePwd:: %s
|
||||
""" % (user_dn, base64.b64encode(("\"" + password + "\"").encode('utf-16-le')))
|
||||
""" % (user_dn, base64.b64encode(pw))
|
||||
|
||||
self.modify_ldif(setpw)
|
||||
|
||||
|
Reference in New Issue
Block a user