forked from extern/shorewall_code
More tweaks to params processing and exporting
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
7d98721169
commit
376999970b
@ -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++;
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user