Bugzilla – Attachment 591 Details for
Bug 748
HP-UX 11.11 (aka 11i) needs BROKEN_GETADDRINFO
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Attempt to detect broken getaddrinfo on HP-UX
openssh-getaddrinfo.patch (text/plain), 2.20 KB, created by
Darren Tucker
on 2004-04-04 22:10:51 AEST
(
hide
)
Description:
Attempt to detect broken getaddrinfo on HP-UX
Filename:
MIME Type:
Creator:
Darren Tucker
Created:
2004-04-04 22:10:51 AEST
Size:
2.20 KB
patch
obsolete
>Index: configure.ac >=================================================================== >RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/configure.ac,v >retrieving revision 1.207 >diff -u -r1.207 configure.ac >--- configure.ac 30 Mar 2004 04:03:46 -0000 1.207 >+++ configure.ac 4 Apr 2004 11:42:31 -0000 >@@ -209,10 +209,7 @@ > AC_DEFINE(DISABLE_UTMP) > AC_DEFINE(LOCKED_PASSWD_STRING, "*") > AC_DEFINE(SPT_TYPE,SPT_PSTAT) >- case "$host" in >- *-*-hpux11.11*) >- AC_DEFINE(BROKEN_GETADDRINFO);; >- esac >+ AC_CHECK_FUNC(getaddrinfo, [ check_for_hpux_broken_getaddrinfo=1 ]) > LIBS="$LIBS -lsec" > AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***])) > ;; >@@ -980,6 +977,74 @@ > [ > AC_MSG_RESULT(no) > AC_DEFINE(SSHD_ACQUIRES_CTTY) >+ ] >+ ) >+fi >+ >+if test ! -z "$check_for_hpux_broken_getaddrinfo"; then >+ AC_MSG_CHECKING(for broken getaddrinfo) >+ AC_TRY_RUN( >+ [ >+#include <stdio.h> >+#include <sys/socket.h> >+#include <netdb.h> >+#include <errno.h> >+#include <netinet/in.h> >+ >+#define TEST_PORT "2222" >+ >+int >+main(void) >+{ >+ int err, sock; >+ struct addrinfo *gai_ai, *ai, hints; >+ char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL; >+ >+ memset(&hints, 0, sizeof(hints)); >+ hints.ai_family = PF_UNSPEC; >+ hints.ai_socktype = SOCK_STREAM; >+ hints.ai_flags = AI_PASSIVE; >+ >+ err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai); >+ if (err != 0) { >+ fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err)); >+ exit(1); >+ } >+ >+ for (ai = gai_ai; ai != NULL; ai = ai->ai_next) { >+ if (ai->ai_family != AF_INET6) >+ continue; >+ >+ err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop, >+ sizeof(ntop), strport, sizeof(strport), >+ NI_NUMERICHOST|NI_NUMERICSERV); >+ >+ if (err != 0) { >+ if (err == EAI_SYSTEM) >+ perror("getnameinfo EAI_SYSTEM"); >+ else >+ fprintf(stderr, "getnameinfo failed: %s\n", >+ gai_strerror(err)); >+ exit(2); >+ } >+ >+ sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); >+ if (sock < 0) >+ perror("socket"); >+ if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) { >+ if (errno == EBADF) >+ exit(3); >+ } >+ } >+ exit(0); >+} >+ ], >+ [ >+ AC_MSG_RESULT(yes) >+ ], >+ [ >+ AC_MSG_RESULT(no) >+ AC_DEFINE(BROKEN_GETADDRINFO) > ] > ) > fi
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 748
:
574
| 591 |
592