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>2020-03-31 17:25:27 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2020-03-31 17:25:27 +0300
commit53ad72e791ea378e4974e2db1eb416d4ee537455 (patch)
tree10b7f80cc31db390f251414dd9faeecc5ef474d8 /include/functions
parent4ff61a6f46dc016552c805407939211f0c90560b (diff)
Removed unneeded complexity regarding dmidecode, as binary checks are already done at this point
Diffstat (limited to 'include/functions')
-rw-r--r--include/functions10
1 files changed, 3 insertions, 7 deletions
diff --git a/include/functions b/include/functions
index 5b60419f..fd47cd3d 100644
--- a/include/functions
+++ b/include/functions
@@ -1774,14 +1774,9 @@
# dmidecode
# Values: VMware Virtual Platform / VirtualBox
if [ -z "${SHORT}" ]; then
- if [ -x /usr/bin/dmidecode ]; then DMIDECODE_BINARY="/usr/bin/dmidecode"
- elif [ -x /usr/sbin/dmidecode ]; then DMIDECODE_BINARY="/usr/sbin/dmidecode"
- else
- DMIDECODE_BINARY=""
- fi
- if [ ! "${DMIDECODE_BINARY}" = "" -a ${PRIVILEGED} -eq 1 ]; then
+ if [ -n "${DMIDECODEBINARY}" -a -x "${DMIDECODEBINARY}" -a ${PRIVILEGED} -eq 1 ]; then
LogText "Test: trying to guess virtualization with dmidecode"
- FIND=$(/usr/sbin/dmidecode -s system-product-name | awk '{ print $1 }')
+ FIND=$(${DMIDECODEBINARY} -s system-product-name | awk '{ print $1 }')
if [ -n "${FIND}" ]; then
LogText "Result: found ${FIND}"
SHORT="${FIND}"
@@ -1794,6 +1789,7 @@
else
LogText "Result: skipped dmidecode test, as we already found machine type"
fi
+
# Other options
# SaltStack: salt-call grains.get virtual
# < needs snippet >