From: deraadt Date: Sun, 26 Jan 1997 00:22:28 +0000 (+0000) Subject: use mktemp(1) to avoid /tmp race; spotted by dholland@eecs.harvard.edu X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=77bff75bb707e5e90a53f2245f3f81824dd7ac02;p=openbsd use mktemp(1) to avoid /tmp race; spotted by dholland@eecs.harvard.edu --- diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index d0ebb545a22..9198d281c72 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -1,4 +1,4 @@ -# $OpenBSD: bsd.lib.mk,v 1.10 1996/12/08 14:42:28 downsj Exp $ +# $OpenBSD: bsd.lib.mk,v 1.11 1997/01/26 00:22:28 deraadt Exp $ # $NetBSD: bsd.lib.mk,v 1.67 1996/01/17 20:39:26 mycroft Exp $ # @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91 @@ -167,10 +167,14 @@ cleandir: _SUBDIRUSE clean .if defined(SRCS) afterdepend: .depend - @(TMP=/tmp/_depend$$$$; \ - sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po \1.so:/' \ + @(TMP=`mktemp -q /tmp/_dependXXXXXXXXXX`; \ + if [ $$? -ne 0 ]; then \ + echo "$$0: cannot create temp file, exiting..."; \ + exit 1; \ + fi; \ + sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po \1.so:/' \ < .depend > $$TMP; \ - mv $$TMP .depend) + mv $$TMP .depend) .endif .if !target(install)