]> andersk Git - gssapi-openssh.git/blobdiff - openssh/ssh-keyscan.c
Merge from OPENSSH_3_8_1P1_GSSAPI_20040713 to OPENSSH_3_9P1_GSSAPI_20040818.
[gssapi-openssh.git] / openssh / ssh-keyscan.c
index e74c81a9002c7720b2a191f34f6abaf1462cab09..97cfabc4ba0c90f429dc3fbbbaf5bb3b07565ea8 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: ssh-keyscan.c,v 1.47 2004/03/08 09:38:05 djm Exp $");
+RCSID("$OpenBSD: ssh-keyscan.c,v 1.50 2004/08/11 21:44:32 avsm Exp $");
 
 #include "openbsd-compat/sys-queue.h"
 
@@ -50,11 +50,7 @@ int timeout = 5;
 int maxfd;
 #define MAXCON (maxfd - 10)
 
-#ifdef HAVE___PROGNAME
 extern char *__progname;
-#else
-char *__progname;
-#endif
 fd_set *read_wait;
 size_t read_wait_size;
 int ncon;
@@ -350,6 +346,7 @@ keygrab_ssh2(con *c)
            "ssh-dss": "ssh-rsa";
        c->c_kex = kex_setup(myproposal);
        c->c_kex->kex[KEX_DH_GRP1_SHA1] = kexdh_client;
+       c->c_kex->kex[KEX_DH_GRP14_SHA1] = kexdh_client;
        c->c_kex->kex[KEX_DH_GEX_SHA1] = kexgex_client;
        c->c_kex->verify_host_key = hostjump;
 
@@ -397,8 +394,8 @@ tcpconnect(char *host)
                        error("socket: %s", strerror(errno));
                        continue;
                }
-               if (fcntl(s, F_SETFL, O_NONBLOCK) < 0)
-                       fatal("F_SETFL: %s", strerror(errno));
+               if (set_nonblock(s) == -1)
+                       fatal("%s: set_nonblock(%d)", __func__, s);
                if (connect(s, ai->ai_addr, ai->ai_addrlen) < 0 &&
                    errno != EINPROGRESS)
                        error("connect (`%s'): %s", host, strerror(errno));
@@ -498,7 +495,7 @@ congreet(int s)
 
        bufsiz = sizeof(buf);
        cp = buf;
-       while (bufsiz-- && (n = read(s, cp, 1)) == 1 && *cp != '\n') {
+       while (bufsiz-- && (n = atomicio(read, s, cp, 1)) == 1 && *cp != '\n') {
                if (*cp == '\r')
                        *cp = '\n';
                cp++;
@@ -564,7 +561,7 @@ conread(int s)
                congreet(s);
                return;
        }
-       n = read(s, c->c_data + c->c_off, c->c_len - c->c_off);
+       n = atomicio(read, s, c->c_data + c->c_off, c->c_len - c->c_off);
        if (n < 0) {
                error("read (%s): %s", c->c_name, strerror(errno));
                confree(s);
This page took 0.03817 seconds and 4 git commands to generate.