From 9bb49f6906eafed0eb0fde01cd403089a502a101 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 24 Sep 2015 16:37:12 +0200 Subject: [PATCH] BUG/MEDIUM: acl: always accept match "found" 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/acl.c b/src/acl.c index 2ee4d5096..033cfc916 100644 --- 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; }