Preserve SHELL variable for "sudo -s". Otherwise we can end up
with a situation where the SHELL variable and the actual shell being run do not match.
This commit is contained in:
@@ -390,6 +390,10 @@ matches_env_keep(const char *var)
|
||||
size_t len;
|
||||
int iswild, keepit = FALSE;
|
||||
|
||||
/* Preserve SHELL variable for "sudo -s". */
|
||||
if (ISSET(sudo_mode, MODE_SHELL) && strncmp(var, "SHELL=", 6) == 0)
|
||||
return TRUE;
|
||||
|
||||
for (cur = def_env_keep; cur; cur = cur->next) {
|
||||
len = strlen(cur->value);
|
||||
/* Deal with '*' wildcard */
|
||||
|
Reference in New Issue
Block a user