]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: acme/cli: don't output error on success
authorWilliam Lallemand <wlallemand@haproxy.com>
Fri, 2 May 2025 19:15:45 +0000 (21:15 +0200)
committerWilliam Lallemand <wlallemand@haproxy.com>
Fri, 2 May 2025 19:21:09 +0000 (21:21 +0200)
Previous patch 7251c13c7 ("MINOR: acme: move the acme task init in a dedicated
function") mistakenly returned the wrong error code when "acme renew" parsing
was successful, and tried to emit an error message.

This patch fixes the issue by returning 0 when the acme task was correctly
scheduled to start.

No backport needed.

src/acme.c

index c2e37c1303f534c98948b80da717b9a1bf2e5bd0..098e2c593caf538935bcc538f248d1c8d7c94a9f 100644 (file)
@@ -2286,8 +2286,11 @@ static int cli_acme_renew_parse(char **args, char *payload, struct appctx *appct
                goto err;
        }
 
-       acme_start_task(store, &errmsg);
+       if (acme_start_task(store, &errmsg) != 0)
+               goto err;
 
+       HA_SPIN_UNLOCK(CKCH_LOCK, &ckch_lock);
+       return 0;
 err:
        HA_SPIN_UNLOCK(CKCH_LOCK, &ckch_lock);
        return cli_dynerr(appctx, errmsg);