From 5e8fd570d1c8f3c8eb5cd23334267dc2aa895483 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Tue, 7 Aug 2018 07:42:34 -0700 Subject: [PATCH] Prepare for Perl 5.32 - Escape '{' in REs Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Chains.pm | 2 +- Shorewall/Perl/Shorewall/Config.pm | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Chains.pm b/Shorewall/Perl/Shorewall/Chains.pm index 9289ff46d..3b72a621c 100644 --- a/Shorewall/Perl/Shorewall/Chains.pm +++ b/Shorewall/Perl/Shorewall/Chains.pm @@ -5819,7 +5819,7 @@ sub do_condition( $$ ) { $chain =~ s/[^\w-]//g; # $1 $2 - $3 - while ( $condition =~ m( ^(.*?) @({)?(?:0|chain)(?(2)}) (.*)$ )x ) { + while ( $condition =~ m( ^(.*?) @(\{)?(?:0|chain)(?(2)}) (.*)$ )x ) { $condition = join( '', $1, $chain, $3 ); } diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index 38977b2fd..a0b6d4807 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -2833,7 +2833,7 @@ sub evaluate_expression( $$$$ ) { } # $1 $2 $3 - $4 - while ( $expression =~ m( ^(.*?) \$({)? (\d+|[a-zA-Z_]\w*) (?(2)}) (.*)$ )x ) { + while ( $expression =~ m( ^(.*?) \$(\{)? (\d+|[a-zA-Z_]\w*) (?(2)}) (.*)$ )x ) { my ( $first, $var, $rest ) = ( $1, $3, $4); if ( $var =~ /^\d+$/ ) { @@ -2850,7 +2850,7 @@ sub evaluate_expression( $$$$ ) { if ( $chain ) { # $1 $2 $3 - $4 - while ( $expression =~ m( ^(.*?) \@({)? (\d+|[a-zA-Z]\w*) (?(2)}) (.*)$ )x ) { + while ( $expression =~ m( ^(.*?) \@(\{)? (\d+|[a-zA-Z]\w*) (?(2)}) (.*)$ )x ) { my ( $first, $var, $rest ) = ( $1, $3, $4); $var = numeric_value( $var ) if $var =~ /^\d/; $val = $var ? $actparams{$var} : $chain; @@ -2861,7 +2861,7 @@ sub evaluate_expression( $$$$ ) { } # $1 $2 $3 - $4 - while ( $expression =~ m( ^(.*?) __({)? (\w+) (?(2)}) (.*)$ )x ) { + while ( $expression =~ m( ^(.*?) __(\{)? (\w+) (?(2)}) (.*)$ )x ) { my ( $first, $cap, $rest ) = ( $1, $3, $4); if ( exists $capdesc{$cap} ) { @@ -3791,7 +3791,7 @@ sub expand_variables( \$ ) { my ( $lineref, $count ) = ( $_[0], 0 ); my $chain = $actparams{chain}; # $1 $2 $3 - $4 - while ( $$lineref =~ m( ^(.*?) \$({)? (\d+|[a-zA-Z_]\w*) (?(2)}) (.*)$ )x ) { + while ( $$lineref =~ m( ^(.*?) \$(\{)? (\d+|[a-zA-Z_]\w*) (?(2)}) (.*)$ )x ) { my ( $first, $var, $rest ) = ( $1, $3, $4); @@ -3830,7 +3830,7 @@ sub expand_variables( \$ ) { # $$lineref =~ s/\\@/??/g; # $1 $2 $3 - $4 - while ( $$lineref =~ m( ^(.*?) \@({)? (\d+|[a-zA-Z_]\w*) (?(2)}) (.*)$ )x ) { + while ( $$lineref =~ m( ^(.*?) \@(\{)? (\d+|[a-zA-Z_]\w*) (?(2)}) (.*)$ )x ) { my ( $first, $var, $rest ) = ( $1, $3, $4); my $val = $var ? $actparams{$var} : $actparams{chain}; $usedcaller = USEDCALLER if $var eq 'caller'; @@ -3846,7 +3846,7 @@ sub expand_variables( \$ ) { sub expand_shorewallrc_variables( \$ ) { my ( $lineref, $count ) = ( $_[0], 0 ); # $1 $2 $3 - $4 - while ( $$lineref =~ m( ^(.*?) \$({)? (\d+|[a-zA-Z]\w*) (?(2)}) (.*)$ )x ) { + while ( $$lineref =~ m( ^(.*?) \$(\{)? (\d+|[a-zA-Z]\w*) (?(2)}) (.*)$ )x ) { my ( $first, $var, $rest ) = ( $1, $3, $4);