[exim] Re: Problems with ${if ..} conditions

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: Nikolaus Rath
Data:  
Para: exim-users
Assunto: [exim] Re: Problems with ${if ..} conditions
Nikolaus Rath <Nikolaus@???> wrote:
> # ./exim -be '${if eq {a}{b} {true} {false}}'
> Failed: missing } at end of "eq" condition



I played around with gdb and got the following result:

---working binary----
Breakpoint 2, eval_condition (s=0xbffffe69 "{a}{b} {true} {false}}", yield=0xbfffe5dc) at expand.c:1772
1772        sub[i] = expand_string_internal(s+1, TRUE, &s, yield == NULL);
(gdb) p s
$4 = (uschar *) 0xbffffe69 "{a}{b} {true} {false}}"
(gdb) s
expand_string_internal (string=0xbffffe6a "a}{b} {true} {false}}", ket_ends=1, 
    left=0xbfffd960, skipping=0) at expand.c:2603
[...]
2659        continue;
(gdb) n
2614    while (*s != 0)
(gdb) p s
$7 = (uschar *) 0xbffffe6b "}{b} {true} {false}}"
[...]
4464    return yield;
(gdb) p yield
$8 = (uschar *) 0x81189b8 "a"
(gdb) n
4488    }
(gdb) n
eval_condition (s=0xbffffe6b "}{b} {true} {false}}", yield=0xbfffe5dc)
    at expand.c:1773
1773        if (sub[i] == NULL) return NULL;
(gdb) n
1774        if (*s++ != '}') goto COND_FAILED_CURLY_END;
(gdb) p *s
$9 = 125 '}'



---broken binary----
Breakpoint 2, eval_condition (s=0xbfbffc85 "{a}{b} {true} {false}}", yield=0xbfbfec88) at expand.c:1772
1772        sub[i] = expand_string_internal(s+1, TRUE, &s, yield == NULL);
(gdb) p s
$12 = (uschar *) 0xbfbffc85 "{a}{b} {true} {false}}"
(gdb) s
expand_string_internal (
    string=0x7374706d <Error reading address 0x7374706d: Bad address>, ket_ends=1, 
    left=0x6f72705f, skipping=0) at expand.c:2602
[...]
2659        continue;
(gdb) n
2624      if (*s == '\\')
(gdb) p s
$15 = (uschar *) 0xbfbffc87 "}{b} {true} {false}}"
[...]
4464    return yield;
(gdb) p yield
$16 = (uschar *) 0x81280b8 "a"
(gdb) n
0x80711b0       4488    }
(gdb) n
eval_condition (s=0xbfbffc85 "{a}{b} {true} {false}}", yield=0xbfbfec88)
    at expand.c:1773
1773        if (sub[i] == NULL) return NULL;
(gdb) n
1774        if (*s++ != '}') goto COND_FAILED_CURLY_END;
(gdb) p *s
$17 = 123 '{'



--Nikolaus

--
Der Dativ ist dem Genitiv sein Tod.