From: Aurelien DARRAGON Date: Wed, 29 Nov 2023 14:03:25 +0000 (+0100) Subject: BUG/MINOR: cfgparse-listen: fix warning being reported as an alert X-Git-Tag: v2.9.0~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eec3911e64a1638c31fd55482aec8f8f770d02c8;p=thirdparty%2Fhaproxy.git BUG/MINOR: cfgparse-listen: fix warning being reported as an alert Since b40542000d ("MEDIUM: proxy: Warn about ambiguous use of named defaults sections") we introduced a new error to prevent user from having an ambiguous named default section in the config which is both inherited explicitly using "from" and implicitly by another proxy due to the default section being the last one defined. However, despite the error message being presented as a warning the err_code, the commit message and the documentation, it is actually reported as a fatal error because ha_alert() was used in place of ha_warning(). In this patch we make the code comply with the documentation and the intended behavior by using ha_warning() to report the error message. This should be backported up to 2.6. --- diff --git a/src/cfgparse-listen.c b/src/cfgparse-listen.c index a8379e4efb..4f88b77d65 100644 --- a/src/cfgparse-listen.c +++ b/src/cfgparse-listen.c @@ -321,9 +321,9 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm) curr_defproxy->flags |= PR_FL_IMPLICIT_REF; if (curr_defproxy && (curr_defproxy->flags & (PR_FL_EXPLICIT_REF|PR_FL_IMPLICIT_REF)) == (PR_FL_EXPLICIT_REF|PR_FL_IMPLICIT_REF)) { - ha_alert("parsing [%s:%d] : defaults section '%s' (declared at %s:%d) is explicitly referenced by another proxy and implicitly used here." - " To avoid any ambiguity don't mix both usage. Add a last defaults section not explicitly used or always use explicit references.\n", - file, linenum, curr_defproxy->id, curr_defproxy->conf.file, curr_defproxy->conf.line); + ha_warning("parsing [%s:%d] : defaults section '%s' (declared at %s:%d) is explicitly referenced by another proxy and implicitly used here." + " To avoid any ambiguity don't mix both usage. Add a last defaults section not explicitly used or always use explicit references.\n", + file, linenum, curr_defproxy->id, curr_defproxy->conf.file, curr_defproxy->conf.line); err_code |= ERR_WARN; }