[svn-commits] kmoore: branch 10 r350731 - in /branches/10: ./ main/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Jan 13 15:41:27 CST 2012


Author: kmoore
Date: Fri Jan 13 15:41:24 2012
New Revision: 350731

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=350731
Log:
Make sure asterisk builds on OpenBSD

OpenBSD defines SO_PEERCRED, but it returns a 'struct sockpeercred', not
'struct ucred', which causes compilation of main/asterisk.c to fail in
read_credentials().  This allows configure to check for sockpeercred and
asterisk to deal with it properly.

(closes issue ASTERISK-18929)
Reported-by: Barry Miller
Patch-by: Barry Miller
........

Merged revisions 350730 from http://svn.asterisk.org/svn/asterisk/branches/1.8

Modified:
    branches/10/   (props changed)
    branches/10/bootstrap.sh
    branches/10/configure.ac
    branches/10/main/asterisk.c

Propchange: branches/10/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: branches/10/bootstrap.sh
URL: http://svnview.digium.com/svn/asterisk/branches/10/bootstrap.sh?view=diff&rev=350731&r1=350730&r2=350731
==============================================================================
--- branches/10/bootstrap.sh (original)
+++ branches/10/bootstrap.sh Fri Jan 13 15:41:24 2012
@@ -16,6 +16,10 @@
 	'FreeBSD 4'*)	# FreeBSD 4.x has a different naming
 		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

Modified: branches/10/configure.ac
URL: http://svnview.digium.com/svn/asterisk/branches/10/configure.ac?view=diff&rev=350731&r1=350730&r2=350731
==============================================================================
--- branches/10/configure.ac (original)
+++ branches/10/configure.ac Fri Jan 13 15:41:24 2012
@@ -540,7 +540,8 @@
 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 <sys/socket.h>])
+AC_CHECK_MEMBERS([struct ucred.uid, struct ucred.cr_uid, struct sockpeercred.uid], [], [], [#include <sys/types.h>
+#include <sys/socket.h> ])
 AC_CHECK_MEMBERS([struct ifreq.ifr_ifru.ifru_hwaddr], [], [], [#include <net/if.h>])
 AC_HEADER_TIME
 AC_STRUCT_TM

Modified: branches/10/main/asterisk.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/main/asterisk.c?view=diff&rev=350731&r1=350730&r2=350731
==============================================================================
--- branches/10/main/asterisk.c (original)
+++ branches/10/main/asterisk.c Fri Jan 13 15:41:24 2012
@@ -1200,7 +1200,12 @@
 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)




More information about the svn-commits mailing list