From 666ecf49b6f1d27fe366dbc404e33431e6de3df4 Mon Sep 17 00:00:00 2001 From: teastep Date: Sun, 6 May 2007 01:17:58 +0000 Subject: [PATCH] Fix "!" in hosts file git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6254 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/Shorewall/Hosts.pm | 2 +- Shorewall-perl/Shorewall/Interfaces.pm | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Shorewall-perl/Shorewall/Hosts.pm b/Shorewall-perl/Shorewall/Hosts.pm index 7deababb3..018ac6abf 100644 --- a/Shorewall-perl/Shorewall/Hosts.pm +++ b/Shorewall-perl/Shorewall/Hosts.pm @@ -116,7 +116,7 @@ sub validate_hosts_file() # $hosts =~ s/!/,!/g; - add_group_to_zone( $zone, $type , $interface, [ split ',', $hosts ] , $optionsref); + add_group_to_zone( $zone, $type , $interface, [ split( ',', $hosts ) ] , $optionsref); progress_message " Host \"$line\" validated"; } diff --git a/Shorewall-perl/Shorewall/Interfaces.pm b/Shorewall-perl/Shorewall/Interfaces.pm index c1abf85c7..b736f8565 100644 --- a/Shorewall-perl/Shorewall/Interfaces.pm +++ b/Shorewall-perl/Shorewall/Interfaces.pm @@ -81,6 +81,7 @@ sub add_group_to_zone($$$$$) $ifacezone = '' unless defined $ifacezone; for my $host ( @$networks ) { + next unless $host; if ( substr( $host, 0, 1 ) eq '!' ) { fatal_error "Only one exclusion allowed in a host list" if $switched; $switched = 1;