Bugzilla – Attachment 1612 Details for
Bug 1569
Hostbased auth fails when using a proxy command
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Allow get_local_name() to handle a socket or pipe.
get_local_name.diff (text/plain), 2.78 KB, created by
Iain Morgan
on 2009-03-10 05:16:47 AEDT
(
hide
)
Description:
Allow get_local_name() to handle a socket or pipe.
Filename:
MIME Type:
Creator:
Iain Morgan
Created:
2009-03-10 05:16:47 AEDT
Size:
2.78 KB
patch
obsolete
>Index: canohost.c >=================================================================== >RCS file: /cvs/openssh/canohost.c,v >retrieving revision 1.74 >diff -u -r1.74 canohost.c >--- canohost.c 14 Feb 2009 05:28:21 -0000 1.74 >+++ canohost.c 8 Mar 2009 00:42:14 -0000 >@@ -27,6 +27,7 @@ > #include <stdlib.h> > #include <string.h> > #include <stdarg.h> >+#include <unistd.h> > > #include "xmalloc.h" > #include "packet.h" >@@ -299,9 +300,22 @@ > } > > char * >-get_local_name(int sock) >+get_local_name(int fd) > { >- return get_socket_address(sock, 0, NI_NAMEREQD); >+ char *host, myname[NI_MAXHOST]; >+ >+ /* Assume we were passwd a socket */ >+ if ((host = get_socket_address(fd, 0, NI_NAMEREQD)) != NULL) >+ return host; >+ >+ /* Handle the case where we were passed a pipe */ >+ if (gethostname(myname, sizeof(myname)) == -1) { >+ verbose("get_local_name: gethostname: %s", strerror(errno)); >+ } else { >+ host = xstrdup(myname); >+ } >+ >+ return host; > } > > /* >Index: ssh-keysign.c >=================================================================== >RCS file: /cvs/openssh/ssh-keysign.c,v >retrieving revision 1.37 >diff -u -r1.37 ssh-keysign.c >--- ssh-keysign.c 1 Sep 2006 05:38:37 -0000 1.37 >+++ ssh-keysign.c 8 Mar 2009 00:42:15 -0000 >@@ -222,7 +222,7 @@ > if ((fd == STDIN_FILENO) || (fd == STDOUT_FILENO)) > fatal("bad fd"); > if ((host = get_local_name(fd)) == NULL) >- fatal("cannot get sockname for fd"); >+ fatal("cannot get local name for fd"); > > data = buffer_get_string(&b, &dlen); > if (valid_request(pw, host, &key, data, dlen) < 0) >Index: sshconnect2.c >=================================================================== >RCS file: /cvs/openssh/sshconnect2.c,v >retrieving revision 1.163 >diff -u -r1.163 sshconnect2.c >--- sshconnect2.c 5 Mar 2009 13:58:22 -0000 1.163 >+++ sshconnect2.c 8 Mar 2009 00:42:15 -0000 >@@ -1488,7 +1488,7 @@ > debug2("ssh_keysign called"); > > if (stat(_PATH_SSH_KEY_SIGN, &st) < 0) { >- error("ssh_keysign: no installed: %s", strerror(errno)); >+ error("ssh_keysign: not installed: %s", strerror(errno)); > return -1; > } > if (fflush(stdout) != 0) >@@ -1558,7 +1558,7 @@ > Sensitive *sensitive = authctxt->sensitive; > Buffer b; > u_char *signature, *blob; >- char *chost, *pkalg, *p, myname[NI_MAXHOST]; >+ char *chost, *pkalg, *p; > const char *service; > u_int blen, slen; > int ok, i, len, found = 0; >@@ -1582,16 +1582,7 @@ > return 0; > } > /* figure out a name for the client host */ >- p = NULL; >- if (packet_connection_is_on_socket()) >- p = get_local_name(packet_get_connection_in()); >- if (p == NULL) { >- if (gethostname(myname, sizeof(myname)) == -1) { >- verbose("userauth_hostbased: gethostname: %s", >- strerror(errno)); >- } else >- p = xstrdup(myname); >- } >+ p = get_local_name(packet_get_connection_in()); > if (p == NULL) { > error("userauth_hostbased: cannot get local ipaddr/name"); > key_free(private);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1569
: 1612