diff options
author | Darren Tucker <dtucker@zip.com.au> | 2005-01-20 11:00:46 +1100 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2005-01-20 11:00:46 +1100 |
commit | b2161e37f5fb13ffaa3f70ad436ecec2ec13bfc4 (patch) | |
tree | 329d98a10e2a5fbc5b58af83f6b2f1559132eabd | |
parent | 0f3832322230ebc4b0fe5a2aca5cf9aaa8b0c3c1 (diff) |
- markus@cvs.openbsd.org 2005/01/05 08:51:32
[sshconnect.c]
remove dead code, log connect() failures with level error, ok djm@
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | sshconnect.c | 20 |
2 files changed, 7 insertions, 18 deletions
@@ -10,6 +10,9 @@ | |||
10 | [servconf.c servconf.h sshd.c sshd_config sshd_config.5] | 10 | [servconf.c servconf.h sshd.c sshd_config sshd_config.5] |
11 | bz #898: support AddressFamily in sshd_config. from | 11 | bz #898: support AddressFamily in sshd_config. from |
12 | peak@argo.troja.mff.cuni.cz; ok deraadt@ | 12 | peak@argo.troja.mff.cuni.cz; ok deraadt@ |
13 | - markus@cvs.openbsd.org 2005/01/05 08:51:32 | ||
14 | [sshconnect.c] | ||
15 | remove dead code, log connect() failures with level error, ok djm@ | ||
13 | 16 | ||
14 | 20050118 | 17 | 20050118 |
15 | - (dtucker) [INSTALL Makefile.in configure.ac survey.sh.in] Implement | 18 | - (dtucker) [INSTALL Makefile.in configure.ac survey.sh.in] Implement |
@@ -1982,4 +1985,4 @@ | |||
1982 | - (djm) Trim deprecated options from INSTALL. Mention UsePAM | 1985 | - (djm) Trim deprecated options from INSTALL. Mention UsePAM |
1983 | - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu | 1986 | - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu |
1984 | 1987 | ||
1985 | $Id: ChangeLog,v 1.3611 2005/01/19 23:57:56 dtucker Exp $ | 1988 | $Id: ChangeLog,v 1.3612 2005/01/20 00:00:46 dtucker Exp $ |
diff --git a/sshconnect.c b/sshconnect.c index 11008e544..33ec4753a 100644 --- a/sshconnect.c +++ b/sshconnect.c | |||
@@ -13,7 +13,7 @@ | |||
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include "includes.h" | 15 | #include "includes.h" |
16 | RCSID("$OpenBSD: sshconnect.c,v 1.158 2004/06/21 17:36:31 avsm Exp $"); | 16 | RCSID("$OpenBSD: sshconnect.c,v 1.159 2005/01/05 08:51:32 markus Exp $"); |
17 | 17 | ||
18 | #include <openssl/bn.h> | 18 | #include <openssl/bn.h> |
19 | 19 | ||
@@ -297,12 +297,6 @@ timeout_connect(int sockfd, const struct sockaddr *serv_addr, | |||
297 | * second). If proxy_command is non-NULL, it specifies the command (with %h | 297 | * second). If proxy_command is non-NULL, it specifies the command (with %h |
298 | * and %p substituted for host and port, respectively) to use to contact | 298 | * and %p substituted for host and port, respectively) to use to contact |
299 | * the daemon. | 299 | * the daemon. |
300 | * Return values: | ||
301 | * 0 for OK | ||
302 | * ECONNREFUSED if we got a "Connection Refused" by the peer on any address | ||
303 | * ECONNABORTED if we failed without a "Connection refused" | ||
304 | * Suitable error messages for the connection failure will already have been | ||
305 | * printed. | ||
306 | */ | 300 | */ |
307 | int | 301 | int |
308 | ssh_connect(const char *host, struct sockaddr_storage * hostaddr, | 302 | ssh_connect(const char *host, struct sockaddr_storage * hostaddr, |
@@ -315,12 +309,6 @@ ssh_connect(const char *host, struct sockaddr_storage * hostaddr, | |||
315 | char ntop[NI_MAXHOST], strport[NI_MAXSERV]; | 309 | char ntop[NI_MAXHOST], strport[NI_MAXSERV]; |
316 | struct addrinfo hints, *ai, *aitop; | 310 | struct addrinfo hints, *ai, *aitop; |
317 | struct servent *sp; | 311 | struct servent *sp; |
318 | /* | ||
319 | * Did we get only other errors than "Connection refused" (which | ||
320 | * should block fallback to rsh and similar), or did we get at least | ||
321 | * one "Connection refused"? | ||
322 | */ | ||
323 | int full_failure = 1; | ||
324 | 312 | ||
325 | debug2("ssh_connect: needpriv %d", needpriv); | 313 | debug2("ssh_connect: needpriv %d", needpriv); |
326 | 314 | ||
@@ -381,8 +369,6 @@ ssh_connect(const char *host, struct sockaddr_storage * hostaddr, | |||
381 | memcpy(hostaddr, ai->ai_addr, ai->ai_addrlen); | 369 | memcpy(hostaddr, ai->ai_addr, ai->ai_addrlen); |
382 | break; | 370 | break; |
383 | } else { | 371 | } else { |
384 | if (errno == ECONNREFUSED) | ||
385 | full_failure = 0; | ||
386 | debug("connect to address %s port %s: %s", | 372 | debug("connect to address %s port %s: %s", |
387 | ntop, strport, strerror(errno)); | 373 | ntop, strport, strerror(errno)); |
388 | /* | 374 | /* |
@@ -408,9 +394,9 @@ ssh_connect(const char *host, struct sockaddr_storage * hostaddr, | |||
408 | 394 | ||
409 | /* Return failure if we didn't get a successful connection. */ | 395 | /* Return failure if we didn't get a successful connection. */ |
410 | if (attempt >= connection_attempts) { | 396 | if (attempt >= connection_attempts) { |
411 | logit("ssh: connect to host %s port %s: %s", | 397 | error("ssh: connect to host %s port %s: %s", |
412 | host, strport, strerror(errno)); | 398 | host, strport, strerror(errno)); |
413 | return full_failure ? ECONNABORTED : ECONNREFUSED; | 399 | return (-1); |
414 | } | 400 | } |
415 | 401 | ||
416 | debug("Connection established."); | 402 | debug("Connection established."); |