diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-09-16 01:20:04 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-09-16 01:20:04 +0000 |
commit | d526f90f06066e8ca43548a6b114260f02d6e314 (patch) | |
tree | fa58ce10954941af2155839a4e48f6e414593eff /usr.bin/mkdep/mkdep.ultrix | |
parent | c4f335adba92b5d6ba3fa116fef9983a2e1190c0 (diff) |
kill the race; spotted by bitblt
Diffstat (limited to 'usr.bin/mkdep/mkdep.ultrix')
-rw-r--r-- | usr.bin/mkdep/mkdep.ultrix | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/usr.bin/mkdep/mkdep.ultrix b/usr.bin/mkdep/mkdep.ultrix index c9e126867b0..b908bd2697f 100644 --- a/usr.bin/mkdep/mkdep.ultrix +++ b/usr.bin/mkdep/mkdep.ultrix @@ -1,6 +1,6 @@ #!/bin/sh - # -# $OpenBSD: mkdep.ultrix,v 1.2 1996/06/26 05:37:09 deraadt Exp $ +# $OpenBSD: mkdep.ultrix,v 1.3 1996/09/16 01:20:03 deraadt Exp $ # $NetBSD: mkdep.ultrix,v 1.2 1994/12/23 07:35:04 jtc Exp $ # # Copyright (c) 1991, 1993 @@ -69,9 +69,17 @@ if [ ! -w $MAKE ]; then exit 1 fi -TMP=/tmp/mkdep$$ +DTMP=/tmp/_mkdep$$ +TMP=$DTMP/mkdep -trap 'rm -f $TMP ; exit 1' 1 2 3 13 15 +um=`umask` +umask 022 +if ! mkdir $DTMP ; then + echo failed to create tmp dir $DTMP + exit 1 +fi +umask $um +trap 'rm -rf $DTMP ; exit 1' 1 2 3 13 15 cp $MAKE ${MAKE}.bak @@ -123,5 +131,5 @@ _EOF_ # copy to preserve permissions cp $TMP $MAKE -rm -f ${MAKE}.bak $TMP +rm -rf ${MAKE}.bak $DTMP exit 0 |