mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-29 23:01:03 +01:00
MINOR: proxy: dynamic-cookie CLIs require TCP or HTTP mode
Prevent the use of "dynamic-cookie" related CLI commands if the backend is not in TCP or HTTP mode.
This commit is contained in:
parent
0b09727a22
commit
403fdee6a4
@ -2936,6 +2936,9 @@ static int cli_parse_enable_dyncookie_backend(char **args, char *payload, struct
|
|||||||
if (!px)
|
if (!px)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
if (px->mode != PR_MODE_TCP && px->mode != PR_MODE_HTTP)
|
||||||
|
return cli_err(appctx, "Not available.\n");
|
||||||
|
|
||||||
/* Note: this lock is to make sure this doesn't change while another
|
/* Note: this lock is to make sure this doesn't change while another
|
||||||
* thread is in srv_set_dyncookie().
|
* thread is in srv_set_dyncookie().
|
||||||
*/
|
*/
|
||||||
@ -2968,6 +2971,9 @@ static int cli_parse_disable_dyncookie_backend(char **args, char *payload, struc
|
|||||||
if (!px)
|
if (!px)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
if (px->mode != PR_MODE_TCP && px->mode != PR_MODE_HTTP)
|
||||||
|
return cli_err(appctx, "Not available.\n");
|
||||||
|
|
||||||
/* Note: this lock is to make sure this doesn't change while another
|
/* Note: this lock is to make sure this doesn't change while another
|
||||||
* thread is in srv_set_dyncookie().
|
* thread is in srv_set_dyncookie().
|
||||||
*/
|
*/
|
||||||
@ -3002,6 +3008,9 @@ static int cli_parse_set_dyncookie_key_backend(char **args, char *payload, struc
|
|||||||
if (!px)
|
if (!px)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
if (px->mode != PR_MODE_TCP && px->mode != PR_MODE_HTTP)
|
||||||
|
return cli_err(appctx, "Not available.\n");
|
||||||
|
|
||||||
if (!*args[4])
|
if (!*args[4])
|
||||||
return cli_err(appctx, "String value expected.\n");
|
return cli_err(appctx, "String value expected.\n");
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user