BUG/MEDIUM: acl: boolean only matches were broken by recent changes

The ACL changes made in the last patchset force the execution
of each pattern matching function. The function pat_match_nothing
was not provided to be excuted, it was just used as a flag that
was checked by the ACL execution code. Now this function is
executed and always returns false.

This patch makes it work as expected. Now, it returns the boolean
status of the received sample just as was done previously in the
ACL code.

This bug is a part of the patchset just merged. It does not need
to be backported.
This commit is contained in:
Thierry FOURNIER 2014-03-17 19:53:10 +01:00 committed by Willy Tarreau
parent c5a4e98639
commit e5978bfc25

View File

@ -433,6 +433,17 @@ int pat_parse_ip(const char *text, struct pattern *pattern, char **err)
/* always return false */
struct pattern *pat_match_nothing(struct sample *smp, struct pattern_expr *expr, int fill)
{
if (smp->data.uint) {
if (fill) {
static_pattern.smp = NULL;
static_pattern.ref = NULL;
static_pattern.flags = 0;
static_pattern.type = 0;
static_pattern.ptr.str = NULL;
}
return &static_pattern;
}
else
return NULL;
}