From 2303b82ca829808d76225b72516b85193d7a44ac Mon Sep 17 00:00:00 2001 From: Zoltan Fridrich Date: Thu, 17 Jul 2025 14:42:10 +0200 Subject: [PATCH] Move the redhat help message to debug1 log level Resolves: RHEL-93957 Signed-off-by: Zoltan Fridrich --- openssh-8.7p1-redhat-help.patch | 39 ++++++++++++++------------------- openssh.spec | 6 ++++- 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/openssh-8.7p1-redhat-help.patch b/openssh-8.7p1-redhat-help.patch index 3ffb657..35a3991 100644 --- a/openssh-8.7p1-redhat-help.patch +++ b/openssh-8.7p1-redhat-help.patch @@ -1,38 +1,31 @@ -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,16 @@ extern int muxserver_sock; +diff --color -ruNp a/ssh.c b/ssh.c +--- a/ssh.c 2025-07-17 14:08:37.880551301 +0200 ++++ b/ssh.c 2025-07-17 15:02:09.224627879 +0200 +@@ -175,6 +175,17 @@ static int forward_confirms_pending = -1 + 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) ++redhat_help_message(void) +{ -+ if(isatty(fileno(stderr))) { -+ fprintf(stderr, -+"\nYou can find some explanations for typical errors at this link:\n" -+" https://red.ht/support_rhel_ssh\n" -+ ); -+ } ++ if (log_level_get() >= SYSLOG_LEVEL_DEBUG1 && ++ isatty(fileno(stderr))) { ++ fprintf(stderr, ++"\nThe link below provides guidance on resolving common SSH errors:\n" ++" https://red.ht/support_rhel_ssh\n"); ++ } +} ++ + /* Prints a help message to the user. This function never returns. */ 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) +@@ -1648,8 +1659,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(); ++ redhat_help_message(); exit(255); + } diff --git a/openssh.spec b/openssh.spec index 1280fb6..42cd8c0 100644 --- a/openssh.spec +++ b/openssh.spec @@ -43,7 +43,7 @@ Summary: An open source implementation of SSH protocol version 2 Name: openssh Version: %{openssh_ver} -Release: 10%{?dist} +Release: 11%{?dist} URL: http://www.openssh.com/portable.html Source0: ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-%{version}.tar.gz Source1: ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-%{version}.tar.gz.asc @@ -686,6 +686,10 @@ test -f %{sysconfig_anaconda} && \ %attr(0755,root,root) %{_libdir}/sshtest/sk-dummy.so %changelog +* Fri Jul 18 2025 Zoltan Fridrich - 9.9p1-11 +- Move the redhat help message to debug1 log level + Resolves: RHEL-93957 + * Thu Jun 26 2025 Dmitry Belyavskiy - 9.9p1-10 - Support for authentication indicators in OpenSSH Resolves: RHEL-40790