aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorvsevolod <vsevolod@FreeBSD.org>2015-08-26 06:31:15 +0800
committervsevolod <vsevolod@FreeBSD.org>2015-08-26 06:31:15 +0800
commit98ddfe6834d54b685033dd431c470439ea7ae8bc (patch)
treee734065b28cc5e70e1e8ebe08d9d2d20491d7835 /mail
parent7e49bf74acaac19db715618e0ff0f829204f5e04 (diff)
downloadfreebsd-ports-gnome-98ddfe6834d54b685033dd431c470439ea7ae8bc.tar.gz
freebsd-ports-gnome-98ddfe6834d54b685033dd431c470439ea7ae8bc.tar.zst
freebsd-ports-gnome-98ddfe6834d54b685033dd431c470439ea7ae8bc.zip
Import the patch to fix segfault during delivery from exim git [1].
[1]: https://bugs.exim.org/show_bug.cgi?id=1671
Diffstat (limited to 'mail')
-rw-r--r--mail/exim/Makefile1
-rw-r--r--mail/exim/files/patch-post-transport-crash82
2 files changed, 83 insertions, 0 deletions
diff --git a/mail/exim/Makefile b/mail/exim/Makefile
index 2af62dc4335c..557c9904c6b7 100644
--- a/mail/exim/Makefile
+++ b/mail/exim/Makefile
@@ -3,6 +3,7 @@
PORTNAME= exim
PORTVERSION?= ${EXIM_VERSION}
+PORTREVISION= 1
CATEGORIES= mail ipv6
MASTER_SITES= EXIM/exim4/:exim
DISTNAME= ${PORTNAME}-${EXIM_VERSION}
diff --git a/mail/exim/files/patch-post-transport-crash b/mail/exim/files/patch-post-transport-crash
new file mode 100644
index 000000000000..6bb69b11925c
--- /dev/null
+++ b/mail/exim/files/patch-post-transport-crash
@@ -0,0 +1,82 @@
+diff --git src/deliver.c.orig src/src/deliver.c
+index 0e7cea3..b5aa9b9 100644
+--- src/deliver.c.orig
++++ src/deliver.c
+@@ -9,6 +9,7 @@
+
+
+ #include "exim.h"
++#include <assert.h>
+
+
+ /* Data block for keeping track of subprocesses for parallel remote
+@@ -7914,17 +7915,36 @@ if (!regex_IGNOREQUOTA) regex_IGNOREQUOTA =
+ uschar *
+ deliver_get_sender_address (uschar * id)
+ {
++int rc;
++uschar * new_sender_address,
++ * save_sender_address;
++
+ if (!spool_open_datafile(id))
+ return NULL;
+
++/* Save and restore the global sender_address. I'm not sure if we should
++not save/restore all the other global variables too, because
++spool_read_header() may change all of them. But OTOH, when this
++deliver_get_sender_address() gets called, the current message is done
++already and nobody needs the globals anymore. (HS12, 2015-08-21) */
++
+ sprintf(CS spoolname, "%s-H", id);
+-if (spool_read_header(spoolname, TRUE, TRUE) != spool_read_OK)
++save_sender_address = sender_address;
++
++rc = spool_read_header(spoolname, TRUE, TRUE);
++
++new_sender_address = sender_address;
++sender_address = save_sender_address;
++
++if (rc != spool_read_OK)
+ return NULL;
+
++assert(new_sender_address);
++
+ (void)close(deliver_datafile);
+ deliver_datafile = -1;
+
+-return sender_address;
++return new_sender_address;
+ }
+
+ /* vi: aw ai sw=2
+diff --git src/transports/smtp.c.orig src/transports/smtp.c
+index 609dba3..c93f2ef 100644
+--- src/transports/smtp.c.orig
++++ src/transports/smtp.c
+@@ -1274,14 +1274,19 @@ we will veto this new message. */
+ static BOOL
+ smtp_are_same_identities(uschar * message_id, smtp_compare_t * s_compare)
+ {
+-uschar * save_sender_address = sender_address;
+-uschar * current_local_identity =
++
++uschar * message_local_identity,
++ * current_local_identity,
++ * new_sender_address;
++
++current_local_identity =
+ smtp_local_identity(s_compare->current_sender_address, s_compare->tblock);
+-uschar * new_sender_address = deliver_get_sender_address(message_id);
+-uschar * message_local_identity =
+- smtp_local_identity(new_sender_address, s_compare->tblock);
+
+-sender_address = save_sender_address;
++if (!(new_sender_address = deliver_get_sender_address(message_id)))
++ return 0;
++
++message_local_identity =
++ smtp_local_identity(new_sender_address, s_compare->tblock);
+
+ return Ustrcmp(current_local_identity, message_local_identity) == 0;
+ }
+