From 356d3fa2ddc4b7e5fe0a1777d40c8a59d29402c9 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Sun, 5 Mar 2017 12:09:54 -0800 Subject: [PATCH] Correct new directives with respect to omitting Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Config.pm | 86 +++++++++++++++++------------- 1 file changed, 49 insertions(+), 37 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index d8f899aad..c27878e45 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -2995,58 +2995,70 @@ sub process_compiler_directive( $$$$ ) { } , ERROR => sub() { - directive_error( evaluate_expression( $expression , - $filename , - $linenumber , - 1 ) , - $actparams{callfile} , - $actparams{callline} ) unless $omitting; + unless ( $omitting ) { + directive_error( evaluate_expression( $expression , + $filename , + $linenumber , + 1 ) , + $actparams{callfile} , + $actparams{callline} ) unless $omitting; + } } , WARNING => sub() { - directive_warning( $config{VERBOSE_MESSAGES} , - evaluate_expression( $expression , - $filename , - $linenumber , - 1 ), - $actparams{callfile} , - $actparams{callline} ) unless $omitting; + unless ( $omitting ) { + directive_warning( $config{VERBOSE_MESSAGES} , + evaluate_expression( $expression , + $filename , + $linenumber , + 1 ), + $actparams{callfile} , + $actparams{callline} ) unless $omitting; + } } , INFO => sub() { - directive_info( $config{VERBOSE_MESSAGES} , - evaluate_expression( $expression , - $filename , - $linenumber , - 1 ), - $actparams{callfile} , - $actparams{callline} ) unless $omitting; + unless ( $omitting ) { + directive_info( $config{VERBOSE_MESSAGES} , + evaluate_expression( $expression , + $filename , + $linenumber , + 1 ), + $actparams{callfile} , + $actparams{callline} ) unless $omitting; + } } , 'WARNING!' => sub() { - directive_warning( ! $config{VERBOSE_MESSAGES} , - evaluate_expression( $expression , - $filename , - $linenumber , - 1 ), - $actparams{callfile} , - $actparams{callline} ) unless $omitting; + unless ( $omitting ) { + directive_warning( ! $config{VERBOSE_MESSAGES} , + evaluate_expression( $expression , + $filename , + $linenumber , + 1 ), + $actparams{callfile} , + $actparams{callline} ) unless $omitting; + } } , 'INFO!' => sub() { - directive_info( ! $config{VERBOSE_MESSAGES} , - evaluate_expression( $expression , - $filename , - $linenumber , - 1 ), - $actparams{callfile} , - $actparams{callline} ) unless $omitting; + unless ( $omitting ) { + directive_info( ! $config{VERBOSE_MESSAGES} , + evaluate_expression( $expression , + $filename , + $linenumber , + 1 ), + $actparams{callfile} , + $actparams{callline} ) unless $omitting; + } } , REQUIRE => sub() { - fatal_error "?REQUIRE may only be used within action files" unless $actparams{0}; - fatal_error "Unknown capability ($expression}" unless $capabilities{$expression}; - require_capability( $expression, "The $actparams{action} action", 's' ); + unless ( $omitting ) { + fatal_error "?REQUIRE may only be used within action files" unless $actparams{0}; + fatal_error "Unknown capability ($expression)" unless $capdesc{$expression}; + require_capability( $expression, "The $actparams{action} action", 's' ); + } } , );