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"
|
elif [ -x /usr/sbin/dmidecode ]; then DMIDECODE_BINARY="/usr/sbin/dmidecode"
|
||||||
else DMIDECODE_BINARY=""
|
else DMIDECODE_BINARY=""
|
||||||
fi
|
fi
|
||||||
if [ ! "${DMIDECODE_BINARY}" = "" ]; then
|
if [ ! "${DMIDECODE_BINARY}" = "" -a ${PRIVILEGED} -eq 1 ]; then
|
||||||
LogText "Test: trying to guess virtualization with dmidecode"
|
LogText "Test: trying to guess virtualization with dmidecode"
|
||||||
FIND=`/usr/sbin/dmidecode -s system-product-name | awk '{ print $1 }'`
|
FIND=`/usr/sbin/dmidecode -s system-product-name | awk '{ print $1 }'`
|
||||||
if [ ! "${FIND}" = "" ]; then
|
if [ ! "${FIND}" = "" ]; then
|
||||||
|
@ -1029,7 +1029,7 @@
|
||||||
LogText "Result: can't find product name with dmidecode"
|
LogText "Result: can't find product name with dmidecode"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
LogText "Result: dmidecode not found"
|
LogText "Result: dmidecode not found (or no access)"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
LogText "Result: skipped dmidecode test, as we already found machine type"
|
LogText "Result: skipped dmidecode test, as we already found machine type"
|
||||||
|
@ -1039,7 +1039,7 @@
|
||||||
if [ "${SHORT}" = "" ]; then
|
if [ "${SHORT}" = "" ]; then
|
||||||
if [ -x /usr/bin/lshw ]; then
|
if [ -x /usr/bin/lshw ]; then
|
||||||
LogText "Test: trying to guess virtualization with lshw"
|
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
|
if [ ! "${FIND}" = "" ]; then
|
||||||
LogText "Result: found ${FIND}"
|
LogText "Result: found ${FIND}"
|
||||||
SHORT="${FIND}"
|
SHORT="${FIND}"
|
||||||
|
|
Loading…
Reference in New Issue