aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEugeni Dodonov <eugeni@mandriva.org>2010-02-09 20:29:44 +0000
committerEugeni Dodonov <eugeni@mandriva.org>2010-02-09 20:29:44 +0000
commite7735b7daae5dec9b6935c9ea47d232498ab16fd (patch)
treeeaaffe412f9fbd76f6035202217b523e9ce3a397 /src
parent2f47a59934a28e07bb875d78aa95c666c8e53170 (diff)
downloadmsec-e7735b7daae5dec9b6935c9ea47d232498ab16fd.tar
msec-e7735b7daae5dec9b6935c9ea47d232498ab16fd.tar.gz
msec-e7735b7daae5dec9b6935c9ea47d232498ab16fd.tar.bz2
msec-e7735b7daae5dec9b6935c9ea47d232498ab16fd.tar.xz
msec-e7735b7daae5dec9b6935c9ea47d232498ab16fd.zip
Properly create symlinks for periodic checks
Diffstat (limited to 'src')
-rw-r--r--src/msec/plugins/audit.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/msec/plugins/audit.py b/src/msec/plugins/audit.py
index 68d3a63..6586d03 100644
--- a/src/msec/plugins/audit.py
+++ b/src/msec/plugins/audit.py
@@ -17,7 +17,7 @@ except IOError:
CRON = '/etc/cron.d/msec'
CRON_REGEX = '[^#]+/usr/share/msec/promisc_check.sh'
CRON_ENTRY = '*/1 * * * * root /usr/share/msec/promisc_check.sh'
-SECURITYCRON = '/etc/cron.daily/msec'
+SECURITYCRON = ['/etc/cron.daily/msec', '/etc/cron.weekly/msec', '/etc/cron.monthly/msec']
SECURITYSH = '/usr/share/msec/security.sh'
class audit:
@@ -206,14 +206,16 @@ class audit:
cron = self.configfiles.get_config_file(CRON)
cron.remove_line_matching('[^#]+/usr/share/msec/security.sh')
- securitycron = self.configfiles.get_config_file(SECURITYCRON)
-
if arg == "yes":
- if not securitycron.exists():
- self.log.info(_('Activating daily security check'))
- securitycron.symlink(SECURITYSH)
+ for securitycron in SECURITYCRON:
+ securitycron = self.configfiles.get_config_file(SECURITYCRON)
+
+ if not securitycron.exists():
+ self.log.info(_('Activating daily security check'))
+ securitycron.symlink(SECURITYSH)
else:
- if securitycron.exists():
- self.log.info(_('Disabling daily security check'))
- securitycron.unlink()
+ for securitycron in SECURITYCRON:
+ if securitycron.exists():
+ self.log.info(_('Disabling daily security check'))
+ securitycron.unlink()