diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index 62ec964c2..e4d48eff2 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -2932,13 +2932,14 @@ sub expand_variables( \$ ) { if ( $var =~ /^\d+$/ ) { fatal_error "Action parameters (\$$var) may only be referenced within the body of an action" unless $chain; - unless ( $config{IGNOREUNKNOWNVARIABLES} ) { + if ( $config{IGNOREUNKNOWNVARIABLES} ) { + fatal_error "Invalid action parameter (\$$var)" if ( length( $var ) > 1 && $var =~ /^0/ ); + } else { fatal_error "Undefined parameter (\$$var)" unless ( defined $actparms{$var} && ( length( $var ) == 1 || $var !~ /^0/ ) ); } - fatal_error "Invalid action parameter (\$$var)" if ( ! defined $actparms{$var} ) || ( length( $var ) > 1 && $var =~ /^0/ ); $val = $var ? $actparms{$var} : $actparms{0}->{name}; } elsif ( exists $variables{$var} ) { $val = $variables{$var};