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:
-rw-r--r--include/functions14
1 files changed, 9 insertions, 5 deletions
diff --git a/include/functions b/include/functions
index 73878f55..01e62e42 100644
--- a/include/functions
+++ b/include/functions
@@ -2143,11 +2143,15 @@
if [ ${SKIPTEST} -eq 0 -a "${TEST_WEIGHT}" = "H" -a "${SCAN_TEST_HEAVY}" = "NO" ]; then SKIPTEST=1; SKIPREASON="Test to system intensive for scan mode (H)"; fi
if [ ${SKIPTEST} -eq 0 -a "${TEST_WEIGHT}" = "M" -a "${SCAN_TEST_MEDIUM}" = "NO" ]; then SKIPTEST=1; SKIPREASON="Test to system intensive for scan mode (M)"; fi
- # Skip test if OS is different than requested
- if [ ${SKIPTEST} -eq 0 -a ! -z "${TEST_NEED_OS}" -a ! "${OS}" = "${TEST_NEED_OS}" ]; then
- SKIPTEST=1; SKIPREASON="Incorrect guest OS (${TEST_NEED_OS} only)"
- if [ ${LOG_INCORRECT_OS} -eq 0 ]; then
- SKIPLOGTEST=1
+ # Test if our OS is the same as the requested OS (can be multiple values)
+ if [ ${SKIPTEST} -eq 0 -a ! -z "${TEST_NEED_OS}" ]; then
+ HASMATCH=0
+ for I in ${TEST_NEED_OS}; do
+ if [ "${I}" = "${OS}" ]; then HASMATCH=1; fi
+ done
+ if [ ${HASMATCH} -eq 0 ]; then
+ SKIPTEST=1; SKIPREASON="Incorrect guest OS (${TEST_NEED_OS} only)"
+ if [ ${LOG_INCORRECT_OS} -eq 0 ]; then SKIPLOGTEST=1; fi
fi
fi