MINOR: acl: Warn when an ACL is named 'or'
authorTim Duesterhus <tim@bastelstu.be>
Wed, 5 Feb 2020 20:00:50 +0000 (21:00 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 6 Feb 2020 15:08:36 +0000 (16:08 +0100)
commit0cf811a5f941261176b67046dbc542d0479ff4a7
treeb3461a96ecda433006627d0c1c1854a8a65bc111
parent9d6bb5a5468e07525ae21269776f38f5737aebcf
MINOR: acl: Warn when an ACL is named 'or'

Consider a configuration like this:

> acl t always_true
> acl or always_false
>
> http-response set-header Foo Bar if t or t

The 'or' within the condition will be treated as a logical disjunction
and the header will be set, despite the ACL 'or' being falsy.

This patch makes it an error to declare such an ACL that will never
work. This patch may be backported to stable releases, turning the
error into a warning only (the code was written in a way to make this
trivial). It should not break anything and might improve the users'
lifes.
src/cfgparse-listen.c
src/fcgi-app.c
src/flt_spoe.c