diff --git a/Shorewall-core/configure b/Shorewall-core/configure index 8218398eb..b36045b9b 100755 --- a/Shorewall-core/configure +++ b/Shorewall-core/configure @@ -113,7 +113,7 @@ for on in \ AUXINITSOURCE \ AUXINITFILE \ SYSTEMD \ - SYSCONFILE \ + SYSCONFFILE \ SYSCONFDIR \ ANNOTATED \ VARDIR @@ -122,6 +122,3 @@ do done cat shorewallrc - - - diff --git a/Shorewall-core/install.sh b/Shorewall-core/install.sh index 96dae998b..bc30dc14f 100755 --- a/Shorewall-core/install.sh +++ b/Shorewall-core/install.sh @@ -139,8 +139,8 @@ done if [ $# -eq 0 ]; then if [ -f ./shorewallrc ]; then . ./shorewallrc - file=~/.shorewallrc - elif [ -f ./.shorewallrc ]; then + file=./shorewallrc + elif [ -f ~/.shorewallrc ]; then . ~/.shorewallrc || exit 1 file=~/.shorewallrc elif [ -f /usr/share/shorewall/shorewallrc ]; then @@ -343,9 +343,9 @@ chmod 644 ${DESTDIR}${SHAREDIR}/shorewall/coreversion if [ ${SHAREDIR} != /usr/share ]; then for f in lib.*; do if [ $BUILD != apple ]; then - eval sed -i \'s\|/usr/share/|${SHAREDIR}/|\' ${DESTDIR}/${SHAREDIR}/$f + eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}/${SHAREDIR}/shorewall/$f else - eval sed -i \'\' -e \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}/$f + eval sed -i \'\' -e \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}/${SHAREDIR}/shorewall/$f fi done fi diff --git a/Shorewall-core/lib.base b/Shorewall-core/lib.base index 14e8ad826..b82e02eb4 100644 --- a/Shorewall-core/lib.base +++ b/Shorewall-core/lib.base @@ -42,6 +42,7 @@ if [ -z "$g_readrc" ]; then g_sharedir="$SHAREDIR" g_sbindir="$SBINDIR" g_vardir="$VARDIR" + g_confdir="$CONFDIR" g_readrc=1 fi diff --git a/Shorewall-core/lib.cli b/Shorewall-core/lib.cli index 6f8dc4769..26db60f38 100644 --- a/Shorewall-core/lib.cli +++ b/Shorewall-core/lib.cli @@ -33,11 +33,13 @@ if [ -z "$g_readrc" ]; then g_libexec="$LIBEXECDIR" g_sharedir="$SHAREDIR" g_sbindir="$SBINDIR" + g_confdir="$CONFDIR" g_readrc=1 fi . ${g_sharedir}/shorewall/lib.base + # # Fatal Error # diff --git a/Shorewall-init/install.sh b/Shorewall-init/install.sh index f0e7f781f..1b12f0a2f 100755 --- a/Shorewall-init/install.sh +++ b/Shorewall-init/install.sh @@ -265,7 +265,7 @@ fi # if [ -n "$INITFILE" ]; then install_file $INITSOURCE ${DESTDIR}${INITDIR}/$INITFILE 0544 - [ "${SHAREDIR}" = /usr/share ] || eval sed -i \'s\|/usr/share/|${SHAREDIR}/|\' ${DESTDIR}${INITDIR}/$INITFILE + [ "${SHAREDIR}" = /usr/share ] || eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}${INITDIR}/$INITFILE if [ -n "${AUXINITSOURCE}" ]; then install_file $INITSOURCE ${DESTDIR}${INITDIR}/$AUXINITFILE 0544 @@ -347,7 +347,7 @@ fi cp ifupdown.sh ifupdown -d[ "${SHAREDIR}" = /usr/share ] || eval sed -i \'s\|/usr/share/|${SHAREDIR}/|\' ifupdown +d[ "${SHAREDIR}" = /usr/share ] || eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ifupdown mkdir -p ${DESTDIR}${LIBEXECDIR}/shorewall-init diff --git a/Shorewall-lite/install.sh b/Shorewall-lite/install.sh index be2dd406f..e71c0f921 100755 --- a/Shorewall-lite/install.sh +++ b/Shorewall-lite/install.sh @@ -360,7 +360,7 @@ if [ -n "$INITFILE" ]; then ;; esac - [ "${SHAREDIR}" = /usr/share ] || eval sed -i \'s\|/usr/share/|${SHAREDIR}/|\' "$initfile" + [ "${SHAREDIR}" = /usr/share ] || eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' "$initfile" echo "$Product init script installed in $initfile" fi @@ -498,8 +498,8 @@ if [ -n "$SYSCONFFILE" -a ! -f ${DESTDIR}${SYSCONFDIR}/${PRODUCT} ]; then fi if [ ${SHAREDIR} != /usr/share ]; then - eval sed -i \'s\|/usr/share/|${SHAREDIR}/|\' ${DESTDIR}/${SHAREDIR}/${PRODUCT}/lib.base - eval sed -i \'s\|/usr/share/|${SHAREDIR}/|\' ${DESTDIR}/${SBINDIR}/$PRODUCT + eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}/${SHAREDIR}/${PRODUCT}/lib.base + eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}/${SBINDIR}/$PRODUCT fi if [ -z "$DESTDIR" -a -n "$first_install" -a -z "${cygwin}${mac}" ]; then diff --git a/Shorewall/Perl/Shorewall/Compiler.pm b/Shorewall/Perl/Shorewall/Compiler.pm index b94b707eb..c52e65a04 100644 --- a/Shorewall/Perl/Shorewall/Compiler.pm +++ b/Shorewall/Perl/Shorewall/Compiler.pm @@ -54,10 +54,10 @@ my $family; # # Initilize the package-globals in the other modules # -sub initialize_package_globals( $ ) { - Shorewall::Config::initialize($family); +sub initialize_package_globals( $$ ) { + Shorewall::Config::initialize($family, $_[1]); Shorewall::Chains::initialize ($family, 1, $export ); - Shorewall::Zones::initialize ($family, shift); + Shorewall::Zones::initialize ($family, $_[0]); Shorewall::Nat::initialize; Shorewall::Providers::initialize($family); Shorewall::Tc::initialize($family); @@ -545,8 +545,8 @@ EOF # sub compiler { - my ( $scriptfilename, $directory, $verbosity, $timestamp , $debug, $chains , $log , $log_verbosity, $preview, $confess , $update , $annotate , $convert, $config_path ) = - ( '', '', -1, '', 0, '', '', -1, 0, 0, 0, 0, , 0 , ''); + my ( $scriptfilename, $directory, $verbosity, $timestamp , $debug, $chains , $log , $log_verbosity, $preview, $confess , $update , $annotate , $convert, $config_path, $shorewallrc ) = + ( '', '', -1, '', 0, '', '', -1, 0, 0, 0, 0, , 0 , '' , ''); $export = 0; $test = 0; @@ -584,6 +584,7 @@ sub compiler { convert => { store => \$convert, validate=> \&validate_boolean } , annotate => { store => \$annotate, validate=> \&validate_boolean } , config_path => { store => \$config_path } , + shorewallrc => { store => \$shorewallrc } , ); # # P A R A M E T E R P R O C E S S I N G @@ -601,7 +602,7 @@ sub compiler { # # Now that we know the address family (IPv4/IPv6), we can initialize the other modules' globals # - initialize_package_globals( $update ); + initialize_package_globals( $update, $shorewallrc ); set_config_path( $config_path ) if $config_path; diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index 23e59f6b3..d90758e13 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -439,7 +439,7 @@ my $ifstack; # our %shorewallrc; -sub process_shorewallrc(); +sub process_shorewallrc($); # # Rather than initializing globals in an INIT block or during declaration, # we initialize them in a function. This is done for two reasons: @@ -450,8 +450,8 @@ sub process_shorewallrc(); # 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 = shift; +sub initialize( $;$ ) { + ( $family, my $shorewallrc ) = @_; if ( $family == F_IPV4 ) { ( $product, $Product, $toolname, $toolNAME ) = qw( shorewall Shorewall iptables IPTABLES ); @@ -759,21 +759,23 @@ sub initialize( $ ) { CONFDIR => '/etc/', ); - process_shorewallrc; + if ( $shorewallrc ) { + process_shorewallrc( $shorewallrc ); - $globals{SHAREDIRPL} = "$shorewallrc{SHAREDIR}/shorewall/"; + $globals{SHAREDIRPL} = "$shorewallrc{SHAREDIR}/shorewall/"; - if ( $family == F_IPV4 ) { - $globals{SHAREDIR} = "$shorewallrc{SHAREDIR}/shorewall"; - $globals{CONFDIR} = "$shorewallrc{CONFDIR}/shorewall"; - $globals{PRODUCT} = 'shorewall'; - $config{IPTABLES} = undef; - $validlevels{ULOG} = 'ULOG'; - } else { - $globals{SHAREDIR} = "$shorewallrc{SHAREDIR}/shorewall6"; - $globals{CONFDIR} = "$shorewallrc{CONFDIR}/shorewall6"; - $globals{PRODUCT} = 'shorewall6'; - $config{IP6TABLES} = undef; + if ( $family == F_IPV4 ) { + $globals{SHAREDIR} = "$shorewallrc{SHAREDIR}/shorewall"; + $globals{CONFDIR} = "$shorewallrc{CONFDIR}/shorewall"; + $globals{PRODUCT} = 'shorewall'; + $config{IPTABLES} = undef; + $validlevels{ULOG} = 'ULOG'; + } else { + $globals{SHAREDIR} = "$shorewallrc{SHAREDIR}/shorewall6"; + $globals{CONFDIR} = "$shorewallrc{CONFDIR}/shorewall6"; + $globals{PRODUCT} = 'shorewall6'; + $config{IP6TABLES} = undef; + } } } @@ -2276,12 +2278,12 @@ sub read_a_line1() { } } -sub process_shorewallrc() { - my $home = $ENV{HOME} || `echo ~`; +sub process_shorewallrc( $ ) { + my $shorewallrc = shift; $shorewallrc{PRODUCT} = $family == F_IPV4 ? 'shorewall' : 'shorewall6'; - if ( $home && open_file "$home/.shorewallrc" ) { + if ( open_file $shorewallrc ) { while ( read_a_line1 ) { if ( $currentline =~ /^([a-zA-Z]\w*)=(.*)$/ ) { my ($var, $val) = ($1, $2); @@ -2292,6 +2294,8 @@ sub process_shorewallrc() { fatal_error "Unrecognized shorewallrc entry"; } } + } else { + fatal_error "Failed to open $shorewallrc: $!"; } } @@ -3469,7 +3473,7 @@ sub process_shorewall_conf( $$ ) { # for ( values %config ) { if ( supplied $_ ) { - expand_variables( $_ ) unless /^'(.+)'$/; + expand_variables( $_, 1) unless /^'(.+)'$/; } } } diff --git a/Shorewall/Perl/compiler.pl b/Shorewall/Perl/compiler.pl index c228593d3..d14442796 100755 --- a/Shorewall/Perl/compiler.pl +++ b/Shorewall/Perl/compiler.pl @@ -65,6 +65,7 @@ sub usage( $ ) { [ --annotate ] [ --update ] [ --convert ] + [ --shorewallrc ] [ --config_path= ] '; @@ -91,6 +92,7 @@ my $annotate = 0; my $update = 0; my $convert = 0; my $config_path = ''; +my $shorewallrc = ''; Getopt::Long::Configure ('bundling'); @@ -122,6 +124,7 @@ my $result = GetOptions('h' => \$help, 'update' => \$update, 'convert' => \$convert, 'config_path=s' => \$config_path, + 'shorewallrc=s' => \$shorewallrc, ); usage(1) unless $result && @ARGV < 2; @@ -144,4 +147,5 @@ compiler( script => $ARGV[0] || '', convert => $convert, annotate => $annotate, config_path => $config_path, + shorewallrc => $shorewallrc ); diff --git a/Shorewall/Samples/Universal/shorewall.conf b/Shorewall/Samples/Universal/shorewall.conf index a7ce12422..2cabfb626 100644 --- a/Shorewall/Samples/Universal/shorewall.conf +++ b/Shorewall/Samples/Universal/shorewall.conf @@ -53,7 +53,7 @@ TCP_FLAGS_LOG_LEVEL=info # L O C A T I O N O F F I L E S A N D D I R E C T O R I E S ############################################################################### -CONFIG_PATH=/etc/shorewall:/usr/share/shorewall +CONFIG_PATH=${CONFDIR}/shorewall:${SHAREDIR}/shorewall IPTABLES= diff --git a/Shorewall/Samples/one-interface/shorewall.conf b/Shorewall/Samples/one-interface/shorewall.conf index d5e9a1c07..373146636 100644 --- a/Shorewall/Samples/one-interface/shorewall.conf +++ b/Shorewall/Samples/one-interface/shorewall.conf @@ -64,7 +64,7 @@ TCP_FLAGS_LOG_LEVEL=info # L O C A T I O N O F F I L E S A N D D I R E C T O R I E S ############################################################################### -CONFIG_PATH=/etc/shorewall:/usr/share/shorewall +CONFIG_PATH=${CONFDIR}/shorewall:${SHAREDIR}/shorewall IPTABLES= diff --git a/Shorewall/Samples/three-interfaces/shorewall.conf b/Shorewall/Samples/three-interfaces/shorewall.conf index ea53c331f..7a5c706e8 100644 --- a/Shorewall/Samples/three-interfaces/shorewall.conf +++ b/Shorewall/Samples/three-interfaces/shorewall.conf @@ -62,7 +62,7 @@ TCP_FLAGS_LOG_LEVEL=info # L O C A T I O N O F F I L E S A N D D I R E C T O R I E S ############################################################################### -CONFIG_PATH=/etc/shorewall:/usr/share/shorewall +CONFIG_PATH=${CONFDIR}/shorewall:${SHAREDIR}/shorewall IPTABLES= diff --git a/Shorewall/Samples/two-interfaces/shorewall.conf b/Shorewall/Samples/two-interfaces/shorewall.conf index d6b6dbe1f..291053d59 100644 --- a/Shorewall/Samples/two-interfaces/shorewall.conf +++ b/Shorewall/Samples/two-interfaces/shorewall.conf @@ -65,7 +65,7 @@ TCP_FLAGS_LOG_LEVEL=info # L O C A T I O N O F F I L E S A N D D I R E C T O R I E S ############################################################################### -CONFIG_PATH=/etc/shorewall:/usr/share/shorewall +CONFIG_PATH=${CONFDIR}/shorewall:${SHAREDIR}/shorewall IPTABLES= diff --git a/Shorewall/configfiles/shorewall.conf b/Shorewall/configfiles/shorewall.conf index 777de5306..91acc561a 100644 --- a/Shorewall/configfiles/shorewall.conf +++ b/Shorewall/configfiles/shorewall.conf @@ -53,7 +53,7 @@ TCP_FLAGS_LOG_LEVEL=info # L O C A T I O N O F F I L E S A N D D I R E C T O R I E S ############################################################################### -CONFIG_PATH="/etc/shorewall:/usr/share/shorewall" +CONFIG_PATH="${CONFDIR}/shorewall:${SHAREDIR}/shorewall" IPTABLES= diff --git a/Shorewall/configpath b/Shorewall/configpath index 9c442bbbc..53e56826b 100644 --- a/Shorewall/configpath +++ b/Shorewall/configpath @@ -10,4 +10,4 @@ # /usr/share/shorewall/configfiles/. This prevents 'compile -e' # from trying to use configuration information from /etc/shorewall. -CONFIG_PATH=${CONFDIR}:/usr/share/shorewall +CONFIG_PATH=${CONFDIR}:${SHAREDIR}/shorewall diff --git a/Shorewall/install.sh b/Shorewall/install.sh index c59481ed9..f6b644947 100755 --- a/Shorewall/install.sh +++ b/Shorewall/install.sh @@ -320,6 +320,7 @@ if [ -z "${DESTDIR}" -a $PRODUCT = shorewall -a ! -f ${SHAREDIR}/$PRODUCT/coreve fi install_file $PRODUCT ${DESTDIR}${SBINDIR}/$PRODUCT 0755 +[ $SHAREDIR = /usr/share ] || eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}/${SBINDIR}/${PRODUCT} echo "$PRODUCT control program installed in ${DESTDIR}${SBINDIR}/$PRODUCT" # @@ -327,7 +328,7 @@ echo "$PRODUCT control program installed in ${DESTDIR}${SBINDIR}/$PRODUCT" # if [ -n "$INITFILE" ]; then install_file $INITSOURCE ${DESTDIR}${INITDIR}/$INITFILE 0544 - [ "${SHAREDIR}" = /usr/share ] || eval sed -i \'s\|/usr/share/|${SHAREDIR}/|\' ${DESTDIR}${INITDIR}/$INITFILE + [ "${SHAREDIR}" = /usr/share ] || eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}${INITDIR}/$INITFILE if [ -n "${AUXINITSOURCE}" ]; then install_file $INITSOURCE ${DESTDIR}${INITDIR}/$INITFILE 0544 @@ -993,7 +994,7 @@ if [ $PRODUCT = shorewall6 ]; then # Symbolically link 'functions' to lib.base # ln -sf lib.base ${DESTDIR}${SHAREDIR}/$PRODUCT/functions - [ $SHAREDIR = /usr/share ] || eval sed -i \'s\|/usr/share/|${SHAREDIR}/|\' ${DESTDIR}/${SHAREDIR}/${PRODUCT}/lib.base + [ $SHAREDIR = /usr/share ] || eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}/${SHAREDIR}/${PRODUCT}/lib.base fi if [ -d Perl ]; then diff --git a/Shorewall/lib.cli-std b/Shorewall/lib.cli-std index 013a8b630..d3bee1ef1 100644 --- a/Shorewall/lib.cli-std +++ b/Shorewall/lib.cli-std @@ -31,9 +31,12 @@ # get_config() { local prog + local confdir ensure_config_path + + if [ "$1" = Yes ]; then params=$(find_file params) @@ -46,7 +49,10 @@ get_config() { if [ -f $config ]; then if [ -r $config ]; then + confdir=${CONFDIR} + CONFDIR=${g_confdir} . $config + CONFDIR=${confdir} else echo "Cannot read $config! (Hint: Are you root?)" >&2 exit 1 @@ -395,7 +401,7 @@ compiler() { [ "$1" = nolock ] && shift; shift - options="--verbose=$VERBOSITY --family=$g_family --config_path=$CONFIG_PATH" + options="--verbose=$VERBOSITY --family=$g_family --config_path=$CONFIG_PATH --shorewallrc=${g_sharedir}/shorewall/shorewallrc" [ -n "$STARTUP_LOG" ] && options="$options --log=$STARTUP_LOG" [ -n "$LOG_VERBOSITY" ] && options="$options --log_verbosity=$LOG_VERBOSITY"; [ -n "$g_export" ] && options="$options --export" diff --git a/Shorewall/shorewall b/Shorewall/shorewall index 5492a42d1..272c7c363 100755 --- a/Shorewall/shorewall +++ b/Shorewall/shorewall @@ -36,6 +36,7 @@ g_libexec="$LIBEXECDIR" g_sharedir="$SHAREDIR" g_sbindir="$SBINDIR" g_perllib="$PERLLIBDIR" +g_confdir="$CONFDIR" g_readrc=1 . $g_sharedir/shorewall/lib.cli diff --git a/Shorewall6-lite/shorewall6-lite b/Shorewall6-lite/shorewall6-lite index a1291267d..720caeff7 100755 --- a/Shorewall6-lite/shorewall6-lite +++ b/Shorewall6-lite/shorewall6-lite @@ -27,30 +27,16 @@ ################################################################################################ g_program=shorewall6-lite -if [ -f ./.shorewallrc ]; then - . ./.shorewallrc || exit 1 -elif [ -f ~/.shorewallrc ]; then - . ~/.shorewallrc || exit 1 -elif [ -r /root/.shorewallrc ]; then - . /root/.shorewallrc || exit 1 -elif [ -r /.shorewallrc ]; then - . /root/.shorewallrc || exit 1 -elif - -f ${SHOREWALLRC_HOME}/.shorewallrc; then - . ${SHOREWALLRC_HOME}/.shorewallrc || exit 1 -else - SHAREDIR=/usr/share - CONFDIR=/etc - SBINDIR=/sbin - VARDIR=/var/lib - LIBEXECDIR=/usr/share - PERLLIBDIR=/usr/share/shorewall - -fi +# +# This is modified by the installer when ${SHAREDIR} <> /usr/share +# +. /usr/share/shorewall/shorewallrc g_libexec="$LIBEXECDIR" g_sharedir="$SHAREDIR" g_sbindir="$SBINDIR" g_perllib="$PERLLIBDIR" +g_confdir="$CONFDIR" g_readrc=1 . $g_sharedir/shorewall/lib.cli diff --git a/Shorewall6/Samples6/Universal/shorewall6.conf b/Shorewall6/Samples6/Universal/shorewall6.conf index 7d86dd9d6..3779913f8 100644 --- a/Shorewall6/Samples6/Universal/shorewall6.conf +++ b/Shorewall6/Samples6/Universal/shorewall6.conf @@ -52,7 +52,7 @@ TCP_FLAGS_LOG_LEVEL=info # L O C A T I O N O F F I L E S A N D D I R E C T O R I E S ############################################################################### -CONFIG_PATH=/etc/shorewall6:/usr/share/shorewall6:/usr/share/shorewall +CONFIG_PATH=${CONFDIR}/shorewall6:${SHAREDIR}/shorewall6:${SHAREDIR}/shorewall IP6TABLES= diff --git a/Shorewall6/Samples6/one-interface/shorewall6.conf b/Shorewall6/Samples6/one-interface/shorewall6.conf index 7ea50a30b..98e2e46bb 100644 --- a/Shorewall6/Samples6/one-interface/shorewall6.conf +++ b/Shorewall6/Samples6/one-interface/shorewall6.conf @@ -52,7 +52,7 @@ TCP_FLAGS_LOG_LEVEL=info # L O C A T I O N O F F I L E S A N D D I R E C T O R I E S ############################################################################### -CONFIG_PATH=/etc/shorewall6:/usr/share/shorewall6:/usr/share/shorewall +CONFIG_PATH=${CONFDIR}/shorewall6:${SHAREDIR}/shorewall6:${SHAREDIR}/shorewall IP6TABLES= diff --git a/Shorewall6/Samples6/three-interfaces/shorewall6.conf b/Shorewall6/Samples6/three-interfaces/shorewall6.conf index 1177054ba..cb126b730 100644 --- a/Shorewall6/Samples6/three-interfaces/shorewall6.conf +++ b/Shorewall6/Samples6/three-interfaces/shorewall6.conf @@ -52,7 +52,7 @@ TCP_FLAGS_LOG_LEVEL=info # L O C A T I O N O F F I L E S A N D D I R E C T O R I E S ############################################################################### -CONFIG_PATH=/etc/shorewall6:/usr/share/shorewall6:/usr/share/shorewall +CONFIG_PATH=${CONFDIR}/shorewall6:${SHAREDIR}/shorewall6:${SHAREDIR}/shorewall IP6TABLES= diff --git a/Shorewall6/Samples6/two-interfaces/shorewall6.conf b/Shorewall6/Samples6/two-interfaces/shorewall6.conf index c4d7f73b2..dd3b2c862 100644 --- a/Shorewall6/Samples6/two-interfaces/shorewall6.conf +++ b/Shorewall6/Samples6/two-interfaces/shorewall6.conf @@ -52,7 +52,7 @@ TCP_FLAGS_LOG_LEVEL=info # L O C A T I O N O F F I L E S A N D D I R E C T O R I E S ############################################################################### -CONFIG_PATH=/etc/shorewall6:/usr/share/shorewall6:/usr/share/shorewall +CONFIG_PATH=${CONFDIR}/shorewall6:${SHAREDIR}/shorewall6:${SHAREDIR}/shorewall IP6TABLES= diff --git a/Shorewall6/configfiles/shorewall6.conf b/Shorewall6/configfiles/shorewall6.conf index 12e20bd3c..5e0907447 100644 --- a/Shorewall6/configfiles/shorewall6.conf +++ b/Shorewall6/configfiles/shorewall6.conf @@ -52,7 +52,7 @@ TCP_FLAGS_LOG_LEVEL=info # L O C A T I O N O F F I L E S A N D D I R E C T O R I E S ############################################################################### -CONFIG_PATH="/etc/shorewall6:/usr/share/shorewall6:/usr/share/shorewall" +CONFIG_PATH="${CONFDIR}/shorewall6:/usr/share/shorewall6:${SHAREDIR}/shorewall" IP6TABLES= diff --git a/Shorewall6/shorewall6 b/Shorewall6/shorewall6 index a1e3e50d0..6d512a0bd 100755 --- a/Shorewall6/shorewall6 +++ b/Shorewall6/shorewall6 @@ -27,22 +27,16 @@ ################################################################################################ g_program=shorewall6 -if [ -f ~/.shorewallrc ]; then - . ~/.shorewallrc || exit 1 -else - SHAREDIR=/usr/share - CONFDIR=/etc - SBINDIR=/sbin - VARDIR=/var/lib - LIBEXECDIR=/usr/share - PERLLIBDIR=/usr/share/shorewall - -fi +# +# This is modified by the installer when ${SHAREDIR} <> /usr/share +# +. /usr/share/shorewall/shorewallrc g_libexec="$LIBEXECDIR" g_sharedir="$SHAREDIR" g_sbindir="$SBINDIR" g_perllib="$PERLLIBDIR" +g_confdir="$CONFDIR" g_readrc=1 . $g_sharedir/shorewall/lib.cli