From 4c7f1a03a01e98459a0996d3c86e7fd2ad957902 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Mon, 26 Sep 2011 07:42:44 -0700 Subject: [PATCH] Catch multiple semicolons on a line. Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Config.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index 4609258f3..0d788aacd 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -1341,8 +1341,9 @@ sub supplied( $ ) { sub split_line( $$$$ ) { my ( $mincolumns, $maxcolumns, $description, $columnsref ) = @_; - my ( $columns, $pairs ) = split( ';', $currentline ); + my ( $columns, $pairs, $rest ) = split( ';', $currentline ); + fatal_error "Only one semicolon (';') allowed on a line" if defined $rest; fatal_error "Shorewall Configuration file entries may not contain single quotes, double quotes, single back quotes or backslashes" if $columns =~ /["'`\\]/; fatal_error "Non-ASCII gunk in file" if $columns =~ /[^\s[:print:]]/; @@ -1378,8 +1379,9 @@ sub split_line( $$$$ ) { sub split_line1( $$$$;$ ) { my ( $mincolumns, $maxcolumns, $description, $columnsref, $nopad) = @_; - my ( $columns, $pairs ) = split( ';', $currentline ); + my ( $columns, $pairs, $rest ) = split( ';', $currentline ); + fatal_error "Only one semicolon (';') allowed on a line" if defined $rest; fatal_error "Shorewall Configuration file entries may not contain double quotes, single back quotes or backslashes" if $columns =~ /["`\\]/; fatal_error "Non-ASCII gunk in file" if $columns =~ /[^\s[:print:]]/;