Remove tabs, test for all Red Hat clones, enhanced text

This commit is contained in:
Michael Boelen 2016-05-02 19:12:55 +02:00
parent 2b52276110
commit 2205866521
1 changed files with 12 additions and 12 deletions

View File

@ -472,21 +472,21 @@
# Test : LOGG-2190
# Description : Checking deleted files
if [ ! "${LSOFBINARY}" = "" ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi
Register --test-no LOGG-2190 --preqs-met ${PREQS_MET} --weight L --network NO --description "Checking deleted files in file table"
Register --test-no LOGG-2190 --preqs-met ${PREQS_MET} --weight L --network NO --description "Checking for deleted files in use"
if [ ${SKIPTEST} -eq 0 ]; then
LogText "Test: checking deleted files that are still in use"
LSOF_GREP="WARNING|Output information"
if [ "${GRSECFOUND}" -ne 0 ]; then
LSOF_GREP="WARNING|Output information"
if [ ${GRSECFOUND} -eq 1 ]; then
# grsecurity causes Fail2Ban to hold onto deleted in-use files in /var/tmp
LSOF_GREP="${LSOF_GREP}|fail2ban"
LSOF_GREP="${LSOF_GREP}|fail2ban"
fi
if [ "${OS_NAME}" = "CentOS" -o "${OS_NAME}" = "Red Hat Enterprise Linux" ]; then
if [ ${OS_REDHAT_OR_CLONE} -eq 1 ]; then
# If lynis is run from /etc/cron.daily some deleted in-use files are kept in /tmp
LSOF_GREP="${LSOF_GREP}|anacron|awk|run-parts"
LSOF_GREP="${LSOF_GREP}|anacron|awk|run-parts"
fi
FIND=`${LSOFBINARY} -n +L 1 2>&1 | egrep -vw "${LSOF_GREP}" | awk '{ if ($5=="REG") { printf "%s(%s)\n", $10, $1 } }' | grep -v "^$" | sort -u`
FIND=`${LSOFBINARY} -n +L 1 2>&1 | egrep -vw "${LSOF_GREP}" | awk '{ if ($5=="REG") { printf "%s(%s)\n", $10, $1 } }' | grep -v "^$" | sort -u`
if [ ! "${FIND}" = "" ]; then
LogText "Result: found one or more files which are deleted, but still in use"
for I in ${FIND}; do