From: Thierry FOURNIER Date: Mon, 17 Mar 2014 18:53:10 +0000 (+0100) Subject: BUG/MEDIUM: acl: boolean only matches were broken by recent changes X-Git-Tag: v1.5-dev23~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5978bfc2534c34c8ef2bb1a6dc1c7e5ebe36aeb;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/pattern.c b/src/pattern.c index 86f94db8dc..16fb7047c6 100644 --- a/src/pattern.c +++ b/src/pattern.c @@ -433,7 +433,18 @@ 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) { - return NULL; + 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; }