mirror of
https://github.com/haproxy/haproxy.git
synced 2026-06-08 16:23:24 -04:00
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:
parent
b9fa07bd20
commit
ef191c46d7
1 changed files with 6 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue