]> Sergey Matveev's repositories - public-inbox.git/commitdiff
config: ignore extindex entries with newlines in paths
authorEric Wong <e@80x24.org>
Fri, 19 Mar 2021 12:35:57 +0000 (10:35 -0200)
committerEric Wong <e@80x24.org>
Fri, 19 Mar 2021 12:46:56 +0000 (12:46 +0000)
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'")
lib/PublicInbox/Config.pm

index 228de4ffe88f631fbccbaee594087a8680adcafd..26ac298eddb86f2256c4618d7abef920f7a4b95d 100644 (file)
@@ -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;