From 6fa5c415aa0acdbeb8a8b9beba390518489304ab Mon Sep 17 00:00:00 2001 From: guenther <> Date: Mon, 15 Sep 2014 06:15:48 +0000 Subject: When fopen()ing internal to libc (the API doesn't support the use of the resulting FILE *), then pass fopen() the 'e' mode letter to mark it close-on-exec. ok miod@ --- src/lib/libc/net/ruserok.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/libc/net/ruserok.c') diff --git a/src/lib/libc/net/ruserok.c b/src/lib/libc/net/ruserok.c index 21646c156b..4d0adfbe4e 100644 --- a/src/lib/libc/net/ruserok.c +++ b/src/lib/libc/net/ruserok.c @@ -118,7 +118,7 @@ iruserok_sa(const void *raddr, int rlen, int superuser, const char *ruser, sa = (struct sockaddr *)raddr; first = 1; - hostf = superuser ? NULL : fopen(_PATH_HEQUIV, "r"); + hostf = superuser ? NULL : fopen(_PATH_HEQUIV, "re"); again: if (hostf) { if (__ivaliduser_sa(hostf, sa, rlen, luser, ruser) == 0) { @@ -144,7 +144,7 @@ again: */ uid = geteuid(); (void)seteuid(pwd->pw_uid); - hostf = fopen(pbuf, "r"); + hostf = fopen(pbuf, "re"); (void)seteuid(uid); if (hostf == NULL) -- cgit v1.2.3-55-g6feb