mirror of https://github.com/CISOfy/lynis.git
PKGS-7392: filter only lines starting with a number when checking apt-check
This commit is contained in:
parent
14f0d563ed
commit
f8e2da3087
|
@ -1161,7 +1161,9 @@ EOF
|
||||||
LogText "Result: found ${ROOTDIR}usr/lib/update-notifier/apt-check"
|
LogText "Result: found ${ROOTDIR}usr/lib/update-notifier/apt-check"
|
||||||
LogText "Test: checking if any of the updates contain security updates"
|
LogText "Test: checking if any of the updates contain security updates"
|
||||||
# apt-check binary is a script and translated. Do not search for normal text strings, but use numbered output only
|
# apt-check binary is a script and translated. Do not search for normal text strings, but use numbered output only
|
||||||
FIND=$(${ROOTDIR}usr/lib/update-notifier/apt-check 2>&1 | ${AWKBINARY} -F\; '{ print $2 }')
|
# We search for the lines that start with a number, as on Ubuntu 24.04 an error can happen:
|
||||||
|
# Warning: W:Unable to read /var/lib/ubuntu-advantage/apt-esm/etc/apt/apt.conf.d/ - DirectoryExists (2: No such file or directory)
|
||||||
|
FIND=$(${ROOTDIR}usr/lib/update-notifier/apt-check 2>&1 | ${GREPBINARY} '^[0-9]' | ${AWKBINARY} -F\; '{ print $2 }')
|
||||||
# Check if we get the proper line back and amount of security patches available
|
# Check if we get the proper line back and amount of security patches available
|
||||||
if [ -z "${FIND}" ]; then
|
if [ -z "${FIND}" ]; then
|
||||||
LogText "Result: did not find security updates line"
|
LogText "Result: did not find security updates line"
|
||||||
|
|
Loading…
Reference in New Issue