Create and use private versions of setpwent() and endpwent() that

set/end the shadow password file too.
This commit is contained in:
Todd C. Miller
2004-11-15 04:06:16 +00:00
parent e26e40df8a
commit 0b34123a8b
4 changed files with 50 additions and 15 deletions

View File

@@ -53,6 +53,7 @@
# include "emul/err.h"
#endif /* HAVE_ERR_H */
#include <pwd.h>
#include <grp.h>
#include <signal.h>
#include <time.h>
#include <errno.h>
@@ -494,8 +495,9 @@ send_mail(line)
}
argv[i] = NULL;
/* Close password file so we don't leak the fd. */
endpwent();
/* Close password and group files so we don't leak fds. */
sudo_endpwent();
endgrent();
/*
* Depending on the config, either run the mailer as root