diff --git a/Shorewall/Perl/Shorewall/Compiler.pm b/Shorewall/Perl/Shorewall/Compiler.pm index faa984d2d..06eac5b97 100644 --- a/Shorewall/Perl/Shorewall/Compiler.pm +++ b/Shorewall/Perl/Shorewall/Compiler.pm @@ -158,7 +158,7 @@ sub generate_script_2() { push_indent; - if ( $shorewallrc{TEMPDIR} ) { + if ( $shorewallrc1{TEMPDIR} ) { emit( '', qq(TMPDIR="$shorewallrc{TEMPDIR}") , q(export TMPDIR) ); @@ -168,14 +168,14 @@ sub generate_script_2() { emit( 'g_family=4' ); if ( $export ) { - emit ( qq(g_confdir=$shorewallrc{CONFDIR}/shorewall-lite), + emit ( qq(g_confdir=$shorewallrc1{CONFDIR}/shorewall-lite), 'g_product="Shorewall Lite"', 'g_program=shorewall-lite', 'g_basedir=/usr/share/shorewall-lite', - qq(CONFIG_PATH="$shorewallrc{CONFDIR}/shorewall-lite:$shorewallrc{SHAREDIR}/shorewall-lite") , + qq(CONFIG_PATH="$shorewallrc1{CONFDIR}/shorewall-lite:$shorewallrc1{SHAREDIR}/shorewall-lite") , ); } else { - emit ( qq(g_confdir=$shorewallrc{CONFDIR}/shorewall), + emit ( qq(g_confdir=$shorewallrc1{CONFDIR}/shorewall), 'g_product=Shorewall', 'g_program=shorewall', 'g_basedir=/usr/share/shorewall', @@ -186,14 +186,14 @@ sub generate_script_2() { emit( 'g_family=6' ); if ( $export ) { - emit ( qq(g_confdir=$shorewallrc{CONFDIR}/shorewall6-lite), + emit ( qq(g_confdir=$shorewallrc1{CONFDIR}/shorewall6-lite), 'g_product="Shorewall6 Lite"', 'g_program=shorewall6-lite', 'g_basedir=/usr/share/shorewall6', - qq(CONFIG_PATH="$shorewallrc{CONFDIR}/shorewall6-lite:$shorewallrc{SHAREDIR}/shorewall6-lite") , + qq(CONFIG_PATH="$shorewallrc1{CONFDIR}/shorewall6-lite:$shorewallrc{SHAREDIR}/shorewall6-lite") , ); } else { - emit ( qq(g_confdir=$shorewallrc{CONFDIR}/shorewall6), + emit ( qq(g_confdir=$shorewallrc1{CONFDIR}/shorewall6), 'g_product=Shorewall6', 'g_program=shorewall6', 'g_basedir=/usr/share/shorewall', @@ -206,15 +206,15 @@ sub generate_script_2() { if ( $family == F_IPV4 ) { if ( $export ) { - emit ( '[ -n "${VARDIR:=' . $shorewallrc{VARDIR} . '/shorewall-lite}" ]' ); + emit ( '[ -n "${VARDIR:=' . $shorewallrc1{VARDIR} . '/shorewall-lite}" ]' ); } else { - emit ( '[ -n "${VARDIR:=' . $shorewallrc{VARDIR} . '/shorewall}" ]' ); + emit ( '[ -n "${VARDIR:=' . $shorewallrc1{VARDIR} . '/shorewall}" ]' ); } } else { if ( $export ) { - emit ( '[ -n "${VARDIR:=' . $shorewallrc{VARDIR} . '/shorewall6-lite}" ]' ); + emit ( '[ -n "${VARDIR:=' . $shorewallrc1{VARDIR} . '/shorewall6-lite}" ]' ); } else { - emit ( '[ -n "${VARDIR:=' . $shorewallrc{VARDIR} . '/shorewall6}" ]' ); + emit ( '[ -n "${VARDIR:=' . $shorewallrc1{VARDIR} . '/shorewall6}" ]' ); } } diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index 61cf8c12b..c90eca040 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -144,6 +144,7 @@ our %EXPORT_TAGS = ( internal => [ qw( create_temp_script %globals %config_files %shorewallrc + %shorewallrc1 %helpers %helpers_map @@ -540,7 +541,7 @@ my $ifstack; # # From .shorewallrc # -our %shorewallrc; +our ( %shorewallrc, %shorewallrc1 ); # # read_a_line options # @@ -900,6 +901,11 @@ sub initialize( $;$$) { SHAREDIR => '/usr/share/', CONFDIR => '/etc/', ); + + %shorewallrc1 = ( + SHAREDIR => '/usr/share/', + CONFDIR => '/etc/', + ); %helpers_enabled = ( amanda => 1, @@ -968,7 +974,15 @@ sub initialize( $;$$) { # # If we are compiling for export, process the shorewallrc from the remote system # - process_shorewallrc( $shorewallrc1 ) if $shorewallrc1; + if ( $shorewallrc1 ) { + my %rc = %shorewallrc; + %shorewallrc = ( ); + process_shorewallrc( $shorewallrc1 ); + %shorewallrc1 = %shorewallrc; + %shorewallrc = %rc; + } else { + %shorewallrc1 = %shorewallrc; + } } my @abbr = qw( Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ); diff --git a/Shorewall/configfiles/stoppedrules b/Shorewall/configfiles/stoppedrules index 65dc3555b..929facdd8 100644 --- a/Shorewall/configfiles/stoppedrules +++ b/Shorewall/configfiles/stoppedrules @@ -9,7 +9,6 @@ # See http://shorewall.net/starting_and_stopping_shorewall.htm for additional # information. # -FORMAT 2 ############################################################################### #TARGET SOURCE DEST PROTO DEST SOURCE # PORT(S) PORT(S) diff --git a/Shorewall6/configfiles/stoppedrules b/Shorewall6/configfiles/stoppedrules index 501000d32..1a54da2d4 100644 --- a/Shorewall6/configfiles/stoppedrules +++ b/Shorewall6/configfiles/stoppedrules @@ -9,7 +9,6 @@ # See http://shorewall.net/starting_and_stopping_shorewall.htm for additional # information. # -FORMAT 2 ############################################################################### #TARGET SOURCE DEST PROTO DEST SOURCE # PORT(S) PORT(S)