rcolebaugh / rpms / openssh

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