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);
|
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
1
sudo.c
@@ -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
1
sudo.h
@@ -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));
|
||||||
|
Reference in New Issue
Block a user