]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: pattern: some entries are not deleted with case insensitive match
authorThierry FOURNIER <tfournier@exceliance.fr>
Fri, 6 Feb 2015 16:53:54 +0000 (17:53 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 6 Feb 2015 17:04:36 +0000 (18:04 +0100)
ACL or map entries are not deleted with the command "del acl" or "del map"
if the case insentive flag is set.

This is because the the case insensitive string are stored in a list and the
default delete function associated with string looks in a tree. I add a check
of the case insensitive flag and execute the delete function for lists if it
is set.

This patch must be backported in 1.5 version.

src/pattern.c

index a6fc52d612ffb684d34ded69c07895cf1ee79c78..b19ffe2736ab14204e614f2634aab53538eff5f1 100644 (file)
@@ -1308,6 +1308,10 @@ void pat_del_tree_str(struct pattern_expr *expr, struct pat_ref_elt *ref)
        struct ebmb_node *node, *next_node;
        struct pattern_tree *elt;
 
+       /* If the flag PAT_F_IGNORE_CASE is set, we cannot use trees */
+       if (expr->mflags & PAT_MF_IGNORE_CASE)
+               return pat_del_list_ptr(expr, ref);
+
        /* browse each node of the tree. */
        for (node = ebmb_first(&expr->pattern_tree), next_node = node ? ebmb_next(node) : NULL;
             node;