Here's an updated patch which also covers the 2am checks. Francois
-- https://fmarier.org/
diff --git a/scripts/aide_run b/scripts/aide_run index 363ef10..14b197e 100755 --- a/scripts/aide_run +++ b/scripts/aide_run @@ -114,7 +114,7 @@ if [ -z "$AIDE" ] then if [ -z "${Tiger_AIDE_LOC_OVERRIDE}" ] then - AIDE=`which aide` + AIDE=`command -v aide` else AIDE=${Tiger_AIDE_LOC_OVERRIDE} fi diff --git a/scripts/check_passwd b/scripts/check_passwd index 1f885e8..fc28227 100755 --- a/scripts/check_passwd +++ b/scripts/check_passwd @@ -328,7 +328,7 @@ done < $WORKDIR/pass.list.$$ } # Verify the sudo file format. -if [ -n "`which visudo`" ] && [ -r /etc/sudoers ] ; then +if [ -n "`command -v visudo`" ] && [ -r /etc/sudoers ] ; then if ! `visudo -cq` ; then message FAIL pass021f "" "Integrity of sudoers files questionable (run 'visudo -c')." fi diff --git a/scripts/check_rootkit b/scripts/check_rootkit old mode 100644 new mode 100755 index bfb2f68..9dbf1e2 --- a/scripts/check_rootkit +++ b/scripts/check_rootkit @@ -143,7 +143,7 @@ fi # Chkrookit binary location|override + default check if [ -z "${Tiger_CHKROOTKIT_LOC_OVERRIDE}" ] then - CHKROOTKIT=`which chkrootkit 2>/dev/null` + CHKROOTKIT=`command -v chkrootkit` else CHKROOTKIT=${Tiger_CHKROOTKIT_LOC_OVERRIDE} fi diff --git a/scripts/crack_run b/scripts/crack_run index e47e4a2..82f26ff 100755 --- a/scripts/crack_run +++ b/scripts/crack_run @@ -91,7 +91,7 @@ if [ -z "$CRACK" ] then if [ -z "${Tiger_CRACK_LOC_OVERRIDE}" ] then - CRACK=`which crack` + CRACK=`command -v crack` else CRACK=${Tiger_CRACK_LOC_OVERRIDE} fi @@ -101,7 +101,7 @@ if [ -z "$REPORTER" ] then if [ -z "${Tiger_CRACKREPORTER_LOC_OVERRIDE}" ] then - REPORTER=`which crack-reporter` + REPORTER=`command -v crack-reporter` else REPORTER=${Tiger_CRACKREPORTER_LOC_OVERRIDE} fi diff --git a/scripts/integrit_run b/scripts/integrit_run index 55a33a1..d830aa5 100755 --- a/scripts/integrit_run +++ b/scripts/integrit_run @@ -83,7 +83,7 @@ if [ -z "$INTEGRIT" ] then if [ -z "${Tiger_INTEGRIT_LOC_OVERRIDE}" ] then - INTEGRIT=`which integrit` + INTEGRIT=`command -v integrit` else INTEGRIT=${Tiger_INTEGRIT_LOC_OVERRIDE} fi diff --git a/scripts/tripwire_run b/scripts/tripwire_run index 3c97d5a..5a95596 100755 --- a/scripts/tripwire_run +++ b/scripts/tripwire_run @@ -90,7 +90,7 @@ if [ -z "$TRIPWIRE" ] then if [ -z "${Tiger_TRIPW_LOC_OVERRIDE}" ] then - TRIPWIRE=`which tripwire` + TRIPWIRE=`command -v tripwire` else TRIPWIRE=${Tiger_TRIPW_LOC_OVERRIDE} fi diff --git a/systems/Linux/2/gen_bootparam_sets b/systems/Linux/2/gen_bootparam_sets index bd91690..c8c1b95 100755 --- a/systems/Linux/2/gen_bootparam_sets +++ b/systems/Linux/2/gen_bootparam_sets @@ -25,10 +25,10 @@ # # If run directly do this, just in case: -[ -z "$AWK" ] && AWK=`which awk` -[ -z "$SED" ] && AWK=`which sed` -[ -z "$RM" ] && RM=`which rm` -[ -z "$YPCAT" ] && YPCAT=`which ypcat 2>/dev/null` +[ -z "$AWK" ] && AWK=`command -v awk` +[ -z "$SED" ] && AWK=`command -v sed` +[ -z "$RM" ] && RM=`command -v rm` +[ -z "$YPCAT" ] && YPCAT=`command -v ypcat` [ -z "$WORKDIR" ] && WORKDIR=/tmp [ -r /etc/bootparams ] && { diff --git a/systems/Linux/2/gen_cron b/systems/Linux/2/gen_cron index caaf498..1fbc9fe 100755 --- a/systems/Linux/2/gen_cron +++ b/systems/Linux/2/gen_cron @@ -35,9 +35,9 @@ #----------------------------------------------------------------------------- # # Defin commands we need, just in case -[ -z "$FIND" ] && FIND=`which find` -[ -z "$LS" ] && LS=`which ls` -[ -z "$SED" ] && SED=`which sed` +[ -z "$FIND" ] && FIND=`command -v find` +[ -z "$LS" ] && LS=`command -v ls` +[ -z "$SED" ] && SED=`command -v sed` [ -z "$CRONSPOOL" ] && CRONSPOOL="/var/spool/cron/crontabs" [ ! -n "$GETUSERHOME" ] && GETUSERHOME=echo diff --git a/systems/Linux/2/gen_export_sets b/systems/Linux/2/gen_export_sets index 23838f9..76b7ba3 100755 --- a/systems/Linux/2/gen_export_sets +++ b/systems/Linux/2/gen_export_sets @@ -23,9 +23,9 @@ #----------------------------------------------------------------------------- # # For debugging purposes -[ -z "$GREP" ] && GREP=`which grep` -[ -z "$SED" ] && SED=`which sed` -[ -z "$AWK" ] && AWK=`which awk` +[ -z "$GREP" ] && GREP=`command -v grep` +[ -z "$SED" ] && SED=`command -v sed` +[ -z "$AWK" ] && AWK=`command -v awk` [ -z "$WORKDIR" ] && WORKDIR=/tmp EXPFILE=/etc/exports diff --git a/systems/Linux/2/gen_group_sets b/systems/Linux/2/gen_group_sets index 93ef408..9e4cbbb 100755 --- a/systems/Linux/2/gen_group_sets +++ b/systems/Linux/2/gen_group_sets @@ -24,13 +24,13 @@ # # If run directly do this, just in case: -[ -z "$GREP" ] && GREP=`which grep` -[ -z "$AWK" ] && AWK=`which awk` -[ -z "$SED" ] && SED=`which sed` -[ -z "$SORT" ] && SORT=`which sort` -[ -z "$COMM" ] && COMM=`which comm` -[ -z "$RM" ] && RM=`which rm` -[ -z "$YPCAT" ] && YPCAT=`which ypcat 2>/dev/null` +[ -z "$GREP" ] && GREP=`command -v grep` +[ -z "$AWK" ] && AWK=`command -v awk` +[ -z "$SED" ] && SED=`command -v sed` +[ -z "$SORT" ] && SORT=`command -v sort` +[ -z "$COMM" ] && COMM=`command -v comm` +[ -z "$RM" ] && RM=`command -v rm` +[ -z "$YPCAT" ] && YPCAT=`command -v ypcat` [ -z "$WORKDIR" ] && WORKDIR=/tmp diff --git a/systems/Linux/2/gen_passwd_sets b/systems/Linux/2/gen_passwd_sets index 908897c..b4a084a 100755 --- a/systems/Linux/2/gen_passwd_sets +++ b/systems/Linux/2/gen_passwd_sets @@ -56,15 +56,15 @@ # # If run directly do this, just in case: -[ -z "$SORT" ] && SORT=`which sort` -[ -z "$JOIN" ] && JOIN=`which join` -[ -z "$GREP" ] && GREP=`which grep` -[ -z "$AWK" ] && AWK=`which awk` -[ -z "$CAT" ] && CAT=`which cat` -[ -z "$RM" ] && RM=`which rm` -[ -z "$CP" ] && CP=`which cp` -[ -z "$YPCAT" ] && YPCAT=`which ypcat 2>/dev/null` -[ -z "$GETENT" ] && GETENT=`which getent 2>/dev/null` +[ -z "$SORT" ] && SORT=`command -v sort` +[ -z "$JOIN" ] && JOIN=`command -v join` +[ -z "$GREP" ] && GREP=`command -v grep` +[ -z "$AWK" ] && AWK=`command -v awk` +[ -z "$CAT" ] && CAT=`command -v cat` +[ -z "$RM" ] && RM=`command -v rm` +[ -z "$CP" ] && CP=`command -v cp` +[ -z "$YPCAT" ] && YPCAT=`command -v ypcat` +[ -z "$GETENT" ] && GETENT=`command -v getent` [ -z "$WORKDIR" ] && WORKDIR=/tmp local=0