From 82f4bcafae6a5c873fa7f91b9c53820e8c6328ef Mon Sep 17 00:00:00 2001 From: Aurelien DARRAGON Date: Thu, 16 Nov 2023 17:16:43 +0100 Subject: [PATCH] MINOR: log/backend: prevent "dynamic-cookie-key" use with LOG mode It doesn't make sense to set "dynamic-cookie-key" inside a log backend, thus we report a warning to the user and reset the setting. --- src/log.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/log.c b/src/log.c index e12a43b7f2..bf1c54d373 100644 --- a/src/log.c +++ b/src/log.c @@ -922,6 +922,13 @@ static int _postcheck_log_backend_compat(struct proxy *be) err_code |= ERR_WARN; istfree(&be->server_id_hdr_name); } + if (be->dyncookie_key) { + ha_warning("Cannot set \"dynamic-cookie-key\" with 'mode log' in %s '%s'. It will be ignored.\n", + proxy_type_str(be), be->id); + + err_code |= ERR_WARN; + ha_free(&be->dyncookie_key); + } return err_code; }