diff options
author | jmmv <jmmv@pkgsrc.org> | 2006-08-28 08:28:57 +0000 |
---|---|---|
committer | jmmv <jmmv@pkgsrc.org> | 2006-08-28 08:28:57 +0000 |
commit | 3e5df982dc4de0b7e087ea6828bf6173c79d2279 (patch) | |
tree | 52a7c5456adefb207fe2f3b6d09730024a3c25b7 /sysutils | |
parent | 69cb55c358454f8820ee8a58e656baf0bba98da7 (diff) | |
download | pkgsrc-3e5df982dc4de0b7e087ea6828bf6173c79d2279.tar.gz |
Update to 0.92:
- Add support for LOCAL_CREDS socket credentials so that we can connect to
the system daemon under NetBSD. It was useless before...
Changes since 0.91:
- Proper thread locking added to pending calls
- Threading semantics changed from init early to init before the second thread
is started
- Correctly error out when an application tries to acquire or release the
org.freedesktop.DBus name instead of sending false result codes
- kqueue directory watching code can now be used to monitor config file changes
on FreeBSD
- --with-dbus-daemondir configure switch added so the daemon can be installed
separate from the user binaries
- Makefiles fixed for cygwin
- Various fixes for the ongoing Windows port
- Fixed docs and comments to use the D-Bus spelling instead of D-BUS
- Many memleaks and bugs fixed
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/dbus/Makefile | 11 | ||||
-rw-r--r-- | sysutils/dbus/distinfo | 12 | ||||
-rw-r--r-- | sysutils/dbus/files/dbus.sh | 6 | ||||
-rw-r--r-- | sysutils/dbus/patches/patch-aa | 20 | ||||
-rw-r--r-- | sysutils/dbus/patches/patch-ab | 123 | ||||
-rw-r--r-- | sysutils/dbus/patches/patch-ac | 39 |
6 files changed, 150 insertions, 61 deletions
diff --git a/sysutils/dbus/Makefile b/sysutils/dbus/Makefile index f299e0680d7..00b63892686 100644 --- a/sysutils/dbus/Makefile +++ b/sysutils/dbus/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.13 2006/08/23 09:44:27 jmmv Exp $ +# $NetBSD: Makefile,v 1.14 2006/08/28 08:28:57 jmmv Exp $ # -DISTNAME= dbus-0.91 +DISTNAME= dbus-0.92 CATEGORIES= sysutils MASTER_SITES= http://freedesktop.org/software/dbus/releases/ @@ -46,6 +46,13 @@ CONFIGURE_ARGS+= --enable-tests CONFIGURE_ARGS+= --enable-verbose-mode .endif +# Next version will automatically detect this with a sane configure check, +# so it should go away. +.include "../../mk/bsd.prefs.mk" +.if ${OPSYS} == "NetBSD" +CONFIGURE_ARGS+= --enable-kqueue +.endif + PKG_SYSCONFSUBDIR= dbus-1 MAKE_DIRS= ${PKG_SYSCONFDIR}/event.d MAKE_DIRS+= ${PKG_SYSCONFDIR}/system.d diff --git a/sysutils/dbus/distinfo b/sysutils/dbus/distinfo index 24310b5fbcb..25e0848f32b 100644 --- a/sysutils/dbus/distinfo +++ b/sysutils/dbus/distinfo @@ -1,8 +1,8 @@ -$NetBSD: distinfo,v 1.10 2006/08/23 09:44:27 jmmv Exp $ +$NetBSD: distinfo,v 1.11 2006/08/28 08:28:57 jmmv Exp $ -SHA1 (dbus-0.91.tar.gz) = 9d05a23383162c08e2800e8577129ec841d8ff17 -RMD160 (dbus-0.91.tar.gz) = 8b57e3e3896d6db53e4daddee518d1236c3704c6 -Size (dbus-0.91.tar.gz) = 1379544 bytes -SHA1 (patch-aa) = 9dd1f74cbed3ef973612f9a1b1336732a88cd819 -SHA1 (patch-ac) = 4e49a5b2139583540be5f1fc445d61946ddc0ef8 +SHA1 (dbus-0.92.tar.gz) = 37edf2fd6c471b086261462b8b8d3dd2656e1bb4 +RMD160 (dbus-0.92.tar.gz) = 23de0396bf5565c02e2e710bebd95ad5de1832a8 +Size (dbus-0.92.tar.gz) = 1388345 bytes +SHA1 (patch-aa) = fbf728371c76c1daa267591cd76dec3138f30acf +SHA1 (patch-ab) = ae2d4d3870acbb48088bc6b1eec4cf181f748493 SHA1 (patch-ae) = c73bed4ec4cca5e7bcdec749ac85ba2c56d8469a diff --git a/sysutils/dbus/files/dbus.sh b/sysutils/dbus/files/dbus.sh index 9d8c272bcec..266bf86c2ec 100644 --- a/sysutils/dbus/files/dbus.sh +++ b/sysutils/dbus/files/dbus.sh @@ -1,6 +1,6 @@ #!@RCD_SCRIPTS_SHELL@ # -# $NetBSD: dbus.sh,v 1.3 2006/03/30 20:57:08 jmmv Exp $ +# $NetBSD: dbus.sh,v 1.4 2006/08/28 08:28:57 jmmv Exp $ # # PROVIDE: dbus # REQUIRE: DAEMON @@ -14,14 +14,12 @@ command="@PREFIX@/bin/dbus-daemon" command_args="--system" pidfile="@VARBASE@/run/dbus/pid" start_precmd=dbus_prestart -dbus_user=messagebus -dbus_group=messagebus dbus_prestart() { if @TEST@ ! -d "@VARBASE@/run/dbus"; then @MKDIR@ "@VARBASE@/run/dbus" @CHMOD@ 0755 "@VARBASE@/run/dbus" - @CHOWN@ ${dbus_user}:${dbus_group} "@VARBASE@/run/dbus" + @CHOWN@ messagebus:messagebus "@VARBASE@/run/dbus" fi } diff --git a/sysutils/dbus/patches/patch-aa b/sysutils/dbus/patches/patch-aa index 751faf026e2..d46585fb0a1 100644 --- a/sysutils/dbus/patches/patch-aa +++ b/sysutils/dbus/patches/patch-aa @@ -1,8 +1,8 @@ -$NetBSD: patch-aa,v 1.3 2006/03/30 20:57:08 jmmv Exp $ +$NetBSD: patch-aa,v 1.4 2006/08/28 08:28:57 jmmv Exp $ ---- bus/Makefile.in.orig 2006-02-24 17:36:50.000000000 +0100 +--- bus/Makefile.in.orig 2006-08-18 21:42:14.000000000 +0200 +++ bus/Makefile.in -@@ -374,11 +374,11 @@ target_alias = @target_alias@ +@@ -301,11 +301,11 @@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ @@ -17,12 +17,12 @@ $NetBSD: patch-aa,v 1.3 2006/03/30 20:57:08 jmmv Exp $ EFENCE = CONFIG_IN_FILES = \ -@@ -939,8 +939,6 @@ clean-local: - /bin/rm *.bb *.bbg *.da *.gcov || true - - install-data-hook: -- $(mkinstalldirs) $(DESTDIR)/$(localstatedir)/run/dbus -- $(mkinstalldirs) $(DESTDIR)/$(configdir)/system.d - $(mkinstalldirs) $(DESTDIR)/$(datadir)/dbus-1/services +@@ -852,8 +852,6 @@ install-data-hook: + chmod 755 $(DESTDIR)$(DBUS_DAEMONDIR); \ + fi + $(INSTALL_PROGRAM) dbus-daemon $(DESTDIR)$(DBUS_DAEMONDIR) +- $(mkinstalldirs) $(DESTDIR)$(localstatedir)/run/dbus +- $(mkinstalldirs) $(DESTDIR)$(configdir)/system.d + $(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/services # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/sysutils/dbus/patches/patch-ab b/sysutils/dbus/patches/patch-ab new file mode 100644 index 00000000000..0b751ad7c07 --- /dev/null +++ b/sysutils/dbus/patches/patch-ab @@ -0,0 +1,123 @@ +$NetBSD: patch-ab,v 1.5 2006/08/28 08:28:57 jmmv Exp $ + +--- dbus/dbus-sysdeps.c.orig 2006-08-18 17:46:59.000000000 +0200 ++++ dbus/dbus-sysdeps.c +@@ -488,6 +488,35 @@ _dbus_connect_unix_socket (const char + } + + /** ++ * Enables or disables the reception of credentials on the given socket during ++ * the next message transmission. This is only effective if the #LOCAL_CREDS ++ * system feature exists, in which case the other side of the connection does ++ * not have to do anything special to send the credentials. ++ * ++ * @param fd socket on which to change the #LOCAL_CREDS flag. ++ * @param on whether to enable or disable the #LOCAL_CREDS flag. ++ */ ++static dbus_bool_t ++_dbus_set_local_creds (int fd, dbus_bool_t on) ++{ ++ dbus_bool_t retval = TRUE; ++ ++#if defined(LOCAL_CREDS) && !defined(HAVE_CMSGCRED) ++ int val = on ? 1 : 0; ++ if (setsockopt (fd, 0, LOCAL_CREDS, &val, sizeof (val)) < 0) ++ { ++ _dbus_verbose ("Unable to set LOCAL_CREDS socket option on fd %d\n", fd); ++ retval = FALSE; ++ } ++ else ++ _dbus_verbose ("LOCAL_CREDS %s for further messages on fd %d\n", ++ on ? "enabled" : "disabled", fd); ++#endif ++ ++ return retval; ++} ++ ++/** + * Creates a socket and binds it to the given path, + * then listens on the socket. The socket is + * set to be nonblocking. +@@ -605,6 +634,15 @@ _dbus_listen_unix_socket (const char + return -1; + } + ++ if (!_dbus_set_local_creds (listen_fd, TRUE)) ++ { ++ dbus_set_error (error, _dbus_error_from_errno (errno), ++ "Failed to enable LOCAL_CREDS on socket \"%s\": %s", ++ path, _dbus_strerror (errno)); ++ close (listen_fd); ++ return -1; ++ } ++ + if (!_dbus_set_fd_nonblocking (listen_fd, error)) + { + _DBUS_ASSERT_ERROR_IS_SET (error); +@@ -875,6 +913,11 @@ _dbus_read_credentials_unix_socket (int + struct cmsghdr hdr; + struct cmsgcred cred; + } cmsg; ++#elif defined(LOCAL_CREDS) ++ struct { ++ struct cmsghdr hdr; ++ struct sockcred cred; ++ } cmsg; + #endif + + _DBUS_ASSERT_ERROR_IS_CLEAR (error); +@@ -889,17 +932,11 @@ _dbus_read_credentials_unix_socket (int + + _dbus_credentials_clear (credentials); + +-#if defined(LOCAL_CREDS) && defined(HAVE_CMSGCRED) +- /* Set the socket to receive credentials on the next message */ +- { +- int on = 1; +- if (setsockopt (client_fd, 0, LOCAL_CREDS, &on, sizeof (on)) < 0) +- { +- _dbus_verbose ("Unable to set LOCAL_CREDS socket option\n"); +- return FALSE; +- } +- } +-#endif ++ /* Systems supporting LOCAL_CREDS are configured to have this feature ++ * enabled (if it does not conflict with HAVE_CMSGCRED) prior accepting ++ * the connection. Therefore, the received message must carry the ++ * credentials information without doing anything special. ++ */ + + iov.iov_base = &buf; + iov.iov_len = 1; +@@ -908,7 +945,7 @@ _dbus_read_credentials_unix_socket (int + msg.msg_iov = &iov; + msg.msg_iovlen = 1; + +-#ifdef HAVE_CMSGCRED ++#if defined(HAVE_CMSGCRED) || defined(LOCAL_CREDS) + memset (&cmsg, 0, sizeof (cmsg)); + msg.msg_control = &cmsg; + msg.msg_controllen = sizeof (cmsg); +@@ -933,7 +970,7 @@ _dbus_read_credentials_unix_socket (int + return FALSE; + } + +-#ifdef HAVE_CMSGCRED ++#if defined(HAVE_CMSGCRED) || defined(LOCAL_CREDS) + if (cmsg.hdr.cmsg_len < sizeof (cmsg) || cmsg.hdr.cmsg_type != SCM_CREDS) + { + dbus_set_error (error, DBUS_ERROR_FAILED, +@@ -965,6 +1002,13 @@ _dbus_read_credentials_unix_socket (int + credentials->pid = cmsg.cred.cmcred_pid; + credentials->uid = cmsg.cred.cmcred_euid; + credentials->gid = cmsg.cred.cmcred_groups[0]; ++#elif defined(LOCAL_CREDS) ++ credentials->pid = DBUS_PID_UNSET; ++ credentials->uid = cmsg.cred.sc_uid; ++ credentials->gid = cmsg.cred.sc_gid; ++ /* Since we have already got the credentials from this socket, we can ++ * disable its LOCAL_CREDS flag if it was ever set. */ ++ _dbus_set_local_creds (client_fd, FALSE); + #elif defined(HAVE_GETPEEREID) + uid_t euid; + gid_t egid; diff --git a/sysutils/dbus/patches/patch-ac b/sysutils/dbus/patches/patch-ac deleted file mode 100644 index 3d413987acb..00000000000 --- a/sysutils/dbus/patches/patch-ac +++ /dev/null @@ -1,39 +0,0 @@ -$NetBSD: patch-ac,v 1.3 2006/07/14 15:55:02 rillig Exp $ - ---- tools/run-with-tmp-session-bus.sh.orig 2005-03-17 18:48:29.000000000 +0100 -+++ tools/run-with-tmp-session-bus.sh 2006-07-14 17:38:50.642306696 +0200 -@@ -1,10 +1,10 @@ --#! /bin/bash -+#! /bin/sh - - SCRIPTNAME=$0 - WRAPPED_SCRIPT=$1 - shift - --function die() -+die() - { - if ! test -z "$DBUS_SESSION_BUS_PID" ; then - echo "killing message bus "$DBUS_SESSION_BUS_PID >&2 -@@ -19,7 +19,7 @@ if test -z "$DBUS_TOP_BUILDDIR" ; then - fi - - ## convenient to be able to ctrl+C without leaking the message bus process --trap 'die "Received SIGINT"' SIGINT -+trap 'die "Received SIGINT"' INT - - CONFIG_FILE=./run-with-tmp-session-bus.conf - SERVICE_DIR="$DBUS_TOP_BUILDDIR/test/data/valid-service-files" -@@ -34,9 +34,10 @@ cat $DBUS_TOP_BUILDDIR/bus/session.conf - - echo "Created configuration file $CONFIG_FILE" >&2 - --export PATH=$DBUS_TOP_BUILDDIR/bus:$PATH -+PATH=$DBUS_TOP_BUILDDIR/bus:$PATH - ## the libtool script found by the path search should already do this, but --export LD_LIBRARY_PATH=$DBUS_TOP_BUILDDIR/dbus/.libs:$LD_LIBRARY_PATH -+LD_LIBRARY_PATH=$DBUS_TOP_BUILDDIR/dbus/.libs:$LD_LIBRARY_PATH -+export PATH LD_LIBRARY_PATH - - unset DBUS_SESSION_BUS_ADDRESS - unset DBUS_SESSION_BUS_PID |