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++; #