summaryrefslogtreecommitdiff
path: root/ssh-keyscan.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2015-01-30 10:44:49 +0000
committerDamien Miller <djm@mindrot.org>2015-01-30 22:47:00 +1100
commit802660cb70453fa4d230cb0233bc1bbdf8328de1 (patch)
tree1a8b31d42585419acfbbe84b13b06adde9ababcb /ssh-keyscan.c
parent86936ec245a15c7abe71a0722610998b0a28b194 (diff)
upstream commit
set a timeout to prevent hangs when talking to busted servers; ok markus@
Diffstat (limited to 'ssh-keyscan.c')
-rw-r--r--ssh-keyscan.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ssh-keyscan.c b/ssh-keyscan.c
index 989f7ecce..2b1303026 100644
--- a/ssh-keyscan.c
+++ b/ssh-keyscan.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-keyscan.c,v 1.98 2015/01/30 01:13:33 djm Exp $ */ 1/* $OpenBSD: ssh-keyscan.c,v 1.99 2015/01/30 10:44:49 djm Exp $ */
2/* 2/*
3 * Copyright 1995, 1996 by David Mazieres <dm@lcs.mit.edu>. 3 * Copyright 1995, 1996 by David Mazieres <dm@lcs.mit.edu>.
4 * 4 *
@@ -468,6 +468,7 @@ congreet(int s)
468 *cp = '\0'; 468 *cp = '\0';
469 if ((c->c_ssh = ssh_packet_set_connection(NULL, s, s)) == NULL) 469 if ((c->c_ssh = ssh_packet_set_connection(NULL, s, s)) == NULL)
470 fatal("ssh_packet_set_connection failed"); 470 fatal("ssh_packet_set_connection failed");
471 ssh_packet_set_timeout(c->c_ssh, timeout, 1);
471 ssh_set_app_data(c->c_ssh, c); /* back link */ 472 ssh_set_app_data(c->c_ssh, c); /* back link */
472 if (sscanf(buf, "SSH-%d.%d-%[^\n]\n", 473 if (sscanf(buf, "SSH-%d.%d-%[^\n]\n",
473 &remote_major, &remote_minor, remote_version) == 3) 474 &remote_major, &remote_minor, remote_version) == 3)