diff --git a/include/common/uri_auth.h b/include/common/uri_auth.h index e80722d4eb..46f1bc653d 100644 --- a/include/common/uri_auth.h +++ b/include/common/uri_auth.h @@ -30,7 +30,7 @@ struct stat_scope { #define ST_SHNODE 0x00000002 /* show node name */ #define ST_SHDESC 0x00000004 /* show description */ #define ST_SHLGNDS 0x00000008 /* show legends */ -#define ST_CONVDONE 0x00000010 /* req_acl conversion done */ +/* unused: 0x00000010 */ #define ST_SHOWADMIN 0x00000020 /* show the admin column */ /* later we may link them to support multiple URI matching */ diff --git a/src/cfgparse.c b/src/cfgparse.c index 05a64a8ef4..e8538f87cc 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -2875,7 +2875,7 @@ int check_config_validity() } } - if (curproxy->uri_auth && !(curproxy->uri_auth->flags & ST_CONVDONE) && + if (curproxy->uri_auth && curproxy->uri_auth != defproxy.uri_auth && !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", @@ -2884,11 +2884,12 @@ int check_config_validity() goto out_uri_auth_compat; } - if (curproxy->uri_auth && curproxy->uri_auth->userlist && !(curproxy->uri_auth->flags & ST_CONVDONE)) { + if (curproxy->uri_auth && curproxy->uri_auth->userlist && + (curproxy->uri_auth != defproxy.uri_auth || + LIST_ISEMPTY(&curproxy->uri_auth->http_req_rules))) { const char *uri_auth_compat_req[10]; struct act_rule *rule; int i = 0; - /* build the ACL condition from scratch. We're relying on anonymous ACLs for that */ uri_auth_compat_req[i++] = "auth"; @@ -2915,8 +2916,6 @@ int check_config_validity() free(curproxy->uri_auth->auth_realm); curproxy->uri_auth->auth_realm = NULL; } - - curproxy->uri_auth->flags |= ST_CONVDONE; } out_uri_auth_compat: