From 095c9212f4d1e21ab83cee37bb8e11f3e54f57fc Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Mon, 12 Dec 2016 16:31:46 -0800 Subject: [PATCH] Fatal error for empty action file - Issue error if a file with the name of the action exists on the CONFIG_PATH Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Rules.pm | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Rules.pm b/Shorewall/Perl/Shorewall/Rules.pm index 9c1179363..0f8aa5daa 100644 --- a/Shorewall/Perl/Shorewall/Rules.pm +++ b/Shorewall/Perl/Shorewall/Rules.pm @@ -2059,17 +2059,17 @@ sub process_action(\$\$$) { for my $proto (split_list( $protos, 'Protocol' ) ) { process_snat1( $chainref, - $action, - $source, - $dest, - $proto, - $port, - $ipsec, - $mark, - $user, - $condition, - $origdest, - $probability, + $action, + $source, + $dest, + $proto, + $port, + $ipsec, + $mark, + $user, + $condition, + $origdest, + $probability, ); } } @@ -2082,6 +2082,12 @@ sub process_action(\$\$$) { pop_open; + unless ( @{$chainref->{rules}} ) { + my $file = find_file( $action ); + + fatal_error "File action.${action} is empty and file $action exists - the two must be combined as described in the Migration Considerations section of the Shorewall release notes" if -f $file; + } + # # Pop the action parameters #