Ensure that action and macro files always allow comment directives.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2012-12-23 12:19:30 -08:00
parent 4d2379f542
commit 0acd93a032
2 changed files with 13 additions and 13 deletions

View File

@ -497,11 +497,11 @@ my $max_format; # Max format value
our $comment; # Current COMMENT our $comment; # Current COMMENT
my @comments; my @comments;
my $comments_allowed; my $comments_allowed;
my $warningcount; my $warningcount;
my $warningcount1; my $warningcount1;
my $warningcount2; my $warningcount2;
my $shorewall_dir; # Shorewall Directory; if non-empty, search here first for files. my $shorewall_dir; # Shorewall Directory; if non-empty, search here first for files.
our $debug; # Global debugging flag our $debug; # Global debugging flag
my $confess; # If true, use Carp to report errors with stack trace. my $confess; # If true, use Carp to report errors with stack trace.
@ -514,9 +514,9 @@ our $Product; # $product with initial cap.
our $sillyname; # Name of temporary filter chains for testing capabilities our $sillyname; # Name of temporary filter chains for testing capabilities
our $sillyname1; our $sillyname1;
my $iptables; # Path to iptables/ip6tables my $iptables; # Path to iptables/ip6tables
my $tc; # Path to tc my $tc; # Path to tc
my $ip; # Path to ip my $ip; # Path to ip
my $shell; # Type of shell that processed the params file my $shell; # Type of shell that processed the params file
@ -2559,14 +2559,14 @@ EOF
# The following two functions allow module clients to nest opens. This happens frequently # The following two functions allow module clients to nest opens. This happens frequently
# in the Rules module. # in the Rules module.
# #
sub push_open( $;$ ) { sub push_open( $;$$ ) {
my ( $file, $max ) = @_; my ( $file, $max , $ca) = @_;
push @includestack, [ $currentfile, $currentfilename, $currentlinenumber, $ifstack, $file_format, $max_format ] if $currentfile; push @includestack, [ $currentfile, $currentfilename, $currentlinenumber, $ifstack, $file_format, $max_format ] if $currentfile;
my @a = @includestack; my @a = @includestack;
push @openstack, \@a; push @openstack, \@a;
@includestack = (); @includestack = ();
$currentfile = undef; $currentfile = undef;
open_file( $file , $max, $comments_allowed ); open_file( $file , $max, $comments_allowed || $ca );
} }
sub pop_open() { sub pop_open() {

View File

@ -1472,7 +1472,7 @@ sub process_actions() {
$targets{$_} = new_action( $_ , ACTION + BUILTIN, 1, 0 ) for @builtins; $targets{$_} = new_action( $_ , ACTION + BUILTIN, 1, 0 ) for @builtins;
for my $file ( qw/actions.std actions/ ) { for my $file ( qw/actions.std actions/ ) {
open_file( $file, 2, 1 ); open_file( $file, 2 );
while ( read_a_line( NORMAL_READ ) ) { while ( read_a_line( NORMAL_READ ) ) {
my ( $action, $options ) = split_line 'action file' , { action => 0, options => 1 }; my ( $action, $options ) = split_line 'action file' , { action => 0, options => 1 };
@ -1552,7 +1552,7 @@ sub process_action($) {
progress_message2 "$doing $actionfile for chain $chainref->{name}..."; progress_message2 "$doing $actionfile for chain $chainref->{name}...";
push_open $actionfile, 2; push_open $actionfile, 2, 1;
my $oldparms = push_action_params( $chainref, $param, $level, $tag ); my $oldparms = push_action_params( $chainref, $param, $level, $tag );
@ -1798,7 +1798,7 @@ sub process_inline ($$$$$$$$$$$$$$$$$$$$) {
progress_message "..Expanding inline action $inlinefile..."; progress_message "..Expanding inline action $inlinefile...";
push_open $inlinefile; push_open $inlinefile, 2;
while ( read_a_line( NORMAL_READ ) ) { while ( read_a_line( NORMAL_READ ) ) {
my ( $mtarget, my ( $mtarget,