You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.2 KiB

  1. From 07ccb48add8c8cb0dd8a0f7d3f4994866d0ef32e Mon Sep 17 00:00:00 2001
  2. From: Willy Tarreau <w@1wt.eu>
  3. Date: Thu, 26 Nov 2015 18:32:39 +0100
  4. Subject: [PATCH 08/10] BUG/MEDIUM: cli: changing compression rate-limiting
  5. must require admin level
  6. Right now it's possible to change the global compression rate limiting
  7. without the CLI being at the admin level.
  8. This fix must be backported to 1.6 and 1.5.
  9. (cherry picked from commit a1c2b2c4f3e65d198a0a4b25a4f655f7b307a855)
  10. (cherry picked from commit 9e5f1489c9f2d6926729890f249f7ebb9d3bfd43)
  11. ---
  12. src/dumpstats.c | 6 ++++++
  13. 1 file changed, 6 insertions(+)
  14. diff --git a/src/dumpstats.c b/src/dumpstats.c
  15. index b4be2cd..b1bbf31 100644
  16. --- a/src/dumpstats.c
  17. +++ b/src/dumpstats.c
  18. @@ -1695,6 +1695,12 @@ static int stats_sock_parse_request(struct stream_interface *si, char *line)
  19. if (strcmp(args[3], "global") == 0) {
  20. int v;
  21. + if (s->listener->bind_conf->level < ACCESS_LVL_ADMIN) {
  22. + appctx->ctx.cli.msg = stats_permission_denied_msg;
  23. + appctx->st0 = STAT_CLI_PRINT;
  24. + return 1;
  25. + }
  26. +
  27. if (!*args[4]) {
  28. appctx->ctx.cli.msg = "Expects a maximum input byte rate in kB/s.\n";
  29. appctx->st0 = STAT_CLI_PRINT;
  30. --
  31. 2.4.10