]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: acl: always accept match "found"
authorWilly Tarreau <w@1wt.eu>
Thu, 24 Sep 2015 14:37:12 +0000 (16:37 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 24 Sep 2015 14:38:48 +0000 (16:38 +0200)
The pattern match "found" fails to parse on binary type samples. The
reason is that it presents itself as an integer type which bin cannot
be cast into. We must always accept this match since it validates
anything on input regardless of the type. Let's just relax the parser
to accept it.

This problem might also exist in 1.5.
(cherry picked from commit 91cc2368a73198bddc3e140d267cce4ee08cf20e)

src/acl.c

index 2ee4d5096008c5cef0bbfbc2c490dce078eee889..033cfc916bfd90b8ee8b3b031cbc413b871e813d 100644 (file)
--- a/src/acl.c
+++ b/src/acl.c
@@ -487,7 +487,7 @@ struct acl_expr *parse_acl_expr(const char **args, char **err, struct arg_list *
                        }
 
                        /* Note: -m found is always valid, bool/int are compatible, str/bin/reg/len are compatible */
-                       if (!sample_casts[cur_type][pat_match_types[idx]]) {
+                       if (idx != PAT_MATCH_FOUND && !sample_casts[cur_type][pat_match_types[idx]]) {
                                memprintf(err, "matching method '%s' cannot be used with fetch keyword '%s'", args[1], expr->kw);
                                goto out_free_expr;
                        }