mirror of https://github.com/CISOfy/lynis.git
Skip directory if it has already been found, or its symlink
This commit is contained in:
parent
8454ac7baf
commit
5ac6812ba5
|
@ -52,10 +52,6 @@
|
|||
logtext "Result: found the path behind this symlink (${SCANDIR} --> ${sFILE})"
|
||||
ORGPATH="${SCANDIR}"
|
||||
SCANDIR="${sFILE}"
|
||||
FIND=`echo ${SCANNEDPATHS} | grep ", ${SCANDIR}"`
|
||||
if [ ! "${FIND}" = "" ]; then
|
||||
SKIPDIR=1; logtext "Result: Skipping this directory as it is a symlink and was already scanned"
|
||||
fi
|
||||
else
|
||||
SKIPDIR=1; logtext "Result: Symlink variable empty, or directory to symlink is non-existing"
|
||||
fi
|
||||
|
@ -63,6 +59,12 @@
|
|||
SKIPDIR=1; logtext "Result: Could not find the location of this symlink, or is not a directory"
|
||||
fi
|
||||
fi
|
||||
|
||||
FIND=`echo ${SCANNEDPATHS} | grep ", ${SCANDIR}"`
|
||||
if [ ! "${FIND}" = "" ]; then
|
||||
SKIPDIR=1; logtext "Result: Skipping this directory as it was already scanned"
|
||||
fi
|
||||
|
||||
if [ ${SKIPDIR} -eq 0 ]; then
|
||||
logtext "Test: Checking binaries in directory ${SCANDIR}"
|
||||
Display --indent 4 --text "- ${SCANDIR}" --result FOUND --color GREEN
|
||||
|
@ -174,7 +176,7 @@
|
|||
done
|
||||
else
|
||||
logtext "Result: Directory ${SCANDIR} skipped"
|
||||
Display --indent 4 --text "- ${SCANDIR} (symlinked from ${ORGPATH})" --result SKIPPED --color YELLOW
|
||||
Display --indent 4 --text "- ${SCANDIR}" --result SKIPPED --color YELLOW
|
||||
fi
|
||||
else
|
||||
Display --indent 4 --text "- ${SCANDIR}" --result "NOT FOUND" --color WHITE
|
||||
|
|
Loading…
Reference in New Issue