From d87dd0e6795870439422ee4f0039d0d76d1974b3 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 17 Jul 2020 06:07:10 +0000 Subject: config: reject `\n' in `inboxdir' "\n" and other characters requiring quoting and/or escaping in in $GIT_DIR/objects/info/alternates was not supported in git 2.11 and earlier; nor does it seem supported at all in libgit2. This will allow us to support sharing git-cat-file or similar endpoints across multiple inboxes via alternates. This breaks an existing use case for anybody wacky enough to put `\n' in the `inboxdir' pathname; but I doubt this affects anybody. --- script/public-inbox-init | 1 + 1 file changed, 1 insertion(+) (limited to 'script') diff --git a/script/public-inbox-init b/script/public-inbox-init index c7f3da6f..951338af 100755 --- a/script/public-inbox-init +++ b/script/public-inbox-init @@ -115,6 +115,7 @@ my $pfx = "publicinbox.$name"; my @x = (qw/git config/, "--file=$pi_config_tmp"); $inboxdir = abs_path($inboxdir); +die "`\\n' not allowed in `$inboxdir'\n" if $inboxdir =~ /\n/s; if (-f "$inboxdir/inbox.lock") { if (!defined $version) { $version = 2; -- cgit v1.2.3-24-ge0c7