mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 06:15:37 +00:00
Dump default bad env table when 'sudo -V' is run by root.
This commit is contained in:
19
env.c
19
env.c
@@ -470,3 +470,22 @@ rebuild_env(sudo_mode, envp)
|
||||
}
|
||||
return(newenvp);
|
||||
}
|
||||
|
||||
void
|
||||
dump_badenv()
|
||||
{
|
||||
struct env_table *entry;
|
||||
int len, iswild;
|
||||
|
||||
/* XXX - mark the ones that are just 'check' */
|
||||
puts("Default table of environment variables to clear");
|
||||
for (entry = sudo_badenv_table; entry->name; entry++) {
|
||||
len = strlen(entry->name);
|
||||
if (entry->name[len - 1] == '=') {
|
||||
iswild = 0;
|
||||
len--;
|
||||
} else
|
||||
iswild = 1;
|
||||
printf("\t%.*s%s\n", len, entry->name, iswild ? "*" : "");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user