Fix "!" in hosts file

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6254 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-05-06 01:17:58 +00:00
parent a9ba8c8ad4
commit 666ecf49b6
2 changed files with 2 additions and 1 deletions

View File

@ -116,7 +116,7 @@ sub validate_hosts_file()
# #
$hosts =~ s/!/,!/g; $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"; progress_message " Host \"$line\" validated";
} }

View File

@ -81,6 +81,7 @@ sub add_group_to_zone($$$$$)
$ifacezone = '' unless defined $ifacezone; $ifacezone = '' unless defined $ifacezone;
for my $host ( @$networks ) { for my $host ( @$networks ) {
next unless $host;
if ( substr( $host, 0, 1 ) eq '!' ) { if ( substr( $host, 0, 1 ) eq '!' ) {
fatal_error "Only one exclusion allowed in a host list" if $switched; fatal_error "Only one exclusion allowed in a host list" if $switched;
$switched = 1; $switched = 1;