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:
authorPierre Humblet <phumblet@phumblet.no-ip.org>2004-10-28 05:46:01 +0400
committerPierre Humblet <phumblet@phumblet.no-ip.org>2004-10-28 05:46:01 +0400
commit531979231dd850a920af0a65bc70d5178ae14fec (patch)
treecedf7460fe072dba7976a95693dd5aab3ca4fc5f /winsup/cygwin/cygheap.h
parent39055108341fae0ca71ef503267d8f619e59a047 (diff)
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.h21
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)