aboutsummaryrefslogtreecommitdiffstats
path: root/cron-sh
diff options
context:
space:
mode:
authorYoann Vandoorselaere <yoann@mandriva.com>2000-03-19 18:41:45 +0000
committerYoann Vandoorselaere <yoann@mandriva.com>2000-03-19 18:41:45 +0000
commitf23b9e38637ce6986f37e56ab05af26b593bfab3 (patch)
tree511af2809432aaa525d08ee4a6f597e791390103 /cron-sh
parentd5a4d37160aacc52b9a234fd084b5086db5c9452 (diff)
downloadmsec-f23b9e38637ce6986f37e56ab05af26b593bfab3.tar
msec-f23b9e38637ce6986f37e56ab05af26b593bfab3.tar.gz
msec-f23b9e38637ce6986f37e56ab05af26b593bfab3.tar.bz2
msec-f23b9e38637ce6986f37e56ab05af26b593bfab3.tar.xz
msec-f23b9e38637ce6986f37e56ab05af26b593bfab3.zip
*** empty log message ***
Diffstat (limited to 'cron-sh')
-rwxr-xr-xcron-sh/security.sh45
1 files changed, 30 insertions, 15 deletions
diff --git a/cron-sh/security.sh b/cron-sh/security.sh
index b949028..b6636b5 100755
--- a/cron-sh/security.sh
+++ b/cron-sh/security.sh
@@ -76,21 +76,36 @@ netstat -pvlA inet 2> /dev/null > ${OPEN_PORT_TODAY};
# Hard disk related file check; the less priority the better...
nice --adjustment=+19 /usr/bin/msec_find ${DIR}
-sort < ${SUID_ROOT_TODAY} > ${SUID_ROOT_TODAY}.tmp
-sort < ${SUID_GROUP_TODAY} > ${SUID_GROUP_TODAY}.tmp
-sort < ${WRITEABLE_TODAY} > ${WRITEABLE_TODAY}.tmp
-sort < ${UNOWNED_USER_TODAY} > ${UNOWNED_USER_TODAY}.tmp
-sort < ${UNOWNED_GROUP_TODAY} > ${UNOWNED_GROUP_TODAY}.tmp
-
-mv -f ${SUID_ROOT_TODAY}.tmp ${SUID_ROOT_TODAY}
-mv -f ${SUID_GROUP_TODAY}.tmp ${SUID_GROUP_TODAY}
-mv -f ${WRITEABLE_TODAY}.tmp ${WRITEABLE_TODAY}
-mv -f ${UNOWNED_USER_TODAY}.tmp ${UNOWNED_USER_TODAY}
-mv -f ${UNOWNED_GROUP_TODAY}.tmp ${UNOWNED_GROUP_TODAY}
-
-while read line; do
- md5sum ${line}
-done < ${SUID_ROOT_TODAY} > ${SUID_MD5_TODAY}
+if [[ -f ${SUID_ROOT_TODAY} ]]; then
+ sort < ${SUID_ROOT_TODAY} > ${SUID_ROOT_TODAY}.tmp
+ mv -f ${SUID_ROOT_TODAY}.tmp ${SUID_ROOT_TODAY}
+fi
+
+if [[ -f ${SUID_GROUP_TODAY} ]]; then
+ sort < ${SUID_GROUP_TODAY} > ${SUID_GROUP_TODAY}.tmp
+ mv -f ${SUID_GROUP_TODAY}.tmp ${SUID_GROUP_TODAY}
+fi
+
+if [[ -f ${WRITEABLE_TODAY} ]]; then
+ sort < ${WRITEABLE_TODAY} > ${WRITEABLE_TODAY}.tmp
+ mv -f ${WRITEABLE_TODAY}.tmp ${WRITEABLE_TODAY}
+fi
+
+if [[ -f ${UNOWNED_USER_TODAY} ]]; then
+ sort < ${UNOWNED_USER_TODAY} > ${UNOWNED_USER_TODAY}.tmp
+ mv -f ${UNOWNED_USER_TODAY}.tmp ${UNOWNED_USER_TODAY}
+fi
+
+if [[ -f ${UNOWNED_GROUP_TODAY} ]]; then
+ sort < ${UNOWNED_GROUP_TODAY} > ${UNOWNED_GROUP_TODAY}.tmp
+ mv -f ${UNOWNED_GROUP_TODAY}.tmp ${UNOWNED_GROUP_TODAY}
+fi
+
+if [[ -f ${SUID_ROOT_TODAY} ]]; then
+ while read line; do
+ md5sum ${line}
+ done < ${SUID_ROOT_TODAY} > ${SUID_MD5_TODAY}
+fi
### Functions ###