]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: acme: wrong error when checking for duplicate section
authorWilliam Lallemand <wlallemand@haproxy.com>
Mon, 23 Mar 2026 10:22:49 +0000 (11:22 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Mon, 23 Mar 2026 10:58:53 +0000 (11:58 +0100)
The cfg_parse_acme() function checks if an 'acme' section is already
existing in the configuration with cur_acme->linenum > 0. But the wrong
filename and line number are displayed in the commit message.

Must be backported to 3.2 and later.

src/acme.c

index 33afa567dcbdc9066ab7d3922c89579ccf797d61..55b6c6cd3e02c5c1c070c665cc565578839dedd9 100644 (file)
@@ -266,7 +266,6 @@ static int cfg_parse_acme(const char *file, int linenum, char **args, int kwm)
        mark_tainted(TAINTED_CONFIG_EXP_KW_DECLARED);
 
        if (strcmp(args[0], "acme") == 0) {
-               struct acme_cfg *tmp_acme = acme_cfgs;
 
                if (alertif_too_many_args(1, file, linenum, args, &err_code))
                        goto out;
@@ -292,7 +291,7 @@ static int cfg_parse_acme(const char *file, int linenum, char **args, int kwm)
                         * name */
                        err_code |= ERR_ALERT | ERR_FATAL;
                        ha_alert("parsing [%s:%d]: acme section '%s' already exists (%s:%d).\n",
-                                       file, linenum, args[1], tmp_acme->filename, tmp_acme->linenum);
+                                file, linenum, args[1], cur_acme->filename, cur_acme->linenum);
                        goto out;
                }