From 1fd340c6d75f57463e664ae8ecd9b981defe43c1 Mon Sep 17 00:00:00 2001 From: teastep Date: Mon, 19 Mar 2007 04:50:37 +0000 Subject: [PATCH] First successfull 'shorewall restart' with Perl compiler git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5575 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- New/Shorewall/Tunnels.pm | 24 ++++++++++++++++++------ New/compiler.pl | 7 ++++--- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/New/Shorewall/Tunnels.pm b/New/Shorewall/Tunnels.pm index 72dded8f9..dd028ad9d 100644 --- a/New/Shorewall/Tunnels.pm +++ b/New/Shorewall/Tunnels.pm @@ -123,8 +123,12 @@ sub setup_tunnels() { ( $kind, my ( $proto, $p ) ) = split /:/, $kind; - $port = $p if $p; - $protocol = $proto if $proto; + if ( $p ) { + $port = $p; + $protocol = $proto; + } elsif ( $proto ) { + $port = $proto; + } add_rule $inchainref, "-p $protocol $source --dport $port -j ACCEPT"; add_rule $outchainref, "-p $protocol $dest --dport $port -j ACCEPT"; @@ -138,8 +142,12 @@ sub setup_tunnels() { ( $kind, my ( $proto, $p ) ) = split /:/, $kind; - $port = $p if $p; - $protocol = $proto if $proto; + if ( $p ) { + $port = $p; + $protocol = $proto; + } elsif ( $proto ) { + $port = $proto; + } add_rule $inchainref, "-p $protocol $source --sport $port -j ACCEPT"; add_rule $outchainref, "-p $protocol $dest --dport $port -j ACCEPT"; @@ -153,8 +161,12 @@ sub setup_tunnels() { ( $kind, my ( $proto, $p ) ) = split /:/, $kind; - $port = $p if $p; - $protocol = $proto if $proto; + if ( $p ) { + $port = $p; + $protocol = $proto; + } elsif ( $proto ) { + $port = $proto; + } add_rule $inchainref, "-p $protocol $source --dport $port -j ACCEPT"; add_rule $outchainref, "-p $protocol $dest --sport $port -j ACCEPT"; diff --git a/New/compiler.pl b/New/compiler.pl index f400c558c..5cbb14e00 100755 --- a/New/compiler.pl +++ b/New/compiler.pl @@ -83,7 +83,7 @@ sub generate_script_1 { emit 'CONFDIR=/etc/shorewall'; emit 'VARDIR=/var/lib/shorewall\n'; emit 'PRODUCT=\'Shorewall\''; - emit '. /usr/share/shoreall/lib.base'; + emit '. /usr/share/shorewall/lib.base'; } emit ''; @@ -92,6 +92,7 @@ sub generate_script_1 { emit "run_${exit}_exit() {"; push_indent; append_file $exit; + emit 'true'; pop_indent; emit "}\n"; } @@ -111,7 +112,7 @@ sub generate_script_1 { emit ' fatal_error "This script requires Shorewall which do not appear to be installed on this system (did you forget \"-e\" when you compiled?)"'; emit 'fi'; emit ''; - emit 'local version=\$(cat \${SHAREDIR}/version)'; + emit 'local version=$(cat ${SHAREDIR}/version)'; emit ''; emit 'if [ ${SHOREWALL_LIBVERSION:-0} -lt 30203 ]; then'; emit ' fatal_error "This script requires Shorewall version 3.3.3 or later; current version is $version"'; @@ -514,7 +515,7 @@ sub generate_script_3() { pop_indent; - emit "}/n"; + emit "}\n"; progress_message2 "Creating iptables-restore input..."; create_netfilter_load;