From fd1bf882f586496e6738df441a116b4cd2a9e875 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 24 Jan 2007 12:14:54 +0000 Subject: [PATCH] * security.h (pop_thread_privilege): Revert to previous state, not to token used for impersonation. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/security.h | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 0c158f2c8..fe75a1b81 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2007-01-24 Corinna Vinschen + + * security.h (pop_thread_privilege): Revert to previous state, not + to token used for impersonation. + 2007-01-24 Corinna Vinschen * cygheap.h (cygheap_user::deimpersonate): Always RevertToSelf. diff --git a/winsup/cygwin/security.h b/winsup/cygwin/security.h index f1d624ff7..6d77716e5 100644 --- a/winsup/cygwin/security.h +++ b/winsup/cygwin/security.h @@ -408,10 +408,10 @@ void set_cygwin_privileges (HANDLE token); #define pop_thread_privilege() \ if (_dup_token) \ { \ - if (_token == hProcToken) \ + if (!cygheap->user.issetuid ()) \ RevertToSelf (); \ else \ - ImpersonateLoggedOnUser (_token); \ + cygheap->user.reimpersonate (); \ CloseHandle (_dup_token); \ } \ }