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>2016-05-03 14:11:28 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2016-05-03 14:11:28 +0300
commitdab69d2860eafd326924b2c0259c2698cffa78ff (patch)
tree79acf9f8aea309195ee3250f36a44a98f3d8483a
parent062782e7a591de0f9815f1df7fde65356ed556aa (diff)
Don't show errors when we are running non-privileged
-rw-r--r--include/functions6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/functions b/include/functions
index 16919eb5..8800cd3f 100644
--- a/include/functions
+++ b/include/functions
@@ -1019,7 +1019,7 @@
elif [ -x /usr/sbin/dmidecode ]; then DMIDECODE_BINARY="/usr/sbin/dmidecode"
else DMIDECODE_BINARY=""
fi
- if [ ! "${DMIDECODE_BINARY}" = "" ]; then
+ if [ ! "${DMIDECODE_BINARY}" = "" -a ${PRIVILEGED} -eq 1 ]; then
LogText "Test: trying to guess virtualization with dmidecode"
FIND=`/usr/sbin/dmidecode -s system-product-name | awk '{ print $1 }'`
if [ ! "${FIND}" = "" ]; then
@@ -1029,7 +1029,7 @@
LogText "Result: can't find product name with dmidecode"
fi
else
- LogText "Result: dmidecode not found"
+ LogText "Result: dmidecode not found (or no access)"
fi
else
LogText "Result: skipped dmidecode test, as we already found machine type"
@@ -1039,7 +1039,7 @@
if [ "${SHORT}" = "" ]; then
if [ -x /usr/bin/lshw ]; then
LogText "Test: trying to guess virtualization with lshw"
- FIND=`lshw -quiet -class system | awk '{ if ($1=="product:") { print $2 }}'`
+ FIND=`lshw -quiet -class system 2> /dev/null | awk '{ if ($1=="product:") { print $2 }}'`
if [ ! "${FIND}" = "" ]; then
LogText "Result: found ${FIND}"
SHORT="${FIND}"