From 2e4f97175ddac76fcacc6b9feebfd7ea6a0f5388 Mon Sep 17 00:00:00 2001 From: teastep Date: Sat, 27 Sep 2003 14:54:16 +0000 Subject: [PATCH] Correct handling of missing common.def file git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@748 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall/changelog.txt | 3 +++ Shorewall/firewall | 8 +++++--- Shorewall/releasenotes.txt | 14 ++++++++++++++ 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/Shorewall/changelog.txt b/Shorewall/changelog.txt index 8739e1b8a..cb2f2c0de 100755 --- a/Shorewall/changelog.txt +++ b/Shorewall/changelog.txt @@ -85,3 +85,6 @@ Changes since 1.4.6 37) Reword error message to avoid the word 'illegal'. 38) Avoid shell error when there is no policy corresponding to a rule. + +39) Fatal error if /etc/shorewall/common or /etc/shoreall/common.def do + not exist. diff --git a/Shorewall/firewall b/Shorewall/firewall index c10baec99..41168c64c 100755 --- a/Shorewall/firewall +++ b/Shorewall/firewall @@ -2851,7 +2851,7 @@ process_rule() # $1 = target # # Process the rules file for the 'start', 'restart' or 'check' command. # -process_rules() # $1 = name of rules file +process_rules() { # # Process a rule where the source or destination is "all" @@ -3925,8 +3925,10 @@ build_common_chain() { if [ -f $common ]; then . $common + elif [ -f /etc/shorewall/common.def ]; then + . /etc/shorewall/common.def else - . `find_file common.def` + fatal_error "/etc/shorewall/common.def does not exist" fi # # New Not Syn Stuff @@ -4497,7 +4499,7 @@ define_firewall() # $1 = Command (Start or Restart) echo "Processing $rules..." - process_rules $rules + process_rules policy=`find_file policy` diff --git a/Shorewall/releasenotes.txt b/Shorewall/releasenotes.txt index 725793169..d25fb6a51 100755 --- a/Shorewall/releasenotes.txt +++ b/Shorewall/releasenotes.txt @@ -67,6 +67,20 @@ Problems Corrected since version 1.4.6: No policy defined from zone to zone +15) Previously, if neither /etc/shorewall/common nor + /etc/shorewall/common.def existed, Shorewall would fail to start + and would not remove the lock file. Failure to remove the lock file + resulted in the following during subsequent attempts to start: + + Loading /usr/share/shorewall/functions... + Processing /etc/shorewall/params ... + Processing /etc/shorewall/shorewall.conf... + Giving up on lock file /var/lib/shorewall/lock + Shorewall Not Started + + Shorewall now reports a fatal error if neither of these two files + exist and correctly removes the lock file. + Migration Issues: 1) IP Traffic Accounting is changed from Snapshot 20030813.