Reset HOME for "sudo -i" even if HOME was listed in env_keep.

This commit is contained in:
Todd C. Miller
2010-09-14 11:28:40 -04:00
parent ece29bdea1
commit ce942f18c0

View File

@@ -523,8 +523,8 @@ rebuild_env(int noexec)
sudo_setenv("USERNAME", user_name, FALSE);
}
/* If we didn't keep HOME, reset it based on target user. */
if (!ISSET(didvar, KEPT_HOME))
/* If not a login shell and it wasn't kept above, reset HOME. */
if (ISSET(sudo_mode, MODE_LOGIN_SHELL) || !ISSET(didvar, KEPT_HOME))
reset_home = TRUE;
/*