mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 22:05:49 +00:00
[MSV1_0] Improve LogonUserEx2 (#2356)
- Improve traces, using %wZ for UNICODE_STRING; - Fix UNICODE_STRING validation.
This commit is contained in:
parent
00a47324f2
commit
8b0cfa1d3c
1 changed files with 11 additions and 10 deletions
|
@ -1244,9 +1244,6 @@ LsaApLogonUserEx2(IN PLSA_CLIENT_REQUEST ClientRequest,
|
|||
/* Fix-up pointers in the authentication info */
|
||||
PtrOffset = (ULONG_PTR)ProtocolSubmitBuffer - (ULONG_PTR)ClientBufferBase;
|
||||
|
||||
Status = RtlValidateUnicodeString(0, &LogonInfo->LogonDomainName);
|
||||
if (!NT_SUCCESS(Status))
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
/* LogonDomainName is optional and can be an empty string */
|
||||
if (LogonInfo->LogonDomainName.Length)
|
||||
{
|
||||
|
@ -1259,16 +1256,16 @@ LsaApLogonUserEx2(IN PLSA_CLIENT_REQUEST ClientRequest,
|
|||
LogonInfo->LogonDomainName.Buffer = NULL;
|
||||
LogonInfo->LogonDomainName.MaximumLength = 0;
|
||||
}
|
||||
|
||||
Status = RtlValidateUnicodeString(0, &LogonInfo->UserName);
|
||||
Status = RtlValidateUnicodeString(0, &LogonInfo->LogonDomainName);
|
||||
if (!NT_SUCCESS(Status))
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
|
||||
/* UserName is mandatory and cannot be an empty string */
|
||||
// TODO: Check for Buffer limits wrt. ClientBufferBase and alignment.
|
||||
LogonInfo->UserName.Buffer = FIXUP_POINTER(LogonInfo->UserName.Buffer, PtrOffset);
|
||||
LogonInfo->UserName.MaximumLength = LogonInfo->UserName.Length;
|
||||
|
||||
Status = RtlValidateUnicodeString(0, &LogonInfo->Password);
|
||||
Status = RtlValidateUnicodeString(0, &LogonInfo->UserName);
|
||||
if (!NT_SUCCESS(Status))
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
/* Password is optional and can be an empty string */
|
||||
|
@ -1284,9 +1281,13 @@ LsaApLogonUserEx2(IN PLSA_CLIENT_REQUEST ClientRequest,
|
|||
LogonInfo->Password.MaximumLength = 0;
|
||||
}
|
||||
|
||||
TRACE("Domain: %S\n", LogonInfo->LogonDomainName.Buffer);
|
||||
TRACE("User: %S\n", LogonInfo->UserName.Buffer);
|
||||
TRACE("Password: %S\n", LogonInfo->Password.Buffer);
|
||||
Status = RtlValidateUnicodeString(0, &LogonInfo->Password);
|
||||
if (!NT_SUCCESS(Status))
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
|
||||
TRACE("Domain: %wZ\n", &LogonInfo->LogonDomainName);
|
||||
TRACE("User: %wZ\n", &LogonInfo->UserName);
|
||||
TRACE("Password: %wZ\n", &LogonInfo->Password);
|
||||
|
||||
// TODO: If LogonType == Service, do some extra work using LogonInfo->Password.
|
||||
}
|
||||
|
@ -1442,7 +1443,7 @@ LsaApLogonUserEx2(IN PLSA_CLIENT_REQUEST ClientRequest,
|
|||
goto done;
|
||||
}
|
||||
|
||||
TRACE("UserName: %S\n", UserInfo->All.UserName.Buffer);
|
||||
TRACE("UserName: %wZ\n", &UserInfo->All.UserName);
|
||||
|
||||
/* Check the password */
|
||||
if ((UserInfo->All.UserAccountControl & USER_PASSWORD_NOT_REQUIRED) == 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue