rkhunter/rkhunter-1.3.2-debugtmp.patch
2008-09-15 21:55:21 +00:00

34 lines
1.1 KiB
Diff

diff -Nur rkhunter-1.3.2.orig/files/rkhunter rkhunter-1.3.2/files/rkhunter
--- rkhunter-1.3.2.orig/files/rkhunter 2008-02-27 08:59:22.000000000 -0700
+++ rkhunter-1.3.2/files/rkhunter 2008-08-31 10:22:20.000000000 -0600
@@ -41,18 +41,18 @@
fi
if [ "$1" = "--debug" ]; then
- if [ -e "/tmp/rkhunter-debug" ]; then
- if [ -f "/tmp/rkhunter-debug" -a ! -h "/tmp/rkhunter-debug" ]; then
- rm -f /tmp/rkhunter-debug >/dev/null 2>&1
- else
- echo "Cannot use '--debug' option. /tmp/rkhunter-debug already exists, but it is not a file."
- exit 1
- fi
- fi
-
- DEBUG_OPT=1
-
- exec 1>/tmp/rkhunter-debug 2>&1
+ DEBUG_FILE=`mktemp -t rkhunter-debug.XXXXXXXXXX`
+ if [ -e "$DEBUG_FILE" ]; then
+ if [ -f "$DEBUG_FILE" -a ! -h "$DEBUG_FILE" ]; then
+ rm -f $DEBUG_FILE >/dev/null 2>&1
+ else
+ echo "Cannot use '--debug' option. $DEBUG_FILE already exists, but it is not a file."
+ exit 1
+ fi
+ fi
+
+ DEBUG_OPT=1
+ exec 1>$DEBUG_FILE 2>&1
set -x
else
DEBUG_OPT=0