git://git.exim.org
/
exim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0971ec0
)
fix queue_name tracking across exec
author
Jeremy Harris
<jgh146exb@wizmail.org>
Mon, 23 May 2016 16:21:29 +0000
(17:21 +0100)
committer
Jeremy Harris
<jgh146exb@wizmail.org>
Mon, 23 May 2016 16:21:29 +0000
(17:21 +0100)
src/src/child.c
patch
|
blob
|
history
src/src/daemon.c
patch
|
blob
|
history
src/src/exim.c
patch
|
blob
|
history
src/src/smtp_in.c
patch
|
blob
|
history
src/src/transport.c
patch
|
blob
|
history
diff --git
a/src/src/child.c
b/src/src/child.c
index 36d192e9a1ae95a8401cd48a3142102ffe17fc10..7f5b909299dd792dd723ef76141865130e773b6d 100644
(file)
--- a/
src/src/child.c
+++ b/
src/src/child.c
@@
-72,9
+72,9
@@
child_exec_exim(int exec_type, BOOL kill_v, int *pcount, BOOL minimal,
{
int first_special = -1;
int n = 0;
{
int first_special = -1;
int n = 0;
-int extra =
(pcount != NULL)
? *pcount : 0;
+int extra =
pcount
? *pcount : 0;
uschar **argv =
uschar **argv =
- store_get((extra + acount + MAX_CLMACROS + 1
6
) * sizeof(char *));
+ store_get((extra + acount + MAX_CLMACROS + 1
8
) * sizeof(char *));
/* In all case, the list starts out with the path, any macros, and a changed
config file. */
/* In all case, the list starts out with the path, any macros, and a changed
config file. */
@@
-113,6
+113,11
@@
if (!minimal)
if (synchronous_delivery) argv[n++] = US"-odi";
if (connection_max_messages >= 0)
argv[n++] = string_sprintf("-oB%d", connection_max_messages);
if (synchronous_delivery) argv[n++] = US"-odi";
if (connection_max_messages >= 0)
argv[n++] = string_sprintf("-oB%d", connection_max_messages);
+ if (*queue_name)
+ {
+ argv[n++] = US"-MCG";
+ argv[n++] = queue_name;
+ }
}
/* Now add in any others that are in the call. Remember which they were,
}
/* Now add in any others that are in the call. Remember which they were,
diff --git
a/src/src/daemon.c
b/src/src/daemon.c
index 3634ad448237df378740c0d3f838aff3f74b79de..a778c489df7bf6d4f2e28df6c997d91323286225 100644
(file)
--- a/
src/src/daemon.c
+++ b/
src/src/daemon.c
@@
-651,8
+651,8
@@
if (pid == 0)
if (geteuid() != root_uid && !deliver_drop_privilege)
{
signal(SIGALRM, SIG_DFL);
if (geteuid() != root_uid && !deliver_drop_privilege)
{
signal(SIGALRM, SIG_DFL);
- (void)child_exec_exim(CEE_EXEC_PANIC, FALSE, NULL, FALSE,
2, US"-Mc",
- message_id);
+ (void)child_exec_exim(CEE_EXEC_PANIC, FALSE, NULL, FALSE,
+
2, US"-Mc",
message_id);
/* Control does not return here. */
}
/* Control does not return here. */
}
@@
-1615,12
+1615,11
@@
else if (daemon_listen)
int i, j;
int smtp_ports = 0;
int smtps_ports = 0;
int i, j;
int smtp_ports = 0;
int smtps_ports = 0;
- ip_address_item *ipa;
- uschar *p = big_buffer;
- uschar *qinfo = (queue_interval > 0)?
- string_sprintf("-q%s", readconf_printtime(queue_interval))
- :
- US"no queue runs";
+ ip_address_item * ipa;
+ uschar * p = big_buffer;
+ uschar * qinfo = queue_interval > 0
+ ? string_sprintf("-q%s", readconf_printtime(queue_interval))
+ : US"no queue runs";
/* Build a list of listening addresses in big_buffer, but limit it to 10
items. The style is for backwards compatibility.
/* Build a list of listening addresses in big_buffer, but limit it to 10
items. The style is for backwards compatibility.
@@
-1631,30
+1630,30
@@
else if (daemon_listen)
for (j = 0; j < 2; j++)
{
for (j = 0; j < 2; j++)
{
- for (i = 0, ipa = addresses; i < 10 && ipa
!= NULL
; i++, ipa = ipa->next)
+ for (i = 0, ipa = addresses; i < 10 && ipa; i++, ipa = ipa->next)
{
/* First time round, look for SMTP ports; second time round, look for
SMTPS ports. For the first one of each, insert leading text. */
if (host_is_tls_on_connect_port(ipa->port) == (j > 0))
{
{
/* First time round, look for SMTP ports; second time round, look for
SMTPS ports. For the first one of each, insert leading text. */
if (host_is_tls_on_connect_port(ipa->port) == (j > 0))
{
-
if (j == 0)
-
{
-
if (smtp_ports++ == 0)
+ if (j == 0)
+ {
+ if (smtp_ports++ == 0)
{
memcpy(p, "SMTP on", 8);
p += 7;
}
{
memcpy(p, "SMTP on", 8);
p += 7;
}
-
}
-
else
-
{
-
if (smtps_ports++ == 0)
+ }
+ else
+ {
+ if (smtps_ports++ == 0)
{
(void)sprintf(CS p, "%sSMTPS on",
{
(void)sprintf(CS p, "%sSMTPS on",
-
(smtp_ports == 0)? "":
" and for ");
- while (*p
!= 0
) p++;
+
smtp_ports == 0 ? "" :
" and for ");
+ while (*p) p++;
}
}
-
}
+ }
/* Now the information about the port (and sometimes interface) */
/* Now the information about the port (and sometimes interface) */
@@
-1679,7
+1678,7
@@
else if (daemon_listen)
}
}
}
}
- if (ipa
!= NULL
)
+ if (ipa)
{
memcpy(p, " ...", 5);
p += 4;
{
memcpy(p, " ...", 5);
p += 4;
@@
-1835,24
+1834,22
@@
for (;;)
if (deliver_force_thaw) *p++ = 'f';
if (queue_run_local) *p++ = 'l';
*p = 0;
if (deliver_force_thaw) *p++ = 'f';
if (queue_run_local) *p++ = 'l';
*p = 0;
- if (queue_name)
- extra[0] = string_sprintf("%sG%s", opt, queue_name);
- else
- extra[0] = opt;
+ extra[0] = queue_name
+ ? string_sprintf("%sG%s", opt, queue_name) : opt;
/* If -R or -S were on the original command line, ensure they get
passed on. */
/* If -R or -S were on the original command line, ensure they get
passed on. */
- if (deliver_selectstring
!= NULL
)
+ if (deliver_selectstring)
{
{
- extra[extracount++] = deliver_selectstring_regex? US"-Rr" : US"-R";
+ extra[extracount++] = deliver_selectstring_regex
? US"-Rr" : US"-R";
extra[extracount++] = deliver_selectstring;
}
extra[extracount++] = deliver_selectstring;
}
- if (deliver_selectstring_sender
!= NULL
)
+ if (deliver_selectstring_sender)
{
{
- extra[extracount++] = deliver_selectstring_sender_regex
?
- US"-Sr" : US"-S";
+ extra[extracount++] = deliver_selectstring_sender_regex
+
?
US"-Sr" : US"-S";
extra[extracount++] = deliver_selectstring_sender;
}
extra[extracount++] = deliver_selectstring_sender;
}
diff --git
a/src/src/exim.c
b/src/src/exim.c
index ea0d0b7900430964adacb9f814e0c263b2cfd6ae..f2ec04f0475291a91d01ebca285db2ed63cdb76f 100644
(file)
--- a/
src/src/exim.c
+++ b/
src/src/exim.c
@@
-2723,7
+2723,7
@@
for (i = 1; i < argc; i++)
break;
}
break;
}
- /* -MCG: set the queue name, to a non-default value
+ /* -MCG: set the queue name, to a non-default value
*/
else if (Ustrcmp(argrest, "CG") == 0)
{
else if (Ustrcmp(argrest, "CG") == 0)
{
@@
-5726,8
+5726,8
@@
while (more)
if (geteuid() != root_uid && !deliver_drop_privilege && !unprivileged)
{
if (geteuid() != root_uid && !deliver_drop_privilege && !unprivileged)
{
- (void)child_exec_exim(CEE_EXEC_EXIT, FALSE, NULL, FALSE,
2, US"-Mc",
- message_id);
+ (void)child_exec_exim(CEE_EXEC_EXIT, FALSE, NULL, FALSE,
+
2, US"-Mc",
message_id);
/* Control does not return here. */
}
/* Control does not return here. */
}
diff --git
a/src/src/smtp_in.c
b/src/src/smtp_in.c
index 1398e620b6e7bc2e9116da8cc5c5a7c9673627b5..565f4b32ed97ca34e01227b86ad9d56ac3f2e98a 100644
(file)
--- a/
src/src/smtp_in.c
+++ b/
src/src/smtp_in.c
@@
-4947,8
+4947,10
@@
while (done <= 0)
break;
}
etrn_command = US"exim -R";
break;
}
etrn_command = US"exim -R";
- argv = CUSS child_exec_exim(CEE_RETURN_ARGV, TRUE, NULL, TRUE, 2, US"-R",
- smtp_cmd_data);
+ argv = CUSS child_exec_exim(CEE_RETURN_ARGV, TRUE, NULL, TRUE,
+ *queue_name ? 4 : 2,
+ US"-R", smtp_cmd_data,
+ US"-MCG", queue_name);
}
/* If we are host-testing, don't actually do anything. */
}
/* If we are host-testing, don't actually do anything. */
diff --git
a/src/src/transport.c
b/src/src/transport.c
index af453b04a1af22cd79c966bae798212e65fdee6a..e1e6dcebf5fc10c43ff1ba51aef18a14e1a685a1 100644
(file)
--- a/
src/src/transport.c
+++ b/
src/src/transport.c
@@
-1923,12
+1923,6
@@
if ((pid = fork()) == 0)
argv = CUSS child_exec_exim(CEE_RETURN_ARGV, TRUE, &i, FALSE, 0);
argv = CUSS child_exec_exim(CEE_RETURN_ARGV, TRUE, &i, FALSE, 0);
- if (*queue_name)
- {
- argv[i++] = US"-MCG";
- argv[i++] = queue_name;
- }
-
if (smtp_use_dsn) argv[i++] = US"-MCD";
if (smtp_authenticated) argv[i++] = US"-MCA";
if (smtp_use_dsn) argv[i++] = US"-MCD";
if (smtp_authenticated) argv[i++] = US"-MCA";