diff options
author | 1996-12-07 07:33:06 +0000 | |
---|---|---|
committer | 1996-12-07 07:33:06 +0000 | |
commit | 91ee8856e73f92e89dce3c97e0b244eb639928a3 (patch) | |
tree | 49771ec2db73a54f18bd183b2aab8ee6251ad4fb | |
parent | buf oflow (diff) | |
download | wireguard-openbsd-91ee8856e73f92e89dce3c97e0b244eb639928a3.tar.xz wireguard-openbsd-91ee8856e73f92e89dce3c97e0b244eb639928a3.zip |
Improved handling of temporary files.
-rw-r--r-- | etc/daily | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/etc/daily b/etc/daily index 898c730f21d..5f4ba4aa377 100644 --- a/etc/daily +++ b/etc/daily @@ -1,6 +1,6 @@ #!/bin/sh - # -# $OpenBSD: daily,v 1.12 1996/12/06 16:49:12 deraadt Exp $ +# $OpenBSD: daily,v 1.13 1996/12/07 07:33:06 bitblt Exp $ # PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local host=`hostname -s` @@ -44,8 +44,16 @@ echo "NOT Removing scratch and junk files." # XXX NOT REMOVING UNTIL SECURITY BUG IS FIXED # find . ! -name . -mtime +7 -exec rm -f -- {} \; ; } #fi +TDIR=/tmp/daily.$$ +if ! mkdir $TDIR ; then + printf "tmp directory %s already exists, looks like:\n" $TDIR + ls -alf $TDIR + exit 1 +fi +cd $TDIR +trap 'rm -rf $TDIR' 0 1 15 + -cd /tmp TMP=daily.$$ rm -f $TMP echo -n > $TMP |