From 5fbf573cd341316c716de930793088b0aa9be177 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 19 Jul 2007 07:24:17 +0000 Subject: [PATCH] * dcrt0.cc (dll_crt0_0): Call set_cygwin_privileges here, after initializing hProcToken. * sec_helper.cc (init_global_security): Don't call set_cygwin_privileges here. --- winsup/cygwin/ChangeLog | 6 ++++++ winsup/cygwin/dcrt0.cc | 2 ++ winsup/cygwin/sec_helper.cc | 2 -- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 73e0f392a..c47df0116 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2007-07-19 Corinna Vinschen + + * dcrt0.cc (dll_crt0_0): Call set_cygwin_privileges here, after + initializing hProcToken. + * sec_helper.cc (init_global_security): Don't call set_cygwin_privileges here. + 2007-07-18 Corinna Vinschen * cygheap.h (shared_prefix): De-const. diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index 03cb3ffae..9e02a6fb8 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -734,7 +734,9 @@ dll_crt0_0 () DuplicateHandle (hMainProc, GetCurrentThread (), hMainProc, &hMainThread, 0, false, DUPLICATE_SAME_ACCESS); + OpenProcessToken (hMainProc, MAXIMUM_ALLOWED, &hProcToken); + set_cygwin_privileges (hProcToken); device::init (); do_global_ctors (&__CTOR_LIST__, 1); diff --git a/winsup/cygwin/sec_helper.cc b/winsup/cygwin/sec_helper.cc index 22809a34f..416488a33 100644 --- a/winsup/cygwin/sec_helper.cc +++ b/winsup/cygwin/sec_helper.cc @@ -530,8 +530,6 @@ init_global_security () sec_none.lpSecurityDescriptor = sec_none_nih.lpSecurityDescriptor = NULL; sec_all.lpSecurityDescriptor = sec_all_nih.lpSecurityDescriptor = get_null_sd (); - - set_cygwin_privileges (hProcToken); } bool