From 14a243fa20538da99c732cc20b082e6a3e205d69 Mon Sep 17 00:00:00 2001 From: teastep Date: Thu, 3 May 2007 14:00:08 +0000 Subject: [PATCH] Fix bad ruleset caused by empty action git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6207 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/Shorewall/Actions.pm | 2 ++ Shorewall-perl/Shorewall/Chains.pm | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/Shorewall-perl/Shorewall/Actions.pm b/Shorewall-perl/Shorewall/Actions.pm index df50d8f71..306138508 100644 --- a/Shorewall-perl/Shorewall/Actions.pm +++ b/Shorewall-perl/Shorewall/Actions.pm @@ -384,6 +384,8 @@ sub process_action3( $$$$$ ) { my $actionfile = find_file "action.$action"; my $standard = ( $actionfile =~ /^$globals{SHAREDIR}/ ); + mark_referenced $chainref; # Just in case the action body is empty. + fatal_error "Missing Action File: $actionfile" unless -f $actionfile; progress_message2 "Processing $actionfile for chain $chainref->{name}..."; diff --git a/Shorewall-perl/Shorewall/Chains.pm b/Shorewall-perl/Shorewall/Chains.pm index 7cfe815f7..c4870b8d4 100644 --- a/Shorewall-perl/Shorewall/Chains.pm +++ b/Shorewall-perl/Shorewall/Chains.pm @@ -55,6 +55,7 @@ our @EXPORT = qw( STANDARD pop_cmd_mode add_command add_commands + mark_referenced add_file add_rule insert_rule @@ -283,6 +284,11 @@ sub add_commands { $chainref->{referenced} = 1; } +sub mark_referenced( $ ) { + my $chainref = shift @_; + + $chainref->{referenced} = 1; +} # # Copy a file into a chain's rules as a set of run-time commands