Problem with ssh-keyscan: no hostkey alg

Markus Friedl markus at openbsd.org
Wed Feb 13 23:47:49 EST 2002


On Tue, Feb 12, 2002 at 06:37:11PM +0100, Patrick Maigron wrote:
> When this is the case for 2 hosts, this message appears twice AND
> SSH-KEYSCAN STOPS QUERYING, which means that no keys at all are
> returned for the following hosts.

this ugly hack should help.

fatal() cannot be called twice.

Index: log.c
===================================================================
RCS file: /cvs/openssh_cvs/log.c,v
retrieving revision 1.19
diff -u -r1.19 log.c
--- log.c	4 Jul 2001 04:46:58 -0000	1.19
+++ log.c	13 Feb 2002 12:48:35 -0000
@@ -228,16 +228,17 @@
 	    (u_long) proc, (u_long) context);
 }
 
+int ssh_fatal_cleanup_running = 0;
+
 /* Cleanup and exit */
 void
 fatal_cleanup(void)
 {
 	struct fatal_cleanup *cu, *next_cu;
-	static int called = 0;
 
-	if (called)
+	if (ssh_fatal_cleanup_running)
 		exit(255);
-	called = 1;
+	ssh_fatal_cleanup_running = 1;
 	/* Call cleanup functions. */
 	for (cu = fatal_cleanups; cu; cu = next_cu) {
 		next_cu = cu->next;
Index: ssh-keyscan.c
===================================================================
RCS file: /cvs/openssh_cvs/ssh-keyscan.c,v
retrieving revision 1.37
diff -u -r1.37 ssh-keyscan.c
--- ssh-keyscan.c	14 Nov 2001 21:40:45 -0000	1.37
+++ ssh-keyscan.c	13 Feb 2002 12:48:35 -0000
@@ -659,8 +659,12 @@
 static void
 fatal_callback(void *arg)
 {
-	if (nonfatal_fatal)
+	extern int ssh_fatal_cleanup_running;
+
+	if (nonfatal_fatal) {
+		ssh_fatal_cleanup_running = 0;
 		longjmp(kexjmp, -1);
+	}
 }
 
 static void



More information about the openssh-unix-dev mailing list