[svn-commits] tilghman: trunk r296535 - in /trunk: ./ include/asterisk/ main/
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Mon Nov 29 01:30:12 CST 2010
Author: tilghman
Date: Mon Nov 29 01:30:09 2010
New Revision: 296535
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=296535
Log:
Merged revisions 296534 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8
................
r296534 | tilghman | 2010-11-29 01:28:44 -0600 (Mon, 29 Nov 2010) | 20 lines
Merged revisions 296533 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2
........
r296533 | tilghman | 2010-11-29 01:27:09 -0600 (Mon, 29 Nov 2010) | 13 lines
I love standards. There are so many to choose from. Except when there isn't one.
Linux and *BSD disagree on the elements within the ucred structure. Detect
which one is in use on the system.
(closes issue #18384)
Reported by: bjm
Patches:
cred-diffs uploaded by bjm (license 473)
20101127__issue18384__1.6.2.diff.txt uploaded by tilghman (license 14)
20101127__issue18384__1.8.diff.txt uploaded by tilghman (license 14)
Tested by: tilghman, bjm
........
................
Modified:
trunk/ (props changed)
trunk/configure
trunk/configure.ac
trunk/include/asterisk/autoconfig.h.in
trunk/main/asterisk.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.
Modified: trunk/configure.ac
URL: http://svnview.digium.com/svn/asterisk/trunk/configure.ac?view=diff&rev=296535&r1=296534&r2=296535
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Mon Nov 29 01:30:09 2010
@@ -489,6 +489,7 @@
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_HEADER_TIME
AC_STRUCT_TM
AC_C_VOLATILE
Modified: trunk/include/asterisk/autoconfig.h.in
URL: http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/autoconfig.h.in?view=diff&rev=296535&r1=296534&r2=296535
==============================================================================
--- trunk/include/asterisk/autoconfig.h.in (original)
+++ trunk/include/asterisk/autoconfig.h.in Mon Nov 29 01:30:09 2010
@@ -815,6 +815,12 @@
/* Define to 1 if `st_blksize' is a member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_BLKSIZE
+
+/* Define to 1 if `cr_uid' is a member of `struct ucred'. */
+#undef HAVE_STRUCT_UCRED_CR_UID
+
+/* Define to 1 if `uid' is a member of `struct ucred'. */
+#undef HAVE_STRUCT_UCRED_UID
/* Define to 1 if you have the mISDN Supplemental Services library. */
#undef HAVE_SUPPSERV
Modified: trunk/main/asterisk.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/asterisk.c?view=diff&rev=296535&r1=296534&r2=296535
==============================================================================
--- trunk/main/asterisk.c (original)
+++ trunk/main/asterisk.c Mon Nov 29 01:30:09 2010
@@ -1202,12 +1202,18 @@
return result;
}
-#if defined(SO_PEERCRED)
+#if defined(SO_PEERCRED) && (defined(HAVE_STRUCT_UCRED_UID) || defined(HAVE_STRUCT_UCRED_CR_UID))
if (getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cred, &len)) {
return result;
}
+#if defined(HAVE_STRUCT_UCRED_UID)
uid = cred.uid;
gid = cred.gid;
+#else /* defined(HAVE_STRUCT_UCRED_CR_UID) */
+ uid = cred.cr_uid;
+ gid = cred.cr_gid;
+#endif /* defined(HAVE_STRUCT_UCRED_UID) */
+
#elif defined(HAVE_GETPEEREID)
if (getpeereid(fd, &uid, &gid)) {
return result;
More information about the svn-commits
mailing list