[SERVICES] Assign a World identity authority for Everyone SID, not Null authority

The current code allocates memory and initializes the Everyone "World" security identifier but with a Null authority identifier. This is utterly wrong on so many levels, more so partly because a Null authority identifier is 0 so after the Everyone SID is initialized, it is actually initialized as S-1-0-0 instead of S-1-1-0.
This commit is contained in:
George Bișoc
2022-05-06 10:09:52 +02:00
parent f340524ea4
commit f559f63063
+2 -1
View File
@@ -55,6 +55,7 @@ DWORD
ScmCreateSids(VOID)
{
SID_IDENTIFIER_AUTHORITY NullAuthority = {SECURITY_NULL_SID_AUTHORITY};
SID_IDENTIFIER_AUTHORITY WorldAuthority = {SECURITY_WORLD_SID_AUTHORITY};
SID_IDENTIFIER_AUTHORITY NtAuthority = {SECURITY_NT_AUTHORITY};
PULONG pSubAuthority;
ULONG ulLength1 = RtlLengthRequiredSid(1);
@@ -78,7 +79,7 @@ ScmCreateSids(VOID)
return ERROR_OUTOFMEMORY;
}
RtlInitializeSid(pWorldSid, &NullAuthority, 1);
RtlInitializeSid(pWorldSid, &WorldAuthority, 1);
pSubAuthority = RtlSubAuthoritySid(pWorldSid, 0);
*pSubAuthority = SECURITY_WORLD_RID;