summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2016-10-10 14:20:30 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2016-10-10 14:29:28 +0100
commita4034eb84d56cfa1e8525bcf8b2f5af74e916ace (patch)
tree8863007a6eb570c408ebf6b4e0fb908db1f0b30d /src
parent633ffd487cc5a3ff851393b5a63e54275704e794 (diff)
Fix check for commandline macro definition
Without this, mailq (done by unpriv user) and daemon SIGHUP handling fail Broken-by: c0b9d3e87264
Diffstat (limited to 'src')
-rw-r--r--src/src/exim.c8
-rw-r--r--src/src/readconf.c2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/src/exim.c b/src/src/exim.c
index f05ba78a8..95f8cef3b 100644
--- a/src/src/exim.c
+++ b/src/src/exim.c
@@ -1347,12 +1347,12 @@ exit(EXIT_FAILURE);
/* Typically, Exim will drop privileges if macros are supplied. In some
cases, we want to not do so.
-Arguments: none (macros is a global)
+Arguments: opt_D_used - true if the commandline had a "-D" option
Returns: true if trusted, false otherwise
*/
static BOOL
-macros_trusted(void)
+macros_trusted(BOOL opt_D_used)
{
#ifdef WHITELIST_D_MACROS
macro_item *m;
@@ -1362,7 +1362,7 @@ size_t len;
BOOL prev_char_item, found;
#endif
-if (macros == NULL)
+if (!opt_D_used)
return TRUE;
#ifndef WHITELIST_D_MACROS
return FALSE;
@@ -3679,7 +3679,7 @@ configuration file changes and macro definitions haven't happened. */
if (( /* EITHER */
(!trusted_config || /* Config changed, or */
- !macros_trusted()) && /* impermissible macros and */
+ !macros_trusted(opt_D_used)) && /* impermissible macros and */
real_uid != root_uid && /* Not root, and */
!running_in_test_harness /* Not fudged */
) || /* OR */
diff --git a/src/src/readconf.c b/src/src/readconf.c
index 8425c0b37..edc09aa4e 100644
--- a/src/src/readconf.c
+++ b/src/src/readconf.c
@@ -784,7 +784,7 @@ for (;;)
replacing all occurrences of the macro. */
macro_found = FALSE;
- for (m = macros; m != NULL; m = m->next)
+ for (m = macros; m; m = m->next)
{
uschar *p, *pp;
uschar *t = s;