mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-15 04:04:10 +01:00
Tweak to host list processing
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6267 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
55e8ff29c7
commit
4ec96b6619
@ -114,11 +114,11 @@ sub validate_hosts_file()
|
||||
#
|
||||
# Now add a comma before '!'. Do it globally - add_group_to_zone() correctly checks for multiple exclusions
|
||||
#
|
||||
if ( substr($hosts, 0, 1 ) eq '!' ) {
|
||||
$hosts = join( '', ALLIPv4 , ',', $hosts );
|
||||
} else {
|
||||
$hosts =~ s/!/,!/g
|
||||
}
|
||||
$hosts =~ s/!/,!/g;
|
||||
#
|
||||
# Take care of case where the hosts list begins with '!'
|
||||
#
|
||||
$hosts = join( '', ALLIPv4 , $hosts ) if substr($hosts, 0, 2 ) eq ',!';
|
||||
|
||||
add_group_to_zone( $zone, $type , $interface, [ split( ',', $hosts ) ] , $optionsref);
|
||||
|
||||
|
@ -81,6 +81,8 @@ sub add_group_to_zone($$$$$)
|
||||
$ifacezone = '' unless defined $ifacezone;
|
||||
|
||||
for my $host ( @$networks ) {
|
||||
fatal_error "Invalid Host List" unless defined $host and $host ne '';
|
||||
|
||||
if ( substr( $host, 0, 1 ) eq '!' ) {
|
||||
fatal_error "Only one exclusion allowed in a host list" if $switched;
|
||||
$switched = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user