diff options
author | hasso <hasso@pkgsrc.org> | 2009-01-06 19:00:50 +0000 |
---|---|---|
committer | hasso <hasso@pkgsrc.org> | 2009-01-06 19:00:50 +0000 |
commit | a027a68ca4deb1c00279e29036b8bcc47a4ccaed (patch) | |
tree | 648d177a4c40805d8e9ad22a8f07ea65ff350ecc | |
parent | b4148413cfe6c6c94bfb2ac5d44683e3c5d27b19 (diff) | |
download | pkgsrc-a027a68ca4deb1c00279e29036b8bcc47a4ccaed.tar.gz |
Make dbus really work on DragonFly and FreeBSD. The patch obtained from
FreeBSD ports. Bump PKGREVISION.
-rw-r--r-- | sysutils/dbus/Makefile | 4 | ||||
-rw-r--r-- | sysutils/dbus/distinfo | 4 | ||||
-rw-r--r-- | sysutils/dbus/patches/patch-ab | 95 |
3 files changed, 82 insertions, 21 deletions
diff --git a/sysutils/dbus/Makefile b/sysutils/dbus/Makefile index 256812625d1..42fca3ab29c 100644 --- a/sysutils/dbus/Makefile +++ b/sysutils/dbus/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.38 2008/11/23 01:40:26 jmcneill Exp $ +# $NetBSD: Makefile,v 1.39 2009/01/06 19:00:50 hasso Exp $ DISTNAME= dbus-1.2.4 -PKGREVISION= 3 +PKGREVISION= 4 CATEGORIES= sysutils MASTER_SITES= http://dbus.freedesktop.org/releases/dbus/ diff --git a/sysutils/dbus/distinfo b/sysutils/dbus/distinfo index f20e17deaaa..5c4e26ed0b7 100644 --- a/sysutils/dbus/distinfo +++ b/sysutils/dbus/distinfo @@ -1,10 +1,10 @@ -$NetBSD: distinfo,v 1.30 2008/11/23 01:40:26 jmcneill Exp $ +$NetBSD: distinfo,v 1.31 2009/01/06 19:00:50 hasso Exp $ SHA1 (dbus-1.2.4.tar.gz) = 913d796b79802b6ee6ca2b0ef59c670f3fd79774 RMD160 (dbus-1.2.4.tar.gz) = 0441eb8b668ed70250e484b02fe6a83c05c9a088 Size (dbus-1.2.4.tar.gz) = 1564370 bytes SHA1 (patch-aa) = 2486dfe8a9c80cf10e099ce20f60d14de84e8adb -SHA1 (patch-ab) = c6718fa46bf4befab0d7cd1c7d698b81922f7021 +SHA1 (patch-ab) = c05559aa0a473d2009f44dd5b65955a9b37e3ab7 SHA1 (patch-ac) = afec419973f339e846dc109866148529f80998b3 SHA1 (patch-ag) = 999071b782982c12329025ea8e393bfed940b654 SHA1 (patch-ai) = a45bd8d29955e9c14a4d8b3f44b42242d70c1cd8 diff --git a/sysutils/dbus/patches/patch-ab b/sysutils/dbus/patches/patch-ab index 39a1c020b20..d8be1cee898 100644 --- a/sysutils/dbus/patches/patch-ab +++ b/sysutils/dbus/patches/patch-ab @@ -1,7 +1,7 @@ -$NetBSD: patch-ab,v 1.15 2008/11/23 01:40:26 jmcneill Exp $ +$NetBSD: patch-ab,v 1.16 2009/01/06 19:00:50 hasso Exp $ ---- dbus/dbus-sysdeps-unix.c.orig 2008-10-06 17:14:50.000000000 -0400 -+++ dbus/dbus-sysdeps-unix.c +--- dbus/dbus-sysdeps-unix.c.orig 2008-10-07 00:14:50 +0300 ++++ dbus/dbus-sysdeps-unix.c 2009-01-06 16:17:35 +0200 @@ -23,6 +23,7 @@ */ @@ -73,8 +73,45 @@ $NetBSD: patch-ab,v 1.15 2008/11/23 01:40:26 jmcneill Exp $ /* NOOP just to make sure only one codepath is used * and to prefer CMSGCRED */ -@@ -1138,6 +1172,9 @@ _dbus_read_credentials_socket (int - struct cmsgcred cred; +@@ -1041,9 +1075,9 @@ write_credentials_byte (int + int bytes_written; + char buf[1] = { '\0' }; + #if defined(HAVE_CMSGCRED) +- struct { ++ union { + struct cmsghdr hdr; +- struct cmsgcred cred; ++ char cred[CMSG_SPACE (sizeof (struct cmsgcred))]; + } cmsg; + struct iovec iov; + struct msghdr msg; +@@ -1054,10 +1088,10 @@ write_credentials_byte (int + msg.msg_iov = &iov; + msg.msg_iovlen = 1; + +- msg.msg_control = &cmsg; +- msg.msg_controllen = sizeof (cmsg); ++ msg.msg_control = (caddr_t) &cmsg; ++ msg.msg_controllen = CMSG_SPACE (sizeof (struct cmsgcred)); + memset (&cmsg, 0, sizeof (cmsg)); +- cmsg.hdr.cmsg_len = sizeof (cmsg); ++ cmsg.hdr.cmsg_len = CMSG_LEN (sizeof (struct cmsgcred)); + cmsg.hdr.cmsg_level = SOL_SOCKET; + cmsg.hdr.cmsg_type = SCM_CREDS; + #endif +@@ -1129,15 +1163,15 @@ _dbus_read_credentials_socket (int + dbus_pid_t pid_read; + int bytes_read; + +- uid_read = DBUS_UID_UNSET; +- pid_read = DBUS_PID_UNSET; +- + #ifdef HAVE_CMSGCRED +- struct { ++ union { + struct cmsghdr hdr; +- struct cmsgcred cred; ++ char cred[CMSG_SPACE (sizeof (struct cmsgcred))]; } cmsg; +#elif defined(LOCAL_PEEREID) @@ -83,28 +120,52 @@ $NetBSD: patch-ab,v 1.15 2008/11/23 01:40:26 jmcneill Exp $ #elif defined(LOCAL_CREDS) struct { struct cmsghdr hdr; -@@ -1170,7 +1207,7 @@ _dbus_read_credentials_socket (int +@@ -1145,6 +1179,9 @@ _dbus_read_credentials_socket (int + } cmsg; + #endif + ++ uid_read = DBUS_UID_UNSET; ++ pid_read = DBUS_PID_UNSET; ++ + _DBUS_ASSERT_ERROR_IS_CLEAR (error); + + /* The POSIX spec certainly doesn't promise this, but +@@ -1170,10 +1207,10 @@ _dbus_read_credentials_socket (int msg.msg_iov = &iov; msg.msg_iovlen = 1; -#if defined(HAVE_CMSGCRED) || defined(LOCAL_CREDS) +#if (defined(HAVE_CMSGCRED) || defined(LOCAL_CREDS)) && !defined(LOCAL_PEEREID) memset (&cmsg, 0, sizeof (cmsg)); - msg.msg_control = &cmsg; - msg.msg_controllen = sizeof (cmsg); -@@ -1210,7 +1247,7 @@ _dbus_read_credentials_socket (int +- msg.msg_control = &cmsg; +- msg.msg_controllen = sizeof (cmsg); ++ msg.msg_control = (caddr_t) &cmsg; ++ msg.msg_controllen = CMSG_SPACE (sizeof (struct cmsgcred)); + #endif + + again: +@@ -1210,8 +1247,8 @@ _dbus_read_credentials_socket (int return FALSE; } -#if defined(HAVE_CMSGCRED) || defined(LOCAL_CREDS) +- if (cmsg.hdr.cmsg_len < sizeof (cmsg) || cmsg.hdr.cmsg_type != SCM_CREDS) +#if (defined(HAVE_CMSGCRED) || defined(LOCAL_CREDS)) && !defined(LOCAL_PEEREID) - if (cmsg.hdr.cmsg_len < sizeof (cmsg) || cmsg.hdr.cmsg_type != SCM_CREDS) ++ if (cmsg.hdr.cmsg_len < CMSG_LEN (sizeof (struct cmsgcred)) || cmsg.hdr.cmsg_type != SCM_CREDS) { dbus_set_error (error, DBUS_ERROR_FAILED, -@@ -1240,6 +1277,16 @@ _dbus_read_credentials_socket (int + "Message from recvmsg() was not SCM_CREDS"); +@@ -1238,8 +1275,21 @@ _dbus_read_credentials_socket (int + cr_len, (int) sizeof (cr), _dbus_strerror (errno)); + } #elif defined(HAVE_CMSGCRED) - pid_read = cmsg.cred.cmcred_pid; - uid_read = cmsg.cred.cmcred_euid; +- pid_read = cmsg.cred.cmcred_pid; +- uid_read = cmsg.cred.cmcred_euid; ++ struct cmsgcred *cred; ++ ++ cred = (struct cmsgcred *) CMSG_DATA (&cmsg); ++ pid_read = cred->cmcred_pid; ++ uid_read = cred->cmcred_euid; +#elif defined(LOCAL_PEEREID) + if (dbus_nb_getpeereid(client_fd, &sockpid, &sockuid, &sockgid) == TRUE) + { @@ -118,7 +179,7 @@ $NetBSD: patch-ab,v 1.15 2008/11/23 01:40:26 jmcneill Exp $ #elif defined(LOCAL_CREDS) pid_read = DBUS_PID_UNSET; uid_read = cmsg.cred.sc_uid; -@@ -1301,7 +1348,7 @@ _dbus_read_credentials_socket (int +@@ -1301,7 +1351,7 @@ _dbus_read_credentials_socket (int } if (ucred != NULL) ucred_free (ucred); @@ -127,7 +188,7 @@ $NetBSD: patch-ab,v 1.15 2008/11/23 01:40:26 jmcneill Exp $ _dbus_verbose ("Socket credentials not supported on this OS\n"); #endif } -@@ -1826,7 +1873,26 @@ _dbus_parse_uid (const DBusString * +@@ -1826,7 +1876,26 @@ _dbus_parse_uid (const DBusString * return TRUE; } @@ -154,7 +215,7 @@ $NetBSD: patch-ab,v 1.15 2008/11/23 01:40:26 jmcneill Exp $ _DBUS_DEFINE_GLOBAL_LOCK (atomic); #if DBUS_USE_ATOMIC_INT_486_COND -@@ -1891,6 +1957,7 @@ _dbus_atomic_dec (DBusAtomic *atomic) +@@ -1891,6 +1960,7 @@ _dbus_atomic_dec (DBusAtomic *atomic) return res; #endif } @@ -162,7 +223,7 @@ $NetBSD: patch-ab,v 1.15 2008/11/23 01:40:26 jmcneill Exp $ #ifdef DBUS_BUILD_TESTS /** Gets our GID -@@ -2793,8 +2860,18 @@ int +@@ -2793,8 +2863,18 @@ int _dbus_printf_string_upper_bound (const char *format, va_list args) { |