From 64c585ffeb263cb6cc9f472cf314c2a822f8f82f Mon Sep 17 00:00:00 2001 From: Thierry FOURNIER Date: Wed, 29 Jan 2014 20:02:36 +0100 Subject: [PATCH] MINOR: cli: Block the usage of the command "acl add" in many cases. If acl is shared with a map, the "add acl" command must be blocked because it not take a sample on his parameters. The absense of this parameter can cause error with corresponding maps. --- src/dumpstats.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/dumpstats.c b/src/dumpstats.c index a796cd70b5..202bd71b81 100644 --- a/src/dumpstats.c +++ b/src/dumpstats.c @@ -2041,6 +2041,17 @@ static int stats_sock_parse_request(struct stream_interface *si, char *line) return 1; } + /* The command "add acl" is prohibited if the reference + * use samples. + */ + if ((appctx->ctx.map.display_flags & PAT_REF_ACL) && + (appctx->ctx.map.ref->flags & PAT_REF_SMP)) { + appctx->ctx.cli.msg = "This ACL is shared with a map containing samples. " + "You must use the command 'add map' to add values.\n"; + appctx->st0 = STAT_CLI_PRINT; + return 1; + } + /* Add value. */ err = NULL; if (appctx->ctx.map.display_flags == PAT_REF_MAP)