Fix another SECTION bug; edit max connections and interval passed to Limit rule

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6318 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-05-10 16:13:16 +00:00
parent bbcd693cec
commit 28b807a03c
3 changed files with 12 additions and 1 deletions

View File

@ -592,6 +592,11 @@ sub process_actions3 () {
fatal_error 'Limit rules must include <set name>,<max connections>,<interval> as the log tag' unless @tag == 3; fatal_error 'Limit rules must include <set name>,<max connections>,<interval> as the log tag' unless @tag == 3;
my $set = $tag[0]; my $set = $tag[0];
for my $index ( 1..2 ) {
fatal_error "Max connections and interval in Limit rules must be numeric" unless $tag[$index] =~ /^\d+$/
}
my $count = $tag[1] + 1; my $count = $tag[1] + 1;
require_capability( 'RECENT_MATCH' , 'Limit rules' , '' ); require_capability( 'RECENT_MATCH' , 'Limit rules' , '' );

View File

@ -316,6 +316,9 @@ sub split_line( $$$ ) {
@line; @line;
} }
#
# Version of 'split_line' that handles COMMENT lines
#
sub split_line1( $$$ ) { sub split_line1( $$$ ) {
my ( $mincolumns, $maxcolumns, $description ) = @_; my ( $mincolumns, $maxcolumns, $description ) = @_;
@ -342,6 +345,9 @@ sub split_line1( $$$ ) {
my %no_pad = ( COMMENT => 0, my %no_pad = ( COMMENT => 0,
SECTION => 2 ); SECTION => 2 );
#
# Version of 'split_line' used on rules file entries
#
sub split_line2( $$$ ) { sub split_line2( $$$ ) {
my ( $mincolumns, $maxcolumns, $description ) = @_; my ( $mincolumns, $maxcolumns, $description ) = @_;

View File

@ -1127,7 +1127,7 @@ sub process_rule ( $$$$$$$$$$ ) {
# #
unless ( $sectioned ) { unless ( $sectioned ) {
finish_section 'ESTABLISHED,RELATED'; finish_section 'ESTABLISHED,RELATED';
$section = 'NEW'; $sections{$section = 'NEW'} = 1;
$sectioned = 1; $sectioned = 1;
} }