]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: acl: warn if "_sub" derivative used with an explicit match
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 28 Oct 2025 10:23:18 +0000 (11:23 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 28 Oct 2025 10:59:32 +0000 (11:59 +0100)
Recently, a new warning is displayed when an ACL derivative match method
is override with another '-m' method. This is implemented via the
following patch :

  6ea50ba462692d6dcf301081f23cab3e0f6086e4
  MINOR: acl; Warn when matching method based on a suffix is overwritten

However, this warning was not reported when "_sub" suffix was specified.
Fix this by adding PAT_MATCH_SUB in the warning comparison.

No backport needed except if above commit is.

src/acl.c

index 954233521da167cc372f16700c262c1b0f5b2768..2aff18e4ff26124e7ec08a8b3358c28186d8f49c 100644 (file)
--- a/src/acl.c
+++ b/src/acl.c
@@ -411,8 +411,9 @@ struct acl_expr *parse_acl_expr(const char **args, char **err, struct arg_list *
 
        if (aclkw) {
                if (((aclkw->match_type == PAT_MATCH_BEG || aclkw->match_type == PAT_MATCH_DIR || aclkw->match_type == PAT_MATCH_DOM ||
-                    aclkw->match_type == PAT_MATCH_DOM || aclkw->match_type == PAT_MATCH_END || aclkw->match_type == PAT_MATCH_LEN ||
-                    aclkw->match_type == PAT_MATCH_REG) && expr->pat.match != pat_match_fcts[aclkw->match_type]) ||
+                     aclkw->match_type == PAT_MATCH_DOM || aclkw->match_type == PAT_MATCH_END || aclkw->match_type == PAT_MATCH_LEN ||
+                     aclkw->match_type == PAT_MATCH_REG || aclkw->match_type == PAT_MATCH_SUB) &&
+                    expr->pat.match != pat_match_fcts[aclkw->match_type]) ||
                    (aclkw->match && expr->pat.match != aclkw->match))
                        ha_warning("parsing [%s:%d] : original matching method '%s' was overwritten and will not be applied as expected.\n",
                                   file, line, aclkw->kw);