Quote original list when a translated list is ill-formed.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2012-05-15 16:39:46 -07:00
parent 85f58d6906
commit 78af118b9a
2 changed files with 6 additions and 4 deletions

View File

@ -1440,10 +1440,10 @@ sub find_file($)
"$config_path[0]$filename";
}
sub split_list( $$ ) {
my ($list, $type ) = @_;
sub split_list( $$;$ ) {
my ($list, $type, $origlist ) = @_;
fatal_error "Invalid $type list ($list)" if $list =~ /^,|,$|,,|!,|,!$/;
fatal_error( "Invalid $type list (" . ( $origlist ? $origlist : $list ) . ')' ) if $list =~ /^,|,$|,,|!,|,!$/;
split /,/, $list;
}

View File

@ -300,9 +300,11 @@ fatal_error "Invalid SRC/DST ($srcdst)" if supplied $srcdst &
my $chainref = get_action_chain;
my ( $level, $tag ) = get_action_logging;
my $target = require_audit ( $action , $audit );
my $origcountries = $countries;
$countries =~ s/\|/,/g;
my @countries = split_list $countries, 'cc';
my @countries = split_list $countries, 'cc', $origcountries;
for ( @countries ) {
fatal_error "Unknown ISO 3661 Country Code ($_)" unless $isocodes{$_};