blob: 82dfe1fa9474b714b982dc41621727ee33707e42 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
diff -urN rkhunter.orig/files/development/rkhunter.8 rkhunter/files/development/rkhunter.8
--- rkhunter.orig/files/development/rkhunter.8 2004-12-28 09:04:06.000000000 -0500
+++ rkhunter/files/development/rkhunter.8 2004-12-28 23:48:02.100576696 -0500
@@ -54,9 +54,10 @@
Use another configuration file, instead of the default one
.TP
.B
---createlogfile
+--createlogfile <file>
A plain text file summarizing \fBrkhunter\fP's findings will be
-output to the path/filename specified after the switch
+output to the path/filename specified after the switch. If no filename
+is specified, a default of /var/log/rkhunter.log is used.
.TP
.B
--cronjob
diff -urN rkhunter.orig/files/rkhunter rkhunter/files/rkhunter
--- rkhunter.orig/files/rkhunter 2004-12-28 12:45:21.000000000 -0500
+++ rkhunter/files/rkhunter 2004-12-28 23:26:33.507472624 -0500
@@ -146,6 +146,11 @@
--createlogfile | --createlog | --create-log | --create-logfile)
DEBUG=1
DEBUGLOG=1
+ if [[ "$2" != -* ]]
+ then
+ shift
+ LOGFILE=$1
+ fi
;;
--dbdir)
shift
@@ -225,12 +230,21 @@
# Through the drain...
DEBUGFILE="/dev/null"
else
- if [ -d "/var/log" ]
+ if [ -n "${LOGFILE}" ]
then
- DEBUGFILE="/var/log/rkhunter.log"
+ if ( [[ "${LOGFILE}" == */* ]] && [ -d "${LOGFILE%/*}" ] ) || [ -w ./ ]
+ then
+ DEBUGFILE="${LOGFILE}"
+ fi
+
+ elif [ -d "/var/log" ]
+ then
+ DEBUGFILE="/var/log/rkhunter.log"
+ [ -n "${LOGFILE}" ] && echo \
+ "${LOGFILE%/*} doesn't exist... trying ${DEBUGFILE}"
else
echo "/var/log doesn't exists... no log file created"
- DEBUGFILE="/dev/null"
+ DEBUGFILE="/dev/null"
fi
# Clear debug file
if [ -f ${DEBUGFILE} ]; then
@@ -4949,7 +4963,8 @@
echo $ECHOOPT ""
echo $ECHOOPT "Valid parameters:"
echo $ECHOOPT "--checkall (-c) : Check system"
- echo $ECHOOPT "--createlogfile* : Create logfile"
+ echo $ECHOOPT "--createlogfile <file>* : Create logfile (file is optional, defaults to"
+ echo $ECHOOPT " : /var/log/rkhunter.log)"
echo $ECHOOPT "--cronjob : Run as cronjob (removes colored layout)"
echo $ECHOOPT "--display-logfile : Show logfile at end of the output"
echo $ECHOOPT "--help (-h) : Show this help"
|