Author: ekohl
Date: Sun Oct 6 23:09:46 2013
New Revision: 60567
URL:
http://svn.reactos.org/svn/reactos?rev=60567&view=rev
Log:
[SAMSRV]
A password is present only if the passwords value has been set and the password is not the
empty password.
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 Oct 6 23:09:46 2013
@@ -6305,6 +6305,9 @@
if (InfoBuffer == NULL)
return STATUS_INSUFFICIENT_RESOURCES;
+ InfoBuffer->Internal1.LmPasswordPresent = FALSE;
+ InfoBuffer->Internal1.NtPasswordPresent = FALSE;
+
/* Get the NT password */
Length = 0;
SampGetObjectAttribute(UserObject,
@@ -6322,9 +6325,13 @@
&Length);
if (!NT_SUCCESS(Status))
goto done;
- }
-
- InfoBuffer->Internal1.NtPasswordPresent = (Length ==
sizeof(ENCRYPTED_NT_OWF_PASSWORD));
+
+ if (memcmp(&InfoBuffer->Internal1.EncryptedNtOwfPassword,
+ &EmptyNtHash,
+ sizeof(ENCRYPTED_NT_OWF_PASSWORD)))
+ InfoBuffer->Internal1.NtPasswordPresent = TRUE;
+ }
+
/* Get the LM password */
Length = 0;
@@ -6343,9 +6350,12 @@
&Length);
if (!NT_SUCCESS(Status))
goto done;
- }
-
- InfoBuffer->Internal1.LmPasswordPresent = (Length ==
sizeof(ENCRYPTED_LM_OWF_PASSWORD));
+
+ if (memcmp(&InfoBuffer->Internal1.EncryptedLmOwfPassword,
+ &EmptyLmHash,
+ sizeof(ENCRYPTED_LM_OWF_PASSWORD)))
+ InfoBuffer->Internal1.LmPasswordPresent = TRUE;
+ }
InfoBuffer->Internal1.PasswordExpired = FALSE;
@@ -6709,6 +6719,9 @@
/* Get the LmPassword and NtPassword attributes */
if (InfoBuffer->All.WhichFields & (USER_ALL_NTPASSWORDPRESENT |
USER_ALL_LMPASSWORDPRESENT))
{
+ InfoBuffer->All.LmPasswordPresent = FALSE;
+ InfoBuffer->All.NtPasswordPresent = FALSE;
+
/* Get the NT password */
Length = 0;
SampGetObjectAttribute(UserObject,
@@ -6717,8 +6730,6 @@
NULL,
&Length);
- InfoBuffer->All.NtPasswordPresent = (Length ==
sizeof(ENCRYPTED_NT_OWF_PASSWORD));
-
if (Length == sizeof(ENCRYPTED_NT_OWF_PASSWORD))
{
InfoBuffer->All.NtOwfPassword.Buffer =
midl_user_allocate(sizeof(ENCRYPTED_NT_OWF_PASSWORD));
@@ -6738,6 +6749,11 @@
&Length);
if (!NT_SUCCESS(Status))
goto done;
+
+ if (memcmp(InfoBuffer->All.NtOwfPassword.Buffer,
+ &EmptyNtHash,
+ sizeof(ENCRYPTED_NT_OWF_PASSWORD)))
+ InfoBuffer->All.NtPasswordPresent = TRUE;
}
/* Get the LM password */
@@ -6748,8 +6764,6 @@
NULL,
&Length);
- InfoBuffer->All.LmPasswordPresent = (Length ==
sizeof(ENCRYPTED_LM_OWF_PASSWORD));
-
if (Length == sizeof(ENCRYPTED_LM_OWF_PASSWORD))
{
InfoBuffer->All.LmOwfPassword.Buffer =
midl_user_allocate(sizeof(ENCRYPTED_LM_OWF_PASSWORD));
@@ -6769,6 +6783,11 @@
&Length);
if (!NT_SUCCESS(Status))
goto done;
+
+ if (memcmp(InfoBuffer->All.LmOwfPassword.Buffer,
+ &EmptyLmHash,
+ sizeof(ENCRYPTED_LM_OWF_PASSWORD)))
+ InfoBuffer->All.LmPasswordPresent = TRUE;
}
}