commit:     c87c9d43f1e04c6f13067946c6cdb868667e4c2f
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sun Oct  8 09:02:10 2017 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sun Oct  8 09:24:54 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c87c9d43

mail-mta/exim: add patch from upstream for crash in address expando

Package-Manager: Portage-2.3.8, Repoman-2.3.3

 .../{exim-4.89-r2.ebuild => exim-4.89-r3.ebuild}   |  1 +
 .../files/exim-4.89-address-expando-crash.patch    | 85 ++++++++++++++++++++++
 2 files changed, 86 insertions(+)

diff --git a/mail-mta/exim/exim-4.89-r2.ebuild 
b/mail-mta/exim/exim-4.89-r3.ebuild
similarity index 99%
rename from mail-mta/exim/exim-4.89-r2.ebuild
rename to mail-mta/exim/exim-4.89-r3.ebuild
index 1f2228c4f0c..654084176e6 100644
--- a/mail-mta/exim/exim-4.89-r2.ebuild
+++ b/mail-mta/exim/exim-4.89-r3.ebuild
@@ -96,6 +96,7 @@ src_prepare() {
        epatch "${FILESDIR}"/exim-4.76-crosscompile.patch # 266591
        epatch "${FILESDIR}"/exim-4.89-CVE-2017-1000369.patch # 622212
        epatch "${FILESDIR}"/${P}-transport-crash.patch # from git/in next 
release
+       epatch "${FILESDIR}"/${P}-address-expando-crash.patch # from git/in 
next release
 
        if use maildir ; then
                epatch "${FILESDIR}"/exim-4.20-maildir.patch

diff --git a/mail-mta/exim/files/exim-4.89-address-expando-crash.patch 
b/mail-mta/exim/files/exim-4.89-address-expando-crash.patch
new file mode 100644
index 00000000000..2a868490a42
--- /dev/null
+++ b/mail-mta/exim/files/exim-4.89-address-expando-crash.patch
@@ -0,0 +1,85 @@
+ignoring parts which don't match due to repo reorg post release
+
+From 1b7cf216d933b395dee691f05becca4dd44b26f7 Mon Sep 17 00:00:00 2001
+From: "Heiko Schlittermann (HS12-RIPE)" <[email protected]>
+Date: Wed, 4 Oct 2017 22:25:45 +0200
+Subject: [PATCH] Check for proper output separator in expanding
+ ${addresses:STRING}    (Closes 2171)
+
+Better yet would be to force setting the output separator literally,
+and not after expansion of the STRING. But this would be an incompatible
+change.
+---
+ doc/doc-docbook/spec.xfpt    | 10 +++++++++-
+ src/src/expand.c             |  8 +++++++-
+ test/scripts/0000-Basic/0002 |  1 +
+ test/stdout/0002             |  1 +
+ 4 files changed, 18 insertions(+), 2 deletions(-)
+
+ignored - diff --git a/doc/doc-docbook/spec.xfpt b/doc/doc-docbook/spec.xfpt
+ignored - index 4a8e1d0..c140945 100644
+ignored - --- a/doc/doc-docbook/spec.xfpt
+ignored - +++ b/doc/doc-docbook/spec.xfpt
+ignored - @@ -10118,7 +10118,15 @@ character. For example:
+ignored -  .code
+ignored -  ${addresses:>& Chief <[email protected]>, [email protected] (dogsbody)}
+ignored -  .endd
+ignored - -expands to &`[email protected]&&[email protected]`&. Compare the 
&*address*& (singular)
+ignored - +expands to &`[email protected]&&[email protected]`&. The string is expanded
+ignored - +first, so if the expanded string starts with >, it may change the 
output
+ignored - +separator unintentionally. This can be avoided by setting the output
+ignored - +separator explicitly:
+ignored - +.code
+ignored - +${addresses:>:$h_from:}
+ignored - +.endd
+ignored - +
+ignored - +Compare the &*address*& (singular)
+ignored -  expansion item, which extracts the working address from a single 
RFC2822
+ignored -  address. See the &*filter*&, &*map*&, and &*reduce*& items for ways 
of
+ignored -  processing lists.
+diff --git a/src/src/expand.c b/src/src/expand.c
+index 353b8ea..67b3d65 100644
+--- a/src/src/expand.c
++++ b/src/src/expand.c
+@@ -6797,7 +6797,13 @@ while (*s != 0)
+         int start, end, domain;  /* Not really used */
+ 
+         while (isspace(*sub)) sub++;
+-        if (*sub == '>') { *outsep = *++sub; ++sub; }
++        if (*sub == '>')
++          if (*outsep = *++sub) ++sub;
++          else {
++            expand_string_message = string_sprintf("output separator "
++              "missing in expanding ${addresses:%s}", --sub);
++            goto EXPAND_FAILED;
++          }
+         parse_allow_group = TRUE;
+ 
+         for (;;)
+ignored - diff --git a/test/scripts/0000-Basic/0002 
b/test/scripts/0000-Basic/0002
+ignored - index cb0bb18..dd9cea2 100644
+ignored - --- a/test/scripts/0000-Basic/0002
+ignored - +++ b/test/scripts/0000-Basic/0002
+ignored - @@ -133,6 +133,7 @@ addresses: ${addresses:>+ Exim Person 
<[email protected]> (that's me),\
+ignored -  addresses: ${addresses:Exim Person <[email protected]> (that's 
me), \
+ignored -             xyz@abc, nullgroupname:;, group: p@q, r@s; }
+ignored -  addresses: ${addresses:[email protected] <[email protected]>}
+ignored - +addresses: ${addresses:>}
+ignored -  
+ignored -  escape:     ${escape:B7·F2ò}
+ignored -  excape8bit: ${escape8bit:undisturbed 
text\ttab\nnewline\ttab\\backslash \176tilde\177DEL\200\x81.}
+ignored - diff --git a/test/stdout/0002 b/test/stdout/0002
+ignored - index 5593f06..1422289 100644
+ignored - --- a/test/stdout/0002
+ignored - +++ b/test/stdout/0002
+ignored - @@ -123,6 +123,7 @@
+ignored -  > addresses: [email protected]+xyz@abc
+ignored -  > addresses: [email protected]:xyz@abc:p@q:r@s
+ignored -  > addresses: 
+ignored - +> Failed: output separator missing in expanding ${addresses:>}
+ignored -  > 
+ignored -  > escape:     B7\267F2\362
+ignored -  > excape8bit: undisturbed text      tab
+-- 
+1.9.1
+

Reply via email to