mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 22:35:10 +00:00
Move endpwent() to be after set_perms(PERM_RUNAS, ...) and also call
endgrent() at the same time.
This commit is contained in:
7
sudo.c
7
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;
|
||||
|
||||
|
Reference in New Issue
Block a user