summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2011-06-10 22:09:21 +0100
committerSimon McVittie <smcv@debian.org>2011-06-10 22:09:21 +0100
commitfbe6c26af93591f53d7439c810213d846d844d95 (patch)
treeacb9c08bf41e3c9608a67f90fc101c01c9c53410
parente034e2bbd4352a21b7f5bf9d4d89f7a41c78cb03 (diff)
downloaddbus-fbe6c26af93591f53d7439c810213d846d844d95.tar.gz
Imported Upstream version 1.4.12upstream/1.4.12
-rw-r--r--AUTHORS3
-rw-r--r--Makefile.in5
-rw-r--r--NEWS43
-rw-r--r--bus/Makefile.am20
-rw-r--r--bus/Makefile.in25
-rw-r--r--cmake/CMakeLists.txt2
-rw-r--r--config.h.in11
-rwxr-xr-xconfigure489
-rw-r--r--configure.ac114
-rw-r--r--dbus/Makefile.in5
-rw-r--r--dbus/dbus-connection.c97
-rw-r--r--dbus/dbus-marshal-header.c6
-rw-r--r--dbus/dbus-message.c2
-rw-r--r--dbus/dbus-pending-call.c26
-rw-r--r--dbus/dbus-pending-call.h3
-rw-r--r--doc/Makefile.in5
-rw-r--r--doc/dbus-faq.html48
-rw-r--r--doc/dbus-specification.html32
-rw-r--r--doc/dbus-test-plan.html4
-rw-r--r--test/Makefile.am87
-rw-r--r--test/Makefile.in334
-rw-r--r--test/corrupt.c362
-rw-r--r--test/dbus-daemon.c326
-rwxr-xr-xtest/dbus-test-runner43
-rw-r--r--test/loopback.c211
-rw-r--r--test/marshal.c258
-rw-r--r--test/name-test/Makefile.in5
-rw-r--r--test/relay.c318
-rw-r--r--tools/Makefile.in5
-rwxr-xr-xtools/run-with-tmp-session-bus.sh2
30 files changed, 2590 insertions, 301 deletions
diff --git a/AUTHORS b/AUTHORS
index 4a7cbef4..cdcfb702 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -62,6 +62,7 @@ Luiz Augusto Von Dentz <luiz.dentz-von@nokia.com>
Marc Brockschmidt <he@debian.org>
Marc Mutz <marc@kdab.net>
Marcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>
+Mark Brand <mabrand@mabrand.nl>
Mark McLoughlin <mark@skynet.ie>
Matthias Clasen <mclasen@redhat.com>
Matt McCutchen <matt@mattmccutchen.net>
@@ -94,6 +95,7 @@ Richard Hughes <richard@hughsie.com>
Richard Hult <rhult@codefactory.se>
Richard Hult <richard@imendio.com>
Robert McQueen <robot101@debian.org>
+Roberto Guido <bob4job@gmail.com>
Romain Pokrzywka <romain@kdab.com>
Ross Burton <ross@openedhand.com>
Ryan Lortie <desrt@desrt.ca>
@@ -105,6 +107,7 @@ Seth Nickell <seth@gnome.org>
Simon McVittie <simon.mcvittie@collabora.co.uk>
Sjoerd Simons <sjoerd@luon.net>
Sledz <sledz@MOBIL-400-586.intern.dresearch.de>
+Sven Herzberg <sven@imendio.com>
Thiago Macieira <thiago@kde.org>
Tim Dijkstra <tim@famdijkstra.org>
Tobias Mueller <fdo-bugs@cryptobitch.de>
diff --git a/Makefile.in b/Makefile.in
index 10e2aa0f..6d90637f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -224,6 +224,8 @@ DBUS_CONSOLE_AUTH_DIR = @DBUS_CONSOLE_AUTH_DIR@
DBUS_CONSOLE_OWNER_FILE = @DBUS_CONSOLE_OWNER_FILE@
DBUS_DAEMONDIR = @DBUS_DAEMONDIR@
DBUS_DATADIR = @DBUS_DATADIR@
+DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@
+DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@
DBUS_HAVE_INT64 = @DBUS_HAVE_INT64@
DBUS_INT16_TYPE = @DBUS_INT16_TYPE@
DBUS_INT32_TYPE = @DBUS_INT32_TYPE@
@@ -269,6 +271,8 @@ EXPANDED_PREFIX = @EXPANDED_PREFIX@
EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@
FGREP = @FGREP@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -313,7 +317,6 @@ PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
RC = @RC@
R_DYNAMIC_LDFLAG = @R_DYNAMIC_LDFLAG@
-SECTION_LDFLAGS = @SECTION_LDFLAGS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
diff --git a/NEWS b/NEWS
index 6ee76fef..ee89426f 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,49 @@
+D-Bus 1.4.12 (2011-06-10)
+==
+
+Security (local denial of service):
+
+• Byte-swap foreign-endian messages correctly, preventing a long-standing
+ local DoS if foreign-endian messages are relayed through the dbus-daemon
+ (backporters: this is git commit c3223ba6c401ba81df1305851312a47c485e6cd7)
+ (fd.o #38120, Debian #629938, no CVE number yet; Simon McVittie)
+
+New things:
+
+• The constant to use for an infinite timeout now has a name,
+ DBUS_TIMEOUT_INFINITE. It is numerically equivalent to 0x7fffffff (INT32_MAX)
+ which can be used for source compatibility with older versions of libdbus.
+
+• If GLib and DBus-GLib are already installed, more tests will be built,
+ providing better coverage. The new tests can also be installed via
+ ./configure --enable-installed-tests
+ for system integration testing, if required. (fd.o #34570, Simon McVittie)
+
+Changes:
+
+• Consistently use atomic operations for the DBusConnection's refcount,
+ fixing potential threading problems (fd.o #38005, Simon McVittie)
+
+• Don't use -Wl,--gc-sections by default: in practice the size decrease is
+ small (300KiB on x86-64) and it frequently doesn't work in unusual
+ toolchains. To optimize for minimum installed size, you should benchmark
+ various possibilities for CFLAGS and LDFLAGS, and set the best flags for
+ your particular toolchain at configure time. (fd.o #33466, Simon McVittie)
+
+• Use #!/bin/sh for run-with-tmp-session-bus.sh, making it work on *BSD
+ (fd.o #35880, Timothy Redaelli)
+
+• Use ln -fs to set up dbus for systemd, which should fix reinstallation
+ when not using a DESTDIR (fd.o #37870, Simon McVittie)
+
+• Windows-specific changes:
+ · don't try to build dbus-daemon-launch-helper (fd.o #37838, Mark Brand)
+
D-Bus 1.4.10 (2011-06-01)
==
+The "Ape Ale" release.
+
Notes for distributors:
This version of D-Bus no longer uses -fPIE by default. Distributions wishing
diff --git a/bus/Makefile.am b/bus/Makefile.am
index dfb3bc34..9761c27c 100644
--- a/bus/Makefile.am
+++ b/bus/Makefile.am
@@ -89,7 +89,7 @@ dbus_daemon_LDADD= \
$(EFENCE) \
$(DBUS_BUS_LIBS)
-dbus_daemon_LDFLAGS=@R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@
+dbus_daemon_LDFLAGS=@R_DYNAMIC_LDFLAG@
LAUNCH_HELPER_SOURCES= \
$(XML_SOURCES) \
@@ -115,7 +115,7 @@ dbus_daemon_launch_helper_LDADD= \
$(top_builddir)/dbus/libdbus-internal.la \
$(DBUS_LAUNCHER_LIBS)
-dbus_daemon_launch_helper_LDFLAGS=@R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@
+dbus_daemon_launch_helper_LDFLAGS=@R_DYNAMIC_LDFLAG@
## we build another binary so we can do the launch testing without root privs.
## DO NOT INSTALL THIS FILE
@@ -127,7 +127,7 @@ dbus_daemon_launch_helper_test_LDADD= \
$(top_builddir)/dbus/libdbus-internal.la \
$(DBUS_LAUNCHER_LIBS)
-dbus_daemon_launch_helper_test_LDFLAGS=@R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@
+dbus_daemon_launch_helper_test_LDFLAGS=@R_DYNAMIC_LDFLAG@
dbus_daemon_launch_helper_test_CPPFLAGS= -DDBUS_STATIC_BUILD \
-DACTIVATION_LAUNCHER_TEST
@@ -141,7 +141,7 @@ bus_test_launch_helper_LDADD= \
$(top_builddir)/dbus/libdbus-internal.la \
$(DBUS_LAUNCHER_LIBS)
-bus_test_launch_helper_LDFLAGS=@R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@
+bus_test_launch_helper_LDFLAGS=@R_DYNAMIC_LDFLAG@
bus_test_launch_helper_CPPFLAGS= -DDBUS_STATIC_BUILD \
-DACTIVATION_LAUNCHER_TEST \
-DACTIVATION_LAUNCHER_DO_OOM
@@ -150,7 +150,9 @@ bus_test_launch_helper_CPPFLAGS= -DDBUS_STATIC_BUILD \
## even when not doing "make check"
noinst_PROGRAMS = $(TESTS)
dbus_daemon_exec_PROGRAMS = dbus-daemon
+if DBUS_UNIX
libexec_PROGRAMS = dbus-daemon-launch-helper
+endif DBUS_UNIX
## note that TESTS has special meaning (stuff to use in make check)
## so if adding tests not to be run in make check, don't add them to
@@ -202,14 +204,16 @@ install-data-hook:
$(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/services
$(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/system-services
if HAVE_SYSTEMD
-# Install dbus.socket as default implementation of a D-Bus stack
+# Install dbus.socket as default implementation of a D-Bus stack.
+# Deliberately not using $(LN_S) here: ln -fs is not universally portable,
+# but neither is systemd, so it's OK to assume here that ln complies with SUS.
$(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/dbus.target.wants
- $(LN_S) ../dbus.socket $(DESTDIR)$(systemdsystemunitdir)/dbus.target.wants/dbus.socket
+ ln -fs ../dbus.socket $(DESTDIR)$(systemdsystemunitdir)/dbus.target.wants/dbus.socket
# Unconditionally enable D-Bus on systemd installations
$(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants
- $(LN_S) ../dbus.socket $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants/dbus.socket
+ ln -fs ../dbus.socket $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants/dbus.socket
$(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/multi-user.target.wants
- $(LN_S) ../dbus.service $(DESTDIR)$(systemdsystemunitdir)/multi-user.target.wants/dbus.service
+ ln -fs ../dbus.service $(DESTDIR)$(systemdsystemunitdir)/multi-user.target.wants/dbus.service
endif
if DBUS_UNIX
diff --git a/bus/Makefile.in b/bus/Makefile.in
index c0cc941a..3526ae85 100644
--- a/bus/Makefile.in
+++ b/bus/Makefile.in
@@ -38,7 +38,7 @@ build_triplet = @build@
host_triplet = @host@
noinst_PROGRAMS = $(am__EXEEXT_3) $(am__EXEEXT_4)
dbus_daemon_exec_PROGRAMS = dbus-daemon$(EXEEXT)
-libexec_PROGRAMS = dbus-daemon-launch-helper$(EXEEXT)
+@DBUS_UNIX_TRUE@libexec_PROGRAMS = dbus-daemon-launch-helper$(EXEEXT)
TESTS = $(am__EXEEXT_1) $(am__EXEEXT_2)
@DBUS_BUILD_TESTS_TRUE@am__append_1 = bus-test bus-test-system
@DBUS_BUILD_TESTS_TRUE@@DBUS_UNIX_TRUE@am__append_2 = bus-test-launch-helper
@@ -338,6 +338,8 @@ DBUS_CONSOLE_AUTH_DIR = @DBUS_CONSOLE_AUTH_DIR@
DBUS_CONSOLE_OWNER_FILE = @DBUS_CONSOLE_OWNER_FILE@
DBUS_DAEMONDIR = @DBUS_DAEMONDIR@
DBUS_DATADIR = @DBUS_DATADIR@
+DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@
+DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@
DBUS_HAVE_INT64 = @DBUS_HAVE_INT64@
DBUS_INT16_TYPE = @DBUS_INT16_TYPE@
DBUS_INT32_TYPE = @DBUS_INT32_TYPE@
@@ -383,6 +385,8 @@ EXPANDED_PREFIX = @EXPANDED_PREFIX@
EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@
FGREP = @FGREP@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -427,7 +431,6 @@ PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
RC = @RC@
R_DYNAMIC_LDFLAG = @R_DYNAMIC_LDFLAG@
-SECTION_LDFLAGS = @SECTION_LDFLAGS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -579,7 +582,7 @@ dbus_daemon_LDADD = \
$(EFENCE) \
$(DBUS_BUS_LIBS)
-dbus_daemon_LDFLAGS = @R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@
+dbus_daemon_LDFLAGS = @R_DYNAMIC_LDFLAG@
LAUNCH_HELPER_SOURCES = \
$(XML_SOURCES) \
config-parser-common.c \
@@ -603,7 +606,7 @@ dbus_daemon_launch_helper_LDADD = \
$(top_builddir)/dbus/libdbus-internal.la \
$(DBUS_LAUNCHER_LIBS)
-dbus_daemon_launch_helper_LDFLAGS = @R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@
+dbus_daemon_launch_helper_LDFLAGS = @R_DYNAMIC_LDFLAG@
dbus_daemon_launch_helper_test_SOURCES = \
activation-helper-bin.c \
$(LAUNCH_HELPER_SOURCES)
@@ -612,7 +615,7 @@ dbus_daemon_launch_helper_test_LDADD = \
$(top_builddir)/dbus/libdbus-internal.la \
$(DBUS_LAUNCHER_LIBS)
-dbus_daemon_launch_helper_test_LDFLAGS = @R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@
+dbus_daemon_launch_helper_test_LDFLAGS = @R_DYNAMIC_LDFLAG@
dbus_daemon_launch_helper_test_CPPFLAGS = -DDBUS_STATIC_BUILD \
-DACTIVATION_LAUNCHER_TEST
@@ -624,7 +627,7 @@ bus_test_launch_helper_LDADD = \
$(top_builddir)/dbus/libdbus-internal.la \
$(DBUS_LAUNCHER_LIBS)
-bus_test_launch_helper_LDFLAGS = @R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@
+bus_test_launch_helper_LDFLAGS = @R_DYNAMIC_LDFLAG@
bus_test_launch_helper_CPPFLAGS = -DDBUS_STATIC_BUILD \
-DACTIVATION_LAUNCHER_TEST \
-DACTIVATION_LAUNCHER_DO_OOM
@@ -2581,14 +2584,16 @@ install-data-hook:
$(mkinstalldirs) $(DESTDIR)$(configdir)/session.d
$(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/services
$(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/system-services
-# Install dbus.socket as default implementation of a D-Bus stack
+# Install dbus.socket as default implementation of a D-Bus stack.
+# Deliberately not using $(LN_S) here: ln -fs is not universally portable,
+# but neither is systemd, so it's OK to assume here that ln complies with SUS.
@HAVE_SYSTEMD_TRUE@ $(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/dbus.target.wants
-@HAVE_SYSTEMD_TRUE@ $(LN_S) ../dbus.socket $(DESTDIR)$(systemdsystemunitdir)/dbus.target.wants/dbus.socket
+@HAVE_SYSTEMD_TRUE@ ln -fs ../dbus.socket $(DESTDIR)$(systemdsystemunitdir)/dbus.target.wants/dbus.socket
# Unconditionally enable D-Bus on systemd installations
@HAVE_SYSTEMD_TRUE@ $(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants
-@HAVE_SYSTEMD_TRUE@ $(LN_S) ../dbus.socket $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants/dbus.socket
+@HAVE_SYSTEMD_TRUE@ ln -fs ../dbus.socket $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants/dbus.socket
@HAVE_SYSTEMD_TRUE@ $(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/multi-user.target.wants
-@HAVE_SYSTEMD_TRUE@ $(LN_S) ../dbus.service $(DESTDIR)$(systemdsystemunitdir)/multi-user.target.wants/dbus.service
+@HAVE_SYSTEMD_TRUE@ ln -fs ../dbus.service $(DESTDIR)$(systemdsystemunitdir)/multi-user.target.wants/dbus.service
@DBUS_UNIX_TRUE@install-exec-hook:
@DBUS_UNIX_TRUE@ if test `id -u` -eq 0; then \
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index 9b9ac546..7476975b 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -226,7 +226,7 @@ ENABLE_TESTING()
OPTION(DBUS_BUILD_TESTS "enable unit test code" ON)
if(DBUS_BUILD_TESTS)
- add_definitions(-DDBUS_BUILD_TESTS)
+ add_definitions(-DDBUS_BUILD_TESTS -DDBUS_ENABLE_EMBEDDED_TESTS)
endif(DBUS_BUILD_TESTS)
OPTION(DBUS_USE_OUTPUT_DEBUG_STRING "enable win32 debug port for message output" OFF)
diff --git a/config.h.in b/config.h.in
index 308025d8..1101227a 100644
--- a/config.h.in
+++ b/config.h.in
@@ -9,7 +9,7 @@
/* Directory for installing the binaries */
#undef DBUS_BINDIR
-/* Build test code */
+/* Define to build test code into the library and binaries */
#undef DBUS_BUILD_TESTS
/* Define to build X11 functionality */
@@ -51,9 +51,15 @@
/* Disable public API sanity checking */
#undef DBUS_DISABLE_CHECKS
+/* Define to build test code into the library and binaries */
+#undef DBUS_ENABLE_EMBEDDED_TESTS
+
/* Use launchd autolaunch */
#undef DBUS_ENABLE_LAUNCHD
+/* Define to build independent test binaries (requires GLib) */
+#undef DBUS_ENABLE_MODULAR_TESTS
+
/* Build with caching of user data */
#undef DBUS_ENABLE_USERDB_CACHE
@@ -114,9 +120,6 @@
/* The name of the gettext domain */
#undef GETTEXT_PACKAGE
-/* Disable GLib assertion macros */
-#undef G_DISABLE_ASSERT
-
/* Disable GLib public API sanity checking */
#undef G_DISABLE_CHECKS
diff --git a/configure b/configure
index b3db6265..9d8c6519 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for dbus 1.4.10.
+# Generated by GNU Autoconf 2.68 for dbus 1.4.12.
#
# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=dbus>.
#
@@ -571,8 +571,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='dbus'
PACKAGE_TARNAME='dbus'
-PACKAGE_VERSION='1.4.10'
-PACKAGE_STRING='dbus 1.4.10'
+PACKAGE_VERSION='1.4.12'
+PACKAGE_STRING='dbus 1.4.12'
PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=dbus'
PACKAGE_URL=''
@@ -672,7 +672,6 @@ XSLTPROC
DBUS_DOXYGEN_DOCS_ENABLED_FALSE
DBUS_DOXYGEN_DOCS_ENABLED_TRUE
DOXYGEN
-SECTION_LDFLAGS
DBUS_X_LIBS
DBUS_X_CFLAGS
X_EXTRA_LIBS
@@ -710,7 +709,6 @@ DBUS_USE_EXPAT_FALSE
DBUS_USE_EXPAT_TRUE
LIBXML_LIBS
LIBXML_CFLAGS
-PKG_CONFIG
DBUS_PATH_OR_ABSTRACT
DBUS_INT16_TYPE
DBUS_INT32_TYPE
@@ -719,6 +717,17 @@ DBUS_UINT64_CONSTANT
DBUS_INT64_CONSTANT
DBUS_INT64_TYPE
R_DYNAMIC_LDFLAG
+DBUS_ENABLE_INSTALLED_TESTS_FALSE
+DBUS_ENABLE_INSTALLED_TESTS_TRUE
+DBUS_ENABLE_MODULAR_TESTS_FALSE
+DBUS_ENABLE_MODULAR_TESTS_TRUE
+DBUS_GLIB_LIBS
+DBUS_GLIB_CFLAGS
+GLIB_LIBS
+GLIB_CFLAGS
+PKG_CONFIG
+DBUS_ENABLE_EMBEDDED_TESTS_FALSE
+DBUS_ENABLE_EMBEDDED_TESTS_TRUE
DBUS_BUILD_TESTS_FALSE
DBUS_BUILD_TESTS_TRUE
DBUS_CYGWIN_FALSE
@@ -875,7 +884,6 @@ with_sysroot
enable_libtool_lock
enable_compiler_coverage
enable_compiler_optimisations
-enable_tests
enable_ansi
enable_verbose_mode
enable_asserts
@@ -902,10 +910,13 @@ with_console_owner_file
with_launchd_agent_dir
with_dbus_user
with_dbus_daemondir
+enable_embedded_tests
+enable_modular_tests
+enable_tests
+enable_installed_tests
enable_x11_autolaunch
with_x
enable_Werror
-enable_gc_sections
with_systemdsystemunitdir
with_dbus_test_dir
'
@@ -923,6 +934,10 @@ CCC
CPP
CXXCPP
PKG_CONFIG
+GLIB_CFLAGS
+GLIB_LIBS
+DBUS_GLIB_CFLAGS
+DBUS_GLIB_LIBS
LIBXML_CFLAGS
LIBXML_LIBS
XMKMF
@@ -1469,7 +1484,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures dbus 1.4.10 to adapt to many kinds of systems.
+\`configure' configures dbus 1.4.12 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1543,7 +1558,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of dbus 1.4.10:";;
+ short | recursive ) echo "Configuration of dbus 1.4.12:";;
esac
cat <<\_ACEOF
@@ -1566,7 +1581,6 @@ Optional Features:
Enable generation of coverage data
--disable-compiler-optimisations
Disable compiler optimisations
- --enable-tests enable unit test code in the library and binaries
--enable-ansi enable -ansi -pedantic gcc flags
--enable-verbose-mode support verbose debug mode
--enable-asserts include assertion checks
@@ -1584,11 +1598,15 @@ Optional Features:
enable console owner file
--enable-userdb-cache build with userdb-cache support
--enable-launchd build with launchd auto-launch support
+ --enable-embedded-tests enable unit test code in the library and binaries
+ --enable-modular-tests enable modular regression tests (requires GLib)
+ --enable-tests enable/disable all tests, overriding
+ embedded-tests/modular-tests
+ --enable-installed-tests
+ enable unit test code in the library and binaries
--enable-x11-autolaunch build with X11 auto-launch support
--disable-Werror compile without -Werror (normally enabled in
development builds)
- --disable-gc-sections disable --gc-sections to work around broken
- toolchains
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -1640,6 +1658,12 @@ Some influential environment variables:
CPP C preprocessor
CXXCPP C++ preprocessor
PKG_CONFIG path to pkg-config utility
+ GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config
+ GLIB_LIBS linker flags for GLIB, overriding pkg-config
+ DBUS_GLIB_CFLAGS
+ C compiler flags for DBUS_GLIB, overriding pkg-config
+ DBUS_GLIB_LIBS
+ linker flags for DBUS_GLIB, overriding pkg-config
LIBXML_CFLAGS
C compiler flags for LIBXML, overriding pkg-config
LIBXML_LIBS linker flags for LIBXML, overriding pkg-config
@@ -1712,7 +1736,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-dbus configure 1.4.10
+dbus configure 1.4.12
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2426,7 +2450,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by dbus $as_me 1.4.10, which was
+It was created by dbus $as_me 1.4.12, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
@@ -3318,7 +3342,7 @@ fi
# Define the identity of the package.
PACKAGE='dbus'
- VERSION='1.4.10'
+ VERSION='1.4.12'
cat >>confdefs.h <<_ACEOF
@@ -3502,7 +3526,7 @@ LT_CURRENT=8
## increment any time the source changes; set to
## 0 if you increment CURRENT
-LT_REVISION=6
+LT_REVISION=7
## increment if any interfaces have been added; set to 0
## if any interfaces have been changed or removed. removal has
@@ -3515,8 +3539,8 @@ LT_AGE=5
DBUS_MAJOR_VERSION=1
DBUS_MINOR_VERSION=4
-DBUS_MICRO_VERSION=10
-DBUS_VERSION=1.4.10
+DBUS_MICRO_VERSION=12
+DBUS_VERSION=1.4.12
@@ -16350,13 +16374,6 @@ else
fi
-# Check whether --enable-tests was given.
-if test "${enable_tests+set}" = set; then :
- enableval=$enable_tests; enable_tests=$enableval
-else
- enable_tests=$USE_MAINTAINER_MODE
-fi
-
# Check whether --enable-ansi was given.
if test "${enable_ansi+set}" = set; then :
enableval=$enable_ansi; enable_ansi=$enableval
@@ -16530,7 +16547,32 @@ if test "${with_dbus_daemondir+set}" = set; then :
fi
- if test x$enable_tests = xyes; then
+# Check whether --enable-embedded-tests was given.
+if test "${enable_embedded_tests+set}" = set; then :
+ enableval=$enable_embedded_tests;
+else
+ enable_embedded_tests=$USE_MAINTAINER_MODE
+fi
+
+# Check whether --enable-modular-tests was given.
+if test "${enable_modular_tests+set}" = set; then :
+ enableval=$enable_modular_tests;
+else
+ enable_modular_tests=auto
+fi
+
+# --enable-tests overrides both --enable-embedded-tests and
+# --enable-modular-tests
+# Check whether --enable-tests was given.
+if test "${enable_tests+set}" = set; then :
+ enableval=$enable_tests; enable_embedded_tests=$enableval; enable_modular_tests=$enableval
+fi
+
+
+# DBUS_ENABLE_EMBEDDED_TESTS controls unit tests built in to .c files
+# and also some stuff in the test/ subdir. DBUS_BUILD_TESTS was an older
+# name for this.
+ if test "x$enable_embedded_tests" = xyes; then
DBUS_BUILD_TESTS_TRUE=
DBUS_BUILD_TESTS_FALSE='#'
else
@@ -16538,12 +16580,330 @@ else
DBUS_BUILD_TESTS_FALSE=
fi
-if test x$enable_tests = xyes; then
+ if test "x$enable_embedded_tests" = xyes; then
+ DBUS_ENABLE_EMBEDDED_TESTS_TRUE=
+ DBUS_ENABLE_EMBEDDED_TESTS_FALSE='#'
+else
+ DBUS_ENABLE_EMBEDDED_TESTS_TRUE='#'
+ DBUS_ENABLE_EMBEDDED_TESTS_FALSE=
+fi
+
+if test "x$enable_embedded_tests" = xyes; then
+
+$as_echo "#define DBUS_ENABLE_EMBEDDED_TESTS 1" >>confdefs.h
+
$as_echo "#define DBUS_BUILD_TESTS 1" >>confdefs.h
fi
+# DBUS_ENABLE_MODULAR_TESTS controls tests that work based on public API.
+# These use GTest, from GLib, because life's too short. They're enabled by
+# default (unless you don't have GLib), because they don't bloat the library
+# or binaries.
+if test "x$enable_modular_tests" != xno; then
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # 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_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
+ # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $ac_pt_PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # 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_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_pt_PKG_CONFIG" = x; then
+ PKG_CONFIG=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
+ fi
+else
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+ _pkg_min_version=0.9.0
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ PKG_CONFIG=""
+ fi
+
+fi
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5
+$as_echo_n "checking for GLIB... " >&6; }
+
+if test -n "$GLIB_CFLAGS"; then
+ pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.22, gio-2.0 >= 2.22\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.22, gio-2.0 >= 2.22") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.22, gio-2.0 >= 2.22" 2>/dev/null`
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$GLIB_LIBS"; then
+ pkg_cv_GLIB_LIBS="$GLIB_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.22, gio-2.0 >= 2.22\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.22, gio-2.0 >= 2.22") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.22, gio-2.0 >= 2.22" 2>/dev/null`
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "glib-2.0 >= 2.22, gio-2.0 >= 2.22" 2>&1`
+ else
+ GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors "glib-2.0 >= 2.22, gio-2.0 >= 2.22" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$GLIB_PKG_ERRORS" >&5
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ if test "x$enable_modular_tests" = xyes; then
+ as_fn_error $? "GLib is required by the modular tests" "$LINENO" 5
+ else # assumed to be "auto"
+ enable_modular_tests=no
+ fi
+elif test $pkg_failed = untried; then
+ if test "x$enable_modular_tests" = xyes; then
+ as_fn_error $? "GLib is required by the modular tests" "$LINENO" 5
+ else # assumed to be "auto"
+ enable_modular_tests=no
+ fi
+else
+ GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS
+ GLIB_LIBS=$pkg_cv_GLIB_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ :
+fi
+ # If dbus-gmain.[ch] returned to libdbus then we wouldn't need this
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBUS_GLIB" >&5
+$as_echo_n "checking for DBUS_GLIB... " >&6; }
+
+if test -n "$DBUS_GLIB_CFLAGS"; then
+ pkg_cv_DBUS_GLIB_CFLAGS="$DBUS_GLIB_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-glib-1\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "dbus-glib-1") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_DBUS_GLIB_CFLAGS=`$PKG_CONFIG --cflags "dbus-glib-1" 2>/dev/null`
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$DBUS_GLIB_LIBS"; then
+ pkg_cv_DBUS_GLIB_LIBS="$DBUS_GLIB_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-glib-1\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "dbus-glib-1") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_DBUS_GLIB_LIBS=`$PKG_CONFIG --libs "dbus-glib-1" 2>/dev/null`
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ DBUS_GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "dbus-glib-1" 2>&1`
+ else
+ DBUS_GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors "dbus-glib-1" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$DBUS_GLIB_PKG_ERRORS" >&5
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ if test "x$enable_modular_tests" = xyes; then
+ as_fn_error $? "dbus-glib is required by the modular tests (for now)" "$LINENO" 5
+ else # assumed to be "auto"
+ enable_modular_tests=no
+ fi
+elif test $pkg_failed = untried; then
+ if test "x$enable_modular_tests" = xyes; then
+ as_fn_error $? "dbus-glib is required by the modular tests (for now)" "$LINENO" 5
+ else # assumed to be "auto"
+ enable_modular_tests=no
+ fi
+else
+ DBUS_GLIB_CFLAGS=$pkg_cv_DBUS_GLIB_CFLAGS
+ DBUS_GLIB_LIBS=$pkg_cv_DBUS_GLIB_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ :
+fi
+ if test "x$enable_modular_tests" != xno; then
+ # dependencies checked, switch from auto to yes
+ enable_modular_tests=yes
+ fi
+fi
+if test "x$enable_modular_tests" = xyes; then
+
+$as_echo "#define DBUS_ENABLE_MODULAR_TESTS 1" >>confdefs.h
+
+fi
+ if test "x$enable_modular_tests" = xyes; then
+ DBUS_ENABLE_MODULAR_TESTS_TRUE=
+ DBUS_ENABLE_MODULAR_TESTS_FALSE='#'
+else
+ DBUS_ENABLE_MODULAR_TESTS_TRUE='#'
+ DBUS_ENABLE_MODULAR_TESTS_FALSE=
+fi
+
+
+# Check whether --enable-installed-tests was given.
+if test "${enable_installed_tests+set}" = set; then :
+ enableval=$enable_installed_tests;
+else
+ enable_installed_tests=no
+fi
+
+ if test "x$enable_installed_tests" = xyes; then
+ DBUS_ENABLE_INSTALLED_TESTS_TRUE=
+ DBUS_ENABLE_INSTALLED_TESTS_FALSE='#'
+else
+ DBUS_ENABLE_INSTALLED_TESTS_TRUE='#'
+ DBUS_ENABLE_INSTALLED_TESTS_FALSE=
+fi
+
+
if test x$enable_verbose_mode = xyes; then
$as_echo "#define DBUS_ENABLE_VERBOSE_MODE 1" >>confdefs.h
@@ -16554,9 +16914,6 @@ if test x$enable_asserts = xno; then
$as_echo "#define DBUS_DISABLE_ASSERT 1" >>confdefs.h
-
-$as_echo "#define G_DISABLE_ASSERT 1" >>confdefs.h
-
R_DYNAMIC_LDFLAG=""
else
# -rdynamic is needed for glibc's backtrace_symbols to work.
@@ -20397,53 +20754,6 @@ fi
CFLAGS="$WARNING_CFLAGS $CFLAGS"
-# Disabling gc-sections makes our binaries bigger, but some toolchains
-# have known-broken support for it which discards sections that are needed.
-# See https://bugs.freedesktop.org/show_bug.cgi?id=33466
-SECTION_LDFLAGS=
-# Check whether --enable-gc-sections was given.
-if test "${enable_gc_sections+set}" = set; then :
- enableval=$enable_gc_sections; enable_gc_sections=$enableval
-else
- enable_gc_sections=yes
-fi
-
-if test "x$GCC,$enable_gc_sections,$dbus_win" = xyes,yes,no; then
- save_CFLAGS="$CFLAGS"
- save_LDFLAGS="$LDFLAGS"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ability to link with --gc-sections" >&5
-$as_echo_n "checking for ability to link with --gc-sections... " >&6; }
- CFLAGS="-ffunction-sections -fdata-sections"
- LDFLAGS="-Wl,--gc-sections"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- rc=yes
-else
- rc=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $rc" >&5
-$as_echo "$rc" >&6; }
- CFLAGS="$save_CFLAGS"
- LDFLAGS="$save_LDFLAGS"
- if test "x$rc" = xyes; then
- SECTION_LDFLAGS="-Wl,--gc-sections"
- CFLAGS="-ffunction-sections -fdata-sections $CFLAGS"
- fi
-fi
-
-
case $host_os in
solaris*)
# Solaris' C library apparently needs these runes to be threadsafe...
@@ -21464,6 +21774,18 @@ if test -z "${DBUS_BUILD_TESTS_TRUE}" && test -z "${DBUS_BUILD_TESTS_FALSE}"; th
as_fn_error $? "conditional \"DBUS_BUILD_TESTS\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${DBUS_ENABLE_EMBEDDED_TESTS_TRUE}" && test -z "${DBUS_ENABLE_EMBEDDED_TESTS_FALSE}"; then
+ as_fn_error $? "conditional \"DBUS_ENABLE_EMBEDDED_TESTS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${DBUS_ENABLE_MODULAR_TESTS_TRUE}" && test -z "${DBUS_ENABLE_MODULAR_TESTS_FALSE}"; then
+ as_fn_error $? "conditional \"DBUS_ENABLE_MODULAR_TESTS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${DBUS_ENABLE_INSTALLED_TESTS_TRUE}" && test -z "${DBUS_ENABLE_INSTALLED_TESTS_FALSE}"; then
+ as_fn_error $? "conditional \"DBUS_ENABLE_INSTALLED_TESTS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${DBUS_USE_EXPAT_TRUE}" && test -z "${DBUS_USE_EXPAT_FALSE}"; then
as_fn_error $? "conditional \"DBUS_USE_EXPAT\" was never defined.
@@ -21946,7 +22268,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by dbus $as_me 1.4.10, which was
+This file was extended by dbus $as_me 1.4.12, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -22012,7 +22334,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-dbus config.status 1.4.10
+dbus config.status 1.4.12
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
@@ -24362,7 +24684,8 @@ echo "
echo "
Maintainer mode: ${USE_MAINTAINER_MODE}
gcc coverage profiling: ${enable_compiler_coverage}
- Building unit tests: ${enable_tests}
+ Building embedded tests: ${enable_embedded_tests}
+ Building modular tests: ${enable_modular_tests}
Building verbose mode: ${enable_verbose_mode}
Building assertions: ${enable_asserts}
Building checks: ${enable_checks}
@@ -24394,11 +24717,11 @@ if test x$have_launchd = xyes; then
fi
echo
-if test x$enable_tests = xyes; then
+if test x$enable_embedded_tests = xyes; then
echo "NOTE: building with unit tests increases the size of the installed library and renders it insecure."
fi
-if test x$enable_tests = xyes -a x$enable_asserts = xno; then
- echo "NOTE: building with unit tests but without assertions means tests may not properly report failures (this configuration is only useful when doing something like profiling the tests)"
+if test x$enable_embedded_tests = xyes -a x$enable_asserts = xno; then
+ echo "NOTE: building with embedded tests but without assertions means tests may not properly report failures (this configuration is only useful when doing something like profiling the tests)"
fi
if test x$enable_compiler_coverage = xyes; then
echo "NOTE: building with coverage profiling is definitely for developers only."
diff --git a/configure.ac b/configure.ac
index 9ff32c4e..408054bd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@ AC_PREREQ([2.63])
m4_define([dbus_major_version], [1])
m4_define([dbus_minor_version], [4])
-m4_define([dbus_micro_version], [10])
+m4_define([dbus_micro_version], [12])
m4_define([dbus_version],
[dbus_major_version.dbus_minor_version.dbus_micro_version])
AC_INIT([dbus],[dbus_version],[https://bugs.freedesktop.org/enter_bug.cgi?product=dbus],[dbus])
@@ -36,7 +36,7 @@ LT_CURRENT=8
## increment any time the source changes; set to
## 0 if you increment CURRENT
-LT_REVISION=6
+LT_REVISION=7
## increment if any interfaces have been added; set to 0
## if any interfaces have been changed or removed. removal has
@@ -122,7 +122,6 @@ AM_CONDITIONAL(DBUS_WINCE, test "$dbus_wince" = yes)
AM_CONDITIONAL(DBUS_UNIX, test "$dbus_unix" = yes)
AM_CONDITIONAL(DBUS_CYGWIN, test "$dbus_cygwin" = yes)
-AC_ARG_ENABLE(tests, AS_HELP_STRING([--enable-tests],[enable unit test code in the library and binaries]),enable_tests=$enableval,enable_tests=$USE_MAINTAINER_MODE)
AC_ARG_ENABLE(ansi, AS_HELP_STRING([--enable-ansi],[enable -ansi -pedantic gcc flags]),enable_ansi=$enableval,enable_ansi=no)
AC_ARG_ENABLE(verbose-mode, AS_HELP_STRING([--enable-verbose-mode],[support verbose debug mode]),enable_verbose_mode=$enableval,enable_verbose_mode=$USE_MAINTAINER_MODE)
AC_ARG_ENABLE(asserts, AS_HELP_STRING([--enable-asserts],[include assertion checks]),enable_asserts=$enableval,enable_asserts=$USE_MAINTAINER_MODE)
@@ -151,12 +150,73 @@ AC_ARG_WITH(launchd-agent-dir, AS_HELP_STRING([--with-launchd-agent-dir=[dirname
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]))
-dnl DBUS_BUILD_TESTS controls unit tests built in to .c files
-dnl and also some stuff in the test/ subdir
-AM_CONDITIONAL(DBUS_BUILD_TESTS, test x$enable_tests = xyes)
-if test x$enable_tests = xyes; then
- AC_DEFINE(DBUS_BUILD_TESTS,1,[Build test code])
+AC_ARG_ENABLE([embedded-tests],
+ AS_HELP_STRING([--enable-embedded-tests],
+ [enable unit test code in the library and binaries]),
+ [], [enable_embedded_tests=$USE_MAINTAINER_MODE])
+AC_ARG_ENABLE([modular-tests],
+ AS_HELP_STRING([--enable-modular-tests],
+ [enable modular regression tests (requires GLib)]),
+ [], [enable_modular_tests=auto])
+# --enable-tests overrides both --enable-embedded-tests and
+# --enable-modular-tests
+AC_ARG_ENABLE([tests],
+ AS_HELP_STRING([--enable-tests],
+ [enable/disable all tests, overriding embedded-tests/modular-tests]),
+ [enable_embedded_tests=$enableval; enable_modular_tests=$enableval],
+ [])
+
+# DBUS_ENABLE_EMBEDDED_TESTS controls unit tests built in to .c files
+# and also some stuff in the test/ subdir. DBUS_BUILD_TESTS was an older
+# name for this.
+AM_CONDITIONAL([DBUS_BUILD_TESTS], [test "x$enable_embedded_tests" = xyes])
+AM_CONDITIONAL([DBUS_ENABLE_EMBEDDED_TESTS],
+ [test "x$enable_embedded_tests" = xyes])
+if test "x$enable_embedded_tests" = xyes; then
+ AC_DEFINE([DBUS_ENABLE_EMBEDDED_TESTS], [1],
+ [Define to build test code into the library and binaries])
+ AC_DEFINE([DBUS_BUILD_TESTS], [1],
+ [Define to build test code into the library and binaries])
+fi
+
+# DBUS_ENABLE_MODULAR_TESTS controls tests that work based on public API.
+# These use GTest, from GLib, because life's too short. They're enabled by
+# default (unless you don't have GLib), because they don't bloat the library
+# or binaries.
+if test "x$enable_modular_tests" != xno; then
+ PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22, gio-2.0 >= 2.22],
+ [],
+ [if test "x$enable_modular_tests" = xyes; then
+ AC_MSG_ERROR([GLib is required by the modular tests])
+ else # assumed to be "auto"
+ enable_modular_tests=no
+ fi])
+ # If dbus-gmain.[ch] returned to libdbus then we wouldn't need this
+ PKG_CHECK_MODULES([DBUS_GLIB], [dbus-glib-1],
+ [],
+ [if test "x$enable_modular_tests" = xyes; then
+ AC_MSG_ERROR([dbus-glib is required by the modular tests (for now)])
+ else # assumed to be "auto"
+ enable_modular_tests=no
+ fi])
+ if test "x$enable_modular_tests" != xno; then
+ # dependencies checked, switch from auto to yes
+ enable_modular_tests=yes
+ fi
+fi
+if test "x$enable_modular_tests" = xyes; then
+ AC_DEFINE([DBUS_ENABLE_MODULAR_TESTS], [1],
+ [Define to build independent test binaries (requires GLib)])
fi
+AM_CONDITIONAL([DBUS_ENABLE_MODULAR_TESTS],
+ [test "x$enable_modular_tests" = xyes])
+
+AC_ARG_ENABLE([installed-tests],
+ AS_HELP_STRING([--enable-installed-tests],
+ [enable unit test code in the library and binaries]),
+ [], [enable_installed_tests=no])
+AM_CONDITIONAL([DBUS_ENABLE_INSTALLED_TESTS],
+ [test "x$enable_installed_tests" = xyes])
if test x$enable_verbose_mode = xyes; then
AC_DEFINE(DBUS_ENABLE_VERBOSE_MODE,1,[Support a verbose mode])
@@ -164,7 +224,6 @@ fi
if test x$enable_asserts = xno; then
AC_DEFINE(DBUS_DISABLE_ASSERT,1,[Disable assertion checking])
- AC_DEFINE(G_DISABLE_ASSERT,1,[Disable GLib assertion macros])
R_DYNAMIC_LDFLAG=""
else
# -rdynamic is needed for glibc's backtrace_symbols to work.
@@ -1168,34 +1227,6 @@ dnl but prepending to CFLAGS (so the user can override it with later CFLAGS)
dnl is the next best thing
CFLAGS="$WARNING_CFLAGS $CFLAGS"
-# Disabling gc-sections makes our binaries bigger, but some toolchains
-# have known-broken support for it which discards sections that are needed.
-# See https://bugs.freedesktop.org/show_bug.cgi?id=33466
-SECTION_LDFLAGS=
-AC_ARG_ENABLE([gc-sections],
- [AS_HELP_STRING([--disable-gc-sections],
- [disable --gc-sections to work around broken toolchains])],
- [enable_gc_sections=$enableval],
- [enable_gc_sections=yes])
-if test "x$GCC,$enable_gc_sections,$dbus_win" = xyes,yes,no; then
- save_CFLAGS="$CFLAGS"
- save_LDFLAGS="$LDFLAGS"
- AC_MSG_CHECKING([for ability to link with --gc-sections])
- CFLAGS="-ffunction-sections -fdata-sections"
- LDFLAGS="-Wl,--gc-sections"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
- [rc=yes],
- [rc=no])
- AC_MSG_RESULT([$rc])
- CFLAGS="$save_CFLAGS"
- LDFLAGS="$save_LDFLAGS"
- if test "x$rc" = xyes; then
- SECTION_LDFLAGS="-Wl,--gc-sections"
- CFLAGS="-ffunction-sections -fdata-sections $CFLAGS"
- fi
-fi
-AC_SUBST([SECTION_LDFLAGS])
-
case $host_os in
solaris*)
# Solaris' C library apparently needs these runes to be threadsafe...
@@ -1572,7 +1603,8 @@ echo "
echo "
Maintainer mode: ${USE_MAINTAINER_MODE}
gcc coverage profiling: ${enable_compiler_coverage}
- Building unit tests: ${enable_tests}
+ Building embedded tests: ${enable_embedded_tests}
+ Building modular tests: ${enable_modular_tests}
Building verbose mode: ${enable_verbose_mode}
Building assertions: ${enable_asserts}
Building checks: ${enable_checks}
@@ -1604,11 +1636,11 @@ if test x$have_launchd = xyes; then
fi
echo
-if test x$enable_tests = xyes; then
+if test x$enable_embedded_tests = xyes; then
echo "NOTE: building with unit tests increases the size of the installed library and renders it insecure."
fi
-if test x$enable_tests = xyes -a x$enable_asserts = xno; then
- echo "NOTE: building with unit tests but without assertions means tests may not properly report failures (this configuration is only useful when doing something like profiling the tests)"
+if test x$enable_embedded_tests = xyes -a x$enable_asserts = xno; then
+ echo "NOTE: building with embedded tests but without assertions means tests may not properly report failures (this configuration is only useful when doing something like profiling the tests)"
fi
if test x$enable_compiler_coverage = xyes; then
echo "NOTE: building with coverage profiling is definitely for developers only."
diff --git a/dbus/Makefile.in b/dbus/Makefile.in
index 4012464b..65793af3 100644
--- a/dbus/Makefile.in
+++ b/dbus/Makefile.in
@@ -374,6 +374,8 @@ DBUS_CONSOLE_AUTH_DIR = @DBUS_CONSOLE_AUTH_DIR@
DBUS_CONSOLE_OWNER_FILE = @DBUS_CONSOLE_OWNER_FILE@
DBUS_DAEMONDIR = @DBUS_DAEMONDIR@
DBUS_DATADIR = @DBUS_DATADIR@
+DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@
+DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@
DBUS_HAVE_INT64 = @DBUS_HAVE_INT64@
DBUS_INT16_TYPE = @DBUS_INT16_TYPE@
DBUS_INT32_TYPE = @DBUS_INT32_TYPE@
@@ -419,6 +421,8 @@ EXPANDED_PREFIX = @EXPANDED_PREFIX@
EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@
FGREP = @FGREP@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -463,7 +467,6 @@ PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
RC = @RC@
R_DYNAMIC_LDFLAG = @R_DYNAMIC_LDFLAG@
-SECTION_LDFLAGS = @SECTION_LDFLAGS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
diff --git a/dbus/dbus-connection.c b/dbus/dbus-connection.c
index d0aca256..c2720e7b 100644
--- a/dbus/dbus-connection.c
+++ b/dbus/dbus-connection.c
@@ -1399,13 +1399,8 @@ _dbus_connection_ref_unlocked (DBusConnection *connection)
_dbus_assert (connection->generation == _dbus_current_generation);
HAVE_LOCK_CHECK (connection);
-
-#ifdef DBUS_HAVE_ATOMIC_INT
+
_dbus_atomic_inc (&connection->refcount);
-#else
- _dbus_assert (connection->refcount.value > 0);
- connection->refcount.value += 1;
-#endif
return connection;
}
@@ -1425,22 +1420,8 @@ _dbus_connection_unref_unlocked (DBusConnection *connection)
_dbus_assert (connection != NULL);
- /* The connection lock is better than the global
- * lock in the atomic increment fallback
- */
-
-#ifdef DBUS_HAVE_ATOMIC_INT
last_unref = (_dbus_atomic_dec (&connection->refcount) == 1);
-#else
- _dbus_assert (connection->refcount.value > 0);
- connection->refcount.value -= 1;
- last_unref = (connection->refcount.value == 0);
-#if 0
- printf ("unref_unlocked() connection %p count = %d\n", connection, connection->refcount.value);
-#endif
-#endif
-
if (last_unref)
_dbus_connection_last_unref (connection);
}
@@ -2126,11 +2107,23 @@ _dbus_connection_send_and_unlock (DBusConnection *connection,
void
_dbus_connection_close_if_only_one_ref (DBusConnection *connection)
{
+ dbus_int32_t tmp_refcount;
+
CONNECTION_LOCK (connection);
-
- _dbus_assert (connection->refcount.value > 0);
- if (connection->refcount.value == 1)
+ /* We increment and then decrement the refcount, because there is no
+ * _dbus_atomic_get (mirroring the fact that there's no InterlockedGet
+ * on Windows). */
+ _dbus_atomic_inc (&connection->refcount);
+ tmp_refcount = _dbus_atomic_dec (&connection->refcount);
+
+ /* The caller should have one ref, and this function temporarily took
+ * one more, which is reflected in this count even though we already
+ * released it (relying on the caller's ref) due to _dbus_atomic_dec
+ * semantics */
+ _dbus_assert (tmp_refcount >= 2);
+
+ if (tmp_refcount == 2)
_dbus_connection_close_possibly_shared_and_unlock (connection);
else
CONNECTION_UNLOCK (connection);
@@ -2632,25 +2625,8 @@ dbus_connection_ref (DBusConnection *connection)
{
_dbus_return_val_if_fail (connection != NULL, NULL);
_dbus_return_val_if_fail (connection->generation == _dbus_current_generation, NULL);
-
- /* The connection lock is better than the global
- * lock in the atomic increment fallback
- *
- * (FIXME but for now we always use the atomic version,
- * to avoid taking the connection lock, due to
- * the mess with set_timeout_functions()/set_watch_functions()
- * calling out to the app without dropping locks)
- */
-
-#if 1
- _dbus_atomic_inc (&connection->refcount);
-#else
- CONNECTION_LOCK (connection);
- _dbus_assert (connection->refcount.value > 0);
- connection->refcount.value += 1;
- CONNECTION_UNLOCK (connection);
-#endif
+ _dbus_atomic_inc (&connection->refcount);
return connection;
}
@@ -2787,33 +2763,9 @@ dbus_connection_unref (DBusConnection *connection)
_dbus_return_if_fail (connection != NULL);
_dbus_return_if_fail (connection->generation == _dbus_current_generation);
-
- /* The connection lock is better than the global
- * lock in the atomic increment fallback
- *
- * (FIXME but for now we always use the atomic version,
- * to avoid taking the connection lock, due to
- * the mess with set_timeout_functions()/set_watch_functions()
- * calling out to the app without dropping locks)
- */
-
-#if 1
- last_unref = (_dbus_atomic_dec (&connection->refcount) == 1);
-#else
- CONNECTION_LOCK (connection);
-
- _dbus_assert (connection->refcount.value > 0);
- connection->refcount.value -= 1;
- last_unref = (connection->refcount.value == 0);
+ last_unref = (_dbus_atomic_dec (&connection->refcount) == 1);
-#if 0
- printf ("unref() connection %p count = %d\n", connection, connection->refcount.value);
-#endif
-
- CONNECTION_UNLOCK (connection);
-#endif
-
if (last_unref)
{
#ifndef DBUS_DISABLE_CHECKS
@@ -3361,8 +3313,9 @@ reply_handler_timeout (void *data)
*
* If -1 is passed for the timeout, a sane default timeout is used. -1
* is typically the best value for the timeout for this reason, unless
- * you want a very short or very long timeout. If INT_MAX is passed for
- * the timeout, no timeout will be set and the call will block forever.
+ * you want a very short or very long timeout. If #DBUS_TIMEOUT_INFINITE is
+ * passed for the timeout, no timeout will be set and the call will block
+ * forever.
*
* @warning if the connection is disconnected or you try to send Unix
* file descriptors on a connection that does not support them, the
@@ -3374,7 +3327,9 @@ reply_handler_timeout (void *data)
* object, or #NULL if connection is disconnected or when you try to
* send Unix file descriptors on a connection that does not support
* them.
- * @param timeout_milliseconds timeout in milliseconds, -1 for default or INT_MAX for no timeout
+ * @param timeout_milliseconds timeout in milliseconds, -1 (or
+ * #DBUS_TIMEOUT_USE_DEFAULT) for default or #DBUS_TIMEOUT_INFINITE for no
+ * timeout
* @returns #FALSE if no memory, #TRUE otherwise.
*
*/
@@ -3507,7 +3462,9 @@ dbus_connection_send_with_reply (DBusConnection *connection,
*
* @param connection the connection
* @param message the message to send
- * @param timeout_milliseconds timeout in milliseconds, -1 for default or INT_MAX for no timeout.
+ * @param timeout_milliseconds timeout in milliseconds, -1 (or
+ * #DBUS_TIMEOUT_USE_DEFAULT) for default or #DBUS_TIMEOUT_INFINITE for no
+ * timeout
* @param error return location for error message
* @returns the message that is the reply or #NULL with an error code if the
* function fails.
diff --git a/dbus/dbus-marshal-header.c b/dbus/dbus-marshal-header.c
index 3f31d7a0..a6c9b80d 100644
--- a/dbus/dbus-marshal-header.c
+++ b/dbus/dbus-marshal-header.c
@@ -1468,14 +1468,20 @@ void
_dbus_header_byteswap (DBusHeader *header,
int new_order)
{
+ unsigned char byte_order;
+
if (header->byte_order == new_order)
return;
+ byte_order = _dbus_string_get_byte (&header->data, BYTE_ORDER_OFFSET);
+ _dbus_assert (header->byte_order == byte_order);
+
_dbus_marshal_byteswap (&_dbus_header_signature_str,
0, header->byte_order,
new_order,
&header->data, 0);
+ _dbus_string_set_byte (&header->data, BYTE_ORDER_OFFSET, new_order);
header->byte_order = new_order;
}
diff --git a/dbus/dbus-message.c b/dbus/dbus-message.c
index 24ef5ac7..a59ed9bf 100644
--- a/dbus/dbus-message.c
+++ b/dbus/dbus-message.c
@@ -4680,7 +4680,7 @@ dbus_message_demarshal_bytes_needed(const char *buf,
if (validity == DBUS_VALID)
{
- _dbus_assert(have_message);
+ _dbus_assert (have_message || (header_len + body_len) > len);
return header_len + body_len;
}
else
diff --git a/dbus/dbus-pending-call.c b/dbus/dbus-pending-call.c
index e1de656a..70392b79 100644
--- a/dbus/dbus-pending-call.c
+++ b/dbus/dbus-pending-call.c
@@ -84,7 +84,9 @@ static dbus_int32_t notify_user_data_slot = -1;
* Creates a new pending reply object.
*
* @param connection connection where reply will arrive
- * @param timeout_milliseconds length of timeout, -1 for default, INT_MAX for no timeout
+ * @param timeout_milliseconds length of timeout, -1 (or
+ * #DBUS_TIMEOUT_USE_DEFAULT) for default,
+ * #DBUS_TIMEOUT_INFINITE for no timeout
* @param timeout_handler timeout handler, takes pending call as data
* @returns a new #DBusPendingCall or #NULL if no memory.
*/
@@ -112,7 +114,7 @@ _dbus_pending_call_new_unlocked (DBusConnection *connection,
return NULL;
}
- if (timeout_milliseconds != _DBUS_INT_MAX)
+ if (timeout_milliseconds != DBUS_TIMEOUT_INFINITE)
{
timeout = _dbus_timeout_new (timeout_milliseconds,
timeout_handler,
@@ -516,6 +518,26 @@ _dbus_pending_call_set_data_unlocked (DBusPendingCall *pending,
*/
/**
+ * @def DBUS_TIMEOUT_INFINITE
+ *
+ * An integer constant representing an infinite timeout. This has the
+ * numeric value 0x7fffffff (the largest 32-bit signed integer).
+ *
+ * For source compatibility with D-Bus versions earlier than 1.4.12, use
+ * 0x7fffffff, or INT32_MAX (assuming your platform has it).
+ */
+
+/**
+ * @def DBUS_TIMEOUT_USE_DEFAULT
+ *
+ * An integer constant representing a request to use the default timeout.
+ * This has numeric value -1.
+ *
+ * For source compatibility with D-Bus versions earlier than 1.4.12, use a
+ * literal -1.
+ */
+
+/**
* @typedef DBusPendingCall
*
* Opaque data type representing a message pending.
diff --git a/dbus/dbus-pending-call.h b/dbus/dbus-pending-call.h
index 8f64b8be..8a37ec0a 100644
--- a/dbus/dbus-pending-call.h
+++ b/dbus/dbus-pending-call.h
@@ -38,6 +38,9 @@ DBUS_BEGIN_DECLS
* @{
*/
+#define DBUS_TIMEOUT_INFINITE ((int) 0x7fffffff)
+#define DBUS_TIMEOUT_USE_DEFAULT (-1)
+
DBUS_EXPORT
DBusPendingCall* dbus_pending_call_ref (DBusPendingCall *pending);
DBUS_EXPORT
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 2344b289..1bcea172 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -116,6 +116,8 @@ DBUS_CONSOLE_AUTH_DIR = @DBUS_CONSOLE_AUTH_DIR@
DBUS_CONSOLE_OWNER_FILE = @DBUS_CONSOLE_OWNER_FILE@
DBUS_DAEMONDIR = @DBUS_DAEMONDIR@
DBUS_DATADIR = @DBUS_DATADIR@
+DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@
+DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@
DBUS_HAVE_INT64 = @DBUS_HAVE_INT64@
DBUS_INT16_TYPE = @DBUS_INT16_TYPE@
DBUS_INT32_TYPE = @DBUS_INT32_TYPE@
@@ -161,6 +163,8 @@ EXPANDED_PREFIX = @EXPANDED_PREFIX@
EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@
FGREP = @FGREP@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -205,7 +209,6 @@ PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
RC = @RC@
R_DYNAMIC_LDFLAG = @R_DYNAMIC_LDFLAG@
-SECTION_LDFLAGS = @SECTION_LDFLAGS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
diff --git a/doc/dbus-faq.html b/doc/dbus-faq.html
index 5a9e96b4..1cb6d7d1 100644
--- a/doc/dbus-faq.html
+++ b/doc/dbus-faq.html
@@ -1,13 +1,13 @@
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>D-Bus FAQ</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="article" title="D-Bus FAQ"><div class="titlepage"><div><div><h2 class="title"><a name="index"></a>D-Bus FAQ</h2></div><div><div class="authorgroup"><div class="author"><h3 class="author"><span class="firstname">Havoc</span> <span class="surname">Pennington</span></h3><div class="affiliation"><span class="orgname">Red Hat, Inc.<br></span><div class="address"><p><br>
    <code class="email">&lt;<a class="email" href="mailto:hp@pobox.com">hp@pobox.com</a>&gt;</code><br>
-   </p></div></div></div><div class="author"><h3 class="author"><span class="firstname">David</span> <span class="othername">A</span> <span class="surname">Wheeler</span></h3></div></div></div><div><p class="releaseinfo">Version 0.3</p></div></div><hr></div><div class="qandaset" title="Frequently Asked Questions"><a name="faq"></a><dl><dt>1. <a href="#idp24880640">
+   </p></div></div></div><div class="author"><h3 class="author"><span class="firstname">David</span> <span class="othername">A</span> <span class="surname">Wheeler</span></h3></div></div></div><div><p class="releaseinfo">Version 0.3</p></div></div><hr></div><div class="qandaset" title="Frequently Asked Questions"><a name="faq"></a><dl><dt>1. <a href="#idp480064">
What is D-Bus?
- </a></dt><dt>2. <a href="#idp28175104">
+ </a></dt><dt>2. <a href="#idp3774560">
Is D-Bus stable/finished?
- </a></dt><dt>3. <a href="#idp28178272">
+ </a></dt><dt>3. <a href="#idp3777728">
How is the reference implementation licensed? Can I use it in
proprietary applications?
- </a></dt><dt>4. <a href="#idp24480960">
+ </a></dt><dt>4. <a href="#idp80512">
What is the difference between a bus name, and object path,
and an interface?
</a></dt><dt>5. <a href="#service">
@@ -39,9 +39,9 @@
How does D-Bus differ from [yet more IPC mechanisms]?
</a></dt><dt>18. <a href="#which-ipc">
Which IPC mechanism should I use?
- </a></dt><dt>19. <a href="#idp29282704">
+ </a></dt><dt>19. <a href="#idp4882016">
How can I submit a bug or patch?
- </a></dt></dl><table border="0" width="100%" summary="Q and A Set"><col align="left" width="1%"><col><tbody><tr class="question" title="1."><td align="left" valign="top"><a name="idp24880640"></a><a name="idp24880896"></a><p><b>1.</b></p></td><td align="left" valign="top"><p>
+ </a></dt></dl><table border="0" width="100%" summary="Q and A Set"><col align="left" width="1%"><col><tbody><tr class="question" title="1."><td align="left" valign="top"><a name="idp480064"></a><a name="idp480320"></a><p><b>1.</b></p></td><td align="left" valign="top"><p>
What is D-Bus?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
This is probably best answered by reading the D-Bus <a class="ulink" href="dbus-tutorial.html" target="_top">tutorial</a> or
@@ -52,7 +52,7 @@
Phrased differently, D-Bus is 1) an interprocess communication (IPC) system and 2) some higher-level
structure (lifecycle tracking, service activation, security policy) provided by two bus daemons,
one systemwide and one per-user-session.
- </p></td></tr><tr class="question" title="2."><td align="left" valign="top"><a name="idp28175104"></a><a name="idp28175360"></a><p><b>2.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="2."><td align="left" valign="top"><a name="idp3774560"></a><a name="idp3774816"></a><p><b>2.</b></p></td><td align="left" valign="top"><p>
Is D-Bus stable/finished?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
The low-level library "libdbus" and the protocol specification are considered
@@ -62,7 +62,7 @@
have their own release schedules and degree of maturity, not linked to
the low-level library and bus daemon release. Check the project page for
the binding you're considering to understand that project's policies.
- </p></td></tr><tr class="question" title="3."><td align="left" valign="top"><a name="idp28178272"></a><a name="idp28178528"></a><p><b>3.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="3."><td align="left" valign="top"><a name="idp3777728"></a><a name="idp3777984"></a><p><b>3.</b></p></td><td align="left" valign="top"><p>
How is the reference implementation licensed? Can I use it in
proprietary applications?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
@@ -77,7 +77,7 @@
use D-Bus</em></span>. If you're going to sue, you have to stop using
the software. Read the licenses to determine their meaning, this FAQ
entry is not intended to change the meaning or terms of the licenses.
- </p></td></tr><tr class="question" title="4."><td align="left" valign="top"><a name="idp24480960"></a><a name="idp24481216"></a><p><b>4.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="4."><td align="left" valign="top"><a name="idp80512"></a><a name="idp80768"></a><p><b>4.</b></p></td><td align="left" valign="top"><p>
What is the difference between a bus name, and object path,
and an interface?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
@@ -107,7 +107,7 @@
interfaces, such as <code class="literal">org.freedesktop.DBus.Introspectable</code>,
<code class="literal">org.freedesktop.BasicTextField</code>,
<code class="literal">org.kde.RichTextDocument</code>.
- </p></td></tr><tr class="question" title="5."><td align="left" valign="top"><a name="service"></a><a name="idp24498144"></a><p><b>5.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="5."><td align="left" valign="top"><a name="service"></a><a name="idp97424"></a><p><b>5.</b></p></td><td align="left" valign="top"><p>
What is a "service"?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
A service is a program that can be launched by the bus daemon
@@ -120,7 +120,7 @@
In the D-Bus docs we try to use "service" only when talking about
programs the bus knows how to launch, i.e. a service always has a
.service file.
- </p></td></tr><tr class="question" title="6."><td align="left" valign="top"><a name="components"></a><a name="idp24501360"></a><p><b>6.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="6."><td align="left" valign="top"><a name="components"></a><a name="idp100640"></a><p><b>6.</b></p></td><td align="left" valign="top"><p>
Is D-Bus a "component system"?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
It helps to keep these concepts separate in your mind:
@@ -170,7 +170,7 @@
from component/object systems, though perhaps a "plugin" tends to be a
bundle of objects with a user-visible name and can be
downloaded/packaged as a unit.
- </p></td></tr><tr class="question" title="7."><td align="left" valign="top"><a name="speed"></a><a name="idp24513904"></a><p><b>7.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="7."><td align="left" valign="top"><a name="speed"></a><a name="idp113184"></a><p><b>7.</b></p></td><td align="left" valign="top"><p>
How fast is the D-Bus reference implementation?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
Of course it depends a bit on what you're doing.
@@ -198,7 +198,7 @@
enable asynchronous communication and avoid round trips.
This is frequently a more important performance issue
than throughput.
- </p></td></tr><tr class="question" title="8."><td align="left" valign="top"><a name="size"></a><a name="idp29197488"></a><p><b>8.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="8."><td align="left" valign="top"><a name="size"></a><a name="idp4796912"></a><p><b>8.</b></p></td><td align="left" valign="top"><p>
How large is the D-Bus reference implementation?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
A production build (with assertions, unit tests, and verbose logging
@@ -207,7 +207,7 @@
A much, much smaller implementation would be possible by omitting out
of memory handling, hardcoding a main loop (or always using blocking
I/O), skipping validation, and otherwise simplifying things.
- </p></td></tr><tr class="question" title="9."><td align="left" valign="top"><a name="other-ipc"></a><a name="idp29200448"></a><p><b>9.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="9."><td align="left" valign="top"><a name="other-ipc"></a><a name="idp4799872"></a><p><b>9.</b></p></td><td align="left" valign="top"><p>
How does D-Bus differ from other interprocess communication
or networking protocols?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
@@ -240,7 +240,7 @@
Note: the D-Bus mailing list subscribers are <span class="emphasis"><em>very much not
interested</em></span> in debating which IPC system is the One True
System. So if you want to discuss that, please use another forum.
- </p></td></tr><tr class="question" title="10."><td align="left" valign="top"><a name="corba"></a><a name="idp29208976"></a><p><b>10.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="10."><td align="left" valign="top"><a name="corba"></a><a name="idp4808400"></a><p><b>10.</b></p></td><td align="left" valign="top"><p>
How does D-Bus differ from CORBA?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
Start by reading <a class="xref" href="#other-ipc" title="9.">Q: 9</a>.
@@ -292,7 +292,7 @@
</p><p>
On a more trivial note, D-Bus involves substantially fewer acronyms
than CORBA.
- </p></td></tr><tr class="question" title="11."><td align="left" valign="top"><a name="xmlrpcsoap"></a><a name="idp24449648"></a><p><b>11.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="11."><td align="left" valign="top"><a name="xmlrpcsoap"></a><a name="idp49472"></a><p><b>11.</b></p></td><td align="left" valign="top"><p>
How does D-Bus differ from XML-RPC and SOAP?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
Start by reading <a class="xref" href="#other-ipc" title="9.">Q: 9</a>.
@@ -311,7 +311,7 @@
supports lifecycle tracking of other applications connected
to the bus. With XML-RPC and SOAP, typically each method call
exists in isolation and has its own HTTP connection.
- </p></td></tr><tr class="question" title="12."><td align="left" valign="top"><a name="dce"></a><a name="idp29248064"></a><p><b>12.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="12."><td align="left" valign="top"><a name="dce"></a><a name="idp4847376"></a><p><b>12.</b></p></td><td align="left" valign="top"><p>
How does D-Bus differ from DCE?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
Start by reading <a class="xref" href="#other-ipc" title="9.">Q: 9</a>.
@@ -324,7 +324,7 @@
a distributed time service. As the name implies, DCE is intended for
use in a large, multi-computer distributed application. D-Bus would
not be well-suited for this.
- </p></td></tr><tr class="question" title="13."><td align="left" valign="top"><a name="dcom"></a><a name="idp29252864"></a><p><b>13.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="13."><td align="left" valign="top"><a name="dcom"></a><a name="idp4852176"></a><p><b>13.</b></p></td><td align="left" valign="top"><p>
How does D-Bus differ from DCOM and COM?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
Start by reading <a class="xref" href="#other-ipc" title="9.">Q: 9</a>.
@@ -334,7 +334,7 @@
</p><p>
DCOM (distributed COM) is a Windows IPC system designed for use with
the COM object system. It's similar in some ways to DCE and CORBA.
- </p></td></tr><tr class="question" title="14."><td align="left" valign="top"><a name="internet-communications-engine"></a><a name="idp29257136"></a><p><b>14.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="14."><td align="left" valign="top"><a name="internet-communications-engine"></a><a name="idp4856448"></a><p><b>14.</b></p></td><td align="left" valign="top"><p>
How does D-Bus differ from ZeroC's Internet Communications Engine (Ice)
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
Start by reading <a class="xref" href="#other-ipc" title="9.">Q: 9</a>.
@@ -344,7 +344,7 @@
on the level of SOAP or CORBA than D-Bus. Ice has a "dual-license"
business around it; i.e. you can use it under the GPL, or pay for a
proprietary license.
- </p></td></tr><tr class="question" title="15."><td align="left" valign="top"><a name="inter-client-exchange"></a><a name="idp29261152"></a><p><b>15.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="15."><td align="left" valign="top"><a name="inter-client-exchange"></a><a name="idp4860464"></a><p><b>15.</b></p></td><td align="left" valign="top"><p>
How does D-Bus differ from Inter-Client Exchange (ICE)?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
<a class="ulink" href="http://www.x.org/X11R6.8.1/docs/ICE/ice.pdf" target="_top">ICE</a>
@@ -362,7 +362,7 @@
DCOP and XSMP are the only two widely-used applications of ICE,
and both could in principle be replaced by D-Bus. (Though whether
GNOME and KDE will bother is an open question.)
- </p></td></tr><tr class="question" title="16."><td align="left" valign="top"><a name="dcop"></a><a name="idp29265776"></a><p><b>16.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="16."><td align="left" valign="top"><a name="dcop"></a><a name="idp4865088"></a><p><b>16.</b></p></td><td align="left" valign="top"><p>
How does D-Bus differ from DCOP?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
Start by reading <a class="xref" href="#other-ipc" title="9.">Q: 9</a>.
@@ -389,14 +389,14 @@
DCOP's implementation to use D-Bus internally (so that GNOME and KDE
would end up using exactly the same bus). See the KDE mailing list
archives for some of these discussions.
- </p></td></tr><tr class="question" title="17."><td align="left" valign="top"><a name="yet-more-ipc"></a><a name="idp29272768"></a><p><b>17.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="17."><td align="left" valign="top"><a name="yet-more-ipc"></a><a name="idp4872080"></a><p><b>17.</b></p></td><td align="left" valign="top"><p>
How does D-Bus differ from [yet more IPC mechanisms]?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
Start by reading <a class="xref" href="#other-ipc" title="9.">Q: 9</a>.
</p><p>
There are countless uses of network sockets in the world. <a class="ulink" href="http://www.mbus.org/" target="_top">MBUS</a>, Sun ONC/RPC, Jabber/XMPP,
SIP, are some we can think of quickly.
- </p></td></tr><tr class="question" title="18."><td align="left" valign="top"><a name="which-ipc"></a><a name="idp29276704"></a><p><b>18.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="18."><td align="left" valign="top"><a name="which-ipc"></a><a name="idp4876016"></a><p><b>18.</b></p></td><td align="left" valign="top"><p>
Which IPC mechanism should I use?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
Start by reading <a class="xref" href="#other-ipc" title="9.">Q: 9</a>.
@@ -427,7 +427,7 @@
to search the list archives is probably to use
an Internet engine such as Google. On Google,
include "site:freedesktop.org" in your search.
- </p></td></tr><tr class="question" title="19."><td align="left" valign="top"><a name="idp29282704"></a><a name="idp29282960"></a><p><b>19.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="19."><td align="left" valign="top"><a name="idp4882016"></a><a name="idp4882272"></a><p><b>19.</b></p></td><td align="left" valign="top"><p>
How can I submit a bug or patch?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
The D-Bus <a class="ulink" href="http://dbus.freedesktop.org" target="_top">web site</a>
diff --git a/doc/dbus-specification.html b/doc/dbus-specification.html
index 7b772f21..25df08f7 100644
--- a/doc/dbus-specification.html
+++ b/doc/dbus-specification.html
@@ -6,7 +6,7 @@
            <code class="email">&lt;<a class="email" href="mailto:alexl@redhat.com">alexl@redhat.com</a>&gt;</code><br>
          </p></div></div></div><div class="author"><h3 class="author"><span class="firstname">Sven</span> <span class="surname">Herzberg</span></h3><div class="affiliation"><span class="orgname">Imendio AB<br></span><div class="address"><p><br>
            <code class="email">&lt;<a class="email" href="mailto:sven@imendio.com">sven@imendio.com</a>&gt;</code><br>
-          </p></div></div></div></div></div><div><p class="releaseinfo">Version 0.15</p></div><div><div class="revhistory"><table border="1" width="100%" summary="Revision history"><tr><th align="left" valign="top" colspan="3"><b>Revision History</b></th></tr><tr><td align="left">Revision current</td><td align="left"><a class="ulink" href="http://cgit.freedesktop.org/dbus/dbus/log/doc/dbus-specification.xml" target="_top">commit log</a></td><td align="left"></td></tr><tr><td align="left" colspan="3"></td></tr><tr><td align="left">Revision 0.15</td><td align="left">3 November 2010</td><td align="left"></td></tr><tr><td align="left" colspan="3"></td></tr><tr><td align="left">Revision 0.14</td><td align="left">12 May 2010</td><td align="left"></td></tr><tr><td align="left" colspan="3"></td></tr><tr><td align="left">Revision 0.13</td><td align="left">23 Dezember 2009</td><td align="left"></td></tr><tr><td align="left" colspan="3"></td></tr><tr><td align="left">Revision 0.12</td><td align="left">7 November, 2006</td><td align="left"></td></tr><tr><td align="left" colspan="3"></td></tr><tr><td align="left">Revision 0.11</td><td align="left">6 February 2005</td><td align="left"></td></tr><tr><td align="left" colspan="3"></td></tr><tr><td align="left">Revision 0.10</td><td align="left">28 January 2005</td><td align="left"></td></tr><tr><td align="left" colspan="3"></td></tr><tr><td align="left">Revision 0.9</td><td align="left">7 Januar 2005</td><td align="left"></td></tr><tr><td align="left" colspan="3"></td></tr><tr><td align="left">Revision 0.8</td><td align="left">06 September 2003</td><td align="left"></td></tr><tr><td align="left" colspan="3">First released document.</td></tr></table></div></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="#introduction">Introduction</a></span></dt><dd><dl><dt><span class="sect2"><a href="#stability">Protocol and Specification Stability</a></span></dt></dl></dd><dt><span class="sect1"><a href="#message-protocol">Message Protocol</a></span></dt><dd><dl><dt><span class="sect2"><a href="#message-protocol-signatures">Type Signatures</a></span></dt><dt><span class="sect2"><a href="#message-protocol-marshaling">Marshaling (Wire Format)</a></span></dt><dt><span class="sect2"><a href="#message-protocol-messages">Message Format</a></span></dt><dt><span class="sect2"><a href="#message-protocol-names">Valid Names</a></span></dt><dt><span class="sect2"><a href="#message-protocol-types">Message Types</a></span></dt><dt><span class="sect2"><a href="#message-protocol-handling-invalid">Invalid Protocol and Spec Extensions</a></span></dt></dl></dd><dt><span class="sect1"><a href="#auth-protocol">Authentication Protocol</a></span></dt><dd><dl><dt><span class="sect2"><a href="#auth-protocol-overview">Protocol Overview</a></span></dt><dt><span class="sect2"><a href="#auth-nul-byte">Special credentials-passing nul byte</a></span></dt><dt><span class="sect2"><a href="#auth-command-auth">AUTH command</a></span></dt><dt><span class="sect2"><a href="#auth-command-cancel">CANCEL Command</a></span></dt><dt><span class="sect2"><a href="#auth-command-data">DATA Command</a></span></dt><dt><span class="sect2"><a href="#auth-command-begin">BEGIN Command</a></span></dt><dt><span class="sect2"><a href="#auth-command-rejected">REJECTED Command</a></span></dt><dt><span class="sect2"><a href="#auth-command-ok">OK Command</a></span></dt><dt><span class="sect2"><a href="#auth-command-error">ERROR Command</a></span></dt><dt><span class="sect2"><a href="#auth-command-negotiate-unix-fd">NEGOTIATE_UNIX_FD Command</a></span></dt><dt><span class="sect2"><a href="#auth-command-agree-unix-fd">AGREE_UNIX_FD Command</a></span></dt><dt><span class="sect2"><a href="#auth-command-future">Future Extensions</a></span></dt><dt><span class="sect2"><a href="#auth-examples">Authentication examples</a></span></dt><dt><span class="sect2"><a href="#auth-states">Authentication state diagrams</a></span></dt><dt><span class="sect2"><a href="#auth-mechanisms">Authentication mechanisms</a></span></dt></dl></dd><dt><span class="sect1"><a href="#addresses">Server Addresses</a></span></dt><dt><span class="sect1"><a href="#transports">Transports</a></span></dt><dd><dl><dt><span class="sect2"><a href="#transports-unix-domain-sockets">Unix Domain Sockets</a></span></dt><dt><span class="sect2"><a href="#transports-launchd">launchd</a></span></dt><dt><span class="sect2"><a href="#transports-tcp-sockets">TCP Sockets</a></span></dt><dt><span class="sect2"><a href="#transports-nonce-tcp-sockets">Nonce-secured TCP Sockets</a></span></dt></dl></dd><dt><span class="sect1"><a href="#meta-transports">Meta Transports</a></span></dt><dd><dl><dt><span class="sect2"><a href="#meta-transports-autolaunch">Autolaunch</a></span></dt></dl></dd><dt><span class="sect1"><a href="#naming-conventions">Naming Conventions</a></span></dt><dt><span class="sect1"><a href="#uuids">UUIDs</a></span></dt><dt><span class="sect1"><a href="#standard-interfaces">Standard Interfaces</a></span></dt><dd><dl><dt><span class="sect2"><a href="#standard-interfaces-peer"><code class="literal">org.freedesktop.DBus.Peer</code></a></span></dt><dt><span class="sect2"><a href="#standard-interfaces-introspectable"><code class="literal">org.freedesktop.DBus.Introspectable</code></a></span></dt><dt><span class="sect2"><a href="#standard-interfaces-properties"><code class="literal">org.freedesktop.DBus.Properties</code></a></span></dt></dl></dd><dt><span class="sect1"><a href="#introspection-format">Introspection Data Format</a></span></dt><dt><span class="sect1"><a href="#message-bus">Message Bus Specification</a></span></dt><dd><dl><dt><span class="sect2"><a href="#message-bus-overview">Message Bus Overview</a></span></dt><dt><span class="sect2"><a href="#message-bus-names">Message Bus Names</a></span></dt><dt><span class="sect2"><a href="#message-bus-routing">Message Bus Message Routing</a></span></dt><dt><span class="sect2"><a href="#message-bus-starting-services">Message Bus Starting Services</a></span></dt><dt><span class="sect2"><a href="#message-bus-types">Well-known Message Bus Instances</a></span></dt><dt><span class="sect2"><a href="#message-bus-messages">Message Bus Messages</a></span></dt></dl></dd><dt><span class="glossary"><a href="#idp5788992">Glossary</a></span></dt></dl></div><div class="sect1" title="Introduction"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="introduction"></a>Introduction</h2></div></div></div><p>
+          </p></div></div></div></div></div><div><p class="releaseinfo">Version 0.15</p></div><div><div class="revhistory"><table border="1" width="100%" summary="Revision history"><tr><th align="left" valign="top" colspan="3"><b>Revision History</b></th></tr><tr><td align="left">Revision current</td><td align="left"><a class="ulink" href="http://cgit.freedesktop.org/dbus/dbus/log/doc/dbus-specification.xml" target="_top">commit log</a></td><td align="left"></td></tr><tr><td align="left" colspan="3"></td></tr><tr><td align="left">Revision 0.15</td><td align="left">3 November 2010</td><td align="left"></td></tr><tr><td align="left" colspan="3"></td></tr><tr><td align="left">Revision 0.14</td><td align="left">12 May 2010</td><td align="left"></td></tr><tr><td align="left" colspan="3"></td></tr><tr><td align="left">Revision 0.13</td><td align="left">23 Dezember 2009</td><td align="left"></td></tr><tr><td align="left" colspan="3"></td></tr><tr><td align="left">Revision 0.12</td><td align="left">7 November, 2006</td><td align="left"></td></tr><tr><td align="left" colspan="3"></td></tr><tr><td align="left">Revision 0.11</td><td align="left">6 February 2005</td><td align="left"></td></tr><tr><td align="left" colspan="3"></td></tr><tr><td align="left">Revision 0.10</td><td align="left">28 January 2005</td><td align="left"></td></tr><tr><td align="left" colspan="3"></td></tr><tr><td align="left">Revision 0.9</td><td align="left">7 Januar 2005</td><td align="left"></td></tr><tr><td align="left" colspan="3"></td></tr><tr><td align="left">Revision 0.8</td><td align="left">06 September 2003</td><td align="left"></td></tr><tr><td align="left" colspan="3">First released document.</td></tr></table></div></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="#introduction">Introduction</a></span></dt><dd><dl><dt><span class="sect2"><a href="#stability">Protocol and Specification Stability</a></span></dt></dl></dd><dt><span class="sect1"><a href="#message-protocol">Message Protocol</a></span></dt><dd><dl><dt><span class="sect2"><a href="#message-protocol-signatures">Type Signatures</a></span></dt><dt><span class="sect2"><a href="#message-protocol-marshaling">Marshaling (Wire Format)</a></span></dt><dt><span class="sect2"><a href="#message-protocol-messages">Message Format</a></span></dt><dt><span class="sect2"><a href="#message-protocol-names">Valid Names</a></span></dt><dt><span class="sect2"><a href="#message-protocol-types">Message Types</a></span></dt><dt><span class="sect2"><a href="#message-protocol-handling-invalid">Invalid Protocol and Spec Extensions</a></span></dt></dl></dd><dt><span class="sect1"><a href="#auth-protocol">Authentication Protocol</a></span></dt><dd><dl><dt><span class="sect2"><a href="#auth-protocol-overview">Protocol Overview</a></span></dt><dt><span class="sect2"><a href="#auth-nul-byte">Special credentials-passing nul byte</a></span></dt><dt><span class="sect2"><a href="#auth-command-auth">AUTH command</a></span></dt><dt><span class="sect2"><a href="#auth-command-cancel">CANCEL Command</a></span></dt><dt><span class="sect2"><a href="#auth-command-data">DATA Command</a></span></dt><dt><span class="sect2"><a href="#auth-command-begin">BEGIN Command</a></span></dt><dt><span class="sect2"><a href="#auth-command-rejected">REJECTED Command</a></span></dt><dt><span class="sect2"><a href="#auth-command-ok">OK Command</a></span></dt><dt><span class="sect2"><a href="#auth-command-error">ERROR Command</a></span></dt><dt><span class="sect2"><a href="#auth-command-negotiate-unix-fd">NEGOTIATE_UNIX_FD Command</a></span></dt><dt><span class="sect2"><a href="#auth-command-agree-unix-fd">AGREE_UNIX_FD Command</a></span></dt><dt><span class="sect2"><a href="#auth-command-future">Future Extensions</a></span></dt><dt><span class="sect2"><a href="#auth-examples">Authentication examples</a></span></dt><dt><span class="sect2"><a href="#auth-states">Authentication state diagrams</a></span></dt><dt><span class="sect2"><a href="#auth-mechanisms">Authentication mechanisms</a></span></dt></dl></dd><dt><span class="sect1"><a href="#addresses">Server Addresses</a></span></dt><dt><span class="sect1"><a href="#transports">Transports</a></span></dt><dd><dl><dt><span class="sect2"><a href="#transports-unix-domain-sockets">Unix Domain Sockets</a></span></dt><dt><span class="sect2"><a href="#transports-launchd">launchd</a></span></dt><dt><span class="sect2"><a href="#transports-tcp-sockets">TCP Sockets</a></span></dt><dt><span class="sect2"><a href="#transports-nonce-tcp-sockets">Nonce-secured TCP Sockets</a></span></dt></dl></dd><dt><span class="sect1"><a href="#meta-transports">Meta Transports</a></span></dt><dd><dl><dt><span class="sect2"><a href="#meta-transports-autolaunch">Autolaunch</a></span></dt></dl></dd><dt><span class="sect1"><a href="#naming-conventions">Naming Conventions</a></span></dt><dt><span class="sect1"><a href="#uuids">UUIDs</a></span></dt><dt><span class="sect1"><a href="#standard-interfaces">Standard Interfaces</a></span></dt><dd><dl><dt><span class="sect2"><a href="#standard-interfaces-peer"><code class="literal">org.freedesktop.DBus.Peer</code></a></span></dt><dt><span class="sect2"><a href="#standard-interfaces-introspectable"><code class="literal">org.freedesktop.DBus.Introspectable</code></a></span></dt><dt><span class="sect2"><a href="#standard-interfaces-properties"><code class="literal">org.freedesktop.DBus.Properties</code></a></span></dt></dl></dd><dt><span class="sect1"><a href="#introspection-format">Introspection Data Format</a></span></dt><dt><span class="sect1"><a href="#message-bus">Message Bus Specification</a></span></dt><dd><dl><dt><span class="sect2"><a href="#message-bus-overview">Message Bus Overview</a></span></dt><dt><span class="sect2"><a href="#message-bus-names">Message Bus Names</a></span></dt><dt><span class="sect2"><a href="#message-bus-routing">Message Bus Message Routing</a></span></dt><dt><span class="sect2"><a href="#message-bus-starting-services">Message Bus Starting Services</a></span></dt><dt><span class="sect2"><a href="#message-bus-types">Well-known Message Bus Instances</a></span></dt><dt><span class="sect2"><a href="#message-bus-messages">Message Bus Messages</a></span></dt></dl></dd><dt><span class="glossary"><a href="#idp5788624">Glossary</a></span></dt></dl></div><div class="sect1" title="Introduction"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="introduction"></a>Introduction</h2></div></div></div><p>
D-Bus is a system for low-latency, low-overhead, easy to use
interprocess communication (IPC). In more detail:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
@@ -899,14 +899,14 @@
commands may be introduced both before, and after
authentication, i.e. both before and after the OK command.
</p></div><div class="sect2" title="Authentication examples"><div class="titlepage"><div><div><h3 class="title"><a name="auth-examples"></a>Authentication examples</h3></div></div></div><p>
- </p><div class="figure"><a name="idp5161344"></a><p class="title"><b>Figure 1. Example of successful magic cookie authentication</b></p><div class="figure-contents"><pre class="programlisting">
+ </p><div class="figure"><a name="idp5160880"></a><p class="title"><b>Figure 1. Example of successful magic cookie authentication</b></p><div class="figure-contents"><pre class="programlisting">
(MAGIC_COOKIE is a made up mechanism)
C: AUTH MAGIC_COOKIE 3138363935333137393635383634
S: OK 1234deadbeef
C: BEGIN
</pre></div></div><p><br class="figure-break">
- </p><div class="figure"><a name="idp5163168"></a><p class="title"><b>Figure 2. Example of finding out mechanisms then picking one</b></p><div class="figure-contents"><pre class="programlisting">
+ </p><div class="figure"><a name="idp5162704"></a><p class="title"><b>Figure 2. Example of finding out mechanisms then picking one</b></p><div class="figure-contents"><pre class="programlisting">
C: AUTH
S: REJECTED KERBEROS_V4 SKEY
C: AUTH SKEY 7ab83f32ee
@@ -915,14 +915,14 @@
S: OK 1234deadbeef
C: BEGIN
</pre></div></div><p><br class="figure-break">
- </p><div class="figure"><a name="idp5165072"></a><p class="title"><b>Figure 3. Example of client sends unknown command then falls back to regular auth</b></p><div class="figure-contents"><pre class="programlisting">
+ </p><div class="figure"><a name="idp5164608"></a><p class="title"><b>Figure 3. Example of client sends unknown command then falls back to regular auth</b></p><div class="figure-contents"><pre class="programlisting">
C: FOOBAR
S: ERROR
C: AUTH MAGIC_COOKIE 3736343435313230333039
S: OK 1234deadbeef
C: BEGIN
</pre></div></div><p><br class="figure-break">
- </p><div class="figure"><a name="idp5166960"></a><p class="title"><b>Figure 4. Example of server doesn't support initial auth mechanism</b></p><div class="figure-contents"><pre class="programlisting">
+ </p><div class="figure"><a name="idp5166496"></a><p class="title"><b>Figure 4. Example of server doesn't support initial auth mechanism</b></p><div class="figure-contents"><pre class="programlisting">
C: AUTH MAGIC_COOKIE 3736343435313230333039
S: REJECTED KERBEROS_V4 SKEY
C: AUTH SKEY 7ab83f32ee
@@ -931,7 +931,7 @@
S: OK 1234deadbeef
C: BEGIN
</pre></div></div><p><br class="figure-break">
- </p><div class="figure"><a name="idp5168976"></a><p class="title"><b>Figure 5. Example of wrong password or the like followed by successful retry</b></p><div class="figure-contents"><pre class="programlisting">
+ </p><div class="figure"><a name="idp5168512"></a><p class="title"><b>Figure 5. Example of wrong password or the like followed by successful retry</b></p><div class="figure-contents"><pre class="programlisting">
C: AUTH MAGIC_COOKIE 3736343435313230333039
S: REJECTED KERBEROS_V4 SKEY
C: AUTH SKEY 7ab83f32ee
@@ -944,7 +944,7 @@
S: OK 1234deadbeef
C: BEGIN
</pre></div></div><p><br class="figure-break">
- </p><div class="figure"><a name="idp5171152"></a><p class="title"><b>Figure 6. Example of skey cancelled and restarted</b></p><div class="figure-contents"><pre class="programlisting">
+ </p><div class="figure"><a name="idp5170688"></a><p class="title"><b>Figure 6. Example of skey cancelled and restarted</b></p><div class="figure-contents"><pre class="programlisting">
C: AUTH MAGIC_COOKIE 3736343435313230333039
S: REJECTED KERBEROS_V4 SKEY
C: AUTH SKEY 7ab83f32ee
@@ -957,7 +957,7 @@
S: OK 1234deadbeef
C: BEGIN
</pre></div></div><p><br class="figure-break">
- </p><div class="figure"><a name="idp5173216"></a><p class="title"><b>Figure 7. Example of successful magic cookie authentication with successful negotiation of Unix FD passing</b></p><div class="figure-contents"><pre class="programlisting">
+ </p><div class="figure"><a name="idp5172752"></a><p class="title"><b>Figure 7. Example of successful magic cookie authentication with successful negotiation of Unix FD passing</b></p><div class="figure-contents"><pre class="programlisting">
(MAGIC_COOKIE is a made up mechanism)
C: AUTH MAGIC_COOKIE 3138363935333137393635383634
@@ -966,7 +966,7 @@
S: AGREE_UNIX_FD
C: BEGIN
</pre></div></div><p><br class="figure-break">
- </p><div class="figure"><a name="idp5175216"></a><p class="title"><b>Figure 8. Example of successful magic cookie authentication with unsuccessful negotiation of Unix FD passing</b></p><div class="figure-contents"><pre class="programlisting">
+ </p><div class="figure"><a name="idp5174752"></a><p class="title"><b>Figure 8. Example of successful magic cookie authentication with unsuccessful negotiation of Unix FD passing</b></p><div class="figure-contents"><pre class="programlisting">
(MAGIC_COOKIE is a made up mechanism)
C: AUTH MAGIC_COOKIE 3138363935333137393635383634
@@ -1244,7 +1244,7 @@
fails, the lock fails. Servers should retry for a reasonable
period of time, then they may choose to delete an existing lock
to keep users from having to manually delete a stale
- lock. <sup>[<a name="idp5260576" href="#ftn.idp5260576" class="footnote">1</a>]</sup>
+ lock. <sup>[<a name="idp5260208" href="#ftn.idp5260208" class="footnote">1</a>]</sup>
</p></li><li class="listitem"><p>
Once the lockfile has been created, the server loads the cookie
file. It should then delete any cookies that are old (the
@@ -2010,7 +2010,7 @@
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>General syntax</p></li><li class="listitem"><p>Comment format</p></li></ul></div><p>
- </p><div class="figure"><a name="idp5565600"></a><p class="title"><b>Figure 9. Example service description file</b></p><div class="figure-contents"><pre class="programlisting">
+ </p><div class="figure"><a name="idp5565232"></a><p class="title"><b>Figure 9. Example service description file</b></p><div class="figure-contents"><pre class="programlisting">
# Sample service description file
[D-BUS Service]
Names=org.freedesktop.ConfigurationDatabase;org.gnome.GConf;
@@ -2180,7 +2180,7 @@
allowing another process to set the selection between the
verification and the setting (e.g., by using XGrabServer /
XungrabServer).
- </p></div><div class="sect4"><div class="titlepage"><div><div><h5 class="title"><a name="idp5618368"></a></h5></div></div></div><p>
+ </p></div><div class="sect4"><div class="titlepage"><div><div><h5 class="title"><a name="idp5618000"></a></h5></div></div></div><p>
[FIXME specify location of .service files, probably using
DESKTOP_DIRS etc. from basedir specification, though login session
bus is not really desktop-specific]
@@ -2195,7 +2195,7 @@
variable. If that variable is not set, applications should try
to connect to the well-known address
<code class="literal">unix:path=/var/run/dbus/system_bus_socket</code>.
- <sup>[<a name="idp5623392" href="#ftn.idp5623392" class="footnote">2</a>]</sup>
+ <sup>[<a name="idp5623024" href="#ftn.idp5623024" class="footnote">2</a>]</sup>
</p><p>
[FIXME specify location of system bus .service files]
</p></div></div><div class="sect2" title="Message Bus Messages"><div class="titlepage"><div><div><h3 class="title"><a name="message-bus-messages"></a>Message Bus Messages</h3></div></div></div><p>
@@ -2380,7 +2380,7 @@
There is also a per-machine ID, described in <a class="xref" href="#standard-interfaces-peer" title="org.freedesktop.DBus.Peer">the section called &#8220;<code class="literal">org.freedesktop.DBus.Peer</code>&#8221;</a> and returned
by org.freedesktop.DBus.Peer.GetMachineId().
For a desktop session bus, the bus ID can be used as a way to uniquely identify a user's session.
- </p></div></div></div><div class="glossary" title="Glossary"><div class="titlepage"><div><div><h2 class="title"><a name="idp5788992"></a>Glossary</h2></div></div></div><p>
+ </p></div></div></div><div class="glossary" title="Glossary"><div class="titlepage"><div><div><h2 class="title"><a name="idp5788624"></a>Glossary</h2></div></div></div><p>
This glossary defines some of the terms used in this specification.
</p><dl><dt><a name="term-bus-name"></a>Bus Name</dt><dd><p>
The message bus maintains an association between names and
@@ -2454,10 +2454,10 @@
message bus. This name will never change owner, and will be unique
(never reused during the lifetime of the message bus).
It will begin with a ':' character.
- </p></dd></dl></div><div class="footnotes"><br><hr width="100" align="left"><div class="footnote"><p><sup>[<a name="ftn.idp5260576" href="#idp5260576" class="para">1</a>] </sup>Lockfiles are used instead of real file
+ </p></dd></dl></div><div class="footnotes"><br><hr width="100" align="left"><div class="footnote"><p><sup>[<a name="ftn.idp5260208" href="#idp5260208" class="para">1</a>] </sup>Lockfiles are used instead of real file
locking <code class="literal">fcntl()</code> because real locking
implementations are still flaky on network
- filesystems.</p></div><div class="footnote"><p><sup>[<a name="ftn.idp5623392" href="#idp5623392" class="para">2</a>] </sup>
+ filesystems.</p></div><div class="footnote"><p><sup>[<a name="ftn.idp5623024" href="#idp5623024" class="para">2</a>] </sup>
The D-Bus reference implementation actually honors the
<code class="literal">$(localstatedir)</code> configure option
for this address, on both client and server side.
diff --git a/doc/dbus-test-plan.html b/doc/dbus-test-plan.html
index a8fc8674..1eaafd23 100644
--- a/doc/dbus-test-plan.html
+++ b/doc/dbus-test-plan.html
@@ -38,7 +38,7 @@
Message Builder. The message builder can take a serialized
message in string-form and convert it into a raw character
string which can then be loaded by the message loader.
- </p><div class="figure"><a name="idp59024"></a><p class="title"><b>Figure 1. Example of a message in string form</b></p><div class="figure-contents"><pre class="programlisting">
+ </p><div class="figure"><a name="idp58256"></a><p class="title"><b>Figure 1. Example of a message in string form</b></p><div class="figure-contents"><pre class="programlisting">
# Standard org.freedesktop.DBus.Hello message
VALID_HEADER
@@ -75,7 +75,7 @@
can read authentication sequences from a file and play them
back to a dummy server and client to make sure that
authentication is working according to the specification.
- </p><div class="figure"><a name="idp65712"></a><p class="title"><b>Figure 2. Example of an authentication script</b></p><div class="figure-contents"><pre class="programlisting">
+ </p><div class="figure"><a name="idp64944"></a><p class="title"><b>Figure 2. Example of an authentication script</b></p><div class="figure-contents"><pre class="programlisting">
## this tests a successful auth of type EXTERNAL
SERVER
diff --git a/test/Makefile.am b/test/Makefile.am
index 9d0681b7..99740c9a 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -52,7 +52,8 @@ test_segfault_SOURCES = \
test_sleep_forever_SOURCES = \
test-sleep-forever.c
-# When any programs are not linked to libdbus-internal, fix this.
+# This assumes that most tests will be linked to libdbus-internal;
+# tests linked to only the public libdbus have their own CPPFLAGS.
AM_CPPFLAGS=-DDBUS_STATIC_BUILD
TEST_LIBS=$(top_builddir)/dbus/libdbus-internal.la $(DBUS_TEST_LIBS)
@@ -69,7 +70,89 @@ shell_test_LDFLAGS=@R_DYNAMIC_LDFLAG@
spawn_test_LDADD=$(TEST_LIBS)
spawn_test_LDFLAGS=@R_DYNAMIC_LDFLAG@
-EXTRA_DIST=
+EXTRA_DIST = dbus-test-runner
+
+testexecdir = $(libdir)/dbus-1.0/test
+
+testexec_PROGRAMS =
+
+installable_tests = \
+ test-corrupt \
+ test-dbus-daemon \
+ test-loopback \
+ test-marshal \
+ test-relay \
+ $(NULL)
+
+installcheck_tests =
+installcheck_environment = \
+ DBUS_TEST_DAEMON=$(DESTDIR)$(DBUS_DAEMONDIR)/dbus-daemon$(EXEEXT) \
+ DBUS_TEST_SYSCONFDIR=$(DESTDIR)$(sysconfdir)
+
+TESTS_ENVIRONMENT = \
+ DBUS_TEST_DAEMON=@abs_top_builddir@/bus/dbus-daemon$(EXEEXT) \
+ DBUS_TEST_DATA=@abs_top_builddir@/test/data
+
+test_corrupt_SOURCES = corrupt.c
+test_corrupt_CPPFLAGS = $(GLIB_CFLAGS) $(DBUS_GLIB_CFLAGS)
+test_corrupt_LDFLAGS = @R_DYNAMIC_LDFLAG@
+test_corrupt_LDADD = $(top_builddir)/dbus/libdbus-1.la \
+ $(GLIB_LIBS) \
+ $(DBUS_GLIB_LIBS)
+
+test_loopback_SOURCES = loopback.c
+test_loopback_CPPFLAGS = $(GLIB_CFLAGS) $(DBUS_GLIB_CFLAGS)
+test_loopback_LDFLAGS = @R_DYNAMIC_LDFLAG@
+test_loopback_LDADD = $(top_builddir)/dbus/libdbus-1.la \
+ $(GLIB_LIBS) \
+ $(DBUS_GLIB_LIBS)
+
+test_relay_SOURCES = relay.c
+test_relay_CPPFLAGS = $(GLIB_CFLAGS) $(DBUS_GLIB_CFLAGS)
+test_relay_LDFLAGS = @R_DYNAMIC_LDFLAG@
+test_relay_LDADD = $(top_builddir)/dbus/libdbus-1.la \
+ $(GLIB_LIBS) \
+ $(DBUS_GLIB_LIBS)
+
+test_dbus_daemon_SOURCES = dbus-daemon.c
+test_dbus_daemon_CPPFLAGS = $(GLIB_CFLAGS) $(DBUS_GLIB_CFLAGS)
+test_dbus_daemon_LDFLAGS = @R_DYNAMIC_LDFLAG@
+test_dbus_daemon_LDADD = $(top_builddir)/dbus/libdbus-1.la \
+ $(GLIB_LIBS) \
+ $(DBUS_GLIB_LIBS)
+
+test_marshal_SOURCES = marshal.c
+test_marshal_CPPFLAGS = $(GLIB_CFLAGS) $(DBUS_GLIB_CFLAGS)
+test_marshal_LDFLAGS = @R_DYNAMIC_LDFLAG@
+test_marshal_LDADD = $(top_builddir)/dbus/libdbus-1.la \
+ $(GLIB_LIBS) \
+ $(DBUS_GLIB_LIBS)
+
+if DBUS_ENABLE_MODULAR_TESTS
+TESTS += $(installable_tests)
+installcheck_tests += $(installable_tests)
+
+if DBUS_ENABLE_INSTALLED_TESTS
+ testexec_PROGRAMS += $(installable_tests)
+else !DBUS_ENABLE_INSTALLED_TESTS
+ noinst_PROGRAMS += $(installable_tests)
+endif !DBUS_ENABLE_INSTALLED_TESTS
+
+endif DBUS_ENABLE_MODULAR_TESTS
+
+# If we're installing the tests into a DESTDIR we can't run them
+# again using the installed copy, because we don't know how to
+# do a portable equivalent of setting LD_LIBRARY_PATH.
+installcheck-local:
+ $(MAKE) check-TESTS TESTS='$$(installcheck_tests)' \
+ TESTS_ENVIRONMENT='$$(installcheck_environment)'
+if DBUS_ENABLE_INSTALLED_TESTS
+ test -n "$(DESTDIR)" || \
+ $(installcheck_environment) \
+ $(srcdir)/dbus-test-runner \
+ $(testexecdir) \
+ $(testexec_PROGRAMS)
+endif DBUS_ENABLE_INSTALLED_TESTS
## keep these in creation order, i.e. uppermost dirs first
TESTDIRS= \
diff --git a/test/Makefile.in b/test/Makefile.in
index 2c9fbd17..c9a0ab76 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -35,8 +35,14 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-@DBUS_BUILD_TESTS_TRUE@TESTS = shell-test$(EXEEXT)
-noinst_PROGRAMS = $(am__EXEEXT_1)
+@DBUS_BUILD_TESTS_FALSE@TESTS = $(am__EXEEXT_5)
+@DBUS_BUILD_TESTS_TRUE@TESTS = shell-test$(EXEEXT) $(am__EXEEXT_5)
+noinst_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_3)
+testexec_PROGRAMS = $(am__EXEEXT_4)
+@DBUS_ENABLE_MODULAR_TESTS_TRUE@am__append_1 = $(installable_tests)
+@DBUS_ENABLE_MODULAR_TESTS_TRUE@am__append_2 = $(installable_tests)
+@DBUS_ENABLE_INSTALLED_TESTS_TRUE@@DBUS_ENABLE_MODULAR_TESTS_TRUE@am__append_3 = $(installable_tests)
+@DBUS_ENABLE_INSTALLED_TESTS_FALSE@@DBUS_ENABLE_MODULAR_TESTS_TRUE@am__append_4 = $(installable_tests)
subdir = test
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -67,7 +73,13 @@ am__v_lt_0 = --silent
@DBUS_BUILD_TESTS_TRUE@ test-segfault$(EXEEXT) \
@DBUS_BUILD_TESTS_TRUE@ test-exit$(EXEEXT) \
@DBUS_BUILD_TESTS_TRUE@ test-sleep-forever$(EXEEXT)
-PROGRAMS = $(noinst_PROGRAMS)
+am__EXEEXT_2 = test-corrupt$(EXEEXT) test-dbus-daemon$(EXEEXT) \
+ test-loopback$(EXEEXT) test-marshal$(EXEEXT) \
+ test-relay$(EXEEXT)
+@DBUS_ENABLE_INSTALLED_TESTS_FALSE@@DBUS_ENABLE_MODULAR_TESTS_TRUE@am__EXEEXT_3 = $(am__EXEEXT_2)
+@DBUS_ENABLE_INSTALLED_TESTS_TRUE@@DBUS_ENABLE_MODULAR_TESTS_TRUE@am__EXEEXT_4 = $(am__EXEEXT_2)
+am__installdirs = "$(DESTDIR)$(testexecdir)"
+PROGRAMS = $(noinst_PROGRAMS) $(testexec_PROGRAMS)
am_shell_test_OBJECTS = shell-test.$(OBJEXT)
shell_test_OBJECTS = $(am_shell_test_OBJECTS)
am__DEPENDENCIES_1 =
@@ -83,15 +95,51 @@ spawn_test_DEPENDENCIES = $(am__DEPENDENCIES_2)
spawn_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(spawn_test_LDFLAGS) $(LDFLAGS) -o $@
+am_test_corrupt_OBJECTS = test_corrupt-corrupt.$(OBJEXT)
+test_corrupt_OBJECTS = $(am_test_corrupt_OBJECTS)
+test_corrupt_DEPENDENCIES = $(top_builddir)/dbus/libdbus-1.la \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+test_corrupt_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(test_corrupt_LDFLAGS) $(LDFLAGS) -o $@
+am_test_dbus_daemon_OBJECTS = test_dbus_daemon-dbus-daemon.$(OBJEXT)
+test_dbus_daemon_OBJECTS = $(am_test_dbus_daemon_OBJECTS)
+test_dbus_daemon_DEPENDENCIES = $(top_builddir)/dbus/libdbus-1.la \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+test_dbus_daemon_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+ $(AM_CFLAGS) $(CFLAGS) $(test_dbus_daemon_LDFLAGS) $(LDFLAGS) \
+ -o $@
am_test_exit_OBJECTS = test-exit.$(OBJEXT)
test_exit_OBJECTS = $(am_test_exit_OBJECTS)
test_exit_LDADD = $(LDADD)
+am_test_loopback_OBJECTS = test_loopback-loopback.$(OBJEXT)
+test_loopback_OBJECTS = $(am_test_loopback_OBJECTS)
+test_loopback_DEPENDENCIES = $(top_builddir)/dbus/libdbus-1.la \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+test_loopback_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(test_loopback_LDFLAGS) $(LDFLAGS) -o $@
+am_test_marshal_OBJECTS = test_marshal-marshal.$(OBJEXT)
+test_marshal_OBJECTS = $(am_test_marshal_OBJECTS)
+test_marshal_DEPENDENCIES = $(top_builddir)/dbus/libdbus-1.la \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+test_marshal_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(test_marshal_LDFLAGS) $(LDFLAGS) -o $@
am_test_names_OBJECTS = test-names.$(OBJEXT)
test_names_OBJECTS = $(am_test_names_OBJECTS)
test_names_DEPENDENCIES = libdbus-testutils.la $(am__DEPENDENCIES_2)
test_names_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(test_names_LDFLAGS) $(LDFLAGS) -o $@
+am_test_relay_OBJECTS = test_relay-relay.$(OBJEXT)
+test_relay_OBJECTS = $(am_test_relay_OBJECTS)
+test_relay_DEPENDENCIES = $(top_builddir)/dbus/libdbus-1.la \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+test_relay_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(test_relay_LDFLAGS) $(LDFLAGS) -o $@
am_test_segfault_OBJECTS = test-segfault.$(OBJEXT)
test_segfault_OBJECTS = $(am_test_segfault_OBJECTS)
test_segfault_LDADD = $(LDADD)
@@ -139,15 +187,19 @@ AM_V_GEN = $(am__v_GEN_$(V))
am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
am__v_GEN_0 = @echo " GEN " $@;
SOURCES = $(libdbus_testutils_la_SOURCES) $(shell_test_SOURCES) \
- $(spawn_test_SOURCES) $(test_exit_SOURCES) \
- $(test_names_SOURCES) $(test_segfault_SOURCES) \
- $(test_service_SOURCES) $(test_shell_service_SOURCES) \
- $(test_sleep_forever_SOURCES)
+ $(spawn_test_SOURCES) $(test_corrupt_SOURCES) \
+ $(test_dbus_daemon_SOURCES) $(test_exit_SOURCES) \
+ $(test_loopback_SOURCES) $(test_marshal_SOURCES) \
+ $(test_names_SOURCES) $(test_relay_SOURCES) \
+ $(test_segfault_SOURCES) $(test_service_SOURCES) \
+ $(test_shell_service_SOURCES) $(test_sleep_forever_SOURCES)
DIST_SOURCES = $(libdbus_testutils_la_SOURCES) $(shell_test_SOURCES) \
- $(spawn_test_SOURCES) $(test_exit_SOURCES) \
- $(test_names_SOURCES) $(test_segfault_SOURCES) \
- $(test_service_SOURCES) $(test_shell_service_SOURCES) \
- $(test_sleep_forever_SOURCES)
+ $(spawn_test_SOURCES) $(test_corrupt_SOURCES) \
+ $(test_dbus_daemon_SOURCES) $(test_exit_SOURCES) \
+ $(test_loopback_SOURCES) $(test_marshal_SOURCES) \
+ $(test_names_SOURCES) $(test_relay_SOURCES) \
+ $(test_segfault_SOURCES) $(test_service_SOURCES) \
+ $(test_shell_service_SOURCES) $(test_sleep_forever_SOURCES)
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
@@ -164,6 +216,7 @@ ETAGS = etags
CTAGS = ctags
am__tty_colors = \
red=; grn=; lgn=; blu=; std=
+@DBUS_ENABLE_MODULAR_TESTS_TRUE@am__EXEEXT_5 = $(am__EXEEXT_2)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
@@ -219,6 +272,8 @@ DBUS_CONSOLE_AUTH_DIR = @DBUS_CONSOLE_AUTH_DIR@
DBUS_CONSOLE_OWNER_FILE = @DBUS_CONSOLE_OWNER_FILE@
DBUS_DAEMONDIR = @DBUS_DAEMONDIR@
DBUS_DATADIR = @DBUS_DATADIR@
+DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@
+DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@
DBUS_HAVE_INT64 = @DBUS_HAVE_INT64@
DBUS_INT16_TYPE = @DBUS_INT16_TYPE@
DBUS_INT32_TYPE = @DBUS_INT32_TYPE@
@@ -264,6 +319,8 @@ EXPANDED_PREFIX = @EXPANDED_PREFIX@
EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@
FGREP = @FGREP@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -308,7 +365,6 @@ PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
RC = @RC@
R_DYNAMIC_LDFLAG = @R_DYNAMIC_LDFLAG@
-SECTION_LDFLAGS = @SECTION_LDFLAGS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -421,7 +477,8 @@ test_sleep_forever_SOURCES = \
test-sleep-forever.c
-# When any programs are not linked to libdbus-internal, fix this.
+# This assumes that most tests will be linked to libdbus-internal;
+# tests linked to only the public libdbus have their own CPPFLAGS.
AM_CPPFLAGS = -DDBUS_STATIC_BUILD
TEST_LIBS = $(top_builddir)/dbus/libdbus-internal.la $(DBUS_TEST_LIBS)
test_service_LDADD = libdbus-testutils.la $(TEST_LIBS)
@@ -434,7 +491,60 @@ shell_test_LDADD = libdbus-testutils.la $(TEST_LIBS)
shell_test_LDFLAGS = @R_DYNAMIC_LDFLAG@
spawn_test_LDADD = $(TEST_LIBS)
spawn_test_LDFLAGS = @R_DYNAMIC_LDFLAG@
-EXTRA_DIST =
+EXTRA_DIST = dbus-test-runner
+testexecdir = $(libdir)/dbus-1.0/test
+installable_tests = \
+ test-corrupt \
+ test-dbus-daemon \
+ test-loopback \
+ test-marshal \
+ test-relay \
+ $(NULL)
+
+installcheck_tests = $(am__append_2)
+installcheck_environment = \
+ DBUS_TEST_DAEMON=$(DESTDIR)$(DBUS_DAEMONDIR)/dbus-daemon$(EXEEXT) \
+ DBUS_TEST_SYSCONFDIR=$(DESTDIR)$(sysconfdir)
+
+TESTS_ENVIRONMENT = \
+ DBUS_TEST_DAEMON=@abs_top_builddir@/bus/dbus-daemon$(EXEEXT) \
+ DBUS_TEST_DATA=@abs_top_builddir@/test/data
+
+test_corrupt_SOURCES = corrupt.c
+test_corrupt_CPPFLAGS = $(GLIB_CFLAGS) $(DBUS_GLIB_CFLAGS)
+test_corrupt_LDFLAGS = @R_DYNAMIC_LDFLAG@
+test_corrupt_LDADD = $(top_builddir)/dbus/libdbus-1.la \
+ $(GLIB_LIBS) \
+ $(DBUS_GLIB_LIBS)
+
+test_loopback_SOURCES = loopback.c
+test_loopback_CPPFLAGS = $(GLIB_CFLAGS) $(DBUS_GLIB_CFLAGS)
+test_loopback_LDFLAGS = @R_DYNAMIC_LDFLAG@
+test_loopback_LDADD = $(top_builddir)/dbus/libdbus-1.la \
+ $(GLIB_LIBS) \
+ $(DBUS_GLIB_LIBS)
+
+test_relay_SOURCES = relay.c
+test_relay_CPPFLAGS = $(GLIB_CFLAGS) $(DBUS_GLIB_CFLAGS)
+test_relay_LDFLAGS = @R_DYNAMIC_LDFLAG@
+test_relay_LDADD = $(top_builddir)/dbus/libdbus-1.la \
+ $(GLIB_LIBS) \
+ $(DBUS_GLIB_LIBS)
+
+test_dbus_daemon_SOURCES = dbus-daemon.c
+test_dbus_daemon_CPPFLAGS = $(GLIB_CFLAGS) $(DBUS_GLIB_CFLAGS)
+test_dbus_daemon_LDFLAGS = @R_DYNAMIC_LDFLAG@
+test_dbus_daemon_LDADD = $(top_builddir)/dbus/libdbus-1.la \
+ $(GLIB_LIBS) \
+ $(DBUS_GLIB_LIBS)
+
+test_marshal_SOURCES = marshal.c
+test_marshal_CPPFLAGS = $(GLIB_CFLAGS) $(DBUS_GLIB_CFLAGS)
+test_marshal_LDFLAGS = @R_DYNAMIC_LDFLAG@
+test_marshal_LDADD = $(top_builddir)/dbus/libdbus-1.la \
+ $(GLIB_LIBS) \
+ $(DBUS_GLIB_LIBS)
+
TESTDIRS = \
data \
data/valid-messages \
@@ -513,18 +623,76 @@ clean-noinstPROGRAMS:
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
+install-testexecPROGRAMS: $(testexec_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(testexecdir)" || $(MKDIR_P) "$(DESTDIR)$(testexecdir)"
+ @list='$(testexec_PROGRAMS)'; test -n "$(testexecdir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(testexecdir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(testexecdir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-testexecPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(testexec_PROGRAMS)'; test -n "$(testexecdir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(testexecdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(testexecdir)" && rm -f $$files
+
+clean-testexecPROGRAMS:
+ @list='$(testexec_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
shell-test$(EXEEXT): $(shell_test_OBJECTS) $(shell_test_DEPENDENCIES)
@rm -f shell-test$(EXEEXT)
$(AM_V_CCLD)$(shell_test_LINK) $(shell_test_OBJECTS) $(shell_test_LDADD) $(LIBS)
spawn-test$(EXEEXT): $(spawn_test_OBJECTS) $(spawn_test_DEPENDENCIES)
@rm -f spawn-test$(EXEEXT)
$(AM_V_CCLD)$(spawn_test_LINK) $(spawn_test_OBJECTS) $(spawn_test_LDADD) $(LIBS)
+test-corrupt$(EXEEXT): $(test_corrupt_OBJECTS) $(test_corrupt_DEPENDENCIES)
+ @rm -f test-corrupt$(EXEEXT)
+ $(AM_V_CCLD)$(test_corrupt_LINK) $(test_corrupt_OBJECTS) $(test_corrupt_LDADD) $(LIBS)
+test-dbus-daemon$(EXEEXT): $(test_dbus_daemon_OBJECTS) $(test_dbus_daemon_DEPENDENCIES)
+ @rm -f test-dbus-daemon$(EXEEXT)
+ $(AM_V_CCLD)$(test_dbus_daemon_LINK) $(test_dbus_daemon_OBJECTS) $(test_dbus_daemon_LDADD) $(LIBS)
test-exit$(EXEEXT): $(test_exit_OBJECTS) $(test_exit_DEPENDENCIES)
@rm -f test-exit$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_exit_OBJECTS) $(test_exit_LDADD) $(LIBS)
+test-loopback$(EXEEXT): $(test_loopback_OBJECTS) $(test_loopback_DEPENDENCIES)
+ @rm -f test-loopback$(EXEEXT)
+ $(AM_V_CCLD)$(test_loopback_LINK) $(test_loopback_OBJECTS) $(test_loopback_LDADD) $(LIBS)
+test-marshal$(EXEEXT): $(test_marshal_OBJECTS) $(test_marshal_DEPENDENCIES)
+ @rm -f test-marshal$(EXEEXT)
+ $(AM_V_CCLD)$(test_marshal_LINK) $(test_marshal_OBJECTS) $(test_marshal_LDADD) $(LIBS)
test-names$(EXEEXT): $(test_names_OBJECTS) $(test_names_DEPENDENCIES)
@rm -f test-names$(EXEEXT)
$(AM_V_CCLD)$(test_names_LINK) $(test_names_OBJECTS) $(test_names_LDADD) $(LIBS)
+test-relay$(EXEEXT): $(test_relay_OBJECTS) $(test_relay_DEPENDENCIES)
+ @rm -f test-relay$(EXEEXT)
+ $(AM_V_CCLD)$(test_relay_LINK) $(test_relay_OBJECTS) $(test_relay_LDADD) $(LIBS)
test-segfault$(EXEEXT): $(test_segfault_OBJECTS) $(test_segfault_DEPENDENCIES)
@rm -f test-segfault$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_segfault_OBJECTS) $(test_segfault_LDADD) $(LIBS)
@@ -553,6 +721,11 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-shell-service.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sleep-forever.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-utils.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_corrupt-corrupt.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_dbus_daemon-dbus-daemon.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_loopback-loopback.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_marshal-marshal.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_relay-relay.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -578,6 +751,86 @@ distclean-compile:
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+test_corrupt-corrupt.o: corrupt.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_corrupt_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_corrupt-corrupt.o -MD -MP -MF $(DEPDIR)/test_corrupt-corrupt.Tpo -c -o test_corrupt-corrupt.o `test -f 'corrupt.c' || echo '$(srcdir)/'`corrupt.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_corrupt-corrupt.Tpo $(DEPDIR)/test_corrupt-corrupt.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='corrupt.c' object='test_corrupt-corrupt.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_corrupt_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_corrupt-corrupt.o `test -f 'corrupt.c' || echo '$(srcdir)/'`corrupt.c
+
+test_corrupt-corrupt.obj: corrupt.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_corrupt_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_corrupt-corrupt.obj -MD -MP -MF $(DEPDIR)/test_corrupt-corrupt.Tpo -c -o test_corrupt-corrupt.obj `if test -f 'corrupt.c'; then $(CYGPATH_W) 'corrupt.c'; else $(CYGPATH_W) '$(srcdir)/corrupt.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_corrupt-corrupt.Tpo $(DEPDIR)/test_corrupt-corrupt.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='corrupt.c' object='test_corrupt-corrupt.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_corrupt_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_corrupt-corrupt.obj `if test -f 'corrupt.c'; then $(CYGPATH_W) 'corrupt.c'; else $(CYGPATH_W) '$(srcdir)/corrupt.c'; fi`
+
+test_dbus_daemon-dbus-daemon.o: dbus-daemon.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_dbus_daemon_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_dbus_daemon-dbus-daemon.o -MD -MP -MF $(DEPDIR)/test_dbus_daemon-dbus-daemon.Tpo -c -o test_dbus_daemon-dbus-daemon.o `test -f 'dbus-daemon.c' || echo '$(srcdir)/'`dbus-daemon.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_dbus_daemon-dbus-daemon.Tpo $(DEPDIR)/test_dbus_daemon-dbus-daemon.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dbus-daemon.c' object='test_dbus_daemon-dbus-daemon.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_dbus_daemon_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_dbus_daemon-dbus-daemon.o `test -f 'dbus-daemon.c' || echo '$(srcdir)/'`dbus-daemon.c
+
+test_dbus_daemon-dbus-daemon.obj: dbus-daemon.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_dbus_daemon_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_dbus_daemon-dbus-daemon.obj -MD -MP -MF $(DEPDIR)/test_dbus_daemon-dbus-daemon.Tpo -c -o test_dbus_daemon-dbus-daemon.obj `if test -f 'dbus-daemon.c'; then $(CYGPATH_W) 'dbus-daemon.c'; else $(CYGPATH_W) '$(srcdir)/dbus-daemon.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_dbus_daemon-dbus-daemon.Tpo $(DEPDIR)/test_dbus_daemon-dbus-daemon.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dbus-daemon.c' object='test_dbus_daemon-dbus-daemon.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_dbus_daemon_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_dbus_daemon-dbus-daemon.obj `if test -f 'dbus-daemon.c'; then $(CYGPATH_W) 'dbus-daemon.c'; else $(CYGPATH_W) '$(srcdir)/dbus-daemon.c'; fi`
+
+test_loopback-loopback.o: loopback.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_loopback_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_loopback-loopback.o -MD -MP -MF $(DEPDIR)/test_loopback-loopback.Tpo -c -o test_loopback-loopback.o `test -f 'loopback.c' || echo '$(srcdir)/'`loopback.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_loopback-loopback.Tpo $(DEPDIR)/test_loopback-loopback.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='loopback.c' object='test_loopback-loopback.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_loopback_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_loopback-loopback.o `test -f 'loopback.c' || echo '$(srcdir)/'`loopback.c
+
+test_loopback-loopback.obj: loopback.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_loopback_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_loopback-loopback.obj -MD -MP -MF $(DEPDIR)/test_loopback-loopback.Tpo -c -o test_loopback-loopback.obj `if test -f 'loopback.c'; then $(CYGPATH_W) 'loopback.c'; else $(CYGPATH_W) '$(srcdir)/loopback.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_loopback-loopback.Tpo $(DEPDIR)/test_loopback-loopback.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='loopback.c' object='test_loopback-loopback.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_loopback_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_loopback-loopback.obj `if test -f 'loopback.c'; then $(CYGPATH_W) 'loopback.c'; else $(CYGPATH_W) '$(srcdir)/loopback.c'; fi`
+
+test_marshal-marshal.o: marshal.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_marshal_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_marshal-marshal.o -MD -MP -MF $(DEPDIR)/test_marshal-marshal.Tpo -c -o test_marshal-marshal.o `test -f 'marshal.c' || echo '$(srcdir)/'`marshal.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_marshal-marshal.Tpo $(DEPDIR)/test_marshal-marshal.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='marshal.c' object='test_marshal-marshal.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_marshal_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_marshal-marshal.o `test -f 'marshal.c' || echo '$(srcdir)/'`marshal.c
+
+test_marshal-marshal.obj: marshal.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_marshal_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_marshal-marshal.obj -MD -MP -MF $(DEPDIR)/test_marshal-marshal.Tpo -c -o test_marshal-marshal.obj `if test -f 'marshal.c'; then $(CYGPATH_W) 'marshal.c'; else $(CYGPATH_W) '$(srcdir)/marshal.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_marshal-marshal.Tpo $(DEPDIR)/test_marshal-marshal.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='marshal.c' object='test_marshal-marshal.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_marshal_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_marshal-marshal.obj `if test -f 'marshal.c'; then $(CYGPATH_W) 'marshal.c'; else $(CYGPATH_W) '$(srcdir)/marshal.c'; fi`
+
+test_relay-relay.o: relay.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_relay_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_relay-relay.o -MD -MP -MF $(DEPDIR)/test_relay-relay.Tpo -c -o test_relay-relay.o `test -f 'relay.c' || echo '$(srcdir)/'`relay.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_relay-relay.Tpo $(DEPDIR)/test_relay-relay.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='relay.c' object='test_relay-relay.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_relay_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_relay-relay.o `test -f 'relay.c' || echo '$(srcdir)/'`relay.c
+
+test_relay-relay.obj: relay.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_relay_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_relay-relay.obj -MD -MP -MF $(DEPDIR)/test_relay-relay.Tpo -c -o test_relay-relay.obj `if test -f 'relay.c'; then $(CYGPATH_W) 'relay.c'; else $(CYGPATH_W) '$(srcdir)/relay.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_relay-relay.Tpo $(DEPDIR)/test_relay-relay.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='relay.c' object='test_relay-relay.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_relay_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_relay-relay.obj `if test -f 'relay.c'; then $(CYGPATH_W) 'relay.c'; else $(CYGPATH_W) '$(srcdir)/relay.c'; fi`
+
mostlyclean-libtool:
-rm -f *.lo
@@ -878,6 +1131,9 @@ check: check-recursive
all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) all-local
installdirs: installdirs-recursive
installdirs-am:
+ for dir in "$(DESTDIR)$(testexecdir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
@@ -906,7 +1162,8 @@ maintainer-clean-generic:
clean: clean-recursive
clean-am: clean-generic clean-libtool clean-local \
- clean-noinstLTLIBRARIES clean-noinstPROGRAMS mostlyclean-am
+ clean-noinstLTLIBRARIES clean-noinstPROGRAMS \
+ clean-testexecPROGRAMS mostlyclean-am
distclean: distclean-recursive
-rm -rf ./$(DEPDIR)
@@ -932,7 +1189,7 @@ install-dvi: install-dvi-recursive
install-dvi-am:
-install-exec-am:
+install-exec-am: install-testexecPROGRAMS
install-html: install-html-recursive
@@ -952,7 +1209,7 @@ install-ps: install-ps-recursive
install-ps-am:
-installcheck-am:
+installcheck-am: installcheck-local
maintainer-clean: maintainer-clean-recursive
-rm -rf ./$(DEPDIR)
@@ -972,7 +1229,7 @@ ps: ps-recursive
ps-am:
-uninstall-am:
+uninstall-am: uninstall-testexecPROGRAMS
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) check-am \
ctags-recursive install-am install-strip tags-recursive
@@ -980,19 +1237,34 @@ uninstall-am:
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am all-local check check-TESTS check-am clean \
clean-generic clean-libtool clean-local \
- clean-noinstLTLIBRARIES clean-noinstPROGRAMS ctags \
- ctags-recursive dist-hook distclean distclean-compile \
- distclean-generic distclean-libtool distclean-tags distdir dvi \
- dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-dvi install-dvi-am \
- install-exec install-exec-am install-html install-html-am \
- install-info install-info-am install-man install-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
- installcheck installcheck-am installdirs installdirs-am \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
- pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am
-
+ clean-noinstLTLIBRARIES clean-noinstPROGRAMS \
+ clean-testexecPROGRAMS ctags ctags-recursive dist-hook \
+ distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip \
+ install-testexecPROGRAMS installcheck installcheck-am \
+ installcheck-local installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags tags-recursive uninstall uninstall-am \
+ uninstall-testexecPROGRAMS
+
+
+# If we're installing the tests into a DESTDIR we can't run them
+# again using the installed copy, because we don't know how to
+# do a portable equivalent of setting LD_LIBRARY_PATH.
+installcheck-local:
+ $(MAKE) check-TESTS TESTS='$$(installcheck_tests)' \
+ TESTS_ENVIRONMENT='$$(installcheck_environment)'
+@DBUS_ENABLE_INSTALLED_TESTS_TRUE@ test -n "$(DESTDIR)" || \
+@DBUS_ENABLE_INSTALLED_TESTS_TRUE@ $(installcheck_environment) \
+@DBUS_ENABLE_INSTALLED_TESTS_TRUE@ $(srcdir)/dbus-test-runner \
+@DBUS_ENABLE_INSTALLED_TESTS_TRUE@ $(testexecdir) \
+@DBUS_ENABLE_INSTALLED_TESTS_TRUE@ $(testexec_PROGRAMS)
dist-hook:
for D in $(TESTDIRS); do \
diff --git a/test/corrupt.c b/test/corrupt.c
new file mode 100644
index 00000000..ef9951af
--- /dev/null
+++ b/test/corrupt.c
@@ -0,0 +1,362 @@
+/* Regression test for being disconnected by a corrupt message (fd.o #15578)
+ *
+ * Author: Simon McVittie <simon.mcvittie@collabora.co.uk>
+ * Copyright © 2010-2011 Nokia Corporation
+ *
+ * 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 <glib.h>
+#include <gio/gio.h>
+
+#include <dbus/dbus.h>
+#include <dbus/dbus-glib-lowlevel.h>
+
+typedef struct {
+ DBusError e;
+
+ DBusServer *server;
+ DBusConnection *server_conn;
+ /* queue of DBusMessage */
+ GQueue client_messages;
+
+ DBusConnection *client_conn;
+} Fixture;
+
+static void
+assert_no_error (const DBusError *e)
+{
+ if (G_UNLIKELY (dbus_error_is_set (e)))
+ g_error ("expected success but got error: %s: %s", e->name, e->message);
+}
+
+static DBusHandlerResult
+client_message_cb (DBusConnection *client_conn,
+ DBusMessage *message,
+ void *data)
+{
+ Fixture *f = data;
+
+ g_assert (client_conn == f->client_conn);
+ g_queue_push_tail (&f->client_messages, dbus_message_ref (message));
+
+ return DBUS_HANDLER_RESULT_HANDLED;
+}
+
+static void
+new_conn_cb (DBusServer *server,
+ DBusConnection *server_conn,
+ void *data)
+{
+ Fixture *f = data;
+
+ g_assert (f->server_conn == NULL);
+ f->server_conn = dbus_connection_ref (server_conn);
+ dbus_connection_setup_with_g_main (server_conn, NULL);
+}
+
+static void
+setup (Fixture *f,
+ gconstpointer addr)
+{
+ dbus_error_init (&f->e);
+ g_queue_init (&f->client_messages);
+
+ f->server = dbus_server_listen (addr, &f->e);
+ assert_no_error (&f->e);
+ g_assert (f->server != NULL);
+
+ dbus_server_set_new_connection_function (f->server,
+ new_conn_cb, f, NULL);
+ dbus_server_setup_with_g_main (f->server, NULL);
+}
+
+static void
+test_connect (Fixture *f,
+ gconstpointer addr G_GNUC_UNUSED)
+{
+ dbus_bool_t have_mem;
+
+ g_assert (f->server_conn == NULL);
+
+ f->client_conn = dbus_connection_open_private (
+ dbus_server_get_address (f->server), &f->e);
+ assert_no_error (&f->e);
+ g_assert (f->client_conn != NULL);
+ dbus_connection_setup_with_g_main (f->client_conn, NULL);
+
+ while (f->server_conn == NULL)
+ {
+ g_print (".");
+ g_main_context_iteration (NULL, TRUE);
+ }
+
+ have_mem = dbus_connection_add_filter (f->client_conn,
+ client_message_cb, f, NULL);
+ g_assert (have_mem);
+}
+
+static void
+test_message (Fixture *f,
+ gconstpointer addr)
+{
+ dbus_bool_t have_mem;
+ dbus_uint32_t serial;
+ DBusMessage *outgoing, *incoming;
+
+ test_connect (f, addr);
+
+ outgoing = dbus_message_new_signal ("/com/example/Hello",
+ "com.example.Hello", "Greeting");
+ g_assert (outgoing != NULL);
+
+ have_mem = dbus_connection_send (f->server_conn, outgoing, &serial);
+ g_assert (have_mem);
+ g_assert (serial != 0);
+
+ while (g_queue_is_empty (&f->client_messages))
+ {
+ g_print (".");
+ g_main_context_iteration (NULL, TRUE);
+ }
+
+ g_assert_cmpuint (g_queue_get_length (&f->client_messages), ==, 1);
+
+ incoming = g_queue_pop_head (&f->client_messages);
+
+ g_assert (!dbus_message_contains_unix_fds (incoming));
+ g_assert_cmpstr (dbus_message_get_destination (incoming), ==, NULL);
+ g_assert_cmpstr (dbus_message_get_error_name (incoming), ==, NULL);
+ g_assert_cmpstr (dbus_message_get_interface (incoming), ==,
+ "com.example.Hello");
+ g_assert_cmpstr (dbus_message_get_member (incoming), ==, "Greeting");
+ g_assert_cmpstr (dbus_message_get_sender (incoming), ==, NULL);
+ g_assert_cmpstr (dbus_message_get_signature (incoming), ==, "");
+ g_assert_cmpstr (dbus_message_get_path (incoming), ==, "/com/example/Hello");
+ g_assert_cmpuint (dbus_message_get_serial (incoming), ==, serial);
+
+ dbus_message_unref (incoming);
+
+ dbus_message_unref (outgoing);
+}
+
+/* Enough bytes for it to be obvious that this connection is broken */
+#define CORRUPT_LEN 1024
+
+/* All-zero is not a valid D-Bus message header - for a start, this is
+ * protocol version 1, not 0 */
+static const gchar not_a_dbus_message[CORRUPT_LEN] = { 0 };
+
+static void
+test_corrupt (Fixture *f,
+ gconstpointer addr)
+{
+ GSocket *socket;
+ GError *gerror = NULL;
+ int fd;
+ gssize len, total_sent;
+ DBusMessage *incoming;
+
+ test_message (f, addr);
+
+ dbus_connection_flush (f->server_conn);
+
+ /* OK, now the connection is working, let's break it! Don't try this
+ * at home; splicing arbitrary bytes into the middle of the stream is
+ * specifically documented as not a valid thing to do. Who'd have thought? */
+ if (!dbus_connection_get_socket (f->server_conn, &fd))
+ g_error ("failed to steal fd from server connection");
+
+ socket = g_socket_new_from_fd (fd, &gerror);
+ g_assert_no_error (gerror);
+ g_assert (socket != NULL);
+
+ total_sent = 0;
+
+ while (total_sent < CORRUPT_LEN)
+ {
+ len = g_socket_send_with_blocking (socket,
+ not_a_dbus_message + total_sent, CORRUPT_LEN - total_sent,
+ TRUE, NULL, &gerror);
+ g_assert_no_error (gerror);
+ g_assert (len >= 0);
+ total_sent += len;
+ }
+
+ /* Now spin on the client connection: the server just sent it complete
+ * rubbish, so it should disconnect */
+ while (g_queue_is_empty (&f->client_messages))
+ {
+ g_print (".");
+ g_main_context_iteration (NULL, TRUE);
+ }
+
+ incoming = g_queue_pop_head (&f->client_messages);
+
+ g_assert (!dbus_message_contains_unix_fds (incoming));
+ g_assert_cmpstr (dbus_message_get_destination (incoming), ==, NULL);
+ g_assert_cmpstr (dbus_message_get_error_name (incoming), ==, NULL);
+ g_assert_cmpstr (dbus_message_get_interface (incoming), ==,
+ "org.freedesktop.DBus.Local");
+ g_assert_cmpstr (dbus_message_get_member (incoming), ==, "Disconnected");
+ g_assert_cmpstr (dbus_message_get_sender (incoming), ==, NULL);
+ g_assert_cmpstr (dbus_message_get_signature (incoming), ==, "");
+ g_assert_cmpstr (dbus_message_get_path (incoming), ==,
+ "/org/freedesktop/DBus/Local");
+
+ dbus_message_unref (incoming);
+}
+
+static void
+test_byte_order (Fixture *f,
+ gconstpointer addr)
+{
+ GSocket *socket;
+ GError *gerror = NULL;
+ int fd;
+ char *blob;
+ const gchar *arg = not_a_dbus_message;
+ const gchar * const *args = &arg;
+ int blob_len, len, total_sent;
+ DBusMessage *message;
+ dbus_bool_t mem;
+
+ test_message (f, addr);
+
+ message = dbus_message_new_signal ("/", "a.b", "c");
+ g_assert (message != NULL);
+ /* Append 0xFF bytes, so that the length of the body when byte-swapped
+ * is 0xFF000000, which is invalid */
+ mem = dbus_message_append_args (message,
+ DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &args, 0xFF,
+ DBUS_TYPE_INVALID);
+ g_assert (mem);
+ mem = dbus_message_marshal (message, &blob, &blob_len);
+ g_assert (mem);
+ g_assert_cmpuint (blob_len, >, 0xFF);
+ g_assert (blob != NULL);
+
+ dbus_message_unref (message);
+
+ /* Break the message by changing its claimed byte order, without actually
+ * byteswapping anything. We happen to know that byte order is the first
+ * byte. */
+ if (blob[0] == 'B')
+ blob[0] = 'l';
+ else
+ blob[0] = 'B';
+
+ /* OK, now the connection is working, let's break it */
+
+ dbus_connection_flush (f->server_conn);
+
+ if (!dbus_connection_get_socket (f->server_conn, &fd))
+ g_error ("failed to steal fd from server connection");
+
+ socket = g_socket_new_from_fd (fd, &gerror);
+ g_assert_no_error (gerror);
+ g_assert (socket != NULL);
+
+ total_sent = 0;
+
+ while (total_sent < blob_len)
+ {
+ len = g_socket_send_with_blocking (socket, blob + total_sent,
+ blob_len - total_sent, TRUE, NULL, &gerror);
+ g_assert_no_error (gerror);
+ g_assert (len >= 0);
+ total_sent += len;
+ }
+
+ dbus_free (blob);
+
+ /* Now spin on the client connection: the server just sent it a faulty
+ * message, so it should disconnect */
+ while (g_queue_is_empty (&f->client_messages))
+ {
+ g_print (".");
+ g_main_context_iteration (NULL, TRUE);
+ }
+
+ message = g_queue_pop_head (&f->client_messages);
+
+ g_assert (!dbus_message_contains_unix_fds (message));
+ g_assert_cmpstr (dbus_message_get_destination (message), ==, NULL);
+ g_assert_cmpstr (dbus_message_get_error_name (message), ==, NULL);
+ g_assert_cmpstr (dbus_message_get_interface (message), ==,
+ "org.freedesktop.DBus.Local");
+ g_assert_cmpstr (dbus_message_get_member (message), ==, "Disconnected");
+ g_assert_cmpstr (dbus_message_get_sender (message), ==, NULL);
+ g_assert_cmpstr (dbus_message_get_signature (message), ==, "");
+ g_assert_cmpstr (dbus_message_get_path (message), ==,
+ "/org/freedesktop/DBus/Local");
+
+ dbus_message_unref (message);
+}
+
+static void
+teardown (Fixture *f,
+ gconstpointer addr G_GNUC_UNUSED)
+{
+ if (f->client_conn != NULL)
+ {
+ dbus_connection_close (f->client_conn);
+ dbus_connection_unref (f->client_conn);
+ f->client_conn = NULL;
+ }
+
+ if (f->server_conn != NULL)
+ {
+ dbus_connection_close (f->server_conn);
+ dbus_connection_unref (f->server_conn);
+ f->server_conn = NULL;
+ }
+
+ if (f->server != NULL)
+ {
+ dbus_server_disconnect (f->server);
+ dbus_server_unref (f->server);
+ f->server = NULL;
+ }
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ g_test_init (&argc, &argv, NULL);
+ g_type_init ();
+
+ g_test_add ("/corrupt/tcp", Fixture, "tcp:host=127.0.0.1", setup,
+ test_corrupt, teardown);
+
+#ifdef DBUS_UNIX
+ g_test_add ("/corrupt/unix", Fixture, "unix:tmpdir=/tmp", setup,
+ test_corrupt, teardown);
+#endif
+
+ g_test_add ("/corrupt/byte-order/tcp", Fixture, "tcp:host=127.0.0.1", setup,
+ test_byte_order, teardown);
+
+ return g_test_run ();
+}
diff --git a/test/dbus-daemon.c b/test/dbus-daemon.c
new file mode 100644
index 00000000..ed10d098
--- /dev/null
+++ b/test/dbus-daemon.c
@@ -0,0 +1,326 @@
+/* Integration tests for the dbus-daemon
+ *
+ * Author: Simon McVittie <simon.mcvittie@collabora.co.uk>
+ * Copyright © 2010-2011 Nokia Corporation
+ *
+ * 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 <glib.h>
+
+#include <dbus/dbus.h>
+#include <dbus/dbus-glib-lowlevel.h>
+
+#include <string.h>
+
+#ifdef DBUS_WIN
+# include <windows.h>
+#else
+# include <signal.h>
+# include <unistd.h>
+#endif
+
+typedef struct {
+ DBusError e;
+ GError *ge;
+
+ gint daemon_pid;
+
+ DBusConnection *left_conn;
+
+ DBusConnection *right_conn;
+ gboolean right_conn_echo;
+} Fixture;
+
+#define assert_no_error(e) _assert_no_error (e, __FILE__, __LINE__)
+static void
+_assert_no_error (const DBusError *e,
+ const char *file,
+ int line)
+{
+ if (G_UNLIKELY (dbus_error_is_set (e)))
+ g_error ("%s:%d: expected success but got error: %s: %s",
+ file, line, e->name, e->message);
+}
+
+static gchar *
+spawn_dbus_daemon (gchar *binary,
+ gchar *configuration,
+ gint *daemon_pid)
+{
+ GError *error = NULL;
+ GString *address;
+ gint address_fd;
+ gchar *argv[] = {
+ binary,
+ configuration,
+ "--nofork",
+ "--print-address=1", /* stdout */
+ NULL
+ };
+
+ g_spawn_async_with_pipes (NULL, /* working directory */
+ argv,
+ NULL, /* envp */
+ G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_SEARCH_PATH,
+ NULL, /* child_setup */
+ NULL, /* user data */
+ daemon_pid,
+ NULL, /* child's stdin = /dev/null */
+ &address_fd,
+ NULL, /* child's stderr = our stderr */
+ &error);
+ g_assert_no_error (error);
+
+ address = g_string_new (NULL);
+
+ /* polling until the dbus-daemon writes out its address is a bit stupid,
+ * but at least it's simple, unlike dbus-launch... in principle we could
+ * use select() here, but life's too short */
+ while (1)
+ {
+ gssize bytes;
+ gchar buf[4096];
+ gchar *newline;
+
+ bytes = read (address_fd, buf, sizeof (buf));
+
+ if (bytes > 0)
+ g_string_append_len (address, buf, bytes);
+
+ newline = strchr (address->str, '\n');
+
+ if (newline != NULL)
+ {
+ g_string_truncate (address, newline - address->str);
+ break;
+ }
+
+ g_usleep (G_USEC_PER_SEC / 10);
+ }
+
+ return g_string_free (address, FALSE);
+}
+
+static DBusConnection *
+connect_to_bus (const gchar *address)
+{
+ DBusConnection *conn;
+ DBusError error = DBUS_ERROR_INIT;
+ dbus_bool_t ok;
+
+ conn = dbus_connection_open_private (address, &error);
+ assert_no_error (&error);
+ g_assert (conn != NULL);
+
+ ok = dbus_bus_register (conn, &error);
+ assert_no_error (&error);
+ g_assert (ok);
+ g_assert (dbus_bus_get_unique_name (conn) != NULL);
+
+ dbus_connection_setup_with_g_main (conn, NULL);
+ return conn;
+}
+
+static DBusHandlerResult
+echo_filter (DBusConnection *connection,
+ DBusMessage *message,
+ void *user_data)
+{
+ DBusMessage *reply;
+ DBusError error = DBUS_ERROR_INIT;
+ int *sleep_ms = user_data;
+
+ if (dbus_message_get_type (message) != DBUS_MESSAGE_TYPE_METHOD_CALL)
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+
+ reply = dbus_message_new_method_return (message);
+
+ if (reply == NULL)
+ g_error ("OOM");
+
+ if (!dbus_connection_send (connection, reply, NULL))
+ g_error ("OOM");
+
+ dbus_message_unref (reply);
+
+ return DBUS_HANDLER_RESULT_HANDLED;
+}
+
+static void
+setup (Fixture *f,
+ gconstpointer context G_GNUC_UNUSED)
+{
+ gchar *dbus_daemon;
+ gchar *config;
+ gchar *address;
+
+ f->ge = NULL;
+ dbus_error_init (&f->e);
+
+ dbus_daemon = g_strdup (g_getenv ("DBUS_TEST_DAEMON"));
+
+ if (dbus_daemon == NULL)
+ dbus_daemon = g_strdup ("dbus-daemon");
+
+ if (g_getenv ("DBUS_TEST_SYSCONFDIR") != NULL)
+ {
+ config = g_strdup_printf ("--config-file=%s/dbus-1/session.conf",
+ g_getenv ("DBUS_TEST_SYSCONFDIR"));
+ }
+ else if (g_getenv ("DBUS_TEST_DATA") != NULL)
+ {
+ config = g_strdup_printf (
+ "--config-file=%s/valid-config-files/session.conf",
+ g_getenv ("DBUS_TEST_DATA"));
+ }
+ else
+ {
+ config = g_strdup ("--session");
+ }
+
+ address = spawn_dbus_daemon (dbus_daemon, config, &f->daemon_pid);
+
+ g_free (dbus_daemon);
+ g_free (config);
+
+ f->left_conn = connect_to_bus (address);
+ f->right_conn = connect_to_bus (address);
+ g_free (address);
+}
+
+static void
+add_echo_filter (Fixture *f)
+{
+ if (!dbus_connection_add_filter (f->right_conn, echo_filter, NULL, NULL))
+ g_error ("OOM");
+
+ f->right_conn_echo = TRUE;
+}
+
+static void
+pc_count (DBusPendingCall *pc,
+ void *data)
+{
+ guint *received_p = data;
+
+ (*received_p)++;
+}
+
+static void
+test_echo (Fixture *f,
+ gconstpointer context G_GNUC_UNUSED)
+{
+ guint count = 2000;
+ guint sent;
+ guint received = 0;
+ double elapsed;
+
+ if (g_test_perf ())
+ count = 100000;
+
+ add_echo_filter (f);
+
+ g_test_timer_start ();
+
+ for (sent = 0; sent < count; sent++)
+ {
+ DBusMessage *m = dbus_message_new_method_call (
+ dbus_bus_get_unique_name (f->right_conn), "/",
+ "com.example", "Spam");
+ DBusPendingCall *pc;
+
+ if (m == NULL)
+ g_error ("OOM");
+
+ if (!dbus_connection_send_with_reply (f->left_conn, m, &pc,
+ DBUS_TIMEOUT_INFINITE) ||
+ pc == NULL)
+ g_error ("OOM");
+
+ if (dbus_pending_call_get_completed (pc))
+ pc_count (pc, &received);
+ else if (!dbus_pending_call_set_notify (pc, pc_count, &received,
+ NULL))
+ g_error ("OOM");
+
+ dbus_pending_call_unref (pc);
+ dbus_message_unref (m);
+ }
+
+ while (received < count)
+ g_main_context_iteration (NULL, TRUE);
+
+ elapsed = g_test_timer_elapsed ();
+
+ g_test_maximized_result (count / elapsed, "%u messages / %f seconds",
+ count, elapsed);
+}
+
+static void
+teardown (Fixture *f,
+ gconstpointer context G_GNUC_UNUSED)
+{
+ dbus_error_free (&f->e);
+ g_clear_error (&f->ge);
+
+ if (f->left_conn != NULL)
+ {
+ dbus_connection_close (f->left_conn);
+ dbus_connection_unref (f->left_conn);
+ f->left_conn = NULL;
+ }
+
+ if (f->right_conn != NULL)
+ {
+ if (f->right_conn_echo)
+ {
+ dbus_connection_remove_filter (f->right_conn, echo_filter, NULL);
+ f->right_conn_echo = FALSE;
+ }
+
+ dbus_connection_close (f->right_conn);
+ dbus_connection_unref (f->right_conn);
+ f->right_conn = NULL;
+ }
+
+#ifdef DBUS_WIN
+ TerminateProcess (f->daemon_pid, 1);
+#else
+ kill (f->daemon_pid, SIGTERM);
+#endif
+
+ g_spawn_close_pid (f->daemon_pid);
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ g_test_init (&argc, &argv, NULL);
+ g_test_bug_base ("https://bugs.freedesktop.org/show_bug.cgi?id=");
+
+ g_test_add ("/echo/session", Fixture, NULL, setup, test_echo, teardown);
+
+ return g_test_run ();
+}
diff --git a/test/dbus-test-runner b/test/dbus-test-runner
new file mode 100755
index 00000000..a3dc3960
--- /dev/null
+++ b/test/dbus-test-runner
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+set -e
+
+dir="$1"
+shift
+
+if ! test -d "$dir"; then
+ echo "Usage: dbus-test-runner directory [executable...]"
+ exit 0
+fi
+
+passed=0
+failed=0
+skipped=0
+
+for prog in "$@"; do
+ e=0
+ "$dir/$prog" || e=$?
+ case $e in
+ (0)
+ echo "PASS: $prog"
+ passed=`expr $passed + 1`
+ ;;
+ (77)
+ echo "SKIP: $prog"
+ skipped=`expr $skipped + 1`
+ ;;
+ (*)
+ echo "FAIL: $prog"
+ failed=`expr $failed + 1`
+ ;;
+ esac
+done
+
+if test $failed = 0; then
+ # avoid saying "FAIL", to make it easy to grep results!
+ echo "PASSED $passed / SKIPPED $skipped"
+ exit 0
+else
+ echo "PASSED $passed / FAILED $failed / SKIPPED $skipped"
+ exit 1
+fi
diff --git a/test/loopback.c b/test/loopback.c
new file mode 100644
index 00000000..d0d69c82
--- /dev/null
+++ b/test/loopback.c
@@ -0,0 +1,211 @@
+/* Simple sanity-check for loopback through TCP and Unix sockets.
+ *
+ * Author: Simon McVittie <simon.mcvittie@collabora.co.uk>
+ * Copyright © 2010-2011 Nokia Corporation
+ *
+ * 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 <glib.h>
+
+#include <dbus/dbus.h>
+#include <dbus/dbus-glib-lowlevel.h>
+
+typedef struct {
+ DBusError e;
+
+ DBusServer *server;
+ DBusConnection *server_conn;
+ /* queue of DBusMessage */
+ GQueue server_messages;
+
+ DBusConnection *client_conn;
+} Fixture;
+
+static void
+assert_no_error (const DBusError *e)
+{
+ if (G_UNLIKELY (dbus_error_is_set (e)))
+ g_error ("expected success but got error: %s: %s", e->name, e->message);
+}
+
+static DBusHandlerResult
+server_message_cb (DBusConnection *server_conn,
+ DBusMessage *message,
+ void *data)
+{
+ Fixture *f = data;
+
+ g_assert (server_conn == f->server_conn);
+ g_queue_push_tail (&f->server_messages, dbus_message_ref (message));
+
+ return DBUS_HANDLER_RESULT_HANDLED;
+}
+
+static void
+new_conn_cb (DBusServer *server,
+ DBusConnection *server_conn,
+ void *data)
+{
+ Fixture *f = data;
+ dbus_bool_t have_mem;
+
+ g_assert (f->server_conn == NULL);
+ f->server_conn = dbus_connection_ref (server_conn);
+ dbus_connection_setup_with_g_main (server_conn, NULL);
+
+ have_mem = dbus_connection_add_filter (server_conn,
+ server_message_cb, f, NULL);
+ g_assert (have_mem);
+}
+
+static void
+setup (Fixture *f,
+ gconstpointer addr)
+{
+ dbus_error_init (&f->e);
+ g_queue_init (&f->server_messages);
+
+ f->server = dbus_server_listen (addr, &f->e);
+ assert_no_error (&f->e);
+ g_assert (f->server != NULL);
+
+ dbus_server_set_new_connection_function (f->server,
+ new_conn_cb, f, NULL);
+ dbus_server_setup_with_g_main (f->server, NULL);
+}
+
+static void
+test_connect (Fixture *f,
+ gconstpointer addr G_GNUC_UNUSED)
+{
+ g_assert (f->server_conn == NULL);
+
+ f->client_conn = dbus_connection_open_private (
+ dbus_server_get_address (f->server), &f->e);
+ assert_no_error (&f->e);
+ g_assert (f->client_conn != NULL);
+ dbus_connection_setup_with_g_main (f->client_conn, NULL);
+
+ while (f->server_conn == NULL)
+ {
+ g_print (".");
+ g_main_context_iteration (NULL, TRUE);
+ }
+}
+
+static void
+test_message (Fixture *f,
+ gconstpointer addr)
+{
+ dbus_bool_t have_mem;
+ dbus_uint32_t serial;
+ DBusMessage *outgoing, *incoming;
+
+ test_connect (f, addr);
+
+ outgoing = dbus_message_new_signal ("/com/example/Hello",
+ "com.example.Hello", "Greeting");
+ g_assert (outgoing != NULL);
+
+ have_mem = dbus_connection_send (f->client_conn, outgoing, &serial);
+ g_assert (have_mem);
+ g_assert (serial != 0);
+
+ while (g_queue_is_empty (&f->server_messages))
+ {
+ g_print (".");
+ g_main_context_iteration (NULL, TRUE);
+ }
+
+ g_assert_cmpuint (g_queue_get_length (&f->server_messages), ==, 1);
+
+ incoming = g_queue_pop_head (&f->server_messages);
+
+ g_assert (!dbus_message_contains_unix_fds (incoming));
+ g_assert_cmpstr (dbus_message_get_destination (incoming), ==, NULL);
+ g_assert_cmpstr (dbus_message_get_error_name (incoming), ==, NULL);
+ g_assert_cmpstr (dbus_message_get_interface (incoming), ==,
+ "com.example.Hello");
+ g_assert_cmpstr (dbus_message_get_member (incoming), ==, "Greeting");
+ g_assert_cmpstr (dbus_message_get_sender (incoming), ==, NULL);
+ g_assert_cmpstr (dbus_message_get_signature (incoming), ==, "");
+ g_assert_cmpstr (dbus_message_get_path (incoming), ==, "/com/example/Hello");
+ g_assert_cmpuint (dbus_message_get_serial (incoming), ==, serial);
+
+ dbus_message_unref (incoming);
+
+ dbus_message_unref (outgoing);
+}
+
+static void
+teardown (Fixture *f,
+ gconstpointer addr G_GNUC_UNUSED)
+{
+ if (f->client_conn != NULL)
+ {
+ dbus_connection_close (f->client_conn);
+ dbus_connection_unref (f->client_conn);
+ f->client_conn = NULL;
+ }
+
+ if (f->server_conn != NULL)
+ {
+ dbus_connection_close (f->server_conn);
+ dbus_connection_unref (f->server_conn);
+ f->server_conn = NULL;
+ }
+
+ if (f->server != NULL)
+ {
+ dbus_server_disconnect (f->server);
+ dbus_server_unref (f->server);
+ f->server = NULL;
+ }
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ g_test_init (&argc, &argv, NULL);
+
+ g_test_add ("/connect/tcp", Fixture, "tcp:host=127.0.0.1", setup,
+ test_connect, teardown);
+ g_test_add ("/message/tcp", Fixture, "tcp:host=127.0.0.1", setup,
+ test_message, teardown);
+
+ g_test_add ("/connect/nonce-tcp", Fixture, "nonce-tcp:host=127.0.0.1", setup,
+ test_connect, teardown);
+ g_test_add ("/message/nonce-tcp", Fixture, "nonce-tcp:host=127.0.0.1", setup,
+ test_message, teardown);
+
+#ifdef DBUS_UNIX
+ g_test_add ("/connect/unix", Fixture, "unix:tmpdir=/tmp", setup,
+ test_connect, teardown);
+ g_test_add ("/message/unix", Fixture, "unix:tmpdir=/tmp", setup,
+ test_message, teardown);
+#endif
+
+ return g_test_run ();
+}
diff --git a/test/marshal.c b/test/marshal.c
new file mode 100644
index 00000000..4cee9412
--- /dev/null
+++ b/test/marshal.c
@@ -0,0 +1,258 @@
+/* Simple sanity-check for D-Bus message serialization.
+ *
+ * Author: Simon McVittie <simon.mcvittie@collabora.co.uk>
+ * Copyright © 2010-2011 Nokia Corporation
+ *
+ * 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 <glib.h>
+
+#include <dbus/dbus.h>
+#include <dbus/dbus-glib-lowlevel.h>
+
+typedef struct {
+ DBusError e;
+} Fixture;
+
+static void
+assert_no_error (const DBusError *e)
+{
+ if (G_UNLIKELY (dbus_error_is_set (e)))
+ g_error ("expected success but got error: %s: %s", e->name, e->message);
+}
+
+static void
+setup (Fixture *f,
+ gconstpointer arg G_GNUC_UNUSED)
+{
+ dbus_error_init (&f->e);
+}
+
+/* this is meant to be obviously correct, not efficient! */
+static guint32
+get_uint32 (const gchar *blob,
+ gsize offset,
+ char endian)
+{
+ if (endian == 'l')
+ {
+ return
+ blob[offset] |
+ (blob[offset + 1] << 8) |
+ (blob[offset + 2] << 16) |
+ (blob[offset + 3] << 24);
+ }
+ else if (endian == 'B')
+ {
+ return
+ (blob[offset] << 24) |
+ (blob[offset + 1] << 16) |
+ (blob[offset + 2] << 8) |
+ blob[offset + 3];
+ }
+ else
+ {
+ g_assert_not_reached ();
+ }
+}
+
+#define BLOB_LENGTH (sizeof (le_blob) - 1)
+#define OFFSET_BODY_LENGTH (4)
+#define OFFSET_SERIAL (8)
+
+const gchar le_blob[] =
+ /* byte 0 */
+ /* yyyyuu fixed headers */
+ "l" /* little-endian */
+ "\2" /* reply (which is the simplest message) */
+ "\2" /* no auto-starting */
+ "\1" /* D-Bus version = 1 */
+ /* byte 4 */
+ "\4\0\0\0" /* bytes in body = 4 */
+ /* byte 8 */
+ "\x78\x56\x34\x12" /* serial number = 0x12345678 */
+ /* byte 12 */
+ /* a(uv) variable headers start here */
+ "\x0f\0\0\0" /* bytes in array of variable headers = 15 */
+ /* pad to 8-byte boundary = nothing */
+ /* byte 16 */
+ "\5" /* in reply to: */
+ "\1u\0" /* variant signature = u */
+ /* pad to 4-byte boundary = nothing */
+ "\x12\xef\xcd\xab" /* 0xabcdef12 */
+ /* pad to 8-byte boundary = nothing */
+ /* byte 24 */
+ "\x08" /* signature: */
+ "\1g\0" /* variant signature = g */
+ "\1u\0" /* 1 byte, u, NUL (no alignment needed) */
+ "\0" /* pad to 8-byte boundary for body */
+ /* body; byte 32 */
+ "\xef\xbe\xad\xde" /* 0xdeadbeef */
+ ;
+
+const gchar be_blob[] =
+ /* byte 0 */
+ /* yyyyuu fixed headers */
+ "B" /* big-endian */
+ "\2" /* reply (which is the simplest message) */
+ "\2" /* no auto-starting */
+ "\1" /* D-Bus version = 1 */
+ /* byte 4 */
+ "\0\0\0\4" /* bytes in body = 4 */
+ /* byte 8 */
+ "\x12\x34\x56\x78" /* serial number = 0x12345678 */
+ /* byte 12 */
+ /* a(uv) variable headers start here */
+ "\0\0\0\x0f" /* bytes in array of variable headers = 15 */
+ /* pad to 8-byte boundary = nothing */
+ /* byte 16 */
+ "\5" /* in reply to: */
+ "\1u\0" /* variant signature = u */
+ /* pad to 4-byte boundary = nothing */
+ "\xab\xcd\xef\x12" /* 0xabcdef12 */
+ /* pad to 8-byte boundary = nothing */
+ /* byte 24 */
+ "\x08" /* signature: */
+ "\1g\0" /* variant signature = g */
+ "\1u\0" /* 1 byte, u, NUL (no alignment needed) */
+ "\0" /* pad to 8-byte boundary for body */
+ /* body; byte 32 */
+ "\xde\xad\xbe\xef" /* 0xdeadbeef */
+ ;
+
+static void
+test_endian (Fixture *f,
+ gconstpointer arg)
+{
+ const gchar *blob = arg;
+ const gchar *native_blob;
+ char *output;
+ DBusMessage *m;
+ int len;
+ dbus_uint32_t u;
+ dbus_bool_t ok;
+
+ g_assert_cmpuint ((guint) sizeof (le_blob), ==, (guint) sizeof (be_blob));
+
+ g_assert_cmpuint (get_uint32 (blob, OFFSET_BODY_LENGTH, blob[0]), ==, 4);
+ g_assert_cmpuint (get_uint32 (blob, OFFSET_SERIAL, blob[0]), ==,
+ 0x12345678u);
+
+ len = dbus_message_demarshal_bytes_needed (blob, sizeof (le_blob));
+ /* everything in the string except the implicit "\0" at the end is part of
+ * the message */
+ g_assert_cmpint (len, ==, BLOB_LENGTH);
+
+ m = dbus_message_demarshal (blob, sizeof (le_blob), &f->e);
+ assert_no_error (&f->e);
+ g_assert (m != NULL);
+
+ g_assert_cmpuint (dbus_message_get_serial (m), ==, 0x12345678u);
+ g_assert_cmpuint (dbus_message_get_reply_serial (m), ==, 0xabcdef12u);
+ g_assert_cmpstr (dbus_message_get_signature (m), ==, "u");
+
+ /* Implementation detail: appending to the message results in it being
+ * byteswapped into compiler byte order, which exposed a bug in libdbus,
+ * fd.o #38120. (If that changes, this test might not exercise that
+ * particular bug but will still be valid.) */
+ u = 0xdecafbadu;
+ ok = dbus_message_append_args (m,
+ DBUS_TYPE_UINT32, &u,
+ DBUS_TYPE_INVALID);
+ g_assert (ok);
+
+ dbus_message_marshal (m, &output, &len);
+
+ g_assert (output[0] == 'l' || output[0] == 'B');
+ /* the single-byte fields are unaffected, even if the endianness was
+ * swapped */
+ g_assert_cmpint (output[1], ==, blob[1]);
+ g_assert_cmpint (output[2], ==, blob[2]);
+ g_assert_cmpint (output[3], ==, blob[3]);
+ /* the length and serial are in the new endianness, the length has expanded
+ * to 8, and the serial is correct */
+ g_assert_cmpuint (get_uint32 (output, OFFSET_BODY_LENGTH, output[0]), ==, 8);
+ g_assert_cmpuint (get_uint32 (output, OFFSET_SERIAL, output[0]), ==,
+ 0x12345678u);
+ /* the second "u" in the signature replaced a padding byte, so only
+ * the length of the body changed */
+ g_assert_cmpint (len, ==, BLOB_LENGTH + 4);
+}
+
+static void
+test_needed (Fixture *f,
+ gconstpointer arg)
+{
+ const gchar *blob = arg;
+
+ /* We need at least 16 bytes to know how long the message is - that's just
+ * a fact of the D-Bus protocol. */
+ g_assert_cmpint (
+ dbus_message_demarshal_bytes_needed (blob, 0), ==, 0);
+ g_assert_cmpint (
+ dbus_message_demarshal_bytes_needed (blob, 15), ==, 0);
+ /* This is enough that we should be able to tell how much we need. */
+ g_assert_cmpint (
+ dbus_message_demarshal_bytes_needed (blob, 16), ==, BLOB_LENGTH);
+ /* The header is 32 bytes long (here), so that's another interesting
+ * boundary. */
+ g_assert_cmpint (
+ dbus_message_demarshal_bytes_needed (blob, 31), ==, BLOB_LENGTH);
+ g_assert_cmpint (
+ dbus_message_demarshal_bytes_needed (blob, 32), ==, BLOB_LENGTH);
+ g_assert_cmpint (
+ dbus_message_demarshal_bytes_needed (blob, 33), ==, BLOB_LENGTH);
+ g_assert_cmpint (
+ dbus_message_demarshal_bytes_needed (blob, BLOB_LENGTH - 1), ==,
+ BLOB_LENGTH);
+ g_assert_cmpint (
+ dbus_message_demarshal_bytes_needed (blob, BLOB_LENGTH), ==,
+ BLOB_LENGTH);
+ g_assert_cmpint (
+ dbus_message_demarshal_bytes_needed (blob, sizeof (be_blob)), ==,
+ BLOB_LENGTH);
+}
+
+static void
+teardown (Fixture *f,
+ gconstpointer arg G_GNUC_UNUSED)
+{
+ dbus_error_free (&f->e);
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ g_test_init (&argc, &argv, NULL);
+
+ g_test_add ("/demarshal/le", Fixture, le_blob, setup, test_endian, teardown);
+ g_test_add ("/demarshal/be", Fixture, be_blob, setup, test_endian, teardown);
+ g_test_add ("/demarshal/needed/le", Fixture, le_blob, setup, test_needed,
+ teardown);
+ g_test_add ("/demarshal/needed/be", Fixture, be_blob, setup, test_needed,
+ teardown);
+
+ return g_test_run ();
+}
diff --git a/test/name-test/Makefile.in b/test/name-test/Makefile.in
index d08ff3a3..ca488449 100644
--- a/test/name-test/Makefile.in
+++ b/test/name-test/Makefile.in
@@ -220,6 +220,8 @@ DBUS_CONSOLE_AUTH_DIR = @DBUS_CONSOLE_AUTH_DIR@
DBUS_CONSOLE_OWNER_FILE = @DBUS_CONSOLE_OWNER_FILE@
DBUS_DAEMONDIR = @DBUS_DAEMONDIR@
DBUS_DATADIR = @DBUS_DATADIR@
+DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@
+DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@
DBUS_HAVE_INT64 = @DBUS_HAVE_INT64@
DBUS_INT16_TYPE = @DBUS_INT16_TYPE@
DBUS_INT32_TYPE = @DBUS_INT32_TYPE@
@@ -265,6 +267,8 @@ EXPANDED_PREFIX = @EXPANDED_PREFIX@
EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@
FGREP = @FGREP@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -309,7 +313,6 @@ PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
RC = @RC@
R_DYNAMIC_LDFLAG = @R_DYNAMIC_LDFLAG@
-SECTION_LDFLAGS = @SECTION_LDFLAGS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
diff --git a/test/relay.c b/test/relay.c
new file mode 100644
index 00000000..bad39f47
--- /dev/null
+++ b/test/relay.c
@@ -0,0 +1,318 @@
+/* Regression test for passing unmodified messages between connections
+ *
+ * Author: Simon McVittie <simon.mcvittie@collabora.co.uk>
+ * Copyright © 2010-2011 Nokia Corporation
+ *
+ * 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 <glib.h>
+
+#include <dbus/dbus.h>
+#include <dbus/dbus-glib-lowlevel.h>
+
+/* This is basically a miniature dbus-daemon. We relay messages from the client
+ * on the left to the client on the right.
+ *
+ * left socket left dispatch right socket right
+ * client ===========> server --------------> server ===========> client
+ * conn conn conn conn
+ *
+ * In the real dbus-daemon, the client connections would be out-of-process,
+ * but here we're cheating and doing everything in-process.
+ */
+
+typedef struct {
+ DBusError e;
+
+ DBusServer *server;
+
+ DBusConnection *left_client_conn;
+ DBusConnection *left_server_conn;
+
+ DBusConnection *right_server_conn;
+ DBusConnection *right_client_conn;
+ /* queue of DBusMessage received by right_client_conn */
+ GQueue messages;
+} Fixture;
+
+static void
+assert_no_error (const DBusError *e)
+{
+ if (G_UNLIKELY (dbus_error_is_set (e)))
+ g_error ("expected success but got error: %s: %s", e->name, e->message);
+}
+
+static DBusHandlerResult
+server_message_cb (DBusConnection *server_conn,
+ DBusMessage *message,
+ void *data)
+{
+ Fixture *f = data;
+
+ g_assert (server_conn == f->left_server_conn);
+ g_assert (f->right_server_conn != NULL);
+
+ dbus_connection_send (f->right_server_conn, message, NULL);
+
+ return DBUS_HANDLER_RESULT_HANDLED;
+}
+
+static DBusHandlerResult
+right_client_message_cb (DBusConnection *client_conn,
+ DBusMessage *message,
+ void *data)
+{
+ Fixture *f = data;
+
+ g_assert (client_conn == f->right_client_conn);
+ g_queue_push_tail (&f->messages, dbus_message_ref (message));
+
+ return DBUS_HANDLER_RESULT_HANDLED;
+}
+
+static void
+new_conn_cb (DBusServer *server,
+ DBusConnection *server_conn,
+ void *data)
+{
+ Fixture *f = data;
+ dbus_bool_t have_mem;
+
+ if (f->left_server_conn == NULL)
+ {
+ f->left_server_conn = dbus_connection_ref (server_conn);
+
+ have_mem = dbus_connection_add_filter (server_conn,
+ server_message_cb, f, NULL);
+ g_assert (have_mem);
+ }
+ else
+ {
+ g_assert (f->right_server_conn == NULL);
+ f->right_server_conn = dbus_connection_ref (server_conn);
+ }
+
+ dbus_connection_setup_with_g_main (server_conn, NULL);
+}
+
+static void
+setup (Fixture *f,
+ gconstpointer data G_GNUC_UNUSED)
+{
+ dbus_error_init (&f->e);
+ g_queue_init (&f->messages);
+
+ f->server = dbus_server_listen ("tcp:host=127.0.0.1", &f->e);
+ assert_no_error (&f->e);
+ g_assert (f->server != NULL);
+
+ dbus_server_set_new_connection_function (f->server,
+ new_conn_cb, f, NULL);
+ dbus_server_setup_with_g_main (f->server, NULL);
+}
+
+static void
+test_connect (Fixture *f,
+ gconstpointer data G_GNUC_UNUSED)
+{
+ dbus_bool_t have_mem;
+
+ g_assert (f->left_server_conn == NULL);
+ g_assert (f->right_server_conn == NULL);
+
+ f->left_client_conn = dbus_connection_open_private (
+ dbus_server_get_address (f->server), &f->e);
+ assert_no_error (&f->e);
+ g_assert (f->left_client_conn != NULL);
+ dbus_connection_setup_with_g_main (f->left_client_conn, NULL);
+
+ while (f->left_server_conn == NULL)
+ {
+ g_print (".");
+ g_main_context_iteration (NULL, TRUE);
+ }
+
+ f->right_client_conn = dbus_connection_open_private (
+ dbus_server_get_address (f->server), &f->e);
+ assert_no_error (&f->e);
+ g_assert (f->right_client_conn != NULL);
+ dbus_connection_setup_with_g_main (f->right_client_conn, NULL);
+
+ while (f->right_server_conn == NULL)
+ {
+ g_print (".");
+ g_main_context_iteration (NULL, TRUE);
+ }
+
+ have_mem = dbus_connection_add_filter (f->right_client_conn,
+ right_client_message_cb, f, NULL);
+ g_assert (have_mem);
+}
+
+static dbus_uint32_t
+send_one (Fixture *f,
+ const char *member)
+{
+ dbus_bool_t have_mem;
+ dbus_uint32_t serial;
+ DBusMessage *outgoing;
+
+ outgoing = dbus_message_new_signal ("/com/example/Hello",
+ "com.example.Hello", member);
+ g_assert (outgoing != NULL);
+
+ have_mem = dbus_connection_send (f->left_client_conn, outgoing, &serial);
+ g_assert (have_mem);
+ g_assert (serial != 0);
+
+ dbus_message_unref (outgoing);
+ return serial;
+}
+
+static void
+test_relay (Fixture *f,
+ gconstpointer data)
+{
+ DBusMessage *incoming;
+
+ test_connect (f, data);
+
+ send_one (f, "First");
+ send_one (f, "Second");
+
+ while (g_queue_get_length (&f->messages) < 2)
+ {
+ g_print (".");
+ g_main_context_iteration (NULL, TRUE);
+ }
+
+ g_assert_cmpuint (g_queue_get_length (&f->messages), ==, 2);
+
+ incoming = g_queue_pop_head (&f->messages);
+ g_assert_cmpstr (dbus_message_get_member (incoming), ==, "First");
+ dbus_message_unref (incoming);
+
+ incoming = g_queue_pop_head (&f->messages);
+ g_assert_cmpstr (dbus_message_get_member (incoming), ==, "Second");
+ dbus_message_unref (incoming);
+}
+
+/* An arbitrary number of messages */
+#define MANY 8192
+
+static void
+test_limit (Fixture *f,
+ gconstpointer data)
+{
+ DBusMessage *incoming;
+ guint i;
+
+ test_connect (f, data);
+
+ /* This was an attempt to reproduce fd.o #34393. It didn't work. */
+ g_test_bug ("34393");
+ dbus_connection_set_max_received_size (f->left_server_conn, 1);
+ g_main_context_iteration (NULL, TRUE);
+
+ for (i = 0; i < MANY; i++)
+ {
+ gchar *buf = g_strdup_printf ("Message%u", i);
+
+ send_one (f, buf);
+ g_free (buf);
+ }
+
+ i = 0;
+
+ while (i < MANY)
+ {
+ while (g_queue_is_empty (&f->messages))
+ {
+ g_main_context_iteration (NULL, TRUE);
+ }
+
+ while ((incoming = g_queue_pop_head (&f->messages)) != NULL)
+ {
+ i++;
+ dbus_message_unref (incoming);
+ }
+ }
+}
+
+static void
+teardown (Fixture *f,
+ gconstpointer data G_GNUC_UNUSED)
+{
+ if (f->left_client_conn != NULL)
+ {
+ dbus_connection_close (f->left_client_conn);
+ dbus_connection_unref (f->left_client_conn);
+ f->left_client_conn = NULL;
+ }
+
+ if (f->right_client_conn != NULL)
+ {
+ dbus_connection_close (f->right_client_conn);
+ dbus_connection_unref (f->right_client_conn);
+ f->right_client_conn = NULL;
+ }
+
+ if (f->left_server_conn != NULL)
+ {
+ dbus_connection_close (f->left_server_conn);
+ dbus_connection_unref (f->left_server_conn);
+ f->left_server_conn = NULL;
+ }
+
+ if (f->right_server_conn != NULL)
+ {
+ dbus_connection_close (f->right_server_conn);
+ dbus_connection_unref (f->right_server_conn);
+ f->right_server_conn = NULL;
+ }
+
+ if (f->server != NULL)
+ {
+ dbus_server_disconnect (f->server);
+ dbus_server_unref (f->server);
+ f->server = NULL;
+ }
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ g_test_init (&argc, &argv, NULL);
+ g_test_bug_base ("https://bugs.freedesktop.org/show_bug.cgi?id=");
+
+ g_test_add ("/connect", Fixture, NULL, setup,
+ test_connect, teardown);
+ g_test_add ("/relay", Fixture, NULL, setup,
+ test_relay, teardown);
+ g_test_add ("/limit", Fixture, NULL, setup,
+ test_limit, teardown);
+
+ return g_test_run ();
+}
diff --git a/tools/Makefile.in b/tools/Makefile.in
index 9d794f49..06b702cd 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -186,6 +186,8 @@ DBUS_CONSOLE_AUTH_DIR = @DBUS_CONSOLE_AUTH_DIR@
DBUS_CONSOLE_OWNER_FILE = @DBUS_CONSOLE_OWNER_FILE@
DBUS_DAEMONDIR = @DBUS_DAEMONDIR@
DBUS_DATADIR = @DBUS_DATADIR@
+DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@
+DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@
DBUS_HAVE_INT64 = @DBUS_HAVE_INT64@
DBUS_INT16_TYPE = @DBUS_INT16_TYPE@
DBUS_INT32_TYPE = @DBUS_INT32_TYPE@
@@ -231,6 +233,8 @@ EXPANDED_PREFIX = @EXPANDED_PREFIX@
EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@
FGREP = @FGREP@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -275,7 +279,6 @@ PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
RC = @RC@
R_DYNAMIC_LDFLAG = @R_DYNAMIC_LDFLAG@
-SECTION_LDFLAGS = @SECTION_LDFLAGS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
diff --git a/tools/run-with-tmp-session-bus.sh b/tools/run-with-tmp-session-bus.sh
index 982184a2..c39999fb 100755
--- a/tools/run-with-tmp-session-bus.sh
+++ b/tools/run-with-tmp-session-bus.sh
@@ -1,4 +1,4 @@
-#! /bin/bash
+#! /bin/sh
SCRIPTNAME=$0
WRAPPED_SCRIPT=$1