Author: ekohl
Date: Sun Sep 15 12:41:48 2013
New Revision: 60128
URL:
http://svn.reactos.org/svn/reactos?rev=60128&view=rev
Log:
[SAMSRV]
Add the INTERACTIVE and Authenticated Users SIDs to the Users alias.
Modified:
trunk/reactos/dll/win32/samsrv/setup.c
Modified: trunk/reactos/dll/win32/samsrv/setup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/setup.c?r…
==============================================================================
--- trunk/reactos/dll/win32/samsrv/setup.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/samsrv/setup.c [iso-8859-1] Sun Sep 15 12:41:48 2013
@@ -822,6 +822,8 @@
HANDLE hBuiltinDomainKey = NULL;
HANDLE hAccountDomainKey = NULL;
PSID pBuiltinSid = NULL;
+ PSID pInteractiveSid = NULL;
+ PSID pAuthenticatedUserSid = NULL;
BOOL bResult = TRUE;
PSID pSid;
HINSTANCE hInstance;
@@ -864,6 +866,30 @@
RtlInitializeSid(pBuiltinSid, &SecurityNtAuthority, 1);
*(RtlSubAuthoritySid(pBuiltinSid, 0)) = SECURITY_BUILTIN_DOMAIN_RID;
+
+ /* Create and initialize the Interactive SID */
+ pInteractiveSid = RtlAllocateHeap(RtlGetProcessHeap(), 0, RtlLengthRequiredSid(1));
+ if (pInteractiveSid == NULL)
+ {
+ ERR("Failed to alloacte the Interactive SID\n");
+ bResult = FALSE;
+ goto done;
+ }
+
+ RtlInitializeSid(pInteractiveSid, &SecurityNtAuthority, 1);
+ *(RtlSubAuthoritySid(pInteractiveSid, 0)) = SECURITY_INTERACTIVE_RID;
+
+ /* Create and initialize the Authenticated User SID */
+ pAuthenticatedUserSid = RtlAllocateHeap(RtlGetProcessHeap(), 0,
RtlLengthRequiredSid(1));
+ if (pAuthenticatedUserSid == NULL)
+ {
+ ERR("Failed to alloacte the Authenticated User SID\n");
+ bResult = FALSE;
+ goto done;
+ }
+
+ RtlInitializeSid(pAuthenticatedUserSid, &SecurityNtAuthority, 1);
+ *(RtlSubAuthoritySid(pAuthenticatedUserSid, 0)) = SECURITY_AUTHENTICATED_USER_RID;
/* Get account domain information */
Status = SampGetAccountDomainInfo(&AccountDomainInfo);
@@ -945,6 +971,15 @@
RtlFreeHeap(RtlGetProcessHeap(), 0, pSid);
}
+ /* Add the Interactive SID to the Users alias */
+ SampSetupAddMemberToAlias(hBuiltinDomainKey,
+ DOMAIN_ALIAS_RID_USERS,
+ pInteractiveSid);
+
+ /* Add the Authenticated User SID to the Users alias */
+ SampSetupAddMemberToAlias(hBuiltinDomainKey,
+ DOMAIN_ALIAS_RID_USERS,
+ pAuthenticatedUserSid);
/* Create the Account domain */
Status = SampSetupCreateDomain(hServerKey,
@@ -997,6 +1032,12 @@
if (AccountDomainInfo)
LsaFreeMemory(AccountDomainInfo);
+ if (pAuthenticatedUserSid)
+ RtlFreeHeap(RtlGetProcessHeap(), 0, pAuthenticatedUserSid);
+
+ if (pInteractiveSid)
+ RtlFreeHeap(RtlGetProcessHeap(), 0, pInteractiveSid);
+
if (pBuiltinSid)
RtlFreeHeap(RtlGetProcessHeap(), 0, pBuiltinSid);