From: Phil Pennock Date: Mon, 26 Jun 2017 22:39:29 +0000 (-0400) Subject: Repair manualroute transport name not-last option X-Git-Tag: exim-4_90_RC1~129 X-Git-Url: https://git.exim.org/users/heiko/exim.git/commitdiff_plain/833c70bc6dc0b85ea942bb127515d582a91a6ed7 Repair manualroute transport name not-last option Commit 55414b25b did const-ification surgery which removed the old "temporarily drop a NUL in here" anti-pattern, but one of the Ustrcmp->Ustrncmp conversions was missed, for transport-name comparison. As a result, since Exim 4.85, we've had an undocumented requirement-by-bug that the transport name be the last such option given. Restore old behaviour. Still missing a test-case to deter regression. --- diff --git a/doc/doc-docbook/spec.xfpt b/doc/doc-docbook/spec.xfpt index 4a239b73c..aab8c00d5 100644 --- a/doc/doc-docbook/spec.xfpt +++ b/doc/doc-docbook/spec.xfpt @@ -19469,6 +19469,10 @@ instead of TRY_AGAIN. That is why the default action is to try a DNS lookup first. Only if that gives a definite &"no such host"& is the local function called. +&*Compatibility*&: From Exim 4.85 until fixed for 4.90, there was an +inadvertent constraint that a transport name as an option had to be the last +option specified. + If no IP address for a host can be found, what happens is controlled by the diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index 336935329..03ec157ec 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -109,6 +109,9 @@ JH/15 Fix a crash in the smtp transport caused when two hosts in succession JH/16 Fix logging of delivery remote port, when specified by router, under callout/hold. +PP/06 Repair manualroute's ability to take options before hostnames. + Fixes bug 2140. + Exim version 4.89 ----------------- diff --git a/src/src/routers/manualroute.c b/src/src/routers/manualroute.c index 95c69328d..31185e160 100644 --- a/src/src/routers/manualroute.c +++ b/src/src/routers/manualroute.c @@ -333,7 +333,7 @@ while (*options != 0) { transport_instance *t; for (t = transports; t != NULL; t = t->next) - if (Ustrcmp(t->name, s) == 0) + if (Ustrncmp(t->name, s, n) == 0) { transport = t; individual_transport_set = TRUE;