summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2007-05-20 15:09:42 +1000
committerDarren Tucker <dtucker@zip.com.au>2007-05-20 15:09:42 +1000
commit26c6662834a0ed748c52044a60ed51b9102e7d54 (patch)
treec04bfd7bfc94fe1b26f6e830f1aad27f3e8c1b3a
parente9405983dc1cf9399e560e70f7c681ba62e09131 (diff)
- djm@cvs.openbsd.org 2007/05/17 20:48:13
[sshconnect2.c] fall back to gethostname() when the outgoing connection is not on a socket, such as is the case when ProxyCommand is used. Gives hostbased auth an opportunity to work; bz#616, report and feedback stuart AT kaloram.com; ok markus@
-rw-r--r--ChangeLog8
-rw-r--r--sshconnect2.c15
2 files changed, 19 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 2bc077cf7..ee16d85a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -22,6 +22,12 @@
22 input/output buffers past the maximum supported by the buffer API and 22 input/output buffers past the maximum supported by the buffer API and
23 promptly fatal() 23 promptly fatal()
24 based on patch from Thue Janus Kristensen; feedback & ok dtucker@ 24 based on patch from Thue Janus Kristensen; feedback & ok dtucker@
25 - djm@cvs.openbsd.org 2007/05/17 20:48:13
26 [sshconnect2.c]
27 fall back to gethostname() when the outgoing connection is not
28 on a socket, such as is the case when ProxyCommand is used.
29 Gives hostbased auth an opportunity to work; bz#616, report
30 and feedback stuart AT kaloram.com; ok markus@
25 31
2620070509 3220070509
27 - (tim) [configure.ac] Bug #1287: Add missing test for ucred.h. 33 - (tim) [configure.ac] Bug #1287: Add missing test for ucred.h.
@@ -2922,4 +2928,4 @@
2922 OpenServer 6 and add osr5bigcrypt support so when someone migrates 2928 OpenServer 6 and add osr5bigcrypt support so when someone migrates
2923 passwords between UnixWare and OpenServer they will still work. OK dtucker@ 2929 passwords between UnixWare and OpenServer they will still work. OK dtucker@
2924 2930
2925$Id: ChangeLog,v 1.4665 2007/05/20 05:09:04 dtucker Exp $ 2931$Id: ChangeLog,v 1.4666 2007/05/20 05:09:42 dtucker Exp $
diff --git a/sshconnect2.c b/sshconnect2.c
index dd971a9f9..2b2740154 100644
--- a/sshconnect2.c
+++ b/sshconnect2.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshconnect2.c,v 1.162 2006/08/30 00:06:51 dtucker Exp $ */ 1/* $OpenBSD: sshconnect2.c,v 1.163 2007/05/17 20:48:13 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * 4 *
@@ -1307,7 +1307,7 @@ userauth_hostbased(Authctxt *authctxt)
1307 Sensitive *sensitive = authctxt->sensitive; 1307 Sensitive *sensitive = authctxt->sensitive;
1308 Buffer b; 1308 Buffer b;
1309 u_char *signature, *blob; 1309 u_char *signature, *blob;
1310 char *chost, *pkalg, *p; 1310 char *chost, *pkalg, *p, myname[NI_MAXHOST];
1311 const char *service; 1311 const char *service;
1312 u_int blen, slen; 1312 u_int blen, slen;
1313 int ok, i, len, found = 0; 1313 int ok, i, len, found = 0;
@@ -1331,7 +1331,16 @@ userauth_hostbased(Authctxt *authctxt)
1331 return 0; 1331 return 0;
1332 } 1332 }
1333 /* figure out a name for the client host */ 1333 /* figure out a name for the client host */
1334 p = get_local_name(packet_get_connection_in()); 1334 p = NULL;
1335 if (packet_connection_is_on_socket())
1336 p = get_local_name(packet_get_connection_in());
1337 if (p == NULL) {
1338 if (gethostname(myname, sizeof(myname)) == -1) {
1339 verbose("userauth_hostbased: gethostname: %s",
1340 strerror(errno));
1341 } else
1342 p = xstrdup(myname);
1343 }
1335 if (p == NULL) { 1344 if (p == NULL) {
1336 error("userauth_hostbased: cannot get local ipaddr/name"); 1345 error("userauth_hostbased: cannot get local ipaddr/name");
1337 key_free(private); 1346 key_free(private);