aboutsummaryrefslogtreecommitdiffstats
path: root/cron-sh/diff_check.sh
diff options
context:
space:
mode:
authorFrederic Lepied <flepied@mandriva.com>2002-02-25 21:12:19 +0000
committerFrederic Lepied <flepied@mandriva.com>2002-02-25 21:12:19 +0000
commita6bb12035abfa2dcb9e93e76241d587d97deb51e (patch)
tree789709cb1596140f2c85efc744977eaee84d7a3d /cron-sh/diff_check.sh
parent0433b2af4c5670867e19beff99bbbbb175eb1a1d (diff)
downloadmsec-a6bb12035abfa2dcb9e93e76241d587d97deb51e.tar
msec-a6bb12035abfa2dcb9e93e76241d587d97deb51e.tar.gz
msec-a6bb12035abfa2dcb9e93e76241d587d97deb51e.tar.bz2
msec-a6bb12035abfa2dcb9e93e76241d587d97deb51e.tar.xz
msec-a6bb12035abfa2dcb9e93e76241d587d97deb51e.zip
split rpm-va check in 2: config files and other files
Diffstat (limited to 'cron-sh/diff_check.sh')
-rwxr-xr-xcron-sh/diff_check.sh28
1 files changed, 20 insertions, 8 deletions
diff --git a/cron-sh/diff_check.sh b/cron-sh/diff_check.sh
index 1441c49..8e14c73 100755
--- a/cron-sh/diff_check.sh
+++ b/cron-sh/diff_check.sh
@@ -146,6 +146,18 @@ fi
### rpm database
if [[ ${RPM_CHECK} == yes ]]; then
+ if [[ -f ${RPM_QA_YESTERDAY} ]]; then
+ diff -u ${RPM_QA_YESTERDAY} ${RPM_QA_TODAY} > ${RPM_QA_DIFF}
+ if [ -s ${RPM_QA_DIFF} ]; then
+ printf "\nSecurity Warning: These packages have changed on the system :\n" >> ${TMP}
+ grep '^+' ${RPM_QA_DIFF} | grep -vw "^+++ " | sed 's|^.||' | while read file; do
+ printf "\t\t- added package : ${file}\n"
+ done >> ${TMP}
+ grep '^-' ${RPM_QA_DIFF} | grep -vw "^--- " | sed 's|^.||' | while read file; do
+ printf "\t\t- removed package : ${file}\n"
+ done >> ${TMP}
+ fi
+ fi
if [[ -f ${RPM_VA_YESTERDAY} ]]; then
diff -u ${RPM_VA_YESTERDAY} ${RPM_VA_TODAY} > ${RPM_VA_DIFF}
if [ -s ${RPM_VA_DIFF} ]; then
@@ -158,15 +170,15 @@ if [[ ${RPM_CHECK} == yes ]]; then
done >> ${TMP}
fi
fi
- if [[ -f ${RPM_QA_YESTERDAY} ]]; then
- diff -u ${RPM_QA_YESTERDAY} ${RPM_QA_TODAY} > ${RPM_QA_DIFF}
- if [ -s ${RPM_QA_DIFF} ]; then
- printf "\nSecurity Warning: These packages have changed on the system :\n" >> ${TMP}
- grep '^+' ${RPM_QA_DIFF} | grep -vw "^+++ " | sed 's|^.||' | while read file; do
- printf "\t\t- added package : ${file}\n"
+ if [[ -f ${RPM_VA_CONFIG_YESTERDAY} ]]; then
+ diff -u ${RPM_VA_CONFIG_YESTERDAY} ${RPM_VA_CONFIG_TODAY} > ${RPM_VA_CONFIG_DIFF}
+ if [ -s ${RPM_VA_CONFIG_DIFF} ]; then
+ printf "\nSecurity Warning: These config files belonging to packages have changed of status on the system :\n" >> ${TMP}
+ grep '^+' ${RPM_VA_CONFIG_DIFF} | grep -vw "^+++ " | sed 's|^.||' | while read file; do
+ printf "\t\t- newly modified : ${file}\n"
done >> ${TMP}
- grep '^-' ${RPM_QA_DIFF} | grep -vw "^--- " | sed 's|^.||' | while read file; do
- printf "\t\t- removed package : ${file}\n"
+ grep '^-' ${RPM_VA_CONFIG_DIFF} | grep -vw "^--- " | sed 's|^.||' | while read file; do
+ printf "\t\t- no more modified : ${file}\n"
done >> ${TMP}
fi
fi