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:
authorMichael Boelen <michael.boelen@cisofy.com>2018-01-25 21:14:58 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2018-01-25 21:14:58 +0300
commit3a4bc4db9c82ef4ab1fe6f4d44b82b1dd2a71af7 (patch)
tree32376391ac037aa9243339e635da07e1e8474a95
parentef2659acc81494ec9d2bcd77c6ff814a529b2a56 (diff)
Use binary paths from both PATH and predefined list to improve detection on all platforms
-rw-r--r--include/binaries4
-rw-r--r--include/consts4
2 files changed, 4 insertions, 4 deletions
diff --git a/include/binaries b/include/binaries
index 1c56607b..a86708f3 100644
--- a/include/binaries
+++ b/include/binaries
@@ -43,8 +43,8 @@
LogText "Status: Starting binary scan..."
# 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
- SORTED_BIN_PATHS=$(echo ${BIN_PATHS} | tr ' ' '\n' | sort | tr '\n' ' ')
+ if [ ! -z "${PATH}" ]; then BIN_PATHS=$(echo "${BIN_PATHS} ${PATH}" | tr ':' ' '); fi
+ SORTED_BIN_PATHS=$(echo ${BIN_PATHS} | tr ' ' '\n' | sort | uniq | tr '\n' ' ')
for SCANDIR in ${SORTED_BIN_PATHS}; do
LogText "Test: Checking binaries in directory ${SCANDIR}"
ORGPATH=""
diff --git a/include/consts b/include/consts
index 1cd32d4d..181ff15b 100644
--- a/include/consts
+++ b/include/consts
@@ -23,8 +23,8 @@
#################################################################################
#
-# Paths where system and program binaries are located
-BIN_PATHS="/bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin \
+# Paths where system and program binaries are typically located
+BIN_PATHS="/bin /sbin /usr/bin /usr/gnu/bin /usr/sbin /usr/local/bin /usr/local/sbin \
/usr/local/libexec /usr/libexec /usr/sfw/bin /usr/sfw/sbin \
/usr/sfw/libexec /opt/sfw/bin /opt/sfw/sbin /opt/sfw/libexec \
/usr/xpg4/bin /usr/css/bin /usr/ucb /usr/X11R6/bin /usr/X11R7/bin \