vishalmishra434 / rpms / openssh

Forked from rpms/openssh a month ago
Clone
Dmitry Belyavskiy 84ad70
diff -up openssh-8.7p1/ssh.c.xxx openssh-8.7p1/ssh.c
Dmitry Belyavskiy 84ad70
--- openssh-8.7p1/ssh.c.xxx	2024-09-11 14:24:06.711088878 +0200
Dmitry Belyavskiy 84ad70
+++ openssh-8.7p1/ssh.c	2024-09-11 14:35:12.883765718 +0200
Dmitry Belyavskiy ebb51c
@@ -175,6 +175,16 @@ extern int muxserver_sock;
Dmitry Belyavskiy 84ad70
 extern u_int muxclient_command;
Dmitry Belyavskiy 84ad70
 
Dmitry Belyavskiy 84ad70
 /* Prints a help message to the user.  This function never returns. */
Dmitry Belyavskiy 84ad70
+static void
Dmitry Belyavskiy 84ad70
+redhat_usage(void)
Dmitry Belyavskiy 84ad70
+{
Dmitry Belyavskiy ebb51c
+    if(isatty(fileno(stderr))) {
Dmitry Belyavskiy 84ad70
+	fprintf(stderr,
Dmitry Belyavskiy 84ad70
+"\nYou can find some explanations for typical errors at this link:\n"
Dmitry Belyavskiy 84ad70
+"	    https://red.ht/support_rhel_ssh\n"
Dmitry Belyavskiy 84ad70
+	);
Dmitry Belyavskiy ebb51c
+    }
Dmitry Belyavskiy 84ad70
+}
Dmitry Belyavskiy 84ad70
 
Dmitry Belyavskiy 84ad70
 static void
Dmitry Belyavskiy 84ad70
 usage(void)
Dmitry Belyavskiy 84ad70
@@ -188,6 +196,7 @@ usage(void)
Dmitry Belyavskiy 84ad70
 "           destination [command [argument ...]]\n"
Dmitry Belyavskiy 84ad70
 "       ssh [-Q query_option]\n"
Dmitry Belyavskiy 84ad70
 	);
Dmitry Belyavskiy 84ad70
+	redhat_usage();
Dmitry Belyavskiy 84ad70
 	exit(255);
Dmitry Belyavskiy 84ad70
 }
Dmitry Belyavskiy 84ad70
 
Dmitry Belyavskiy 84ad70
@@ -1609,8 +1618,10 @@ main(int ac, char **av)
Dmitry Belyavskiy 84ad70
 	/* Open a connection to the remote host. */
Dmitry Belyavskiy 84ad70
 	if (ssh_connect(ssh, host, options.host_arg, addrs, &hostaddr,
Dmitry Belyavskiy 84ad70
 	    options.port, options.connection_attempts,
Dmitry Belyavskiy 84ad70
-	    &timeout_ms, options.tcp_keep_alive) != 0)
Dmitry Belyavskiy 84ad70
+	    &timeout_ms, options.tcp_keep_alive) != 0) {
Dmitry Belyavskiy 84ad70
+		redhat_usage();
Dmitry Belyavskiy 84ad70
 		exit(255);
Dmitry Belyavskiy 84ad70
+	}
Dmitry Belyavskiy 84ad70
 
Dmitry Belyavskiy 84ad70
 	if (addrs != NULL)
Dmitry Belyavskiy 84ad70
 		freeaddrinfo(addrs);