]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: acl: boolean only matches were broken by recent changes
authorThierry FOURNIER <tfournier@exceliance.fr>
Mon, 17 Mar 2014 18:53:10 +0000 (19:53 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 17 Mar 2014 19:12:40 +0000 (20:12 +0100)
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.

src/pattern.c

index 86f94db8dceae1fa29ed6805e9777663fe23c7ad..16fb7047c64cddcaa2c61474d728824789e8a3af 100644 (file)
@@ -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;
 }