From 94c6b37e8e05b914c63c6c55e46ab53bdfd60273 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Sat, 1 May 2010 07:51:24 -0700 Subject: [PATCH] Avoid leaving an orphan '!' behind. Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Chains.pm | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Chains.pm b/Shorewall/Perl/Shorewall/Chains.pm index 42fe92521..dd55281ac 100644 --- a/Shorewall/Perl/Shorewall/Chains.pm +++ b/Shorewall/Perl/Shorewall/Chains.pm @@ -1565,11 +1565,11 @@ sub replace_references1( $$$ ) { # # Prevent multiple '-p', '-i', '-o', '-s' and '-d' matches # - s/ -p [^ ]+ / / if $hasp; - s/ -i [^ ]+ / / if $hasi; - s/ -o [^ ]+ / / if $haso; - s/ -s [^ ]+ / / if $hass; - s/ -d [^ ]+ / / if $hasd; + s/( !)? -p [^ ]+ / / if $hasp; + s/( !)? -i [^ ]+ / / if $hasi; + s/( !)? -o [^ ]+ / / if $haso; + s/( !)? -s [^ ]+ / / if $hass; + s/( !)? -d [^ ]+ / / if $hasd; s/\s+-([jg]) $name($|\s)/$matches -$1 ${target}$2/; add_reference ( $fromref, $tableref->{$target} ); $count++; @@ -1593,11 +1593,11 @@ sub replace_references1( $$$ ) { # # Prevent multiple '-p', '-i', '-o', '-s' and '-d' matches # - s/ -p [^ ]+ / / if $hasp; - s/ -i [^ ]+ / / if $hasi; - s/ -o [^ ]+ / / if $haso; - s/ -s [^ ]+ / / if $hass; - s/ -d [^ ]+ / / if $hasd; + s/( !)? -p [^ ]+ / / if $hasp; + s/( !)? -i [^ ]+ / / if $hasi; + s/( !)? -o [^ ]+ / / if $haso; + s/( !)? -s [^ ]+ / / if $hass; + s/( !)? -d [^ ]+ / / if $hasd; s/\s+-[jg] $name($|\s)/$matches -j ${target}$1/; $count++; trace( $fromref, 'R', $rule, $_ ) if $debug;