]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: acl: parser must also stop at comma on ACL-only keywords
authorWilly Tarreau <w@1wt.eu>
Mon, 16 Dec 2013 21:01:06 +0000 (22:01 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 16 Dec 2013 21:01:06 +0000 (22:01 +0100)
Igor at owind reported that "url_reg,lower" does not parse because
find_acl_kw() looks for the parenthesis but not for the comma.

src/acl.c

index c4f1934888ad21253af56273364c917e07cf1e45..b04c9dfa99def959ea5bdf4453ca074fa170b595 100644 (file)
--- a/src/acl.c
+++ b/src/acl.c
@@ -76,7 +76,8 @@ struct acl *find_acl_by_name(const char *name, struct list *head)
 }
 
 /* Return a pointer to the ACL keyword <kw>, or NULL if not found. Note that if
- * <kw> contains an opening parenthesis, only the left part of it is checked.
+ * <kw> contains an opening parenthesis or a comma, only the left part of it is
+ * checked.
  */
 struct acl_keyword *find_acl_kw(const char *kw)
 {
@@ -84,9 +85,9 @@ struct acl_keyword *find_acl_kw(const char *kw)
        const char *kwend;
        struct acl_kw_list *kwl;
 
-       kwend = strchr(kw, '(');
-       if (!kwend)
-               kwend = kw + strlen(kw);
+       kwend = kw;
+       while (*kwend && *kwend != '(' && *kwend != ',')
+               kwend++;
 
        list_for_each_entry(kwl, &acl_keywords.list, list) {
                for (index = 0; kwl->kw[index].kw != NULL; index++) {