From 0b09727a22fc2bd36bc7b3e73ca9c5a85ce2601c Mon Sep 17 00:00:00 2001 From: Aurelien DARRAGON Date: Tue, 19 Sep 2023 18:37:29 +0200 Subject: [PATCH] MINOR: cfgparse-listen: "dynamic-cookie-key" requires TCP or HTTP mode Prevent the use of the "dynamic-cookie-key" keyword in proxy sections when TCP or HTTP modes are not set. --- src/cfgparse-listen.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/cfgparse-listen.c b/src/cfgparse-listen.c index f8330a6e0..0bd193970 100644 --- a/src/cfgparse-listen.c +++ b/src/cfgparse-listen.c @@ -676,6 +676,13 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm) if (warnifnotcap(curproxy, PR_CAP_BE, file, linenum, args[0], NULL)) err_code |= ERR_WARN; + if (curproxy->mode != PR_MODE_TCP && curproxy->mode != PR_MODE_HTTP) { + ha_alert("parsing [%s:%d] : '%s' requires TCP or HTTP mode.\n", + file, linenum, args[0]); + err_code |= ERR_ALERT | ERR_FATAL; + goto out; + } + if (*(args[1]) == 0) { ha_alert("parsing [%s:%d] : '%s' expects as argument.\n", file, linenum, args[0]);