From 2a54e8cd24da8bae26990a31f98c4df32c01db3e Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Sat, 28 Aug 2010 13:37:19 -0700 Subject: [PATCH] split_list1 removes () --- Shorewall/Perl/Shorewall/Config.pm | 2 ++ Shorewall/Perl/Shorewall/Zones.pm | 6 +----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index 7e218ea51..99db425d8 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -1479,10 +1479,12 @@ sub split_list1( $$ ) { fatal_error "Invalid $type list ($list)" if $count > 1; push @list2 , $_; } else { + s/\(//; $element = $_; } } elsif ( ( $count = tr/)/)/ ) > 0 ) { fatal_error "Invalid $type list ($list)" unless $element && $count == 1; + s/\)//; push @list2, join ',', $element, $_; $element = ''; } elsif ( $element ) { diff --git a/Shorewall/Perl/Shorewall/Zones.pm b/Shorewall/Perl/Shorewall/Zones.pm index c561a27d3..2fe4c983c 100644 --- a/Shorewall/Perl/Shorewall/Zones.pm +++ b/Shorewall/Perl/Shorewall/Zones.pm @@ -929,10 +929,6 @@ sub process_interface( $$ ) { } elsif ( $type == IPLIST_IF_OPTION ) { fatal_error "The '$option' option requires a value" unless defined $value; # - # Remove parentheses from address list if present - # - $value =~ s/\)$// if $value =~ s/^\(//; - # # Add all IP to the front of a list if the list begins with '!' # $value = join ',' , ALLIP , $value if $value =~ /^!/; @@ -965,7 +961,7 @@ sub process_interface( $$ ) { fatal_error "The '$option' option requires a value" unless defined $value; if ( $option eq 'physical' ) { - fatal_error "Invalid Physical interface name ($value)" unless $value && $value =~ /^[\w.@%-]*\+?$/; + fatal_error "Invalid Physical interface name ($value)" unless $value && $value !~ /%/; fatal_error "Duplicate physical interface name ($value)" if ( $physical{$value} && ! $port );