mirror of https://github.com/CISOfy/lynis.git
sort BIN_PATHS before process (#510)
This commit is contained in:
parent
f79cb08db3
commit
2c774b8795
|
@ -44,8 +44,8 @@
|
||||||
|
|
||||||
# Test if our PATH variable provides a set of paths (otherwise we use predefined list in include/consts)
|
# Test if our PATH variable provides a set of paths (otherwise we use predefined list in include/consts)
|
||||||
if [ ! -z "${PATH}" ]; then BIN_PATHS=$(echo ${PATH} | tr ':' ' '); fi
|
if [ ! -z "${PATH}" ]; then BIN_PATHS=$(echo ${PATH} | tr ':' ' '); fi
|
||||||
|
SORTED_BIN_PATHS=$(echo ${BIN_PATHS} | tr ' ' '\n' | sort | tr '\n' ' ')
|
||||||
for SCANDIR in ${BIN_PATHS}; do
|
for SCANDIR in ${SORTED_BIN_PATHS}; do
|
||||||
LogText "Test: Checking binaries in directory ${SCANDIR}"
|
LogText "Test: Checking binaries in directory ${SCANDIR}"
|
||||||
ORGPATH=""
|
ORGPATH=""
|
||||||
if [ -d ${SCANDIR} ]; then
|
if [ -d ${SCANDIR} ]; then
|
||||||
|
@ -277,6 +277,7 @@
|
||||||
LogText "Result: Directory ${SCANDIR} does NOT exist"
|
LogText "Result: Directory ${SCANDIR} does NOT exist"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
unset SORTED_BIN_PATHS
|
||||||
BINARY_SCAN_FINISHED=1
|
BINARY_SCAN_FINISHED=1
|
||||||
BINARY_PATHS_FOUND=$(echo ${BINARY_PATHS_FOUND} | sed 's/^, //g' | sed 's/ //g')
|
BINARY_PATHS_FOUND=$(echo ${BINARY_PATHS_FOUND} | sed 's/^, //g' | sed 's/ //g')
|
||||||
LogText "Discovered directories: ${BINARY_PATHS_FOUND}"
|
LogText "Discovered directories: ${BINARY_PATHS_FOUND}"
|
||||||
|
|
Loading…
Reference in New Issue