[PATCH 0/2] MR482: advapi32/tests: Test kernel object security with the primary token as well.
From: Jinoh Kang <jinoh.kang.kr(a)gmail.com> Ensure that all handles to mutex and event objects are closed, so that their names are actually deleted from the namespace. --- dlls/advapi32/tests/security.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index aeee279a86d..882a346b46a 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -5546,6 +5546,7 @@ static void test_mutex_security(HANDLE token) ok(!dup, "OpenMutex should fail\n"); todo_wine ok(GetLastError() == ERROR_ACCESS_DENIED, "wrong error %lu\n", GetLastError()); + if (dup) CloseHandle(dup); } test_default_handle_security(token, mutex, &mapping); @@ -5603,6 +5604,7 @@ static void test_event_security(HANDLE token) ok(!dup, "OpenEvent should fail\n"); todo_wine ok(GetLastError() == ERROR_ACCESS_DENIED, "wrong error %lu\n", GetLastError()); + if (dup) CloseHandle(dup); } test_default_handle_security(token, event, &mapping); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/482
From: Jinoh Kang <jinoh.kang.kr(a)gmail.com> --- dlls/advapi32/tests/security.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index 882a346b46a..33ff7e08978 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -6232,6 +6232,7 @@ static void test_kernel_objects_security(void) { HANDLE token, process_token; DWORD ret, token_type; + int i; ret = OpenProcessToken(GetCurrentProcess(), TOKEN_DUPLICATE | TOKEN_QUERY, &process_token); ok(ret, "OpenProcessToken error %ld\n", GetLastError()); @@ -6247,11 +6248,17 @@ static void test_kernel_objects_security(void) ok(ret, "access token should be a valid impersonation token\n"); ok(token_type == TokenImpersonation, "expected TokenImpersonation, got %ld\n", token_type); - test_mutex_security(token); - test_event_security(token); - test_named_pipe_security(token); - test_semaphore_security(token); - test_file_security(token); + for (i = 0; i < 2; i++) + { + HANDLE cur_token = i ? process_token : token; + winetest_push_context("with %s token", i ? "process" : "impersonation"); + test_mutex_security(cur_token); + test_event_security(cur_token); + test_named_pipe_security(cur_token); + test_semaphore_security(cur_token); + test_file_security(cur_token); + winetest_pop_context(); + } test_filemap_security(); test_thread_security(); test_process_access(); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/482
This merge request was closed by Jinoh Kang. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/482
participants (2)
-
Jinoh Kang -
Jinoh Kang (@iamahuman)