summaryrefslogtreecommitdiff
path: root/sudo.c
diff options
context:
space:
mode:
authorTodd C. Miller <Todd.Miller@courtesan.com>2000-05-12 20:55:35 +0000
committerTodd C. Miller <Todd.Miller@courtesan.com>2000-05-12 20:55:35 +0000
commit56cfb1dbe2dba7679b6672d8fae86e3d0a78af43 (patch)
tree0aaa3d5261068df9c2c1d4951a302bbee374f42a /sudo.c
parent6347e9522da41eeae75f9f5822f9aba61790c8b4 (diff)
downloadsudo-56cfb1dbe2dba7679b6672d8fae86e3d0a78af43.tar.gz
Call clean_env very early in main() for paranoia's sake. Idea from
Marc Esipovich.
Diffstat (limited to 'sudo.c')
-rw-r--r--sudo.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sudo.c b/sudo.c
index 0580720a2..903e742c2 100644
--- a/sudo.c
+++ b/sudo.c
@@ -193,6 +193,9 @@ main(argc, argv)
# endif
#endif /* HAVE_GETPRPWNAM && HAVE_SET_AUTH_PARAMETERS */
+ /* Get rid of any nasty bits in the environment. */
+ clean_env(environ, badenv_table);
+
Argv = argv;
Argc = argc;
@@ -272,8 +275,6 @@ main(argc, argv)
if (user_cmnd == NULL && NewArgc == 0)
usage(1);
- clean_env(environ, badenv_table);
-
cmnd_status = init_vars(sudo_mode);
/* At this point, ruid == euid == 0 */