diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2001-06-04 14:29:54 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2001-06-04 14:29:54 +0000 |
commit | f7fa593d6b33a17dd543ea12df02625c409ecf0e (patch) | |
tree | 63021ea0fa9ffdd61294238ea7150b66d7671c7d | |
parent | ac5561f2ed95d2ffcb81723d9556aadc1768ca04 (diff) | |
download | cygnal-f7fa593d6b33a17dd543ea12df02625c409ecf0e.tar.gz cygnal-f7fa593d6b33a17dd543ea12df02625c409ecf0e.tar.bz2 cygnal-f7fa593d6b33a17dd543ea12df02625c409ecf0e.zip |
* cygheap.h (cygheap_user::cygheap_user): Initialize token to
INVALID_HANDLE_VALUE.
* uinfo.cc (uinfo_init): Close token handle if needed.
-rw-r--r-- | winsup/cygwin/ChangeLog | 6 | ||||
-rw-r--r-- | winsup/cygwin/cygheap.h | 3 | ||||
-rw-r--r-- | winsup/cygwin/uinfo.cc | 2 |
3 files changed, 10 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 820c41f32..c4cf3bb2d 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +Mon Jun 4 16:21:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (cygheap_user::cygheap_user): Initialize token to + INVALID_HANDLE_VALUE. + * uinfo.cc (uinfo_init): Close token handle if needed. + Sun Jun 3 20:52:13 2001 Christopher Faylor <cgf@cygnus.com> * path.cc (normalize_posix_path): Revert .. check removed by previous diff --git a/winsup/cygwin/cygheap.h b/winsup/cygwin/cygheap.h index 6348590a2..a5c823f74 100644 --- a/winsup/cygwin/cygheap.h +++ b/winsup/cygwin/cygheap.h @@ -107,7 +107,8 @@ public: HANDLE token; BOOL impersonated; - cygheap_user () : pname (NULL), plogsrv (NULL), pdomain (NULL), psid (NULL) {} + cygheap_user () : pname (NULL), plogsrv (NULL), pdomain (NULL), + psid (NULL), token (INVALID_HANDLE_VALUE) {} ~cygheap_user (); void set_name (const char *new_name); diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc index b024396e8..a3b734ebf 100644 --- a/winsup/cygwin/uinfo.cc +++ b/winsup/cygwin/uinfo.cc @@ -161,6 +161,8 @@ uinfo_init () Setting `impersonated' to TRUE seems to be wrong but it isn't. Impersonated is thought as "Current User and `token' are coincident". See seteuid() for the mechanism behind that. */ + if (cygheap->user.token != INVALID_HANDLE_VALUE) + CloseHandle (cygheap->user.token); cygheap->user.token = INVALID_HANDLE_VALUE; cygheap->user.impersonated = TRUE; |