diff options
author | jilles <jilles@FreeBSD.org> | 2012-12-10 17:56:51 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2012-12-10 17:56:51 +0000 |
commit | c8062fa2a473cce32f1049fa8353dea6b9cdb3f2 (patch) | |
tree | 9f5cc2b7405bf9c939ab0a429b81f41e3fce190b /lib/libc/gen/getnetgrent.c | |
parent | 8f8a6363fa6769d8a9a530131101dfc5972b9cc9 (diff) | |
download | FreeBSD-src-c8062fa2a473cce32f1049fa8353dea6b9cdb3f2.zip FreeBSD-src-c8062fa2a473cce32f1049fa8353dea6b9cdb3f2.tar.gz |
libc: Make various internal file descriptors close-on-exec.
These are obtained via fopen().
Diffstat (limited to 'lib/libc/gen/getnetgrent.c')
-rw-r--r-- | lib/libc/gen/getnetgrent.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/gen/getnetgrent.c b/lib/libc/gen/getnetgrent.c index 51b3e37..4c56461 100644 --- a/lib/libc/gen/getnetgrent.c +++ b/lib/libc/gen/getnetgrent.c @@ -173,7 +173,7 @@ setnetgrent(const char *group) if (((stat(_PATH_NETGROUP, &_yp_statp) < 0) && errno == ENOENT) || _yp_statp.st_size == 0) _use_only_yp = _netgr_yp_enabled = 1; - if ((netf = fopen(_PATH_NETGROUP,"r")) != NULL ||_use_only_yp){ + if ((netf = fopen(_PATH_NETGROUP,"re")) != NULL ||_use_only_yp){ /* * Icky: grab the first character of the netgroup file * and turn on NIS if it's a '+'. rewind the stream @@ -197,7 +197,7 @@ setnetgrent(const char *group) return; } #else - if ((netf = fopen(_PATH_NETGROUP, "r"))) { + if ((netf = fopen(_PATH_NETGROUP, "re"))) { #endif if (parse_netgrp(group)) endnetgrent(); |