{
struct show_map_ctx *ctx = applet_reserve_svcctx(appctx, sizeof(*ctx));
- if ((appctx->cli_ctx.level & ACCESS_LVL_MASK) < ACCESS_LVL_ADMIN)
- ha_warning("'%s %s' accessed without admin rights, this won't be supported anymore starting from haproxy 3.3\n", args[0], args[1]);
+ if (!cli_has_level(appctx, ACCESS_LVL_ADMIN))
+ return 1;
if (strcmp(args[1], "map") == 0 || strcmp(args[1], "acl") == 0) {
/* Set flags. */
{
struct show_map_ctx *ctx = applet_reserve_svcctx(appctx, sizeof(*ctx));
- if ((appctx->cli_ctx.level & ACCESS_LVL_MASK) < ACCESS_LVL_ADMIN)
- ha_warning("'%s %s' accessed without admin rights, this won't be supported anymore starting from haproxy 3.3\n", args[0], args[1]);
+ if (!cli_has_level(appctx, ACCESS_LVL_ADMIN))
+ return 1;
if (strcmp(args[1], "map") == 0 ||
strcmp(args[1], "acl") == 0) {
{
struct show_map_ctx *ctx = applet_reserve_svcctx(appctx, sizeof(*ctx));
- if ((appctx->cli_ctx.level & ACCESS_LVL_MASK) < ACCESS_LVL_ADMIN)
- ha_warning("'%s %s' accessed without admin rights, this won't be supported anymore starting from haproxy 3.3\n", args[0], args[1]);
+ if (!cli_has_level(appctx, ACCESS_LVL_ADMIN))
+ return 1;
if (strcmp(args[1], "map") == 0 ||
strcmp(args[1], "acl") == 0) {
{
struct show_map_ctx *ctx = applet_reserve_svcctx(appctx, sizeof(*ctx));
- if ((appctx->cli_ctx.level & ACCESS_LVL_MASK) < ACCESS_LVL_ADMIN)
- ha_warning("'%s %s' accessed without admin rights, this won't be supported anymore starting from haproxy 3.3\n", args[0], args[1]);
+ if (!cli_has_level(appctx, ACCESS_LVL_ADMIN))
+ return 1;
if (strcmp(args[1], "map") == 0) {
char *err;
{
struct show_map_ctx *ctx = applet_reserve_svcctx(appctx, sizeof(*ctx));
- if ((appctx->cli_ctx.level & ACCESS_LVL_MASK) < ACCESS_LVL_ADMIN)
- ha_warning("'%s %s' accessed without admin rights, this won't be supported anymore starting from haproxy 3.3\n", args[0], args[1]);
+ if (!cli_has_level(appctx, ACCESS_LVL_ADMIN))
+ return 1;
if (strcmp(args[1], "map") == 0 ||
strcmp(args[1], "acl") == 0) {
{
struct show_map_ctx *ctx = applet_reserve_svcctx(appctx, sizeof(*ctx));
- if ((appctx->cli_ctx.level & ACCESS_LVL_MASK) < ACCESS_LVL_ADMIN)
- ha_warning("'%s %s' accessed without admin rights, this won't be supported anymore starting from haproxy 3.3\n", args[0], args[1]);
+ if (!cli_has_level(appctx, ACCESS_LVL_ADMIN))
+ return 1;
if (args[1][0] == 'm')
ctx->display_flags = PAT_REF_MAP;
{
struct show_map_ctx *ctx = applet_reserve_svcctx(appctx, sizeof(*ctx));
- if ((appctx->cli_ctx.level & ACCESS_LVL_MASK) < ACCESS_LVL_ADMIN)
- ha_warning("'%s %s' accessed without admin rights, this won't be supported anymore starting from haproxy 3.3\n", args[0], args[1]);
+ if (!cli_has_level(appctx, ACCESS_LVL_ADMIN))
+ return 1;
if (strcmp(args[1], "map") == 0 || strcmp(args[1], "acl") == 0) {
const char *gen = NULL;
{
struct show_map_ctx *ctx = applet_reserve_svcctx(appctx, sizeof(*ctx));
- if ((appctx->cli_ctx.level & ACCESS_LVL_MASK) < ACCESS_LVL_ADMIN)
- ha_warning("'%s %s' accessed without admin rights, this won't be supported anymore starting from haproxy 3.3\n", args[0], args[1]);
+ if (!cli_has_level(appctx, ACCESS_LVL_ADMIN))
+ return 1;
if (strcmp(args[1], "map") == 0 || strcmp(args[1], "acl") == 0) {
const char *gen = NULL;