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 <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2016-12-12 16:31:46 -08:00
parent 612eee64d1
commit 095c9212f4
No known key found for this signature in database
GPG Key ID: 96E6B3F2423A4D10

View File

@ -2059,17 +2059,17 @@ sub process_action(\$\$$) {
for my $proto (split_list( $protos, 'Protocol' ) ) { for my $proto (split_list( $protos, 'Protocol' ) ) {
process_snat1( $chainref, process_snat1( $chainref,
$action, $action,
$source, $source,
$dest, $dest,
$proto, $proto,
$port, $port,
$ipsec, $ipsec,
$mark, $mark,
$user, $user,
$condition, $condition,
$origdest, $origdest,
$probability, $probability,
); );
} }
} }
@ -2082,6 +2082,12 @@ sub process_action(\$\$$) {
pop_open; 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 # Pop the action parameters
# #