diff options
author | 2013-01-18 11:13:38 +0000 | |
---|---|---|
committer | 2013-01-18 11:13:38 +0000 | |
commit | 9b57625df1b12fc25b9c843a41a8d4dd1a9e2ded (patch) | |
tree | 525269b87f06084d62ab70664db860416e589311 | |
parent | oops. this kassert should have gone with the B_NOTMAPPED commit (diff) | |
download | wireguard-openbsd-9b57625df1b12fc25b9c843a41a8d4dd1a9e2ded.tar.xz wireguard-openbsd-9b57625df1b12fc25b9c843a41a8d4dd1a9e2ded.zip |
Use open(O_CLOEXEC) instead of a separate fcntl(FD_CLOEXEC) call.
Nudged by David Hill
-rw-r--r-- | usr.bin/passwd/local_passwd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/passwd/local_passwd.c b/usr.bin/passwd/local_passwd.c index cdac5fed743..1ad540d63d7 100644 --- a/usr.bin/passwd/local_passwd.c +++ b/usr.bin/passwd/local_passwd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: local_passwd.c,v 1.40 2009/10/27 23:59:41 deraadt Exp $ */ +/* $OpenBSD: local_passwd.c,v 1.41 2013/01/18 11:13:38 guenther Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -130,8 +130,8 @@ local_passwd(char *uname, int authenticated) } if (i >= 4) fputc('\n', stderr); - pfd = open(_PATH_MASTERPASSWD, O_RDONLY, 0); - if (pfd < 0 || fcntl(pfd, F_SETFD, FD_CLOEXEC) == -1) + pfd = open(_PATH_MASTERPASSWD, O_RDONLY | O_CLOEXEC, 0); + if (pfd < 0) pw_error(_PATH_MASTERPASSWD, 1, 1); /* Update master.passwd file and rebuild spwd.db. */ |