2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 14:25:15 +00:00

Move endpwent() to be after set_perms(PERM_RUNAS, ...) and also call

endgrent() at the same time.
This commit is contained in:
Todd C. Miller
2002-03-12 03:19:04 +00:00
parent 1c23b1b68a
commit 99cc62452d

7
sudo.c
View File

@@ -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;