From: Eric Wong Date: Fri, 19 Mar 2021 12:35:57 +0000 (-0200) Subject: config: ignore extindex entries with newlines in paths X-Git-Tag: v1.7.0~952 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=1d1498c6c5d42733bd63bd109076882c5d6e8a2a;p=public-inbox.git config: ignore extindex entries with newlines in paths git 2.11 and earlier could not handle git directories with newlines in them, nor does libgit2 support them. Followup-to: d87dd0e679587043 ("config: reject `\n' in `inboxdir'") --- diff --git a/lib/PublicInbox/Config.pm b/lib/PublicInbox/Config.pm index 228de4ff..26ac298e 100644 --- a/lib/PublicInbox/Config.pm +++ b/lib/PublicInbox/Config.pm @@ -510,6 +510,10 @@ sub _fill_ei ($$) { my $pfx = "extindex.$name"; my $d = $self->{"$pfx.topdir"} // return; -d $d or return; + if (index($d, "\n") >= 0) { + warn "E: `$d' must not contain `\\n'\n"; + return; + } my $es = PublicInbox::ExtSearch->new($d); for my $k (qw(indexlevel indexsequentialshard)) { my $v = _one_val($self, $pfx, $k) // next;