mirror of
https://github.com/reactos/reactos.git
synced 2025-06-01 15:38:37 +00:00
[SAMSRV]
A password is present only if the passwords value has been set and the password is not the empty password. svn path=/trunk/; revision=60567
This commit is contained in:
parent
b7674bb164
commit
22175a9d82
1 changed files with 26 additions and 7 deletions
|
@ -6305,6 +6305,9 @@ SampQueryUserInternal1(PSAM_DB_OBJECT UserObject,
|
|||
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 @@ SampQueryUserInternal1(PSAM_DB_OBJECT UserObject,
|
|||
&Length);
|
||||
if (!NT_SUCCESS(Status))
|
||||
goto done;
|
||||
|
||||
if (memcmp(&InfoBuffer->Internal1.EncryptedNtOwfPassword,
|
||||
&EmptyNtHash,
|
||||
sizeof(ENCRYPTED_NT_OWF_PASSWORD)))
|
||||
InfoBuffer->Internal1.NtPasswordPresent = TRUE;
|
||||
}
|
||||
|
||||
InfoBuffer->Internal1.NtPasswordPresent = (Length == sizeof(ENCRYPTED_NT_OWF_PASSWORD));
|
||||
|
||||
/* Get the LM password */
|
||||
Length = 0;
|
||||
|
@ -6343,9 +6350,12 @@ SampQueryUserInternal1(PSAM_DB_OBJECT UserObject,
|
|||
&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 @@ SampQueryUserAll(PSAM_DB_OBJECT UserObject,
|
|||
/* 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 @@ SampQueryUserAll(PSAM_DB_OBJECT UserObject,
|
|||
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 @@ SampQueryUserAll(PSAM_DB_OBJECT UserObject,
|
|||
&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 @@ SampQueryUserAll(PSAM_DB_OBJECT UserObject,
|
|||
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 @@ SampQueryUserAll(PSAM_DB_OBJECT UserObject,
|
|||
&Length);
|
||||
if (!NT_SUCCESS(Status))
|
||||
goto done;
|
||||
|
||||
if (memcmp(InfoBuffer->All.LmOwfPassword.Buffer,
|
||||
&EmptyLmHash,
|
||||
sizeof(ENCRYPTED_LM_OWF_PASSWORD)))
|
||||
InfoBuffer->All.LmPasswordPresent = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue