diff --git a/include/haproxy/stats-t.h b/include/haproxy/stats-t.h index c3fc21b46..a9bf25e31 100644 --- a/include/haproxy/stats-t.h +++ b/include/haproxy/stats-t.h @@ -41,6 +41,7 @@ #define STAT_SHOW_FDESC 0x00001000 /* show the field descriptions when possible */ #define STAT_SHMODULES 0x00002000 /* conf: show modules */ #define STAT_HIDE_MAINT 0x00004000 /* hide maint/disabled servers */ +#define STAT_CONVDONE 0x00008000 /* conf: rules conversion done */ #define STAT_BOUND 0x00800000 /* bound statistics to selected proxies/types/services */ #define STAT_STARTED 0x01000000 /* some output has occurred */ diff --git a/src/cfgparse.c b/src/cfgparse.c index 83530ae4b..03405a40c 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -2842,7 +2842,7 @@ int check_config_validity() } } - if (curproxy->uri_auth && curproxy->uri_auth != defproxy.uri_auth && + if (curproxy->uri_auth && !(curproxy->uri_auth->flags & STAT_CONVDONE) && !LIST_ISEMPTY(&curproxy->uri_auth->http_req_rules) && (curproxy->uri_auth->userlist || curproxy->uri_auth->auth_realm )) { ha_alert("%s '%s': stats 'auth'/'realm' and 'http-request' can't be used at the same time.\n", @@ -2852,7 +2852,7 @@ int check_config_validity() } if (curproxy->uri_auth && curproxy->uri_auth->userlist && - (curproxy->uri_auth != defproxy.uri_auth || + (!(curproxy->uri_auth->flags & STAT_CONVDONE) || LIST_ISEMPTY(&curproxy->uri_auth->http_req_rules))) { const char *uri_auth_compat_req[10]; struct act_rule *rule; @@ -2883,6 +2883,7 @@ int check_config_validity() free(curproxy->uri_auth->auth_realm); curproxy->uri_auth->auth_realm = NULL; } + curproxy->uri_auth->flags |= STAT_CONVDONE; } out_uri_auth_compat: