From 77bff75bb707e5e90a53f2245f3f81824dd7ac02 Mon Sep 17 00:00:00 2001 From: deraadt Date: Sun, 26 Jan 1997 00:22:28 +0000 Subject: [PATCH] use mktemp(1) to avoid /tmp race; spotted by dholland@eecs.harvard.edu --- share/mk/bsd.lib.mk | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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) -- 2.20.1