From 34574228404994c812086fd30bb7f78a49d7c3df Mon Sep 17 00:00:00 2001 From: Frederic Lepied Date: Fri, 22 Feb 2002 18:42:14 +0000 Subject: check uid and not gid --- cron-sh/security_check.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'cron-sh/security_check.sh') diff --git a/cron-sh/security_check.sh b/cron-sh/security_check.sh index 2b300ba..dcdbfc4 100755 --- a/cron-sh/security_check.sh +++ b/cron-sh/security_check.sh @@ -4,13 +4,17 @@ # Written by Vandoorselaere Yoann, # -if [[ -f /etc/security/msec/security.conf ]]; then - . /etc/security/msec/security.conf +if [[ -f /var/lib/msec/security.conf ]]; then + . /var/lib/msec/security.conf else - echo "/etc/security/msec/security.conf don't exist." + echo "/var/lib/msec/security.conf don't exist." exit 1 fi +if [[ -f /etc/security/msec/security.conf ]]; then + . /etc/security/msec/security.conf +fi + if [[ ${CHECK_SECURITY} != yes ]]; then exit 0 fi @@ -62,7 +66,7 @@ while read username uid homedir; do for f in ${list} ; do file="${homedir}/${f}" if [[ -f ${file} ]] ; then - printf "${uid} ${username} ${file} `ls -Lldcgn ${file}`\n" + printf "${uid} ${username} ${file} `ls -LldcGn ${file}`\n" fi done done | awk '$1 != $6 && $6 != "0" \ @@ -91,7 +95,7 @@ while read username uid homedir; do for f in ${list} ; do file=${homedir}/${f} if [[ -f ${file} ]] ; then - printf "${uid} ${username} ${file} `ls -Lldcgn ${file}`\n" + printf "${uid} ${username} ${file} `ls -LldcGn ${file}`\n" fi done done | awk '$1 != $6 && $6 != "0" \ @@ -110,9 +114,9 @@ fi awk -F: '/^[^+-]/ { print $1 " " $3 " " $6 }' /etc/passwd | \ while read username uid homedir; do if [[ -d ${homedir} ]] ; then - realuid=`ls -Lldgn ${homedir}| awk '{ print $3 }'` - realuser=`ls -Lldg ${homedir}| awk '{ print $3 }'` - permissions=`ls -Lldg ${homedir}| awk '{ print $1 }'` + realuid=`ls -LldGn ${homedir}| awk '{ print $3 }'` + realuser=`ls -LldG ${homedir}| awk '{ print $3 }'` + permissions=`ls -LldG ${homedir}| awk '{ print $1 }'` printf "${permissions} ${username} (${uid}) ${realuser} (${realuid})\n" fi done | awk '$3 != $5 && $5 != "(0)" \ -- cgit v1.2.1