From b22b279bd152a5769224b7c16932661a6db778d8 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Fri, 19 Mar 2010 10:01:02 -0700 Subject: [PATCH] Some additional idiot-proofing. Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Rules.pm | 8 ++++++++ Shorewall/changelog.txt | 2 ++ 2 files changed, 10 insertions(+) diff --git a/Shorewall/Perl/Shorewall/Rules.pm b/Shorewall/Perl/Shorewall/Rules.pm index daef3678e..b215c9e44 100644 --- a/Shorewall/Perl/Shorewall/Rules.pm +++ b/Shorewall/Perl/Shorewall/Rules.pm @@ -274,6 +274,14 @@ sub setup_blacklist() { progress_message " \"$currentline\" added to blacklist"; } + + if ( $first_entry && @$hosts ) { + warning_message q(There are interfaces or hosts with the 'blacklist' option but the 'blacklist' file is empty); + last BLACKLIST; + } + } elsif ( @$hosts ) { + warning_message q(There are interfaces or hosts with the 'blacklist' option, but the 'blacklist' file is either missing or has zero size); + last BLACKLIST; } my $state = $config{BLACKLISTNEWONLY} ? $globals{UNTRACKED} ? '-m state --state NEW,INVALID,UNTRACKED ' : '-m state --state NEW,INVALID ' : ''; diff --git a/Shorewall/changelog.txt b/Shorewall/changelog.txt index 9afb7d754..c2a373ea3 100644 --- a/Shorewall/changelog.txt +++ b/Shorewall/changelog.txt @@ -33,6 +33,8 @@ Changes in Shorewall 4.4.8 16) Distinguish between 'Started' and 'Restored' in ${VARDIR}/state +17) Issue warnings when 'blacklist' but no blacklist file entries. + Changes in Shorewall 4.4.7 1) Backport optimization changes from 4.5.