* [PATCH 2/2] config: ignore extindex entries with newlines in paths
2021-03-19 12:35 5% [PATCH 0/2] newline rejection for new stuff Eric Wong
@ 2021-03-19 12:35 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2021-03-19 12:35 UTC (permalink / raw)
To: meta
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;
^ permalink raw reply related [relevance 7%]
* [PATCH 0/2] newline rejection for new stuff
@ 2021-03-19 12:35 5% Eric Wong
2021-03-19 12:35 7% ` [PATCH 2/2] config: ignore extindex entries with newlines in paths Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2021-03-19 12:35 UTC (permalink / raw)
To: meta
Too many things get broken by allowing newlines in
path names and they're not worth fixing.
Eric Wong (2):
lei: disallow "\n" in local externals paths
config: ignore extindex entries with newlines in paths
lib/PublicInbox/Config.pm | 4 ++++
lib/PublicInbox/LeiExternal.pm | 5 +++++
lib/PublicInbox/LeiXSearch.pm | 2 ++
t/lei-externals.t | 8 ++++++--
t/lei-mirror.t | 5 +++++
t/lei.t | 12 ++++++++++++
6 files changed, 34 insertions(+), 2 deletions(-)
^ permalink raw reply [relevance 5%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2021-03-19 12:35 5% [PATCH 0/2] newline rejection for new stuff Eric Wong
2021-03-19 12:35 7% ` [PATCH 2/2] config: ignore extindex entries with newlines in paths Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).