Sophie

Sophie

distrib > Mandriva > 10.0-com > i586 > by-pkgid > 2295ae7071de301474a134f126c2c717 > files > 1

logcheck-1.1.1-9.1.100mdk.src.rpm

--- logcheck-1.1.1/systems/linux/logcheck.sh.CAN-2004-0404	2004-12-21 16:21:10.000000000 -0700
+++ logcheck-1.1.1/systems/linux/logcheck.sh	2004-12-21 16:21:56.000000000 -0700
@@ -52,7 +52,11 @@
 # You would also be well advised to make sure all your system/cron scripts
 # use this directory for their "scratch" area. 
 
-TMPDIR=/var/lib/logcheck
+TMPDIR=$(mktemp -d /var/tmp/logcheck.XXXXXX) || {
+    echo "Could not create temporary directory, either the drive is full or there's an active attack" \
+    | $MAIL -s "Logcheck: $HOSTNAME $DATE Something went very wrong" $SYSADMIN
+    exit 1
+}
 
 # The 'grep' command. This command MUST support the
 # '-i' '-v' and '-f' flags!! The GNU grep does this by default (that's
@@ -273,3 +277,4 @@
 
 # Clean Up
 rm -f $TMPDIR/check.$$ $TMPDIR/checkoutput.$$ $TMPDIR/checkreport.$$
+rmdir $TMPDIR