mirror of https://github.com/CISOfy/lynis.git
[KRNL-5830] Fetch target for symlinked kernel
This commit is contained in:
parent
d680fe549f
commit
4e255617d3
|
@ -640,13 +640,14 @@
|
||||||
else
|
else
|
||||||
ReportException "${TEST_NO}:1" "Can't determine kernel version on disk, need debug data"
|
ReportException "${TEST_NO}:1" "Can't determine kernel version on disk, need debug data"
|
||||||
fi
|
fi
|
||||||
elif [ -f ${ROOTDIR}boot/vmlinuz-linux -o -f ${ROOTDIR}boot/vmlinuz-linux-lts -o -f $(ls -t ${ROOTDIR}boot/vmlinuz-* 2> /dev/null | head -1) ]; then
|
elif [ -f ${ROOTDIR}boot/vmlinuz-linux -o -f ${ROOTDIR}boot/vmlinuz-linux-lts -o -f $(ls -t ${ROOTDIR}boot/vm[l-]* 2> /dev/null | head -1) ]; then
|
||||||
if [ -f ${ROOTDIR}boot/vmlinuz-linux ]; then
|
if [ -L ${ROOTDIR}boot/vmlinuz-linux ]; then
|
||||||
FOUND_VMLINUZ=${ROOTDIR}boot/vmlinuz-linux
|
FOUND_VMLINUZ=$(readlink ${ROOTDIR}boot/vmlinuz-linux)
|
||||||
elif [ -f ${ROOTDIR}boot/vmlinuz-linux-lts ]; then
|
elif [ -f ${ROOTDIR}boot/vmlinuz-linux-lts ]; then
|
||||||
FOUND_VMLINUZ=${ROOTDIR}boot/vmlinuz-linux-lts
|
FOUND_VMLINUZ=${ROOTDIR}boot/vmlinuz-linux-lts
|
||||||
else
|
else
|
||||||
FOUND_VMLINUZ=$(ls -t ${ROOTDIR}boot/vmlinuz-* 2> /dev/null | head -1)
|
# Match on /boot/vm5.3.7 or /boot/vmlinuz-5.3.7-1-default
|
||||||
|
FOUND_VMLINUZ=$(ls -t ${ROOTDIR}boot/vm[l-]* 2> /dev/null | head -1)
|
||||||
fi
|
fi
|
||||||
LogText "Result: found ${FOUND_VMLINUZ}"
|
LogText "Result: found ${FOUND_VMLINUZ}"
|
||||||
LogText "Test: checking kernel version on disk"
|
LogText "Test: checking kernel version on disk"
|
||||||
|
|
Loading…
Reference in New Issue