1
0
mirror of https://github.com/CISOfy/lynis.git synced 2025-04-08 17:15:25 +02:00

[KRNL-5830] improved detection for non-symlinked kernel on disk

This commit is contained in:
Michael Boelen 2020-06-21 13:14:08 +02:00
parent aebd5ed9b3
commit 6d9b530bf4
No known key found for this signature in database
GPG Key ID: 26141F77A09D7F04

@ -674,7 +674,10 @@
LogText "Result: found a symlink, retrieving destination"
FOUND_VMLINUZ=$(readlink "${FOUND_VMLINUZ}")
LogText "Result: destination file is ${FOUND_VMLINUZ}"
VERSION_ON_DISK=$(echo ${FOUND_VMLINUZ} | ${SEDBINARY} 's/^vmlinuz-//')
VERSION_ON_DISK=$(echo ${FOUND_VMLINUZ} | ${SEDBINARY} 's#^/boot/##' | ${SEDBINARY} 's/^vmlinuz-//')
LogText "Result: version derived from file name is '${VERSION_ON_DISK}'"
elif [ -f "${FOUND_VMLINUZ}" ]; then
VERSION_ON_DISK=$(echo ${FOUND_VMLINUZ} | ${SEDBINARY} 's#^/boot/##' | ${SEDBINARY} 's/^vmlinuz-//')
LogText "Result: version derived from file name is '${VERSION_ON_DISK}'"
fi