BUG/MINOR: acl: report "ACL" not "map" in ACL ID lookup failures

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.
This commit is contained in:
Willy Tarreau 2026-06-08 13:43:25 +02:00
parent b9fa07bd20
commit ef191c46d7

View file

@ -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