diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index 025724ceb..b70db0715 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -2000,6 +2000,21 @@ sub find_writable_file($) { "$config_path[0]$filename"; } +# +# Determine if a value has been supplied +# +sub supplied( $ ) { + my $val = shift; + + defined $val && $val ne ''; +} + +sub passed( $ ) { + my $val = shift; + + defined $val && $val ne '' && $val ne '-'; +} + # # Split a comma-separated list into a Perl array # @@ -2058,7 +2073,7 @@ sub split_list1( $$;$ ) { sub split_list2( $$ ) { my ($list, $type ) = @_; - fatal_error "Invalid $type ($list)" if $list =~ /^:|::/; + fatal_error "Invalid $type ($list)" if $list =~ /^:/; my @list1 = split /:/, $list; my @list2; @@ -2095,6 +2110,7 @@ sub split_list2( $$ ) { fatal_error "Invalid $type ($list)" if $opencount < 0; } } elsif ( $element eq '' ) { + fatal_error "Invalid $type ($list)" unless supplied $_; push @list2 , $_; } else { $element = join ':', $element , $_; @@ -2260,21 +2276,6 @@ sub split_columns( $ ) { @list2; } -# -# Determine if a value has been supplied -# -sub supplied( $ ) { - my $val = shift; - - defined $val && $val ne ''; -} - -sub passed( $ ) { - my $val = shift; - - defined $val && $val ne '' && $val ne '-'; -} - sub clear_comment(); #