From 1667d9d110401b60c13b7d52834f61c93d5c0f25 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 4 Jan 2012 19:29:10 +0000 Subject: [PATCH 1/3] Don't use DBUS_SESSION_BUS_DEFAULT_ADDRESS on the client side Instead, hard-code "autolaunch:" because that's always what we want to fall back to anyway. Some background for this: Under autotools, this was never defined by the build system, only by dbus-internals.h, so this is not a change in behaviour. Under cmake, it was previously defined by the build system. However, its value on Unix was meaningless (it turns out to be an address that can neither be listened on nor connected to, because it typically consists of unix:path=/tmp) so there is no loss of functionality there. Its value on Windows under cmake was recently changed from "nonce-tcp:" to "autolaunch:", but what we actually seem to want is to listen on "nonce-tcp:", but fall back to "autolaunch:" if no address is available. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38201 --- cmake/config.h.cmake | 1 - dbus/dbus-bus.c | 10 +++++----- dbus/dbus-internals.h | 4 ---- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/cmake/config.h.cmake b/cmake/config.h.cmake index 6221c19..885e378 100644 --- a/cmake/config.h.cmake +++ b/cmake/config.h.cmake @@ -16,7 +16,6 @@ #cmakedefine DBUS_DAEMON_NAME "@DBUS_DAEMON_NAME@" #cmakedefine DBUS_SYSTEM_BUS_DEFAULT_ADDRESS "@DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@" #cmakedefine DBUS_MACHINE_UUID_FILE "@DBUS_MACHINE_UUID_FILE@" -#cmakedefine DBUS_SESSION_BUS_DEFAULT_ADDRESS "@DBUS_SESSION_BUS_DEFAULT_ADDRESS@" #cmakedefine DBUS_DAEMONDIR "@DBUS_DAEMONDIR@" #cmakedefine PACKAGE "@PACKAGE@" /* Version number of package */ diff --git a/dbus/dbus-bus.c b/dbus/dbus-bus.c index f05ddea..120fa5c 100644 --- a/dbus/dbus-bus.c +++ b/dbus/dbus-bus.c @@ -192,12 +192,12 @@ init_session_address (void) if (!retval) return FALSE; - /* The DBUS_SESSION_BUS_DEFAULT_ADDRESS should have really been named - * DBUS_SESSION_BUS_FALLBACK_ADDRESS. - */ + /* If we don't have anything better, we could try using autolaunch? + * This was previously a #define, but there's no point in making it + * configurable, since everything should always fall back to this. */ if (bus_connection_addresses[DBUS_BUS_SESSION] == NULL) - bus_connection_addresses[DBUS_BUS_SESSION] = - _dbus_strdup (DBUS_SESSION_BUS_DEFAULT_ADDRESS); + bus_connection_addresses[DBUS_BUS_SESSION] = _dbus_strdup ("autolaunch:"); + if (bus_connection_addresses[DBUS_BUS_SESSION] == NULL) return FALSE; diff --git a/dbus/dbus-internals.h b/dbus/dbus-internals.h index 4e383bc..d3f684c 100644 --- a/dbus/dbus-internals.h +++ b/dbus/dbus-internals.h @@ -35,10 +35,6 @@ DBUS_BEGIN_DECLS -#ifndef DBUS_SESSION_BUS_DEFAULT_ADDRESS -#define DBUS_SESSION_BUS_DEFAULT_ADDRESS "autolaunch:" -#endif - void _dbus_warn (const char *format, ...) _DBUS_GNUC_PRINTF (1, 2); -- 1.7.8.2