From 84ad70de575a2a241a3739c1f5aa1ae1d3cbb59e Mon Sep 17 00:00:00 2001 From: Dmitry Belyavskiy Date: Tue, 15 Oct 2024 13:10:20 +0200 Subject: [PATCH] Add extra help information on ssh early failure Resolves: RHEL-62718 --- openssh-8.7p1-redhat-help.patch | 38 +++++++++++++++++++++++++++++++++ openssh.spec | 4 ++++ 2 files changed, 42 insertions(+) create mode 100644 openssh-8.7p1-redhat-help.patch diff --git a/openssh-8.7p1-redhat-help.patch b/openssh-8.7p1-redhat-help.patch new file mode 100644 index 0000000..95d669c --- /dev/null +++ b/openssh-8.7p1-redhat-help.patch @@ -0,0 +1,38 @@ +diff -up openssh-8.7p1/ssh.c.xxx openssh-8.7p1/ssh.c +--- openssh-8.7p1/ssh.c.xxx 2024-09-11 14:24:06.711088878 +0200 ++++ openssh-8.7p1/ssh.c 2024-09-11 14:35:12.883765718 +0200 +@@ -175,6 +175,14 @@ extern int muxserver_sock; + extern u_int muxclient_command; + + /* Prints a help message to the user. This function never returns. */ ++static void ++redhat_usage(void) ++{ ++ fprintf(stderr, ++"\nYou can find some explanations for typical errors at this link:\n" ++" https://red.ht/support_rhel_ssh\n" ++ ); ++} + + static void + usage(void) +@@ -188,6 +196,7 @@ usage(void) + " destination [command [argument ...]]\n" + " ssh [-Q query_option]\n" + ); ++ redhat_usage(); + exit(255); + } + +@@ -1609,8 +1618,10 @@ main(int ac, char **av) + /* Open a connection to the remote host. */ + if (ssh_connect(ssh, host, options.host_arg, addrs, &hostaddr, + options.port, options.connection_attempts, +- &timeout_ms, options.tcp_keep_alive) != 0) ++ &timeout_ms, options.tcp_keep_alive) != 0) { ++ redhat_usage(); + exit(255); ++ } + + if (addrs != NULL) + freeaddrinfo(addrs); diff --git a/openssh.spec b/openssh.spec index aafaf78..0c9168b 100644 --- a/openssh.spec +++ b/openssh.spec @@ -194,6 +194,7 @@ Patch1014: openssh-8.7p1-nohostsha1proof.patch Patch1015: openssh-9.6p1-pam-rhost.patch Patch1016: openssh-9.9p1-separate-keysign.patch +Patch1017: openssh-8.7p1-redhat-help.patch License: BSD-3-Clause AND BSD-2-Clause AND ISC AND SSH-OpenSSH AND ssh-keyscan AND sprintf AND LicenseRef-Fedora-Public-Domain AND X11-distribute-modifications-variant Requires: /sbin/nologin @@ -375,6 +376,7 @@ gpgv2 --quiet --keyring %{SOURCE3} %{SOURCE1} %{SOURCE0} %patch -P 1014 -p1 -b .nosha1hostproof %patch -P 1015 -p1 -b .pam-rhost %patch -P 1016 -p1 -b .sep-keysign +%patch -P 1017 -p1 -b .help %patch -P 100 -p1 -b .coverity @@ -657,6 +659,8 @@ test -f %{sysconfig_anaconda} && \ * Tue Oct 15 2024 Dmitry Belyavskiy - 9.9p1-2 - Resolve memory management issues after rebase Related: RHEL-60564 +- Add extra help information on ssh early failure + Resolves: RHEL-62718 * Thu Oct 10 2024 Dmitry Belyavskiy - 9.9p1-1 - Update to OpenSSH 9.9p1