summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2019-05-10 15:18:56 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2019-05-10 15:33:49 +0100
commite5903596a0f6b078f5854ca591963e21c7f7328a (patch)
tree2a17fa1dc8bc989912a49b5aac432d2344580f39 /src
parent345f272404cb1c454b7602214c76fd0ebf04d66e (diff)
Fix listing a named queue by a non-admin user. Bug 2398
Diffstat (limited to 'src')
-rw-r--r--src/src/exim.c25
-rw-r--r--src/src/queue.c7
2 files changed, 17 insertions, 15 deletions
diff --git a/src/src/exim.c b/src/src/exim.c
index 1952d91a4..1aa32b269 100644
--- a/src/src/exim.c
+++ b/src/src/exim.c
@@ -3193,22 +3193,23 @@ for (i = 1; i < argc; i++)
/* -q[f][f][l][G<name>]: 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<name>/]<n>: 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;
diff --git a/src/src/queue.c b/src/src/queue.c
index 617c267a3..89ac87f94 100644
--- a/src/src/queue.c
+++ b/src/src/queue.c
@@ -778,11 +778,12 @@ Argument: points to the tree node
Returns: nothing
*/
-static void queue_list_extras(tree_node *p)
+static void
+queue_list_extras(tree_node *p)
{
-if (p->left != NULL) queue_list_extras(p->left);
+if (p->left) queue_list_extras(p->left);
if (!p->data.val) printf(" +D %s\n", p->name);
-if (p->right != NULL) queue_list_extras(p->right);
+if (p->right) queue_list_extras(p->right);
}