[SAMSRV]
authorEric Kohl <eric.kohl@reactos.org>
Wed, 10 Jul 2013 23:04:49 +0000 (23:04 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Wed, 10 Jul 2013 23:04:49 +0000 (23:04 +0000)
SamrChangePasswordUser: Update the PasswordLastSet time after a new password has been set.

svn path=/trunk/; revision=59456

reactos/dll/win32/samsrv/samrpc.c

index fce4676..fe7929f 100644 (file)
@@ -7477,6 +7477,7 @@ SamrChangePasswordUser(IN SAMPR_HANDLE UserHandle,
     PENCRYPTED_NT_OWF_PASSWORD NewNtPassword;
     PSAM_DB_OBJECT UserObject;
     ULONG Length;
+    SAM_USER_FIXED_DATA FixedUserData;
     NTSTATUS Status;
 
     TRACE("(%p %u %p %p %u %p %p %u %p %u %p)\n",
@@ -7585,6 +7586,28 @@ SamrChangePasswordUser(IN SAMPR_HANDLE UserHandle,
                                      NtPresent,
                                      NewLmPassword,
                                      LmPresent);
+        if (NT_SUCCESS(Status))
+        {
+            /* Get the fixed size user data */
+            Length = sizeof(SAM_USER_FIXED_DATA);
+            Status = SampGetObjectAttribute(UserObject,
+                                            L"F",
+                                            NULL,
+                                            &FixedUserData,
+                                            &Length);
+            if (NT_SUCCESS(Status))
+            {
+                /* Update PasswordLastSet */
+                NtQuerySystemTime(&FixedUserData.PasswordLastSet);
+
+                /* Set the fixed size user data */
+                Status = SampSetObjectAttribute(UserObject,
+                                                L"F",
+                                                REG_BINARY,
+                                                &FixedUserData,
+                                                Length);
+            }
+        }
     }
 
     return Status;