Revert "When exporting or testing, set all variables defined in the params file"

This reverts commit f9003fab43.
This commit is contained in:
Tom Eastep 2020-04-01 12:55:41 -07:00
parent 112c4dc38a
commit 3f0e4959a1
No known key found for this signature in database
GPG Key ID: 96E6B3F2423A4D10
2 changed files with 4 additions and 15 deletions

View File

@ -59,7 +59,7 @@ our $have_arptables; # True if we have arptables rules
# Initilize the package-globals in the other modules
#
sub initialize_package_globals( $$$ ) {
Shorewall::Config::initialize($family, $export, $test, $_[1], $_[2]);
Shorewall::Config::initialize($family, $export, $_[1], $_[2]);
Shorewall::Chains::initialize ($family, 1, $export );
Shorewall::Zones::initialize ($family, $_[0]);
Shorewall::Nat::initialize($family);

View File

@ -791,16 +791,8 @@ our %ipsets; # All required IPsets
#
our %filecache;
#
# When we ran
#
our $compiletime;
#
# The -t option was specified to the compile command
#
our $test;
sub process_shorewallrc($$);
sub add_variables( \% );
#
@ -813,8 +805,8 @@ sub add_variables( \% );
# 2. The compiler can run multiple times in the same process so it has to be
# able to re-initialize its dependent modules' state.
#
sub initialize($$;$$$) {
( $family, $export, $test, my ( $shorewallrc, $shorewallrc1 ) ) = @_;
sub initialize($;$$$) {
( $family, $export, my ( $shorewallrc, $shorewallrc1 ) ) = @_;
if ( $family == F_IPV4 ) {
( $product, $Product, $toolname, $toolNAME ) = qw( shorewall Shorewall iptables IPTABLES );
@ -6007,14 +5999,11 @@ sub export_params() {
} else {
$value =~ s/'"'"'/'/g;
}
#
# Don't export pairs from %ENV
#
if ( defined $ENV{$param} ) {
unless ( $export || $test ) {
next if $value eq $ENV{$param};
}
next if $value eq $ENV{$param};
} elsif ( exists $ENV{$param} ) {
next unless supplied $value;
}