summaryrefslogtreecommitdiffstats
path: root/usr.bin/patch/inp.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1996-06-25 23:06:36 +0000
committerderaadt <deraadt@openbsd.org>1996-06-25 23:06:36 +0000
commitb004f8f9652eab72b5061d874d07f48c51ae35b3 (patch)
tree909f8daf075af59220e8bbac22acb4cdac74dbd3 /usr.bin/patch/inp.c
parentopen O_EXCL instead of creat; for writable rdist directories... still small DOS (diff)
downloadwireguard-openbsd-b004f8f9652eab72b5061d874d07f48c51ae35b3.tar.xz
wireguard-openbsd-b004f8f9652eab72b5061d874d07f48c51ae35b3.zip
mktemp w/ open & fdopen
Diffstat (limited to 'usr.bin/patch/inp.c')
-rw-r--r--usr.bin/patch/inp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/patch/inp.c b/usr.bin/patch/inp.c
index e7661358124..34a93b590a6 100644
--- a/usr.bin/patch/inp.c
+++ b/usr.bin/patch/inp.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: inp.c,v 1.2 1996/06/10 11:21:28 niklas Exp $ */
+/* $OpenBSD: inp.c,v 1.3 1996/06/25 23:06:38 deraadt Exp $ */
#ifndef lint
-static char rcsid[] = "$OpenBSD: inp.c,v 1.2 1996/06/10 11:21:28 niklas Exp $";
+static char rcsid[] = "$OpenBSD: inp.c,v 1.3 1996/06/25 23:06:38 deraadt Exp $";
#endif /* not lint */
#include "EXTERN.h"
@@ -241,7 +241,7 @@ char *filename;
using_plan_a = FALSE;
if ((ifp = fopen(filename, "r")) == Nullfp)
pfatal2("can't open file %s", filename);
- if ((tifd = creat(TMPINNAME, 0666)) < 0)
+ if ((tifd = open(TMPINNAME, O_EXCL|O_CREAT|O_WRONLY, 0666)) < 0)
pfatal2("can't open file %s", TMPINNAME);
while (fgets(buf, sizeof buf, ifp) != Nullch) {
if (revision != Nullch && !found_revision && rev_in_string(buf))