Skip to content

Commit f559f63

Browse files
committed
[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.
1 parent f340524 commit f559f63

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

base/system/services/security.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ DWORD
5555
ScmCreateSids(VOID)
5656
{
5757
SID_IDENTIFIER_AUTHORITY NullAuthority = {SECURITY_NULL_SID_AUTHORITY};
58+
SID_IDENTIFIER_AUTHORITY WorldAuthority = {SECURITY_WORLD_SID_AUTHORITY};
5859
SID_IDENTIFIER_AUTHORITY NtAuthority = {SECURITY_NT_AUTHORITY};
5960
PULONG pSubAuthority;
6061
ULONG ulLength1 = RtlLengthRequiredSid(1);
@@ -78,7 +79,7 @@ ScmCreateSids(VOID)
7879
return ERROR_OUTOFMEMORY;
7980
}
8081

81-
RtlInitializeSid(pWorldSid, &NullAuthority, 1);
82+
RtlInitializeSid(pWorldSid, &WorldAuthority, 1);
8283
pSubAuthority = RtlSubAuthoritySid(pWorldSid, 0);
8384
*pSubAuthority = SECURITY_WORLD_RID;
8485

0 commit comments

Comments
 (0)