From 891bf9596163d8210577b3672d8be03dd1349955 Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Sat, 15 Aug 2020 12:53:46 -0700 Subject: [PATCH] Girocco/Config.pm: add size limits config section Include the first of the new size limits configuration options $max_file_size512 which sets the maximum file size in units of 512-byte blocks for any clone, fetch or receive-pack operations. Signed-off-by: Kyle J. McKay --- Girocco/Config.pm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Girocco/Config.pm b/Girocco/Config.pm index 5ad955e..0c5c6b2 100644 --- a/Girocco/Config.pm +++ b/Girocco/Config.pm @@ -797,6 +797,30 @@ our %reserved_suffixes = ( # +## ------------------- +## Size limit settings +## ------------------- +# + +# If this is set to a non-zero value, whenever a receive-pack, mirror fetch +# or clone runs, git will be run with a UL_SETFSIZE value set to this value. +# +# The limit is not active while performing garbage collection or other +# maintenance tasks. +# +# If git attempts to create a file larger than this limit, it will receive a +# SIGXFSZ signal which will cause git to terminate. +# +# Note that if the actual value of UL_GETFSIZE at runtime is already less than +# the value set here, then that value will be silently used instead. +# +# The value represents the maximum file size allowed in units of 512-byte blocks +# and must be <= 2147483647 (which represents a size of 1 TiB less 512 bytes). +# +our $max_file_size512 = undef; # default is no limit + + +# ## ------------------------- ## sendmail.pl configuration ## ------------------------- @@ -1148,6 +1172,9 @@ $suppress_git_ssh_logging = $suppress_git_ssh_logging ? 1 : ''; (not $httpspushurl or $httpsdnsname) or die "Girocco::Config invalid \$httpspushurl does not start with https://domainname"; (not $svn_log_window_size or $svn_log_window_size =~ /^[1-9][0-9]*$/) or die "Girocco::Config \$svn_log_window_size must be undef or numeric"; +(defined($max_file_size512) && !$max_file_size512) and $max_file_size512 = undef; +(not defined($max_file_size512) or $max_file_size512 =~ /^[1-9][0-9]*$/ && $max_file_size512 <= 2147483647) + or die "Girocco::Config \$max_file_size512 must be undef or a positive integer <= 2147483647"; (not $posix_sh_bin or $posix_sh_bin !~ /\s/) or die "Girocco::Config: \$posix_sh_bin must not contain any whitespace"; (not $perl_bin or $perl_bin !~ /\s/) or die "Girocco::Config: \$perl_bin must not contain any whitespace"; !$delay_gfi_redelta and $delay_gfi_redelta = undef; -- 2.11.4.GIT