File: //opt/BCLinux/bse/option_check/c24_noOneSU
#!/bin/sh
#=======================================================
InsertSection "check if permit user can su to root"
LINE_NUMEBER=`grep -n '^auth' /etc/pam.d/su | head -n 1 | awk -F : '{printf $1}'`
LINE_NUMEBER=`expr $LINE_NUMEBER`
IS_EXIST=`grep '^auth' /etc/pam.d/su |grep pam_wheel.so | grep "group=wheel" | wc -l`
if [ ${IS_EXIST} -eq 0 ]; then
echo "c24" >> $RESULT_FILE
echo "" >> $RESULT_FILE
logtext "WRN_C24: $(loadtext TXT_WRN_C24)"
logtext "Suggestion: $(loadtext TXT_SUG_C24)"
Display --indent 2 --text "- Check the pam.d/su setting... " --result WARNING --color RED
Display --indent 2 --text "There is no pam_wheel set, check warning"
AddHP 0 1
else
logtext "There have pam_wheel set, check OK"
Display --indent 2 --text "- Check the pam.d/su setting... " --result OK --color GREEN
AddHP 1 1
fi