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/getgrent.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/getgrent.c')
-rw-r--r-- | lib/libc/gen/getgrent.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libc/gen/getgrent.c b/lib/libc/gen/getgrent.c index 18f64a8..f9480c3 100644 --- a/lib/libc/gen/getgrent.c +++ b/lib/libc/gen/getgrent.c @@ -810,7 +810,7 @@ files_setgrent(void *retval, void *mdata, va_list ap) if (st->fp != NULL) rewind(st->fp); else if (stayopen) - st->fp = fopen(_PATH_GROUP, "r"); + st->fp = fopen(_PATH_GROUP, "re"); break; case ENDGRENT: if (st->fp != NULL) { @@ -861,7 +861,7 @@ files_group(void *retval, void *mdata, va_list ap) if (*errnop != 0) return (NS_UNAVAIL); if (st->fp == NULL && - ((st->fp = fopen(_PATH_GROUP, "r")) == NULL)) { + ((st->fp = fopen(_PATH_GROUP, "re")) == NULL)) { *errnop = errno; return (NS_UNAVAIL); } @@ -1251,7 +1251,7 @@ compat_setgrent(void *retval, void *mdata, va_list ap) if (st->fp != NULL) rewind(st->fp); else if (stayopen) - st->fp = fopen(_PATH_GROUP, "r"); + st->fp = fopen(_PATH_GROUP, "re"); set_setent(dtab, mdata); (void)_nsdispatch(NULL, dtab, NSDB_GROUP_COMPAT, "setgrent", compatsrc, 0); @@ -1335,7 +1335,7 @@ compat_group(void *retval, void *mdata, va_list ap) if (*errnop != 0) return (NS_UNAVAIL); if (st->fp == NULL && - ((st->fp = fopen(_PATH_GROUP, "r")) == NULL)) { + ((st->fp = fopen(_PATH_GROUP, "re")) == NULL)) { *errnop = errno; rv = NS_UNAVAIL; goto fin; |