From: Willy Tarreau Date: Sat, 16 Jun 2007 17:35:18 +0000 (+0200) Subject: [BUG] negation in ACL conds was not cleared between terms X-Git-Tag: v1.3.12~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=74b98a8c22132165eddbd212584410575fde9325;p=thirdparty%2Fhaproxy.git [BUG] negation in ACL conds was not cleared between terms The exclamation mark (!) in front of an ACL condition was propagated to the whole line instead of being flushed after parsing an acl name. --- diff --git a/src/acl.c b/src/acl.c index 0cc9248330..c4860abdfe 100644 --- a/src/acl.c +++ b/src/acl.c @@ -546,8 +546,7 @@ struct acl_cond *prune_acl_cond(struct acl_cond *cond) struct acl_cond *parse_acl_cond(const char **args, struct list *known_acl, int pol) { __label__ out_return, out_free_suite, out_free_term; - int arg; - int neg = 0; + int arg, neg; const char *word; struct acl *cur_acl; struct acl_term *cur_term; @@ -563,6 +562,7 @@ struct acl_cond *parse_acl_cond(const char **args, struct list *known_acl, int p cond->pol = pol; cur_suite = NULL; + neg = 0; for (arg = 0; *args[arg]; arg++) { word = args[arg]; @@ -605,6 +605,7 @@ struct acl_cond *parse_acl_cond(const char **args, struct list *known_acl, int p LIST_ADDQ(&cond->suites, &cur_suite->list); } LIST_ADDQ(&cur_suite->terms, &cur_term->list); + neg = 0; } return cond; @@ -677,7 +678,7 @@ int acl_exec_cond(struct acl_cond *cond, struct proxy *px, struct session *l4, v } } /* - * OK now we have the result of this expression in expr_res. + * OK now we have the result of this expression in acl_res. * - we have the PASS bit set if at least one pattern matched ; * - we have the MISS bit set if at least one pattern may match * later so that we should not cache a failure ;