]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: cli: Block the usage of the command "acl add" in many cases.
authorThierry FOURNIER <tfournier@exceliance.fr>
Wed, 29 Jan 2014 19:02:36 +0000 (20:02 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 17 Mar 2014 17:06:08 +0000 (18:06 +0100)
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

index a796cd70b54af650fd8d313dba33daf82896d218..202bd71b814f214a9ce6285d8ba1dd28c5133212 100644 (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)