From 6e6da400393c16937949fd3cf76db5e411263dca Mon Sep 17 00:00:00 2001 From: teastep Date: Sat, 24 Nov 2007 02:28:18 +0000 Subject: [PATCH] Apply missing config file fix to trunk git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@7739 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/Shorewall/Accounting.pm | 2 +- Shorewall-perl/Shorewall/Nat.pm | 6 +++--- Shorewall-perl/Shorewall/Rules.pm | 14 +++++++++----- Shorewall-perl/Shorewall/Tunnels.pm | 2 +- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Shorewall-perl/Shorewall/Accounting.pm b/Shorewall-perl/Shorewall/Accounting.pm index 4b4b8cf6b..7dc95d8a3 100644 --- a/Shorewall-perl/Shorewall/Accounting.pm +++ b/Shorewall-perl/Shorewall/Accounting.pm @@ -176,7 +176,7 @@ sub setup_accounting() { my $fn = open_file 'accounting'; - first_entry "$doing $fn..."; + first_entry "$doing $fn..." if $fn; while ( read_a_line ) { diff --git a/Shorewall-perl/Shorewall/Nat.pm b/Shorewall-perl/Shorewall/Nat.pm index c0cfa1f5e..eae672343 100644 --- a/Shorewall-perl/Shorewall/Nat.pm +++ b/Shorewall-perl/Shorewall/Nat.pm @@ -307,7 +307,7 @@ sub setup_masq() { my $fn = open_file 'masq'; - first_entry( sub { progress_message2 "$doing $fn..."; require_capability 'NAT_ENABLED' , 'a non-empty masq file' , 's'; } ); + first_entry( sub { progress_message2 "$doing $fn..."; require_capability 'NAT_ENABLED' , 'a non-empty masq file' , 's'; } ) if $fn; while ( read_a_line ) { @@ -412,7 +412,7 @@ sub setup_nat() { my $fn = open_file 'nat'; - first_entry( sub { progress_message2 "$doing $fn..."; require_capability 'NAT_ENABLED' , 'a non-empty nat file' , 's'; } ); + first_entry( sub { progress_message2 "$doing $fn..."; require_capability 'NAT_ENABLED' , 'a non-empty nat file' , 's'; } ) if $fn; while ( read_a_line ) { @@ -436,7 +436,7 @@ sub setup_netmap() { my $fn = open_file 'netmap'; - first_entry( sub { progress_message2 "$doing $fn..."; require_capability 'NAT_ENABLED' , 'a non-empty netmap file' , 's'; } ); + first_entry( sub { progress_message2 "$doing $fn..."; require_capability 'NAT_ENABLED' , 'a non-empty netmap file' , 's'; } ) if $fn; while ( read_a_line ) { diff --git a/Shorewall-perl/Shorewall/Rules.pm b/Shorewall-perl/Shorewall/Rules.pm index da818d70f..f58a66bc7 100644 --- a/Shorewall-perl/Shorewall/Rules.pm +++ b/Shorewall-perl/Shorewall/Rules.pm @@ -221,7 +221,7 @@ sub setup_rfc1918_filteration( $ ) { my $fn = open_file 'rfc1918'; - first_entry "$doing $fn..."; + first_entry "$doing $fn..." if $fn; while ( read_a_line ) { @@ -341,7 +341,7 @@ sub process_criticalhosts() { my $fn = open_file 'routestopped'; - first_entry "$doing $fn for critical hosts..."; + first_entry "$doing $fn for critical hosts..." if $fn; while ( read_a_line ) { @@ -382,7 +382,7 @@ sub process_routestopped() { my $fn = open_file 'routestopped'; - first_entry "$doing $fn..."; + first_entry "$doing $fn..." if $fn; while ( read_a_line ) { @@ -702,7 +702,7 @@ sub setup_mac_lists( $ ) { my $fn = open_file 'maclist'; - first_entry "$doing $fn..."; + first_entry "$doing $fn..." if $fn; while ( read_a_line ) { @@ -899,6 +899,10 @@ sub process_rule1 ( $$$$$$$$$$$ ) { my $actionchainref; my $optimize = $wildcard ? ( $basictarget =~ /!$/ ? 0 : $config{OPTIMIZE} ) : 0; + unless ( defined $param ) { + ( $basictarget, $param ) = ( $1, $2 ) if $action =~ /^(\w+)[(](.*)[)]$/; + } + $param = '' unless defined $param; # @@ -1345,7 +1349,7 @@ sub process_rules() { my $fn = open_file 'rules'; - first_entry "$doing $fn..."; + first_entry "$doing $fn..." if $fn; while ( read_a_line ) { diff --git a/Shorewall-perl/Shorewall/Tunnels.pm b/Shorewall-perl/Shorewall/Tunnels.pm index 0ca265741..7d736a4de 100644 --- a/Shorewall-perl/Shorewall/Tunnels.pm +++ b/Shorewall-perl/Shorewall/Tunnels.pm @@ -270,7 +270,7 @@ sub setup_tunnels() { # my $fn = open_file 'tunnels'; - first_entry "$doing $fn..."; + first_entry "$doing $fn..." if $fn; while ( read_a_line ) {