diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-08-13 20:12:59 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-08-13 20:12:59 +0100 |
commit | 627cdde0ebe00678a71e0bf3f21aedcbd4c7a940 (patch) | |
tree | f49bfef3f3bcda7d573e70ad704a8d7b66372ff8 | |
parent | b5d36dc27d1905d4d46ad7f0097f0ea0e0776adb (diff) | |
download | dbus-627cdde0ebe00678a71e0bf3f21aedcbd4c7a940.tar.gz dbus-627cdde0ebe00678a71e0bf3f21aedcbd4c7a940.tar.bz2 dbus-627cdde0ebe00678a71e0bf3f21aedcbd4c7a940.zip |
Revert "Split DBUS_SESSION_BUS_DEFAULT_ADDRESS into listen, connect addresses and set better defaults"
This reverts commit b5d36dc27d1905d4d46ad7f0097f0ea0e0776adb.
On second thoughts, this is too big a change for a stable branch.
-rw-r--r-- | README.cmake | 7 | ||||
-rw-r--r-- | bus/session.conf.in | 2 | ||||
-rw-r--r-- | cmake/CMakeLists.txt | 9 | ||||
-rw-r--r-- | cmake/config.h.cmake | 2 | ||||
-rw-r--r-- | cmake/dbus-env.bat.cmake | 4 | ||||
-rw-r--r-- | configure.ac | 64 | ||||
-rw-r--r-- | dbus/dbus-bus.c | 8 | ||||
-rw-r--r-- | dbus/dbus-internals.h | 4 |
8 files changed, 24 insertions, 76 deletions
diff --git a/README.cmake b/README.cmake index 0c30ba66..0e923356 100644 --- a/README.cmake +++ b/README.cmake @@ -129,11 +129,8 @@ DBUS_HAVE_ATOMIC_INT:BOOL=OFF // install required system libraries DBUS_INSTALL_SYSTEM_LIBS:BOOL=OFF -// session bus default listening address -DBUS_SESSION_BUS_LISTEN_ADDRESS:STRING=autolaunch: - -// session bus fallback address for clients -DBUS_SESSION_BUS_CONNECT_ADDRESS:STRING=autolaunch: +// session bus default address +DBUS_SESSION_BUS_DEFAULT_ADDRESS:STRING=nonce-tcp: // system bus default address (only useful on Unix) DBUS_SYSTEM_BUS_DEFAULT_ADDRESS:STRING=unix:path=/var/run/dbus/system_bus_socket diff --git a/bus/session.conf.in b/bus/session.conf.in index 716b5e79..e121ff93 100644 --- a/bus/session.conf.in +++ b/bus/session.conf.in @@ -12,7 +12,7 @@ the behavior of child processes. --> <keep_umask/> - <listen>@DBUS_SESSION_BUS_LISTEN_ADDRESS@</listen> + <listen>@DBUS_SESSION_BUS_DEFAULT_ADDRESS@</listen> <standard_session_servicedirs /> diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 52a48fdc..5174469d 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -442,16 +442,14 @@ set (DBUS_USER ) set (DBUS_SYSTEM_BUS_DEFAULT_ADDRESS "unix:path=${EXPANDED_LOCALSTATEDIR}/run/dbus/system_bus_socket" CACHE STRING "system bus default address") if (WIN32) - set (DBUS_SESSION_BUS_LISTEN_ADDRESS "autolaunch:" CACHE STRING "session bus default listening address") - set (DBUS_SESSION_BUS_CONNECT_ADDRESS "autolaunch:" CACHE STRING "session bus fallback address for clients") + set (DBUS_SESSION_BUS_DEFAULT_ADDRESS "nonce-tcp:" CACHE STRING "session bus default address") set (DBUS_SYSTEM_CONFIG_FILE "etc/dbus-1/system.conf") set (DBUS_SESSION_CONFIG_FILE "etc/dbus-1/session.conf") # bus-test expects a non empty string set (DBUS_USER "Administrator") else (WIN32) - set (DBUS_SESSION_BUS_LISTEN_ADDRESS "unix:tmpdir=${DBUS_SESSION_SOCKET_DIR}" CACHE STRING "session bus default listening address") - set (DBUS_SESSION_BUS_CONNECT_ADDRESS "autolaunch:" CACHE STRING "session bus fallback address for clients") + set (DBUS_SESSION_BUS_DEFAULT_ADDRESS "unix:path=${DBUS_SESSION_SOCKET_DIR}" CACHE STRING "session bus default address") set (sysconfdir "") set (configdir ${sysconfdir}/dbus-1 ) set (DBUS_SYSTEM_CONFIG_FILE ${configdir}/system.conf) @@ -571,8 +569,7 @@ message(" Using XML parser: ${XML_LIB} " message(" Daemon executable name: ${DBUS_DAEMON_NAME}") if (WIN32) message(" System bus address: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS} ") -message(" Session bus listens on: ${DBUS_SESSION_BUS_LISTEN_ADDRESS} ") -message(" Session clients connect to: ${DBUS_SESSION_BUS_CONNECT_ADDRESS} ") +message(" Session bus address: ${DBUS_SESSION_BUS_DEFAULT_ADDRESS} ") else (WIN32) #message(" Init scripts style: ${with_init_scripts} ") #message(" Abstract socket names: ${have_abstract_sockets} ") diff --git a/cmake/config.h.cmake b/cmake/config.h.cmake index 76ccb866..6221c190 100644 --- a/cmake/config.h.cmake +++ b/cmake/config.h.cmake @@ -15,8 +15,8 @@ #cmakedefine DBUS_SESSION_CONFIG_FILE "@DBUS_SESSION_CONFIG_FILE@" #cmakedefine DBUS_DAEMON_NAME "@DBUS_DAEMON_NAME@" #cmakedefine DBUS_SYSTEM_BUS_DEFAULT_ADDRESS "@DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@" -#cmakedefine DBUS_SESSION_BUS_CONNECT_ADDRESS "@DBUS_SESSION_BUS_CONNECT_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/cmake/dbus-env.bat.cmake b/cmake/dbus-env.bat.cmake index d859ce03..85f70051 100644 --- a/cmake/dbus-env.bat.cmake +++ b/cmake/dbus-env.bat.cmake @@ -2,7 +2,7 @@ @echo off :: session bus address -set DBUS_SESSION_BUS_ADDRESS=@DBUS_SESSION_BUS_CONNECT_ADDRESS@ +set DBUS_SESSION_BUS_ADDRESS=@DBUS_SESSION_BUS_DEFAULT_ADDRESS@ :: system bus address -set DBUS_SYSTEM_BUS_DEFAULT_ADDRESS=@DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@ +set DBUS_SYSTEM_BUS_DEFAULT_ADDRESS=@DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@
\ No newline at end of file diff --git a/configure.ac b/configure.ac index b54d29d8..12847c4a 100644 --- a/configure.ac +++ b/configure.ac @@ -169,6 +169,7 @@ AC_ARG_WITH(console-owner-file, AS_HELP_STRING([--with-console-owner-file=[filen 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])) +AC_ARG_WITH(dbus_session_bus_default_address, AS_HELP_STRING([--with-dbus-session-bus-default-address=[nonce-tcp:/autolaunch:/tcp:host:port]],[Transport Type to be used (default: nonce-tcp:)]),with_dbus_session_bus_default_address=$withval,with_dbus_session_bus_default_address=nonce-tcp:) AC_ARG_ENABLE([embedded-tests], AS_HELP_STRING([--enable-embedded-tests], @@ -1674,64 +1675,14 @@ fi AC_DEFINE_UNQUOTED(DBUS_SESSION_SOCKET_DIR, "$DBUS_SESSION_SOCKET_DIR", [Where per-session bus puts its sockets]) AC_SUBST(DBUS_SESSION_SOCKET_DIR) -# This must be a listening address. It doesn't necessarily need to be an -# address you can connect to - it can be something vague like -# "nonce-tcp:". -# -# The default varies by platform. -AC_ARG_WITH([dbus_session_bus_listen_address], - AS_HELP_STRING([--with-dbus-session-bus-listen-address=[ADDRESS]], - [default address for a session bus to listen on (see configure.ac)]), - [with_dbus_session_bus_listen_address=$withval], - [with_dbus_session_bus_listen_address=]) - -if test "x$with_dbus_session_bus_listen_address" != "x"; then - # the user specified something, trust them - DBUS_SESSION_BUS_LISTEN_ADDRESS="$with_dbus_session_bus_listen_address" -elif test x$dbus_win = xyes; then - # On Windows, you can (and should) listen on autolaunch addresses, - # because autolaunching is different. - # See https://bugs.freedesktop.org/show_bug.cgi?id=38201 - DBUS_SESSION_BUS_LISTEN_ADDRESS="autolaunch:" +if test x$dbus_win = xyes; then + DBUS_SESSION_BUS_DEFAULT_ADDRESS="$with_dbus_session_bus_default_address" elif test x$have_launchd = xyes; then - # Mac OS X default is to use launchd - DBUS_SESSION_BUS_LISTEN_ADDRESS="launchd:env=DBUS_LAUNCHD_SESSION_BUS_SOCKET" -else - # The default on all other Unix platforms (notably Linux) - # is to create a randomly named socket in /tmp or similar - DBUS_SESSION_BUS_LISTEN_ADDRESS="unix:tmpdir=$DBUS_SESSION_SOCKET_DIR" -fi -AC_SUBST([DBUS_SESSION_BUS_LISTEN_ADDRESS]) - -# This must be an address you can connect to. It doesn't necessarily -# need to be an address you can listen on - it can be "autolaunch:", -# even on Unix. -# -# The default varies by platform. -AC_ARG_WITH([dbus_session_bus_connect_address], - AS_HELP_STRING([--with-dbus-session-bus-connect-address=[ADDRESS]], - [fallback address for a session bus client to connect to (see configure.ac)]), - [with_dbus_session_bus_connect_address=$withval], - [with_dbus_session_bus_connect_address=]) - -if test "x$with_dbus_session_bus_connect_address" != "x"; then - # the user specified something, trust them - DBUS_SESSION_BUS_CONNECT_ADDRESS="$with_dbus_session_bus_connect_address" -elif test x$dbus_win = xyes; then - # Windows autolaunching is a bit different; leaving it in its own - # branch of the conditional because the default might conceivably - # change (see #38201) - DBUS_SESSION_BUS_CONNECT_ADDRESS="autolaunch:" + DBUS_SESSION_BUS_DEFAULT_ADDRESS="launchd:env=DBUS_LAUNCHD_SESSION_BUS_SOCKET" else - # The default on all other Unix platforms (notably Linux) - # is to use auto-launching - this works a bit differently on Mac OS X - # but comes out basically the same in the end - DBUS_SESSION_BUS_CONNECT_ADDRESS="autolaunch:" + DBUS_SESSION_BUS_DEFAULT_ADDRESS="unix:tmpdir=$DBUS_SESSION_SOCKET_DIR" fi -AC_SUBST([DBUS_SESSION_BUS_CONNECT_ADDRESS]) -AC_DEFINE_UNQUOTED([DBUS_SESSION_BUS_CONNECT_ADDRESS], - ["$DBUS_SESSION_BUS_CONNECT_ADDRESS"], - [Fallback address for session bus clients]) +AC_SUBST(DBUS_SESSION_BUS_DEFAULT_ADDRESS) # darwin needs this to initialize the environment AC_CHECK_HEADERS(crt_externs.h) @@ -1847,8 +1798,7 @@ echo " System bus socket: ${DBUS_SYSTEM_SOCKET} System bus address: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS} System bus PID file: ${DBUS_SYSTEM_PID_FILE} - Session bus listens on: ${DBUS_SESSION_BUS_LISTEN_ADDRESS} - Session clients connect to: ${DBUS_SESSION_BUS_CONNECT_ADDRESS} + Session bus address: ${DBUS_SESSION_BUS_DEFAULT_ADDRESS} Console auth dir: ${DBUS_CONSOLE_AUTH_DIR} Console owner file: ${have_console_owner_file} Console owner file path: ${DBUS_CONSOLE_OWNER_FILE} diff --git a/dbus/dbus-bus.c b/dbus/dbus-bus.c index 6f81c74a..fadc3a8b 100644 --- a/dbus/dbus-bus.c +++ b/dbus/dbus-bus.c @@ -192,12 +192,12 @@ init_session_address (void) if (!retval) return FALSE; - /* We have a hard-coded (but compile-time-configurable) fallback address for - * the session bus. */ + /* 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_CONNECT_ADDRESS); - + _dbus_strdup (DBUS_SESSION_BUS_DEFAULT_ADDRESS); if (bus_connection_addresses[DBUS_BUS_SESSION] == NULL) return FALSE; diff --git a/dbus/dbus-internals.h b/dbus/dbus-internals.h index 80376ad5..8036a2ba 100644 --- a/dbus/dbus-internals.h +++ b/dbus/dbus-internals.h @@ -35,6 +35,10 @@ 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); |