diff options
author | Pierre Humblet <phumblet@phumblet.no-ip.org> | 2004-10-28 01:46:01 +0000 |
---|---|---|
committer | Pierre Humblet <phumblet@phumblet.no-ip.org> | 2004-10-28 01:46:01 +0000 |
commit | 531979231dd850a920af0a65bc70d5178ae14fec (patch) | |
tree | cedf7460fe072dba7976a95693dd5aab3ca4fc5f /winsup/cygwin/cygheap.h | |
parent | 39055108341fae0ca71ef503267d8f619e59a047 (diff) | |
download | cygnal-531979231dd850a920af0a65bc70d5178ae14fec.tar.gz cygnal-531979231dd850a920af0a65bc70d5178ae14fec.tar.bz2 cygnal-531979231dd850a920af0a65bc70d5178ae14fec.zip |
2004-10-28 Pierre Humblet <pierre.humblet@ieee.org>
* path.cc (mount_info::from_registry): Deimpersonate while
accessing HKLM.
(mount_info::read_cygdrive_info_from_registry): Ditto.
* cygheap.h: Define NO_IMPERSONATION.
(cygheap_user::issetuid): Replace INVALID_HANDLE_VALUE by
NO_IMPERSONATION.
(cygheap_user::has_impersonation_tokens): Ditto.
(cygheap_user::close_impersonation_tokens): Ditto.
* uinfo.cc (uinfo_init): Ditto.
* syscalls.cc (seteuid32): Ditto.
* security.cc (set_impersonation_token): Ditto.
Diffstat (limited to 'winsup/cygwin/cygheap.h')
-rw-r--r-- | winsup/cygwin/cygheap.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/winsup/cygwin/cygheap.h b/winsup/cygwin/cygheap.h index 80abe6e2c..2feff8518 100644 --- a/winsup/cygwin/cygheap.h +++ b/winsup/cygwin/cygheap.h @@ -169,7 +169,8 @@ public: PSID sid () { return effec_cygsid; } PSID saved_sid () { return saved_cygsid; } const char *ontherange (homebodies what, struct passwd * = NULL); - bool issetuid () const { return current_token != INVALID_HANDLE_VALUE; } +#define NO_IMPERSONATION NULL + bool issetuid () const { return current_token != NO_IMPERSONATION; } HANDLE token () { return current_token; } void deimpersonate () { @@ -183,26 +184,26 @@ public: system_printf ("ImpersonateLoggedOnUser: %E"); } bool has_impersonation_tokens () - { return external_token != INVALID_HANDLE_VALUE - || internal_token != INVALID_HANDLE_VALUE - || current_token != INVALID_HANDLE_VALUE; } + { return external_token != NO_IMPERSONATION + || internal_token != NO_IMPERSONATION + || current_token != NO_IMPERSONATION; } void close_impersonation_tokens () { - if (current_token != INVALID_HANDLE_VALUE) + if (current_token != NO_IMPERSONATION) { if( current_token != external_token && current_token != internal_token) CloseHandle (current_token); - current_token = INVALID_HANDLE_VALUE; + current_token = NO_IMPERSONATION; } - if (external_token != INVALID_HANDLE_VALUE) + if (external_token != NO_IMPERSONATION) { CloseHandle (external_token); - external_token = INVALID_HANDLE_VALUE; + external_token = NO_IMPERSONATION; } - if (internal_token != INVALID_HANDLE_VALUE) + if (internal_token != NO_IMPERSONATION) { CloseHandle (internal_token); - internal_token = INVALID_HANDLE_VALUE; + internal_token = NO_IMPERSONATION; } } const char *cygheap_user::test_uid (char *&, const char *, size_t) |