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:
authorsilentcreek <silentcreek@users.noreply.github.com>2019-03-07 12:05:12 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2019-03-07 12:05:12 +0300
commitfb567465c9159e9217907776e3132392ad8baeb5 (patch)
treeba0e206f32a8396da31c754256b226a8d7f1eb30
parent17f2e34660b9be19ad671feb783bf957703fa038 (diff)
[KRNL-5788] Fix false positive warning on missing /vmlinuz (#650)
Not all architectures use a /vmlinuz symlink in Debian. For instance, armhf systems may only provide a symlink in /boot/vmlinuz. Fall back to testing /boot/vmlinuz if /vmlinuz is not found. Signed-off-by: Timo Sigurdsson <public_timo.s@silentcreek.de>
-rw-r--r--include/tests_kernel17
1 files changed, 12 insertions, 5 deletions
diff --git a/include/tests_kernel b/include/tests_kernel
index 88a3c2fc..62c78800 100644
--- a/include/tests_kernel
+++ b/include/tests_kernel
@@ -374,10 +374,17 @@
LogText "Test: Searching apt-cache, to determine if a newer kernel is available"
if [ -x ${ROOTDIR}usr/bin/apt-cache ]; then
LogText "Result: found ${ROOTDIR}usr/bin/apt-cache"
- LogText "Test: checking readlink location of ${ROOTDIR}vmlinuz"
- if [ -f ${ROOTDIR}vmlinuz ]; then
+ LogText "Test: checking presence of ${ROOTDIR}vmlinuz or ${ROOTDIR}boot/vmlinuz"
+ if [ -f ${ROOTDIR}vmlinuz -o -f ${ROOTDIR}boot/vmlinuz ]; then
HAS_VMLINUZ=1
- FINDKERNFILE=$(readlink -f ${ROOTDIR}vmlinuz)
+ if [ -f ${ROOTDIR}vmlinuz ]; then
+ FINDVMLINUZ=${ROOTDIR}vmlinuz
+ else
+ FINDVMLINUZ=${ROOTDIR}boot/vmlinuz
+ fi
+ LogText "Result: found ${FINDVMLINUZ}"
+ LogText "Test: checking readlink location of ${FINDVMLINUZ}"
+ FINDKERNFILE=$(readlink -f ${FINDVMLINUZ})
LogText "Output: readlink reported file ${FINDKERNFILE}"
LogText "Test: checking package from dpkg -S"
FINDKERNEL=$(dpkg -S ${FINDKERNFILE} 2> /dev/null | ${AWKBINARY} -F : '{print $1}')
@@ -386,8 +393,8 @@
FINDKERNEL=linux-image-$(uname -r)
LogText "Result: ${ROOTDIR}vmlinuz missing due to grsecurity; assuming ${FINDKERNEL}"
else
- LogText "This system is missing ${ROOTDIR}vmlinuz. Unable to check whether kernel is up-to-date."
- ReportSuggestion ${TEST_NO} "Determine why ${ROOTDIR}vmlinuz is missing on this Debian/Ubuntu system." "/vmlinuz"
+ LogText "This system is missing ${ROOTDIR}vmlinuz or ${ROOTDIR}boot/vmlinuz. Unable to check whether kernel is up-to-date."
+ ReportSuggestion ${TEST_NO} "Determine why ${ROOTDIR}vmlinuz or ${ROOTDIR}boot/vmlinuz is missing on this Debian/Ubuntu system." "/vmlinuz or /boot/vmlinuz"
fi
LogText "Test: Using apt-cache policy to determine if there is an update available"
FINDINST=$(apt-cache policy ${FINDKERNEL} | ${EGREPBINARY} 'Installed' | ${CUTBINARY} -d ':' -f2 | ${TRBINARY} -d ' ')