summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1996-09-16 01:37:00 +0000
committerderaadt <deraadt@openbsd.org>1996-09-16 01:37:00 +0000
commit9f32315e284c74ca851c062d3db0acb86c698f85 (patch)
tree75c22b87a9e27688fdb2a963956f14aba17105f8
parentkill the race; spotted by bitblt (diff)
downloadwireguard-openbsd-9f32315e284c74ca851c062d3db0acb86c698f85.tar.xz
wireguard-openbsd-9f32315e284c74ca851c062d3db0acb86c698f85.zip
kill /tmp race
-rw-r--r--sbin/modload/modload.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/modload/modload.c b/sbin/modload/modload.c
index 5e7dee9be9e..4aec3c69911 100644
--- a/sbin/modload/modload.c
+++ b/sbin/modload/modload.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: modload.c,v 1.8 1996/08/29 15:17:38 deraadt Exp $ */
+/* $OpenBSD: modload.c,v 1.9 1996/09/16 01:37:00 deraadt Exp $ */
/* $NetBSD: modload.c,v 1.13 1995/05/28 05:21:58 jtc Exp $ */
/*
@@ -257,7 +257,7 @@ main(argc, argv)
entry[strlen(entry) - 2] = '\0'; /* chop off .o */
}
- if((modfd = open(out, O_RDWR | O_CREAT, 0666)) < 0)
+ if((modfd = open(out, O_RDWR | O_EXCL | O_CREAT, 0666)) < 0)
err(1, "creating %s", out);
close(modfd);