* cygheap.h (cygheap_user::issetuid): New method.
* dtable.cc (dtable::vfork_child_dup): Use new method to determine if we are in "setuid mode." * fork.cc (fork_parent): Ditto. * spawn.cc (spawn_guts): Ditto. * syscalls.cc (seteuid32): Ditto. (setegid32): Ditto. * environ.cc (spenv::retrieve): (Suggested by Pierre Humblet) Do potential recalculation of cygheap_user stuff when in setuid mode. Return special value when environment variable exists but should not be added. (build_env): Don't add retrieved value to dstp if it is 'dont_add'.
This commit is contained in:
@ -144,6 +144,10 @@ public:
|
||||
PSID sid () const { return psid; }
|
||||
PSID orig_sid () const { return orig_psid; }
|
||||
const char *ontherange (homebodies what, struct passwd * = NULL);
|
||||
bool issetuid () const
|
||||
{
|
||||
return impersonated && token != INVALID_HANDLE_VALUE;
|
||||
}
|
||||
};
|
||||
|
||||
/* cwd cache stuff. */
|
||||
|
Reference in New Issue
Block a user