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