git.git commit
f4aa8c8b (fetch/clone: detect dubious ownership
of local repositories, 2024-04-10) has proven to be overly aggressive
and breaks existing setups where git-http-backend is serving
read-only repositories from reasonably trusted sources and not
running hooks of any sort.
Just mark everything as safe since our public-facing instances
have always assumed writes to all git repos come from a
different user than whatever user -netd/-httpd runs as.
$env{PATH_TRANSLATED} = "$git->{git_dir}/$path";
my $rdr = input_prepare($env) or return r(500);
$rdr->{quiet} = 1;
- my $qsp = PublicInbox::Qspawn->new([qw(git http-backend)], \%env, $rdr);
+ my $cmd = $git->cmd('http-backend');
+ splice @$cmd, 1, 0, '-c', 'safe.directory=*';
+ my $qsp = PublicInbox::Qspawn->new($cmd, \%env, $rdr);
$qsp->psgi_yield($env, $limiter, \&ghb_parse_hdr, $env, $git, $path);
}