forked from extern/shorewall_code
Make LOGMARK work without a parameter.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
8b56e16bf9
commit
f8be76f471
@ -574,6 +574,13 @@ sub initialize( $ ) {
|
|||||||
MASK_BITS => undef
|
MASK_BITS => undef
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Valid log levels
|
||||||
|
#
|
||||||
|
# Note that we don't include LOGMARK; that is so we can default its
|
||||||
|
# priority to 'info' (LOGMARK itself defaults to 'warn').
|
||||||
|
#
|
||||||
%validlevels = ( DEBUG => 7,
|
%validlevels = ( DEBUG => 7,
|
||||||
INFO => 6,
|
INFO => 6,
|
||||||
NOTICE => 5,
|
NOTICE => 5,
|
||||||
@ -587,7 +594,7 @@ sub initialize( $ ) {
|
|||||||
PANIC => 0,
|
PANIC => 0,
|
||||||
NONE => '',
|
NONE => '',
|
||||||
NFLOG => 'NFLOG',
|
NFLOG => 'NFLOG',
|
||||||
LOGMARK => 'LOGMARK' );
|
);
|
||||||
|
|
||||||
#
|
#
|
||||||
# From parsing the capabilities file or capabilities detection
|
# From parsing the capabilities file or capabilities detection
|
||||||
@ -2137,12 +2144,15 @@ sub validate_level( $ ) {
|
|||||||
return $rawlevel;
|
return $rawlevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $level =~ /LOGMARK[(](.*)[)]$/ ) {
|
if ( $level =~ /LOGMARK([(](.+)[)])?$/ ) {
|
||||||
my $sublevel = $1;
|
my $sublevel = $2;
|
||||||
|
|
||||||
|
if ( $1 ) {
|
||||||
$sublevel = $validlevels{$sublevel} unless $sublevel =~ /^[0-7]$/;
|
$sublevel = $validlevels{$sublevel} unless $sublevel =~ /^[0-7]$/;
|
||||||
|
|
||||||
level_error( $level ) unless defined $sublevel =~ /^[0-7]$/;
|
level_error( $level ) unless defined $sublevel =~ /^[0-7]$/;
|
||||||
|
} else {
|
||||||
|
$sublevel = 6; # info
|
||||||
|
}
|
||||||
|
|
||||||
require_capability ( 'LOG_TARGET' , 'A log level other than NONE', 's' );
|
require_capability ( 'LOG_TARGET' , 'A log level other than NONE', 's' );
|
||||||
require_capability( 'LOGMARK_TARGET' , 'LOGMARK', 's' );
|
require_capability( 'LOGMARK_TARGET' , 'LOGMARK', 's' );
|
||||||
|
@ -80,11 +80,12 @@
|
|||||||
|
|
||||||
<simplelist>
|
<simplelist>
|
||||||
<member><emphasis
|
<member><emphasis
|
||||||
role="bold">LOGMARK</emphasis><replaceable>(priority)</replaceable></member>
|
role="bold">LOGMARK[</emphasis><replaceable>(priority)</replaceable><emphasis
|
||||||
|
role="bold">]</emphasis></member>
|
||||||
</simplelist>
|
</simplelist>
|
||||||
|
|
||||||
<para>where <replaceable>priority</replaceable> is one of the levels
|
<para>where <replaceable>priority</replaceable> is one of the levels
|
||||||
listed in the list above.</para>
|
listed in the list above. If omitted, the default is info (6).</para>
|
||||||
|
|
||||||
<para>The following options may be set in shorewall.conf.</para>
|
<para>The following options may be set in shorewall.conf.</para>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user