On 04/09/2012 10:13 AM, Tom Eastep wrote:
> On 04/09/2012 06:56 AM, Steven Jan Springl wrote:
> 
>> Rule:
>>
>> SHELL  echo  "#DROP  fw  wan  tcp  80"
>>
>> produces the following error messages:
>>
>> /bin/sh: Syntax error: Unterminated quoted string
>> ERROR: SHELL Script failed : /etc/shorewallT8/rules (line 15)
> 
> Doesn't this happen on prior versions as well?

The attached patch should correct this issue.

Thanks, Steven

-Tom
-- 
Tom Eastep        \ When I die, I want to go like my Grandfather who
Shoreline,         \ died peacefully in his sleep. Not screaming like
Washington, USA     \ all of the passengers in his car
http://shorewall.net \________________________________________________
diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm
index b54bcd2..63a3445 100644
--- a/Shorewall/Perl/Shorewall/Config.pm
+++ b/Shorewall/Perl/Shorewall/Config.pm
@@ -1559,8 +1559,12 @@ sub process_conditional( $$$ ) {
 
     my ($keyword, $rest) = ( $1, $2 );
 
-    $rest = '' unless supplied $rest;
-    $rest =~ s/\s*$//;
+    if ( supplied $rest ) {
+	$rest =~ s/#.*//;
+	$rest =~ s/\s*$//;
+    } else {
+	$rest = '';
+    }
 
     my ( $lastkeyword, $prioromit, $lastomit, $lastlinenumber ) = @ifstack ? @{$ifstack[-1]} : ('', 0, 0, 0 );
 
@@ -2175,10 +2179,6 @@ sub read_a_line(;$$$$) {
 	    #
 	    chop $currentline, next if substr( ( $currentline .= $_ ), -1, 1 ) eq '\\';
 	    #
-	    # Now remove concatinated comments
-	    #
-	    $currentline =~ s/#.*$// if $strip_comments;
-	    #
 	    # Ignore ( concatenated ) Blank Lines
 	    #
 	    $currentline = '', $currentlinenumber = 0, next if $currentline =~ /^\s*$/ && $suppress_whitespace;
@@ -2221,6 +2221,14 @@ sub read_a_line(;$$$$) {
 		    next;
 		}
 	    }
+	    #
+	    # Now remove concatinated comments
+	    #
+	    $currentline =~ s/#.*$// if $strip_comments;
+	    #
+	    # Ignore ( concatenated ) Blank Lines after comments are removed.
+	    #
+	    $currentline = '', $currentlinenumber = 0, next if $currentline =~ /^\s*$/ && $suppress_whitespace;
 
 	    my $count = 0;
 	    #

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Shorewall-devel mailing list
Shorewall-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/shorewall-devel

Reply via email to