mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-22 09:57:41 +00:00
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:
parent
b4a48510cd
commit
7a06f32cbb
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user