Package: aide
Severity: minor
Tags: patch

At every run of /etc/cron.daily/aide, a temporary file in /tmp gets
left behind when AIDE is set to run in quiet mode.  This results in
lots of /tmp/error* files after a while.

$ ls /tmp/error* | wc -l
35

The cause is an 'exit 0' statement in the cronjob, which gets
executed before the cleanup of the temporary file when quiet mode
is enabled.

Here's a small patch which removes the temporary file for two
additional exit paths in the cronjob.


-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.12.5
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
--- debian/aide.cron.old        2005-08-30 15:23:15.000000000 +0200
+++ debian/aide.cron    2005-08-30 15:23:48.000000000 +0200
@@ -31,6 +31,7 @@
        echo "Fatal error: The AIDE database does not exist!"
        echo "This may mean you haven't created it, or it may mean that someone 
has removed it."
        ) | /usr/bin/mail -s "Daily AIDE report for $FQDN" $MAILTO
+       rm -f "$ERRORTMP"
        exit 0
 fi
 
@@ -42,6 +43,7 @@
 
 if [ -n "$QUIETREPORTS" ] && [ $QUIETREPORTS -a \! -s $LOGDIR/$LOGFILE -a \! 
-s $ERRORTMP ]; then
        # Bail now because there was no output and QUIETREPORTS is set
+       rm -f "$ERRORTMP"
        exit 0
 fi
 

Reply via email to