SamrChangePasswordUser: Use SampSetUserPassword to set the password hashes and update the password history.

svn path=/trunk/; revision=59453
This commit is contained in:
Eric Kohl 2013-07-09 21:47:55 +00:00
parent 76feb9e733
commit dc49d97409

View file

@ -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;
}