Up the INCLUDE depth limit to 20

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2018-03-12 14:39:53 -07:00
parent 6f6abfc8cd
commit 3be071ca3d
No known key found for this signature in database
GPG Key ID: 96E6B3F2423A4D10

View File

@ -562,7 +562,9 @@ our %helpers = ( amanda => UDP,
sip => UDP,
snmp => UDP,
tftp => UDP,
);
);
use constant { INCLUDE_LIMIT => 20 };
our %helpers_map;
@ -3320,7 +3322,7 @@ sub copy1( $ ) {
my @line = split / /;
fatal_error "Invalid INCLUDE command" if @line != 2;
fatal_error "INCLUDEs nested too deeply" if @includestack >= 4;
fatal_error "INCLUDEs nested too deeply" if @includestack >= INCLUDE_LIMIT;
my $filename = find_file $line[1];
@ -3530,7 +3532,7 @@ sub read_a_line($);
sub embedded_shell( $ ) {
my $multiline = shift;
fatal_error "INCLUDEs nested too deeply" if @includestack >= 4;
fatal_error "INCLUDEs nested too deeply" if @includestack >= INCLUDE_LIMIT;
my ( $command, $linenumber ) = ( "/bin/sh -c '$currentline", $currentlinenumber );
$directive_callback->( 'SHELL', $currentline ) if $directive_callback;
@ -3617,7 +3619,7 @@ sub embedded_perl( $ ) {
$embedded--;
if ( $perlscript ) {
fatal_error "INCLUDEs nested too deeply" if @includestack >= 4;
fatal_error "INCLUDEs nested too deeply" if @includestack >= INCLUDE_LIMIT;
assert( close $perlscript );
@ -3971,7 +3973,7 @@ sub read_a_line($) {
my @line = split ' ', $currentline;
fatal_error "Invalid INCLUDE command" if @line != 2;
fatal_error "INCLUDEs/Scripts nested too deeply" if @includestack >= 4;
fatal_error "INCLUDEs/Scripts nested too deeply" if @includestack >= INCLUDE_LIMIT;
my $filename = find_file $line[1];