mirror of https://github.com/CISOfy/lynis.git
[KRNL-5830] ignore rescue kernel on systems such as CentOS
This commit is contained in:
parent
92df49d08e
commit
71c474f455
|
@ -665,8 +665,9 @@
|
||||||
LogText "Result: found ${ROOTDIR}boot/vmlinuz-linux-lts"
|
LogText "Result: found ${ROOTDIR}boot/vmlinuz-linux-lts"
|
||||||
FOUND_VMLINUZ=${ROOTDIR}boot/vmlinuz-linux-lts
|
FOUND_VMLINUZ=${ROOTDIR}boot/vmlinuz-linux-lts
|
||||||
else
|
else
|
||||||
# Match on /boot/vm5.3.7 or /boot/vmlinuz-5.3.7-1-default
|
# Match on items like /boot/vm5.3.7 or /boot/vmlinuz-5.3.7-1-default. Get newest file (ls -t and pipe into head)
|
||||||
FOUND_VMLINUZ=$(${LSBINARY} -t ${ROOTDIR}boot/vm[l0-9]* 2> /dev/null | ${HEADBINARY} -1)
|
# Note: ignore a rescue kernel (e.g. CentOS)
|
||||||
|
FOUND_VMLINUZ=$(${LSBINARY} -t ${ROOTDIR}boot/vm[l0-9]* 2> /dev/null | ${GREPBINARY} -v '\-rescue\-' | ${HEADBINARY} -1)
|
||||||
LogText "Result: found ${FOUND_VMLINUZ}"
|
LogText "Result: found ${FOUND_VMLINUZ}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue