From 3e20c1e30b3036c3452737fad9bd5ddb9d5ca946 Mon Sep 17 00:00:00 2001 From: mboelen Date: Mon, 25 Apr 2016 10:56:11 +0200 Subject: [PATCH] [KRNL-5788] Improvements for grsecurity kernels --- include/tests_kernel | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/include/tests_kernel b/include/tests_kernel index a2089e69..e9781240 100644 --- a/include/tests_kernel +++ b/include/tests_kernel @@ -349,15 +349,13 @@ LogText "Test: checking package from dpkg -S" FINDKERNEL=`dpkg -S ${FINDKERNFILE} 2> /dev/null | awk -F : '{print $1}'` LogText "Output: dpkg -S reported package ${FINDKERNEL}" + elif [ -e /dev/grsec ]; then + FINDKERNEL=linux-image-`uname -r` + LogText "/vmlinuz missing due to grsecurity; assuming ${FINDKERNEL}" else - if [ -e /dev/grsec ]; then - FINDKERNEL=linux-image-`uname -r` - LogText "/vmlinuz missing due to grsecurity; assuming ${FINDKERNEL}" - else - LogText "This system is missing /vmlinuz. Unable to check whether kernel is up-to-date." - ReportException "${TEST_NO}:00|Missing /vmlinuz" - ReportSuggestion ${TEST_NO} "Discover why /vmlinuz is missing. Consider manually re-linking." - fi + LogText "This system is missing /vmlinuz. Unable to check whether kernel is up-to-date." + ReportException "${TEST_NO}:00|Missing /vmlinuz" + ReportSuggestion ${TEST_NO} "Discover why /vmlinuz is missing. Consider manually re-linking." fi LogText "Test: Using apt-cache policy to determine if there is an update available" FINDINST=`apt-cache policy ${FINDKERNEL} | egrep 'Installed' | cut -d ':' -f2 | tr -d ' '` @@ -375,7 +373,7 @@ if [ -e /dev/grsec ]; then Display --indent 2 --text "- Checking for available kernel update" --result GRSEC --color GREEN LogText "Result: Grsecurity is installed; unable to determine if there's a newer kernel available" - ReportSuggestion ${TEST_NO} "Manually check to confirm you're using a recent kernel and grsecurity patch" + ReportManual "Manually check to confirm you're using a recent kernel and grsecurity patch" else Display --indent 2 --text "- Checking for available kernel update" --result OK --color GREEN LogText "Result: no kernel update available"