Levi Ramsey <[EMAIL PROTECTED]> writes:
> Since installing 8.2 beta 2 (I never installed beta 1), I have been
> annoyed at having to rewrite my /etc/syslog.conf file daily, so I hacked
> this patch together.
>
> It enables a standard rule to be defined for the tty12 syslog.
>
> I have tested it only against msec-0.18-3mdk, but I can't find anything
> in the changelogs to indicate that it will break in later versions...
>
> P.S., this is the first patch I've submitted anywhere... don't be too
> hard on me if it sucks ass...
The patch is ok but I don't want to change the default. So I have done the
following to allow you to change the default in /etc/security/msec/level.local.
diff -u -u -r1.8 libmsec.py
--- libmsec.py 2002/02/14 01:50:08 1.8
+++ libmsec.py 2002/02/15 04:57:56
@@ -351,16 +351,17 @@
menulst = ConfigFile.get_config_file(MENULST)
menulst.exists() and menulst.remove_line_matching('^password\s')
-def enable_console_log(arg):
- ''' Enable/Disable syslog reports to console 12.'''
+def enable_console_log(arg, expr='*.*'):
+ ''' Enable/Disable syslog reports to console 12. \\fIexpr\\fP is the
+expression describing what to log (see syslog.conf(5) for more details).'''
syslogconf = ConfigFile.get_config_file(SYSLOGCONF)
if arg:
_interactive and log(_('Enabling log on console 12'))
- syslogconf.exists() and
syslogconf.replace_line_matching('\s*[^#]+/dev/tty12', '*.* /dev/tty12', 1)
+ syslogconf.exists() and
+syslogconf.replace_line_matching('\s*[^#]+/dev/tty12', expr + ' /dev/tty12', 1)
else:
_interactive and log(_('Disabling log on console 12'))
- syslogconf.exists() and syslogconf.remove_line_matching('\*\.\*\s*/dev/tty12')
+ syslogconf.exists() and syslogconf.remove_line_matching('\s*[^#]+/dev/tty12')
def enable_promisc_check(arg):
''' Activate/Disable ethernet cards promiscuity check.'''
--
Fred - May the source be with you