[49300] trunk/dports/devel/dbus
mcalhoun at macports.org
mcalhoun at macports.org
Mon Apr 6 20:18:49 PDT 2009
Revision: 49300
http://trac.macports.org/changeset/49300
Author: mcalhoun at macports.org
Date: 2009-04-06 20:18:47 -0700 (Mon, 06 Apr 2009)
Log Message:
-----------
dbus:
* Update launchd patch to latest version.
* Fix Panther build (#17198 and #19106).
* Bypass startup.create for daemon (#15081).
* Add variants to allow non-root to install (#18987).
Modified Paths:
--------------
trunk/dports/devel/dbus/Portfile
Added Paths:
-----------
trunk/dports/devel/dbus/files/patch-launchd-integration.diff
Removed Paths:
-------------
trunk/dports/devel/dbus/files/config.cache
trunk/dports/devel/dbus/files/patch-dbus-launch-x11.c.diff
trunk/dports/devel/dbus/files/patch-dbus-sysdeps-unix.c.diff
trunk/dports/devel/dbus/files/patch-dbus-sysdeps-util-unix.c.diff
trunk/dports/devel/dbus/files/patch-launchd-integration-dist.diff
Modified: trunk/dports/devel/dbus/Portfile
===================================================================
--- trunk/dports/devel/dbus/Portfile 2009-04-07 02:11:27 UTC (rev 49299)
+++ trunk/dports/devel/dbus/Portfile 2009-04-07 03:18:47 UTC (rev 49300)
@@ -6,7 +6,7 @@
name dbus
version 1.2.12
-revision 4
+revision 5
maintainers mcalhoun openmaintainer
categories devel
platforms darwin
@@ -22,32 +22,82 @@
sha1 13de8dc28c9edae7b9d2928ff691549bb2bef21a \
rmd160 779d76320f1343dae7447c82a683e372e6c11729
-
-patchfiles patch-dbus-sysdeps-unix.c.diff \
- patch-launchd-integration-dist.diff
+# There is a proposeal to use launchd with dbus (see https://bugs.freedesktop.org/show_bug.cgi?id=14259).
+# patch-launchd-integration.diff is a slightly modified patch from Fink.
+patchfiles patch-launchd-integration.diff
-post-patch {
- reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/dbus/dbus-sysdeps-unix.c
-}
+use_autoreconf yes
-depends_build port:pkgconfig
+depends_build \
+ port:pkgconfig \
+ port:autoconf \
+ port:automake \
+ port:libtool
+set dbus_user messagebus
+set dbus_group messagebus
+set startup_root ""
+
depends_lib port:expat
configure.args --disable-doxygen-docs \
--disable-xml-docs \
--without-x \
- --enable-launchd
+ --enable-launchd \
+ --with-launchd-agent-dir=${prefix}/Library/LaunchAgents
+pre-configure {
+ # Value must be set in pre-configure because dbus_user may change in variant.
+ configure.args-append --with-dbus-user=${dbus_user}
+}
+
+post-patch {
+ reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/dbus/dbus-sysdeps-unix.c
+ reinplace {s|broken_poll="no (cross compiling)"|broken_poll=yes|} ${worksrcpath}/configure
+
+ if { ! [variant_isset no_startupitem] } {
+ # Disable if installed into startup directory.
+ reinplace "s|<false />|<false />\\\n\\\n\\\t<key>Disabled</key>\\\n\\\t<true/>|" \
+ ${worksrcpath}/bus/org.freedesktop.dbus-session.plist.in
+ }
+
+ if { ${os.major} >= 9 } {
+ # Allow OnDemand for Leopard and above.
+ reinplace {s|<false />|<true />|} \
+ ${worksrcpath}/bus/org.freedesktop.dbus-session.plist.in
+ }
+}
+
platform darwin 7 {
- patchfiles patch-dbus-launch-x11.c.diff \
- patch-dbus-sysdeps-util-unix.c.diff
+ depends_build-delete port:autoconf port:automake port:libtool
+ depends_lib-append port:xorg-libsm port:xorg-libX11
- depends_lib-append port:xorg-libX11
+ patchfiles-delete patch-launchd-integration.diff
+ use_autoreconf no
+
configure.args-delete --without-x \
- --enable-launchd
+ --enable-launchd \
+ --with-launchd-agent-dir=${prefix}/Library/LaunchAgents
configure.args-append --with-x
+
+ post-patch {
+ # Neither _SC_GETPW_R_SIZE_MAX nor _SC_GETGR_R_SIZE_MAX are defined in Panther.
+ # The value of -1 is used to emulate a failed sysconf call.
+ reinplace "s|sysconf (_SC_GETPW_R_SIZE_MAX)|-1|" \
+ ${worksrcpath}/dbus/dbus-sysdeps-unix.c
+ reinplace "s|sysconf (_SC_GETGR_R_SIZE_MAX)|-1|" \
+ ${worksrcpath}/dbus/dbus-sysdeps-util-unix.c
+
+ # -Wno-pointer-sign does not work on Panther.
+ reinplace {/CFLAGS="$CFLAGS -Wno-pointer-sign"/d} ${worksrcpath}/configure
+ }
+
+ if { ! [variant_isset no_startupitem] } {
+ startupitem.create yes
+ }
+ startupitem.name dbus
+ startupitem.executable ${prefix}/bin/dbus-daemon --system --nofork
}
use_parallel_build yes
@@ -62,42 +112,89 @@
}
}
-post-destroot {
- foreach dir ${destroot.keepdirs} {
- file mkdir $dir
- }
-}
-
destroot.keepdirs \
${destroot}${prefix}/share/dbus-1/services \
${destroot}${prefix}/var/run/dbus \
- ${destroot}${prefix}/var/lib/dbus \
${destroot}${prefix}/etc/dbus-1/system.d \
${destroot}${prefix}/etc/dbus-1/session.d
-startupitem.create yes
-startupitem.name dbus
-startupitem.executable ${prefix}/bin/dbus-daemon --system --nofork
+post-destroot {
+ global plistFl
+
+ if {![variant_isset darwin_7]} {
+ # Simplify startup script over startupitem.create.
+ # See http://trac.macports.org/ticket/15081
+ set plistDir ${prefix}/Library/LaunchDaemons
+ xinstall -d -m 0755 ${destroot}${plistDir}
+ set plistFl ${plistDir}/org.freedesktop.dbus-system.plist
+ set plist [open "${destroot}${plistFl}" w 0644]
+
+ puts ${plist} "<?xml version='1.0' encoding='UTF-8'?>"
+ puts ${plist} "<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\""
+ puts ${plist} "\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\" >"
+ puts ${plist} "<plist version='1.0'>"
+ puts ${plist} "<dict>"
+
+ puts ${plist} "<key>Label</key><string>org.freedesktop.dbus-system.plist</string>"
+
+ puts ${plist} "<key>ProgramArguments</key>"
+ puts ${plist} "<array>"
+ puts ${plist} "\t<string>${prefix}/bin/dbus-daemon</string>"
+ puts ${plist} "\t<string>--system</string>"
+ puts ${plist} "\t<string>--nofork</string>"
+ puts ${plist} "</array>"
+
+ puts ${plist} "<key>OnDemand</key><false/>"
+
+ if { ! [variant_isset no_startupitem] } {
+ puts ${plist} "<key>Disabled</key><true/>"
+ }
+
+ puts ${plist} "</dict>"
+ puts ${plist} "</plist>"
+
+ close ${plist}
+
+ if { ! [variant_isset no_startupitem] } {
+ xinstall -d -m 0755 ${destroot}${startup_root}/Library/LaunchDaemons
+ xinstall -d -m 0755 ${destroot}${startup_root}/Library/LaunchAgents
+ ln -s ${plistFl} ${destroot}${startup_root}/Library/LaunchDaemons
+ ln -s ${prefix}/Library/LaunchAgents/org.freedesktop.dbus-session.plist ${destroot}${startup_root}/Library/LaunchAgents
+ }
+ }
+
+ system "env DYLD_LIBRARY_PATH=${destroot}${prefix}/lib ${destroot}${prefix}/bin/dbus-uuidgen --ensure=${destroot}${prefix}/var/lib/dbus/machine-id"
+}
pre-activate {
- addgroup messagebus
- adduser messagebus gid=[existsgroup messagebus] realname=Message\ Bus
+ addgroup ${dbus_group}
+ adduser ${dbus_user} gid=[existsgroup ${dbus_group}] realname=Message\ Bus
}
post-activate {
- file attributes ${prefix}/var/run/dbus -group messagebus -owner messagebus
- file attributes ${prefix}/libexec/dbus-daemon-launch-helper -group messagebus
- system "dbus-uuidgen --ensure"
+ global plistFl
- if {![variant_isset darwin_7]} {
- ui_msg "##############################################################################"
- ui_msg "# It is absolutely necessary for dbus enabled programs to work to execute"
+ file attributes ${prefix}/var/run/dbus -group ${dbus_group} -owner ${dbus_user}
+ file attributes ${prefix}/libexec/dbus-daemon-launch-helper -group ${dbus_group}
+
+ if {![variant_isset darwin_7] && ![variant_isset no_startupitem] } {
+ if { ! [variant_isset no_root] } {
+ set sudo "sudo "
+ file attributes /Library/LaunchAgents/org.freedesktop.dbus-session.plist -owner root -group wheel
+ file attributes /Library/LaunchDaemons/[file tail ${plistFl}] -owner root -group wheel
+ } else {
+ set sudo ""
+ }
+
+ ui_msg "#################################################################################################"
+ ui_msg "# Startup items have been generated that will aid in"
+ ui_msg "# starting ${portname} with launchd. They are disabled"
+ ui_msg "# by default. Execute the following command to start them,"
+ ui_msg "# and to cause it to launch at startup:"
ui_msg "#"
- ui_msg "# launchctl load /Library/LaunchAgents/org.freedesktop.dbus-session.plist"
- ui_msg "#"
- ui_msg "# once for every user. Don't use 'sudo', else it will work only for root!"
- ui_msg "# You also have to unload it before deactivating/uninstalling this software!"
- ui_msg "##############################################################################"
+ ui_msg "# ${sudo}launchctl load -w ${startup_root}/Library/LaunchDaemons/[file tail ${plistFl}]"
+ ui_msg "# ${sudo}launchctl load -w ${startup_root}/Library/LaunchAgents/org.freedesktop.dbus-session.plist"
+ ui_msg "##################################################################################################"
}
}
@@ -105,26 +202,38 @@
configure.args-append --enable-tests
}
-if {[variant_isset universal]} {
- if { ${os.arch}=="i386" } {
- array set merger_configure_args {
- ppc64 --config-cache
+variant no_startupitem description {Do not install startup files.} {}
+
+variant no_root description {Run the DBUS daemon as MacPorts install user.} {
+ pre-fetch {
+ if { ${install.user}=="root" || ${install.group}=="wheel" } {
+ ui_error "The DBUS daemon should not be run as root."
+ erorr "Please do not use this variant with your MacPorts configuration."
}
- if { ${os.major} > 9 } {
- set merger_configure_args(ppc) --config-cache
- }
- } else {
- array set merger_configure_args {
- i386 --config-cache
- x86_64 --config-cache
- }
}
- post-extract {
- # Answers to questions configure can't determine without running a program.
- copy ${filespath}/config.cache ${worksrcpath}
+ set dbus_user ${install.user}
+ set dbus_group ${install.group}
+ set startup_root [join [lrange [exec /usr/bin/dscl . -read Users/${install.user} NFSHomeDirectory] 1 end]]
+
+ # Files are installed into user's startup directory.
+ if { ![variant_isset no_staruptitem] } {
+ destroot.violate_mtree yes
}
}
+set cross_opts "ac_cv_have_abstract_sockets=no NM='/usr/bin/nm -p'"
+if { ${os.arch}=="i386" } {
+ if { ${os.major} >= 10 } {
+ set merger_configure_env(ppc) ${cross_opts}
+ } else {
+ set merger_configure_env(ppc) "NM='/usr/bin/nm -p'"
+ }
+ set merger_configure_env(ppc64) ${cross_opts}
+} else {
+ set merger_configure_env(i386) ${cross_opts}
+ set merger_configure_env(x86_64) ${cross_opts}
+}
+
livecheck.check regex
livecheck.regex {D-Bus (\d+(?:\.\d+)*)}
Deleted: trunk/dports/devel/dbus/files/config.cache
===================================================================
--- trunk/dports/devel/dbus/files/config.cache 2009-04-07 02:11:27 UTC (rev 49299)
+++ trunk/dports/devel/dbus/files/config.cache 2009-04-07 03:18:47 UTC (rev 49300)
@@ -1,2 +0,0 @@
-broken_poll=yes
-ac_cv_have_abstract_sockets=no
Deleted: trunk/dports/devel/dbus/files/patch-dbus-launch-x11.c.diff
===================================================================
--- trunk/dports/devel/dbus/files/patch-dbus-launch-x11.c.diff 2009-04-07 02:11:27 UTC (rev 49299)
+++ trunk/dports/devel/dbus/files/patch-dbus-launch-x11.c.diff 2009-04-07 03:18:47 UTC (rev 49300)
@@ -1,11 +0,0 @@
---- ./tools/dbus-launch-x11.c.orig 2008-10-11 18:53:43.000000000 +0800
-+++ ./tools/dbus-launch-x11.c 2008-10-11 18:51:51.000000000 +0800
-@@ -143,7 +143,7 @@
- */
- for (p = display; *p; ++p)
- {
-- if (*p == ':')
-+ if (*p == ':' || *p == '/')
- *p = '_';
- }
-
Deleted: trunk/dports/devel/dbus/files/patch-dbus-sysdeps-unix.c.diff
===================================================================
--- trunk/dports/devel/dbus/files/patch-dbus-sysdeps-unix.c.diff 2009-04-07 02:11:27 UTC (rev 49299)
+++ trunk/dports/devel/dbus/files/patch-dbus-sysdeps-unix.c.diff 2009-04-07 03:18:47 UTC (rev 49300)
@@ -1,74 +0,0 @@
---- dbus/dbus-sysdeps-unix.c.orig 2008-12-28 12:03:48.000000000 -0500
-+++ dbus/dbus-sysdeps-unix.c 2008-12-28 12:13:00.000000000 -0500
-@@ -1591,8 +1591,10 @@
- gid_t *buf;
- int buf_count;
- int i;
--
-- buf_count = 17;
-+ int initial_buf_count;
-+
-+ initial_buf_count = 17;
-+ buf_count = initial_buf_count;
- buf = dbus_new (gid_t, buf_count);
- if (buf == NULL)
- {
-@@ -1604,7 +1606,29 @@
- info->primary_gid,
- buf, &buf_count) < 0)
- {
-- gid_t *new = dbus_realloc (buf, buf_count * sizeof (buf[0]));
-+ gid_t *new;
-+ /* Presumed cause of negative return code: buf has insufficient
-+ entries to hold the entire group list. The Linux behavior in this
-+ case is to pass back the actual number of groups in buf_count, but
-+ on Mac OS X 10.5, buf_count is unhelpfully left alone.
-+ So as a hack, try to help out a bit by guessing a larger
-+ number of groups, within reason.. might still fail, of course,
-+ but we can at least print a more informative message. I looked up
-+ the "right way" to do this by downloading Apple's own source code
-+ for the "id" command, and it turns out that they use an
-+ undocumented library function getgrouplist_2 (!) which is not
-+ declared in any header in /usr/include (!!). That did not seem
-+ like the way to go here.
-+
-+ I also demoted this problem to a warning as long as errno is 0,
-+ since as far as I could tell from discussion on the web, dbus works
-+ fine even when HAVE_GETGROUPLIST is false and it can only know about
-+ the primary group.
-+ */
-+ if (buf_count == initial_buf_count) {
-+ buf_count *= 16; /* Retry with an arbitrarily scaled-up array */
-+ }
-+ new = dbus_realloc (buf, buf_count * sizeof (buf[0]));
- if (new == NULL)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
-@@ -1617,14 +1641,19 @@
- errno = 0;
- if (getgrouplist (username_c, info->primary_gid, buf, &buf_count) < 0)
- {
-- dbus_set_error (error,
-- _dbus_error_from_errno (errno),
-- "Failed to get groups for username \"%s\" primary GID "
-- DBUS_GID_FORMAT ": %s\n",
-- username_c, info->primary_gid,
-- _dbus_strerror (errno));
-- dbus_free (buf);
-- goto failed;
-+ if (errno == 0) {
-+ _dbus_warn("It appears that username \"%s\" is in more than %d groups.\nProceeding with just the first %d groups.",
-+ username_c, buf_count, buf_count);
-+ } else {
-+ dbus_set_error (error,
-+ _dbus_error_from_errno (errno),
-+ "Failed to get groups for username \"%s\" primary GID "
-+ DBUS_GID_FORMAT ": %s\n",
-+ username_c, info->primary_gid,
-+ _dbus_strerror (errno));
-+ dbus_free (buf);
-+ goto failed;
-+ }
- }
- }
-
Deleted: trunk/dports/devel/dbus/files/patch-dbus-sysdeps-util-unix.c.diff
===================================================================
--- trunk/dports/devel/dbus/files/patch-dbus-sysdeps-util-unix.c.diff 2009-04-07 02:11:27 UTC (rev 49299)
+++ trunk/dports/devel/dbus/files/patch-dbus-sysdeps-util-unix.c.diff 2009-04-07 03:18:47 UTC (rev 49300)
@@ -1,17 +0,0 @@
---- dbus/dbus-sysdeps-util-unix.c.orig 2008-12-28 12:04:09.000000000 -0500
-+++ dbus/dbus-sysdeps-util-unix.c 2008-12-28 10:04:16.000000000 -0500
-@@ -43,6 +43,7 @@
- #include <sys/socket.h>
- #include <dirent.h>
- #include <sys/un.h>
-+#include <syslog.h>
- #ifdef HAVE_LIBAUDIT
- #include <sys/prctl.h>
- #include <sys/capability.h>
-@@ -1227,4 +1228,4 @@
- _dbus_string_free (&cmdline);
- _dbus_string_free (&path);
- return FALSE;
--}
-\ No newline at end of file
-+}
Deleted: trunk/dports/devel/dbus/files/patch-launchd-integration-dist.diff
===================================================================
--- trunk/dports/devel/dbus/files/patch-launchd-integration-dist.diff 2009-04-07 02:11:27 UTC (rev 49299)
+++ trunk/dports/devel/dbus/files/patch-launchd-integration-dist.diff 2009-04-07 03:18:47 UTC (rev 49300)
@@ -1,2686 +0,0 @@
-This patch is provides launchd support for dbus. This version has beed
-ported from HEAD to the 1.2.12 distribution and therefore also include
-patches for configure and Makefile.in's
-Hopefully this gets soon integrated upstream, see this bug for details:
-https://bugs.freedesktop.org/show_bug.cgi?id=14259
-
-diff -Nurp Makefile.in Makefile.in
---- Makefile.in 2009-01-07 01:30:43.000000000 +0100
-+++ Makefile.in 2009-01-10 16:39:19.000000000 +0100
-@@ -1,4 +1,4 @@
--# Makefile.in generated by automake 1.10.1 from Makefile.am.
-+# Makefile.in generated by automake 1.10.2 from Makefile.am.
- # @configure_input@
-
- # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-@@ -152,6 +152,7 @@ DBUS_MAJOR_VERSION = @DBUS_MAJOR_VERSION
- DBUS_MICRO_VERSION = @DBUS_MICRO_VERSION@
- DBUS_MINOR_VERSION = @DBUS_MINOR_VERSION@
- DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@
-+DBUS_SESSION_BUS_DEFAULT_ADDRESS = @DBUS_SESSION_BUS_DEFAULT_ADDRESS@
- DBUS_SESSION_SOCKET_DIR = @DBUS_SESSION_SOCKET_DIR@
- DBUS_SYSTEM_BUS_DEFAULT_ADDRESS = @DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@
- DBUS_SYSTEM_PID_FILE = @DBUS_SYSTEM_PID_FILE@
-@@ -167,7 +168,7 @@ DEFS = @DEFS@
- DEPDIR = @DEPDIR@
- DOXYGEN = @DOXYGEN@
- DSYMUTIL = @DSYMUTIL@
--ECHO = @ECHO@
-+DUMPBIN = @DUMPBIN@
- ECHO_C = @ECHO_C@
- ECHO_N = @ECHO_N@
- ECHO_T = @ECHO_T@
-@@ -179,8 +180,7 @@ EXPANDED_LIBDIR = @EXPANDED_LIBDIR@
- EXPANDED_LIBEXECDIR = @EXPANDED_LIBEXECDIR@
- EXPANDED_LOCALSTATEDIR = @EXPANDED_LOCALSTATEDIR@
- EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@
--F77 = @F77@
--FFLAGS = @FFLAGS@
-+FGREP = @FGREP@
- GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
- GREP = @GREP@
- INSTALL = @INSTALL@
-@@ -188,12 +188,16 @@ INSTALL_DATA = @INSTALL_DATA@
- INSTALL_PROGRAM = @INSTALL_PROGRAM@
- INSTALL_SCRIPT = @INSTALL_SCRIPT@
- INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-+LAUNCHCTL = @LAUNCHCTL@
-+LAUNCHD_AGENT_DIR = @LAUNCHD_AGENT_DIR@
-+LD = @LD@
- LDFLAGS = @LDFLAGS@
- LIBOBJS = @LIBOBJS@
- LIBS = @LIBS@
- LIBTOOL = @LIBTOOL@
- LIBXML_CFLAGS = @LIBXML_CFLAGS@
- LIBXML_LIBS = @LIBXML_LIBS@
-+LIPO = @LIPO@
- LN_S = @LN_S@
- LTLIBOBJS = @LTLIBOBJS@
- LT_AGE = @LT_AGE@
-@@ -202,8 +206,12 @@ LT_REVISION = @LT_REVISION@
- MAINT = @MAINT@
- MAKEINFO = @MAKEINFO@
- MKDIR_P = @MKDIR_P@
-+NM = @NM@
- NMEDIT = @NMEDIT@
-+OBJDUMP = @OBJDUMP@
- OBJEXT = @OBJEXT@
-+OTOOL = @OTOOL@
-+OTOOL64 = @OTOOL64@
- PACKAGE = @PACKAGE@
- PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
- PACKAGE_NAME = @PACKAGE_NAME@
-@@ -250,7 +258,7 @@ abs_top_builddir = @abs_top_builddir@
- abs_top_srcdir = @abs_top_srcdir@
- ac_ct_CC = @ac_ct_CC@
- ac_ct_CXX = @ac_ct_CXX@
--ac_ct_F77 = @ac_ct_F77@
-+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
- am__include = @am__include@
- am__leading_dot = @am__leading_dot@
- am__quote = @am__quote@
-@@ -281,6 +289,7 @@ libdir = @libdir@
- libexecdir = @libexecdir@
- localedir = @localedir@
- localstatedir = @localstatedir@
-+lt_ECHO = @lt_ECHO@
- mandir = @mandir@
- mkdir_p = @mkdir_p@
- oldincludedir = @oldincludedir@
-@@ -411,7 +420,7 @@ clean-libtool:
- -rm -rf .libs _libs
-
- distclean-libtool:
-- -rm -f libtool
-+ -rm -f libtool config.lt
- install-pkgconfigDATA: $(pkgconfig_DATA)
- @$(NORMAL_INSTALL)
- test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
-@@ -505,7 +514,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
-- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
-+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
- tags: TAGS
-diff -Nurp bus/Makefile.in bus/Makefile.in
---- bus/Makefile.in 2009-01-07 01:30:41.000000000 +0100
-+++ bus/Makefile.in 2009-01-10 16:39:18.000000000 +0100
-@@ -1,4 +1,4 @@
--# Makefile.in generated by automake 1.10.1 from Makefile.am.
-+# Makefile.in generated by automake 1.10.2 from Makefile.am.
- # @configure_input@
-
- # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-@@ -43,6 +43,7 @@ noinst_PROGRAMS = $(am__EXEEXT_1) dbus-d
- subdir = bus
- DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- $(srcdir)/dbus-daemon.1.in $(srcdir)/messagebus.in \
-+ $(srcdir)/org.freedesktop.dbus-session.plist.in \
- $(srcdir)/rc.messagebus.in $(srcdir)/session.conf.in \
- $(srcdir)/system.conf.in
- ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-@@ -52,8 +53,8 @@ am__configure_deps = $(am__aclocal_m4_de
- $(ACLOCAL_M4)
- mkinstalldirs = $(install_sh) -d
- CONFIG_HEADER = $(top_builddir)/config.h
--CONFIG_CLEAN_FILES = system.conf session.conf messagebus rc.messagebus \
-- dbus-daemon.1
-+CONFIG_CLEAN_FILES = system.conf session.conf messagebus \
-+ org.freedesktop.dbus-session.plist rc.messagebus dbus-daemon.1
- @DBUS_BUILD_TESTS_TRUE at am__EXEEXT_1 = bus-test$(EXEEXT) \
- @DBUS_BUILD_TESTS_TRUE@ bus-test-system$(EXEEXT) \
- @DBUS_BUILD_TESTS_TRUE@ bus-test-launch-helper$(EXEEXT)
-@@ -189,7 +190,7 @@ dbus_daemon_launch_helper_test_LINK = $(
- $(AM_CFLAGS) $(CFLAGS) \
- $(dbus_daemon_launch_helper_test_LDFLAGS) $(LDFLAGS) -o $@
- am__installdirs = "$(DESTDIR)$(initddir)" "$(DESTDIR)$(man1dir)" \
-- "$(DESTDIR)$(configdir)"
-+ "$(DESTDIR)$(agentdir)" "$(DESTDIR)$(configdir)"
- initdSCRIPT_INSTALL = $(INSTALL_SCRIPT)
- SCRIPTS = $(initd_SCRIPTS)
- DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-@@ -223,8 +224,9 @@ am__vpath_adj = case $$p in \
- *) f=$$p;; \
- esac;
- am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
-+agentDATA_INSTALL = $(INSTALL_DATA)
- configDATA_INSTALL = $(INSTALL_DATA)
--DATA = $(config_DATA)
-+DATA = $(agent_DATA) $(config_DATA)
- ETAGS = etags
- CTAGS = ctags
- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-@@ -266,6 +268,7 @@ DBUS_MAJOR_VERSION = @DBUS_MAJOR_VERSION
- DBUS_MICRO_VERSION = @DBUS_MICRO_VERSION@
- DBUS_MINOR_VERSION = @DBUS_MINOR_VERSION@
- DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@
-+DBUS_SESSION_BUS_DEFAULT_ADDRESS = @DBUS_SESSION_BUS_DEFAULT_ADDRESS@
- DBUS_SESSION_SOCKET_DIR = @DBUS_SESSION_SOCKET_DIR@
- DBUS_SYSTEM_BUS_DEFAULT_ADDRESS = @DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@
- DBUS_SYSTEM_PID_FILE = @DBUS_SYSTEM_PID_FILE@
-@@ -281,7 +284,7 @@ DEFS = @DEFS@
- DEPDIR = @DEPDIR@
- DOXYGEN = @DOXYGEN@
- DSYMUTIL = @DSYMUTIL@
--ECHO = @ECHO@
-+DUMPBIN = @DUMPBIN@
- ECHO_C = @ECHO_C@
- ECHO_N = @ECHO_N@
- ECHO_T = @ECHO_T@
-@@ -293,8 +296,7 @@ EXPANDED_LIBDIR = @EXPANDED_LIBDIR@
- EXPANDED_LIBEXECDIR = @EXPANDED_LIBEXECDIR@
- EXPANDED_LOCALSTATEDIR = @EXPANDED_LOCALSTATEDIR@
- EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@
--F77 = @F77@
--FFLAGS = @FFLAGS@
-+FGREP = @FGREP@
- GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
- GREP = @GREP@
- INSTALL = @INSTALL@
-@@ -302,12 +304,16 @@ INSTALL_DATA = @INSTALL_DATA@
- INSTALL_PROGRAM = @INSTALL_PROGRAM@
- INSTALL_SCRIPT = @INSTALL_SCRIPT@
- INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-+LAUNCHCTL = @LAUNCHCTL@
-+LAUNCHD_AGENT_DIR = @LAUNCHD_AGENT_DIR@
-+LD = @LD@
- LDFLAGS = @LDFLAGS@
- LIBOBJS = @LIBOBJS@
- LIBS = @LIBS@
- LIBTOOL = @LIBTOOL@
- LIBXML_CFLAGS = @LIBXML_CFLAGS@
- LIBXML_LIBS = @LIBXML_LIBS@
-+LIPO = @LIPO@
- LN_S = @LN_S@
- LTLIBOBJS = @LTLIBOBJS@
- LT_AGE = @LT_AGE@
-@@ -316,8 +322,12 @@ LT_REVISION = @LT_REVISION@
- MAINT = @MAINT@
- MAKEINFO = @MAKEINFO@
- MKDIR_P = @MKDIR_P@
-+NM = @NM@
- NMEDIT = @NMEDIT@
-+OBJDUMP = @OBJDUMP@
- OBJEXT = @OBJEXT@
-+OTOOL = @OTOOL@
-+OTOOL64 = @OTOOL64@
- PACKAGE = @PACKAGE@
- PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
- PACKAGE_NAME = @PACKAGE_NAME@
-@@ -364,7 +374,7 @@ abs_top_builddir = @abs_top_builddir@
- abs_top_srcdir = @abs_top_srcdir@
- ac_ct_CC = @ac_ct_CC@
- ac_ct_CXX = @ac_ct_CXX@
--ac_ct_F77 = @ac_ct_F77@
-+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
- am__include = @am__include@
- am__leading_dot = @am__leading_dot@
- am__quote = @am__quote@
-@@ -395,6 +405,7 @@ libdir = @libdir@
- libexecdir = @libexecdir@
- localedir = @localedir@
- localstatedir = @localstatedir@
-+lt_ECHO = @lt_ECHO@
- mandir = @mandir@
- mkdir_p = @mkdir_p@
- oldincludedir = @oldincludedir@
-@@ -418,12 +429,15 @@ INCLUDES = -I$(top_srcdir) $(DBUS_BUS_CF
- EFENCE =
- CONFIG_IN_FILES = \
- session.conf.in \
-- system.conf.in
-+ system.conf.in \
-+ org.freedesktop.dbus-session.plist.in
-
- config_DATA = \
- session.conf \
- system.conf
-
-+ at DBUS_ENABLE_LAUNCHD_TRUE@agentdir = $(LAUNCHD_AGENT_DIR)
-+ at DBUS_ENABLE_LAUNCHD_TRUE@agent_DATA = org.freedesktop.dbus-session.plist
- @DBUS_USE_EXPAT_TRUE at XML_SOURCES = config-loader-expat.c
- @DBUS_USE_LIBXML_TRUE at XML_SOURCES = config-loader-libxml.c
- @DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX_FALSE@@DBUS_BUS_ENABLE_INOTIFY_FALSE@@DBUS_BUS_ENABLE_KQUEUE_FALSE at DIR_WATCH_SOURCE = dir-watch-default.c
-@@ -569,8 +583,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
-- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-- && exit 0; \
-+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-+ && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
-@@ -600,6 +614,8 @@ session.conf: $(top_builddir)/config.sta
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
- messagebus: $(top_builddir)/config.status $(srcdir)/messagebus.in
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-+org.freedesktop.dbus-session.plist: $(top_builddir)/config.status $(srcdir)/org.freedesktop.dbus-session.plist.in
-+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
- rc.messagebus: $(top_builddir)/config.status $(srcdir)/rc.messagebus.in
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
- dbus-daemon.1: $(top_builddir)/config.status $(srcdir)/dbus-daemon.1.in
-@@ -960,8 +976,8 @@ install-man1: $(man1_MANS) $(man_MANS)
- esac; \
- done; \
- for i in $$list; do \
-- if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
-- else file=$$i; fi; \
-+ if test -f $$i; then file=$$i; \
-+ else file=$(srcdir)/$$i; fi; \
- ext=`echo $$i | sed -e 's/^.*\\.//'`; \
- case "$$ext" in \
- 1*) ;; \
-@@ -994,6 +1010,23 @@ uninstall-man1:
- echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
- rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
- done
-+install-agentDATA: $(agent_DATA)
-+ @$(NORMAL_INSTALL)
-+ test -z "$(agentdir)" || $(MKDIR_P) "$(DESTDIR)$(agentdir)"
-+ @list='$(agent_DATA)'; for p in $$list; do \
-+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-+ f=$(am__strip_dir) \
-+ echo " $(agentDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(agentdir)/$$f'"; \
-+ $(agentDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(agentdir)/$$f"; \
-+ done
-+
-+uninstall-agentDATA:
-+ @$(NORMAL_UNINSTALL)
-+ @list='$(agent_DATA)'; for p in $$list; do \
-+ f=$(am__strip_dir) \
-+ echo " rm -f '$(DESTDIR)$(agentdir)/$$f'"; \
-+ rm -f "$(DESTDIR)$(agentdir)/$$f"; \
-+ done
- install-configDATA: $(config_DATA)
- @$(NORMAL_INSTALL)
- test -z "$(configdir)" || $(MKDIR_P) "$(DESTDIR)$(configdir)"
-@@ -1017,7 +1050,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
-- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
-+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
- tags: TAGS
-@@ -1060,7 +1093,7 @@ distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
- check-TESTS: $(TESTS)
-- @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \
-+ @failed=0; all=0; xfail=0; xpass=0; skip=0; \
- srcdir=$(srcdir); export srcdir; \
- list=' $(TESTS) '; \
- if test -n "$$list"; then \
-@@ -1071,7 +1104,7 @@ check-TESTS: $(TESTS)
- if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
- all=`expr $$all + 1`; \
- case " $(XFAIL_TESTS) " in \
-- *$$ws$$tst$$ws*) \
-+ *[\ \ ]$$tst[\ \ ]*) \
- xpass=`expr $$xpass + 1`; \
- failed=`expr $$failed + 1`; \
- echo "XPASS: $$tst"; \
-@@ -1083,7 +1116,7 @@ check-TESTS: $(TESTS)
- elif test $$? -ne 77; then \
- all=`expr $$all + 1`; \
- case " $(XFAIL_TESTS) " in \
-- *$$ws$$tst$$ws*) \
-+ *[\ \ ]$$tst[\ \ ]*) \
- xfail=`expr $$xfail + 1`; \
- echo "XFAIL: $$tst"; \
- ;; \
-@@ -1097,23 +1130,36 @@ check-TESTS: $(TESTS)
- echo "SKIP: $$tst"; \
- fi; \
- done; \
-+ if test "$$all" -eq 1; then \
-+ tests="test"; \
-+ All=""; \
-+ else \
-+ tests="tests"; \
-+ All="All "; \
-+ fi; \
- if test "$$failed" -eq 0; then \
- if test "$$xfail" -eq 0; then \
-- banner="All $$all tests passed"; \
-+ banner="$$All$$all $$tests passed"; \
- else \
-- banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
-+ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
-+ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
- fi; \
- else \
- if test "$$xpass" -eq 0; then \
-- banner="$$failed of $$all tests failed"; \
-+ banner="$$failed of $$all $$tests failed"; \
- else \
-- banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
-+ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
-+ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
- fi; \
- fi; \
- dashes="$$banner"; \
- skipped=""; \
- if test "$$skip" -ne 0; then \
-- skipped="($$skip tests were not run)"; \
-+ if test "$$skip" -eq 1; then \
-+ skipped="($$skip test was not run)"; \
-+ else \
-+ skipped="($$skip tests were not run)"; \
-+ fi; \
- test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
- dashes="$$skipped"; \
- fi; \
-@@ -1163,7 +1209,7 @@ check-am: all-am
- check: check-am
- all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA)
- installdirs:
-- for dir in "$(DESTDIR)$(initddir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(configdir)"; do \
-+ for dir in "$(DESTDIR)$(initddir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(agentdir)" "$(DESTDIR)$(configdir)"; do \
- test -z "$$dir" || $(MKDIR_P) "$$dir"; \
- done
- install: install-am
-@@ -1211,7 +1257,8 @@ info: info-am
-
- info-am:
-
--install-data-am: install-configDATA install-initdSCRIPTS install-man
-+install-data-am: install-agentDATA install-configDATA \
-+ install-initdSCRIPTS install-man
- @$(NORMAL_INSTALL)
- $(MAKE) $(AM_MAKEFLAGS) install-data-hook
-
-@@ -1249,8 +1296,8 @@ ps: ps-am
-
- ps-am:
-
--uninstall-am: uninstall-configDATA uninstall-initdSCRIPTS \
-- uninstall-man
-+uninstall-am: uninstall-agentDATA uninstall-configDATA \
-+ uninstall-initdSCRIPTS uninstall-man
- @$(NORMAL_INSTALL)
- $(MAKE) $(AM_MAKEFLAGS) uninstall-hook
-
-@@ -1262,18 +1309,18 @@ uninstall-man: uninstall-man1
- clean-generic clean-libtool clean-local clean-noinstPROGRAMS \
- ctags distclean distclean-compile distclean-generic \
- distclean-libtool distclean-tags distdir dvi dvi-am html \
-- html-am info info-am install install-am install-configDATA \
-- install-data install-data-am install-data-hook install-dvi \
-- install-dvi-am install-exec install-exec-am install-html \
-- install-html-am install-info install-info-am \
-- install-initdSCRIPTS install-man install-man1 install-pdf \
-- install-pdf-am install-ps install-ps-am install-strip \
-- installcheck installcheck-am installdirs maintainer-clean \
-- maintainer-clean-generic mostlyclean mostlyclean-compile \
-- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-- tags uninstall uninstall-am uninstall-configDATA \
-- uninstall-hook uninstall-initdSCRIPTS uninstall-man \
-- uninstall-man1
-+ html-am info info-am install install-agentDATA install-am \
-+ install-configDATA install-data install-data-am \
-+ install-data-hook install-dvi install-dvi-am install-exec \
-+ install-exec-am install-html install-html-am install-info \
-+ install-info-am install-initdSCRIPTS install-man install-man1 \
-+ install-pdf install-pdf-am install-ps install-ps-am \
-+ install-strip installcheck installcheck-am installdirs \
-+ maintainer-clean maintainer-clean-generic mostlyclean \
-+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
-+ pdf pdf-am ps ps-am tags uninstall uninstall-agentDATA \
-+ uninstall-am uninstall-configDATA uninstall-hook \
-+ uninstall-initdSCRIPTS uninstall-man uninstall-man1
-
-
- clean-local:
-diff -Nurp dbus/Makefile.in dbus/Makefile.in
---- dbus/Makefile.in 2009-01-07 01:30:42.000000000 +0100
-+++ dbus/Makefile.in 2009-01-10 16:39:18.000000000 +0100
-@@ -1,4 +1,4 @@
--# Makefile.in generated by automake 1.10.1 from Makefile.am.
-+# Makefile.in generated by automake 1.10.2 from Makefile.am.
- # @configure_input@
-
- # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-@@ -61,7 +61,38 @@ libLTLIBRARIES_INSTALL = $(INSTALL)
- LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES)
- am__DEPENDENCIES_1 =
- libdbus_1_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
--am__objects_1 = dbus-address.lo dbus-auth.lo dbus-auth-script.lo \
-+am__libdbus_1_la_SOURCES_DIST = dbus-address.c dbus-auth.c dbus-auth.h \
-+ dbus-auth-script.c dbus-auth-script.h dbus-bus.c \
-+ dbus-connection.c dbus-connection-internal.h \
-+ dbus-credentials.c dbus-credentials.h dbus-errors.c \
-+ dbus-keyring.c dbus-keyring.h dbus-marshal-header.c \
-+ dbus-marshal-header.h dbus-marshal-byteswap.c \
-+ dbus-marshal-byteswap.h dbus-marshal-recursive.c \
-+ dbus-marshal-recursive.h dbus-marshal-validate.c \
-+ dbus-marshal-validate.h dbus-message.c dbus-message-internal.h \
-+ dbus-message-private.h dbus-misc.c dbus-object-tree.c \
-+ dbus-object-tree.h dbus-pending-call.c \
-+ dbus-pending-call-internal.h dbus-resources.c dbus-resources.h \
-+ dbus-server.c dbus-server-debug-pipe.c \
-+ dbus-server-debug-pipe.h dbus-server-protected.h \
-+ dbus-server-socket.c dbus-server-socket.h dbus-server-unix.c \
-+ dbus-server-unix.h dbus-sha.c dbus-sha.h dbus-signature.c \
-+ dbus-timeout.c dbus-timeout.h dbus-threads-internal.h \
-+ dbus-threads.c dbus-transport.c dbus-transport.h \
-+ dbus-transport-protected.h dbus-transport-socket.c \
-+ dbus-transport-socket.h dbus-transport-unix.c \
-+ dbus-transport-unix.h dbus-uuidgen.c dbus-uuidgen.h \
-+ dbus-watch.c dbus-watch.h dbus-server-launchd.h \
-+ dbus-server-launchd.c dbus-dataslot.c dbus-dataslot.h \
-+ dbus-hash.c dbus-hash.h dbus-internals.c dbus-internals.h \
-+ dbus-list.c dbus-list.h dbus-marshal-basic.c \
-+ dbus-marshal-basic.h dbus-memory.c dbus-mempool.c \
-+ dbus-mempool.h dbus-string.c dbus-string.h \
-+ dbus-string-private.h dbus-sysdeps.c dbus-sysdeps.h \
-+ dbus-sysdeps-pthread.c dbus-sysdeps-unix.c dbus-sysdeps-unix.h \
-+ dbus-userdb.c dbus-userdb.h
-+ at DBUS_ENABLE_LAUNCHD_TRUE@am__objects_1 = dbus-server-launchd.lo
-+am__objects_2 = dbus-address.lo dbus-auth.lo dbus-auth-script.lo \
- dbus-bus.lo dbus-connection.lo dbus-credentials.lo \
- dbus-errors.lo dbus-keyring.lo dbus-marshal-header.lo \
- dbus-marshal-byteswap.lo dbus-marshal-recursive.lo \
-@@ -71,25 +102,62 @@ am__objects_1 = dbus-address.lo dbus-aut
- dbus-server-unix.lo dbus-sha.lo dbus-signature.lo \
- dbus-timeout.lo dbus-threads.lo dbus-transport.lo \
- dbus-transport-socket.lo dbus-transport-unix.lo \
-- dbus-uuidgen.lo dbus-watch.lo
--am__objects_2 = dbus-dataslot.lo dbus-hash.lo dbus-internals.lo \
-+ dbus-uuidgen.lo dbus-watch.lo $(am__objects_1)
-+am__objects_3 = dbus-dataslot.lo dbus-hash.lo dbus-internals.lo \
- dbus-list.lo dbus-marshal-basic.lo dbus-memory.lo \
- dbus-mempool.lo dbus-string.lo dbus-sysdeps.lo \
- dbus-sysdeps-pthread.lo dbus-sysdeps-unix.lo dbus-userdb.lo
--am_libdbus_1_la_OBJECTS = $(am__objects_1) $(am__objects_2)
-+am_libdbus_1_la_OBJECTS = $(am__objects_2) $(am__objects_3)
- libdbus_1_la_OBJECTS = $(am_libdbus_1_la_OBJECTS)
- libdbus_1_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(libdbus_1_la_LDFLAGS) $(LDFLAGS) -o $@
- libdbus_convenience_la_LIBADD =
--am__objects_3 = dbus-auth-util.lo dbus-credentials-util.lo \
-+am__libdbus_convenience_la_SOURCES_DIST = dbus-address.c dbus-auth.c \
-+ dbus-auth.h dbus-auth-script.c dbus-auth-script.h dbus-bus.c \
-+ dbus-connection.c dbus-connection-internal.h \
-+ dbus-credentials.c dbus-credentials.h dbus-errors.c \
-+ dbus-keyring.c dbus-keyring.h dbus-marshal-header.c \
-+ dbus-marshal-header.h dbus-marshal-byteswap.c \
-+ dbus-marshal-byteswap.h dbus-marshal-recursive.c \
-+ dbus-marshal-recursive.h dbus-marshal-validate.c \
-+ dbus-marshal-validate.h dbus-message.c dbus-message-internal.h \
-+ dbus-message-private.h dbus-misc.c dbus-object-tree.c \
-+ dbus-object-tree.h dbus-pending-call.c \
-+ dbus-pending-call-internal.h dbus-resources.c dbus-resources.h \
-+ dbus-server.c dbus-server-debug-pipe.c \
-+ dbus-server-debug-pipe.h dbus-server-protected.h \
-+ dbus-server-socket.c dbus-server-socket.h dbus-server-unix.c \
-+ dbus-server-unix.h dbus-sha.c dbus-sha.h dbus-signature.c \
-+ dbus-timeout.c dbus-timeout.h dbus-threads-internal.h \
-+ dbus-threads.c dbus-transport.c dbus-transport.h \
-+ dbus-transport-protected.h dbus-transport-socket.c \
-+ dbus-transport-socket.h dbus-transport-unix.c \
-+ dbus-transport-unix.h dbus-uuidgen.c dbus-uuidgen.h \
-+ dbus-watch.c dbus-watch.h dbus-server-launchd.h \
-+ dbus-server-launchd.c dbus-dataslot.c dbus-dataslot.h \
-+ dbus-hash.c dbus-hash.h dbus-internals.c dbus-internals.h \
-+ dbus-list.c dbus-list.h dbus-marshal-basic.c \
-+ dbus-marshal-basic.h dbus-memory.c dbus-mempool.c \
-+ dbus-mempool.h dbus-string.c dbus-string.h \
-+ dbus-string-private.h dbus-sysdeps.c dbus-sysdeps.h \
-+ dbus-sysdeps-pthread.c dbus-sysdeps-unix.c dbus-sysdeps-unix.h \
-+ dbus-userdb.c dbus-userdb.h dbus-auth-util.c \
-+ dbus-credentials-util.c dbus-mainloop.c dbus-mainloop.h \
-+ dbus-marshal-byteswap-util.c dbus-marshal-recursive-util.c \
-+ dbus-marshal-validate-util.c dbus-message-factory.c \
-+ dbus-message-factory.h dbus-message-util.c dbus-shell.c \
-+ dbus-shell.h dbus-spawn.c dbus-spawn.h dbus-string-util.c \
-+ dbus-sysdeps-util.c dbus-sysdeps-util-unix.c dbus-test.c \
-+ dbus-test.h dbus-userdb-util.c
-+am__objects_4 = dbus-auth-util.lo dbus-credentials-util.lo \
- dbus-mainloop.lo dbus-marshal-byteswap-util.lo \
- dbus-marshal-recursive-util.lo dbus-marshal-validate-util.lo \
- dbus-message-factory.lo dbus-message-util.lo dbus-shell.lo \
- dbus-spawn.lo dbus-string-util.lo dbus-sysdeps-util.lo \
- dbus-sysdeps-util-unix.lo dbus-test.lo dbus-userdb-util.lo
--am_libdbus_convenience_la_OBJECTS = $(am__objects_1) $(am__objects_2) \
-- $(am__objects_3)
-+am_libdbus_convenience_la_OBJECTS = $(am__objects_2) $(am__objects_3) \
-+ $(am__objects_4)
- libdbus_convenience_la_OBJECTS = $(am_libdbus_convenience_la_OBJECTS)
- libdbus_convenience_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-@@ -116,8 +184,9 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLF
- $(LDFLAGS) -o $@
- SOURCES = $(libdbus_1_la_SOURCES) $(libdbus_convenience_la_SOURCES) \
- $(dbus_test_SOURCES)
--DIST_SOURCES = $(libdbus_1_la_SOURCES) \
-- $(libdbus_convenience_la_SOURCES) $(dbus_test_SOURCES)
-+DIST_SOURCES = $(am__libdbus_1_la_SOURCES_DIST) \
-+ $(am__libdbus_convenience_la_SOURCES_DIST) \
-+ $(dbus_test_SOURCES)
- dbusarchincludeHEADERS_INSTALL = $(INSTALL_HEADER)
- dbusincludeHEADERS_INSTALL = $(INSTALL_HEADER)
- HEADERS = $(dbusarchinclude_HEADERS) $(dbusinclude_HEADERS)
-@@ -162,6 +231,7 @@ DBUS_MAJOR_VERSION = @DBUS_MAJOR_VERSION
- DBUS_MICRO_VERSION = @DBUS_MICRO_VERSION@
- DBUS_MINOR_VERSION = @DBUS_MINOR_VERSION@
- DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@
-+DBUS_SESSION_BUS_DEFAULT_ADDRESS = @DBUS_SESSION_BUS_DEFAULT_ADDRESS@
- DBUS_SESSION_SOCKET_DIR = @DBUS_SESSION_SOCKET_DIR@
- DBUS_SYSTEM_BUS_DEFAULT_ADDRESS = @DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@
- DBUS_SYSTEM_PID_FILE = @DBUS_SYSTEM_PID_FILE@
-@@ -177,7 +247,7 @@ DEFS = @DEFS@
- DEPDIR = @DEPDIR@
- DOXYGEN = @DOXYGEN@
- DSYMUTIL = @DSYMUTIL@
--ECHO = @ECHO@
-+DUMPBIN = @DUMPBIN@
- ECHO_C = @ECHO_C@
- ECHO_N = @ECHO_N@
- ECHO_T = @ECHO_T@
-@@ -189,8 +259,7 @@ EXPANDED_LIBDIR = @EXPANDED_LIBDIR@
- EXPANDED_LIBEXECDIR = @EXPANDED_LIBEXECDIR@
- EXPANDED_LOCALSTATEDIR = @EXPANDED_LOCALSTATEDIR@
- EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@
--F77 = @F77@
--FFLAGS = @FFLAGS@
-+FGREP = @FGREP@
- GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
- GREP = @GREP@
- INSTALL = @INSTALL@
-@@ -198,12 +267,16 @@ INSTALL_DATA = @INSTALL_DATA@
- INSTALL_PROGRAM = @INSTALL_PROGRAM@
- INSTALL_SCRIPT = @INSTALL_SCRIPT@
- INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-+LAUNCHCTL = @LAUNCHCTL@
-+LAUNCHD_AGENT_DIR = @LAUNCHD_AGENT_DIR@
-+LD = @LD@
- LDFLAGS = @LDFLAGS@
- LIBOBJS = @LIBOBJS@
- LIBS = @LIBS@
- LIBTOOL = @LIBTOOL@
- LIBXML_CFLAGS = @LIBXML_CFLAGS@
- LIBXML_LIBS = @LIBXML_LIBS@
-+LIPO = @LIPO@
- LN_S = @LN_S@
- LTLIBOBJS = @LTLIBOBJS@
- LT_AGE = @LT_AGE@
-@@ -212,8 +285,12 @@ LT_REVISION = @LT_REVISION@
- MAINT = @MAINT@
- MAKEINFO = @MAKEINFO@
- MKDIR_P = @MKDIR_P@
-+NM = @NM@
- NMEDIT = @NMEDIT@
-+OBJDUMP = @OBJDUMP@
- OBJEXT = @OBJEXT@
-+OTOOL = @OTOOL@
-+OTOOL64 = @OTOOL64@
- PACKAGE = @PACKAGE@
- PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
- PACKAGE_NAME = @PACKAGE_NAME@
-@@ -260,7 +337,7 @@ abs_top_builddir = @abs_top_builddir@
- abs_top_srcdir = @abs_top_srcdir@
- ac_ct_CC = @ac_ct_CC@
- ac_ct_CXX = @ac_ct_CXX@
--ac_ct_F77 = @ac_ct_F77@
-+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
- am__include = @am__include@
- am__leading_dot = @am__leading_dot@
- am__quote = @am__quote@
-@@ -291,6 +368,7 @@ libdir = @libdir@
- libexecdir = @libexecdir@
- localedir = @localedir@
- localstatedir = @localstatedir@
-+lt_ECHO = @lt_ECHO@
- mandir = @mandir@
- mkdir_p = @mkdir_p@
- oldincludedir = @oldincludedir@
-@@ -314,6 +392,10 @@ INCLUDES = -I$(top_builddir) -I$(top_src
-
- dbusincludedir = $(includedir)/dbus-1.0/dbus
- dbusarchincludedir = $(libdir)/dbus-1.0/include/dbus
-+ at DBUS_ENABLE_LAUNCHD_TRUE@LAUNCHD_SOURCES = \
-+ at DBUS_ENABLE_LAUNCHD_TRUE@ dbus-server-launchd.h \
-+ at DBUS_ENABLE_LAUNCHD_TRUE@ dbus-server-launchd.c
-+
- lib_LTLIBRARIES = libdbus-1.la
- dbusinclude_HEADERS = \
- dbus.h \
-@@ -396,7 +478,8 @@ DBUS_LIB_SOURCES = \
- dbus-uuidgen.c \
- dbus-uuidgen.h \
- dbus-watch.c \
-- dbus-watch.h
-+ dbus-watch.h \
-+ $(LAUNCHD_SOURCES)
-
-
- ### source code that goes in the installed client library
-@@ -486,8 +569,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
-- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-- && exit 0; \
-+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-+ && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
-@@ -603,6 +686,7 @@ distclean-compile:
- @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dbus-pending-call.Plo at am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dbus-resources.Plo at am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dbus-server-debug-pipe.Plo at am__quote@
-+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dbus-server-launchd.Plo at am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dbus-server-socket.Plo at am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dbus-server-unix.Plo at am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dbus-server.Plo at am__quote@
-@@ -695,7 +779,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
-- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
-+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
- tags: TAGS
-@@ -738,7 +822,7 @@ distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
- check-TESTS: $(TESTS)
-- @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \
-+ @failed=0; all=0; xfail=0; xpass=0; skip=0; \
- srcdir=$(srcdir); export srcdir; \
- list=' $(TESTS) '; \
- if test -n "$$list"; then \
-@@ -749,7 +833,7 @@ check-TESTS: $(TESTS)
- if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
- all=`expr $$all + 1`; \
- case " $(XFAIL_TESTS) " in \
-- *$$ws$$tst$$ws*) \
-+ *[\ \ ]$$tst[\ \ ]*) \
- xpass=`expr $$xpass + 1`; \
- failed=`expr $$failed + 1`; \
- echo "XPASS: $$tst"; \
-@@ -761,7 +845,7 @@ check-TESTS: $(TESTS)
- elif test $$? -ne 77; then \
- all=`expr $$all + 1`; \
- case " $(XFAIL_TESTS) " in \
-- *$$ws$$tst$$ws*) \
-+ *[\ \ ]$$tst[\ \ ]*) \
- xfail=`expr $$xfail + 1`; \
- echo "XFAIL: $$tst"; \
- ;; \
-@@ -775,23 +859,36 @@ check-TESTS: $(TESTS)
- echo "SKIP: $$tst"; \
- fi; \
- done; \
-+ if test "$$all" -eq 1; then \
-+ tests="test"; \
-+ All=""; \
-+ else \
-+ tests="tests"; \
-+ All="All "; \
-+ fi; \
- if test "$$failed" -eq 0; then \
- if test "$$xfail" -eq 0; then \
-- banner="All $$all tests passed"; \
-+ banner="$$All$$all $$tests passed"; \
- else \
-- banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
-+ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
-+ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
- fi; \
- else \
- if test "$$xpass" -eq 0; then \
-- banner="$$failed of $$all tests failed"; \
-+ banner="$$failed of $$all $$tests failed"; \
- else \
-- banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
-+ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
-+ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
- fi; \
- fi; \
- dashes="$$banner"; \
- skipped=""; \
- if test "$$skip" -ne 0; then \
-- skipped="($$skip tests were not run)"; \
-+ if test "$$skip" -eq 1; then \
-+ skipped="($$skip test was not run)"; \
-+ else \
-+ skipped="($$skip tests were not run)"; \
-+ fi; \
- test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
- dashes="$$skipped"; \
- fi; \
-diff -Nurp doc/Makefile.in doc/Makefile.in
---- doc/Makefile.in 2009-01-07 01:30:42.000000000 +0100
-+++ doc/Makefile.in 2009-01-10 16:39:18.000000000 +0100
-@@ -1,4 +1,4 @@
--# Makefile.in generated by automake 1.10.1 from Makefile.am.
-+# Makefile.in generated by automake 1.10.2 from Makefile.am.
- # @configure_input@
-
- # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-@@ -83,6 +83,7 @@ DBUS_MAJOR_VERSION = @DBUS_MAJOR_VERSION
- DBUS_MICRO_VERSION = @DBUS_MICRO_VERSION@
- DBUS_MINOR_VERSION = @DBUS_MINOR_VERSION@
- DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@
-+DBUS_SESSION_BUS_DEFAULT_ADDRESS = @DBUS_SESSION_BUS_DEFAULT_ADDRESS@
- DBUS_SESSION_SOCKET_DIR = @DBUS_SESSION_SOCKET_DIR@
- DBUS_SYSTEM_BUS_DEFAULT_ADDRESS = @DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@
- DBUS_SYSTEM_PID_FILE = @DBUS_SYSTEM_PID_FILE@
-@@ -98,7 +99,7 @@ DEFS = @DEFS@
- DEPDIR = @DEPDIR@
- DOXYGEN = @DOXYGEN@
- DSYMUTIL = @DSYMUTIL@
--ECHO = @ECHO@
-+DUMPBIN = @DUMPBIN@
- ECHO_C = @ECHO_C@
- ECHO_N = @ECHO_N@
- ECHO_T = @ECHO_T@
-@@ -110,8 +111,7 @@ EXPANDED_LIBDIR = @EXPANDED_LIBDIR@
- EXPANDED_LIBEXECDIR = @EXPANDED_LIBEXECDIR@
- EXPANDED_LOCALSTATEDIR = @EXPANDED_LOCALSTATEDIR@
- EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@
--F77 = @F77@
--FFLAGS = @FFLAGS@
-+FGREP = @FGREP@
- GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
- GREP = @GREP@
- INSTALL = @INSTALL@
-@@ -119,12 +119,16 @@ INSTALL_DATA = @INSTALL_DATA@
- INSTALL_PROGRAM = @INSTALL_PROGRAM@
- INSTALL_SCRIPT = @INSTALL_SCRIPT@
- INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-+LAUNCHCTL = @LAUNCHCTL@
-+LAUNCHD_AGENT_DIR = @LAUNCHD_AGENT_DIR@
-+LD = @LD@
- LDFLAGS = @LDFLAGS@
- LIBOBJS = @LIBOBJS@
- LIBS = @LIBS@
- LIBTOOL = @LIBTOOL@
- LIBXML_CFLAGS = @LIBXML_CFLAGS@
- LIBXML_LIBS = @LIBXML_LIBS@
-+LIPO = @LIPO@
- LN_S = @LN_S@
- LTLIBOBJS = @LTLIBOBJS@
- LT_AGE = @LT_AGE@
-@@ -133,8 +137,12 @@ LT_REVISION = @LT_REVISION@
- MAINT = @MAINT@
- MAKEINFO = @MAKEINFO@
- MKDIR_P = @MKDIR_P@
-+NM = @NM@
- NMEDIT = @NMEDIT@
-+OBJDUMP = @OBJDUMP@
- OBJEXT = @OBJEXT@
-+OTOOL = @OTOOL@
-+OTOOL64 = @OTOOL64@
- PACKAGE = @PACKAGE@
- PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
- PACKAGE_NAME = @PACKAGE_NAME@
-@@ -181,7 +189,7 @@ abs_top_builddir = @abs_top_builddir@
- abs_top_srcdir = @abs_top_srcdir@
- ac_ct_CC = @ac_ct_CC@
- ac_ct_CXX = @ac_ct_CXX@
--ac_ct_F77 = @ac_ct_F77@
-+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
- am__include = @am__include@
- am__leading_dot = @am__leading_dot@
- am__quote = @am__quote@
-@@ -212,6 +220,7 @@ libdir = @libdir@
- libexecdir = @libexecdir@
- localedir = @localedir@
- localstatedir = @localstatedir@
-+lt_ECHO = @lt_ECHO@
- mandir = @mandir@
- mkdir_p = @mkdir_p@
- oldincludedir = @oldincludedir@
-@@ -244,8 +253,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
-- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-- && exit 0; \
-+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-+ && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
-diff -Nurp test/Makefile.in test/Makefile.in
---- test/Makefile.in 2009-01-07 01:30:42.000000000 +0100
-+++ test/Makefile.in 2009-01-10 16:39:18.000000000 +0100
-@@ -1,4 +1,4 @@
--# Makefile.in generated by automake 1.10.1 from Makefile.am.
-+# Makefile.in generated by automake 1.10.2 from Makefile.am.
- # @configure_input@
-
- # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-@@ -179,6 +179,7 @@ DBUS_MAJOR_VERSION = @DBUS_MAJOR_VERSION
- DBUS_MICRO_VERSION = @DBUS_MICRO_VERSION@
- DBUS_MINOR_VERSION = @DBUS_MINOR_VERSION@
- DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@
-+DBUS_SESSION_BUS_DEFAULT_ADDRESS = @DBUS_SESSION_BUS_DEFAULT_ADDRESS@
- DBUS_SESSION_SOCKET_DIR = @DBUS_SESSION_SOCKET_DIR@
- DBUS_SYSTEM_BUS_DEFAULT_ADDRESS = @DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@
- DBUS_SYSTEM_PID_FILE = @DBUS_SYSTEM_PID_FILE@
-@@ -194,7 +195,7 @@ DEFS = @DEFS@
- DEPDIR = @DEPDIR@
- DOXYGEN = @DOXYGEN@
- DSYMUTIL = @DSYMUTIL@
--ECHO = @ECHO@
-+DUMPBIN = @DUMPBIN@
- ECHO_C = @ECHO_C@
- ECHO_N = @ECHO_N@
- ECHO_T = @ECHO_T@
-@@ -206,8 +207,7 @@ EXPANDED_LIBDIR = @EXPANDED_LIBDIR@
- EXPANDED_LIBEXECDIR = @EXPANDED_LIBEXECDIR@
- EXPANDED_LOCALSTATEDIR = @EXPANDED_LOCALSTATEDIR@
- EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@
--F77 = @F77@
--FFLAGS = @FFLAGS@
-+FGREP = @FGREP@
- GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
- GREP = @GREP@
- INSTALL = @INSTALL@
-@@ -215,12 +215,16 @@ INSTALL_DATA = @INSTALL_DATA@
- INSTALL_PROGRAM = @INSTALL_PROGRAM@
- INSTALL_SCRIPT = @INSTALL_SCRIPT@
- INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-+LAUNCHCTL = @LAUNCHCTL@
-+LAUNCHD_AGENT_DIR = @LAUNCHD_AGENT_DIR@
-+LD = @LD@
- LDFLAGS = @LDFLAGS@
- LIBOBJS = @LIBOBJS@
- LIBS = @LIBS@
- LIBTOOL = @LIBTOOL@
- LIBXML_CFLAGS = @LIBXML_CFLAGS@
- LIBXML_LIBS = @LIBXML_LIBS@
-+LIPO = @LIPO@
- LN_S = @LN_S@
- LTLIBOBJS = @LTLIBOBJS@
- LT_AGE = @LT_AGE@
-@@ -229,8 +233,12 @@ LT_REVISION = @LT_REVISION@
- MAINT = @MAINT@
- MAKEINFO = @MAKEINFO@
- MKDIR_P = @MKDIR_P@
-+NM = @NM@
- NMEDIT = @NMEDIT@
-+OBJDUMP = @OBJDUMP@
- OBJEXT = @OBJEXT@
-+OTOOL = @OTOOL@
-+OTOOL64 = @OTOOL64@
- PACKAGE = @PACKAGE@
- PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
- PACKAGE_NAME = @PACKAGE_NAME@
-@@ -277,7 +285,7 @@ abs_top_builddir = @abs_top_builddir@
- abs_top_srcdir = @abs_top_srcdir@
- ac_ct_CC = @ac_ct_CC@
- ac_ct_CXX = @ac_ct_CXX@
--ac_ct_F77 = @ac_ct_F77@
-+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
- am__include = @am__include@
- am__leading_dot = @am__leading_dot@
- am__quote = @am__quote@
-@@ -308,6 +316,7 @@ libdir = @libdir@
- libexecdir = @libexecdir@
- localedir = @localedir@
- localstatedir = @localstatedir@
-+lt_ECHO = @lt_ECHO@
- mandir = @mandir@
- mkdir_p = @mkdir_p@
- oldincludedir = @oldincludedir@
-@@ -405,8 +414,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
-- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-- && exit 0; \
-+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-+ && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
-@@ -595,7 +604,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
-- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
-+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
- tags: TAGS
-@@ -651,7 +660,7 @@ distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
- check-TESTS: $(TESTS)
-- @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \
-+ @failed=0; all=0; xfail=0; xpass=0; skip=0; \
- srcdir=$(srcdir); export srcdir; \
- list=' $(TESTS) '; \
- if test -n "$$list"; then \
-@@ -662,7 +671,7 @@ check-TESTS: $(TESTS)
- if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
- all=`expr $$all + 1`; \
- case " $(XFAIL_TESTS) " in \
-- *$$ws$$tst$$ws*) \
-+ *[\ \ ]$$tst[\ \ ]*) \
- xpass=`expr $$xpass + 1`; \
- failed=`expr $$failed + 1`; \
- echo "XPASS: $$tst"; \
-@@ -674,7 +683,7 @@ check-TESTS: $(TESTS)
- elif test $$? -ne 77; then \
- all=`expr $$all + 1`; \
- case " $(XFAIL_TESTS) " in \
-- *$$ws$$tst$$ws*) \
-+ *[\ \ ]$$tst[\ \ ]*) \
- xfail=`expr $$xfail + 1`; \
- echo "XFAIL: $$tst"; \
- ;; \
-@@ -688,23 +697,36 @@ check-TESTS: $(TESTS)
- echo "SKIP: $$tst"; \
- fi; \
- done; \
-+ if test "$$all" -eq 1; then \
-+ tests="test"; \
-+ All=""; \
-+ else \
-+ tests="tests"; \
-+ All="All "; \
-+ fi; \
- if test "$$failed" -eq 0; then \
- if test "$$xfail" -eq 0; then \
-- banner="All $$all tests passed"; \
-+ banner="$$All$$all $$tests passed"; \
- else \
-- banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
-+ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
-+ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
- fi; \
- else \
- if test "$$xpass" -eq 0; then \
-- banner="$$failed of $$all tests failed"; \
-+ banner="$$failed of $$all $$tests failed"; \
- else \
-- banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
-+ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
-+ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
- fi; \
- fi; \
- dashes="$$banner"; \
- skipped=""; \
- if test "$$skip" -ne 0; then \
-- skipped="($$skip tests were not run)"; \
-+ if test "$$skip" -eq 1; then \
-+ skipped="($$skip test was not run)"; \
-+ else \
-+ skipped="($$skip tests were not run)"; \
-+ fi; \
- test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
- dashes="$$skipped"; \
- fi; \
-diff -Nurp test/name-test/Makefile.in test/name-test/Makefile.in
---- test/name-test/Makefile.in 2009-01-07 01:30:43.000000000 +0100
-+++ test/name-test/Makefile.in 2009-01-10 16:39:18.000000000 +0100
-@@ -1,4 +1,4 @@
--# Makefile.in generated by automake 1.10.1 from Makefile.am.
-+# Makefile.in generated by automake 1.10.2 from Makefile.am.
- # @configure_input@
-
- # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-@@ -182,6 +182,7 @@ DBUS_MAJOR_VERSION = @DBUS_MAJOR_VERSION
- DBUS_MICRO_VERSION = @DBUS_MICRO_VERSION@
- DBUS_MINOR_VERSION = @DBUS_MINOR_VERSION@
- DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@
-+DBUS_SESSION_BUS_DEFAULT_ADDRESS = @DBUS_SESSION_BUS_DEFAULT_ADDRESS@
- DBUS_SESSION_SOCKET_DIR = @DBUS_SESSION_SOCKET_DIR@
- DBUS_SYSTEM_BUS_DEFAULT_ADDRESS = @DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@
- DBUS_SYSTEM_PID_FILE = @DBUS_SYSTEM_PID_FILE@
-@@ -197,7 +198,7 @@ DEFS = @DEFS@
- DEPDIR = @DEPDIR@
- DOXYGEN = @DOXYGEN@
- DSYMUTIL = @DSYMUTIL@
--ECHO = @ECHO@
-+DUMPBIN = @DUMPBIN@
- ECHO_C = @ECHO_C@
- ECHO_N = @ECHO_N@
- ECHO_T = @ECHO_T@
-@@ -209,8 +210,7 @@ EXPANDED_LIBDIR = @EXPANDED_LIBDIR@
- EXPANDED_LIBEXECDIR = @EXPANDED_LIBEXECDIR@
- EXPANDED_LOCALSTATEDIR = @EXPANDED_LOCALSTATEDIR@
- EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@
--F77 = @F77@
--FFLAGS = @FFLAGS@
-+FGREP = @FGREP@
- GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
- GREP = @GREP@
- INSTALL = @INSTALL@
-@@ -218,12 +218,16 @@ INSTALL_DATA = @INSTALL_DATA@
- INSTALL_PROGRAM = @INSTALL_PROGRAM@
- INSTALL_SCRIPT = @INSTALL_SCRIPT@
- INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-+LAUNCHCTL = @LAUNCHCTL@
-+LAUNCHD_AGENT_DIR = @LAUNCHD_AGENT_DIR@
-+LD = @LD@
- LDFLAGS = @LDFLAGS@
- LIBOBJS = @LIBOBJS@
- LIBS = @LIBS@
- LIBTOOL = @LIBTOOL@
- LIBXML_CFLAGS = @LIBXML_CFLAGS@
- LIBXML_LIBS = @LIBXML_LIBS@
-+LIPO = @LIPO@
- LN_S = @LN_S@
- LTLIBOBJS = @LTLIBOBJS@
- LT_AGE = @LT_AGE@
-@@ -232,8 +236,12 @@ LT_REVISION = @LT_REVISION@
- MAINT = @MAINT@
- MAKEINFO = @MAKEINFO@
- MKDIR_P = @MKDIR_P@
-+NM = @NM@
- NMEDIT = @NMEDIT@
-+OBJDUMP = @OBJDUMP@
- OBJEXT = @OBJEXT@
-+OTOOL = @OTOOL@
-+OTOOL64 = @OTOOL64@
- PACKAGE = @PACKAGE@
- PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
- PACKAGE_NAME = @PACKAGE_NAME@
-@@ -280,7 +288,7 @@ abs_top_builddir = @abs_top_builddir@
- abs_top_srcdir = @abs_top_srcdir@
- ac_ct_CC = @ac_ct_CC@
- ac_ct_CXX = @ac_ct_CXX@
--ac_ct_F77 = @ac_ct_F77@
-+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
- am__include = @am__include@
- am__leading_dot = @am__leading_dot@
- am__quote = @am__quote@
-@@ -311,6 +319,7 @@ libdir = @libdir@
- libexecdir = @libexecdir@
- localedir = @localedir@
- localstatedir = @localstatedir@
-+lt_ECHO = @lt_ECHO@
- mandir = @mandir@
- mkdir_p = @mkdir_p@
- oldincludedir = @oldincludedir@
-@@ -375,8 +384,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
-- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-- && exit 0; \
-+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-+ && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
-@@ -517,7 +526,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
-- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
-+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
- tags: TAGS
-@@ -560,7 +569,7 @@ distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
- check-TESTS: $(TESTS)
-- @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \
-+ @failed=0; all=0; xfail=0; xpass=0; skip=0; \
- srcdir=$(srcdir); export srcdir; \
- list=' $(TESTS) '; \
- if test -n "$$list"; then \
-@@ -571,7 +580,7 @@ check-TESTS: $(TESTS)
- if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
- all=`expr $$all + 1`; \
- case " $(XFAIL_TESTS) " in \
-- *$$ws$$tst$$ws*) \
-+ *[\ \ ]$$tst[\ \ ]*) \
- xpass=`expr $$xpass + 1`; \
- failed=`expr $$failed + 1`; \
- echo "XPASS: $$tst"; \
-@@ -583,7 +592,7 @@ check-TESTS: $(TESTS)
- elif test $$? -ne 77; then \
- all=`expr $$all + 1`; \
- case " $(XFAIL_TESTS) " in \
-- *$$ws$$tst$$ws*) \
-+ *[\ \ ]$$tst[\ \ ]*) \
- xfail=`expr $$xfail + 1`; \
- echo "XFAIL: $$tst"; \
- ;; \
-@@ -597,23 +606,36 @@ check-TESTS: $(TESTS)
- echo "SKIP: $$tst"; \
- fi; \
- done; \
-+ if test "$$all" -eq 1; then \
-+ tests="test"; \
-+ All=""; \
-+ else \
-+ tests="tests"; \
-+ All="All "; \
-+ fi; \
- if test "$$failed" -eq 0; then \
- if test "$$xfail" -eq 0; then \
-- banner="All $$all tests passed"; \
-+ banner="$$All$$all $$tests passed"; \
- else \
-- banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
-+ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
-+ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
- fi; \
- else \
- if test "$$xpass" -eq 0; then \
-- banner="$$failed of $$all tests failed"; \
-+ banner="$$failed of $$all $$tests failed"; \
- else \
-- banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
-+ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
-+ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
- fi; \
- fi; \
- dashes="$$banner"; \
- skipped=""; \
- if test "$$skip" -ne 0; then \
-- skipped="($$skip tests were not run)"; \
-+ if test "$$skip" -eq 1; then \
-+ skipped="($$skip test was not run)"; \
-+ else \
-+ skipped="($$skip tests were not run)"; \
-+ fi; \
- test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
- dashes="$$skipped"; \
- fi; \
-diff -Nurp tools/Makefile.in tools/Makefile.in
---- tools/Makefile.in 2009-01-07 01:30:43.000000000 +0100
-+++ tools/Makefile.in 2009-01-10 16:39:19.000000000 +0100
-@@ -1,4 +1,4 @@
--# Makefile.in generated by automake 1.10.1 from Makefile.am.
-+# Makefile.in generated by automake 1.10.2 from Makefile.am.
- # @configure_input@
-
- # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-@@ -154,6 +154,7 @@ DBUS_MAJOR_VERSION = @DBUS_MAJOR_VERSION
- DBUS_MICRO_VERSION = @DBUS_MICRO_VERSION@
- DBUS_MINOR_VERSION = @DBUS_MINOR_VERSION@
- DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@
-+DBUS_SESSION_BUS_DEFAULT_ADDRESS = @DBUS_SESSION_BUS_DEFAULT_ADDRESS@
- DBUS_SESSION_SOCKET_DIR = @DBUS_SESSION_SOCKET_DIR@
- DBUS_SYSTEM_BUS_DEFAULT_ADDRESS = @DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@
- DBUS_SYSTEM_PID_FILE = @DBUS_SYSTEM_PID_FILE@
-@@ -169,7 +170,7 @@ DEFS = @DEFS@
- DEPDIR = @DEPDIR@
- DOXYGEN = @DOXYGEN@
- DSYMUTIL = @DSYMUTIL@
--ECHO = @ECHO@
-+DUMPBIN = @DUMPBIN@
- ECHO_C = @ECHO_C@
- ECHO_N = @ECHO_N@
- ECHO_T = @ECHO_T@
-@@ -181,8 +182,7 @@ EXPANDED_LIBDIR = @EXPANDED_LIBDIR@
- EXPANDED_LIBEXECDIR = @EXPANDED_LIBEXECDIR@
- EXPANDED_LOCALSTATEDIR = @EXPANDED_LOCALSTATEDIR@
- EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@
--F77 = @F77@
--FFLAGS = @FFLAGS@
-+FGREP = @FGREP@
- GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
- GREP = @GREP@
- INSTALL = @INSTALL@
-@@ -190,12 +190,16 @@ INSTALL_DATA = @INSTALL_DATA@
- INSTALL_PROGRAM = @INSTALL_PROGRAM@
- INSTALL_SCRIPT = @INSTALL_SCRIPT@
- INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-+LAUNCHCTL = @LAUNCHCTL@
-+LAUNCHD_AGENT_DIR = @LAUNCHD_AGENT_DIR@
-+LD = @LD@
- LDFLAGS = @LDFLAGS@
- LIBOBJS = @LIBOBJS@
- LIBS = @LIBS@
- LIBTOOL = @LIBTOOL@
- LIBXML_CFLAGS = @LIBXML_CFLAGS@
- LIBXML_LIBS = @LIBXML_LIBS@
-+LIPO = @LIPO@
- LN_S = @LN_S@
- LTLIBOBJS = @LTLIBOBJS@
- LT_AGE = @LT_AGE@
-@@ -204,8 +208,12 @@ LT_REVISION = @LT_REVISION@
- MAINT = @MAINT@
- MAKEINFO = @MAKEINFO@
- MKDIR_P = @MKDIR_P@
-+NM = @NM@
- NMEDIT = @NMEDIT@
-+OBJDUMP = @OBJDUMP@
- OBJEXT = @OBJEXT@
-+OTOOL = @OTOOL@
-+OTOOL64 = @OTOOL64@
- PACKAGE = @PACKAGE@
- PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
- PACKAGE_NAME = @PACKAGE_NAME@
-@@ -252,7 +260,7 @@ abs_top_builddir = @abs_top_builddir@
- abs_top_srcdir = @abs_top_srcdir@
- ac_ct_CC = @ac_ct_CC@
- ac_ct_CXX = @ac_ct_CXX@
--ac_ct_F77 = @ac_ct_F77@
-+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
- am__include = @am__include@
- am__leading_dot = @am__leading_dot@
- am__quote = @am__quote@
-@@ -283,6 +291,7 @@ libdir = @libdir@
- libexecdir = @libexecdir@
- localedir = @localedir@
- localstatedir = @localstatedir@
-+lt_ECHO = @lt_ECHO@
- mandir = @mandir@
- mkdir_p = @mkdir_p@
- oldincludedir = @oldincludedir@
-@@ -346,8 +355,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
-- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-- && exit 0; \
-+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-+ && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
-@@ -466,8 +475,8 @@ install-man1: $(man1_MANS) $(man_MANS)
- esac; \
- done; \
- for i in $$list; do \
-- if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
-- else file=$$i; fi; \
-+ if test -f $$i; then file=$$i; \
-+ else file=$(srcdir)/$$i; fi; \
- ext=`echo $$i | sed -e 's/^.*\\.//'`; \
- case "$$ext" in \
- 1*) ;; \
-@@ -523,7 +532,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
-- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
-+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
- tags: TAGS
---- configure 2009-01-10 17:14:56.000000000 +0100
-+++ configure 2009-01-10 17:14:11.000000000 +0100
-@@ -844,6 +844,11 @@
- HAVE_LIBAUDIT_TRUE
- HAVE_CONSOLE_OWNER_FILE_FALSE
- HAVE_CONSOLE_OWNER_FILE_TRUE
-+LAUNCHD_AGENT_DIR
-+DBUS_SESSION_BUS_DEFAULT_ADDRESS
-+DBUS_ENABLE_LAUNCHD_FALSE
-+DBUS_ENABLE_LAUNCHD_TRUE
-+LAUNCHCTL
- DBUS_BUS_ENABLE_KQUEUE_FALSE
- DBUS_BUS_ENABLE_KQUEUE_TRUE
- DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX_FALSE
-@@ -1026,6 +1031,7 @@
- enable_kqueue
- enable_console_owner_file
- enable_userdb_cache
-+enable_launchd
- with_xml
- with_init_scripts
- with_session_socket_dir
-@@ -1034,6 +1040,7 @@
- with_system_socket
- with_console_auth_dir
- with_console_owner_file
-+with_launchd_agent_dir
- with_dbus_user
- with_dbus_daemondir
- with_x
-@@ -1714,6 +1721,7 @@
- --enable-console-owner-file
- enable console owner file
- --enable-userdb-cache build with userdb-cache support
-+ --enable-launchd build with launchd auto-launch support
-
- Optional Packages:
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
-@@ -1737,6 +1745,9 @@
- directory to check for console ownerhip
- --with-console-owner-file=filename
- file whose owner determines current console owner
-+ --with-launchd-agent-dir=dirname
-+ directory to put the launchd agent (default:
-+ /Library/LaunchAgents)
- --with-dbus-user=<user> User for running the DBUS daemon (messagebus)
- --with-dbus-daemondir=dirname
- Directory for installing the DBUS daemon
-@@ -15866,6 +15877,13 @@
- enable_userdb_cache=yes
- fi
-
-+# Check whether --enable-launchd was given.
-+if test "${enable_launchd+set}" = set; then
-+ enableval=$enable_launchd; enable_launchd=$enableval
-+else
-+ enable_launchd=auto
-+fi
-+
-
-
- # Check whether --with-xml was given.
-@@ -15916,6 +15934,12 @@
- fi
-
-
-+# Check whether --with-launchd-agent-dir was given.
-+if test "${with_launchd_agent_dir+set}" = set; then
-+ withval=$with_launchd_agent_dir;
-+fi
-+
-+
- # Check whether --with-dbus_user was given.
- if test "${with_dbus_user+set}" = set; then
- withval=$with_dbus_user;
-@@ -23179,6 +23203,230 @@
- fi
-
-
-+# launchd checks
-+if test x$enable_launchd = xno ; then
-+ have_launchd=no
-+else
-+ have_launchd=yes
-+ if test "${ac_cv_header_launch_h+set}" = set; then
-+ { $as_echo "$as_me:$LINENO: checking for launch.h" >&5
-+$as_echo_n "checking for launch.h... " >&6; }
-+if test "${ac_cv_header_launch_h+set}" = set; then
-+ $as_echo_n "(cached) " >&6
-+fi
-+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_launch_h" >&5
-+$as_echo "$ac_cv_header_launch_h" >&6; }
-+else
-+ # Is the header compilable?
-+{ $as_echo "$as_me:$LINENO: checking launch.h usability" >&5
-+$as_echo_n "checking launch.h usability... " >&6; }
-+cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h. */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h. */
-+$ac_includes_default
-+#include <launch.h>
-+_ACEOF
-+rm -f conftest.$ac_objext
-+if { (ac_try="$ac_compile"
-+case "(($ac_try" in
-+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-+ *) ac_try_echo=$ac_try;;
-+esac
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-+ (eval "$ac_compile") 2>conftest.er1
-+ ac_status=$?
-+ grep -v '^ *+' conftest.er1 >conftest.err
-+ rm -f conftest.er1
-+ cat conftest.err >&5
-+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); } && {
-+ test -z "$ac_c_werror_flag" ||
-+ test ! -s conftest.err
-+ } && test -s conftest.$ac_objext; then
-+ ac_header_compiler=yes
-+else
-+ $as_echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+ ac_header_compiler=no
-+fi
-+
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-+$as_echo "$ac_header_compiler" >&6; }
-+
-+# Is the header present?
-+{ $as_echo "$as_me:$LINENO: checking launch.h presence" >&5
-+$as_echo_n "checking launch.h presence... " >&6; }
-+cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h. */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h. */
-+#include <launch.h>
-+_ACEOF
-+if { (ac_try="$ac_cpp conftest.$ac_ext"
-+case "(($ac_try" in
-+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-+ *) ac_try_echo=$ac_try;;
-+esac
-+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-+$as_echo "$ac_try_echo") >&5
-+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-+ ac_status=$?
-+ grep -v '^ *+' conftest.er1 >conftest.err
-+ rm -f conftest.er1
-+ cat conftest.err >&5
-+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); } >/dev/null && {
-+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-+ test ! -s conftest.err
-+ }; then
-+ ac_header_preproc=yes
-+else
-+ $as_echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+ ac_header_preproc=no
-+fi
-+
-+rm -f conftest.err conftest.$ac_ext
-+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-+$as_echo "$ac_header_preproc" >&6; }
-+
-+# So? What about this header?
-+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-+ yes:no: )
-+ { $as_echo "$as_me:$LINENO: WARNING: launch.h: accepted by the compiler, rejected by the preprocessor!" >&5
-+$as_echo "$as_me: WARNING: launch.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-+ { $as_echo "$as_me:$LINENO: WARNING: launch.h: proceeding with the compiler's result" >&5
-+$as_echo "$as_me: WARNING: launch.h: proceeding with the compiler's result" >&2;}
-+ ac_header_preproc=yes
-+ ;;
-+ no:yes:* )
-+ { $as_echo "$as_me:$LINENO: WARNING: launch.h: present but cannot be compiled" >&5
-+$as_echo "$as_me: WARNING: launch.h: present but cannot be compiled" >&2;}
-+ { $as_echo "$as_me:$LINENO: WARNING: launch.h: check for missing prerequisite headers?" >&5
-+$as_echo "$as_me: WARNING: launch.h: check for missing prerequisite headers?" >&2;}
-+ { $as_echo "$as_me:$LINENO: WARNING: launch.h: see the Autoconf documentation" >&5
-+$as_echo "$as_me: WARNING: launch.h: see the Autoconf documentation" >&2;}
-+ { $as_echo "$as_me:$LINENO: WARNING: launch.h: section \"Present But Cannot Be Compiled\"" >&5
-+$as_echo "$as_me: WARNING: launch.h: section \"Present But Cannot Be Compiled\"" >&2;}
-+ { $as_echo "$as_me:$LINENO: WARNING: launch.h: proceeding with the preprocessor's result" >&5
-+$as_echo "$as_me: WARNING: launch.h: proceeding with the preprocessor's result" >&2;}
-+ { $as_echo "$as_me:$LINENO: WARNING: launch.h: in the future, the compiler will take precedence" >&5
-+$as_echo "$as_me: WARNING: launch.h: in the future, the compiler will take precedence" >&2;}
-+
-+ ;;
-+esac
-+{ $as_echo "$as_me:$LINENO: checking for launch.h" >&5
-+$as_echo_n "checking for launch.h... " >&6; }
-+if test "${ac_cv_header_launch_h+set}" = set; then
-+ $as_echo_n "(cached) " >&6
-+else
-+ ac_cv_header_launch_h=$ac_header_preproc
-+fi
-+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_launch_h" >&5
-+$as_echo "$ac_cv_header_launch_h" >&6; }
-+
-+fi
-+if test "x$ac_cv_header_launch_h" = x""yes; then
-+ :
-+else
-+ have_launchd=no
-+fi
-+
-+
-+ # Extract the first word of "launchctl", so it can be a program name with args.
-+set dummy launchctl; ac_word=$2
-+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if test "${ac_cv_path_LAUNCHCTL+set}" = set; then
-+ $as_echo_n "(cached) " >&6
-+else
-+ case $LAUNCHCTL in
-+ [\\/]* | ?:[\\/]*)
-+ ac_cv_path_LAUNCHCTL="$LAUNCHCTL" # Let the user override the test with a path.
-+ ;;
-+ *)
-+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+ IFS=$as_save_IFS
-+ test -z "$as_dir" && as_dir=.
-+ for ac_exec_ext in '' $ac_executable_extensions; do
-+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-+ ac_cv_path_LAUNCHCTL="$as_dir/$ac_word$ac_exec_ext"
-+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+ break 2
-+ fi
-+done
-+done
-+IFS=$as_save_IFS
-+
-+ ;;
-+esac
-+fi
-+LAUNCHCTL=$ac_cv_path_LAUNCHCTL
-+if test -n "$LAUNCHCTL"; then
-+ { $as_echo "$as_me:$LINENO: result: $LAUNCHCTL" >&5
-+$as_echo "$LAUNCHCTL" >&6; }
-+else
-+ { $as_echo "$as_me:$LINENO: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+
-+ if test "x$LAUNCHCTL" = "x"; then
-+ have_launchd=no
-+ fi
-+
-+ if test x$enable_launchd = xyes -a x$have_launchd = xno ; then
-+ { { $as_echo "$as_me:$LINENO: error: launchd support explicitly enabled but not available" >&5
-+$as_echo "$as_me: error: launchd support explicitly enabled but not available" >&2;}
-+ { (exit 1); exit 1; }; }
-+ fi
-+fi
-+
-+if test x$have_launchd = xyes; then
-+
-+cat >>confdefs.h <<\_ACEOF
-+#define DBUS_ENABLE_LAUNCHD 1
-+_ACEOF
-+
-+fi
-+
-+ if test x$have_launchd = xyes; then
-+ DBUS_ENABLE_LAUNCHD_TRUE=
-+ DBUS_ENABLE_LAUNCHD_FALSE='#'
-+else
-+ DBUS_ENABLE_LAUNCHD_TRUE='#'
-+ DBUS_ENABLE_LAUNCHD_FALSE=
-+fi
-+
-+
-+if test x$have_launchd = xyes; then
-+ DBUS_SESSION_BUS_DEFAULT_ADDRESS="launchd:env=DBUS_LAUNCHD_SESSION_BUS_SOCKET"
-+else
-+ DBUS_SESSION_BUS_DEFAULT_ADDRESS="unix:tmpdir=$DBUS_SESSION_SOCKET_DIR"
-+fi
-+
-+
-+
-+#### Directory to place launchd agent file
-+if test "x$with_launchd_agent_dir" = "x"; then
-+ LAUNCHD_AGENT_DIR="/Library/LaunchAgents"
-+else
-+ LAUNCHD_AGENT_DIR="$with_launchd_agent_dir"
-+fi
-+
-+
-+
- if test x$enable_console_owner_file = xno ; then
- have_console_owner_file=no;
- else
-@@ -25761,7 +26009,7 @@
-
-
-
--ac_config_files="$ac_config_files Doxyfile dbus/dbus-arch-deps.h bus/system.conf bus/session.conf bus/messagebus bus/rc.messagebus bus/dbus-daemon.1 Makefile dbus/Makefile bus/Makefile tools/Makefile test/Makefile test/name-test/Makefile doc/Makefile dbus-1.pc test/data/valid-config-files/debug-allow-all.conf test/data/valid-config-files/debug-allow-all-sha1.conf test/data/valid-config-files-system/debug-allow-all-pass.conf test/data/valid-config-files-system/debug-allow-all-fail.conf test/data/valid-service-files/org.freedesktop.DBus.TestSuite.PrivServer.service test/data/valid-service-files/org.freedesktop.DBus.TestSuiteEchoService.service test/data/valid-service-files/org.freedesktop.DBus.TestSuiteSegfaultService.service test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteEchoSe
rvice.service test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteSegfaultService.service test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoExec.service test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoUser.service test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoService.service"
-+ac_config_files="$ac_config_files Doxyfile dbus/dbus-arch-deps.h bus/system.conf bus/session.conf bus/messagebus bus/org.freedesktop.dbus-session.plist bus/rc.messagebus bus/dbus-daemon.1 Makefile dbus/Makefile bus/Makefile tools/Makefile test/Makefile test/name-test/Makefile doc/Makefile dbus-1.pc test/data/valid-config-files/debug-allow-all.conf test/data/valid-config-files/debug-allow-all-sha1.conf test/data/valid-config-files-system/debug-allow-all-pass.conf test/data/valid-config-files-system/debug-allow-all-fail.conf test/data/valid-service-files/org.freedesktop.DBus.TestSuite.PrivServer.service test/data/valid-service-files/org.freedesktop.DBus.TestSuiteEchoService.service test/data/valid-service-files/org.freedesktop.DBus.TestSuiteSegfaultService.service test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service test/data/valid-service-files-syst
em/org.freedesktop.DBus.TestSuiteEchoService.service test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteSegfaultService.service test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoExec.service test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoUser.service test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoService.service"
-
- cat >confcache <<\_ACEOF
- # This file is a shell script that caches the results of configure
-@@ -25952,6 +26200,13 @@
- Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
- fi
-+if test -z "${DBUS_ENABLE_LAUNCHD_TRUE}" && test -z "${DBUS_ENABLE_LAUNCHD_FALSE}"; then
-+ { { $as_echo "$as_me:$LINENO: error: conditional \"DBUS_ENABLE_LAUNCHD\" was never defined.
-+Usually this means the macro was only invoked conditionally." >&5
-+$as_echo "$as_me: error: conditional \"DBUS_ENABLE_LAUNCHD\" was never defined.
-+Usually this means the macro was only invoked conditionally." >&2;}
-+ { (exit 1); exit 1; }; }
-+fi
- if test -z "${HAVE_CONSOLE_OWNER_FILE_TRUE}" && test -z "${HAVE_CONSOLE_OWNER_FILE_FALSE}"; then
- { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_CONSOLE_OWNER_FILE\" was never defined.
- Usually this means the macro was only invoked conditionally." >&5
-@@ -26861,6 +27116,7 @@
- "bus/system.conf") CONFIG_FILES="$CONFIG_FILES bus/system.conf" ;;
- "bus/session.conf") CONFIG_FILES="$CONFIG_FILES bus/session.conf" ;;
- "bus/messagebus") CONFIG_FILES="$CONFIG_FILES bus/messagebus" ;;
-+ "bus/org.freedesktop.dbus-session.plist") CONFIG_FILES="$CONFIG_FILES bus/org.freedesktop.dbus-session.plist" ;;
- "bus/rc.messagebus") CONFIG_FILES="$CONFIG_FILES bus/rc.messagebus" ;;
- "bus/dbus-daemon.1") CONFIG_FILES="$CONFIG_FILES bus/dbus-daemon.1" ;;
- "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
-@@ -28556,6 +28812,7 @@
- Building Doxygen docs: ${enable_doxygen_docs}
- Building XML docs: ${enable_xml_docs}
- Building cache support: ${enable_userdb_cache}
-+ Building launchd support: ${have_launchd}
- Gettext libs (empty OK): ${INTLLIBS}
- Using XML parser: ${with_xml}
- Init scripts style: ${with_init_scripts}
-@@ -28570,6 +28827,7 @@
- System bus user: ${DBUS_USER}
- Session bus services dir: ${EXPANDED_DATADIR}/dbus-1/services
- 'make check' socket dir: ${TEST_SOCKET_DIR}
-+ launchd agent dir: ${LAUNCHD_AGENT_DIR}
- "
-
- if test x$enable_tests = xyes; then
---- config.h.in 2009-01-07 01:31:10.000000000 +0100
-+++ config.h.in 2009-01-10 17:47:14.000000000 +0100
-@@ -45,6 +45,9 @@
- /* Disable public API sanity checking */
- #undef DBUS_DISABLE_CHECKS
-
-+/* Use launchd autolaunch */
-+#undef DBUS_ENABLE_LAUNCHD
-+
- /* Build with caching of user data */
- #undef DBUS_ENABLE_USERDB_CACHE
-
-@@ -251,6 +254,10 @@
- /* Define to 1 if you have the `writev' function. */
- #undef HAVE_WRITEV
-
-+/* Define to the sub-directory in which libtool stores uninstalled libraries.
-+ */
-+#undef LT_OBJDIR
-+
- /* Define to 1 if your C compiler doesn't accept -c and -o together. */
- #undef NO_MINUS_C_MINUS_O
-
-diff --git a/README.launchd b/README.launchd
---- /dev/null
-+++ README.launchd
-@@ -0,0 +1,61 @@
-+Launchd[1,2] replaces init, inetd and cron on Mac OS X since 10.4 "Tiger".
-+dbus uses this service to provide a common session bus address for each user
-+and so deprecates the X11 enabled dbus-launcher.
-+
-+[1] http://developer.apple.com/MacOsX/launchd.html
-+[2] http://launchd.macosforge.org/
-+
-+
-+Setup
-+===
-+
-+Configure with --enable-launchd and --without-x (X11 should not harm but it's
-+simply not necessary any more)
-+After installation, to prevent a reboot, load the dbus session starter into
-+launchd by executing:
-+$ launchctl load /Library/LaunchAgents/org.freedesktop.dbus-session.plist
-+
-+You can change the launch agent dir via configure, but it's not recommended.
-+Make sure to execute the above line as the actual user for which you want to
-+use a session bus since launchd manages its agents on a per user basis.
-+
-+
-+How it works
-+===
-+
-+Launchd allocates a socket and provides the unix path to it via the variable
-+DBUS_LAUNCHD_SESSION_BUS_SOCKET in launchd's environment. Every process
-+spawned by launchd (or dbus-daemon, if stared by launchd) can access it through
-+its own environment. Other processes can query launchd for it by executing:
-+$ launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET
-+However, this is normally done by the dbus client lib for you.
-+
-+If launchd start dbus-daemon with a config file containing a "launchd:env=FOO"
-+address, as the default session config does with env=DBUS_LAUNCHD_SESSION_BUS_SOCKET,
-+the daemon will get the file descriptor from launchd and start listening on it.
-+The environment variable is used to get the actual socket path which is passed
-+to every service spawned by dbus-daemon as a result from autolaunch messages.
-+Please note that it's not possible to start dbus-daemon manually when using a
-+"launchd:" address. Only child processes of launchd can access the above
-+mentioned file descriptor!
-+
-+To create custom buses just set up an other launch agent. As a quick start copy
-+/Library/LaunchAgents/org.freedesktop.dbus-session.plist, change the label
-+to i.e. "org.freedesktop.dbus-foo" and change the SecureSocketWithKey value,
-+i.e. to "DBUS_LAUNCHD_FOO_BUS_SOCKET". This environment variable has to be set
-+in the config file for your new bus in the <listen> element (see session.config).
-+Then edit your /Library/LaunchAgents/org.freedesktop.dbus-foo.plist to start
-+dbus-daemon with "--config-file=/opt/local/etc/dbus-1/foo.conf" instead of
-+"--session". Now load the new plist onto launchd as described in the setup
-+section of this document.
-+Executing "launchctl export" should now give you two sockets, one in
-+DBUS_LAUNCHD_SESSION_BUS_SOCKET and the new DBUS_LAUNCHD_FOO_BUS_SOCKET.
-+To connect to this new bus use "launchd:env=DBUS_LAUNCHD_FOO_BUS_SOCKET".
-+
-+Since Mac OS X 10.5 "Leopard" you can also configure launchd to start
-+dbus-daemon on demand as soon as some process connects to the socket. Since
-+it's broken on 10.4 this feature is disabled per default. Look at
-+/Library/LaunchAgents/org.freedesktop.dbus-session.plist to change it.
-+
-+On the client side, the envvar DBUS_SESSION_BUS_ADDRESS can be normally used
-+but if it's not set, launchd is queried for the session bus socket.
-diff --git a/bus/Makefile.am b/bus/Makefile.am
---- bus/Makefile.am
-+++ bus/Makefile.am
-@@ -9,12 +9,18 @@ EFENCE=
-
- CONFIG_IN_FILES= \
- session.conf.in \
-- system.conf.in
-+ system.conf.in \
-+ org.freedesktop.dbus-session.plist.in
-
- config_DATA= \
- session.conf \
- system.conf
-
-+if DBUS_ENABLE_LAUNCHD
-+agentdir=$(LAUNCHD_AGENT_DIR)
-+agent_DATA=org.freedesktop.dbus-session.plist
-+endif
-+
- if DBUS_USE_LIBXML
- XML_SOURCES=config-loader-libxml.c
- endif
-diff --git a/bus/org.freedesktop.dbus-session.plist.in b/bus/org.freedesktop.dbus-session.plist.in
---- /dev/null
-+++ bus/org.freedesktop.dbus-session.plist.in
-@@ -0,0 +1,31 @@
-+<?xml version="1.0" encoding="UTF-8"?>
-+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-+<plist version="1.0">
-+<dict>
-+ <key>Label</key>
-+ <string>org.freedesktop.dbus-session</string>
-+
-+ <key>ServiceIPC</key>
-+ <true/>
-+
-+ <!-- bug in 10.4's launchd - on-demand loading does not work -->
-+ <key>OnDemand</key>
-+ <false />
-+
-+ <key>ProgramArguments</key>
-+ <array>
-+ <string>@DBUS_DAEMONDIR@/dbus-daemon</string>
-+ <string>--nofork</string>
-+ <string>--session</string>
-+ </array>
-+
-+ <key>Sockets</key>
-+ <dict>
-+ <key>unix_domain_listener</key>
-+ <dict>
-+ <key>SecureSocketWithKey</key>
-+ <string>DBUS_LAUNCHD_SESSION_BUS_SOCKET</string>
-+ </dict>
-+ </dict>
-+</dict>
-+</plist>
-diff --git a/bus/session.conf.in b/bus/session.conf.in
---- bus/session.conf.in
-+++ bus/session.conf.in
-@@ -12,7 +12,7 @@
- the behavior of child processes. -->
- <keep_umask/>
-
-- <listen>unix:tmpdir=@DBUS_SESSION_SOCKET_DIR@</listen>
-+ <listen>@DBUS_SESSION_BUS_DEFAULT_ADDRESS@</listen>
-
- <standard_session_servicedirs />
-
-diff --git a/dbus/Makefile.am b/dbus/Makefile.am
---- dbus/Makefile.am
-+++ dbus/Makefile.am
-@@ -70,6 +70,8 @@ DBUS_LIB_SOURCES= \
- dbus-server.c \
- dbus-server-debug-pipe.c \
- dbus-server-debug-pipe.h \
-+ dbus-server-launchd.c \
-+ dbus-server-launchd.h \
- dbus-server-protected.h \
- dbus-server-socket.c \
- dbus-server-socket.h \
-diff --git a/dbus/dbus-bus.c b/dbus/dbus-bus.c
---- dbus/dbus-bus.c
-+++ dbus/dbus-bus.c
-@@ -22,6 +22,7 @@
- *
- */
-
-+#include <config.h>
- #include "dbus-bus.h"
- #include "dbus-protocol.h"
- #include "dbus-internals.h"
-@@ -29,7 +30,7 @@
- #include "dbus-marshal-validate.h"
- #include "dbus-threads-internal.h"
- #include "dbus-connection-internal.h"
--#include <string.h>
-+#include "dbus-string.h"
-
- /**
- * @defgroup DBusBus Message bus APIs
-@@ -147,6 +148,63 @@ get_from_env (char **connection_p,
- }
-
- static dbus_bool_t
-+init_session_address (void)
-+{
-+ dbus_bool_t retval;
-+
-+ retval = FALSE;
-+
-+ /* First, look in the environment. This is the normal case on
-+ * freedesktop.org/Unix systems. */
-+ get_from_env (&bus_connection_addresses[DBUS_BUS_SESSION],
-+ "DBUS_SESSION_BUS_ADDRESS");
-+ if (bus_connection_addresses[DBUS_BUS_SESSION] == NULL)
-+ {
-+ dbus_bool_t supported;
-+ DBusString addr;
-+ DBusError error = DBUS_ERROR_INIT;
-+
-+ if (!_dbus_string_init (&addr))
-+ return FALSE;
-+
-+ supported = FALSE;
-+ /* So it's not in the environment - let's try a platform-specific method.
-+ * On MacOS, this involves asking launchd. On Windows (not specified yet)
-+ * we might do a COM lookup.
-+ * Ignore errors - if we failed, fall back to autolaunch. */
-+ retval = _dbus_lookup_session_address (&supported, &addr, &error);
-+ if (supported && retval)
-+ {
-+ retval =_dbus_string_steal_data (&addr, &bus_connection_addresses[DBUS_BUS_SESSION]);
-+ }
-+ else if (supported && !retval)
-+ {
-+ if (dbus_error_is_set(&error))
-+ _dbus_warn ("Dynamic session lookup supported but failed: %s\n", error.message);
-+ else
-+ _dbus_warn ("Dynamic session lookup supported but failed silently\n");
-+ }
-+ _dbus_string_free (&addr);
-+ }
-+ else
-+ retval = TRUE;
-+
-+ if (!retval)
-+ return FALSE;
-+
-+ /* The DBUS_SESSION_BUS_DEFAULT_ADDRESS should have really been named
-+ * DBUS_SESSION_BUS_FALLBACK_ADDRESS.
-+ */
-+ if (bus_connection_addresses[DBUS_BUS_SESSION] == NULL)
-+ bus_connection_addresses[DBUS_BUS_SESSION] =
-+ _dbus_strdup (DBUS_SESSION_BUS_DEFAULT_ADDRESS);
-+ if (bus_connection_addresses[DBUS_BUS_SESSION] == NULL)
-+ return FALSE;
-+
-+ return TRUE;
-+}
-+
-+static dbus_bool_t
- init_connections_unlocked (void)
- {
- if (!initialized)
-@@ -198,17 +256,9 @@ init_connections_unlocked (void)
- {
- _dbus_verbose ("Filling in session bus address...\n");
-
-- if (!get_from_env (&bus_connection_addresses[DBUS_BUS_SESSION],
-- "DBUS_SESSION_BUS_ADDRESS"))
-+ if (!init_session_address ())
- return FALSE;
-
-- if (bus_connection_addresses[DBUS_BUS_SESSION] == NULL)
-- bus_connection_addresses[DBUS_BUS_SESSION] =
-- _dbus_strdup (DBUS_SESSION_BUS_DEFAULT_ADDRESS);
--
-- if (bus_connection_addresses[DBUS_BUS_SESSION] == NULL)
-- return FALSE;
--
- _dbus_verbose (" \"%s\"\n", bus_connection_addresses[DBUS_BUS_SESSION] ?
- bus_connection_addresses[DBUS_BUS_SESSION] : "none set");
- }
-diff --git a/dbus/dbus-server-launchd.c b/dbus/dbus-server-launchd.c
---- /dev/null
-+++ dbus/dbus-server-launchd.c
-@@ -0,0 +1,176 @@
-+/* dbus-server-launchd.c Server methods for interacting with launchd.
-+ * Copyright (C) 2007, Tanner Lovelace <lovelace at wayfarer.org>
-+ * Copyright (C) 2008, Benjamin Reed <rangerrick at befunk.com>
-+ *
-+ * Permission is hereby granted, free of charge, to any person
-+ * obtaining a copy of this software and associated documentation
-+ * files (the "Software"), to deal in the Software without
-+ * restriction, including without limitation the rights to use, copy,
-+ * modify, merge, publish, distribute, sublicense, and/or sell copies
-+ * of the Software, and to permit persons to whom the Software is
-+ * furnished to do so, subject to the following conditions:
-+ *
-+ * The above copyright notice and this permission notice shall be
-+ * included in all copies or substantial portions of the Software.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-+ * DEALINGS IN THE SOFTWARE.
-+ */
-+
-+#include <config.h>
-+#include "dbus-server-launchd.h"
-+
-+/**
-+ * @defgroup DBusServerLaunchd DBusServer implementations for Launchd
-+ * @ingroup DBusInternals
-+ * @brief Implementation details of DBusServer with Launchd support
-+ *
-+ * @{
-+ */
-+
-+#ifdef DBUS_ENABLE_LAUNCHD
-+#include <launch.h>
-+#include <errno.h>
-+
-+#include "dbus-server-socket.h"
-+
-+/* put other private launchd functions here */
-+
-+#endif /* DBUS_ENABLE_LAUNCHD */
-+
-+/**
-+ * @brief Creates a new server from launchd.
-+ *
-+ * launchd has allocaed a socket for us. We now query launchd for the
-+ * file descriptor of this socket and create a server on it.
-+ * In addition we inherit launchd's environment which holds a variable
-+ * containing the path to the socket. This is used to init the server's
-+ * address which is passed to autolaunched services.
-+ *
-+ * @param launchd_env_var the environment variable which holds the unix path to the socket
-+ * @param error location to store reason for failure.
-+ * @returns the new server, or #NULL on failure.
-+ */
-+
-+DBusServer*
-+_dbus_server_new_for_launchd (const char *launchd_env_var,
-+ DBusError *error)
-+{
-+#ifdef DBUS_ENABLE_LAUNCHD
-+ DBusServer *server;
-+ DBusString address;
-+ int launchd_fd;
-+ launch_data_t sockets_dict, checkin_response;
-+ launch_data_t checkin_request;
-+ launch_data_t listening_fd_array, listening_fd;
-+ const char * launchd_socket_path = _dbus_getenv(launchd_env_var);
-+
-+ _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-+
-+ if (*launchd_socket_path == '\0')
-+ {
-+ dbus_set_error (error, DBUS_ERROR_BAD_ADDRESS,
-+ "launchd's environment variable %s is empty, but should contain a socket path");
-+ return NULL;
-+ }
-+
-+ if (!_dbus_string_init (&address))
-+ {
-+ dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
-+ return NULL;
-+ }
-+ if (!_dbus_string_append (&address, "unix:path="))
-+ {
-+ dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
-+ goto l_failed_0;
-+ }
-+ if (!_dbus_string_append (&address, launchd_socket_path))
-+ {
-+ dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
-+ goto l_failed_0;
-+ }
-+
-+ if ((checkin_request = launch_data_new_string (LAUNCH_KEY_CHECKIN)) == NULL)
-+ {
-+ dbus_set_error (error, DBUS_ERROR_NO_MEMORY,
-+ "launch_data_new_string(\"%s\") Unable to create string.\n", LAUNCH_KEY_CHECKIN);
-+ goto l_failed_0;
-+ }
-+
-+ if ((checkin_response = launch_msg (checkin_request)) == NULL)
-+ {
-+ dbus_set_error (error, DBUS_ERROR_IO_ERROR, "launch_msg(\"%s\") IPC failure: %s\n",
-+ LAUNCH_KEY_CHECKIN, strerror (errno));
-+ goto l_failed_0;
-+ }
-+
-+ if (LAUNCH_DATA_ERRNO == launch_data_get_type (checkin_response))
-+ {
-+ dbus_set_error (error, DBUS_ERROR_FAILED, "Check-in failed: %s\n",
-+ strerror (launch_data_get_errno (checkin_response)));
-+ goto l_failed_0;
-+ }
-+
-+ sockets_dict = launch_data_dict_lookup (checkin_response, LAUNCH_JOBKEY_SOCKETS);
-+ if (NULL == sockets_dict)
-+ {
-+ dbus_set_error (error, DBUS_ERROR_IO_ERROR, "No sockets found to answer requests on!\n");
-+ goto l_failed_0;
-+ }
-+
-+ listening_fd_array = launch_data_dict_lookup (sockets_dict, "unix_domain_listener");
-+ if (NULL == listening_fd_array)
-+ {
-+ dbus_set_error (error, DBUS_ERROR_IO_ERROR, "No known sockets found to answer requests on!\n");
-+ goto l_failed_0;
-+ }
-+
-+ if (launch_data_array_get_count (listening_fd_array) != 1)
-+ {
-+ dbus_set_error (error, DBUS_ERROR_LIMITS_EXCEEDED,
-+ "Expected 1 socket from launchd, got %d.\n",
-+ launch_data_array_get_count (listening_fd_array));
-+ goto l_failed_0;
-+ }
-+
-+ listening_fd = launch_data_array_get_index (listening_fd_array, 0);
-+ launchd_fd = launch_data_get_fd (listening_fd);
-+
-+ _dbus_fd_set_close_on_exec (launchd_fd);
-+
-+ if (launchd_fd < 0)
-+ {
-+ _DBUS_ASSERT_ERROR_IS_SET (error);
-+ goto l_failed_0;
-+ }
-+
-+ server = _dbus_server_new_for_socket (&launchd_fd, 1, &address);
-+ if (server == NULL)
-+ {
-+ dbus_set_error (error, DBUS_ERROR_NO_SERVER, "Unable to listen on launchd fd %d.", launchd_fd);
-+ goto l_failed_0;
-+ }
-+
-+ _dbus_string_free (&address);
-+
-+ return server;
-+
-+ l_failed_0:
-+ _dbus_string_free (&address);
-+
-+ return NULL;
-+#else /* DBUS_ENABLE_LAUNCHD */
-+ dbus_set_error(error, DBUS_ERROR_BAD_ADDRESS,
-+ "address type 'launchd' requested, but launchd support not compiled in");
-+ return NULL;
-+#endif
-+}
-+
-+/** @} */
-+
-diff --git a/dbus/dbus-server-launchd.h b/dbus/dbus-server-launchd.h
---- /dev/null
-+++ dbus/dbus-server-launchd.h
-@@ -0,0 +1,38 @@
-+/* dbus-server-launchd.h Server methods for interacting with launchd.
-+* Copyright (C) 2008, Benjamin Reed <rangerrick at befunk.com>
-+*
-+* Permission is hereby granted, free of charge, to any person
-+* obtaining a copy of this software and associated documentation
-+* files (the "Software"), to deal in the Software without
-+* restriction, including without limitation the rights to use, copy,
-+* modify, merge, publish, distribute, sublicense, and/or sell copies
-+* of the Software, and to permit persons to whom the Software is
-+* furnished to do so, subject to the following conditions:
-+*
-+* The above copyright notice and this permission notice shall be
-+* included in all copies or substantial portions of the Software.
-+*
-+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-+* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-+* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-+* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-+* DEALINGS IN THE SOFTWARE.
-+*/
-+
-+#ifndef DBUS_SERVER_LAUNCHD_H
-+#define DBUS_SERVER_LAUNCHD_H
-+
-+#include <dbus/dbus-internals.h>
-+#include <dbus/dbus-server-protected.h>
-+
-+DBUS_BEGIN_DECLS
-+
-+DBusServer* _dbus_server_new_for_launchd (const char *launchd_env_var,
-+ DBusError *error);
-+
-+DBUS_END_DECLS
-+
-+#endif /* DBUS_SERVER_LAUNCHD_H */
-diff --git a/dbus/dbus-server-unix.c b/dbus/dbus-server-unix.c
---- dbus/dbus-server-unix.c
-+++ dbus/dbus-server-unix.c
-@@ -21,9 +21,11 @@
- *
- */
-
-+#include <config.h>
- #include "dbus-internals.h"
- #include "dbus-server-unix.h"
- #include "dbus-server-socket.h"
-+#include "dbus-server-launchd.h"
- #include "dbus-transport-unix.h"
- #include "dbus-connection-internal.h"
- #include "dbus-sysdeps-unix.h"
-@@ -145,6 +147,27 @@ _dbus_server_listen_platform_specific (DBusAddressEntry *entry,
- return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
- }
- }
-+ else if (strcmp (method, "launchd") == 0)
-+ {
-+ const char *launchd_env_var = dbus_address_entry_get_value (entry, "env");
-+ if (launchd_env_var == NULL)
-+ {
-+ _dbus_set_bad_address (error, "launchd", "env", NULL);
-+ return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
-+ }
-+ *server_p = _dbus_server_new_for_launchd (launchd_env_var, error);
-+
-+ if (*server_p != NULL)
-+ {
-+ _DBUS_ASSERT_ERROR_IS_CLEAR(error);
-+ return DBUS_SERVER_LISTEN_OK;
-+ }
-+ else
-+ {
-+ _DBUS_ASSERT_ERROR_IS_SET(error);
-+ return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
-+ }
-+ }
- else
- {
- /* If we don't handle the method, we return NULL with the
-diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c
---- dbus/dbus-sysdeps-unix.c
-+++ dbus/dbus-sysdeps-unix.c
-@@ -2841,23 +2841,30 @@ _dbus_get_tmpdir(void)
- }
-
- /**
-- * Determines the address of the session bus by querying a
-- * platform-specific method.
-+ * Execute a subprocess, returning up to 1024 bytes of output
-+ * into @p result.
- *
-- * If successful, returns #TRUE and appends the address to @p
-- * address. If a failure happens, returns #FALSE and
-+ * If successful, returns #TRUE and appends the output to @p
-+ * result. If a failure happens, returns #FALSE and
- * sets an error in @p error.
- *
-- * @param address a DBusString where the address can be stored
-+ * @note It's not an error if the subprocess terminates normally
-+ * without writing any data to stdout. Verify the @p result length
-+ * before and after this function call to cover this case.
-+ *
-+ * @param progname initial path to exec
-+ * @param argv NULL-terminated list of arguments
-+ * @param result a DBusString where the output can be append
- * @param error a DBusError to store the error in case of failure
- * @returns #TRUE on success, #FALSE if an error happened
- */
--dbus_bool_t
--_dbus_get_autolaunch_address (DBusString *address,
-- DBusError *error)
-+static dbus_bool_t
-+_read_subprocess_line_argv (const char *progpath,
-+ char * const *argv,
-+ DBusString *result,
-+ DBusError *error)
- {
-- static char *argv[6];
-- int address_pipe[2] = { -1, -1 };
-+ int result_pipe[2] = { -1, -1 };
- int errors_pipe[2] = { -1, -1 };
- pid_t pid;
- int ret;
-@@ -2876,48 +2883,26 @@ _dbus_get_autolaunch_address (DBusString *address,
- return FALSE;
- }
-
-- if (!_dbus_get_local_machine_uuid_encoded (&uuid))
-- {
-- _DBUS_SET_OOM (error);
-- goto out;
-- }
--
-- i = 0;
-- argv[i] = "dbus-launch";
-- ++i;
-- argv[i] = "--autolaunch";
-- ++i;
-- argv[i] = _dbus_string_get_data (&uuid);
-- ++i;
-- argv[i] = "--binary-syntax";
-- ++i;
-- argv[i] = "--close-stderr";
-- ++i;
-- argv[i] = NULL;
-- ++i;
--
-- _dbus_assert (i == _DBUS_N_ELEMENTS (argv));
--
-- orig_len = _dbus_string_get_length (address);
-+ orig_len = _dbus_string_get_length (result);
-
- #define READ_END 0
- #define WRITE_END 1
-- if (pipe (address_pipe) < 0)
-+ if (pipe (result_pipe) < 0)
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
-- "Failed to create a pipe: %s",
-- _dbus_strerror (errno));
-- _dbus_verbose ("Failed to create a pipe to call dbus-launch: %s\n",
-- _dbus_strerror (errno));
-+ "Failed to create a pipe to call %s: %s",
-+ progpath, _dbus_strerror (errno));
-+ _dbus_verbose ("Failed to create a pipe to call %s: %s\n",
-+ progpath, _dbus_strerror (errno));
- goto out;
- }
- if (pipe (errors_pipe) < 0)
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
-- "Failed to create a pipe: %s",
-- _dbus_strerror (errno));
-- _dbus_verbose ("Failed to create a pipe to call dbus-launch: %s\n",
-- _dbus_strerror (errno));
-+ "Failed to create a pipe to call %s: %s",
-+ progpath, _dbus_strerror (errno));
-+ _dbus_verbose ("Failed to create a pipe to call %s: %s\n",
-+ progpath, _dbus_strerror (errno));
- goto out;
- }
-
-@@ -2925,10 +2910,10 @@ _dbus_get_autolaunch_address (DBusString *address,
- if (pid < 0)
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
-- "Failed to fork(): %s",
-- _dbus_strerror (errno));
-- _dbus_verbose ("Failed to fork() to call dbus-launch: %s\n",
-- _dbus_strerror (errno));
-+ "Failed to fork() to call %s: %s",
-+ progpath, _dbus_strerror (errno));
-+ _dbus_verbose ("Failed to fork() to call %s: %s\n",
-+ progpath, _dbus_strerror (errno));
- goto out;
- }
-
-@@ -2946,7 +2931,7 @@ _dbus_get_autolaunch_address (DBusString *address,
- _dbus_verbose ("/dev/null fd %d opened\n", fd);
-
- /* set-up stdXXX */
-- close (address_pipe[READ_END]);
-+ close (result_pipe[READ_END]);
- close (errors_pipe[READ_END]);
- close (0); /* close stdin */
- close (1); /* close stdout */
-@@ -2954,7 +2939,7 @@ _dbus_get_autolaunch_address (DBusString *address,
-
- if (dup2 (fd, 0) == -1)
- _exit (1);
-- if (dup2 (address_pipe[WRITE_END], 1) == -1)
-+ if (dup2 (result_pipe[WRITE_END], 1) == -1)
- _exit (1);
- if (dup2 (errors_pipe[WRITE_END], 2) == -1)
- _exit (1);
-@@ -2969,25 +2954,26 @@ _dbus_get_autolaunch_address (DBusString *address,
- for (i = 3; i < maxfds; i++)
- close (i);
-
-- execv (DBUS_BINDIR "/dbus-launch", argv);
--
-- /* failed, try searching PATH */
-- execvp ("dbus-launch", argv);
-+ /* If it looks fully-qualified, try execv first */
-+ if (progpath[0] == '/')
-+ execv (progpath, argv);
-+ else
-+ execvp (progpath, argv);
-
- /* still nothing, we failed */
- _exit (1);
- }
-
- /* parent process */
-- close (address_pipe[WRITE_END]);
-+ close (result_pipe[WRITE_END]);
- close (errors_pipe[WRITE_END]);
-- address_pipe[WRITE_END] = -1;
-+ result_pipe[WRITE_END] = -1;
- errors_pipe[WRITE_END] = -1;
-
- ret = 0;
- do
- {
-- ret = _dbus_read (address_pipe[READ_END], address, 1024);
-+ ret = _dbus_read (result_pipe[READ_END], result, 1024);
- }
- while (ret > 0);
-
-@@ -3000,27 +2986,27 @@ _dbus_get_autolaunch_address (DBusString *address,
-
- /* We succeeded if the process exited with status 0 and
- anything was read */
-- if (!WIFEXITED (status) || WEXITSTATUS (status) != 0 ||
-- _dbus_string_get_length (address) == orig_len)
-+ if (!WIFEXITED (status) || WEXITSTATUS (status) != 0 )
- {
- /* The process ended with error */
- DBusString error_message;
- _dbus_string_init (&error_message);
- ret = 0;
- do
-- {
-- ret = _dbus_read (errors_pipe[READ_END], &error_message, 1024);
-- }
-+ {
-+ ret = _dbus_read (errors_pipe[READ_END], &error_message, 1024);
-+ }
- while (ret > 0);
-
-- _dbus_string_set_length (address, orig_len);
-+ _dbus_string_set_length (result, orig_len);
- if (_dbus_string_get_length (&error_message) > 0)
-- dbus_set_error (error, DBUS_ERROR_SPAWN_EXEC_FAILED,
-- "dbus-launch failed to autolaunch D-Bus session: %s",
-- _dbus_string_get_data (&error_message));
-+ dbus_set_error (error, DBUS_ERROR_SPAWN_EXEC_FAILED,
-+ "%s terminated abnormally with the following error: %s",
-+ progpath, _dbus_string_get_data (&error_message));
- else
-- dbus_set_error (error, DBUS_ERROR_SPAWN_EXEC_FAILED,
-- "Failed to execute dbus-launch to autolaunch D-Bus session");
-+ dbus_set_error (error, DBUS_ERROR_SPAWN_EXEC_FAILED,
-+ "%s terminated abnormally without any error message",
-+ progpath);
- goto out;
- }
-
-@@ -3032,20 +3018,202 @@ _dbus_get_autolaunch_address (DBusString *address,
- else
- _DBUS_ASSERT_ERROR_IS_SET (error);
-
-- if (address_pipe[0] != -1)
-- close (address_pipe[0]);
-- if (address_pipe[1] != -1)
-- close (address_pipe[1]);
-+ if (result_pipe[0] != -1)
-+ close (result_pipe[0]);
-+ if (result_pipe[1] != -1)
-+ close (result_pipe[1]);
- if (errors_pipe[0] != -1)
- close (errors_pipe[0]);
- if (errors_pipe[1] != -1)
- close (errors_pipe[1]);
-
-+ return retval;
-+}
-+
-+/**
-+ * Returns the address of a new session bus.
-+ *
-+ * If successful, returns #TRUE and appends the address to @p
-+ * address. If a failure happens, returns #FALSE and
-+ * sets an error in @p error.
-+ *
-+ * @param address a DBusString where the address can be stored
-+ * @param error a DBusError to store the error in case of failure
-+ * @returns #TRUE on success, #FALSE if an error happened
-+ */
-+dbus_bool_t
-+_dbus_get_autolaunch_address (DBusString *address,
-+ DBusError *error)
-+{
-+ static char *argv[6];
-+ int i;
-+ DBusString uuid;
-+ dbus_bool_t retval;
-+
-+ _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-+ retval = FALSE;
-+
-+ if (!_dbus_string_init (&uuid))
-+ {
-+ _DBUS_SET_OOM (error);
-+ return FALSE;
-+ }
-+
-+ if (!_dbus_get_local_machine_uuid_encoded (&uuid))
-+ {
-+ _DBUS_SET_OOM (error);
-+ goto out;
-+ }
-+
-+ i = 0;
-+ argv[i] = "dbus-launch";
-+ ++i;
-+ argv[i] = "--autolaunch";
-+ ++i;
-+ argv[i] = _dbus_string_get_data (&uuid);
-+ ++i;
-+ argv[i] = "--binary-syntax";
-+ ++i;
-+ argv[i] = "--close-stderr";
-+ ++i;
-+ argv[i] = NULL;
-+ ++i;
-+
-+ _dbus_assert (i == _DBUS_N_ELEMENTS (argv));
-+
-+ retval = _read_subprocess_line_argv (DBUS_BINDIR "/dbus-launch",
-+ argv, address, error);
-+
-+ out:
- _dbus_string_free (&uuid);
- return retval;
- }
-
- /**
-+ * quries launchd for a specific env var which holds the socket path.
-+ * @param launchd_env_var the env var to look up
-+ * @param error a DBusError to store the error in case of failure
-+ * @return the value of the env var
-+ */
-+const char *
-+_dbus_lookup_launchd_socket (const char *launchd_env_var,
-+ DBusError *error)
-+{
-+#ifdef DBUS_ENABLE_LAUNCHD
-+ char *argv[4];
-+ int i;
-+ DBusString socket_path;
-+
-+ _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-+
-+ if (!_dbus_string_init (&socket_path))
-+ {
-+ _DBUS_SET_OOM (error);
-+ return FALSE;
-+ }
-+
-+ i = 0;
-+ argv[i] = "launchctl";
-+ ++i;
-+ argv[i] = "getenv";
-+ ++i;
-+ argv[i] = (char*)launchd_env_var;
-+ ++i;
-+ argv[i] = NULL;
-+ ++i;
-+
-+ _dbus_assert (i == _DBUS_N_ELEMENTS (argv));
-+
-+ if (!_read_subprocess_line_argv(argv[0], argv, &socket_path, error))
-+ {
-+ _dbus_string_free(&socket_path);
-+ return NULL;
-+ }
-+
-+ /* no error, but no result either */
-+ if (_dbus_string_get_length(&socket_path) == 0)
-+ {
-+ _dbus_string_free(&socket_path);
-+ return NULL;
-+ }
-+
-+ /* strip the carriage-return */
-+ _dbus_string_shorten(&socket_path, 1);
-+ return _dbus_string_get_const_data(&socket_path);
-+#else /* DBUS_ENABLE_LAUNCHD */
-+ dbus_set_error(error, DBUS_ERROR_NOT_SUPPORTED,
-+ "can't lookup socket from launchd; launchd support not compiled in");
-+ return NULL;
-+#endif
-+}
-+
-+static dbus_bool_t
-+_dbus_lookup_session_address_launchd (DBusString *address,
-+ DBusError *error)
-+{
-+ const char *launchd_socket = _dbus_lookup_launchd_socket ("DBUS_LAUNCHD_SESSION_BUS_SOCKET",
-+ error);
-+ if (dbus_error_is_set(error))
-+ return FALSE;
-+ if (launchd_socket == NULL)
-+ {
-+ dbus_set_error(error, "no socket path",
-+ "launchd did not provide a socket path, "
-+ "verify that org.freedesktop.dbus-session.plist is loaded!");
-+ return FALSE;
-+ }
-+ if (!_dbus_string_append (address, "unix:path="))
-+ {
-+ _DBUS_SET_OOM (error);
-+ return FALSE;
-+ }
-+ if (!_dbus_string_append (address, launchd_socket))
-+ {
-+ _DBUS_SET_OOM (error);
-+ return FALSE;
-+ }
-+
-+ return TRUE;
-+}
-+
-+/**
-+ * Determines the address of the session bus by querying a
-+ * platform-specific method.
-+ *
-+ * The first parameter will be a boolean specifying whether
-+ * or not a dynamic session lookup is supported on this platform.
-+ *
-+ * If supported is TRUE and the return value is #TRUE, the
-+ * address will be appended to @p address.
-+ * If a failure happens, returns #FALSE and sets an error in
-+ * @p error.
-+ *
-+ * If supported is FALSE, ignore the return value.
-+ *
-+ * @param supported returns whether this method is supported
-+ * @param address a DBusString where the address can be stored
-+ * @param error a DBusError to store the error in case of failure
-+ * @returns #TRUE on success, #FALSE if an error happened
-+ */
-+dbus_bool_t
-+_dbus_lookup_session_address (dbus_bool_t *supported,
-+ DBusString *address,
-+ DBusError *error)
-+{
-+#ifdef DBUS_ENABLE_LAUNCHD
-+ *supported = TRUE;
-+ return _dbus_lookup_session_address_launchd (address, error);
-+#else
-+ /* On non-Mac Unix platforms, if the session address isn't already
-+ * set in DBUS_SESSION_BUS_ADDRESS environment variable, we punt and
-+ * fall back to the autolaunch: global default; see
-+ * init_session_address in dbus/dbus-bus.c. */
-+ *supported = FALSE;
-+ return TRUE;
-+#endif
-+}
-+
-+/**
- * Reads the uuid of the machine we're running on from
- * the dbus configuration. Optionally try to create it
- * (only root can do this usually).
-diff --git a/dbus/dbus-sysdeps-unix.h b/dbus/dbus-sysdeps-unix.h
---- dbus/dbus-sysdeps-unix.h
-+++ dbus/dbus-sysdeps-unix.h
-@@ -77,6 +77,9 @@ dbus_bool_t _dbus_read_credentials (int client_fd,
- dbus_bool_t _dbus_send_credentials (int server_fd,
- DBusError *error);
-
-+const char *_dbus_lookup_launchd_socket (const char *launchd_env_var,
-+ DBusError *error);
-+
- /** Information about a UNIX user */
- typedef struct DBusUserInfo DBusUserInfo;
- /** Information about a UNIX group */
-diff --git a/dbus/dbus-sysdeps.h b/dbus/dbus-sysdeps.h
---- dbus/dbus-sysdeps.h
-+++ dbus/dbus-sysdeps.h
-@@ -468,6 +468,10 @@ void _dbus_log_security (const char *msg, va_list args);
- dbus_bool_t _dbus_get_autolaunch_address (DBusString *address,
- DBusError *error);
-
-+dbus_bool_t _dbus_lookup_session_address (dbus_bool_t *supported,
-+ DBusString *address,
-+ DBusError *error);
-+
- /** Type representing a universally unique ID
- * @todo rename to UUID instead of GUID
- */
-diff --git a/dbus/dbus-transport-unix.c b/dbus/dbus-transport-unix.c
---- dbus/dbus-transport-unix.c
-+++ dbus/dbus-transport-unix.c
-@@ -171,6 +171,34 @@ _dbus_transport_open_platform_specific (DBusAddressEntry *entry,
- return DBUS_TRANSPORT_OPEN_OK;
- }
- }
-+ else if (strcmp (method, "launchd") == 0)
-+ {
-+ const char *launchd_env_var = dbus_address_entry_get_value (entry, "env");
-+ if (launchd_env_var == NULL)
-+ {
-+ _dbus_set_bad_address (error, "launchd", "env", NULL);
-+ return DBUS_TRANSPORT_OPEN_BAD_ADDRESS;
-+ }
-+
-+ const char *launchd_socket = _dbus_lookup_launchd_socket (launchd_env_var, error);
-+ if (launchd_socket)
-+ *transport_p = _dbus_transport_new_for_domain_socket (launchd_socket, FALSE,
-+ error);
-+ else
-+ dbus_set_error(error, DBUS_ERROR_BAD_ADDRESS,
-+ "launchd's env var %s does not exist", launchd_env_var);
-+
-+ if (*transport_p == NULL)
-+ {
-+ _DBUS_ASSERT_ERROR_IS_SET (error);
-+ return DBUS_TRANSPORT_OPEN_DID_NOT_CONNECT;
-+ }
-+ else
-+ {
-+ _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-+ return DBUS_TRANSPORT_OPEN_OK;
-+ }
-+ }
- else
- {
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
Added: trunk/dports/devel/dbus/files/patch-launchd-integration.diff
===================================================================
--- trunk/dports/devel/dbus/files/patch-launchd-integration.diff (rev 0)
+++ trunk/dports/devel/dbus/files/patch-launchd-integration.diff 2009-04-07 03:18:47 UTC (rev 49300)
@@ -0,0 +1,1171 @@
+diff -Nurd README.launchd dbus-1.2.12-new/README.launchd
+--- README.launchd 1969-12-31 19:00:00.000000000 -0500
++++ dbus-1.2.12-new/README.launchd 2009-02-23 08:33:30.000000000 -0500
+@@ -0,0 +1,61 @@
++Launchd[1,2] replaces init, inetd and cron on Mac OS X since 10.4 "Tiger".
++dbus uses this service to provide a common session bus address for each user
++and so deprecates the X11 enabled dbus-launcher.
++
++[1] http://developer.apple.com/MacOsX/launchd.html
++[2] http://launchd.macosforge.org/
++
++
++Setup
++===
++
++Configure with --enable-launchd and --without-x (X11 should not harm but it's
++simply not necessary any more)
++After installation, to prevent a reboot, load the dbus session starter into
++launchd by executing:
++$ launchctl load /Library/LaunchAgents/org.freedesktop.dbus-session.plist
++
++You can change the launch agent dir via configure, but it's not recommended.
++Make sure to execute the above line as the actual user for which you want to
++use a session bus since launchd manages its agents on a per user basis.
++
++
++How it works
++===
++
++Launchd allocates a socket and provides the unix path to it via the variable
++DBUS_LAUNCHD_SESSION_BUS_SOCKET in launchd's environment. Every process
++spawned by launchd (or dbus-daemon, if stared by launchd) can access it through
++its own environment. Other processes can query launchd for it by executing:
++$ launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET
++However, this is normally done by the dbus client lib for you.
++
++If launchd start dbus-daemon with a config file containing a "launchd:env=FOO"
++address, as the default session config does with env=DBUS_LAUNCHD_SESSION_BUS_SOCKET,
++the daemon will get the file descriptor from launchd and start listening on it.
++The environment variable is used to get the actual socket path which is passed
++to every service spawned by dbus-daemon as a result from autolaunch messages.
++Please note that it's not possible to start dbus-daemon manually when using a
++"launchd:" address. Only child processes of launchd can access the above
++mentioned file descriptor!
++
++To create custom buses just set up an other launch agent. As a quick start copy
++/Library/LaunchAgents/org.freedesktop.dbus-session.plist, change the label
++to i.e. "org.freedesktop.dbus-foo" and change the SecureSocketWithKey value,
++i.e. to "DBUS_LAUNCHD_FOO_BUS_SOCKET". This environment variable has to be set
++in the config file for your new bus in the <listen> element (see session.config).
++Then edit your /Library/LaunchAgents/org.freedesktop.dbus-foo.plist to start
++dbus-daemon with "--config-file=/opt/local/etc/dbus-1/foo.conf" instead of
++"--session". Now load the new plist onto launchd as described in the setup
++section of this document.
++Executing "launchctl export" should now give you two sockets, one in
++DBUS_LAUNCHD_SESSION_BUS_SOCKET and the new DBUS_LAUNCHD_FOO_BUS_SOCKET.
++To connect to this new bus use "launchd:env=DBUS_LAUNCHD_FOO_BUS_SOCKET".
++
++Since Mac OS X 10.5 "Leopard" you can also configure launchd to start
++dbus-daemon on demand as soon as some process connects to the socket. Since
++it's broken on 10.4 this feature is disabled per default. Look at
++/Library/LaunchAgents/org.freedesktop.dbus-session.plist to change it.
++
++On the client side, the envvar DBUS_SESSION_BUS_ADDRESS can be normally used
++but if it's not set, launchd is queried for the session bus socket.
+diff -Nurd bus/Makefile.am dbus-1.2.12-new/bus/Makefile.am
+--- bus/Makefile.am 2008-08-07 14:44:35.000000000 -0400
++++ dbus-1.2.12-new/bus/Makefile.am 2009-02-23 08:33:30.000000000 -0500
+@@ -9,12 +9,18 @@
+
+ CONFIG_IN_FILES= \
+ session.conf.in \
+- system.conf.in
++ system.conf.in \
++ org.freedesktop.dbus-session.plist.in
+
+ config_DATA= \
+ session.conf \
+ system.conf
+
++if DBUS_ENABLE_LAUNCHD
++agentdir=$(LAUNCHD_AGENT_DIR)
++agent_DATA=org.freedesktop.dbus-session.plist
++endif
++
+ if DBUS_USE_LIBXML
+ XML_SOURCES=config-loader-libxml.c
+ endif
+diff -Nurd bus/org.freedesktop.dbus-session.plist.in dbus-1.2.12-new/bus/org.freedesktop.dbus-session.plist.in
+--- bus/org.freedesktop.dbus-session.plist.in 1969-12-31 19:00:00.000000000 -0500
++++ dbus-1.2.12-new/bus/org.freedesktop.dbus-session.plist.in 2009-02-23 08:33:30.000000000 -0500
+@@ -0,0 +1,31 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
++<plist version="1.0">
++<dict>
++ <key>Label</key>
++ <string>org.freedesktop.dbus-session</string>
++
++ <key>ServiceIPC</key>
++ <true/>
++
++ <!-- bug in 10.4's launchd - on-demand loading does not work -->
++ <key>OnDemand</key>
++ <false />
++
++ <key>ProgramArguments</key>
++ <array>
++ <string>@DBUS_DAEMONDIR@/dbus-daemon</string>
++ <string>--nofork</string>
++ <string>--session</string>
++ </array>
++
++ <key>Sockets</key>
++ <dict>
++ <key>unix_domain_listener</key>
++ <dict>
++ <key>SecureSocketWithKey</key>
++ <string>DBUS_LAUNCHD_SESSION_BUS_SOCKET</string>
++ </dict>
++ </dict>
++</dict>
++</plist>
+diff -Nurd bus/session.conf.in dbus-1.2.12-new/bus/session.conf.in
+--- bus/session.conf.in 2009-01-06 17:52:22.000000000 -0500
++++ dbus-1.2.12-new/bus/session.conf.in 2009-02-23 08:33:30.000000000 -0500
+@@ -12,7 +12,7 @@
+ the behavior of child processes. -->
+ <keep_umask/>
+
+- <listen>unix:tmpdir=@DBUS_SESSION_SOCKET_DIR@</listen>
++ <listen>@DBUS_SESSION_BUS_DEFAULT_ADDRESS@</listen>
+
+ <standard_session_servicedirs />
+
+diff -Nurd configure.in dbus-1.2.12-new/configure.in
+--- configure.in 2009-01-06 19:30:26.000000000 -0500
++++ dbus-1.2.12-new/configure.in 2009-02-23 08:33:30.000000000 -0500
+@@ -78,6 +78,7 @@
+ AC_ARG_ENABLE(kqueue, AS_HELP_STRING([--enable-kqueue],[build with kqueue support]),enable_kqueue=$enableval,enable_kqueue=auto)
+ AC_ARG_ENABLE(console-owner-file, AS_HELP_STRING([--enable-console-owner-file],[enable console owner file]),enable_console_owner_file=$enableval,enable_console_owner_file=auto)
+ AC_ARG_ENABLE(userdb-cache, AS_HELP_STRING([--enable-userdb-cache],[build with userdb-cache support]),enable_userdb_cache=$enableval,enable_userdb_cache=yes)
++AC_ARG_ENABLE(launchd, AS_HELP_STRING([--enable-launchd],[build with launchd auto-launch support]),enable_launchd=$enableval,enable_launchd=auto)
+
+ AC_ARG_WITH(xml, AS_HELP_STRING([--with-xml=[libxml/expat]],[XML library to use]))
+ AC_ARG_WITH(init-scripts, AS_HELP_STRING([--with-init-scripts=[redhat]],[Style of init scripts to install]))
+@@ -87,6 +88,7 @@
+ AC_ARG_WITH(system-socket, AS_HELP_STRING([--with-system-socket=[filename]],[UNIX domain socket for systemwide daemon]))
+ AC_ARG_WITH(console-auth-dir, AS_HELP_STRING([--with-console-auth-dir=[dirname]],[directory to check for console ownerhip]))
+ AC_ARG_WITH(console-owner-file, AS_HELP_STRING([--with-console-owner-file=[filename]],[file whose owner determines current console owner]))
++AC_ARG_WITH(launchd-agent-dir, AS_HELP_STRING([--with-launchd-agent-dir=[dirname]],[directory to put the launchd agent (default: /Library/LaunchAgents)]))
+ AC_ARG_WITH(dbus_user, AS_HELP_STRING([--with-dbus-user=<user>],[User for running the DBUS daemon (messagebus)]))
+ AC_ARG_WITH(dbus_daemondir, AS_HELP_STRING([--with-dbus-daemondir=[dirname]],[Directory for installing the DBUS daemon]))
+
+@@ -1026,6 +1028,46 @@
+
+ AM_CONDITIONAL(DBUS_BUS_ENABLE_KQUEUE, test x$have_kqueue = xyes)
+
++# launchd checks
++if test x$enable_launchd = xno ; then
++ have_launchd=no
++else
++ have_launchd=yes
++ AC_CHECK_HEADER([launch.h], , have_launchd=no)
++ AC_PATH_PROG([LAUNCHCTL], [launchctl])
++ if test "x$LAUNCHCTL" = "x"; then
++ have_launchd=no
++ fi
++
++ if test x$enable_launchd = xyes -a x$have_launchd = xno ; then
++ AC_MSG_ERROR([launchd support explicitly enabled but not available])
++ fi
++fi
++
++dnl check if launchd is enabled
++if test x$have_launchd = xyes; then
++ AC_DEFINE(DBUS_ENABLE_LAUNCHD,1,[Use launchd autolaunch])
++fi
++
++AM_CONDITIONAL(DBUS_ENABLE_LAUNCHD, test x$have_launchd = xyes)
++
++if test x$have_launchd = xyes; then
++ DBUS_SESSION_BUS_DEFAULT_ADDRESS="launchd:env=DBUS_LAUNCHD_SESSION_BUS_SOCKET"
++else
++ DBUS_SESSION_BUS_DEFAULT_ADDRESS="unix:tmpdir=$DBUS_SESSION_SOCKET_DIR"
++fi
++AC_SUBST(DBUS_SESSION_BUS_DEFAULT_ADDRESS)
++
++
++#### Directory to place launchd agent file
++if test "x$with_launchd_agent_dir" = "x"; then
++ LAUNCHD_AGENT_DIR="/Library/LaunchAgents"
++else
++ LAUNCHD_AGENT_DIR="$with_launchd_agent_dir"
++fi
++
++AC_SUBST(LAUNCHD_AGENT_DIR)
++
+ dnl console owner file
+ if test x$enable_console_owner_file = xno ; then
+ have_console_owner_file=no;
+@@ -1387,6 +1429,7 @@
+ bus/system.conf
+ bus/session.conf
+ bus/messagebus
++bus/org.freedesktop.dbus-session.plist
+ bus/rc.messagebus
+ bus/dbus-daemon.1
+ Makefile
+@@ -1454,6 +1497,7 @@
+ Building Doxygen docs: ${enable_doxygen_docs}
+ Building XML docs: ${enable_xml_docs}
+ Building cache support: ${enable_userdb_cache}
++ Building launchd support: ${have_launchd}
+ Gettext libs (empty OK): ${INTLLIBS}
+ Using XML parser: ${with_xml}
+ Init scripts style: ${with_init_scripts}
+@@ -1467,8 +1511,11 @@
+ Console owner file path: ${DBUS_CONSOLE_OWNER_FILE}
+ System bus user: ${DBUS_USER}
+ Session bus services dir: ${EXPANDED_DATADIR}/dbus-1/services
+- 'make check' socket dir: ${TEST_SOCKET_DIR}
+-"
++ 'make check' socket dir: ${TEST_SOCKET_DIR}"
++if test x$have_launchd = xyes; then
++ echo " launchd agent dir: ${LAUNCHD_AGENT_DIR}"
++fi
++echo
+
+ if test x$enable_tests = xyes; then
+ echo "NOTE: building with unit tests increases the size of the installed library and renders it insecure."
+diff -Nurd dbus/Makefile.am dbus-1.2.12-new/dbus/Makefile.am
+--- dbus/Makefile.am 2008-08-07 14:44:36.000000000 -0400
++++ dbus-1.2.12-new/dbus/Makefile.am 2009-02-23 08:33:30.000000000 -0500
+@@ -70,6 +70,8 @@
+ dbus-server.c \
+ dbus-server-debug-pipe.c \
+ dbus-server-debug-pipe.h \
++ dbus-server-launchd.c \
++ dbus-server-launchd.h \
+ dbus-server-protected.h \
+ dbus-server-socket.c \
+ dbus-server-socket.h \
+diff -Nurd dbus/dbus-bus.c dbus-1.2.12-new/dbus/dbus-bus.c
+--- dbus/dbus-bus.c 2008-08-07 14:44:36.000000000 -0400
++++ dbus-1.2.12-new/dbus/dbus-bus.c 2009-02-23 08:33:54.000000000 -0500
+@@ -22,6 +22,7 @@
+ *
+ */
+
++#include <config.h>
+ #include "dbus-bus.h"
+ #include "dbus-protocol.h"
+ #include "dbus-internals.h"
+@@ -29,7 +30,7 @@
+ #include "dbus-marshal-validate.h"
+ #include "dbus-threads-internal.h"
+ #include "dbus-connection-internal.h"
+-#include <string.h>
++#include "dbus-string.h"
+
+ /**
+ * @defgroup DBusBus Message bus APIs
+@@ -147,6 +148,63 @@
+ }
+
+ static dbus_bool_t
++init_session_address (void)
++{
++ dbus_bool_t retval;
++
++ retval = FALSE;
++
++ /* First, look in the environment. This is the normal case on
++ * freedesktop.org/Unix systems. */
++ get_from_env (&bus_connection_addresses[DBUS_BUS_SESSION],
++ "DBUS_SESSION_BUS_ADDRESS");
++ if (bus_connection_addresses[DBUS_BUS_SESSION] == NULL)
++ {
++ dbus_bool_t supported;
++ DBusString addr;
++ DBusError error = DBUS_ERROR_INIT;
++
++ if (!_dbus_string_init (&addr))
++ return FALSE;
++
++ supported = FALSE;
++ /* So it's not in the environment - let's try a platform-specific method.
++ * On MacOS, this involves asking launchd. On Windows (not specified yet)
++ * we might do a COM lookup.
++ * Ignore errors - if we failed, fall back to autolaunch. */
++ retval = _dbus_lookup_session_address (&supported, &addr, &error);
++ if (supported && retval)
++ {
++ retval =_dbus_string_steal_data (&addr, &bus_connection_addresses[DBUS_BUS_SESSION]);
++ }
++ else if (supported && !retval)
++ {
++ if (dbus_error_is_set(&error))
++ _dbus_warn ("Dynamic session lookup supported but failed: %s\n", error.message);
++ else
++ _dbus_warn ("Dynamic session lookup supported but failed silently\n");
++ }
++ _dbus_string_free (&addr);
++ }
++ else
++ retval = TRUE;
++
++ if (!retval)
++ return FALSE;
++
++ /* The DBUS_SESSION_BUS_DEFAULT_ADDRESS should have really been named
++ * DBUS_SESSION_BUS_FALLBACK_ADDRESS.
++ */
++ if (bus_connection_addresses[DBUS_BUS_SESSION] == NULL)
++ bus_connection_addresses[DBUS_BUS_SESSION] =
++ _dbus_strdup (DBUS_SESSION_BUS_DEFAULT_ADDRESS);
++ if (bus_connection_addresses[DBUS_BUS_SESSION] == NULL)
++ return FALSE;
++
++ return TRUE;
++}
++
++static dbus_bool_t
+ init_connections_unlocked (void)
+ {
+ if (!initialized)
+@@ -198,17 +256,9 @@
+ {
+ _dbus_verbose ("Filling in session bus address...\n");
+
+- if (!get_from_env (&bus_connection_addresses[DBUS_BUS_SESSION],
+- "DBUS_SESSION_BUS_ADDRESS"))
++ if (!init_session_address ())
+ return FALSE;
+
+- if (bus_connection_addresses[DBUS_BUS_SESSION] == NULL)
+- bus_connection_addresses[DBUS_BUS_SESSION] =
+- _dbus_strdup (DBUS_SESSION_BUS_DEFAULT_ADDRESS);
+-
+- if (bus_connection_addresses[DBUS_BUS_SESSION] == NULL)
+- return FALSE;
+-
+ _dbus_verbose (" \"%s\"\n", bus_connection_addresses[DBUS_BUS_SESSION] ?
+ bus_connection_addresses[DBUS_BUS_SESSION] : "none set");
+ }
+diff -Nurd dbus/dbus-server-launchd.c dbus-1.2.12-new/dbus/dbus-server-launchd.c
+--- dbus/dbus-server-launchd.c 1969-12-31 19:00:00.000000000 -0500
++++ dbus-1.2.12-new/dbus/dbus-server-launchd.c 2009-02-23 08:33:55.000000000 -0500
+@@ -0,0 +1,176 @@
++/* dbus-server-launchd.c Server methods for interacting with launchd.
++ * Copyright (C) 2007, Tanner Lovelace <lovelace at wayfarer.org>
++ * Copyright (C) 2008, Benjamin Reed <rangerrick at befunk.com>
++ *
++ * Permission is hereby granted, free of charge, to any person
++ * obtaining a copy of this software and associated documentation
++ * files (the "Software"), to deal in the Software without
++ * restriction, including without limitation the rights to use, copy,
++ * modify, merge, publish, distribute, sublicense, and/or sell copies
++ * of the Software, and to permit persons to whom the Software is
++ * furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be
++ * included in all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
++ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
++ * DEALINGS IN THE SOFTWARE.
++ */
++
++#include <config.h>
++#include "dbus-server-launchd.h"
++
++/**
++ * @defgroup DBusServerLaunchd DBusServer implementations for Launchd
++ * @ingroup DBusInternals
++ * @brief Implementation details of DBusServer with Launchd support
++ *
++ * @{
++ */
++
++#ifdef DBUS_ENABLE_LAUNCHD
++#include <launch.h>
++#include <errno.h>
++
++#include "dbus-server-socket.h"
++
++/* put other private launchd functions here */
++
++#endif /* DBUS_ENABLE_LAUNCHD */
++
++/**
++ * @brief Creates a new server from launchd.
++ *
++ * launchd has allocaed a socket for us. We now query launchd for the
++ * file descriptor of this socket and create a server on it.
++ * In addition we inherit launchd's environment which holds a variable
++ * containing the path to the socket. This is used to init the server's
++ * address which is passed to autolaunched services.
++ *
++ * @param launchd_env_var the environment variable which holds the unix path to the socket
++ * @param error location to store reason for failure.
++ * @returns the new server, or #NULL on failure.
++ */
++
++DBusServer*
++_dbus_server_new_for_launchd (const char *launchd_env_var,
++ DBusError *error)
++{
++#ifdef DBUS_ENABLE_LAUNCHD
++ DBusServer *server;
++ DBusString address;
++ int launchd_fd;
++ launch_data_t sockets_dict, checkin_response;
++ launch_data_t checkin_request;
++ launch_data_t listening_fd_array, listening_fd;
++ const char * launchd_socket_path = _dbus_getenv(launchd_env_var);
++
++ _DBUS_ASSERT_ERROR_IS_CLEAR (error);
++
++ if (*launchd_socket_path == '\0')
++ {
++ dbus_set_error (error, DBUS_ERROR_BAD_ADDRESS,
++ "launchd's environment variable %s is empty, but should contain a socket path");
++ return NULL;
++ }
++
++ if (!_dbus_string_init (&address))
++ {
++ dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
++ return NULL;
++ }
++ if (!_dbus_string_append (&address, "unix:path="))
++ {
++ dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
++ goto l_failed_0;
++ }
++ if (!_dbus_string_append (&address, launchd_socket_path))
++ {
++ dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
++ goto l_failed_0;
++ }
++
++ if ((checkin_request = launch_data_new_string (LAUNCH_KEY_CHECKIN)) == NULL)
++ {
++ dbus_set_error (error, DBUS_ERROR_NO_MEMORY,
++ "launch_data_new_string(\"%s\") Unable to create string.\n", LAUNCH_KEY_CHECKIN);
++ goto l_failed_0;
++ }
++
++ if ((checkin_response = launch_msg (checkin_request)) == NULL)
++ {
++ dbus_set_error (error, DBUS_ERROR_IO_ERROR, "launch_msg(\"%s\") IPC failure: %s\n",
++ LAUNCH_KEY_CHECKIN, strerror (errno));
++ goto l_failed_0;
++ }
++
++ if (LAUNCH_DATA_ERRNO == launch_data_get_type (checkin_response))
++ {
++ dbus_set_error (error, DBUS_ERROR_FAILED, "Check-in failed: %s\n",
++ strerror (launch_data_get_errno (checkin_response)));
++ goto l_failed_0;
++ }
++
++ sockets_dict = launch_data_dict_lookup (checkin_response, LAUNCH_JOBKEY_SOCKETS);
++ if (NULL == sockets_dict)
++ {
++ dbus_set_error (error, DBUS_ERROR_IO_ERROR, "No sockets found to answer requests on!\n");
++ goto l_failed_0;
++ }
++
++ listening_fd_array = launch_data_dict_lookup (sockets_dict, "unix_domain_listener");
++ if (NULL == listening_fd_array)
++ {
++ dbus_set_error (error, DBUS_ERROR_IO_ERROR, "No known sockets found to answer requests on!\n");
++ goto l_failed_0;
++ }
++
++ if (launch_data_array_get_count (listening_fd_array) != 1)
++ {
++ dbus_set_error (error, DBUS_ERROR_LIMITS_EXCEEDED,
++ "Expected 1 socket from launchd, got %d.\n",
++ launch_data_array_get_count (listening_fd_array));
++ goto l_failed_0;
++ }
++
++ listening_fd = launch_data_array_get_index (listening_fd_array, 0);
++ launchd_fd = launch_data_get_fd (listening_fd);
++
++ _dbus_fd_set_close_on_exec (launchd_fd);
++
++ if (launchd_fd < 0)
++ {
++ _DBUS_ASSERT_ERROR_IS_SET (error);
++ goto l_failed_0;
++ }
++
++ server = _dbus_server_new_for_socket (&launchd_fd, 1, &address);
++ if (server == NULL)
++ {
++ dbus_set_error (error, DBUS_ERROR_NO_SERVER, "Unable to listen on launchd fd %d.", launchd_fd);
++ goto l_failed_0;
++ }
++
++ _dbus_string_free (&address);
++
++ return server;
++
++ l_failed_0:
++ _dbus_string_free (&address);
++
++ return NULL;
++#else /* DBUS_ENABLE_LAUNCHD */
++ dbus_set_error(error, DBUS_ERROR_BAD_ADDRESS,
++ "address type 'launchd' requested, but launchd support not compiled in");
++ return NULL;
++#endif
++}
++
++/** @} */
++
+diff -Nurd dbus/dbus-server-launchd.h dbus-1.2.12-new/dbus/dbus-server-launchd.h
+--- dbus/dbus-server-launchd.h 1969-12-31 19:00:00.000000000 -0500
++++ dbus-1.2.12-new/dbus/dbus-server-launchd.h 2009-02-23 08:33:30.000000000 -0500
+@@ -0,0 +1,38 @@
++/* dbus-server-launchd.h Server methods for interacting with launchd.
++* Copyright (C) 2008, Benjamin Reed <rangerrick at befunk.com>
++*
++* Permission is hereby granted, free of charge, to any person
++* obtaining a copy of this software and associated documentation
++* files (the "Software"), to deal in the Software without
++* restriction, including without limitation the rights to use, copy,
++* modify, merge, publish, distribute, sublicense, and/or sell copies
++* of the Software, and to permit persons to whom the Software is
++* furnished to do so, subject to the following conditions:
++*
++* The above copyright notice and this permission notice shall be
++* included in all copies or substantial portions of the Software.
++*
++* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
++* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
++* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
++* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
++* DEALINGS IN THE SOFTWARE.
++*/
++
++#ifndef DBUS_SERVER_LAUNCHD_H
++#define DBUS_SERVER_LAUNCHD_H
++
++#include <dbus/dbus-internals.h>
++#include <dbus/dbus-server-protected.h>
++
++DBUS_BEGIN_DECLS
++
++DBusServer* _dbus_server_new_for_launchd (const char *launchd_env_var,
++ DBusError *error);
++
++DBUS_END_DECLS
++
++#endif /* DBUS_SERVER_LAUNCHD_H */
+diff -Nurd dbus/dbus-server-unix.c dbus-1.2.12-new/dbus/dbus-server-unix.c
+--- dbus/dbus-server-unix.c 2008-08-07 14:44:36.000000000 -0400
++++ dbus-1.2.12-new/dbus/dbus-server-unix.c 2009-02-23 08:33:55.000000000 -0500
+@@ -21,9 +21,11 @@
+ *
+ */
+
++#include <config.h>
+ #include "dbus-internals.h"
+ #include "dbus-server-unix.h"
+ #include "dbus-server-socket.h"
++#include "dbus-server-launchd.h"
+ #include "dbus-transport-unix.h"
+ #include "dbus-connection-internal.h"
+ #include "dbus-sysdeps-unix.h"
+@@ -145,6 +147,27 @@
+ return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
+ }
+ }
++ else if (strcmp (method, "launchd") == 0)
++ {
++ const char *launchd_env_var = dbus_address_entry_get_value (entry, "env");
++ if (launchd_env_var == NULL)
++ {
++ _dbus_set_bad_address (error, "launchd", "env", NULL);
++ return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
++ }
++ *server_p = _dbus_server_new_for_launchd (launchd_env_var, error);
++
++ if (*server_p != NULL)
++ {
++ _DBUS_ASSERT_ERROR_IS_CLEAR(error);
++ return DBUS_SERVER_LISTEN_OK;
++ }
++ else
++ {
++ _DBUS_ASSERT_ERROR_IS_SET(error);
++ return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
++ }
++ }
+ else
+ {
+ /* If we don't handle the method, we return NULL with the
+diff -Nurd dbus/dbus-sysdeps-unix.c dbus-1.2.12-new/dbus/dbus-sysdeps-unix.c
+--- dbus/dbus-sysdeps-unix.c 2009-01-06 17:38:11.000000000 -0500
++++ dbus-1.2.12-new/dbus/dbus-sysdeps-unix.c 2009-02-23 08:33:55.000000000 -0500
+@@ -1591,8 +1591,10 @@
+ gid_t *buf;
+ int buf_count;
+ int i;
+-
+- buf_count = 17;
++ int initial_buf_count;
++
++ initial_buf_count = 17;
++ buf_count = initial_buf_count;
+ buf = dbus_new (gid_t, buf_count);
+ if (buf == NULL)
+ {
+@@ -1604,7 +1606,29 @@
+ info->primary_gid,
+ buf, &buf_count) < 0)
+ {
+- gid_t *new = dbus_realloc (buf, buf_count * sizeof (buf[0]));
++ gid_t *new;
++ /* Presumed cause of negative return code: buf has insufficient
++ entries to hold the entire group list. The Linux behavior in this
++ case is to pass back the actual number of groups in buf_count, but
++ on Mac OS X 10.5, buf_count is unhelpfully left alone.
++ So as a hack, try to help out a bit by guessing a larger
++ number of groups, within reason.. might still fail, of course,
++ but we can at least print a more informative message. I looked up
++ the "right way" to do this by downloading Apple's own source code
++ for the "id" command, and it turns out that they use an
++ undocumented library function getgrouplist_2 (!) which is not
++ declared in any header in /usr/include (!!). That did not seem
++ like the way to go here.
++
++ I also demoted this problem to a warning as long as errno is 0,
++ since as far as I could tell from discussion on the web, dbus works
++ fine even when HAVE_GETGROUPLIST is false and it can only know about
++ the primary group.
++ */
++ if (buf_count == initial_buf_count) {
++ buf_count *= 16; /* Retry with an arbitrarily scaled-up array */
++ }
++ new = dbus_realloc (buf, buf_count * sizeof (buf[0]));
+ if (new == NULL)
+ {
+ dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
+@@ -1617,14 +1641,19 @@
+ errno = 0;
+ if (getgrouplist (username_c, info->primary_gid, buf, &buf_count) < 0)
+ {
+- dbus_set_error (error,
+- _dbus_error_from_errno (errno),
+- "Failed to get groups for username \"%s\" primary GID "
+- DBUS_GID_FORMAT ": %s\n",
+- username_c, info->primary_gid,
+- _dbus_strerror (errno));
+- dbus_free (buf);
+- goto failed;
++ if (errno == 0) {
++ _dbus_warn("It appears that username \"%s\" is in more than %d groups.\nProceeding with just the first %d groups.",
++ username_c, buf_count, buf_count);
++ } else {
++ dbus_set_error (error,
++ _dbus_error_from_errno (errno),
++ "Failed to get groups for username \"%s\" primary GID "
++ DBUS_GID_FORMAT ": %s\n",
++ username_c, info->primary_gid,
++ _dbus_strerror (errno));
++ dbus_free (buf);
++ goto failed;
++ }
+ }
+ }
+
+@@ -2835,23 +2864,30 @@
+ }
+
+ /**
+- * Determines the address of the session bus by querying a
+- * platform-specific method.
++ * Execute a subprocess, returning up to 1024 bytes of output
++ * into @p result.
+ *
+- * If successful, returns #TRUE and appends the address to @p
+- * address. If a failure happens, returns #FALSE and
++ * If successful, returns #TRUE and appends the output to @p
++ * result. If a failure happens, returns #FALSE and
+ * sets an error in @p error.
+ *
+- * @param address a DBusString where the address can be stored
++ * @note It's not an error if the subprocess terminates normally
++ * without writing any data to stdout. Verify the @p result length
++ * before and after this function call to cover this case.
++ *
++ * @param progname initial path to exec
++ * @param argv NULL-terminated list of arguments
++ * @param result a DBusString where the output can be append
+ * @param error a DBusError to store the error in case of failure
+ * @returns #TRUE on success, #FALSE if an error happened
+ */
+-dbus_bool_t
+-_dbus_get_autolaunch_address (DBusString *address,
+- DBusError *error)
++static dbus_bool_t
++_read_subprocess_line_argv (const char *progpath,
++ char * const *argv,
++ DBusString *result,
++ DBusError *error)
+ {
+- static char *argv[6];
+- int address_pipe[2] = { -1, -1 };
++ int result_pipe[2] = { -1, -1 };
+ int errors_pipe[2] = { -1, -1 };
+ pid_t pid;
+ int ret;
+@@ -2870,48 +2906,26 @@
+ return FALSE;
+ }
+
+- if (!_dbus_get_local_machine_uuid_encoded (&uuid))
+- {
+- _DBUS_SET_OOM (error);
+- goto out;
+- }
+-
+- i = 0;
+- argv[i] = "dbus-launch";
+- ++i;
+- argv[i] = "--autolaunch";
+- ++i;
+- argv[i] = _dbus_string_get_data (&uuid);
+- ++i;
+- argv[i] = "--binary-syntax";
+- ++i;
+- argv[i] = "--close-stderr";
+- ++i;
+- argv[i] = NULL;
+- ++i;
+-
+- _dbus_assert (i == _DBUS_N_ELEMENTS (argv));
+-
+- orig_len = _dbus_string_get_length (address);
++ orig_len = _dbus_string_get_length (result);
+
+ #define READ_END 0
+ #define WRITE_END 1
+- if (pipe (address_pipe) < 0)
++ if (pipe (result_pipe) < 0)
+ {
+ dbus_set_error (error, _dbus_error_from_errno (errno),
+- "Failed to create a pipe: %s",
+- _dbus_strerror (errno));
+- _dbus_verbose ("Failed to create a pipe to call dbus-launch: %s\n",
+- _dbus_strerror (errno));
++ "Failed to create a pipe to call %s: %s",
++ progpath, _dbus_strerror (errno));
++ _dbus_verbose ("Failed to create a pipe to call %s: %s\n",
++ progpath, _dbus_strerror (errno));
+ goto out;
+ }
+ if (pipe (errors_pipe) < 0)
+ {
+ dbus_set_error (error, _dbus_error_from_errno (errno),
+- "Failed to create a pipe: %s",
+- _dbus_strerror (errno));
+- _dbus_verbose ("Failed to create a pipe to call dbus-launch: %s\n",
+- _dbus_strerror (errno));
++ "Failed to create a pipe to call %s: %s",
++ progpath, _dbus_strerror (errno));
++ _dbus_verbose ("Failed to create a pipe to call %s: %s\n",
++ progpath, _dbus_strerror (errno));
+ goto out;
+ }
+
+@@ -2919,10 +2933,10 @@
+ if (pid < 0)
+ {
+ dbus_set_error (error, _dbus_error_from_errno (errno),
+- "Failed to fork(): %s",
+- _dbus_strerror (errno));
+- _dbus_verbose ("Failed to fork() to call dbus-launch: %s\n",
+- _dbus_strerror (errno));
++ "Failed to fork() to call %s: %s",
++ progpath, _dbus_strerror (errno));
++ _dbus_verbose ("Failed to fork() to call %s: %s\n",
++ progpath, _dbus_strerror (errno));
+ goto out;
+ }
+
+@@ -2940,7 +2954,7 @@
+ _dbus_verbose ("/dev/null fd %d opened\n", fd);
+
+ /* set-up stdXXX */
+- close (address_pipe[READ_END]);
++ close (result_pipe[READ_END]);
+ close (errors_pipe[READ_END]);
+ close (0); /* close stdin */
+ close (1); /* close stdout */
+@@ -2948,7 +2962,7 @@
+
+ if (dup2 (fd, 0) == -1)
+ _exit (1);
+- if (dup2 (address_pipe[WRITE_END], 1) == -1)
++ if (dup2 (result_pipe[WRITE_END], 1) == -1)
+ _exit (1);
+ if (dup2 (errors_pipe[WRITE_END], 2) == -1)
+ _exit (1);
+@@ -2963,25 +2977,26 @@
+ for (i = 3; i < maxfds; i++)
+ close (i);
+
+- execv (DBUS_BINDIR "/dbus-launch", argv);
+-
+- /* failed, try searching PATH */
+- execvp ("dbus-launch", argv);
++ /* If it looks fully-qualified, try execv first */
++ if (progpath[0] == '/')
++ execv (progpath, argv);
++ else
++ execvp (progpath, argv);
+
+ /* still nothing, we failed */
+ _exit (1);
+ }
+
+ /* parent process */
+- close (address_pipe[WRITE_END]);
++ close (result_pipe[WRITE_END]);
+ close (errors_pipe[WRITE_END]);
+- address_pipe[WRITE_END] = -1;
++ result_pipe[WRITE_END] = -1;
+ errors_pipe[WRITE_END] = -1;
+
+ ret = 0;
+ do
+ {
+- ret = _dbus_read (address_pipe[READ_END], address, 1024);
++ ret = _dbus_read (result_pipe[READ_END], result, 1024);
+ }
+ while (ret > 0);
+
+@@ -2994,27 +3009,27 @@
+
+ /* We succeeded if the process exited with status 0 and
+ anything was read */
+- if (!WIFEXITED (status) || WEXITSTATUS (status) != 0 ||
+- _dbus_string_get_length (address) == orig_len)
++ if (!WIFEXITED (status) || WEXITSTATUS (status) != 0 )
+ {
+ /* The process ended with error */
+ DBusString error_message;
+ _dbus_string_init (&error_message);
+ ret = 0;
+ do
+- {
+- ret = _dbus_read (errors_pipe[READ_END], &error_message, 1024);
+- }
++ {
++ ret = _dbus_read (errors_pipe[READ_END], &error_message, 1024);
++ }
+ while (ret > 0);
+
+- _dbus_string_set_length (address, orig_len);
++ _dbus_string_set_length (result, orig_len);
+ if (_dbus_string_get_length (&error_message) > 0)
+- dbus_set_error (error, DBUS_ERROR_SPAWN_EXEC_FAILED,
+- "dbus-launch failed to autolaunch D-Bus session: %s",
+- _dbus_string_get_data (&error_message));
++ dbus_set_error (error, DBUS_ERROR_SPAWN_EXEC_FAILED,
++ "%s terminated abnormally with the following error: %s",
++ progpath, _dbus_string_get_data (&error_message));
+ else
+- dbus_set_error (error, DBUS_ERROR_SPAWN_EXEC_FAILED,
+- "Failed to execute dbus-launch to autolaunch D-Bus session");
++ dbus_set_error (error, DBUS_ERROR_SPAWN_EXEC_FAILED,
++ "%s terminated abnormally without any error message",
++ progpath);
+ goto out;
+ }
+
+@@ -3026,20 +3041,202 @@
+ else
+ _DBUS_ASSERT_ERROR_IS_SET (error);
+
+- if (address_pipe[0] != -1)
+- close (address_pipe[0]);
+- if (address_pipe[1] != -1)
+- close (address_pipe[1]);
++ if (result_pipe[0] != -1)
++ close (result_pipe[0]);
++ if (result_pipe[1] != -1)
++ close (result_pipe[1]);
+ if (errors_pipe[0] != -1)
+ close (errors_pipe[0]);
+ if (errors_pipe[1] != -1)
+ close (errors_pipe[1]);
+
++ return retval;
++}
++
++/**
++ * Returns the address of a new session bus.
++ *
++ * If successful, returns #TRUE and appends the address to @p
++ * address. If a failure happens, returns #FALSE and
++ * sets an error in @p error.
++ *
++ * @param address a DBusString where the address can be stored
++ * @param error a DBusError to store the error in case of failure
++ * @returns #TRUE on success, #FALSE if an error happened
++ */
++dbus_bool_t
++_dbus_get_autolaunch_address (DBusString *address,
++ DBusError *error)
++{
++ static char *argv[6];
++ int i;
++ DBusString uuid;
++ dbus_bool_t retval;
++
++ _DBUS_ASSERT_ERROR_IS_CLEAR (error);
++ retval = FALSE;
++
++ if (!_dbus_string_init (&uuid))
++ {
++ _DBUS_SET_OOM (error);
++ return FALSE;
++ }
++
++ if (!_dbus_get_local_machine_uuid_encoded (&uuid))
++ {
++ _DBUS_SET_OOM (error);
++ goto out;
++ }
++
++ i = 0;
++ argv[i] = "dbus-launch";
++ ++i;
++ argv[i] = "--autolaunch";
++ ++i;
++ argv[i] = _dbus_string_get_data (&uuid);
++ ++i;
++ argv[i] = "--binary-syntax";
++ ++i;
++ argv[i] = "--close-stderr";
++ ++i;
++ argv[i] = NULL;
++ ++i;
++
++ _dbus_assert (i == _DBUS_N_ELEMENTS (argv));
++
++ retval = _read_subprocess_line_argv (DBUS_BINDIR "/dbus-launch",
++ argv, address, error);
++
++ out:
+ _dbus_string_free (&uuid);
+ return retval;
+ }
+
+ /**
++ * quries launchd for a specific env var which holds the socket path.
++ * @param launchd_env_var the env var to look up
++ * @param error a DBusError to store the error in case of failure
++ * @return the value of the env var
++ */
++const char *
++_dbus_lookup_launchd_socket (const char *launchd_env_var,
++ DBusError *error)
++{
++#ifdef DBUS_ENABLE_LAUNCHD
++ char *argv[4];
++ int i;
++ DBusString socket_path;
++
++ _DBUS_ASSERT_ERROR_IS_CLEAR (error);
++
++ if (!_dbus_string_init (&socket_path))
++ {
++ _DBUS_SET_OOM (error);
++ return FALSE;
++ }
++
++ i = 0;
++ argv[i] = "launchctl";
++ ++i;
++ argv[i] = "getenv";
++ ++i;
++ argv[i] = (char*)launchd_env_var;
++ ++i;
++ argv[i] = NULL;
++ ++i;
++
++ _dbus_assert (i == _DBUS_N_ELEMENTS (argv));
++
++ if (!_read_subprocess_line_argv(argv[0], argv, &socket_path, error))
++ {
++ _dbus_string_free(&socket_path);
++ return NULL;
++ }
++
++ /* no error, but no result either */
++ if (_dbus_string_get_length(&socket_path) == 0)
++ {
++ _dbus_string_free(&socket_path);
++ return NULL;
++ }
++
++ /* strip the carriage-return */
++ _dbus_string_shorten(&socket_path, 1);
++ return _dbus_string_get_const_data(&socket_path);
++#else /* DBUS_ENABLE_LAUNCHD */
++ dbus_set_error(error, DBUS_ERROR_NOT_SUPPORTED,
++ "can't lookup socket from launchd; launchd support not compiled in");
++ return NULL;
++#endif
++}
++
++static dbus_bool_t
++_dbus_lookup_session_address_launchd (DBusString *address,
++ DBusError *error)
++{
++ const char *launchd_socket = _dbus_lookup_launchd_socket ("DBUS_LAUNCHD_SESSION_BUS_SOCKET",
++ error);
++ if (dbus_error_is_set(error))
++ return FALSE;
++ if (launchd_socket == NULL)
++ {
++ dbus_set_error(error, "no socket path",
++ "launchd did not provide a socket path, "
++ "verify that org.freedesktop.dbus-session.plist is loaded!");
++ return FALSE;
++ }
++ if (!_dbus_string_append (address, "unix:path="))
++ {
++ _DBUS_SET_OOM (error);
++ return FALSE;
++ }
++ if (!_dbus_string_append (address, launchd_socket))
++ {
++ _DBUS_SET_OOM (error);
++ return FALSE;
++ }
++
++ return TRUE;
++}
++
++/**
++ * Determines the address of the session bus by querying a
++ * platform-specific method.
++ *
++ * The first parameter will be a boolean specifying whether
++ * or not a dynamic session lookup is supported on this platform.
++ *
++ * If supported is TRUE and the return value is #TRUE, the
++ * address will be appended to @p address.
++ * If a failure happens, returns #FALSE and sets an error in
++ * @p error.
++ *
++ * If supported is FALSE, ignore the return value.
++ *
++ * @param supported returns whether this method is supported
++ * @param address a DBusString where the address can be stored
++ * @param error a DBusError to store the error in case of failure
++ * @returns #TRUE on success, #FALSE if an error happened
++ */
++dbus_bool_t
++_dbus_lookup_session_address (dbus_bool_t *supported,
++ DBusString *address,
++ DBusError *error)
++{
++#ifdef DBUS_ENABLE_LAUNCHD
++ *supported = TRUE;
++ return _dbus_lookup_session_address_launchd (address, error);
++#else
++ /* On non-Mac Unix platforms, if the session address isn't already
++ * set in DBUS_SESSION_BUS_ADDRESS environment variable, we punt and
++ * fall back to the autolaunch: global default; see
++ * init_session_address in dbus/dbus-bus.c. */
++ *supported = FALSE;
++ return TRUE;
++#endif
++}
++
++/**
+ * Reads the uuid of the machine we're running on from
+ * the dbus configuration. Optionally try to create it
+ * (only root can do this usually).
+diff -Nurd dbus/dbus-sysdeps-unix.h dbus-1.2.12-new/dbus/dbus-sysdeps-unix.h
+--- dbus/dbus-sysdeps-unix.h 2008-12-17 15:58:11.000000000 -0500
++++ dbus-1.2.12-new/dbus/dbus-sysdeps-unix.h 2009-02-23 08:33:30.000000000 -0500
+@@ -77,6 +77,9 @@
+ dbus_bool_t _dbus_send_credentials (int server_fd,
+ DBusError *error);
+
++const char *_dbus_lookup_launchd_socket (const char *launchd_env_var,
++ DBusError *error);
++
+ /** Information about a UNIX user */
+ typedef struct DBusUserInfo DBusUserInfo;
+ /** Information about a UNIX group */
+diff -Nurd dbus/dbus-sysdeps.h dbus-1.2.12-new/dbus/dbus-sysdeps.h
+--- dbus/dbus-sysdeps.h 2009-01-06 17:52:23.000000000 -0500
++++ dbus-1.2.12-new/dbus/dbus-sysdeps.h 2009-02-23 08:33:30.000000000 -0500
+@@ -468,6 +468,10 @@
+ dbus_bool_t _dbus_get_autolaunch_address (DBusString *address,
+ DBusError *error);
+
++dbus_bool_t _dbus_lookup_session_address (dbus_bool_t *supported,
++ DBusString *address,
++ DBusError *error);
++
+ /** Type representing a universally unique ID
+ * @todo rename to UUID instead of GUID
+ */
+diff -Nurd dbus/dbus-transport-unix.c dbus-1.2.12-new/dbus/dbus-transport-unix.c
+--- dbus/dbus-transport-unix.c 2008-08-07 14:44:36.000000000 -0400
++++ dbus-1.2.12-new/dbus/dbus-transport-unix.c 2009-02-23 08:34:52.000000000 -0500
+@@ -171,6 +171,41 @@
+ return DBUS_TRANSPORT_OPEN_OK;
+ }
+ }
++ else if (strcmp (method, "launchd") == 0)
++ {
++ const char *launchd_env_var = dbus_address_entry_get_value (entry, "env");
++ DBusError tmp_error = DBUS_ERROR_INIT;
++ if (launchd_env_var == NULL)
++ {
++ _dbus_set_bad_address (error, "launchd", "env", NULL);
++ return DBUS_TRANSPORT_OPEN_BAD_ADDRESS;
++ }
++
++ const char *launchd_socket = _dbus_lookup_launchd_socket (launchd_env_var, error);
++ if (launchd_socket)
++ {
++ *transport_p = _dbus_transport_new_for_domain_socket (launchd_socket, FALSE,
++ error);
++ }
++ else
++ {
++ dbus_set_error(&tmp_error, DBUS_ERROR_BAD_ADDRESS,
++ "launchd's env var %s does not exist", launchd_env_var);
++ dbus_error_free(error);
++ dbus_move_error(&tmp_error, error);
++ }
++
++ if (*transport_p == NULL)
++ {
++ _DBUS_ASSERT_ERROR_IS_SET (error);
++ return DBUS_TRANSPORT_OPEN_DID_NOT_CONNECT;
++ }
++ else
++ {
++ _DBUS_ASSERT_ERROR_IS_CLEAR (error);
++ return DBUS_TRANSPORT_OPEN_OK;
++ }
++ }
+ else
+ {
+ _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090406/3a7f3a7f/attachment-0001.html>
More information about the macports-changes
mailing list