]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: acl: report "ACL" not "map" in ACL ID lookup failures
authorWilly Tarreau <w@1wt.eu>
Mon, 8 Jun 2026 11:43:25 +0000 (13:43 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 8 Jun 2026 11:45:39 +0000 (13:45 +0200)
As reported by @broxio in issue #3411, when trying to delete an ACL by
its name, in case of error the message says "unknown map identifier".
We need to check the type to decide between map and ACL as in other
messages.

This can be backported to all stable branches. Thanks to @broxio for
reporting the issue with a reproducer and providing this tested fix.

src/map.c

index 9bca28d8b6ad86d808e5192560a78421828fba00..bad7583627c676b464fab1888da3d294fff1e3b7 100644 (file)
--- a/src/map.c
+++ b/src/map.c
@@ -998,8 +998,12 @@ static int cli_parse_del_map(char **args, char *payload, struct appctx *appctx,
        /* Lookup the reference in the maps. */
        ctx->ref = pat_ref_lookup_ref(args[2]);
        if (!ctx->ref ||
-           !(ctx->ref->flags & ctx->display_flags))
-               return cli_err(appctx, "Unknown map identifier. Please use #<id> or <file>.\n");
+           !(ctx->ref->flags & ctx->display_flags)) {
+               if (ctx->display_flags == PAT_REF_MAP)
+                       return cli_err(appctx, "Unknown map identifier. Please use #<id> or <file>.\n");
+               else
+                       return cli_err(appctx, "Unknown ACL identifier. Please use #<id> or <file>.\n");
+       }
 
        /* If the entry identifier start with a '#', it is considered as
         * pointer id