diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-01-26 00:22:29 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-01-26 00:22:29 +0000 |
commit | 4640a9fc32fcc4332d35c8a19d0953fdfafbc06e (patch) | |
tree | 9b5d8972257d9e6bba01def1298c79e966293a63 | |
parent | 73053f024f7a393dd6be53ec17a797dafb2d8470 (diff) |
use mktemp(1) to avoid /tmp race; spotted by dholland@eecs.harvard.edu
-rw-r--r-- | share/mk/bsd.lib.mk | 12 |
1 files 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) |