]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: ssl/cli: Remove empty lines from CLI output
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Tue, 5 Apr 2022 14:44:21 +0000 (16:44 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Tue, 5 Apr 2022 14:53:37 +0000 (16:53 +0200)
There were empty lines in the output of "show ssl ca-file <cafile>" and
"show ssl crl-file <crlfile>" commands when an empty line should only
mark the end of the output. This patch adds a space to those lines.

This patch should be backported to 2.5.

src/ssl_ckch.c

index c047b1c6b2e561235ea82033d6a848d5109d9f6c..3bd061090b5d410403f16c879338ab933e7ab09c 100644 (file)
@@ -2960,7 +2960,7 @@ static int cli_io_handler_show_cafile_detail(struct appctx *appctx)
                if (ca_index && ca_index-1 != i)
                        continue;
 
-               chunk_appendf(out, "\nCertificate #%d:\n", i+1);
+               chunk_appendf(out, " \nCertificate #%d:\n", i+1);
                retval = show_cert_detail(cert, NULL, out);
                if (retval < 0)
                        goto end_no_putchk;
@@ -3619,7 +3619,7 @@ static int cli_io_handler_show_crlfile_detail(struct appctx *appctx)
                if (index && index-1 != i)
                        continue;
 
-               chunk_appendf(out, "\nCertificate Revocation List #%d:\n", i+1);
+               chunk_appendf(out, " \nCertificate Revocation List #%d:\n", i+1);
                retval = show_crl_detail(crl, out);
                if (retval < 0)
                        goto end_no_putchk;