summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--configure.ac77
2 files changed, 75 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index c31cc19a1..b21a809b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
120040406 120040406
2 - (dtucker) [acconfig.h configure.ac defines.h] Bug #820: don't use 2 - (dtucker) [acconfig.h configure.ac defines.h] Bug #820: don't use
3 updwtmpx() on IRIX since it seems to clobber utmp. ok djm@ 3 updwtmpx() on IRIX since it seems to clobber utmp. ok djm@
4 - (dtucker) [configure.ac] Bug #816, #748 (again): Attempt to detect
5 broken getaddrinfo and friends on HP-UX. ok djm@
4 6
520040330 720040330
6 - (dtucker) [configure.ac] Bug #811: Use "!" for LOCKED_PASSWD_PREFIX on 8 - (dtucker) [configure.ac] Bug #811: Use "!" for LOCKED_PASSWD_PREFIX on
@@ -934,4 +936,4 @@
934 - (djm) Trim deprecated options from INSTALL. Mention UsePAM 936 - (djm) Trim deprecated options from INSTALL. Mention UsePAM
935 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu 937 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
936 938
937$Id: ChangeLog,v 1.3300 2004/04/06 11:31:12 dtucker Exp $ 939$Id: ChangeLog,v 1.3301 2004/04/06 11:39:02 dtucker Exp $
diff --git a/configure.ac b/configure.ac
index 2d2147518..3f515c453 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
1# $Id: configure.ac,v 1.208 2004/04/06 11:31:13 dtucker Exp $ 1# $Id: configure.ac,v 1.209 2004/04/06 11:39:02 dtucker Exp $
2# 2#
3# Copyright (c) 1999-2004 Damien Miller 3# Copyright (c) 1999-2004 Damien Miller
4# 4#
@@ -209,10 +209,7 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
209 AC_DEFINE(DISABLE_UTMP) 209 AC_DEFINE(DISABLE_UTMP)
210 AC_DEFINE(LOCKED_PASSWD_STRING, "*") 210 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
211 AC_DEFINE(SPT_TYPE,SPT_PSTAT) 211 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
212 case "$host" in 212 check_for_hpux_broken_getaddrinfo=1
213 *-*-hpux11.11*)
214 AC_DEFINE(BROKEN_GETADDRINFO);;
215 esac
216 LIBS="$LIBS -lsec" 213 LIBS="$LIBS -lsec"
217 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***])) 214 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
218 ;; 215 ;;
@@ -985,6 +982,76 @@ main()
985 ) 982 )
986fi 983fi
987 984
985check_for_hpux_broken_getaddrinfo=1
986
987if test "x$ac_cv_func_getaddrinfo" = "xyes" -a "x$check_for_hpux_broken_getaddrinfo" = "x1"; then
988 AC_MSG_CHECKING(if getaddrinfo seems to work)
989 AC_TRY_RUN(
990 [
991#include <stdio.h>
992#include <sys/socket.h>
993#include <netdb.h>
994#include <errno.h>
995#include <netinet/in.h>
996
997#define TEST_PORT "2222"
998
999int
1000main(void)
1001{
1002 int err, sock;
1003 struct addrinfo *gai_ai, *ai, hints;
1004 char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL;
1005
1006 memset(&hints, 0, sizeof(hints));
1007 hints.ai_family = PF_UNSPEC;
1008 hints.ai_socktype = SOCK_STREAM;
1009 hints.ai_flags = AI_PASSIVE;
1010
1011 err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
1012 if (err != 0) {
1013 fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
1014 exit(1);
1015 }
1016
1017 for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
1018 if (ai->ai_family != AF_INET6)
1019 continue;
1020
1021 err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop,
1022 sizeof(ntop), strport, sizeof(strport),
1023 NI_NUMERICHOST|NI_NUMERICSERV);
1024
1025 if (err != 0) {
1026 if (err == EAI_SYSTEM)
1027 perror("getnameinfo EAI_SYSTEM");
1028 else
1029 fprintf(stderr, "getnameinfo failed: %s\n",
1030 gai_strerror(err));
1031 exit(2);
1032 }
1033
1034 sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
1035 if (sock < 0)
1036 perror("socket");
1037 if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) {
1038 if (errno == EBADF)
1039 exit(3);
1040 }
1041 }
1042 exit(0);
1043}
1044 ],
1045 [
1046 AC_MSG_RESULT(yes)
1047 ],
1048 [
1049 AC_MSG_RESULT(no)
1050 AC_DEFINE(BROKEN_GETADDRINFO)
1051 ]
1052 )
1053fi
1054
988AC_FUNC_GETPGRP 1055AC_FUNC_GETPGRP
989 1056
990# Check for PAM libs 1057# Check for PAM libs