From cb1f62156e0661f733d4a54b81cc77433776b8f2 Mon Sep 17 00:00:00 2001 From: Shawn Hoffman Date: Fri, 24 Apr 2020 16:43:27 -0700 Subject: [PATCH] Use RtlSubAuthoritySid instead of directly poking SID Signed-off-by: Shawn Hoffman Signed-off-by: Jason A. Donenfeld --- wintun.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wintun.c b/wintun.c index 624de2f..12ef467 100644 --- a/wintun.c +++ b/wintun.c @@ -788,7 +788,7 @@ static NTSTATUS TunInitializeDispatchSecurityDescriptor(VOID) SID LocalSystem = { 0 }; if (!NT_SUCCESS(Status = RtlInitializeSid(&LocalSystem, &NtAuthority, 1))) return Status; - LocalSystem.SubAuthority[0] = 18; + *RtlSubAuthoritySid(&LocalSystem, 0) = SECURITY_LOCAL_SYSTEM_RID; struct { ACL Dacl;