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:
authormslifcak <slifcan@gmail.com>2018-01-17 15:49:07 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2018-01-17 15:49:07 +0300
commit2c774b8795b88616ac36466370bb6fb54d7d924e (patch)
treeab51f8e7c016dab36d09f060cec2fdbf7549f630
parentf79cb08db36db7c827f2b4bdb0d021b7096d57bb (diff)
sort BIN_PATHS before process (#510)
-rw-r--r--include/binaries5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/binaries b/include/binaries
index ee2818e5..1f31ee99 100644
--- a/include/binaries
+++ b/include/binaries
@@ -44,8 +44,8 @@
# 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
-
- for SCANDIR in ${BIN_PATHS}; do
+ SORTED_BIN_PATHS=$(echo ${BIN_PATHS} | tr ' ' '\n' | sort | tr '\n' ' ')
+ for SCANDIR in ${SORTED_BIN_PATHS}; do
LogText "Test: Checking binaries in directory ${SCANDIR}"
ORGPATH=""
if [ -d ${SCANDIR} ]; then
@@ -277,6 +277,7 @@
LogText "Result: Directory ${SCANDIR} does NOT exist"
fi
done
+ unset SORTED_BIN_PATHS
BINARY_SCAN_FINISHED=1
BINARY_PATHS_FOUND=$(echo ${BINARY_PATHS_FOUND} | sed 's/^, //g' | sed 's/ //g')
LogText "Discovered directories: ${BINARY_PATHS_FOUND}"