]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: cli: set the ACCESS_MASTER* bits on the master bind_conf
authorWilly Tarreau <w@1wt.eu>
Fri, 12 Mar 2021 14:00:57 +0000 (15:00 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 12 Mar 2021 18:09:19 +0000 (19:09 +0100)
Right now the code is a bit hackish, it tests for the keyword's level
flags but checks the applet's origin to compare the bits. Let's start
by properly setting the ACCESS_MASTER_ONLY and ACCESS_MASTER flags on
the master CLI's bind_conf so that they are automatically present
all the time.

src/cli.c

index 99cb9df8645df6fe3455dbc66bb72249e14dc1c3..b21f1c5de118335acde5ae1dee764be616a55792 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -2645,6 +2645,7 @@ int mworker_cli_proxy_new_listener(char *line)
 
        bind_conf->level &= ~ACCESS_LVL_MASK;
        bind_conf->level |= ACCESS_LVL_ADMIN;
+       bind_conf->level |= ACCESS_MASTER | ACCESS_MASTER_ONLY;
 
        if (!str2listener(args[0], mworker_proxy, bind_conf, "master-socket", 0, &err)) {
                ha_alert("Cannot create the listener of the master CLI\n");