diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2014-10-26 20:38:14 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2014-10-26 20:38:14 +0000 |
commit | 9984f073bd5c5a6aaf05c67798036b12a4c09f6d (patch) | |
tree | e2c1c3528bf22b10ec5cb16b36f4c8bd3eda40a6 /usr.bin/chpass | |
parent | d8508a468e716a887fc49618cdc5f69c0d315de5 (diff) |
Prefer mkostemp(O_CLOEXEC) over mkstemp()+fcntl(F_SETFD)
Prefer fopen("re") over fopen("r")+fcntl(F_SETFD)
ok otto@ millert@
Diffstat (limited to 'usr.bin/chpass')
-rw-r--r-- | usr.bin/chpass/chpass.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/chpass/chpass.c b/usr.bin/chpass/chpass.c index 24f2eebc6a8..8fed8c4190a 100644 --- a/usr.bin/chpass/chpass.c +++ b/usr.bin/chpass/chpass.c @@ -1,4 +1,4 @@ -/* $OpenBSD: chpass.c,v 1.39 2013/04/18 16:23:25 okan Exp $ */ +/* $OpenBSD: chpass.c,v 1.40 2014/10/26 20:38:13 guenther Exp $ */ /* $NetBSD: chpass.c,v 1.8 1996/05/15 21:50:43 jtc Exp $ */ /*- @@ -167,8 +167,8 @@ main(int argc, char *argv[]) if ((pw = pw_dup(pw)) == NULL) pw_error(NULL, 1, 1); - dfd = mkstemp(tempname); - if (dfd == -1 || fcntl(dfd, F_SETFD, FD_CLOEXEC) == -1) + dfd = mkostemp(tempname, O_CLOEXEC); + if (dfd == -1) pw_error(tempname, 1, 1); display(tempname, dfd, pw); edit_status = edit(tempname, pw); |