diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index 0d7e198d4..39dcf0733 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -5925,7 +5925,7 @@ sub get_params( $ ) { # delete $params{$_}; } else { - unless ( $_ eq 'SHOREWALL_INIT_SCRIPT' || $_ eq 'SW_LOGGERTAG' ) { + unless ( $_ eq 'SHOREWALL_INIT_SCRIPT' || $_ eq 'SW_LOGGERTAG' || $_ eq 'SW_CONFDIR' ) { 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{$_}; } diff --git a/Shorewall/lib.cli-std b/Shorewall/lib.cli-std index 3f27b45cd..df8ee8185 100644 --- a/Shorewall/lib.cli-std +++ b/Shorewall/lib.cli-std @@ -456,6 +456,16 @@ compiler() { ensure_root # + # Let params and the compiler know the base configuration directory + # + if [ -n "$g_shorewalldir" ]; then + SW_CONFDIR="$g_shorewalldir" + else + SW_CONFDIR="$g_confdir" + fi + + export SW_CONFDIR + # # We've now set g_shorewalldir so recalculate CONFIG_PATH # [ -n "$g_haveconfig" ] || ensure_config_path