The SHELL environment variable was preserved from the user's

environment instead of being reset based on the passwd database
when the "env_reset" option was used.  Now it is reset as it should be.
This commit is contained in:
Todd C. Miller
2002-01-15 23:43:59 +00:00
parent 5236ceedf7
commit ea24bef19c
3 changed files with 8 additions and 25 deletions

3
sudo.c
View File

@@ -511,7 +511,8 @@ init_vars(sudo_mode)
log_error(0, "uid %ld does not exist in the passwd file!",
(long) pw.pw_uid);
}
user_shell = sudo_user.pw->pw_shell;
if (user_shell == NULL || *user_shell == '\0')
user_shell = sudo_user.pw->pw_shell;
/* It is now safe to use log_error() and set_perms() */