summaryrefslogtreecommitdiffstats
path: root/source4/scripting/python/samba/samdb.py
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2009-08-19 12:37:11 +0200
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2009-09-07 12:29:34 +0200
commitfdd62e9699b181a140292689fcd88a559bc26211 (patch)
tree56461242c76d178c268fb77a205188f6c5c4c78c /source4/scripting/python/samba/samdb.py
parent0d07ce19496ffbc20a5be2548476a07033acb6d7 (diff)
downloadsamba-fdd62e9699b181a140292689fcd88a559bc26211.tar.gz
samba-fdd62e9699b181a140292689fcd88a559bc26211.tar.xz
samba-fdd62e9699b181a140292689fcd88a559bc26211.zip
s4: Let the "setpassword" script finally use the "samdb_set_password" routine
The "setpassword" script should use the "samdb_set_password" call to change the NT user password. Windows Server tests show that "userPassword" is not the right place to save the NT password and does not inherit the password complexity.
Diffstat (limited to 'source4/scripting/python/samba/samdb.py')
-rw-r--r--source4/scripting/python/samba/samdb.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/source4/scripting/python/samba/samdb.py b/source4/scripting/python/samba/samdb.py
index a58d6c5b124..b78c8f37d93 100644
--- a/source4/scripting/python/samba/samdb.py
+++ b/source4/scripting/python/samba/samdb.py
@@ -161,14 +161,14 @@ pwdLastSet: 0
assert(len(res) == 1)
user_dn = res[0].dn
- setpw = """
-dn: %s
-changetype: modify
-replace: userPassword
-userPassword:: %s
-""" % (user_dn, base64.b64encode(password))
+ mod = ldb.Message()
+ mod.dn = user_dn
+
+ glue.samdb_set_password(samdb=self, user_dn=str(user_dn),
+ dom_dn=self.domain_dn(), mod=mod, new_password=password,
+ user_change=True)
- self.modify_ldif(setpw)
+ self.modify(mod)
if force_password_change_at_next_login:
self.force_password_change_at_next_login(user_dn)