=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/ssh-keyscan.c,v retrieving revision 1.47.2.2 retrieving revision 1.48 diff -u -r1.47.2.2 -r1.48 --- src/usr.bin/ssh/ssh-keyscan.c 2005/03/10 17:15:05 1.47.2.2 +++ src/usr.bin/ssh/ssh-keyscan.c 2004/06/13 12:53:24 1.48 @@ -7,7 +7,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-keyscan.c,v 1.47.2.2 2005/03/10 17:15:05 brad Exp $"); +RCSID("$OpenBSD: ssh-keyscan.c,v 1.48 2004/06/13 12:53:24 djm Exp $"); #include #include @@ -29,7 +29,6 @@ #include "log.h" #include "atomicio.h" #include "misc.h" -#include "hostfile.h" /* Flag indicating whether IPv4 or IPv6. This can be set on the command line. Default value is AF_UNSPEC means both IPv4 and IPv6. */ @@ -43,8 +42,6 @@ int get_keytypes = KT_RSA1; /* Get only RSA1 keys by default */ -int hash_hosts = 0; /* Hash hostname on output */ - #define MAXMAXFD 256 /* The number of seconds after which to give up on a TCP connection */ @@ -360,14 +357,10 @@ static void keyprint(con *c, Key *key) { - char *host = c->c_output_name ? c->c_output_name : c->c_name; - if (!key) return; - if (hash_hosts && (host = host_hash(host, NULL, 0)) == NULL) - fatal("host_hash failed"); - fprintf(stdout, "%s ", host); + fprintf(stdout, "%s ", c->c_output_name ? c->c_output_name : c->c_name); key_write(key, stdout); fputs("\n", stdout); } @@ -391,8 +384,8 @@ error("socket: %s", strerror(errno)); continue; } - if (set_nonblock(s) == -1) - fatal("%s: set_nonblock(%d)", __func__, s); + if (fcntl(s, F_SETFL, O_NONBLOCK) < 0) + fatal("F_SETFL: %s", strerror(errno)); if (connect(s, ai->ai_addr, ai->ai_addrlen) < 0 && errno != EINPROGRESS) error("connect (`%s'): %s", host, strerror(errno)); @@ -492,7 +485,7 @@ bufsiz = sizeof(buf); cp = buf; - while (bufsiz-- && (n = atomicio(read, s, cp, 1)) == 1 && *cp != '\n') { + while (bufsiz-- && (n = read(s, cp, 1)) == 1 && *cp != '\n') { if (*cp == '\r') *cp = '\n'; cp++; @@ -558,7 +551,7 @@ congreet(s); return; } - n = atomicio(read, s, c->c_data + c->c_off, c->c_len - c->c_off); + n = 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); @@ -674,7 +667,7 @@ static void usage(void) { - fprintf(stderr, "usage: %s [-46Hv] [-f file] [-p port] [-T timeout] [-t type]\n" + fprintf(stderr, "usage: %s [-v46] [-p port] [-T timeout] [-t type] [-f file]\n" "\t\t [host | addrlist namelist] [...]\n", __progname); exit(1); @@ -695,11 +688,8 @@ if (argc <= 1) usage(); - while ((opt = getopt(argc, argv, "Hv46p:T:t:f:")) != -1) { + while ((opt = getopt(argc, argv, "v46p:T:t:f:")) != -1) { switch (opt) { - case 'H': - hash_hosts = 1; - break; case 'p': ssh_port = a2port(optarg); if (ssh_port == 0) {