exiqgrep -r and -f options match all messages if no

Bug #1966923 reported by EOLE team
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
exim
Fix Released
Unknown
exim4 (Debian)
Fix Released
Unknown
exim4 (Ubuntu)
Fix Released
High
Sergio Durigan Junior
Jammy
Fix Released
High
Sergio Durigan Junior

Bug Description

On jammy, exiqgrep command shows syntax errors :

root@eolebase:~# exiqgrep
syntax error at /usr/sbin/exiqgrep line 56, near ") {"
syntax error at /usr/sbin/exiqgrep line 56, near ";}"
syntax error at /usr/sbin/exiqgrep line 57, near ";}"
syntax error at /usr/sbin/exiqgrep line 58, near ";}"
Execution of /usr/sbin/exiqgrep aborted due to compilation errors.

Version 4.95-4ubuntu1 uses patch 75_35-Exiqgrep-check-arg-parsing.-Bug-2821.patch to fix bug 2821.
This patch reflects upstream commit df618101a5ea15dc90c4a2968798ef2be9dba16f.
This upstream commit introduced a syntax error and have been fixed by a later commit 42ed39da5af85552a35626348bb77e5576e18aa4.

The patch 75_35-Exiqgrep-check-arg-parsing.-Bug-2821.patch should be amended to reflect this late fix in order to avoid syntax error with command exiqgrep.

Upstream bug : https://bugs.exim.org/show_bug.cgi?id=2821

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: exim4 4.95-4ubuntu1
ProcVersionSignature: Ubuntu 5.15.0-23.23-generic 5.15.27
Uname: Linux 5.15.0-23-generic x86_64
ApportVersion: 2.20.11-0ubuntu79
Architecture: amd64
CasperMD5CheckResult: pass
Date: Tue Mar 29 12:37:59 2022
InstallationDate: Installed on 2022-01-06 (81 days ago)
InstallationMedia: Ubuntu-Server 22.04 LTS "Jammy Jellyfish" - Alpha amd64 (20211229)
PackageArchitecture: all
SourcePackage: exim4
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
In , Fiedler-x (fiedler-x) wrote :

The original author of this comment is <email address hidden>.

If exiqgrep is invoked with -r or -f but without specifying a regular
expression - e.g. like
  exiqgrep -i -r | xargs exim -Mrm
all enqueued are deleted.

Help output states
  Selection criteria:
        -f <regexp> Match sender address sender (field is "< >" wrapped)
  ...
which indicates that <regexp> is a required criteria.

I presume the absence of <regexp> is treated as an empty regex, matching
everything - but I would consider this a bug, or at least unexpected behaviour.

Needless to say the fallout of discovering this was somewhat significant. User
error, yes, but not immediately obvious.

Revision history for this message
In , Fiedler-x (fiedler-x) wrote :

--- Bug imported by <email address hidden> 2021-10-20 14:53 UTC ---

This bug was previously known as _bug_ 2821 at https://bugs.exim.org/show_bug.cgi?id=2821

Unknown bug field "comment_sort_order" encountered while moving bug
   <comment_sort_order>oldest_to_newest</comment_sort_order>
Unknown platform unknown. Setting to default platform "".
The original reporter of this bug does not have
   an account here. Reassigning to the person who moved
   it here: <email address hidden>.
   Previous reporter was <email address hidden>.

Revision history for this message
In , Git-p (git-p) wrote :

Git commit: https://git.exim.org/exim.git/commitdiff/df618101a5ea15dc90c4a2968798ef2be9dba16f

commit df618101a5ea15dc90c4a2968798ef2be9dba16f
Author: Jeremy Harris <email address hidden>
AuthorDate: Mon Oct 18 11:01:47 2021 +0100
Commit: Jeremy Harris <email address hidden>
CommitDate: Mon Oct 18 11:01:47 2021 +0100

    Exiqgrep: check arg parsing. Bug 2821
---
 src/src/exiqgrep.src | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/src/exiqgrep.src b/src/src/exiqgrep.src
index c8762df..04602da 100644
--- a/src/src/exiqgrep.src
+++ b/src/src/exiqgrep.src
@@ -53,7 +53,7 @@ if ($ARGV[0] eq '--version') {
         exit 0;
 }

-getopts('hf:r:y:o:s:C:zxlibRcaG:',\%opt);
+if (!getopts('hf:r:y:o:s:C:zxlibRcaG:',\%opt) { &help; exit;}
 if ($ARGV[0]) { &help; exit;}
 if ($opt{h}) { &help; exit;}
 if ($opt{a}) { $eargs = '-bp'; }

Revision history for this message
In , Jgh146exb (jgh146exb) wrote :

Nobody commented

Revision history for this message
In , Eximusers-i (eximusers-i) wrote :

(In reply to Jeremy Harris from comment #4)
> Nobody commented

The applied patch introduces unbalanced parentheses.
syntax error at /usr/sbin/exiqgrep line 56, near ") {"
syntax error at /usr/sbin/exiqgrep line 56, near ";}"
syntax error at /usr/sbin/exiqgrep line 57, near ";}"
syntax error at /usr/sbin/exiqgrep line 58, near ";}"
Execution of /usr/sbin/exiqgrep aborted due to compilation errors.

cu Andreas

Revision history for this message
In , Jgh146exb (jgh146exb) wrote :

Oops. We had no regression-test case.

Revision history for this message
In , Git-p (git-p) wrote :

Git commit: https://git.exim.org/exim.git/commitdiff/42ed39da5af85552a35626348bb77e5576e18aa4

commit 42ed39da5af85552a35626348bb77e5576e18aa4
Author: Jeremy Harris <email address hidden>
AuthorDate: Sun Mar 6 14:25:13 2022 +0000
Commit: Jeremy Harris <email address hidden>
CommitDate: Sun Mar 6 16:45:03 2022 +0000

    utilities: fix exiqgrep perl syntax, add testcases. bug 2821

    broken-by: df618101a5
----
 doc/doc-docbook/spec.xfpt | 18 ++++++++++---
 src/src/exiqgrep.src | 9 ++++---
 test/README | 6 +++++
 test/runtest | 15 +++++++++--
 test/scripts/0000-Basic/0611 | 6 +++++
 test/stdout/0611 | 62 ++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 108 insertions(+), 8 deletions(-)

Revision history for this message
In , Jgh146exb (jgh146exb) wrote :

No further comments seen.

Revision history for this message
EOLE team (eole-team) wrote :
Changed in exim:
status: Unknown → Fix Released
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Thanks for the bug report, EOLE team.

I can confirm that the exiqgrep command indeed fails on Jammy. I will see about backporting the fix to the package.

BTW, this also affects Debian and there's a bug opened against the Debian exim4 package.

Changed in exim4 (Ubuntu):
status: New → Triaged
assignee: nobody → Sergio Durigan Junior (sergiodj)
importance: Undecided → High
tags: added: server-todo
Changed in exim4 (Debian):
status: Unknown → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package exim4 - 4.95-4ubuntu2

---------------
exim4 (4.95-4ubuntu2) jammy; urgency=medium

  * d/p/lp1966923-exiqgrep-syntax-error.patch: Fix exiqgrep syntax error,
    improve the validation of command-line options and add a new -E option
    to allow specifying a binary to be used. (LP: #1966923)

 -- Sergio Durigan Junior <email address hidden> Wed, 30 Mar 2022 16:45:24 -0400

Changed in exim4 (Ubuntu Jammy):
status: Triaged → Fix Released
EOLE team (eole-team)
tags: added: verification-done-jammy
Changed in exim4 (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.