mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-25 07:38:57 +01:00
Allow arbitrary $n variables when IGNOREUNKNOWNVARIABLES=Yes
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
cadf2747fe
commit
f9dc89dc61
@ -2932,13 +2932,14 @@ sub expand_variables( \$ ) {
|
|||||||
if ( $var =~ /^\d+$/ ) {
|
if ( $var =~ /^\d+$/ ) {
|
||||||
fatal_error "Action parameters (\$$var) may only be referenced within the body of an action" unless $chain;
|
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} &&
|
fatal_error "Undefined parameter (\$$var)" unless ( defined $actparms{$var} &&
|
||||||
( length( $var ) == 1 ||
|
( length( $var ) == 1 ||
|
||||||
$var !~ /^0/ ) );
|
$var !~ /^0/ ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
fatal_error "Invalid action parameter (\$$var)" if ( ! defined $actparms{$var} ) || ( length( $var ) > 1 && $var =~ /^0/ );
|
|
||||||
$val = $var ? $actparms{$var} : $actparms{0}->{name};
|
$val = $var ? $actparms{$var} : $actparms{0}->{name};
|
||||||
} elsif ( exists $variables{$var} ) {
|
} elsif ( exists $variables{$var} ) {
|
||||||
$val = $variables{$var};
|
$val = $variables{$var};
|
||||||
|
Loading…
Reference in New Issue
Block a user