From: deraadt Date: Mon, 16 Sep 1996 01:37:00 +0000 (+0000) Subject: kill /tmp race X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9f32315e284c74ca851c062d3db0acb86c698f85;p=openbsd kill /tmp race --- 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);