summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2003-09-22 12:09:17 +1000
committerDarren Tucker <dtucker@zip.com.au>2003-09-22 12:09:17 +1000
commit7724e94d041d267b5b9915b37d44c0986b12fe6d (patch)
tree34a347388684277c2a11dd10b050355c150ef407
parent2a2e64ea4004c879497b29466f8275a90d9cc009 (diff)
- (dtucker) [configure.ac openbsd-compat/fake-rfc2553.c
openbsd-compat/fake-rfc2553.h] Bug #659: Test for and handle systems with where gai_strerror is defined as "const char *". Part of patch supplied by bugzilla-openssh at thewrittenword.com
-rw-r--r--ChangeLog6
-rw-r--r--configure.ac19
-rw-r--r--openbsd-compat/fake-rfc2553.c6
-rw-r--r--openbsd-compat/fake-rfc2553.h4
4 files changed, 29 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 77ca50246..933b8094d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,10 @@
9 Patch from david.haughton at ncr.com 9 Patch from david.haughton at ncr.com
10 - (dtucker) [configure.ac] Bug #659: uid swapping issues on IRIX 6. 10 - (dtucker) [configure.ac] Bug #659: uid swapping issues on IRIX 6.
11 Part of patch supplied by bugzilla-openssh at thewrittenword.com 11 Part of patch supplied by bugzilla-openssh at thewrittenword.com
12 - (dtucker) [configure.ac openbsd-compat/fake-rfc2553.c
13 openbsd-compat/fake-rfc2553.h] Bug #659: Test for and handle systems with
14 where gai_strerror is defined as "const char *". Part of patch supplied
15 by bugzilla-openssh at thewrittenword.com
12 16
1320030919 1720030919
14 - (djm) Bug #683: Remove reference to --with-ipv4-default from INSTALL; 18 - (djm) Bug #683: Remove reference to --with-ipv4-default from INSTALL;
@@ -1141,4 +1145,4 @@
1141 - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. 1145 - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo.
1142 Report from murple@murple.net, diagnosis from dtucker@zip.com.au 1146 Report from murple@murple.net, diagnosis from dtucker@zip.com.au
1143 1147
1144$Id: ChangeLog,v 1.2994.2.18 2003/09/22 01:58:44 dtucker Exp $ 1148$Id: ChangeLog,v 1.2994.2.19 2003/09/22 02:09:17 dtucker Exp $
diff --git a/configure.ac b/configure.ac
index 5cf7d9097..c5f98468f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
1# $Id: configure.ac,v 1.154.2.6 2003/09/22 01:58:44 dtucker Exp $ 1# $Id: configure.ac,v 1.154.2.7 2003/09/22 02:09:18 dtucker Exp $
2 2
3AC_INIT 3AC_INIT
4AC_CONFIG_SRCDIR([ssh.c]) 4AC_CONFIG_SRCDIR([ssh.c])
@@ -731,7 +731,7 @@ dnl Checks for library functions. Please keep in alphabetical order
731AC_CHECK_FUNCS(\ 731AC_CHECK_FUNCS(\
732 arc4random __b64_ntop b64_ntop __b64_pton b64_pton basename \ 732 arc4random __b64_ntop b64_ntop __b64_pton b64_pton basename \
733 bcopy bindresvport_sa clock fchmod fchown freeaddrinfo futimes \ 733 bcopy bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
734 gai_strerror getaddrinfo getcwd getgrouplist getnameinfo getopt \ 734 getaddrinfo getcwd getgrouplist getnameinfo getopt \
735 getpeereid _getpty getrlimit getttyent glob inet_aton \ 735 getpeereid _getpty getrlimit getttyent glob inet_aton \
736 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \ 736 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
737 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \ 737 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
@@ -743,6 +743,21 @@ AC_CHECK_FUNCS(\
743 truncate utimes vhangup vsnprintf waitpid \ 743 truncate utimes vhangup vsnprintf waitpid \
744) 744)
745 745
746# IRIX has a const char return value for gai_strerror()
747AC_CHECK_FUNCS(gai_strerror,[
748 AC_DEFINE(HAVE_GAI_STRERROR)
749 AC_TRY_COMPILE([
750#include <sys/types.h>
751#include <sys/socket.h>
752#include <netdb.h>
753
754const char *gai_strerror(int);],[
755char *str;
756
757str = gai_strerror(0);],[
758 AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1,
759 [Define if gai_strerror() returns const char *])])])
760
746AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP)) 761AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
747 762
748dnl Make sure prototypes are defined for these before using them. 763dnl Make sure prototypes are defined for these before using them.
diff --git a/openbsd-compat/fake-rfc2553.c b/openbsd-compat/fake-rfc2553.c
index f44924836..b0cc69bd7 100644
--- a/openbsd-compat/fake-rfc2553.c
+++ b/openbsd-compat/fake-rfc2553.c
@@ -37,7 +37,7 @@
37 37
38#include "includes.h" 38#include "includes.h"
39 39
40RCSID("$Id: fake-rfc2553.c,v 1.4 2003/06/13 22:43:23 djm Exp $"); 40RCSID("$Id: fake-rfc2553.c,v 1.4.2.1 2003/09/22 02:09:18 dtucker Exp $");
41 41
42#ifndef HAVE_GETNAMEINFO 42#ifndef HAVE_GETNAMEINFO
43int getnameinfo(const struct sockaddr *sa, size_t salen, char *host, 43int getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
@@ -77,7 +77,11 @@ int getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
77#endif /* !HAVE_GETNAMEINFO */ 77#endif /* !HAVE_GETNAMEINFO */
78 78
79#ifndef HAVE_GAI_STRERROR 79#ifndef HAVE_GAI_STRERROR
80#ifdef HAVE_CONST_GAI_STRERROR_PROTO
81const char *
82#else
80char * 83char *
84#endif
81gai_strerror(int err) 85gai_strerror(int err)
82{ 86{
83 switch (err) { 87 switch (err) {
diff --git a/openbsd-compat/fake-rfc2553.h b/openbsd-compat/fake-rfc2553.h
index b70b928f8..2d5439296 100644
--- a/openbsd-compat/fake-rfc2553.h
+++ b/openbsd-compat/fake-rfc2553.h
@@ -1,4 +1,4 @@
1/* $Id: fake-rfc2553.h,v 1.6 2003/08/29 16:59:52 mouring Exp $ */ 1/* $Id: fake-rfc2553.h,v 1.6.2.1 2003/09/22 02:09:18 dtucker Exp $ */
2 2
3/* 3/*
4 * Copyright (C) 2000-2003 Damien Miller. All rights reserved. 4 * Copyright (C) 2000-2003 Damien Miller. All rights reserved.
@@ -137,7 +137,7 @@ int getaddrinfo(const char *, const char *,
137 const struct addrinfo *, struct addrinfo **); 137 const struct addrinfo *, struct addrinfo **);
138#endif /* !HAVE_GETADDRINFO */ 138#endif /* !HAVE_GETADDRINFO */
139 139
140#ifndef HAVE_GAI_STRERROR 140#if !defined(HAVE_GAI_STRERROR) && !defined(HAVE_CONST_GAI_STRERROR_PROTO)
141char *gai_strerror(int); 141char *gai_strerror(int);
142#endif /* !HAVE_GAI_STRERROR */ 142#endif /* !HAVE_GAI_STRERROR */
143 143