From bfeea76cf2dec3277d89c2aa060c8bbce96eae51 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Tue, 25 Dec 2012 08:10:48 -0800 Subject: [PATCH] Disallow ?FORMAT when $max_format == 1 Signed-off-by: Tom Eastep Conflicts: Shorewall/Perl/Shorewall/Config.pm --- Shorewall/Perl/Shorewall/Config.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index 6305555ad..bdfe39b43 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -2250,6 +2250,7 @@ sub process_compiler_directive( $$$$ ) { FORMAT => sub() { unless ( $omitting ) { + directive_error( "?FORMAT is not allowed in this file", $filename, $linenumber ) unless $max_format > 1; directive_error( "Missing format", $filename, $linenumber ) unless supplied $expression; directive_error( "Invalid format ($expression)", $filename, $linenumber ) unless $expression =~ /^\d+$/; directive_error( "Format must be between 1 and $max_format", $filename, $linenumber ) unless $expression && $expression <= $max_format;