Re: [Exim] Problem lookup mysql expansion

Góra strony
Delete this message
Reply to this message
Autor: Philip Hazel
Data:  
Dla: Steffen Herold
CC: exim-users
Temat: Re: [Exim] Problem lookup mysql expansion
On Fri, 7 Dec 2001, Steffen Herold wrote:

> routelist_item = gmx.de "${lookup mysql {SELECT mx FROM routing WHERE
> domain LIKE '${quote_mysql:$domain}'}{$value}}" byname
> after handling route_lists items, matched = 1
> original hostlist=${lookup mysql {SELECT mx FROM routing WHERE domain
> LIKE options=${quote_mysql:$domain}'}{$value}}" byname
> dom_router router: error for gmx.de
>
>     message: dom_router router: failed to expand "${lookup mysql {SELECT
> mx FROM routing WHERE domain LIKE ": missing } at end of string


Hmm. For some reason it seems to have broken the quoted item at the
single quote. Notice the curtailed string it claims to be expanding.

AARRGGHH!! It's a bug. Gosh, I wonder why nobody noticed that one
before? It's an elementary howler. I must have had a really bad day.

Below is a very hacky patch (untested) that might fix it. No time to do
a proper job ... I'm off for the weekend.

-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.



*** exim-3.33/src/routers/domainlist.c        Wed Aug 15 12:09:11 2001
--- routers/domainlist.c    Fri Dec  7 15:55:32 2001
***************
*** 215,222 ****


  if (*s == '\"' || *s == '\'')
    {
    *hostlist = ++s;
!   while (*s != 0 && *s != '\"' && *s != '\'') s++;
    }
  else
    {
--- 215,223 ----


  if (*s == '\"' || *s == '\'')
    {
+   int quote = *s;
    *hostlist = ++s;
!   while (*s != 0 && *s != quote) s++;
    }
  else
    {