Similar to the stats socket bug, we must check that the proxy is not disabled
before trying to enable/disable a server.
Even if a disabled proxy is not displayed, someone can inject a faulty proxy
name in the POST parameters. So, we must ensure that no disabled proxy can be
used.
---
src/proto_http.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/proto_http.c b/src/proto_http.c
index 643e708..edd619a 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -2912,7 +2912,7 @@ int http_process_req_stat_post(struct session *s, struct
buffer *req)
if (backend && action &&
get_backend_server(backend, value, &px, &sv)) {
switch (action) {
case 1:
- if (! (sv->state &
SRV_MAINTAIN)) {
+ if ((px->state != PR_STSTOPPED)
&& !(sv->state & SRV_MAINTAIN)) {
/* Not already in
maintenance, we can change the server state */
sv->state |=
SRV_MAINTAIN;
set_server_down(sv);
@@ -2920,7 +2920,7 @@ int http_process_req_stat_post(struct session *s, struct
buffer *req)
}
break;
case 2:
- if ((sv->state & SRV_MAINTAIN))
{
+ if ((px->state != PR_STSTOPPED)
&& (sv->state & SRV_MAINTAIN)) {
/* Already in
maintenance, we can change the server state */
set_server_up(sv);
sv->health = sv->rise;
/* up, but will fall down at first failure */
--
1.7.4.1