Author: ekohl
Date: Sun Jul 7 12:45:03 2013
New Revision: 59445
URL:
http://svn.reactos.org/svn/reactos?rev=59445&view=rev
Log:
[SAMSRV]
Start work on SamrChangePasswordUser. The new passwords can be stored but the required
checks are still missing.
Modified:
trunk/reactos/dll/win32/samsrv/samrpc.c
Modified: trunk/reactos/dll/win32/samsrv/samrpc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/samrpc.c?…
==============================================================================
--- trunk/reactos/dll/win32/samsrv/samrpc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/samsrv/samrpc.c [iso-8859-1] Sun Jul 7 12:45:03 2013
@@ -7469,8 +7469,86 @@
IN unsigned char LmCrossEncryptionPresent,
IN PENCRYPTED_LM_OWF_PASSWORD NewLmEncryptedWithNewNt)
{
- UNIMPLEMENTED;
- return STATUS_NOT_IMPLEMENTED;
+ ENCRYPTED_LM_OWF_PASSWORD StoredLmPassword;
+ ENCRYPTED_NT_OWF_PASSWORD StoredNtPassword;
+ PSAM_DB_OBJECT UserObject;
+ ULONG Length;
+ NTSTATUS Status;
+
+ TRACE("(%p %u %u)\n",
+ UserHandle, LmPresent, NtPresent);
+
+ /* Validate the user handle */
+ Status = SampValidateDbObject(UserHandle,
+ SamDbUserObject,
+ USER_CHANGE_PASSWORD,
+ &UserObject);
+ if (!NT_SUCCESS(Status))
+ {
+ TRACE("SampValidateDbObject failed with status 0x%08lx\n", Status);
+ return Status;
+ }
+
+ /* Retrieve the LM password */
+ Length = sizeof(ENCRYPTED_LM_OWF_PASSWORD);
+ Status = SampGetObjectAttribute(UserObject,
+ L"LMPwd",
+ NULL,
+ &StoredLmPassword,
+ &Length);
+ if (!NT_SUCCESS(Status))
+ {
+
+ }
+
+ /* Retrieve the NT password */
+ Length = sizeof(ENCRYPTED_NT_OWF_PASSWORD);
+ Status = SampGetObjectAttribute(UserObject,
+ L"NTPwd",
+ NULL,
+ &StoredNtPassword,
+ &Length);
+ if (!NT_SUCCESS(Status))
+ {
+
+ }
+
+ /* FIXME: Check if the old passwords match the stored ones */
+
+
+ /* Store the new LM password */
+ if (LmPresent)
+ {
+ Length = sizeof(ENCRYPTED_LM_OWF_PASSWORD);
+ Status = SampSetObjectAttribute(UserObject,
+ L"LMPwd",
+ REG_BINARY,
+ NewLmEncryptedWithOldLm,
+ 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,
+ NewNtEncryptedWithOldNt,
+ Length);
+ if (!NT_SUCCESS(Status))
+ {
+ goto done;
+ }
+ }
+
+
+done:
+ return Status;
}