From e5978bfc2534c34c8ef2bb1a6dc1c7e5ebe36aeb Mon Sep 17 00:00:00 2001 From: Thierry FOURNIER Date: Mon, 17 Mar 2014 19:53:10 +0100 Subject: [PATCH] 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. --- src/pattern.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/pattern.c b/src/pattern.c index 86f94db8d..16fb7047c 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; }