2
0
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:
Todd C. Miller
2001-11-12 18:08:30 +00:00
parent c4c0f0046e
commit 63ae9ec2ad
3 changed files with 21 additions and 0 deletions

19
env.c
View File

@@ -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 ? "*" : "");
}
}