mirror of
https://github.com/reactos/reactos.git
synced 2024-10-02 07:26:47 +00:00
[SAMSRV]
SamrChangePasswordUser: Use SampSetUserPassword to set the password hashes and update the password history. svn path=/trunk/; revision=59453
This commit is contained in:
parent
76feb9e733
commit
dc49d97409
|
@ -7577,41 +7577,16 @@ SamrChangePasswordUser(IN SAMPR_HANDLE UserHandle,
|
|||
}
|
||||
}
|
||||
|
||||
/* Store the new LM password */
|
||||
/* Store the new password hashes */
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
if (LmPresent)
|
||||
{
|
||||
Length = sizeof(ENCRYPTED_LM_OWF_PASSWORD);
|
||||
Status = SampSetObjectAttribute(UserObject,
|
||||
L"LMPwd",
|
||||
REG_BINARY,
|
||||
NewLmPassword,
|
||||
Length);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
/* Store the new NT password */
|
||||
if (NtPresent)
|
||||
{
|
||||
Length = sizeof(ENCRYPTED_NT_OWF_PASSWORD);
|
||||
Status = SampSetObjectAttribute(UserObject,
|
||||
L"NTPwd",
|
||||
REG_BINARY,
|
||||
NewNtPassword,
|
||||
Length);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
Status = SampSetUserPassword(UserObject,
|
||||
NewNtPassword,
|
||||
NtPresent,
|
||||
NewLmPassword,
|
||||
LmPresent);
|
||||
}
|
||||
|
||||
|
||||
done:
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue