[exim-cvs] copy transport struct for modifying for **bypasse…

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Exim Git Commits Mailing List
Date:  
À: exim-cvs
Sujet: [exim-cvs] copy transport struct for modifying for **bypassed** postprocess
Gitweb: https://git.exim.org/exim.git/commitdiff/fd5ad03aa7da47965ce3e23294661c8f3c602d33
Commit:     fd5ad03aa7da47965ce3e23294661c8f3c602d33
Parent:     44be14a30870bb141b1cdb6ea31d8e8a50c90329
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Sat May 15 00:00:06 2021 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Mon Jun 28 00:30:02 2021 +0100


    copy transport struct for modifying for **bypassed** postprocess
---
 src/src/deliver.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)


diff --git a/src/src/deliver.c b/src/src/deliver.c
index f9f6746..e931d22 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 */
         }