summaryrefslogtreecommitdiffstats
path: root/lib/libutil
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2012-12-27 20:24:44 +0000
committerbapt <bapt@FreeBSD.org>2012-12-27 20:24:44 +0000
commit85a7bc88636c4a46a80bb6c42be258f2efc6b20b (patch)
tree8ea4f8c558537571085b253d0a6e095f5eb687fe /lib/libutil
parentcdddb6f42aaffc74cbd40b690c0696055bf7f84d (diff)
downloadFreeBSD-src-85a7bc88636c4a46a80bb6c42be258f2efc6b20b.zip
FreeBSD-src-85a7bc88636c4a46a80bb6c42be258f2efc6b20b.tar.gz
Add O_CLOEXEC to flopen
Requested by: jilles
Diffstat (limited to 'lib/libutil')
-rw-r--r--lib/libutil/gr_util.c2
-rw-r--r--lib/libutil/pw_util.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/libutil/gr_util.c b/lib/libutil/gr_util.c
index 2f87bd1..4583257 100644
--- a/lib/libutil/gr_util.c
+++ b/lib/libutil/gr_util.c
@@ -101,7 +101,7 @@ gr_lock(void)
for (;;) {
struct stat st;
- lockfd = flopen(group_file, O_RDONLY|O_NONBLOCK, 0);
+ lockfd = flopen(group_file, O_RDONLY|O_NONBLOCK|O_CLOEXEC, 0);
if (lockfd == -1) {
if (errno == EWOULDBLOCK) {
errx(1, "the group file is busy");
diff --git a/lib/libutil/pw_util.c b/lib/libutil/pw_util.c
index 24c0263..befd1fb 100644
--- a/lib/libutil/pw_util.c
+++ b/lib/libutil/pw_util.c
@@ -179,7 +179,7 @@ pw_lock(void)
for (;;) {
struct stat st;
- lockfd = flopen(masterpasswd, O_RDONLY|O_NONBLOCK, 0);
+ lockfd = flopen(masterpasswd, O_RDONLY|O_NONBLOCK|O_CLOEXEC, 0);
if (lockfd == -1) {
if (errno == EWOULDBLOCK) {
errx(1, "the password db file is busy");
OpenPOWER on IntegriCloud