mirror of https://github.com/CISOfy/lynis.git
Don't show errors when we are running non-privileged
This commit is contained in:
parent
062782e7a5
commit
dab69d2860
|
@ -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}"
|
||||
|
|
Loading…
Reference in New Issue