summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2021-05-15 00:00:06 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2021-06-28 00:30:02 +0100
commitfd5ad03aa7da47965ce3e23294661c8f3c602d33 (patch)
treeb637e93a7cc1788dc3ba5314bd5ac57996b9be38 /src
parent44be14a30870bb141b1cdb6ea31d8e8a50c90329 (diff)
copy transport struct for modifying for **bypassed** postprocess
Diffstat (limited to 'src')
-rw-r--r--src/src/deliver.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/src/deliver.c b/src/src/deliver.c
index f9f674643..e931d22e9 100644
--- a/src/src/deliver.c
+++ b/src/src/deliver.c
@@ -6554,14 +6554,19 @@ while (addr_new) /* Loop until all addresses dealt with */
/* Treat /dev/null as a special case and abandon the delivery. This
avoids having to specify a uid on the transport just for this case.
- Arrange for the transport name to be logged as "**bypassed**". */
+ Arrange for the transport name to be logged as "**bypassed**".
+ Copy the transport for this fairly unusual case rather than having
+ to make all transports mutable. */
if (Ustrcmp(addr->address, "/dev/null") == 0)
{
- uschar *save = addr->transport->name;
- addr->transport->name = US"**bypassed**";
+ transport_instance * save_t = addr->transport;
+ transport_instance * t = store_get(sizeof(*t), is_tainted(save_t));
+ *t = *save_t;
+ t->name = US"**bypassed**";
+ addr->transport = t;
(void)post_process_one(addr, OK, LOG_MAIN, EXIM_DTYPE_TRANSPORT, '=');
- addr->transport->name = save;
+ addr->transport= save_t;
continue; /* with the next new address */
}