From 376999970bccdf7cb941af656bc853ee6bb74fd8 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Wed, 28 Oct 2015 14:33:55 -0700 Subject: [PATCH] More tweaks to params processing and exporting Signed-off-by: Tom Eastep --- 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 877f2d61f..c7700fb98 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -5287,12 +5287,16 @@ sub get_params( $ ) { for ( keys %params ) { if ( /[^\w]/ ) { - delete $params{$_} + delete $params{$_}; + } elsif ( /^(?:SHLVL|OLDPWD)$/ ) { + delete $params{$_}; } else { unless ( $_ eq 'SHOREWALL_INIT_SCRIPT' ) { fatal_error "The variable name $_ is reserved and may not be set in the params file" if /^SW_/ || /^SHOREWALL_/ || ( exists $config{$_} && ! exists $ENV{$_} ) || exists $reserved{$_}; } + + $params{$_} = '' unless defined $params{$_}; } } @@ -5362,7 +5366,11 @@ sub export_params() { # # Don't export pairs from %ENV # - next if defined $ENV{$param} && $value eq $ENV{$param}; + if ( defined $ENV{$param} ) { + next if $value eq $ENV{$param}; + } elsif ( exists $ENV{$param} ) { + next unless supplied $value; + } emit "#\n# From the params file\n#" unless $count++; #