From 9e2db30661ea495328a1e828c277d05319d2692b Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Thu, 9 Oct 2014 12:43:38 -0600 Subject: [PATCH] Fix possible CloseHandle on bad token in the Default Folder ACLs patch. --- ...l32-Set-the-default-security-attributes-for-user.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/patches/shell32-Default_Folder_ACLs/0001-shell32-Set-the-default-security-attributes-for-user.patch b/patches/shell32-Default_Folder_ACLs/0001-shell32-Set-the-default-security-attributes-for-user.patch index a5bd2516..292d019a 100644 --- a/patches/shell32-Default_Folder_ACLs/0001-shell32-Set-the-default-security-attributes-for-user.patch +++ b/patches/shell32-Default_Folder_ACLs/0001-shell32-Set-the-default-security-attributes-for-user.patch @@ -1,4 +1,4 @@ -From 2da338393244264d5a5e872b0dd0198cd32e501c Mon Sep 17 00:00:00 2001 +From 5acc23c9ced211c685c64716f20eecbdb8f2aa27 Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Tue, 25 Feb 2014 10:44:36 -0700 Subject: shell32: Set the default security attributes for user shell folders. @@ -8,7 +8,7 @@ Subject: shell32: Set the default security attributes for user shell folders. 1 file changed, 100 insertions(+), 1 deletion(-) diff --git a/dlls/shell32/shellpath.c b/dlls/shell32/shellpath.c -index f92d56e..ef83065 100644 +index f92d56e..0ca7211 100644 --- a/dlls/shell32/shellpath.c +++ b/dlls/shell32/shellpath.c @@ -2200,6 +2200,85 @@ cleanup: @@ -33,8 +33,8 @@ index f92d56e..ef83065 100644 + + if (!OpenThreadToken(GetCurrentThread(), TOKEN_READ, TRUE, &token)) + { -+ if (GetLastError() != ERROR_NO_TOKEN) goto cleanup; -+ if (!OpenProcessToken(GetCurrentProcess(), TOKEN_READ, &token)) goto cleanup; ++ if (GetLastError() != ERROR_NO_TOKEN) return NULL; ++ if (!OpenProcessToken(GetCurrentProcess(), TOKEN_READ, &token)) return NULL; + } + GetTokenInformation(token, TokenUser, NULL, 0, &user_size); + if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) goto cleanup;