Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormboelen <michael@cisofy.com>2014-10-13 21:45:14 +0400
committermboelen <michael@cisofy.com>2014-10-13 21:45:14 +0400
commit6f893ea3b4b6f38f4ea96196ade9441ab092cae1 (patch)
tree766477a456ff4a664bd51e2f48efc9cc943e74e6
parentebdee5b0d2e39e0009f46e5a01777a600931737c (diff)
Improved symlink detection and reporting
-rw-r--r--include/binaries20
1 files changed, 12 insertions, 8 deletions
diff --git a/include/binaries b/include/binaries
index f68c1e85..4a72ed1b 100644
--- a/include/binaries
+++ b/include/binaries
@@ -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"