From: Todd C. Miller Date: Mon, 12 Nov 2001 18:08:30 +0000 (+0000) Subject: Dump default bad env table when 'sudo -V' is run by root. X-Git-Tag: SUDO_1_6_4~161 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=63ae9ec2ad180d1bf4ab0ead83de57b52896e6cf;p=sudo Dump default bad env table when 'sudo -V' is run by root. --- diff --git a/env.c b/env.c index 0027a4cce..739216382 100644 --- a/env.c +++ b/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 ? "*" : ""); + } +} diff --git a/sudo.c b/sudo.c index cdcc32a92..5728316a5 100644 --- a/sudo.c +++ b/sudo.c @@ -214,6 +214,7 @@ main(argc, argv, envp) dump_auth_methods(); dump_defaults(); dump_interfaces(); + dump_badenv(); } exit(0); break; diff --git a/sudo.h b/sudo.h index f34274b04..58fa93415 100644 --- a/sudo.h +++ b/sudo.h @@ -212,6 +212,7 @@ VOID *erealloc __P((VOID *, size_t)); char *estrdup __P((const char *)); int easprintf __P((char **, const char *, ...)); int evasprintf __P((char **, const char *, va_list)); +void dump_badenv __P((void)); void dump_defaults __P((void)); void dump_auth_methods __P((void)); int lock_file __P((int, int));