summaryrefslogtreecommitdiff
path: root/ssh-keyscan.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2010-01-10 10:31:12 +1100
committerDarren Tucker <dtucker@zip.com.au>2010-01-10 10:31:12 +1100
commit7bd98e7f74ebd8bd32157b607acedcb68201b7de (patch)
treeb62a62fcc4def0b22e48f6dde5e414a77e4d2244 /ssh-keyscan.c
parent8c65f646a93ed2f61da65ba0ecf65a99bd585b79 (diff)
- dtucker@cvs.openbsd.org 2010/01/09 23:04:13
[channels.c ssh.1 servconf.c sshd_config.5 sshd.c channels.h servconf.h ssh-keyscan.1 ssh-keyscan.c readconf.c sshconnect.c misc.c ssh.c readconf.h scp.1 sftp.1 ssh_config.5 misc.h] Remove RoutingDomain from ssh since it's now not needed. It can be replaced with "route exec" or "nc -V" as a proxycommand. "route exec" also ensures that trafic such as DNS lookups stays withing the specified routingdomain. For example (from reyk): # route -T 2 exec /usr/sbin/sshd or inherited from the parent process $ route -T 2 exec sh $ ssh 10.1.2.3 ok deraadt@ markus@ stevesk@ reyk@
Diffstat (limited to 'ssh-keyscan.c')
-rw-r--r--ssh-keyscan.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/ssh-keyscan.c b/ssh-keyscan.c
index faeb9e13e..7afe446ae 100644
--- a/ssh-keyscan.c
+++ b/ssh-keyscan.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-keyscan.c,v 1.80 2009/12/25 19:40:21 stevesk Exp $ */ 1/* $OpenBSD: ssh-keyscan.c,v 1.81 2010/01/09 23:04:13 dtucker 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 *
@@ -68,9 +68,6 @@ int timeout = 5;
68int maxfd; 68int maxfd;
69#define MAXCON (maxfd - 10) 69#define MAXCON (maxfd - 10)
70 70
71/* The default routing domain */
72int scan_rdomain = -1;
73
74extern char *__progname; 71extern char *__progname;
75fd_set *read_wait; 72fd_set *read_wait;
76size_t read_wait_nfdset; 73size_t read_wait_nfdset;
@@ -415,8 +412,7 @@ tcpconnect(char *host)
415 if ((gaierr = getaddrinfo(host, strport, &hints, &aitop)) != 0) 412 if ((gaierr = getaddrinfo(host, strport, &hints, &aitop)) != 0)
416 fatal("getaddrinfo %s: %s", host, ssh_gai_strerror(gaierr)); 413 fatal("getaddrinfo %s: %s", host, ssh_gai_strerror(gaierr));
417 for (ai = aitop; ai; ai = ai->ai_next) { 414 for (ai = aitop; ai; ai = ai->ai_next) {
418 s = socket_rdomain(ai->ai_family, ai->ai_socktype, 415 s = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
419 ai->ai_protocol, scan_rdomain);
420 if (s < 0) { 416 if (s < 0) {
421 error("socket: %s", strerror(errno)); 417 error("socket: %s", strerror(errno));
422 continue; 418 continue;
@@ -719,7 +715,7 @@ usage(void)
719{ 715{
720 fprintf(stderr, 716 fprintf(stderr,
721 "usage: %s [-46Hv] [-f file] [-p port] [-T timeout] [-t type]\n" 717 "usage: %s [-46Hv] [-f file] [-p port] [-T timeout] [-t type]\n"
722 "\t\t [-V rdomain] [host | addrlist namelist] ...\n", 718 "\t\t [host | addrlist namelist] ...\n",
723 __progname); 719 __progname);
724 exit(1); 720 exit(1);
725} 721}
@@ -745,7 +741,7 @@ main(int argc, char **argv)
745 if (argc <= 1) 741 if (argc <= 1)
746 usage(); 742 usage();
747 743
748 while ((opt = getopt(argc, argv, "Hv46p:T:t:f:V:")) != -1) { 744 while ((opt = getopt(argc, argv, "Hv46p:T:t:f:")) != -1) {
749 switch (opt) { 745 switch (opt) {
750 case 'H': 746 case 'H':
751 hash_hosts = 1; 747 hash_hosts = 1;
@@ -806,13 +802,6 @@ main(int argc, char **argv)
806 case '6': 802 case '6':
807 IPv4or6 = AF_INET6; 803 IPv4or6 = AF_INET6;
808 break; 804 break;
809 case 'V':
810 scan_rdomain = a2rdomain(optarg);
811 if (scan_rdomain == -1) {
812 fprintf(stderr, "Bad rdomain '%s'\n", optarg);
813 exit(1);
814 }
815 break;
816 case '?': 805 case '?':
817 default: 806 default:
818 usage(); 807 usage();