diff --git a/patches/advapi32-Token_Integrity_Level/definition b/patches/advapi32-Token_Integrity_Level/definition index 4ea715ed..01b8ac79 100644 --- a/patches/advapi32-Token_Integrity_Level/definition +++ b/patches/advapi32-Token_Integrity_Level/definition @@ -5,7 +5,6 @@ Depends: advapi32-GetExplicitEntriesFromAclW Depends: kernel32-COMSPEC Depends: kernel32-UmsStubs Depends: ntdll-APC_Start_Process -Depends: ntdll-TokenLogonSid Depends: ntdll-RunlevelInformationInActivationContext Depends: server-CreateProcess_ACLs Depends: server-Misc_ACL diff --git a/patches/ntdll-TokenLogonSid/0001-ntdll-TokenLogonSid-stub-in-NtQueryInformationToken.patch b/patches/ntdll-TokenLogonSid/0001-ntdll-TokenLogonSid-stub-in-NtQueryInformationToken.patch deleted file mode 100644 index 328f0aac..00000000 --- a/patches/ntdll-TokenLogonSid/0001-ntdll-TokenLogonSid-stub-in-NtQueryInformationToken.patch +++ /dev/null @@ -1,94 +0,0 @@ -From 691e58a26a95239493cadde8687b5870cccda501 Mon Sep 17 00:00:00 2001 -From: Andrew Wesie -Date: Wed, 3 May 2017 14:59:38 -0500 -Subject: ntdll: TokenLogonSid stub in NtQueryInformationToken. - -Signed-off-by: Andrew Wesie ---- - dlls/advapi32/tests/security.c | 6 +++--- - dlls/ntdll/nt.c | 28 +++++++++++++++++++++++++++- - 2 files changed, 30 insertions(+), 4 deletions(-) - -diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c -index d41e42e24fa..09f14f0d4eb 100644 ---- a/dlls/advapi32/tests/security.c -+++ b/dlls/advapi32/tests/security.c -@@ -1841,11 +1841,11 @@ static void test_token_attr(void) - todo_wine win_skip("TokenLogonSid not supported. Skipping tests\n"); - else - { -- todo_wine ok(!ret && (GetLastError() == ERROR_INSUFFICIENT_BUFFER), -+ ok(!ret && (GetLastError() == ERROR_INSUFFICIENT_BUFFER), - "GetTokenInformation(TokenLogonSid) failed with error %d\n", GetLastError()); - Groups = HeapAlloc(GetProcessHeap(), 0, Size); - ret = GetTokenInformation(Token, TokenLogonSid, Groups, Size, &Size); -- todo_wine ok(ret, -+ ok(ret, - "GetTokenInformation(TokenLogonSid) failed with error %d\n", GetLastError()); - if (ret) - { -@@ -1858,7 +1858,7 @@ static void test_token_attr(void) - - /* S-1-5-5-0-XXXXXX */ - ret = IsWellKnownSid(Groups->Groups[0].Sid, WinLogonIdsSid); -- ok(ret, "Unknown SID\n"); -+ todo_wine ok(ret, "Unknown SID\n"); - } - } - -diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c -index 8938d5d71c1..31b8bc75f29 100644 ---- a/dlls/ntdll/nt.c -+++ b/dlls/ntdll/nt.c -@@ -254,6 +254,21 @@ NTSTATUS WINAPI NtQueryInformationToken( - ULONG tokeninfolength, - PULONG retlen ) - { -+ static const struct -+ { -+ /* same fields as struct _SID */ -+ BYTE Revision; -+ BYTE SubAuthorityCount; -+ SID_IDENTIFIER_AUTHORITY IdentifierAuthority; -+ DWORD SubAuthority[SECURITY_LOGON_IDS_RID_COUNT]; -+ } -+ logon_sid = -+ { -+ SID_REVISION, -+ SECURITY_LOGON_IDS_RID_COUNT, -+ {SECURITY_NT_AUTHORITY}, -+ {SECURITY_LOGON_IDS_RID, 0, 0} -+ }; - static const ULONG info_len [] = - { - 0, -@@ -284,7 +299,7 @@ NTSTATUS WINAPI NtQueryInformationToken( - sizeof(TOKEN_MANDATORY_LABEL) + sizeof(SID), /* TokenIntegrityLevel [sizeof(SID) includes one SubAuthority] */ - 0, /* TokenUIAccess */ - 0, /* TokenMandatoryPolicy */ -- 0, /* TokenLogonSid */ -+ sizeof(TOKEN_GROUPS) + sizeof(logon_sid), /* TokenLogonSid */ - sizeof(DWORD), /* TokenIsAppContainer */ - 0, /* TokenCapabilities */ - sizeof(TOKEN_APPCONTAINER_INFORMATION) + sizeof(SID), /* TokenAppContainerSid */ -@@ -552,6 +567,17 @@ NTSTATUS WINAPI NtQueryInformationToken( - *(DWORD*)tokeninfo = 0; - break; - } -+ case TokenLogonSid: -+ { -+ TOKEN_GROUPS *groups = tokeninfo; -+ SID *sid = (SID *)(groups + 1); -+ FIXME("QueryInformationToken( ..., TokenLogonSid, ...) semi-stub\n"); -+ groups->GroupCount = 1; -+ groups->Groups[0].Sid = sid; -+ groups->Groups[0].Attributes = 0; -+ memcpy(sid, &logon_sid, sizeof(logon_sid)); -+ } -+ break; - default: - { - ERR("Unhandled Token Information class %d!\n", tokeninfoclass); --- -2.14.1 - diff --git a/patches/ntdll-TokenLogonSid/definition b/patches/ntdll-TokenLogonSid/definition deleted file mode 100644 index aa52b20e..00000000 --- a/patches/ntdll-TokenLogonSid/definition +++ /dev/null @@ -1 +0,0 @@ -Fixes: Implement TokenLogonSid stub in NtQueryInformationToken diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index ad955c87..b85672ac 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -52,7 +52,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "f9181daa1ddc2c10d3b6ddd4610bc1421cfd0f42" + echo "354fa7eb7921c3317e7943c18871febe5570dd52" } # Show version information @@ -294,7 +294,6 @@ patch_enable_all () enable_ntdll_SystemRoot_Symlink="$1" enable_ntdll_ThreadTime="$1" enable_ntdll_Threading="$1" - enable_ntdll_TokenLogonSid="$1" enable_ntdll_User_Shared_Data="$1" enable_ntdll_WRITECOPY="$1" enable_ntdll_Wait_User_APC="$1" @@ -1161,9 +1160,6 @@ patch_enable () ntdll-Threading) enable_ntdll_Threading="$2" ;; - ntdll-TokenLogonSid) - enable_ntdll_TokenLogonSid="$2" - ;; ntdll-User_Shared_Data) enable_ntdll_User_Shared_Data="$2" ;; @@ -2907,9 +2903,6 @@ if test "$enable_advapi32_Token_Integrity_Level" -eq 1; then if test "$enable_ntdll_RunlevelInformationInActivationContext" -gt 1; then abort "Patchset ntdll-RunlevelInformationInActivationContext disabled, but advapi32-Token_Integrity_Level depends on that." fi - if test "$enable_ntdll_TokenLogonSid" -gt 1; then - abort "Patchset ntdll-TokenLogonSid disabled, but advapi32-Token_Integrity_Level depends on that." - fi if test "$enable_server_CreateProcess_ACLs" -gt 1; then abort "Patchset server-CreateProcess_ACLs disabled, but advapi32-Token_Integrity_Level depends on that." fi @@ -2922,7 +2915,6 @@ if test "$enable_advapi32_Token_Integrity_Level" -eq 1; then enable_kernel32_UmsStubs=1 enable_ntdll_APC_Start_Process=1 enable_ntdll_RunlevelInformationInActivationContext=1 - enable_ntdll_TokenLogonSid=1 enable_server_CreateProcess_ACLs=1 enable_server_Misc_ACL=1 fi @@ -3269,23 +3261,11 @@ if test "$enable_ntdll_RunlevelInformationInActivationContext" -eq 1; then ) >> "$patchlist" fi -# Patchset ntdll-TokenLogonSid -# | -# | Modified files: -# | * dlls/advapi32/tests/security.c, dlls/ntdll/nt.c -# | -if test "$enable_ntdll_TokenLogonSid" -eq 1; then - patch_apply ntdll-TokenLogonSid/0001-ntdll-TokenLogonSid-stub-in-NtQueryInformationToken.patch - ( - printf '%s\n' '+ { "Andrew Wesie", "ntdll: TokenLogonSid stub in NtQueryInformationToken.", 1 },'; - ) >> "$patchlist" -fi - # Patchset advapi32-Token_Integrity_Level # | # | This patchset has the following (direct or indirect) dependencies: # | * Staging, advapi32-CreateRestrictedToken, advapi32-GetExplicitEntriesFromAclW, kernel32-COMSPEC, kernel32-UmsStubs, -# | ntdll-APC_Start_Process, ntdll-RunlevelInformationInActivationContext, ntdll-TokenLogonSid, server-CreateProcess_ACLs, +# | ntdll-APC_Start_Process, ntdll-RunlevelInformationInActivationContext, server-CreateProcess_ACLs, # | server-Misc_ACL # | # | This patchset fixes the following Wine bugs: