From: Todd C. Miller Date: Tue, 12 Mar 2002 03:19:04 +0000 (+0000) Subject: Move endpwent() to be after set_perms(PERM_RUNAS, ...) and also call X-Git-Tag: SUDO_1_6_6~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=99cc62452d5ce3d73bbcea2db3a44e4b221414cd;p=sudo Move endpwent() to be after set_perms(PERM_RUNAS, ...) and also call endgrent() at the same time. --- diff --git a/sudo.c b/sudo.c index 39ef205be..b216d8a18 100644 --- a/sudo.c +++ b/sudo.c @@ -370,9 +370,6 @@ main(argc, argv, envp) (void) sigaction(SIGQUIT, &sa, NULL); (void) sigaction(SIGTSTP, &sa, NULL); - /* Close the password file */ - endpwent(); - /* Override user's umask if configured to do so. */ if (def_ival(I_UMASK) != 0777) (void) umask(def_mode(I_UMASK)); @@ -385,6 +382,10 @@ main(argc, argv, envp) /* Become specified user or root. */ set_perms(PERM_RUNAS, sudo_mode); + /* Close the password and group files */ + endpwent(); + endgrent(); + /* Install the new environment. */ environ = new_environ;