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

1
sudo.c
View File

@@ -214,6 +214,7 @@ main(argc, argv, envp)
dump_auth_methods(); dump_auth_methods();
dump_defaults(); dump_defaults();
dump_interfaces(); dump_interfaces();
dump_badenv();
} }
exit(0); exit(0);
break; break;

1
sudo.h
View File

@@ -212,6 +212,7 @@ VOID *erealloc __P((VOID *, size_t));
char *estrdup __P((const char *)); char *estrdup __P((const char *));
int easprintf __P((char **, const char *, ...)); int easprintf __P((char **, const char *, ...));
int evasprintf __P((char **, const char *, va_list)); int evasprintf __P((char **, const char *, va_list));
void dump_badenv __P((void));
void dump_defaults __P((void)); void dump_defaults __P((void));
void dump_auth_methods __P((void)); void dump_auth_methods __P((void));
int lock_file __P((int, int)); int lock_file __P((int, int));