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>2019-07-05 19:37:10 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2019-07-05 19:37:10 +0300
commitc639cb4f6e30f2fef49cefd55eb2fd99044cc3fe (patch)
tree4962c4237dba9e50c80fdfa2122d320fdc0070d8 /include/binaries
parent8d4fd1a7aa47a39375b2b6bcdab810b51b75ca01 (diff)
Only check empty binaries when we did a full scan, as for some commands the binary scanning is not performed
Diffstat (limited to 'include/binaries')
-rw-r--r--include/binaries46
1 files changed, 25 insertions, 21 deletions
diff --git a/include/binaries b/include/binaries
index c3e5dff9..d894caf9 100644
--- a/include/binaries
+++ b/include/binaries
@@ -279,6 +279,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')
@@ -286,31 +287,34 @@
LogText "Result: found ${COUNT} binaries"
Report "binaries_count=${COUNT}"
Report "binary_paths=${BINARY_PATHS_FOUND}"
+
+ # Test if the basic system tools are defined. These will be used during the audit.
+ [ "${AWKBINARY:-}" ] || ExitFatal "awk binary not found"
+ [ "${CUTBINARY:-}" ] || ExitFatal "cut binary not found"
+ [ "${EGREPBINARY:-}" ] || ExitFatal "grep binary not found"
+ [ "${FINDBINARY:-}" ] || ExitFatal "find binary not found"
+ [ "${GREPBINARY:-}" ] || ExitFatal "grep binary not found"
+ [ "${HEADBINARY:-}" ] || ExitFatal "head binary not found"
+ [ "${LSBINARY:-}" ] || ExitFatal "ls binary not found"
+ [ "${PSBINARY:-}" ] || ExitFatal "ps binary not found"
+ [ "${SEDBINARY:-}" ] || ExitFatal "sed binary not found"
+ [ "${SORTBINARY:-}" ] || ExitFatal "sort binary not found"
+ [ "${TRBINARY:-}" ] || ExitFatal "tr binary not found"
+ [ "${UNIQBINARY:-}" ] || ExitFatal "uniq binary not found"
+ [ "${WCBINARY:-}" ] || ExitFatal "wc binary not found"
+
+ # Test a few other tools that we did not specifically define (yet)
+ TOOLS="xxd"
+ for T in ${TOOLS}; do
+ DATA=$(type ${T})
+ if [ $? -gt 0 ]; then ExitFatal "${T} binary not found"; fi
+ done
+
+
else
LogText "Result: checking of binaries skipped in this mode"
fi
- # Test if the basic system tools are defined. These will be used during the audit.
- [ "${AWKBINARY:-}" ] || ExitFatal "awk binary not found"
- [ "${CUTBINARY:-}" ] || ExitFatal "cut binary not found"
- [ "${EGREPBINARY:-}" ] || ExitFatal "grep binary not found"
- [ "${FINDBINARY:-}" ] || ExitFatal "find binary not found"
- [ "${GREPBINARY:-}" ] || ExitFatal "grep binary not found"
- [ "${HEADBINARY:-}" ] || ExitFatal "head binary not found"
- [ "${LSBINARY:-}" ] || ExitFatal "ls binary not found"
- [ "${PSBINARY:-}" ] || ExitFatal "ps binary not found"
- [ "${SEDBINARY:-}" ] || ExitFatal "sed binary not found"
- [ "${SORTBINARY:-}" ] || ExitFatal "sort binary not found"
- [ "${TRBINARY:-}" ] || ExitFatal "tr binary not found"
- [ "${UNIQBINARY:-}" ] || ExitFatal "uniq binary not found"
- [ "${WCBINARY:-}" ] || ExitFatal "wc binary not found"
-
- # Test a few other tools that we did not specifically define (yet)
- TOOLS="xxd"
- for T in ${TOOLS}; do
- DATA=$(type ${T})
- if [ $? -gt 0 ]; then ExitFatal "${T} binary not found"; fi
- done
#
#================================================================================