From 924e53ed76050bae9d66bcc76f6c53c917bfade0 Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Tue, 3 May 2016 10:58:05 +0200 Subject: Do an earlier detection of grsecurity and store result, so tests can be simplified --- include/tests_mac_frameworks | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'include/tests_mac_frameworks') diff --git a/include/tests_mac_frameworks b/include/tests_mac_frameworks index 74d662f7..6ee373de 100644 --- a/include/tests_mac_frameworks +++ b/include/tests_mac_frameworks @@ -19,7 +19,6 @@ ################################################################################# # APPARMORFOUND=0 # Set default for test MACF-6208 - GRSECFOUND=0 # grsecurity MAC_FRAMEWORK_ACTIVE=0 # Default no MAC framework active RBAC_FRAMEWORK_ACTIVE=0 # Default no RBAC framework active SELINUXFOUND=0 @@ -137,28 +136,20 @@ # # Test : RBAC-6272 # Description : Check if grsecurity is installed - # Notes : Solaris doesn't support test -e - if [ ! "${OS}" = "Solaris" ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi - Register --test-no RBAC-6272 --preqs-met ${PREQS_MET} --weight L --network NO --description "Check grsecurity presence" + # Notes : We already checked grsecurity in osdetection + Register --test-no RBAC-6272 --weight L --network NO --description "Check grsecurity presence" if [ ${SKIPTEST} -eq 0 ]; then - if [ -e /dev/grsec ]; then - GRSECFOUND=1 - LogText "Result: grsecurity available (/dev/grsec found)" - else - LogText "Result: grsecurity not present (/dev/grsec not found)" - fi # Check Linux kernel configuration if [ ! "${LINUXCONFIGFILE}" = "" -a -f "${LINUXCONFIGFILE}" ]; then FIND=`${GREPBINARY} ^CONFIG_GRKERNSEC=y ${LINUXCONFIGFILE}` if [ ! "${FIND}" = "" ]; then LogText "Result: grsecurity available (in kernel config)" - GRSECFOUND=1 + GRSEC_FOUND=1 else LogText "Result: no grsecurity found in kernel config" fi fi - # Found grsecurity? - if [ ${GRSECFOUND} -eq 1 ]; then + if [ ${GRSEC_FOUND} -eq 1 ]; then Display --indent 2 --text "- Checking presence grsecurity" --result FOUND --color GREEN AddHP 3 3 else @@ -186,7 +177,7 @@ ################################################################################# # -Report "framework_grsecurity=${GRSECFOUND}" +Report "framework_grsecurity=${GRSEC_FOUND}" Report "framework_selinux=${SELINUXFOUND}" WaitForKeyPress -- cgit v1.2.3