]> andersk Git - openssh.git/blobdiff - sshconnect.c
- (tim) [contrib/cygwin/README] add minires-devel requirement. Patch from
[openssh.git] / sshconnect.c
index 80b45c79ef32b5918f78b57e97050a8f7161ca64..11008e544ff6c8d848e936682e80b7c7f223363e 100644 (file)
@@ -13,7 +13,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: sshconnect.c,v 1.155 2003/12/09 21:53:37 markus Exp $");
+RCSID("$OpenBSD: sshconnect.c,v 1.158 2004/06/21 17:36:31 avsm Exp $");
 
 #include <openssl/bn.h>
 
@@ -31,7 +31,6 @@ RCSID("$OpenBSD: sshconnect.c,v 1.155 2003/12/09 21:53:37 markus Exp $");
 #include "readconf.h"
 #include "atomicio.h"
 #include "misc.h"
-#include "readpass.h"
 
 #include "dns.h"
 
@@ -231,12 +230,12 @@ timeout_connect(int sockfd, const struct sockaddr *serv_addr,
        if (timeout <= 0)
                return (connect(sockfd, serv_addr, addrlen));
 
-       if (fcntl(sockfd, F_SETFL, O_NONBLOCK) < 0)
-               return (-1);
-
+       set_nonblock(sockfd);
        rc = connect(sockfd, serv_addr, addrlen);
-       if (rc == 0)
+       if (rc == 0) {
+               unset_nonblock(sockfd);
                return (0);
+       }
        if (errno != EINPROGRESS)
                return (-1);
 
@@ -277,6 +276,7 @@ timeout_connect(int sockfd, const struct sockaddr *serv_addr,
                        break;
                }
                result = 0;
+               unset_nonblock(sockfd);
                break;
        default:
                /* Should not occur */
@@ -767,19 +767,19 @@ check_host_key(char *host, struct sockaddr *hostaddr, Key *host_key,
                break;
        case HOST_CHANGED:
                if (options.check_host_ip && host_ip_differ) {
-                       char *msg;
+                       char *key_msg;
                        if (ip_status == HOST_NEW)
-                               msg = "is unknown";
+                               key_msg = "is unknown";
                        else if (ip_status == HOST_OK)
-                               msg = "is unchanged";
+                               key_msg = "is unchanged";
                        else
-                               msg = "has a different value";
+                               key_msg = "has a different value";
                        error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
                        error("@       WARNING: POSSIBLE DNS SPOOFING DETECTED!          @");
                        error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
                        error("The %s host key for %s has changed,", type, host);
                        error("and the key for the according IP address %s", ip);
-                       error("%s. This could either mean that", msg);
+                       error("%s. This could either mean that", key_msg);
                        error("DNS SPOOFING is happening or the IP address for the host");
                        error("and its host key have changed at the same time.");
                        if (ip_status != HOST_NEW)
This page took 0.068107 seconds and 4 git commands to generate.