]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: ssl_ckch: Dump CRL transaction only once if show command yield
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 3 Jun 2022 08:32:18 +0000 (10:32 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 3 Jun 2022 09:20:34 +0000 (11:20 +0200)
When loaded CRL files are displayed via "show ssl crl-file" command, the
in-progess transaction, if any, is also displayed. However, if the command
yield, the transaction is re-displayed again and again.

To fix the issue, old_crlfile_entry field is used to remember the transaction
was already displayed.

This patch must be backported as far as 2.5.

src/ssl_ckch.c

index 601cec9354588ce64ac109e7a824186ba644b4b6..5a08bc72f6fb8e5bed931392e5e11d4d0b5fe076 100644 (file)
@@ -3762,11 +3762,12 @@ static int cli_io_handler_show_crlfile(struct appctx *appctx)
        if (trash == NULL)
                return 1;
 
-       if (!ctx->old_crlfile_entry) {
-               if (crlfile_transaction.old_crlfile_entry) {
-                       chunk_appendf(trash, "# transaction\n");
-                       chunk_appendf(trash, "*%s\n", crlfile_transaction.old_crlfile_entry->path);
-               }
+       if (!ctx->old_crlfile_entry && crlfile_transaction.old_crlfile_entry) {
+               chunk_appendf(trash, "# transaction\n");
+               chunk_appendf(trash, "*%s\n", crlfile_transaction.old_crlfile_entry->path);
+               if (applet_putchk(appctx, trash) == -1)
+                       goto yield;
+               ctx->old_crlfile_entry = crlfile_transaction.old_crlfile_entry;
        }
 
        /* First time in this io_handler. */