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.
This commit is contained in:
Thierry FOURNIER 2014-01-29 20:02:36 +01:00 committed by Willy Tarreau
parent 0b6d15fdc8
commit 64c585ffeb
1 changed files with 11 additions and 0 deletions

View File

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