Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2007-02-23 18:15:50 +0300
committerCorinna Vinschen <corinna@vinschen.de>2007-02-23 18:15:50 +0300
commita76877e977ff264e44c4d9278920fe511fc73dd4 (patch)
tree77a3e569e9e5a248cf845f89d7e8eb6ba6193f2f /winsup/cygwin/security.h
parent9fa43ff6c61626df04f9b87c09f5233ba07a608d (diff)
Throughout remove all usage of wincap.has_security.
* environ.cc (environ_init): Drop setting allow_ntsec here. * grp.cc (initgroups32): Drop usage of label "out". * security.cc (allow_ntsec): Set to true by default. * syscalls.cc (seteuid32): Remove label success_9x. * wincap.cc: Remove has_security throughout. * wincap.h: Ditto.
Diffstat (limited to 'winsup/cygwin/security.h')
-rw-r--r--winsup/cygwin/security.h27
1 files changed, 13 insertions, 14 deletions
diff --git a/winsup/cygwin/security.h b/winsup/cygwin/security.h
index 6d77716e5..a5c9c69ce 100644
--- a/winsup/cygwin/security.h
+++ b/winsup/cygwin/security.h
@@ -388,20 +388,18 @@ void set_cygwin_privileges (HANDLE token);
#define set_process_privilege(p,v) set_privilege (hProcToken, (p), (v))
#define _push_thread_privilege(_priv, _val, _check) { \
- HANDLE _token = NULL, _dup_token = NULL; \
- if (wincap.has_security ()) \
- { \
- _token = (cygheap->user.issetuid () && (_check)) \
- ? cygheap->user.token () : hProcToken; \
- if (!DuplicateTokenEx (_token, MAXIMUM_ALLOWED, NULL, \
- SecurityImpersonation, TokenImpersonation, \
- &_dup_token)) \
- debug_printf ("DuplicateTokenEx: %E"); \
- else if (!ImpersonateLoggedOnUser (_dup_token)) \
- debug_printf ("ImpersonateLoggedOnUser: %E"); \
- else \
- set_privilege (_dup_token, (_priv), (_val)); \
- }
+ HANDLE _dup_token = NULL; \
+ HANDLE _token = (cygheap->user.issetuid () && (_check)) \
+ ? cygheap->user.token () : hProcToken; \
+ if (!DuplicateTokenEx (_token, MAXIMUM_ALLOWED, NULL, \
+ SecurityImpersonation, TokenImpersonation, \
+ &_dup_token)) \
+ debug_printf ("DuplicateTokenEx: %E"); \
+ else if (!ImpersonateLoggedOnUser (_dup_token)) \
+ debug_printf ("ImpersonateLoggedOnUser: %E"); \
+ else \
+ set_privilege (_dup_token, (_priv), (_val));
+
#define push_thread_privilege(_priv, _val) _push_thread_privilege(_priv,_val,1)
#define push_self_privilege(_priv, _val) _push_thread_privilege(_priv,_val,0)
@@ -415,6 +413,7 @@ void set_cygwin_privileges (HANDLE token);
CloseHandle (_dup_token); \
} \
}
+
#define pop_self_privilege() pop_thread_privilege()
/* shared.cc: */