summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/syscalls.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r--winsup/cygwin/syscalls.cc5
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)
{