2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-30 22:05:46 +00:00

Eliminate use of setpwent()/endpwent() and setgrent()/endgrent().

Sudo never iterates over the passwd or group file.
Rename sudo_set{pw,gr}ent() -> sudo_mk{pw,gr}cache() and
use sudo_free{pw,gr}cache() instead of sudo_end{pw,gr}ent().
This commit is contained in:
Todd C. Miller
2016-05-11 07:06:45 -06:00
parent 8b4de84049
commit 23d288563e
7 changed files with 29 additions and 57 deletions

View File

@@ -623,9 +623,7 @@ send_mail(const char *fmt, ...)
sudoers_setlocale(SUDOERS_LOCALE_SUDOERS, NULL);
/* Close password, group and other fds so we don't leak. */
sudo_endpwent();
sudo_endgrent();
/* Close fds so we don't leak anything. */
closefrom(STDERR_FILENO + 1);
if (pipe(pfd) == -1) {