diff -up smeserver-rkhunter-1.2.0/createlinks.maipatch smeserver-rkhunter-1.2.0/createlinks --- smeserver-rkhunter-1.2.0/createlinks.maipatch 2009-04-02 16:46:09.000000000 -0400 +++ smeserver-rkhunter-1.2.0/createlinks 2013-06-20 18:01:13.000000000 -0400 @@ -8,5 +8,7 @@ for my $event (qw( )) { templates2events("/etc/rkhunter.conf", $event) + ; templates2events("/etc/sysconfig/rkhunter", $event); + templates2events("/etc/cron.daily/rkhunter", $event); } diff -up smeserver-rkhunter-1.2.0/root/etc/e-smith/templates/etc/cron.daily/rkhunter/10script.maipatch smeserver-rkhunter-1.2.0/root/etc/e-smith/templates/etc/cron.daily/rkhunter/10script --- smeserver-rkhunter-1.2.0/root/etc/e-smith/templates/etc/cron.daily/rkhunter/10script.maipatch 2013-06-20 17:52:06.000000000 -0400 +++ smeserver-rkhunter-1.2.0/root/etc/e-smith/templates/etc/cron.daily/rkhunter/10script 2013-06-20 17:56:01.000000000 -0400 @@ -0,0 +1,58 @@ +#!/bin/sh +# 01-rkhunter A shell script to update and run rkhunter via CRON + +XITVAL=0 + +# Get a secure tempfile +TMPFILE1=`/bin/mktemp -p /var/lib/rkhunter rkhcronlog.XXXXXXXXXX` || exit 1 + +if [ ! -e /var/lock/subsys/rkhunter ]; then + + # Try to keep the SysInit boot scan from colliding with us (highly unlikely) + /bin/touch /var/lock/subsys/rkhunter + + # Source system configuration parameters. + if [ -e /etc/sysconfig/rkhunter ] ; then + . /etc/sysconfig/rkhunter + else + { my $mail = $rkhunter{'mail'} || "root"; $OUT .= "MAILTO= $mail";} + fi + + # If a diagnostic mode scan was requested, setup the parameters + if [ "$DIAG_SCAN" == "yes" ]; then + RKHUNTER_FLAGS="--checkall --skip-keypress --nocolors --quiet --appendlog --display-logfile" + else + RKHUNTER_FLAGS="--cronjob --nocolors --report-warnings-only" + fi + + # Set a few critical parameters + RKHUNTER=/usr/bin/rkhunter + LOGFILE=/var/log/rkhunter/rkhunter.log + + # Run RootKit Hunter if available + if [ -x $RKHUNTER ]; then + /bin/echo -e "\n--------------------- Start Rootkit Hunter Update ---------------------" \ + > $TMPFILE1 + /bin/nice -n 10 $RKHUNTER --update --nocolors 2>&1 >> $TMPFILE1 + /bin/echo -e "\n---------------------- Start Rootkit Hunter Scan ----------------------" \ + >> $TMPFILE1 + /bin/nice -n 10 $RKHUNTER $RKHUNTER_FLAGS 2>&1 >> $TMPFILE1 + XITVAL=$? + /bin/echo -e "\n----------------------- End Rootkit Hunter Scan -----------------------" \ + >> $TMPFILE1 + + if [ $XITVAL != 0 ]; then + /bin/cat $TMPFILE1 | /bin/mail -s "rkhunter Daily Run on $(hostname)" $MAILTO + fi + /bin/cat $TMPFILE1 >> $LOGFILE + fi + + # Delete the gating lockfile + /bin/rm -f /var/lock/subsys/rkhunter +fi + +# Delete the secure tempfile +/bin/rm -f $TMPFILE1 + +exit $XITVAL + diff -up smeserver-rkhunter-1.2.0/root/etc/e-smith/templates/etc/cron.daily/rkhunter/template-begin.maipatch smeserver-rkhunter-1.2.0/root/etc/e-smith/templates/etc/cron.daily/rkhunter/template-begin diff -up smeserver-rkhunter-1.2.0/root/etc/e-smith/templates/etc/cron.daily/rkhunter/template-end.maipatch smeserver-rkhunter-1.2.0/root/etc/e-smith/templates/etc/cron.daily/rkhunter/template-end diff -up smeserver-rkhunter-1.2.0/root/etc/e-smith/templates/etc/sysconfig/rkhunter/09warning.maipatch smeserver-rkhunter-1.2.0/root/etc/e-smith/templates/etc/sysconfig/rkhunter/09warning --- smeserver-rkhunter-1.2.0/root/etc/e-smith/templates/etc/sysconfig/rkhunter/09warning.maipatch 2013-06-20 17:57:17.000000000 -0400 +++ smeserver-rkhunter-1.2.0/root/etc/e-smith/templates/etc/sysconfig/rkhunter/09warning 2013-06-20 17:57:29.000000000 -0400 @@ -0,0 +1,11 @@ +#------------------------------------------------------------ +# !!DO NOT MODIFY THIS FILE!! +# +# Manual changes will be lost when this file is regenerated. +# +# Please read the developer's guide, which is available +# at http://www.contribs.org/development/ +# +# Copyright (C) 1999-2006 Mitel Networks Corporation +#------------------------------------------------------------ + diff -up smeserver-rkhunter-1.2.0/root/etc/e-smith/templates/etc/sysconfig/rkhunter/10config.maipatch smeserver-rkhunter-1.2.0/root/etc/e-smith/templates/etc/sysconfig/rkhunter/10config --- smeserver-rkhunter-1.2.0/root/etc/e-smith/templates/etc/sysconfig/rkhunter/10config.maipatch 2013-06-20 17:54:33.000000000 -0400 +++ smeserver-rkhunter-1.2.0/root/etc/e-smith/templates/etc/sysconfig/rkhunter/10config 2013-06-20 17:56:35.000000000 -0400 @@ -0,0 +1,11 @@ +# System configuration file for Rootkit Hunter which +# stores RPM system specifics for cron run, etc. +# +# MAILTO= +# DIAG_SCAN= no - perform normal report scan +# yes - perform detailed report scan +# (includes application check) + +{ $OUT .= "MAILTO= ". $rkhunter{'mail'} || "root";} +DIAG_SCAN=no +