summaryrefslogtreecommitdiffstats
path: root/lib/libutil/check_expire.c
diff options
context:
space:
mode:
authorokan <okan@openbsd.org>2013-04-29 00:19:19 +0000
committerokan <okan@openbsd.org>2013-04-29 00:19:19 +0000
commit0876a2673a5c0bb03981ebf89b239be1d49ee04d (patch)
treec1ce34051224550002837ec5f9bb25ad89bff5d4 /lib/libutil/check_expire.c
parentPreliminary modifications for Xorg 1bpp server, based on OpenBSD/hp300 (diff)
downloadwireguard-openbsd-0876a2673a5c0bb03981ebf89b239be1d49ee04d.tar.xz
wireguard-openbsd-0876a2673a5c0bb03981ebf89b239be1d49ee04d.zip
use O_CLOEXEC with open() instead of open/fcntl; from David Hill
ok otto
Diffstat (limited to 'lib/libutil/check_expire.c')
-rw-r--r--lib/libutil/check_expire.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libutil/check_expire.c b/lib/libutil/check_expire.c
index 72c789b0be5..8e23a67fb74 100644
--- a/lib/libutil/check_expire.c
+++ b/lib/libutil/check_expire.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: check_expire.c,v 1.8 2004/04/20 23:21:23 millert Exp $ */
+/* $OpenBSD: check_expire.c,v 1.9 2013/04/29 00:19:19 okan Exp $ */
/*
* Copyright (c) 1997 Berkeley Software Design, Inc. All rights reserved.
@@ -173,8 +173,8 @@ pwd_update(const struct passwd *pwd, const struct passwd *opwd)
return("can't open passwd temp file");
}
- pfd = open(_PATH_MASTERPASSWD, O_RDONLY, 0);
- if (pfd < 0 || fcntl(pfd, F_SETFD, 1) == -1) {
+ pfd = open(_PATH_MASTERPASSWD, O_RDONLY|O_CLOEXEC, 0);
+ if (pfd < 0) {
pw_abort();
return(strerror(errno));
}