[svn-commits] tilghman: branch 1.8 r296534 - in /branches/1.8: ./ include/asterisk/ main/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Nov 29 01:28:48 CST 2010


Author: tilghman
Date: Mon Nov 29 01:28:44 2010
New Revision: 296534

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=296534
Log:
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:
    branches/1.8/   (props changed)
    branches/1.8/configure
    branches/1.8/configure.ac
    branches/1.8/include/asterisk/autoconfig.h.in
    branches/1.8/main/asterisk.c

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

Modified: branches/1.8/configure.ac
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/configure.ac?view=diff&rev=296534&r1=296533&r2=296534
==============================================================================
--- branches/1.8/configure.ac (original)
+++ branches/1.8/configure.ac Mon Nov 29 01:28:44 2010
@@ -486,6 +486,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: branches/1.8/include/asterisk/autoconfig.h.in
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/include/asterisk/autoconfig.h.in?view=diff&rev=296534&r1=296533&r2=296534
==============================================================================
--- branches/1.8/include/asterisk/autoconfig.h.in (original)
+++ branches/1.8/include/asterisk/autoconfig.h.in Mon Nov 29 01:28:44 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: branches/1.8/main/asterisk.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/asterisk.c?view=diff&rev=296534&r1=296533&r2=296534
==============================================================================
--- branches/1.8/main/asterisk.c (original)
+++ branches/1.8/main/asterisk.c Mon Nov 29 01:28:44 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