mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-25 23:20:45 +00:00
[BUG] uri_auth: do not attemp to convert uri_auth -> http-request more than once
Bug reported by Laurent Dolosor.
This commit is contained in:
parent
15f0ac4829
commit
329f74d463
@ -30,6 +30,7 @@ struct stat_scope {
|
|||||||
#define ST_SHNODE 0x00000002 /* show node name */
|
#define ST_SHNODE 0x00000002 /* show node name */
|
||||||
#define ST_SHDESC 0x00000004 /* show description */
|
#define ST_SHDESC 0x00000004 /* show description */
|
||||||
#define ST_SHLGNDS 0x00000008 /* show legends */
|
#define ST_SHLGNDS 0x00000008 /* show legends */
|
||||||
|
#define ST_CONVDONE 0x00000010 /* req_acl conversion done */
|
||||||
|
|
||||||
/* later we may link them to support multiple URI matching */
|
/* later we may link them to support multiple URI matching */
|
||||||
struct uri_auth {
|
struct uri_auth {
|
||||||
|
@ -4803,7 +4803,8 @@ int check_config_validity()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (curproxy->uri_auth && !LIST_ISEMPTY(&curproxy->uri_auth->req_acl) &&
|
if (curproxy->uri_auth && !(curproxy->uri_auth->flags & ST_CONVDONE) &&
|
||||||
|
!LIST_ISEMPTY(&curproxy->uri_auth->req_acl) &&
|
||||||
(curproxy->uri_auth->userlist || curproxy->uri_auth->auth_realm )) {
|
(curproxy->uri_auth->userlist || curproxy->uri_auth->auth_realm )) {
|
||||||
Alert("%s '%s': stats 'auth'/'realm' and 'http-request' can't be used at the same time.\n",
|
Alert("%s '%s': stats 'auth'/'realm' and 'http-request' can't be used at the same time.\n",
|
||||||
"proxy", curproxy->id);
|
"proxy", curproxy->id);
|
||||||
@ -4811,7 +4812,7 @@ int check_config_validity()
|
|||||||
goto out_uri_auth_compat;
|
goto out_uri_auth_compat;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (curproxy->uri_auth && curproxy->uri_auth->userlist) {
|
if (curproxy->uri_auth && curproxy->uri_auth->userlist && !(curproxy->uri_auth->flags & ST_CONVDONE)) {
|
||||||
const char *uri_auth_compat_req[10];
|
const char *uri_auth_compat_req[10];
|
||||||
struct req_acl_rule *req_acl;
|
struct req_acl_rule *req_acl;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@ -4842,6 +4843,8 @@ int check_config_validity()
|
|||||||
free(curproxy->uri_auth->auth_realm);
|
free(curproxy->uri_auth->auth_realm);
|
||||||
curproxy->uri_auth->auth_realm = NULL;
|
curproxy->uri_auth->auth_realm = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
curproxy->uri_auth->flags |= ST_CONVDONE;
|
||||||
}
|
}
|
||||||
out_uri_auth_compat:
|
out_uri_auth_compat:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user