diff --git a/bootstrap.sh b/bootstrap.sh index 6ca277df2c..3497e24e62 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -17,6 +17,10 @@ case `uname -sr` in MY_AC_VER=259 MY_AM_VER=19 ;; + OpenBSD*) + export AUTOCONF_VERSION=2.63 + export AUTOMAKE_VERSION=1.9 + ;; *'BSD'*) MY_AC_VER=-2.62 MY_AM_VER=-1.9 diff --git a/configure.ac b/configure.ac index e239e8a1a4..3b6a3a63d3 100644 --- a/configure.ac +++ b/configure.ac @@ -540,7 +540,8 @@ AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_CHECK_MEMBERS([struct stat.st_blksize]) -AC_CHECK_MEMBERS([struct ucred.uid, struct ucred.cr_uid], [], [], [#include ]) +AC_CHECK_MEMBERS([struct ucred.uid, struct ucred.cr_uid, struct sockpeercred.uid], [], [], [#include +#include ]) AC_CHECK_MEMBERS([struct ifreq.ifr_ifru.ifru_hwaddr], [], [], [#include ]) AC_HEADER_TIME AC_STRUCT_TM diff --git a/main/asterisk.c b/main/asterisk.c index 9473fc9861..12dc6483e5 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -1200,7 +1200,12 @@ static pthread_t lthread; static int read_credentials(int fd, char *buffer, size_t size, struct console *con) { #if defined(SO_PEERCRED) +#ifdef HAVE_STRUCT_SOCKPEERCRED_UID +#define HAVE_STRUCT_UCRED_UID + struct sockpeercred cred; +#else struct ucred cred; +#endif socklen_t len = sizeof(cred); #endif #if defined(HAVE_GETPEEREID)