[exim-dev] [Bug 167] Make "true" and "false" valid expansion…

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Phil Pennock
Dátum:  
Címzett: exim-dev
Tárgy: [exim-dev] [Bug 167] Make "true" and "false" valid expansion conditions
------- You are receiving this mail because: -------
You are the QA contact for the bug.

http://bugs.exim.org/show_bug.cgi?id=167

Phil Pennock <exim-dev@???> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |exim-dev@???





--- Comment #14 from Phil Pennock <exim-dev@???> 2008-09-14 00:03:48 ---
(In reply to comment #13)
> I notice that the "condition" ACL condition accepts numbers as boolean values,
> while your patch doesn't.


Yeah, I opted to accept the values which readconf interprets as bools, then in
the comment wrote "condition =" (and didn't specify ACL vs Router).

Okay, ACLs explicitly check for no/false/yes/true or if the value consists
entirely of digits and if so, if non-zero.

Routers use expand_check_condition(), which checks for the empty string, or
"0", "no", "false"; those return FALSE, all other values are TRUE (and forced
failures or search failures are also FALSE). This matches the documentation.
Note then that "0000" is FALSE in an ACL condition but TRUE in a Router
condition.

So I think that the cleanest solution is to clarify in the comment that it's
the ACL condition rules which apply and to accept numbers (which I had actually
thought about, but decided against, doh).

The way the code is written, abstracting this into a common function would add
a complicated API and I think that this is simple enough that logic replication
is reasonable. I'll add cross-reference comments to both places, though.

Patch forthcoming.


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email