From f68bfde86fb224e0959a54e175b4b186c1563d17 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Wed, 1 Dec 2010 13:57:16 -0800 Subject: [PATCH] Continue to fine-tune params processing --- Shorewall/Perl/Shorewall/Config.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index 2f3861b77..e10e7dc99 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -2902,12 +2902,15 @@ sub get_params() { my $variable; if ( $params[0] =~ /^declare/ ) { + # + # getparams was interpreted by bash + # for ( @params ) { if ( /^declare -x (.*?)="(.*[^\\])"$/ ) { $params{$1} = $2 unless $1 eq '_'; } elsif ( /^declare -x (.*?)="(.*)$/ ) { $params{$variable=$1}="${2}\n"; - } elsif ( /^declare -x (.*)\s+$/ || /^declare -x (.*)=""/ ) { + } elsif ( /^declare -x (.*)\s+$/ || /^declare -x (.*)=""$/ ) { $params{$1} = ''; } else { assert($variable); @@ -2916,8 +2919,13 @@ sub get_params() { } } } else { + # + # getparams was interpreted by dash/ash/busybox + # for ( @params ) { - if ( /^export (.*?)='(.*)'$/ ) { + if ( /^export (.*?)='(.*'"'"')$/ ) { + $params{$variable=$1}="${2}\n"; + } elsif ( /^export (.*?)='(.*)'$/ ) { $params{$1} = $2 unless $1 eq '_'; } elsif ( /^export (.*?)='(.*)$/ ) { $params{$variable=$1}="${2}\n";