]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Check if getpeereid is actually declared.
authorDarren Tucker <dtucker@dtucker.net>
Mon, 17 Feb 2020 11:48:50 +0000 (22:48 +1100)
committerDarren Tucker <dtucker@dtucker.net>
Mon, 17 Feb 2020 11:48:50 +0000 (22:48 +1100)
Check in sys/socket.h (AIX) and unistd.h (FreeBSD, DragonFLy and OS X).
Prevents undeclared function warning on at least some versions of AIX.

configure.ac
openbsd-compat/openbsd-compat.h

index b689db4b5c563223a6dfc8a3d65e90a88bf4807b..7094d470d1899e050020d215a2d12719755af2d9 100644 (file)
@@ -1986,10 +1986,11 @@ AC_CHECK_DECL([tcsendbreak],
 
 AC_CHECK_DECLS([h_errno], , ,[#include <netdb.h>])
 
-AC_CHECK_DECLS([SHUT_RD], , ,
+AC_CHECK_DECLS([SHUT_RD, getpeereid], , ,
        [
 #include <sys/types.h>
 #include <sys/socket.h>
+#include <unistd.h>
        ])
 
 AC_CHECK_DECLS([O_NONBLOCK], , ,
index 4a16702ef751be01779a501a4dce78208e6ef557..e5fd6f5bbaf32f1424c36bb16255f7c90c53f68a 100644 (file)
@@ -197,7 +197,7 @@ int writev(int, struct iovec *, int);
 #include "bsd-waitpid.h"
 #include "bsd-poll.h"
 
-#ifndef HAVE_GETPEEREID
+#if defined(HAVE_DECL_GETPEEREID) && HAVE_DECL_GETPEEREID == 0
 int getpeereid(int , uid_t *, gid_t *);
 #endif