https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f559f63063a64aba3f489aef210a9848a0850d48

commit f559f63063a64aba3f489aef210a9848a0850d48
Author:     George Bișoc <[email protected]>
AuthorDate: Sun Feb 13 19:12:19 2022 +0100
Commit:     George Bișoc <[email protected]>
CommitDate: Fri May 6 10:09:52 2022 +0200

    [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.
---
 base/system/services/security.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/base/system/services/security.c b/base/system/services/security.c
index b2639e95a20..2e8f284a714 100644
--- a/base/system/services/security.c
+++ b/base/system/services/security.c
@@ -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;
 

Reply via email to