From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 277BF1F9FF for ; Fri, 19 Mar 2021 12:35:58 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/2] config: ignore extindex entries with newlines in paths Date: Fri, 19 Mar 2021 10:35:57 -0200 Message-Id: <20210319123557.19068-3-e@80x24.org> In-Reply-To: <20210319123557.19068-1-e@80x24.org> References: <20210319123557.19068-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/PublicInbox/Config.pm b/lib/PublicInbox/Config.pm index 1037c884..770d9256 100644 --- a/lib/PublicInbox/Config.pm +++ b/lib/PublicInbox/Config.pm @@ -514,6 +514,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;