From 28b807a03cc12aee0b828dfc1100ab4fe60ccbd7 Mon Sep 17 00:00:00 2001 From: teastep Date: Thu, 10 May 2007 16:13:16 +0000 Subject: [PATCH] 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 --- Shorewall-perl/Shorewall/Actions.pm | 5 +++++ Shorewall-perl/Shorewall/Config.pm | 6 ++++++ Shorewall-perl/Shorewall/Rules.pm | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Shorewall-perl/Shorewall/Actions.pm b/Shorewall-perl/Shorewall/Actions.pm index 2c938bfb2..c8c937809 100644 --- a/Shorewall-perl/Shorewall/Actions.pm +++ b/Shorewall-perl/Shorewall/Actions.pm @@ -592,6 +592,11 @@ sub process_actions3 () { fatal_error 'Limit rules must include ,, as the log tag' unless @tag == 3; 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; require_capability( 'RECENT_MATCH' , 'Limit rules' , '' ); diff --git a/Shorewall-perl/Shorewall/Config.pm b/Shorewall-perl/Shorewall/Config.pm index 876d5b8b0..79bb5fcb3 100644 --- a/Shorewall-perl/Shorewall/Config.pm +++ b/Shorewall-perl/Shorewall/Config.pm @@ -316,6 +316,9 @@ sub split_line( $$$ ) { @line; } +# +# Version of 'split_line' that handles COMMENT lines +# sub split_line1( $$$ ) { my ( $mincolumns, $maxcolumns, $description ) = @_; @@ -342,6 +345,9 @@ sub split_line1( $$$ ) { my %no_pad = ( COMMENT => 0, SECTION => 2 ); +# +# Version of 'split_line' used on rules file entries +# sub split_line2( $$$ ) { my ( $mincolumns, $maxcolumns, $description ) = @_; diff --git a/Shorewall-perl/Shorewall/Rules.pm b/Shorewall-perl/Shorewall/Rules.pm index 0b302f97f..cc978eba6 100644 --- a/Shorewall-perl/Shorewall/Rules.pm +++ b/Shorewall-perl/Shorewall/Rules.pm @@ -1127,7 +1127,7 @@ sub process_rule ( $$$$$$$$$$ ) { # unless ( $sectioned ) { finish_section 'ESTABLISHED,RELATED'; - $section = 'NEW'; + $sections{$section = 'NEW'} = 1; $sectioned = 1; }