mirror of https://github.com/CISOfy/lynis.git
Improved symlink detection and reporting
This commit is contained in:
parent
ebdee5b0d2
commit
6f893ea3b4
|
@ -46,14 +46,18 @@
|
|||
if [ -L ${SCANDIR} ]; then
|
||||
logtext "Result: directory exists, but is actually a symlink"
|
||||
ShowSymlinkPath ${SCANDIR}
|
||||
if [ ${FOUNDPATH} -eq 1 -a -d ${rFILE} ]; then
|
||||
# Set path to new location
|
||||
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"
|
||||
if [ ${FOUNDPATH} -eq 1 ]; then
|
||||
if [ ! "${SYMLINK}" = "" -a -d ${SYMLINK} ]; then
|
||||
# Set path to new location
|
||||
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
|
||||
else
|
||||
SKIPDIR=1; logtext "Result: Could not find the location of this symlink, or is not a directory"
|
||||
|
|
Loading…
Reference in New Issue