From 0b5e30aa7b3a9891393403a741984853284eac0d Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Tue, 10 Apr 2012 17:27:23 -0700 Subject: [PATCH 1/2] Fix INCLUDE inside an ?IF ... ?ENDIF Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Config.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index e385792c6..5dae92582 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -2265,7 +2265,7 @@ sub read_a_line(;$$$$) { } } - if ( @ifstack ) { + if ( @ifstack > $ifstack ) { $currentlinenumber = 'EOF'; fatal_error "Missing ?ENDIF to match the ?IF at line $ifstack[-1]->[3]"; } From e263a3c27db630952c29f795a5f1cae19ab6a27a Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Wed, 11 Apr 2012 07:11:05 -0700 Subject: [PATCH 2/2] Remove redundant logic Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Config.pm | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index 5dae92582..485da6348 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -1674,7 +1674,6 @@ sub copy1( $ ) { if ( $script || $debug ) { my ( $do_indent, $here_documents ) = ( 1, ''); - my $save_ifstack = $ifstack; open_file( $_[0] ); @@ -1771,13 +1770,6 @@ sub copy1( $ ) { } } - if ( $ifstack < @ifstack ) { - $currentlinenumber = 'EOF'; - fatal_error "Missing ?ENDIF to match the ?IF at line $ifstack[-1]->[3]"; - } else { - $ifstack = $save_ifstack; - } - close_file; } } @@ -2265,11 +2257,6 @@ sub read_a_line(;$$$$) { } } - if ( @ifstack > $ifstack ) { - $currentlinenumber = 'EOF'; - fatal_error "Missing ?ENDIF to match the ?IF at line $ifstack[-1]->[3]"; - } - close_file; } }