From: Jeremy Harris Date: Fri, 10 May 2019 14:35:58 +0000 (+0100) Subject: Fix listing a named queue by a non-admin user. Bug 2398 X-Git-Url: https://git.exim.org/exim.git/commitdiff_plain/fbf6767e15a0367d3f3a8462bc3a87d96bf7b71a Fix listing a named queue by a non-admin user. Bug 2398 (cherry picked from commit e5903596a0) (cherry picked from commit affc23f0d27bfbca773094146d7e62872ed2895b) (cherry picked from commit 772e1c684e79465df71157cdccc57739bb841cae) --- diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index 00795fb83..a026e720b 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -68,6 +68,10 @@ JH/16 GnuTLS: rework ciphersuite strings under recent library versions. Thanks JH/18 GnuTLS: fix $tls_out_ocsp under hosts_request_ocsp. Previously the verification result was not updated unless hosts_require_ocsp applied. +JH/19 Bug 2398: fix listing of a named-queue. Previously, even with the option + queue_list_requires_admin set to false, non-admin users were denied the + facility. + Exim version 4.92 ----------------- diff --git a/src/src/exim.c b/src/src/exim.c index f6f15f449..83b5ef51f 100644 --- a/src/src/exim.c +++ b/src/src/exim.c @@ -3187,22 +3187,23 @@ for (i = 1; i < argc; i++) /* -q[f][f][l][G]: Run the queue, optionally forced, optionally local only, optionally named, optionally starting from a given message id. */ - if (*argrest == 0 && - (i + 1 >= argc || argv[i+1][0] == '-' || mac_ismsgid(argv[i+1]))) - { - queue_interval = 0; - if (i+1 < argc && mac_ismsgid(argv[i+1])) - start_queue_run_id = argv[++i]; - if (i+1 < argc && mac_ismsgid(argv[i+1])) - stop_queue_run_id = argv[++i]; - } + if (!(list_queue || count_queue)) + if (*argrest == 0 + && (i + 1 >= argc || argv[i+1][0] == '-' || mac_ismsgid(argv[i+1]))) + { + queue_interval = 0; + if (i+1 < argc && mac_ismsgid(argv[i+1])) + start_queue_run_id = argv[++i]; + if (i+1 < argc && mac_ismsgid(argv[i+1])) + stop_queue_run_id = argv[++i]; + } /* -q[f][f][l][G/]: Run the queue at regular intervals, optionally forced, optionally local only, optionally named. */ - else if ((queue_interval = readconf_readtime(*argrest ? argrest : argv[++i], - 0, FALSE)) <= 0) - exim_fail("exim: bad time value %s: abandoned\n", argv[i]); + else if ((queue_interval = readconf_readtime(*argrest ? argrest : argv[++i], + 0, FALSE)) <= 0) + exim_fail("exim: bad time value %s: abandoned\n", argv[i]); break;