mirror of
https://github.com/samba-team/samba.git
synced 2025-07-21 12:59:09 +03:00
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.
This commit is contained in:
@ -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
|
||||
|
||||
self.modify_ldif(setpw)
|
||||
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(mod)
|
||||
|
||||
if force_password_change_at_next_login:
|
||||
self.force_password_change_at_next_login(user_dn)
|
||||
|
Reference in New Issue
Block a user