diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2001-10-22 22:31:00 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2001-10-22 22:31:00 +0400 |
commit | 65d1068cb8f5cc2a2e291d3e45594b260762aa61 (patch) | |
tree | 5e6aa07130a141b4c6f33f1c68bee3b4e29270b4 /winsup/cygwin/syscalls.cc | |
parent | 333d60984389f9e0173c60d6016ac36099686b59 (diff) |
Patch suggested by Ian Ray <ian.ray@nokia.com>:
* syscalls.cc (seteuid): Unset environment variables HOMEDRIVE and
HOMEPATH before calling internal_getlogin().
* uinfo.cc (internal_getlogin): Use default HOMEPATH and HOMEDRIVE
from environment if both are present, else query NetUserGetInfo().
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r-- | winsup/cygwin/syscalls.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 1fa7c37ee..9d9eaeb89 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -2031,6 +2031,11 @@ seteuid (uid_t uid) retrieving user's SID. */ user.token = cygheap->user.impersonated ? cygheap->user.token : INVALID_HANDLE_VALUE; + /* Unsetting these both env vars is necessary to get NetUserGetInfo() + called in internal_getlogin (). Otherwise the wrong path is used + after a user switch, probably. */ + unsetenv ("HOMEDRIVE"); + unsetenv ("HOMEPATH"); struct passwd *pw_cur = internal_getlogin (user); if (pw_cur != pw_new) { |