aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xcron-sh/diff_check.sh2
-rwxr-xr-xcron-sh/security.sh32
2 files changed, 18 insertions, 16 deletions
diff --git a/cron-sh/diff_check.sh b/cron-sh/diff_check.sh
index 9b548d6..1b6f9e4 100755
--- a/cron-sh/diff_check.sh
+++ b/cron-sh/diff_check.sh
@@ -143,9 +143,7 @@ if [[ -s ${TMP} ]]; then
echo -e "\n\n*** Diff Check, ${date} ***\n" >> ${SECURITY_LOG}
cat ${TMP} >> ${SECURITY_LOG}
-
Maillog "*** Diff Check, ${date} ***" "${TMP}"
-
fi
if [[ -f ${TMP} ]]; then
diff --git a/cron-sh/security.sh b/cron-sh/security.sh
index 9f97382..f238c07 100755
--- a/cron-sh/security.sh
+++ b/cron-sh/security.sh
@@ -78,17 +78,17 @@ find ${DIR} -xdev -type f -perm -2 -printf "${PRINT}" 2> /dev/null | sort > ${WR
find ${DIR} -xdev -nouser -printf "${PRINT}" 2> /dev/null | sort > ${UNOWNED_USER_TODAY}
find ${DIR} -xdev -nogroup -printf "${PRINT}" 2> /dev/null | sort > ${UNOWNED_GROUP_TODAY}
-cat ${SUID_ROOT_TODAY} | while read line; do
+while read line; do
md5sum ${line}
-done > ${SUID_MD5_TODAY}
+done < ${SUID_ROOT_TODAY} > ${SUID_MD5_TODAY}
### Functions ###
Syslog() {
if [[ ${SYSLOG_WARN} == yes ]]; then
- cat ${1} | while read line; do
+ while read line; do
/sbin/initlog --string="${line}"
- done
+ done < ${1}
fi
}
@@ -104,17 +104,13 @@ Maillog() {
subject=${1}
text=${2}
- if [[ ${MAIL_WARN} != yes ]]; then
- return;
- fi
-
- if [[ -z ${MAIL_USER} ]]; then
- return;
+ if [[ ${MAIL_WARN} == yes ]]; then
+ if [[ ! -z ${MAIL_USER} ]]; then
+ if [[ -x /bin/mail ]]; then
+ cat ${text} | /bin/mail -s "${subject}" "${MAIL_USER}"
+ fi
+ fi
fi
-
- if [[ -x /bin/mail ]]; then
- cat ${text} | /bin/mail -s "${subject}" "${MAIL_USER}"
- fi
}
##################
@@ -122,3 +118,11 @@ Maillog() {
. /etc/security/msec/cron-sh/diff_check.sh
. /etc/security/msec/cron-sh/security_check.sh
+
+
+
+
+
+
+
+