use constant MAX_DIRECTIVE_SIZE => 50*1024; # 50 KiB
use constant MAX_SIGNATURE_SIZE => 50*1024; # 50 KiB
+# limit on the number of subdirectories allowed
+use constant MAX_DIRECTORY_DEPTH => 4;
+
#
# -- Configuration sanity check
#
# A couple of subdir levels are ok, but don't allow hundreds.
my $slash_count = ($val =~ tr,/,/,);
fatal("$slash_count slashes is too many, in $val",1,$directive_file_contents)
- if ($slash_count > 3 and not $do_not_fail);
+ if ($slash_count > (MAX_DIRECTORY_DEPTH-1) and not $do_not_fail);
# Only let them specify one directory directive.
fatal("Only one directory directive is allowed per directive file. "