From dc49d97409c9f4ea842dc42bf4bd83fc8bc1d38b Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Tue, 9 Jul 2013 21:47:55 +0000 Subject: [PATCH] [SAMSRV] SamrChangePasswordUser: Use SampSetUserPassword to set the password hashes and update the password history. svn path=/trunk/; revision=59453 --- reactos/dll/win32/samsrv/samrpc.c | 37 +++++-------------------------- 1 file changed, 6 insertions(+), 31 deletions(-) diff --git a/reactos/dll/win32/samsrv/samrpc.c b/reactos/dll/win32/samsrv/samrpc.c index b571fa9f4ca..fce467670ae 100644 --- a/reactos/dll/win32/samsrv/samrpc.c +++ b/reactos/dll/win32/samsrv/samrpc.c @@ -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; }