Use binary paths from both PATH and predefined list to improve detection on all platforms

This commit is contained in:
Michael Boelen 2018-01-25 19:14:58 +01:00
parent ef2659acc8
commit 3a4bc4db9c
No known key found for this signature in database
GPG Key ID: 26141F77A09D7F04
2 changed files with 4 additions and 4 deletions

View File

@ -43,8 +43,8 @@
LogText "Status: Starting binary scan..." LogText "Status: Starting binary scan..."
# 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 "${BIN_PATHS} ${PATH}" | tr ':' ' '); fi
SORTED_BIN_PATHS=$(echo ${BIN_PATHS} | tr ' ' '\n' | sort | tr '\n' ' ') SORTED_BIN_PATHS=$(echo ${BIN_PATHS} | tr ' ' '\n' | sort | uniq | tr '\n' ' ')
for SCANDIR in ${SORTED_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=""

View File

@ -23,8 +23,8 @@
################################################################################# #################################################################################
# #
# Paths where system and program binaries are located # Paths where system and program binaries are typically located
BIN_PATHS="/bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin \ 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/local/libexec /usr/libexec /usr/sfw/bin /usr/sfw/sbin \
/usr/sfw/libexec /opt/sfw/bin /opt/sfw/sbin /opt/sfw/libexec \ /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 \ /usr/xpg4/bin /usr/css/bin /usr/ucb /usr/X11R6/bin /usr/X11R7/bin \