summaryrefslogtreecommitdiffstats
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 77ca5024..933b8094 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,10 @@
Patch from david.haughton at ncr.com
- (dtucker) [configure.ac] Bug #659: uid swapping issues on IRIX 6.
Part of patch supplied by bugzilla-openssh at thewrittenword.com
+ - (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
20030919
- (djm) Bug #683: Remove reference to --with-ipv4-default from INSTALL;
@@ -1141,4 +1145,4 @@
- Fix sshd BindAddress and -b options for systems using fake-getaddrinfo.
Report from murple@murple.net, diagnosis from dtucker@zip.com.au
-$Id: ChangeLog,v 1.2994.2.18 2003/09/22 01:58:44 dtucker Exp $
+$Id: ChangeLog,v 1.2994.2.19 2003/09/22 02:09:17 dtucker Exp $
diff --git a/configure.ac b/configure.ac
index 5cf7d909..c5f98468 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-# $Id: configure.ac,v 1.154.2.6 2003/09/22 01:58:44 dtucker Exp $
+# $Id: configure.ac,v 1.154.2.7 2003/09/22 02:09:18 dtucker Exp $
AC_INIT
AC_CONFIG_SRCDIR([ssh.c])
@@ -731,7 +731,7 @@ dnl Checks for library functions. Please keep in alphabetical order
AC_CHECK_FUNCS(\
arc4random __b64_ntop b64_ntop __b64_pton b64_pton basename \
bcopy bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
- gai_strerror getaddrinfo getcwd getgrouplist getnameinfo getopt \
+ getaddrinfo getcwd getgrouplist getnameinfo getopt \
getpeereid _getpty getrlimit getttyent glob inet_aton \
inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
@@ -743,6 +743,21 @@ AC_CHECK_FUNCS(\
truncate utimes vhangup vsnprintf waitpid \
)
+# IRIX has a const char return value for gai_strerror()
+AC_CHECK_FUNCS(gai_strerror,[
+ AC_DEFINE(HAVE_GAI_STRERROR)
+ AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netdb.h>
+
+const char *gai_strerror(int);],[
+char *str;
+
+str = gai_strerror(0);],[
+ AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1,
+ [Define if gai_strerror() returns const char *])])])
+
AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
dnl 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 f4492483..b0cc69bd 100644
--- a/openbsd-compat/fake-rfc2553.c
+++ b/openbsd-compat/fake-rfc2553.c
@@ -37,7 +37,7 @@
#include "includes.h"
-RCSID("$Id: fake-rfc2553.c,v 1.4 2003/06/13 22:43:23 djm Exp $");
+RCSID("$Id: fake-rfc2553.c,v 1.4.2.1 2003/09/22 02:09:18 dtucker Exp $");
#ifndef HAVE_GETNAMEINFO
int 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,
#endif /* !HAVE_GETNAMEINFO */
#ifndef HAVE_GAI_STRERROR
+#ifdef HAVE_CONST_GAI_STRERROR_PROTO
+const char *
+#else
char *
+#endif
gai_strerror(int err)
{
switch (err) {
diff --git a/openbsd-compat/fake-rfc2553.h b/openbsd-compat/fake-rfc2553.h
index b70b928f..2d543929 100644
--- a/openbsd-compat/fake-rfc2553.h
+++ b/openbsd-compat/fake-rfc2553.h
@@ -1,4 +1,4 @@
-/* $Id: fake-rfc2553.h,v 1.6 2003/08/29 16:59:52 mouring Exp $ */
+/* $Id: fake-rfc2553.h,v 1.6.2.1 2003/09/22 02:09:18 dtucker Exp $ */
/*
* Copyright (C) 2000-2003 Damien Miller. All rights reserved.
@@ -137,7 +137,7 @@ int getaddrinfo(const char *, const char *,
const struct addrinfo *, struct addrinfo **);
#endif /* !HAVE_GETADDRINFO */
-#ifndef HAVE_GAI_STRERROR
+#if !defined(HAVE_GAI_STRERROR) && !defined(HAVE_CONST_GAI_STRERROR_PROTO)
char *gai_strerror(int);
#endif /* !HAVE_GAI_STRERROR */