From df618101a5ea15dc90c4a2968798ef2be9dba16f Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Mon, 18 Oct 2021 11:01:47 +0100 Subject: [PATCH] Exiqgrep: check arg parsing. Bug 2821 --- src/exiqgrep.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/exiqgrep.src b/src/exiqgrep.src index c8762df47..04602da68 100644 --- a/src/exiqgrep.src +++ b/src/exiqgrep.src @@ -53,12 +53,14 @@ if ($ARGV[0] eq '--version') { exit 0; } -getopts('hf:r:y:o:s:C:zxlibRcaG:',\%opt); -if ($ARGV[0]) { &help; exit;} -if ($opt{h}) { &help; exit;} +if (!getopts('hf:r:y:o:s:C:zxlibRcaG:E:',\%opt)) { &help; exit; } +if ($opt{h}) { &help; exit; } +if ($ARGV[0] || !($opt{f} || $opt{r} || $opt{s} || $opt{y} || $opt{o} || $opt{z} || $opt{x} || $opt{c})) + { &help; exit(1); } if ($opt{a}) { $eargs = '-bp'; } if ($opt{C} && -e $opt{C} && -f $opt{C} && -R $opt{C}) { $eargs .= ' -C '.$opt{C}; } if ($opt{G}) { $eargs .= ' -qG'.$opt{G}; } +if ($opt{E}) { $exim = $opt{E}; } # Read message queue output into hash &collect(); @@ -75,6 +77,7 @@ Exim message queue display utility. -h This help message. -C Specify which exim.conf to use. + -E Specify exim binary to use. Selection criteria: -f Match sender address sender (field is "< >" wrapped) -- 2.34.1