From 210ba41a3c2c43041fa4ba40e9e0b0676052a2b8 Mon Sep 17 00:00:00 2001 From: mboelen Date: Thu, 20 Aug 2015 18:46:06 +0200 Subject: [PATCH] Improved umask detection and logging --- include/tests_authentication | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/include/tests_authentication b/include/tests_authentication index b00ef5ad..d4e9463b 100644 --- a/include/tests_authentication +++ b/include/tests_authentication @@ -813,7 +813,9 @@ #FIND2=`egrep "^([[:space:]])([[:tab:]])*umask" /etc/profile | awk '{ print $2 }' | wc -l` WEAK_UMASK=0 FOUND_UMASK=0 - if [ "${FIND2}" = "1" ]; then + if [ "${FIND2}" = "0" ]; then + logtext "Result: did not find umask in /etc/profile" + elif [ "${FIND2}" = "1" ]; then logtext "Result: found umask (prefixed with spaces)" FOUND_UMASK=1 if [ ! "${FIND}" = "077" -a ! "${FIND}" = "027" ]; then @@ -824,7 +826,7 @@ fi # Found more than 1 umask value in profile else - logtext "Result: found several umask values configured in /etc/profile" + logtext "Result: found multiple umask values configured in /etc/profile" FOUND_UMASK=1 for I in ${FIND}; do if [ ! "${I}" = "077" -a ! "${I}" = "027" ]; then @@ -861,7 +863,7 @@ logtext "Test: Checking umask entries in /etc/passwd (pam_umask)" if [ -f /etc/passwd ]; then logtext "Result: file /etc/passwd exists" - logtext "Test: Checking umask value in /etc/profile" + logtext "Test: Checking umask value in /etc/passwd" FIND=`grep "umask=" /etc/passwd` if [ "${FIND}" = "" ]; then ReportManual "AUTH-9328:03" @@ -873,7 +875,7 @@ # /etc/login.defs logtext "Test: Checking /etc/login.defs" if [ -f /etc/login.defs ]; then - logtext "Result: file /etc/profile exists" + logtext "Result: file /etc/login.defs exists" logtext "Test: Checking umask value in /etc/login.defs" FIND=`grep "^UMASK" /etc/login.defs | awk '{ print $2 }'` if [ "${FIND}" = "" ]; then