mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-30 19:43:45 +01:00
Allow arbitrary $n variables when IGNOREUNKNOWNVARIABLES=Yes
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
83111a1126
commit
60e3f1015e
@ -2933,13 +2933,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