mirror of
https://github.com/CISOfy/lynis.git
synced 2025-04-08 17:15:25 +02:00
[KRNL-5830] derive kernel version from filename after obtaining symlink target
This commit is contained in:
parent
ab4291242d
commit
b7da40c6ae
@ -645,7 +645,7 @@
|
||||
LogText "Result: found symlink ${ROOTDIR}boot/vmlinuz-linux"
|
||||
FOUND_VMLINUZ=$(readlink ${ROOTDIR}boot/vmlinuz-linux)
|
||||
LogText "Result: symlinked target is ${FOUND_VMLINUZ}"
|
||||
VERSION_ON_DISK=$(echo ${FOUND_VMLINUZ} | sed 's/^vmlinuz-//')
|
||||
VERSION_ON_DISK=$(echo ${FOUND_VMLINUZ} | ${SEDBINARY} 's/^vmlinuz-//')
|
||||
elif [ -f ${ROOTDIR}boot/vmlinuz-linux-lts ]; then
|
||||
LogText "Result: found boot/vmlinuz-linux-lts"
|
||||
FOUND_VMLINUZ=${ROOTDIR}boot/vmlinuz-linux-lts
|
||||
@ -658,10 +658,11 @@
|
||||
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-//')
|
||||
LogText "Result: version derived from file name is '${VERSION_ON_DISK}'"
|
||||
fi
|
||||
|
||||
if [ -z "${VERSION_ON_DISK}" ]; then
|
||||
|
||||
LogText "Result: found ${FOUND_VMLINUZ}"
|
||||
LogText "Test: checking kernel version on disk"
|
||||
NEXTLINE=0
|
||||
|
Loading…
x
Reference in New Issue
Block a user