From 3f0e4959a1f310e44960fa53a5d08e12f656d153 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Wed, 1 Apr 2020 12:55:41 -0700 Subject: [PATCH] Revert "When exporting or testing, set all variables defined in the params file" This reverts commit f9003fab43f7b6d8c273ddb17c0ef5e525878a69. --- Shorewall/Perl/Shorewall/Compiler.pm | 2 +- Shorewall/Perl/Shorewall/Config.pm | 17 +++-------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Compiler.pm b/Shorewall/Perl/Shorewall/Compiler.pm index bf890a4ca..92a758d97 100644 --- a/Shorewall/Perl/Shorewall/Compiler.pm +++ b/Shorewall/Perl/Shorewall/Compiler.pm @@ -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); diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index a71b6cc5c..0a31fec89 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -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; }