* cygheap.h (class cygheap_user): Use INVALID_HANDLE_VALUE as invalid

value for tokens.
	* syscalls.cc (seteuid32): Ditto.  Set new_token to process token if
	process token is suitable.
	* uinfo.cc (uinfo_init): Initialize tokens in cygheap user info
	to INVALID_HANDLE_VALUE.

	* cygheap.h (enum impersonation): Delete.
	(cygheap_user::impersonation_state): Delete.
	(cygheap_user::current_token): New.
	(cygheap_user::issetuid): Modify to use current_token.
	(cygheap_user::token): Ditto.
	(cygheap_user::deimpersonate): Ditto.
	(cygheap_user::reimpersonate): Ditto.
	(cygheap_user::has_impersonation_tokens): Ditto.
	(cygheap_user::close_impersonation_tokens): Ditto.
	* security.cc (cygwin_set_impersonation_token): Always set the token.
	(verify_token): Change type of gsid to cygpsid.
	(get_file_attribute): Use the effective ids.
	* syscalls.cc (seteuid32): Modify to use cygheap_user::current_token.
	* uinfo.cc (uinfo_init) Do not set cygheap->user.impersonation_state.
This commit is contained in:
Corinna Vinschen
2003-07-14 17:04:21 +00:00
parent 9ff631a70c
commit ea3ba11499
5 changed files with 106 additions and 115 deletions

View File

@@ -122,7 +122,9 @@ uinfo_init ()
cygheap->user.orig_uid = cygheap->user.real_uid = myself->uid;
cygheap->user.orig_gid = cygheap->user.real_gid = myself->gid;
cygheap->user.impersonation_state = IMP_NONE;
cygheap->user.external_token = INVALID_HANDLE_VALUE;
cygheap->user.internal_token = INVALID_HANDLE_VALUE;
cygheap->user.current_token = INVALID_HANDLE_VALUE;
cygheap->user.set_orig_sid (); /* Update the original sid */
}