Search queries may start with `-', confusing getopt(3) and
Getopt::Long; so we use `--' to separate the query string
from switches.
Consequences of this bug were limited to a single broken HTTP
response for the requesting client.
It didn't didn't allow writes to on-disk Xapian DBs, but caused
aborts on some searches or nonsensical results when using the
optional external xap_helper processes. There was no risk of
data leaks since the mset xap_helper endpoint only returns
document IDs (unsigned integers), and not terms.
The biggest danger from this bug was that it could run systems
out of space if they are configured to write out core dumps.
my ($self, $qry_str, $opt, $cb, @args) = @_;
if ($XHC) { # unconditionally retrieving pct + rank for now
xdb($self); # populate {nshards}
- my @margs = ($self->xh_args, xh_opt($self, $opt));
+ my @margs = ($self->xh_args, xh_opt($self, $opt), '--');
my $ret = eval {
my $rd = $XHC->mkreq(undef, 'mset', @margs, $qry_str);
PublicInbox::XhcMset->maybe_new($rd, $self, $cb, @args);