Author: ekohl
Date: Mon Sep 26 16:28:10 2016
New Revision: 72814
URL:
http://svn.reactos.org/svn/reactos?rev=72814&view=rev
Log:
[LSASRV]
Store the domain name and user SID in the session too.
Modified:
trunk/reactos/dll/win32/lsasrv/authpackage.c
trunk/reactos/dll/win32/lsasrv/lsasrv.h
trunk/reactos/dll/win32/lsasrv/session.c
Modified: trunk/reactos/dll/win32/lsasrv/authpackage.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/authpacka…
==============================================================================
--- trunk/reactos/dll/win32/lsasrv/authpackage.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/lsasrv/authpackage.c [iso-8859-1] Mon Sep 26 16:28:10 2016
@@ -1380,7 +1380,12 @@
SECURITY_LOGON_TYPE LogonType;
NTSTATUS Status;
- TRACE("(%p %p)\n", RequestMsg, LogonContext);
+ PUNICODE_STRING UserName = NULL;
+ PUNICODE_STRING LogonDomainName = NULL;
+// UNICODE_STRING LogonServer;
+
+
+ TRACE("LsapLogonUser(%p %p)\n", RequestMsg, LogonContext);
PackageId = RequestMsg->LogonUser.Request.AuthenticationPackage;
LogonType = RequestMsg->LogonUser.Request.LogonType;
@@ -1606,9 +1611,23 @@
// TokenHandle = NULL;
+ if (LogonType == Interactive ||
+ LogonType == Batch ||
+ LogonType == Service)
+ {
+ UserName = &((PMSV1_0_INTERACTIVE_LOGON)LocalAuthInfo)->UserName;
+ LogonDomainName =
&((PMSV1_0_INTERACTIVE_LOGON)LocalAuthInfo)->LogonDomainName;
+ }
+ else
+ {
+ FIXME("LogonType %lu is not supported yet!\n", LogonType);
+ }
+
Status = LsapSetLogonSessionData(&RequestMsg->LogonUser.Reply.LogonId,
LogonType,
- AccountName);
+ UserName,
+ LogonDomainName,
+ TokenInfo1->User.User.Sid);
if (!NT_SUCCESS(Status))
{
ERR("LsapSetLogonSessionData failed (Status 0x%08lx)\n", Status);
Modified: trunk/reactos/dll/win32/lsasrv/lsasrv.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/lsasrv.h?…
==============================================================================
--- trunk/reactos/dll/win32/lsasrv/lsasrv.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/lsasrv/lsasrv.h [iso-8859-1] Mon Sep 26 16:28:10 2016
@@ -450,7 +450,9 @@
LsapSetLogonSessionData(
_In_ PLUID LogonId,
_In_ ULONG LogonType,
- _In_ PUNICODE_STRING UserName);
+ _In_ PUNICODE_STRING UserName,
+ _In_ PUNICODE_STRING LogonDomain,
+ _In_ PSID Sid);
NTSTATUS
LsapEnumLogonSessions(IN OUT PLSA_API_MSG RequestMsg);
Modified: trunk/reactos/dll/win32/lsasrv/session.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/session.c…
==============================================================================
--- trunk/reactos/dll/win32/lsasrv/session.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/lsasrv/session.c [iso-8859-1] Mon Sep 26 16:28:10 2016
@@ -67,9 +67,12 @@
LsapSetLogonSessionData(
_In_ PLUID LogonId,
_In_ ULONG LogonType,
- _In_ PUNICODE_STRING UserName)
+ _In_ PUNICODE_STRING UserName,
+ _In_ PUNICODE_STRING LogonDomain,
+ _In_ PSID Sid)
{
PLSAP_LOGON_SESSION Session;
+ ULONG Length;
TRACE("LsapSetLogonSessionData(%p)\n", LogonId);
@@ -88,6 +91,22 @@
Session->UserName.Length = UserName->Length;
Session->UserName.MaximumLength = UserName->MaximumLength;
RtlCopyMemory(Session->UserName.Buffer, UserName->Buffer,
UserName->MaximumLength);
+
+ TRACE("LogonDomain %wZ\n", LogonDomain);
+ Session->LogonDomain.Buffer = RtlAllocateHeap(RtlGetProcessHeap(),
HEAP_ZERO_MEMORY, LogonDomain->MaximumLength);
+ if (Session->LogonDomain.Buffer == NULL)
+ return STATUS_INSUFFICIENT_RESOURCES;
+
+ Session->LogonDomain.Length = LogonDomain->Length;
+ Session->LogonDomain.MaximumLength = LogonDomain->MaximumLength;
+ RtlCopyMemory(Session->LogonDomain.Buffer, LogonDomain->Buffer,
LogonDomain->MaximumLength);
+
+ Length = RtlLengthSid(Sid);
+ Session->Sid = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, Length);
+ if (Session->UserName.Buffer == NULL)
+ return STATUS_INSUFFICIENT_RESOURCES;
+
+ RtlCopyMemory(Session->Sid, Sid, Length);
return STATUS_SUCCESS;
}