diff options
author | Yoann Vandoorselaere <yoann@mandriva.com> | 1999-12-19 20:05:06 +0000 |
---|---|---|
committer | Yoann Vandoorselaere <yoann@mandriva.com> | 1999-12-19 20:05:06 +0000 |
commit | f452f1717554c19e09ae8ef68aeb00e107b08015 (patch) | |
tree | 2a645692f9ec964c7b2b8744cc5aeea2835f0135 /cron-sh/security_check.sh | |
parent | ee1bc9f98ca6fb3c2a9fef6b559ecd87eb64cf53 (diff) | |
download | msec-f452f1717554c19e09ae8ef68aeb00e107b08015.tar msec-f452f1717554c19e09ae8ef68aeb00e107b08015.tar.gz msec-f452f1717554c19e09ae8ef68aeb00e107b08015.tar.bz2 msec-f452f1717554c19e09ae8ef68aeb00e107b08015.tar.xz msec-f452f1717554c19e09ae8ef68aeb00e107b08015.zip |
*** empty log message ***
Diffstat (limited to 'cron-sh/security_check.sh')
-rwxr-xr-x | cron-sh/security_check.sh | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/cron-sh/security_check.sh b/cron-sh/security_check.sh index d7d6ff3..aafa294 100755 --- a/cron-sh/security_check.sh +++ b/cron-sh/security_check.sh @@ -43,34 +43,29 @@ Ttylog() { ### Writeable file detection if [[ ${CHECK_WRITEABLE} == yes ]]; then - find ${DIR} -xdev -type f -perm -2 -print | sort > ${TMP} - - if [[ -s ${TMP} ]]; then - printf "\nSecurity Warning: World Writeable Files found :\n" >> ${SECURITY} - cat ${TMP} | awk '{print "\t\t- " $0}' >> ${SECURITY} + if [[ -s ${WRITEABLE_TODAY} ]]; then + printf "\nSecurity Warning: World Writeable files found :\n" >> ${SECURITY} + cat ${WRITEABLE_TODAY} | awk '{print "\t\t- " $0}' >> ${SECURITY} fi fi ### Search Un Owned file if [[ ${CHECK_UNOWNED} == yes ]]; then - find ${DIR} -xdev -nouser -print | sort > ${TMP} - - if [[ -s ${TMP} ]]; then - printf "\nSecurity Warning : the following file aren't owned by any user :\n" >> ${SECURITY} - printf "\ttheses files now have user \"nobody\" as their owner." >> ${SECURITY_LOG} - cat ${TMP} | awk '{print "\t\t- " $0}' >> ${SECURITY} - cat ${TMP} | while read line; do - chown nobody ${line}; + if [[ -s ${UNOWNED_USER_TODAY} ]]; then + printf "\nSecurity Warning : User Unowned files found :\n" >> ${SECURITY} + printf "\t( theses files now have user \"nobody\" as their owner. )\n" >> ${SECURITY_LOG} + cat ${UNOWNED_USER_TODAY} | awk '{print "\t\t- " $0}' >> ${SECURITY} + cat ${UNOWNED_USER_TODAY} | while read line; do + chown nobody "${line}"; # Use quote if filename contain space. done fi - find $DIR -xdev -nogroup -print | sort > ${TMP} - if [[ -s ${TMP} ]]; then - printf "\nSecurity Warning : the following file aren't owned by any group :\n" >> ${SECURITY} - printf "\ttheses files now have group \"nogroup\" as their group owner." >> ${SECURITY} - cat ${TMP} | awk '{print "\t\t- " $0}' >> ${SECURITY} - cat ${TMP} | while read line; do - chgrp nogroup ${line}; + if [[ -s ${UNOWNED_GROUP_TODAY} ]]; then + printf "\nSecurity Warning : Group Unowned files found :\n" >> ${SECURITY} + printf "\t( theses files now have group \"nogroup\" as their group owner. )\n" >> ${SECURITY} + cat ${UNOWNED_GROUP_TODAY} | awk '{print "\t\t- " $0}' >> ${SECURITY} + cat ${UNOWNED_GROUP_TODAY} | while read line; do + chgrp nogroup "${line}"; # Use quote if filename contain space. done fi fi |