From 7377eb1993bf989f5a61a968e935d94cc3b78b3d Mon Sep 17 00:00:00 2001 From: teastep Date: Tue, 9 Dec 2008 22:58:49 +0000 Subject: [PATCH] More operation fixes git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@8962 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/Shorewall/Compiler.pm | 32 ++++++++++++++++++++-------- Shorewall-perl/Shorewall/Config.pm | 5 ++++- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/Shorewall-perl/Shorewall/Compiler.pm b/Shorewall-perl/Shorewall/Compiler.pm index 5b4602592..e24dd1cf9 100644 --- a/Shorewall-perl/Shorewall/Compiler.pm +++ b/Shorewall-perl/Shorewall/Compiler.pm @@ -120,16 +120,30 @@ sub generate_script_1() { push_indent; - if ( $export ) { - emit ( 'SHAREDIR=/usr/share/shorewall-lite', - 'CONFDIR=/etc/shorewall-lite', - 'PRODUCT="Shorewall Lite"' - ); + if ( $family == F_IPV4 ) { + if ( $export ) { + emit ( 'SHAREDIR=/usr/share/shorewall-lite', + 'CONFDIR=/etc/shorewall-lite', + 'PRODUCT="Shorewall Lite"' + ); + } else { + emit ( 'SHAREDIR=/usr/share/shorewall', + 'CONFDIR=/etc/shorewall', + 'PRODUCT=\'Shorewall\'', + ); + } } else { - emit ( 'SHAREDIR=/usr/share/shorewall', - 'CONFDIR=/etc/shorewall', - 'PRODUCT=\'Shorewall\'', - ); + if ( $export ) { + emit ( 'SHAREDIR=/usr/share/shorewall6-lite', + 'CONFDIR=/etc/shorewall6-lite', + 'PRODUCT="Shorewall6 Lite"' + ); + } else { + emit ( 'SHAREDIR=/usr/share/shorewall6', + 'CONFDIR=/etc/shorewall6', + 'PRODUCT=\'Shorewall6\'', + ); + } } emit( '[ -f ${CONFDIR}/vardir ] && . ${CONFDIR}/vardir' ); diff --git a/Shorewall-perl/Shorewall/Config.pm b/Shorewall-perl/Shorewall/Config.pm index 571cece2d..2da9de88d 100644 --- a/Shorewall-perl/Shorewall/Config.pm +++ b/Shorewall-perl/Shorewall/Config.pm @@ -406,6 +406,9 @@ sub initialize( $ ) { BLACKLIST_DISPOSITION => undef, ); } else { + $globals{SHAREDIR} = '/usr/share/shorewall'; + $globals{CONFDIR} = '/etc/shorewall6'; + %config = ( STARTUP_ENABLED => undef, VERBOSITY => undef, @@ -1811,7 +1814,7 @@ sub ensure_config_path() { my $f = "$globals{SHAREDIR}/configpath"; - $globals{CONFDIR} = "/usr/share/$product/configfiles/"; + $globals{CONFDIR} = "/usr/share/$product/configfiles/" if $> != 0; unless ( $config{CONFIG_PATH} ) { fatal_error "$f does not exist" unless -f $f;