summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2015-03-27 17:42:07 +0300
committerIgor Pashev <pashev.igor@gmail.com>2015-03-27 17:42:07 +0300
commit0c9ed253893faa13313fee30ce6dbf40a0339035 (patch)
tree488b25b9c65c93011c75eb09035db2d5ee2f400f
parent6a2ee6bd4acd68ec4f28fa397543079d8cab77cc (diff)
parentc1c801dcb5e6470e9327195c89ee2da6e505127b (diff)
downloaddbus-0c9ed253893faa13313fee30ce6dbf40a0339035.tar.gz
Merge branch 'master' of git://anonscm.debian.org/pkg-utopia/dbus
Conflicts: debian/changelog debian/dbus.postinst
-rw-r--r--Doxyfile.in1
-rw-r--r--HACKING7
-rw-r--r--INSTALL6
-rw-r--r--Makefile.am3
-rw-r--r--Makefile.in381
-rw-r--r--NEWS726
-rw-r--r--README23
-rw-r--r--README.valgrind24
-rw-r--r--README.win21
-rw-r--r--aclocal.m4751
-rwxr-xr-xautogen.sh105
-rw-r--r--bus/Makefile.am31
-rw-r--r--bus/Makefile.in670
-rw-r--r--bus/activation-helper-bin.c5
-rw-r--r--bus/activation-helper.c7
-rw-r--r--bus/activation.c97
-rw-r--r--bus/activation.h3
-rw-r--r--bus/bus.c111
-rw-r--r--bus/bus.h4
-rw-r--r--bus/config-loader-libxml.c324
-rw-r--r--bus/config-parser-trivial.c4
-rw-r--r--bus/config-parser.c45
-rw-r--r--bus/connection.c185
-rw-r--r--bus/connection.h6
-rw-r--r--bus/dbus.service.in2
-rw-r--r--bus/desktop-file.c6
-rw-r--r--bus/desktop-file.h1
-rw-r--r--bus/dir-watch-dnotify.c93
-rw-r--r--bus/dir-watch-inotify.c20
-rw-r--r--bus/dir-watch-kqueue.c175
-rw-r--r--bus/dispatch.c15
-rw-r--r--bus/driver.c323
-rw-r--r--bus/driver.h4
-rw-r--r--bus/expirelist.c4
-rw-r--r--bus/main.c49
-rw-r--r--bus/policy.c4
-rw-r--r--bus/policy.h2
-rw-r--r--bus/selinux.c61
-rw-r--r--bus/services.c7
-rw-r--r--bus/session.conf.in6
-rw-r--r--bus/signals.c38
-rw-r--r--bus/stats.c251
-rw-r--r--bus/system.conf.in8
-rw-r--r--bus/test-launch-helper.c13
-rw-r--r--bus/test-main.c8
-rw-r--r--bus/test-system.c8
-rw-r--r--bus/test.c2
-rw-r--r--bus/test.h2
-rw-r--r--cmake/CMakeLists.txt197
-rw-r--r--cmake/ConfigureChecks.cmake9
-rw-r--r--cmake/Doxyfile.cmake182
-rw-r--r--cmake/bus/CMakeLists.txt44
-rw-r--r--cmake/config.h.cmake41
-rwxr-xr-xcmake/cross-compile.sh110
-rw-r--r--cmake/dbus-env.bat.cmake4
-rw-r--r--cmake/dbus/CMakeLists.txt30
-rw-r--r--cmake/doc/CMakeLists.txt90
-rw-r--r--cmake/modules/COPYING-CMAKE-SCRIPTS22
-rw-r--r--cmake/modules/CPackInstallConfig.cmake9
-rw-r--r--cmake/modules/FindGLIB.cmake42
-rw-r--r--cmake/modules/FindGLib2.cmake60
-rw-r--r--cmake/modules/FindGObject.cmake52
-rw-r--r--cmake/modules/FindLibExpat.cmake61
-rw-r--r--cmake/modules/Macros.cmake59
-rw-r--r--cmake/modules/MacrosAutotools.cmake60
-rw-r--r--cmake/test/CMakeLists.txt77
-rw-r--r--cmake/test/name-test/CMakeLists.txt48
-rw-r--r--cmake/tools/CMakeLists.txt2
-rwxr-xr-xcompile10
-rwxr-xr-xconfig.guess346
-rw-r--r--config.h.in43
-rwxr-xr-xconfig.sub113
-rwxr-xr-xconfigure1883
-rw-r--r--configure.ac380
-rw-r--r--dbus/Makefile.am31
-rw-r--r--dbus/Makefile.in378
-rw-r--r--dbus/dbus-address.c12
-rw-r--r--dbus/dbus-arch-deps.h.in8
-rw-r--r--dbus/dbus-asv-util.c260
-rw-r--r--dbus/dbus-asv-util.h46
-rw-r--r--dbus/dbus-auth-script.c10
-rw-r--r--dbus/dbus-auth-util.c4
-rw-r--r--dbus/dbus-auth.c12
-rw-r--r--dbus/dbus-auth.h3
-rw-r--r--dbus/dbus-bus.c82
-rw-r--r--dbus/dbus-connection-internal.h8
-rw-r--r--dbus/dbus-connection.c146
-rw-r--r--dbus/dbus-credentials-util.c16
-rw-r--r--dbus/dbus-credentials.c32
-rw-r--r--dbus/dbus-credentials.h4
-rw-r--r--dbus/dbus-dataslot.c77
-rw-r--r--dbus/dbus-dataslot.h8
-rw-r--r--dbus/dbus-errors.c3
-rw-r--r--dbus/dbus-hash.c4
-rw-r--r--dbus/dbus-init-win.cpp52
-rw-r--r--dbus/dbus-internals.c79
-rw-r--r--dbus/dbus-internals.h83
-rw-r--r--dbus/dbus-keyring.c12
-rw-r--r--dbus/dbus-list.c21
-rw-r--r--dbus/dbus-macros.h13
-rw-r--r--dbus/dbus-mainloop.c25
-rw-r--r--dbus/dbus-marshal-basic.c77
-rw-r--r--dbus/dbus-marshal-basic.h39
-rw-r--r--dbus/dbus-marshal-byteswap-util.c4
-rw-r--r--dbus/dbus-marshal-byteswap.c4
-rw-r--r--dbus/dbus-marshal-header.c4
-rw-r--r--dbus/dbus-marshal-recursive-util.c36
-rw-r--r--dbus/dbus-marshal-validate-util.c4
-rw-r--r--dbus/dbus-memory.c59
-rw-r--r--dbus/dbus-mempool.c30
-rw-r--r--dbus/dbus-message-factory.c4
-rw-r--r--dbus/dbus-message-factory.h4
-rw-r--r--dbus/dbus-message-internal.h7
-rw-r--r--dbus/dbus-message-private.h2
-rw-r--r--dbus/dbus-message-util.c249
-rw-r--r--dbus/dbus-message.c248
-rw-r--r--dbus/dbus-message.h12
-rw-r--r--dbus/dbus-misc.c2
-rw-r--r--dbus/dbus-misc.h4
-rw-r--r--dbus/dbus-nonce.c16
-rw-r--r--dbus/dbus-object-tree.c468
-rw-r--r--dbus/dbus-pending-call.c16
-rw-r--r--dbus/dbus-server-debug-pipe.c4
-rw-r--r--dbus/dbus-server-launchd.c3
-rw-r--r--dbus/dbus-server-protected.h5
-rw-r--r--dbus/dbus-server-socket.c7
-rw-r--r--dbus/dbus-server-unix.c38
-rw-r--r--dbus/dbus-server.c55
-rw-r--r--dbus/dbus-sha.c4
-rw-r--r--dbus/dbus-shell.c12
-rw-r--r--dbus/dbus-signature.c2
-rw-r--r--dbus/dbus-socket-set-poll.c2
-rw-r--r--dbus/dbus-spawn-win.c47
-rw-r--r--dbus/dbus-spawn.c168
-rw-r--r--dbus/dbus-spawn.h1
-rw-r--r--dbus/dbus-string-util.c4
-rw-r--r--dbus/dbus-string.c51
-rw-r--r--dbus/dbus-string.h2
-rw-r--r--dbus/dbus-syntax.c8
-rw-r--r--dbus/dbus-sysdeps-pthread.c19
-rw-r--r--dbus/dbus-sysdeps-thread-win.c30
-rw-r--r--dbus/dbus-sysdeps-unix.c656
-rw-r--r--dbus/dbus-sysdeps-unix.h4
-rw-r--r--dbus/dbus-sysdeps-util-unix.c358
-rw-r--r--dbus/dbus-sysdeps-util-win.c249
-rw-r--r--dbus/dbus-sysdeps-util.c4
-rw-r--r--dbus/dbus-sysdeps-win.c596
-rw-r--r--dbus/dbus-sysdeps-win.h9
-rw-r--r--dbus/dbus-sysdeps-wince-glue.c2
-rw-r--r--dbus/dbus-sysdeps.c32
-rw-r--r--dbus/dbus-sysdeps.h47
-rw-r--r--dbus/dbus-test.c15
-rw-r--r--dbus/dbus-threads.c423
-rw-r--r--dbus/dbus-transport-protected.h2
-rw-r--r--dbus/dbus-transport-socket.c70
-rw-r--r--dbus/dbus-transport-unix.c2
-rw-r--r--dbus/dbus-transport.c76
-rw-r--r--dbus/dbus-transport.h7
-rw-r--r--dbus/dbus-types.h36
-rw-r--r--dbus/dbus-userdb-util.c33
-rw-r--r--dbus/dbus-userdb.c51
-rw-r--r--dbus/dbus-userdb.h2
-rw-r--r--dbus/dbus-watch.c64
-rw-r--r--dbus/dbus-watch.h2
-rw-r--r--dbus/sd-daemon.c193
-rw-r--r--dbus/sd-daemon.h59
-rw-r--r--debian/changelog321
-rw-r--r--debian/clean1
-rw-r--r--debian/control43
-rw-r--r--debian/copyright645
-rw-r--r--debian/dbus-udeb.dirs1
-rw-r--r--debian/dbus-udeb.install6
-rw-r--r--debian/dbus-udeb.postinst7
-rw-r--r--debian/dbus.README.Debian32
-rw-r--r--debian/dbus.bug-control1
-rw-r--r--debian/dbus.init2
-rw-r--r--debian/dbus.install-generic (renamed from debian/dbus.install)7
-rw-r--r--debian/dbus.install-systemd5
-rw-r--r--debian/dbus.postinst31
-rw-r--r--debian/dbus.postrm6
-rw-r--r--debian/dbus.triggers2
-rw-r--r--debian/libdbus-1-3.symbols1
-rwxr-xr-xdebian/rules75
-rwxr-xr-xdebian/tests/build36
-rw-r--r--debian/tests/control5
-rwxr-xr-xdebian/tests/installed-tests33
-rwxr-xr-xdepcomp455
-rw-r--r--doc/Makefile.am71
-rw-r--r--doc/Makefile.in239
-rw-r--r--doc/dbus-cleanup-sockets.143
-rw-r--r--doc/dbus-cleanup-sockets.1.xml.in65
-rw-r--r--doc/dbus-daemon.1.in766
-rw-r--r--doc/dbus-daemon.1.xml.in (renamed from cmake/bus/dbus-daemon.xml)629
-rw-r--r--doc/dbus-faq.html437
-rw-r--r--doc/dbus-faq.xml4
-rw-r--r--doc/dbus-launch.1211
-rw-r--r--doc/dbus-launch.1.xml.in (renamed from cmake/tools/dbus-launch.xml)120
-rw-r--r--doc/dbus-monitor.178
-rw-r--r--doc/dbus-monitor.1.xml.in (renamed from cmake/tools/dbus-monitor.xml)19
-rw-r--r--doc/dbus-run-session.1.xml.in151
-rw-r--r--doc/dbus-send.1109
-rw-r--r--doc/dbus-send.1.xml.in (renamed from cmake/tools/dbus-send.xml)101
-rw-r--r--doc/dbus-specification.html2898
-rw-r--r--doc/dbus-specification.xml1573
-rw-r--r--doc/dbus-test-plan.html141
-rw-r--r--doc/dbus-test-plan.xml18
-rw-r--r--doc/dbus-tutorial.html991
-rw-r--r--doc/dbus-tutorial.xml4
-rw-r--r--doc/dbus-uuidgen.189
-rw-r--r--doc/dbus-uuidgen.1.xml.in126
-rwxr-xr-xinstall-sh14
-rw-r--r--ltmain.sh4
-rw-r--r--m4/compiler.m42
-rw-r--r--m4/libtool.m412
-rwxr-xr-xmissing414
-rwxr-xr-xtest-driver139
-rw-r--r--test/Makefile.am147
-rw-r--r--test/Makefile.in1359
-rw-r--r--test/corrupt.c37
-rw-r--r--test/data/valid-config-files/incoming-limit.conf.in (renamed from test/data/valid-config-files/incoming-limit.conf)2
-rw-r--r--test/dbus-daemon-eavesdrop.c38
-rw-r--r--test/dbus-daemon.c252
-rw-r--r--test/internals/printf.c88
-rw-r--r--test/internals/refs.c1
-rw-r--r--test/internals/syslog.c10
-rw-r--r--test/loopback.c85
-rw-r--r--test/manual-authz.c409
-rw-r--r--test/marshal.c28
-rw-r--r--test/name-test/Makefile.am23
-rw-r--r--test/name-test/Makefile.in719
-rwxr-xr-xtest/name-test/run-test-systemserver.sh5
-rwxr-xr-xtest/name-test/run-test.sh5
-rw-r--r--test/name-test/test-autolaunch.c11
-rw-r--r--test/name-test/test-threads-init.c14
-rw-r--r--test/relay.c25
-rw-r--r--test/shell-test.c2
-rw-r--r--test/spawn-test.c4
-rw-r--r--test/test-exit.c2
-rw-r--r--test/test-segfault.c18
-rw-r--r--test/test-utils.c93
-rw-r--r--test/test-utils.h39
-rw-r--r--tools/Makefile.am8
-rw-r--r--tools/Makefile.in245
-rw-r--r--tools/dbus-launch-win.c4
-rw-r--r--tools/dbus-launch.c138
-rw-r--r--tools/dbus-monitor.c51
-rw-r--r--tools/dbus-print-message.c10
-rw-r--r--tools/dbus-run-session.c464
-rw-r--r--tools/dbus-send.c73
-rwxr-xr-xtools/run-with-tmp-session-bus.sh52
-rw-r--r--tools/strtoll.c1
-rw-r--r--tools/strtoull.c1
252 files changed, 16183 insertions, 14251 deletions
diff --git a/Doxyfile.in b/Doxyfile.in
index afac639b..f0a37eda 100644
--- a/Doxyfile.in
+++ b/Doxyfile.in
@@ -147,7 +147,6 @@ PREDEFINED = "DBUS_BEGIN_DECLS=" \
"DBUS_END_DECLS=" \
"DOXYGEN_SHOULD_SKIP_THIS" \
"DBUS_GNUC_DEPRECATED=" \
- "_DBUS_DEFINE_GLOBAL_LOCK(name)=" \
"_DBUS_GNUC_PRINTF(from,to)="
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
diff --git a/HACKING b/HACKING
index 805fd2e0..2fed9e6c 100644
--- a/HACKING
+++ b/HACKING
@@ -11,6 +11,11 @@ of patches, etc. should go there.
Security
===
+If you find a security vulnerability that is not known to the public,
+please report it privately to dbus-security@lists.freedesktop.org
+or by reporting a freedesktop.org bug that is marked as
+restricted to the "D-BUS security group".
+
Most of D-Bus is security sensitive. Guidelines related to that:
- avoid memcpy(), sprintf(), strlen(), snprintf, strlcat(),
@@ -267,7 +272,7 @@ Tests
These are the test programs that are built if dbus is compiled using
--enable-tests.
-dbus/dbus-test
+dbus/test-dbus
This is the main unit test program that tests all aspects of the D-Bus
client library.
diff --git a/INSTALL b/INSTALL
index e182f985..f2f0122c 100644
--- a/INSTALL
+++ b/INSTALL
@@ -51,15 +51,11 @@ Core library
Requisite:
- Gettext
- - expat or libxml-2
-
- NB, expat is the recommended XML parser because it has more robust
- handling of OOM conditions.
+ - expat
Optional:
- libselinux (for SELinux integration)
- - dnotify (for automatic service file reload)
- doxygen (for API documentation)
- xmlto or meinproc4 (for Spec & other XML documentation)
diff --git a/Makefile.am b/Makefile.am
index 10b96703..756ab8b9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -7,6 +7,7 @@ DISTCLEANFILES = \
dbus-1.pc
EXTRA_DIST = \
+ autogen.sh \
HACKING \
dbus-1.pc.in \
cleanup-man-pages.sh \
@@ -14,6 +15,7 @@ EXTRA_DIST = \
NEWS.pre-1-0 \
ChangeLog.pre-1-2 \
NEWS.pre-1-2 \
+ README.valgrind \
README.win \
README.wince \
README.cygwin \
@@ -26,6 +28,7 @@ update-authors:
git shortlog -s -e | cut -c 8- | sort > AUTHORS
DISTCHECK_CONFIGURE_FLAGS = \
+ --enable-xml-docs \
--with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
diff --git a/Makefile.in b/Makefile.in
index c6d6d33f..8cb80061 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.6 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -38,23 +37,51 @@
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
VPATH = @srcdir@
-am__make_dryrun = \
- { \
- am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
- *) \
- for am__flg in $$MAKEFLAGS; do \
- case $$am__flg in \
- *=*|--*) ;; \
- *n*) am__dry=yes; break;; \
- esac; \
- done;; \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
- test $$am__dry = yes; \
- }
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -73,30 +100,31 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-DIST_COMMON = README $(am__configure_deps) $(srcdir)/Doxyfile.in \
- $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- $(srcdir)/config.h.in $(srcdir)/dbus-1-uninstalled.pc.in \
- $(srcdir)/dbus-1.pc.in $(srcdir)/tools/lcov.am \
- $(top_srcdir)/configure \
- $(top_srcdir)/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoExec.service.in \
- $(top_srcdir)/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoService.service.in \
- $(top_srcdir)/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoUser.service.in \
- $(top_srcdir)/test/data/valid-config-files-system/debug-allow-all-fail.conf.in \
- $(top_srcdir)/test/data/valid-config-files-system/debug-allow-all-pass.conf.in \
- $(top_srcdir)/test/data/valid-config-files/debug-allow-all-sha1.conf.in \
+DIST_COMMON = $(srcdir)/tools/lcov.am INSTALL NEWS README AUTHORS \
+ ChangeLog $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+ $(top_srcdir)/configure $(am__configure_deps) \
+ $(srcdir)/config.h.in $(srcdir)/Doxyfile.in \
+ $(srcdir)/dbus-1.pc.in $(srcdir)/dbus-1-uninstalled.pc.in \
$(top_srcdir)/test/data/valid-config-files/debug-allow-all.conf.in \
- $(top_srcdir)/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteEchoService.service.in \
- $(top_srcdir)/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteSegfaultService.service.in \
- $(top_srcdir)/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service.in \
- $(top_srcdir)/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service.in \
+ $(top_srcdir)/test/data/valid-config-files/debug-allow-all-sha1.conf.in \
+ $(top_srcdir)/test/data/valid-config-files/incoming-limit.conf.in \
+ $(top_srcdir)/test/data/valid-config-files-system/debug-allow-all-pass.conf.in \
+ $(top_srcdir)/test/data/valid-config-files-system/debug-allow-all-fail.conf.in \
$(top_srcdir)/test/data/valid-service-files/org.freedesktop.DBus.TestSuite.PrivServer.service.in \
$(top_srcdir)/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteEchoService.service.in \
$(top_srcdir)/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteForkingEchoService.service.in \
$(top_srcdir)/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteSegfaultService.service.in \
- $(top_srcdir)/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service.in \
$(top_srcdir)/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service.in \
- AUTHORS COPYING ChangeLog INSTALL NEWS compile config.guess \
- config.sub depcomp install-sh ltmain.sh missing
+ $(top_srcdir)/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service.in \
+ $(top_srcdir)/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteEchoService.service.in \
+ $(top_srcdir)/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteSegfaultService.service.in \
+ $(top_srcdir)/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service.in \
+ $(top_srcdir)/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service.in \
+ $(top_srcdir)/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoExec.service.in \
+ $(top_srcdir)/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoUser.service.in \
+ $(top_srcdir)/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoService.service.in \
+ COPYING compile config.guess config.sub install-sh missing \
+ ltmain.sh
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
@@ -115,6 +143,7 @@ CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES = Doxyfile dbus-1.pc dbus-1-uninstalled.pc \
test/data/valid-config-files/debug-allow-all.conf \
test/data/valid-config-files/debug-allow-all-sha1.conf \
+ test/data/valid-config-files/incoming-limit.conf \
test/data/valid-config-files-system/debug-allow-all-pass.conf \
test/data/valid-config-files-system/debug-allow-all-fail.conf \
test/data/valid-service-files/org.freedesktop.DBus.TestSuite.PrivServer.service \
@@ -131,21 +160,28 @@ CONFIG_CLEAN_FILES = Doxyfile dbus-1.pc dbus-1-uninstalled.pc \
test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoUser.service \
test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoService.service
CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
+am__v_at_1 =
SOURCES =
DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
- html-recursive info-recursive install-data-recursive \
- install-dvi-recursive install-exec-recursive \
- install-html-recursive install-info-recursive \
- install-pdf-recursive install-ps-recursive install-recursive \
- installcheck-recursive installdirs-recursive pdf-recursive \
- ps-recursive uninstall-recursive
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+ ctags-recursive dvi-recursive html-recursive info-recursive \
+ install-data-recursive install-dvi-recursive \
+ install-exec-recursive install-html-recursive \
+ install-info-recursive install-pdf-recursive \
+ install-ps-recursive install-recursive installcheck-recursive \
+ installdirs-recursive pdf-recursive ps-recursive \
+ tags-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -182,11 +218,33 @@ am__installdirs = "$(DESTDIR)$(pkgconfigdir)"
DATA = $(pkgconfig_DATA)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
- $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
- distdir dist dist-all distcheck
+am__recursive_targets = \
+ $(RECURSIVE_TARGETS) \
+ $(RECURSIVE_CLEAN_TARGETS) \
+ $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+ cscope distdir dist dist-all distcheck
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
+ $(LISP)config.h.in
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
+CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
@@ -197,6 +255,7 @@ am__remove_distdir = \
&& rm -rf "$(distdir)" \
|| { sleep 5 && rm -rf "$(distdir)"; }; \
else :; fi
+am__post_remove_distdir = $(am__remove_distdir)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
@@ -224,6 +283,7 @@ am__relativize = \
reldir="$$dir2"
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
+DIST_TARGETS = dist-gzip
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
@@ -256,7 +316,6 @@ 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@
DBUS_INT64_CONSTANT = @DBUS_INT64_CONSTANT@
@@ -267,7 +326,8 @@ DBUS_MICRO_VERSION = @DBUS_MICRO_VERSION@
DBUS_MINOR_VERSION = @DBUS_MINOR_VERSION@
DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@
DBUS_PREFIX = @DBUS_PREFIX@
-DBUS_SESSION_BUS_DEFAULT_ADDRESS = @DBUS_SESSION_BUS_DEFAULT_ADDRESS@
+DBUS_SESSION_BUS_CONNECT_ADDRESS = @DBUS_SESSION_BUS_CONNECT_ADDRESS@
+DBUS_SESSION_BUS_LISTEN_ADDRESS = @DBUS_SESSION_BUS_LISTEN_ADDRESS@
DBUS_SESSION_SOCKET_DIR = @DBUS_SESSION_SOCKET_DIR@
DBUS_STATIC_BUILD_CPPFLAGS = @DBUS_STATIC_BUILD_CPPFLAGS@
DBUS_SYSTEM_BUS_DEFAULT_ADDRESS = @DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@
@@ -316,8 +376,6 @@ LIBDBUS_LIBS = @LIBDBUS_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
-LIBXML_CFLAGS = @LIBXML_CFLAGS@
-LIBXML_LIBS = @LIBXML_LIBS@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
@@ -326,7 +384,6 @@ LT_CURRENT = @LT_CURRENT@
LT_REVISION = @LT_REVISION@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
-MAN2HTML = @MAN2HTML@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NETWORK_libs = @NETWORK_libs@
@@ -360,7 +417,6 @@ SHELL = @SHELL@
STRIP = @STRIP@
SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
SYSTEMD_LIBS = @SYSTEMD_LIBS@
-TEST_BUS_BINARY = @TEST_BUS_BINARY@
TEST_LAUNCH_HELPER_BINARY = @TEST_LAUNCH_HELPER_BINARY@
TEST_LISTEN = @TEST_LISTEN@
TEST_SOCKET_DIR = @TEST_SOCKET_DIR@
@@ -443,6 +499,7 @@ DISTCLEANFILES = \
dbus-1.pc
EXTRA_DIST = \
+ autogen.sh \
HACKING \
dbus-1.pc.in \
cleanup-man-pages.sh \
@@ -450,6 +507,7 @@ EXTRA_DIST = \
NEWS.pre-1-0 \
ChangeLog.pre-1-2 \
NEWS.pre-1-2 \
+ README.valgrind \
README.win \
README.wince \
README.cygwin \
@@ -457,6 +515,7 @@ EXTRA_DIST = \
cmake
DISTCHECK_CONFIGURE_FLAGS = \
+ --enable-xml-docs \
--with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
@@ -501,8 +560,8 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
$(am__aclocal_m4_deps):
config.h: stamp-h1
- @if test ! -f $@; then rm -f stamp-h1; else :; fi
- @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
+ @test -f $@ || rm -f stamp-h1
+ @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
@@ -524,6 +583,8 @@ test/data/valid-config-files/debug-allow-all.conf: $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $@
test/data/valid-config-files/debug-allow-all-sha1.conf: $(top_builddir)/config.status $(top_srcdir)/test/data/valid-config-files/debug-allow-all-sha1.conf.in
cd $(top_builddir) && $(SHELL) ./config.status $@
+test/data/valid-config-files/incoming-limit.conf: $(top_builddir)/config.status $(top_srcdir)/test/data/valid-config-files/incoming-limit.conf.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
test/data/valid-config-files-system/debug-allow-all-pass.conf: $(top_builddir)/config.status $(top_srcdir)/test/data/valid-config-files-system/debug-allow-all-pass.conf.in
cd $(top_builddir) && $(SHELL) ./config.status $@
test/data/valid-config-files-system/debug-allow-all-fail.conf: $(top_builddir)/config.status $(top_srcdir)/test/data/valid-config-files-system/debug-allow-all-fail.conf.in
@@ -586,22 +647,25 @@ uninstall-pkgconfigDATA:
dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir)
# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-# (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
- @fail= failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+# (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+ @fail=; \
+ if $(am__make_keepgoing); then \
+ failcom='fail=yes'; \
+ else \
+ failcom='exit 1'; \
+ fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
@@ -616,57 +680,12 @@ $(RECURSIVE_TARGETS):
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
-$(RECURSIVE_CLEAN_TARGETS):
- @fail= failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- case "$@" in \
- distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
- *) list='$(SUBDIRS)' ;; \
- esac; \
- rev=''; for subdir in $$list; do \
- if test "$$subdir" = "."; then :; else \
- rev="$$subdir $$rev"; \
- fi; \
- done; \
- rev="$$rev ."; \
- target=`echo $@ | sed s/-recursive//`; \
- for subdir in $$rev; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done && test -z "$$fail"
-tags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
- done
-ctags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
- done
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
@@ -682,12 +701,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
- list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
+ $(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
@@ -699,15 +713,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$$unique; \
fi; \
fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
@@ -716,9 +726,31 @@ GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
+cscope: cscope.files
+ test ! -s cscope.files \
+ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
+clean-cscope:
+ -rm -f cscope.files
+cscope.files: clean-cscope cscopelist
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+ -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
distdir: $(DISTFILES)
$(am__remove_distdir)
@@ -786,40 +818,42 @@ distdir: $(DISTFILES)
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
- $(am__remove_distdir)
+ $(am__post_remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
- $(am__remove_distdir)
+ $(am__post_remove_distdir)
dist-lzip: distdir
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
- $(am__remove_distdir)
-
-dist-lzma: distdir
- tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
- $(am__remove_distdir)
+ $(am__post_remove_distdir)
dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
- $(am__remove_distdir)
+ $(am__post_remove_distdir)
dist-tarZ: distdir
+ @echo WARNING: "Support for shar distribution archives is" \
+ "deprecated." >&2
+ @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
- $(am__remove_distdir)
+ $(am__post_remove_distdir)
dist-shar: distdir
+ @echo WARNING: "Support for distribution archives compressed with" \
+ "legacy program 'compress' is deprecated." >&2
+ @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
- $(am__remove_distdir)
+ $(am__post_remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
- $(am__remove_distdir)
+ $(am__post_remove_distdir)
-dist dist-all: distdir
- tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
- $(am__remove_distdir)
+dist dist-all:
+ $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
+ $(am__post_remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
@@ -830,8 +864,6 @@ distcheck: dist
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
- *.tar.lzma*) \
- lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
*.tar.lz*) \
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
*.tar.xz*) \
@@ -843,18 +875,19 @@ distcheck: dist
*.zip*) \
unzip $(distdir).zip ;;\
esac
- chmod -R a-w $(distdir); chmod u+w $(distdir)
- mkdir $(distdir)/_build
- mkdir $(distdir)/_inst
+ chmod -R a-w $(distdir)
+ chmod u+w $(distdir)
+ mkdir $(distdir)/_build $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build \
- && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ && ../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
+ --srcdir=.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
@@ -877,7 +910,7 @@ distcheck: dist
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
&& cd "$$am__cwd" \
|| exit 1
- $(am__remove_distdir)
+ $(am__post_remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
@@ -1016,26 +1049,24 @@ ps-am:
uninstall-am: uninstall-pkgconfigDATA
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
- ctags-recursive install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
- all all-am all-local am--refresh check check-am clean \
- clean-generic clean-libtool ctags ctags-recursive dist \
- dist-all dist-bzip2 dist-gzip dist-lzip dist-lzma dist-shar \
- dist-tarZ dist-xz dist-zip distcheck distclean \
- distclean-generic distclean-hdr distclean-libtool \
- distclean-tags distcleancheck distdir distuninstallcheck 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-pkgconfigDATA install-ps install-ps-am \
- install-strip installcheck installcheck-am installdirs \
- installdirs-am maintainer-clean maintainer-clean-generic \
- mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
- ps ps-am tags tags-recursive uninstall uninstall-am \
- uninstall-pkgconfigDATA
+.MAKE: $(am__recursive_targets) all install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am all-local \
+ am--refresh check check-am clean clean-cscope clean-generic \
+ clean-libtool cscope cscopelist-am ctags ctags-am dist \
+ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \
+ dist-xz dist-zip distcheck distclean distclean-generic \
+ distclean-hdr distclean-libtool distclean-tags distcleancheck \
+ distdir distuninstallcheck 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-pkgconfigDATA \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
+ uninstall-am uninstall-pkgconfigDATA
all-local: Doxyfile
diff --git a/NEWS b/NEWS
index 3ea75053..d45c4ad7 100644
--- a/NEWS
+++ b/NEWS
@@ -1,30 +1,738 @@
-D-Bus 1.6.10 (2013-04-24)
+D-Bus 1.8.16 (2015-02-09)
==
-The “little-known facts about bananas” release.
+The “poorly concealed wrestlers” release.
-• Following Unicode Corrigendum #9, the noncharacters U+nFFFE, U+nFFFF,
- U+FDD0..U+FDEF are allowed in UTF-8 strings again.
- (fd.o #63072, Simon McVittie)
+Security fixes:
+
+• Do not allow non-uid-0 processes to send forged ActivationFailure
+ messages. On Linux systems with systemd activation, this would
+ allow a local denial of service: unprivileged processes could
+ flood the bus with these forged messages, winning the race with
+ the actual service activation and causing an error reply
+ to be sent back when service auto-activation was requested.
+ This does not prevent the real service from being started,
+ so it only works while the real service is not running.
+ (CVE-2015-0245, fd.o #88811; Simon McVittie)
+
+Other fixes:
+
+• fix a Windows build failure (fd.o #88009, Ralf Habacker)
+
+• on Windows, allow up to 8K connections to the dbus-daemon instead of the
+ previous 64, completing a previous fix which only worked under
+ Autotools (fd.o #71297, Ralf Habacker)
+
+D-Bus 1.8.14 (2015-01-05)
+==
+
+The “40lb of roofing nails” release.
+
+Security hardening:
+
+• Do not allow calls to UpdateActivationEnvironment from uids other than
+ the uid of the dbus-daemon. If a system service installs unsafe
+ security policy rules that allow arbitrary method calls
+ (such as CVE-2014-8148) then this prevents memory consumption and
+ possible privilege escalation via UpdateActivationEnvironment.
+
+ We believe that in practice, privilege escalation here is avoided
+ by dbus-daemon-launch-helper sanitizing its environment; but
+ it seems better to be safe.
+
+• Do not allow calls to UpdateActivationEnvironment or the Stats interface
+ on object paths other than /org/freedesktop/DBus. Some system services
+ install unsafe security policy rules that allow arbitrary method calls
+ to any destination, method and interface with a specified object path;
+ while less bad than allowing arbitrary method calls, these security
+ policies are still harmful, since dbus-daemon normally offers the
+ same API on all object paths and other system services might behave
+ similarly.
+
+Other fixes:
+
+• Add missing initialization so GetExtendedTcpTable doesn't crash on
+ Windows Vista SP0 (fd.o #77008, Илья А. Ткаченко)
+
+D-Bus 1.8.12 (2014-11-24)
+==
+
+The “days of fuchsia passed” release.
+
+Fixes:
+
+• Partially revert the CVE-2014-3639 patch by increasing the default
+ authentication timeout on the system bus from 5 seconds back to 30
+ seconds, since this has been reported to cause boot regressions for
+ some users, mostly with parallel boot (systemd) on slower hardware.
+
+ On fast systems where local users are considered particularly hostile,
+ administrators can return to the 5 second timeout (or any other value
+ in milliseconds) by saving this as /etc/dbus-1/system-local.conf:
+
+ <busconfig>
+ <limit name="auth_timeout">5000</limit>
+ </busconfig>
+
+ (fd.o #86431, Simon McVittie)
+
+• Add a message in syslog/the Journal when the auth_timeout is exceeded
+ (fd.o #86431, Simon McVittie)
+
+• Send back an AccessDenied error if the addressed recipient is not allowed
+ to receive a message (and in builds with assertions enabled, don't
+ assert under the same conditions). (fd.o #86194, Jacek Bukarewicz)
+
+D-Bus 1.8.10 (2014-11-10)
+==
+
+The “tenants with a leaking roof get priority” release.
+
+Security fixes:
+
+• Increase dbus-daemon's RLIMIT_NOFILE rlimit to 65536
+ so that CVE-2014-3636 part A cannot exhaust the system bus'
+ file descriptors, completing the incomplete fix in 1.8.8.
+ (CVE-2014-7824, fd.o #85105; Simon McVittie, Alban Crequy)
+
+D-Bus 1.8.8 (2014-09-16)
+==
+
+The "smashy smashy egg man" release.
+
+Security fixes:
+
+• Do not accept an extra fd in the padding of a cmsg message, which
+ could lead to a 4-byte heap buffer overrun.
+ (CVE-2014-3635, fd.o #83622; Simon McVittie)
+
+• Reduce default for maximum Unix file descriptors passed per message
+ from 1024 to 16, preventing a uid with the default maximum number of
+ connections from exhausting the system bus' file descriptors under
+ Linux's default rlimit. Distributors or system administrators with a
+ more restrictive fd limit may wish to reduce these limits further.
+
+ Additionally, on Linux this prevents a second denial of service
+ in which the dbus-daemon can be made to exceed the maximum number
+ of fds per sendmsg() and disconnect the process that would have
+ received them.
+ (CVE-2014-3636, fd.o #82820; Alban Crequy)
+
+• Disconnect connections that still have a fd pending unmarshalling after
+ a new configurable limit, pending_fd_timeout (defaulting to 150 seconds),
+ removing the possibility of creating an abusive connection that cannot be
+ disconnected by setting up a circular reference to a connection's
+ file descriptor.
+ (CVE-2014-3637, fd.o #80559; Alban Crequy)
+
+• Reduce default for maximum pending replies per connection from 8192 to 128,
+ mitigating an algorithmic complexity denial-of-service attack
+ (CVE-2014-3638, fd.o #81053; Alban Crequy)
+
+• Reduce default for authentication timeout on the system bus from
+ 30 seconds to 5 seconds, avoiding denial of service by using up
+ all unauthenticated connection slots; and when all unauthenticated
+ connection slots are used up, make new connection attempts block
+ instead of disconnecting them.
+ (CVE-2014-3639, fd.o #80919; Alban Crequy)
+
+Other fixes:
+
+• Check for libsystemd from systemd >= 209, falling back to
+ the older separate libraries if not found (Umut Tezduyar Lindskog,
+ Simon McVittie)
+
+• On Linux, use prctl() to disable core dumps from a test executable
+ that deliberately raises SIGSEGV to test dbus-daemon's handling
+ of that condition (fd.o #83772, Simon McVittie)
+
+• Fix compilation with --enable-stats (fd.o #81043, Gentoo #507232;
+ Alban Crequy)
+
+• Improve documentation for running tests on Windows (fd.o #41252,
+ Ralf Habacker)
+
+D-Bus 1.8.6 (2014-06-02)
+==
+
+Security fixes:
+
+• On Linux ≥ 2.6.37-rc4, if sendmsg() fails with ETOOMANYREFS, silently drop
+ the message. This prevents an attack in which a malicious client can
+ make dbus-daemon disconnect a system service, which is a local
+ denial of service.
+ (fd.o #80163, CVE-2014-3532; Alban Crequy)
+
+• Track remaining Unix file descriptors correctly when more than one
+ message in quick succession contains fds. This prevents another attack
+ in which a malicious client can make dbus-daemon disconnect a system
+ service.
+ (fd.o #79694, fd.o #80469, CVE-2014-3533; Alejandro Martínez Suárez,
+ Simon McVittie, Alban Crequy)
+
+Other fixes:
+
+• When dbus-launch --exit-with-session starts a dbus-daemon but then cannot
+ attach to a session, kill the dbus-daemon as intended
+ (fd.o #74698, Роман Донченко)
+
+D-Bus 1.8.4 (2014-06-10)
+==
+
+Security fix:
+
+• Alban Crequy at Collabora Ltd. discovered and fixed a denial-of-service
+ flaw in dbus-daemon, part of the reference implementation of D-Bus.
+ Additionally, in highly unusual environments the same flaw could lead to
+ a side channel between processes that should not be able to communicate.
+ (CVE-2014-3477, fd.o #78979)
+
+D-Bus 1.8.2 (2014-04-30)
+==
+
+The “nobody wants red” release.
+
+Enhancements:
+
+• in the CMake build system, add some hints for Linux users cross-compiling
+ Windows D-Bus binaries to be able to run tests under Wine
+ (fd.o #41252, Ralf Habacker)
+
+• add Documentation key to dbus.service (fd.o #77447, Cameron Norman)
+
+Fixes:
+
+• in "dbus-uuidgen --ensure", try to copy systemd's /etc/machine-id
+ to /var/lib/dbus/machine-id instead of generating an entirely new ID
+ (fd.o #77941, Simon McVittie)
+
+• if dbus-launch receives an X error very quickly, do not kill
+ unrelated processes (fd.o #74698, Роман Донченко)
+
+• on Windows, allow up to 8K connections to the dbus-daemon, instead of the
+ previous 64 (fd.o #71297; Cristian Onet, Ralf Habacker)
+
+• cope with \r\n newlines in regression tests, since on Windows,
+ dbus-daemon.exe uses text mode (fd.o #75863, Руслан Ижбулатов)
+
+D-Bus 1.8.0 (2014-01-20)
+==
+
+The “Wolverine distrusts my printer” release.
+
+This starts a new stable branch. The 1.6.x branch is now considered to be
+outdated, and will only receive fixes for serious bugs such as security
+flaws. The 1.4.x and 1.2.x branches no longer have upstream support and
+are unlikely to get any more releases, but if distributors still need to
+support them, please share security patches via upstream.
+
+Summary of changes since 1.6.x:
+
+• libdbus always behaves as if dbus_threads_init_default() had been called
+ (thread-safety by default)
+• new dbus-run-session tool, replacing certain misuses of dbus-launch
+• dbus-monitor can talk to outdated versions of dbus-daemon again
+• new org.freedesktop.DBus.GetConnectionCredentials method
+• GetConnectionUnixProcessID also works correctly on Windows, returning
+ the Windows process ID
+• GetConnectionWindowsSID returns the correct SID on Windows
+• expat is required, libxml2 can no longer be used as a substitute
+• the userDB cache is required, and cannot be disabled
+• a 64-bit integer type (either int, long, long long or _int64) is required
+• better systemd-journald integration on Linux
+• fixed long-standing fd and array leaks when failing to parse a message
+• fixed referenced-but-never-freed parent nodes (effectively memory leaks)
+ when using certain object-path allocation patterns, notably in Avahi
+• better defaults for Windows support
+• better CMake support
+• better portability to mingw32, FreeBSD, NetBSD, QNX and Hurd
+• the source language for the man pages is now Docbook XML
+
+Enhancements since 1.7.10:
+
+• Enhance the CMake build system to check for GLib and compile/run
+ a subset of the regression tests (fd.o #41252, #73495; Ralf Habacker)
+
+Fixes since 1.7.10:
+
+• don't rely on va_copy(), use DBUS_VA_COPY() wrapper (fd.o #72840,
+ Ralf Habacker)
+
+• fix compilation of systemd journal support on older systemd versions where
+ sd-journal.h doesn't include syslog.h (fd.o #73455, Ralf Habacker)
+
+• fix compilation on older MSVC versions by including stdlib.h
+ (fd.o #73455, Ralf Habacker)
+
+• Allow <allow_anonymous/> to appear in an included configuration file
+ (fd.o #73475, Matt Hoosier)
+
+Test behaviour changes since 1.7.10:
+
+• If the tests crash with an assertion failure, they no longer default to
+ blocking for a debugger to be attached. Set DBUS_BLOCK_ON_ABORT in the
+ environment if you want the old behaviour.
+
+• To improve debuggability, the dbus-daemon and dbus-daemon-eavesdrop tests
+ can be run with an external dbus-daemon by setting
+ DBUS_TEST_DAEMON_ADDRESS in the environment. Test-cases that require
+ an unusually-configured dbus-daemon are skipped.
+
+D-Bus 1.7.10 (2014-01-06)
+==
+
+The “weighted companion cube” release.
+
+This is a release candidate for D-Bus 1.8.
+
+D-Bus Specification 0.23:
+
+• don't require messages with no INTERFACE to be dispatched
+ (fd.o #68597, Simon McVittie)
+
+• document "tcp:bind=..." and "nonce-tcp:bind=..." (fd.o #72301,
+ Chengwei Yang)
+
+• define "listenable" and "connectable" addresses, and discuss
+ the difference (fd.o #61303, Simon McVittie)
+
+Enhancements:
+
+• support printing Unix file descriptors in dbus-send, dbus-monitor
+ (fd.o #70592, Robert Ancell)
+
+• don't install systemd units if --disable-systemd is given
+ (fd.o #71818, Chengwei Yang)
+
+Fixes:
+
+• don't leak memory on out-of-memory while listing activatable or
+ active services (fd.o #71526, Radoslaw Pajak)
+
+• fix undefined behaviour in a regression test (fd.o #69924, DreamNik)
+
+• escape Unix socket addresses correctly (fd.o #46013, Chengwei Yang)
+
+• on SELinux systems, don't assume that SECCLASS_DBUS, DBUS__ACQUIRE_SVC
+ and DBUS__SEND_MSG are numerically equal to their values in the
+ reference policy (fd.o #88719, osmond sun)
+
+• define PROCESS_QUERY_LIMITED_INFORMATION if missing from MinGW < 4 headers
+ (fd.o #71366, Matt Fischer)
+
+• define WIN32_LEAN_AND_MEAN to avoid conflicts between winsock.h and
+ winsock2.h (fd.o #71405, Matt Fischer)
+
+• do not return failure from _dbus_read_nonce() with no error set,
+ preventing a potential crash (fd.o #72298, Chengwei Yang)
+
+• on BSD systems, avoid some O(1)-per-process memory and fd leaks in kqueue,
+ preventing test failures (fd.o #69332, fd.o #72213; Chengwei Yang)
+
+• fix warning spam on Hurd by not trying to set SO_REUSEADDR on Unix sockets,
+ which doesn't do anything anyway on at least Linux and FreeBSD
+ (fd.o #69492, Simon McVittie)
+
+• fix use of TCP sockets on FreeBSD and Hurd by tolerating EINVAL from
+ sendmsg() with SCM_CREDS (retrying with plain send()), and looking
+ for credentials more correctly (fd.o #69492, Simon McVittie)
+
+• ensure that tests run with a temporary XDG_RUNTIME_DIR to avoid
+ getting mixed up in XDG/systemd "user sessions" (fd.o #61301,
+ Simon McVittie)
+
+• refresh cached policy rules for existing connections when bus
+ configuration changes (fd.o #39463, Chengwei Yang)
+
+D-Bus 1.7.8 (2013-11-01)
+==
+
+The “extreme hills” release.
+
+Dependencies:
+
+• If systemd support is enabled, libsystemd-journal is now required.
+
+Enhancements:
+
+• When activating a non-systemd service under systemd, annotate its
+ stdout/stderr with its bus name in the Journal. Known limitation:
+ because the socket is opened before forking, the process will still be
+ logged as if it had dbus-daemon's process ID and user ID.
+ (fd.o #68559, Chengwei Yang)
+
+• Document more configuration elements in dbus-daemon(1)
+ (fd.o #69125, Chengwei Yang)
+
+Fixes:
+
+• Don't leak string arrays or fds if dbus_message_iter_get_args_valist()
+ unpacks them and then encounters an error (fd.o #21259, Chengwei Yang)
+
+• If compiled with libaudit, retain CAP_AUDIT_WRITE so we can write
+ disallowed method calls to the audit log, fixing a regression in 1.7.6
+ (fd.o #49062, Colin Walters)
+
+• path_namespace='/' in match rules incorrectly matched nothing; it
+ now matches everything. (fd.o #70799, Simon McVittie)
+
+D-Bus 1.7.6 (2013-10-09)
+==
+
+The “CSI Shrewsbury” release.
+
+Build-time configuration changes:
+
+• Directory change notification via dnotify on Linux is no longer
+ supported; it hadn't compiled successfully since 2010 in any case.
+ If you don't have inotify (Linux) or kqueue (*BSD), you will need
+ to send SIGHUP to the dbus-daemon when its configuration changes.
+ (fd.o #33001, Chengwei Yang)
+
+• Compiling with --disable-userdb-cache is no longer supported;
+ it didn't work since at least 2008, and would lead to an extremely
+ slow dbus-daemon even it worked. (fd.o #15589, #17133, #66947;
+ Chengwei Yang)
+
+• The DBUS_DISABLE_ASSERTS CMake option didn't actually disable most
+ assertions. It has been renamed to DBUS_DISABLE_ASSERT to be consistent
+ with the Autotools build system. (fd.o #66142, Chengwei Yang)
+
+• --with-valgrind=auto enables Valgrind instrumentation if and only if
+ valgrind headers are available. The default is still --with-valgrind=no.
+ (fd.o #56925, Simon McVittie)
+
+Dependencies:
+
+• Platforms with no 64-bit integer type are no longer supported.
+ (fd.o #65429, Simon McVittie)
+
+• GNU make is now (documented to be) required. (fd.o #48277, Simon McVittie)
+
+• Full test coverage no longer requires dbus-glib, although the tests do not
+ exercise the shared library (only a static copy) if dbus-glib is missing.
+ (fd.o #68852, Simon McVittie)
+
+Enhancements:
+
+• D-Bus Specification 0.22
+ · Document GetAdtAuditSessionData() and
+ GetConnectionSELinuxSecurityContext() (fd.o #54445, Simon)
+ · Fix example .service file (fd.o #66481, Chengwei Yang)
+ · Don't claim D-Bus is "low-latency" (lower than what?), just
+ give factual statements about it supporting async use
+ (fd.o #65141, Justin Lee)
+ · Document the contents of .service files, and the fact that
+ system services' filenames are constrained
+ (fd.o #66608; Simon McVittie, Chengwei Yang)
+
+• Be thread-safe by default on all platforms, even if
+ dbus_threads_init_default() has not been called. For compatibility with
+ older libdbus, library users should continue to call
+ dbus_threads_init_default(): it is harmless to do so.
+ (fd.o #54972, Simon McVittie)
+
+• Add GetConnectionCredentials() method (fd.o #54445, Simon)
+
+• New API: dbus_setenv(), a simple wrapper around setenv().
+ Note that this is not thread-safe. (fd.o #39196, Simon)
+
+• Add dbus-send --peer=ADDRESS (connect to a given peer-to-peer connection,
+ like --address=ADDRESS in previous versions) and dbus-send --bus=ADDRESS
+ (connect to a given bus, like dbus-monitor --address=ADDRESS).
+ dbus-send --address still exists for backwards compatibility,
+ but is no longer documented. (fd.o #48816, Andrey Mazo)
+
+• Windows-specific:
+ · "dbus-daemon --nofork" is allowed on Windows again. (fd.o #68852,
+ Simon McVittie)
+
+Fixes:
+
+• Avoid an infinite busy-loop if a signal interrupts waitpid()
+ (fd.o #68945, Simon McVittie)
+
+• Clean up memory for parent nodes when objects are unexported
+ (fd.o #60176, Thomas Fitzsimmons)
+
+• Make dbus_connection_set_route_peer_messages(x, FALSE) behave as
+ documented. Previously, it assumed its second parameter was TRUE.
+ (fd.o #69165, Chengwei Yang)
+
+• Escape addresses containing non-ASCII characters correctly
+ (fd.o #53499, Chengwei Yang)
+
+• Document <servicedir> search order correctly (fd.o #66994, Chengwei Yang)
+
+• Don't crash on "dbus-send --session / x.y.z" which regressed in 1.7.4.
+ (fd.o #65923, Chengwei Yang)
+
+• If malloc() returns NULL in _dbus_string_init() or similar, don't free
+ an invalid pointer if the string is later freed (fd.o #65959, Chengwei Yang)
+
+• If malloc() returns NULL in dbus_set_error(), don't va_end() a va_list
+ that was never va_start()ed (fd.o #66300, Chengwei Yang)
+
+• fix build failure with --enable-stats (fd.o #66004, Chengwei Yang)
+
+• fix a regression test on platforms with strict alignment (fd.o #67279,
+ Colin Walters)
+
+• Avoid calling function parameters "interface" since certain Windows headers
+ have a namespace-polluting macro of that name (fd.o #66493, Ivan Romanov)
+
+• Assorted Doxygen fixes (fd.o #65755, Chengwei Yang)
+
+• Various thread-safety improvements to static variables (fd.o #68610,
+ Simon McVittie)
+
+• Make "make -j check" work (fd.o #68852, Simon McVittie)
+
+• Fix a NULL pointer dereference on an unlikely error path
+ (fd.o #69327, Sviatoslav Chagaev)
+
+• Improve valgrind memory pool tracking (fd.o #69326,
+ Sviatoslav Chagaev)
+
+• Don't over-allocate memory in dbus-monitor (fd.o #69329,
+ Sviatoslav Chagaev)
+
+• dbus-monitor can monitor dbus-daemon < 1.5.6 again
+ (fd.o #66107, Chengwei Yang)
+
+• Unix-specific:
+ · If accept4() fails with EINVAL, as it can on older Linux kernels
+ with newer glibc, try accept() instead of going into a busy-loop.
+ (fd.o #69026, Chengwei Yang)
+ · If socket() or socketpair() fails with EINVAL or EPROTOTYPE,
+ for instance on Hurd or older Linux with a new glibc, try without
+ SOCK_CLOEXEC. (fd.o #69073; Pino Toscano, Chengwei Yang)
+ · Fix a file descriptor leak on an error code path.
+ (fd.o #69182, Sviatoslav Chagaev)
+ · dbus-run-session: clear some unwanted environment variables
+ (fd.o #39196, Simon)
+ · dbus-run-session: compile on FreeBSD (fd.o #66197, Chengwei Yang)
+ · Don't fail the autolaunch test if there is no DISPLAY (fd.o #40352, Simon)
+ · Use dbus-launch from the builddir for testing, not the installed copy
+ (fd.o #37849, Chengwei Yang)
+ · Fix compilation if writev() is unavailable (fd.o #69409,
+ Vasiliy Balyasnyy)
+ · Remove broken support for LOCAL_CREDS credentials passing, and
+ document where each credential-passing scheme is used (fd.o #60340,
+ Simon McVittie)
+ · Make autogen.sh work on *BSD by not assuming GNU coreutils functionality
+ (fd.o #35881, #69787; Chengwei Yang)
+ · dbus-monitor: be portable to NetBSD (fd.o #69842, Chengwei Yang)
+ · dbus-launch: stop using non-portable asprintf (fd.o #37849, Simon)
+ · Improve error reporting from the setuid activation helper (fd.o #66728,
+ Chengwei Yang)
+
+• Windows-specific:
+ · Remove unavailable command-line options from 'dbus-daemon --help'
+ (fd.o #42441, Ralf Habacker)
+ · Add support for looking up local TCPv4 clients' credentials on
+ Windows XP via the undocumented AllocateAndGetTcpExTableFromStack
+ function (fd.o #66060, Ralf Habacker)
+ · Fix insufficient dependency-tracking (fd.o #68505, Simon McVittie)
+ · Don't include wspiapi.h, fixing a compiler warning (fd.o #68852,
+ Simon McVittie)
+
+• Internal changes:
+ · add DBUS_ENABLE_ASSERT, DBUS_ENABLE_CHECKS for less confusing
+ conditionals (fd.o #66142, Chengwei Yang)
+ · improve verbose-mode output (fd.o #63047, Colin Walters)
+ · consolidate Autotools and CMake build (fd.o #64875, Ralf Habacker)
+ · fix various unused variables, unusual build configurations
+ etc. (fd.o #65712, #65990, #66005, #66257, #69165, #69410, #70218;
+ Chengwei Yang, Vasiliy Balyasnyy)
+
+D-Bus 1.7.4 (2013-06-13)
+==
+
+The “but is your thread-safety thread-safe?” release.
+
+Security fixes:
+
+• CVE-2013-2168: Fix misuse of va_list that could be used as a denial
+ of service for system services. Vulnerability reported by Alexandru Cornea.
+ (Simon)
+
+Dependencies:
+
+• The Windows version of libdbus now contains a C++ source file, used
+ to provide global initialization when the library is loaded.
+ gcc (mingw*) users should ensure that g++ is also installed.
+
+• The libxml2-based configuration reader (which hasn't worked for 2.5 years,
+ and was never the recommended option) has been removed. Expat is now a
+ hard dependency.
+
+Enhancements:
+
+• It should now be safe to call dbus_threads_init_default() from any thread,
+ at any time. Authors of loadable modules and plugins that use libdbus
+ should consider doing so during initialization.
+ (fd.o #54972, Simon McVittie)
+
+• Improve dbus-send documentation and command-line parsing (fd.o #65424,
+ Chengwei Yang)
+
+Unix-specific:
+ · dbus-run-session: experimental new tool to start a temporary D-Bus
+ session, e.g. for regression tests or a text console, replacing
+ certain uses of dbus-launch which weren't really correct
+ (fd.o #39196, Simon)
+
+Other fixes:
+
+• In dbus-daemon, don't crash if a .service file starts with key=value
+ (fd.o #60853, Chengwei Yang)
+
+• Unix-specific:
+ · Fix a crash similar to CVE-2013-2168 the first time we try to use syslog
+ on a platform not defining LOG_PERROR, such as Solaris or QNX.
+ This regressed in 1.7.0. (Simon)
+ · Fix an assertion failure if we try to activate systemd services before
+ systemd connects to the bus (fd.o #50199, Chengwei Yang)
+ · Avoid compiler warnings for ignoring the return from write()
+ (Chengwei Yang)
+
+• Windows-specific:
+ · Under cmake, install runtime libraries (DLLs) into bin/ instead of lib/
+ so that Windows finds them (fd.o #59733, Ralf Habacker)
+
+D-Bus 1.7.2 (2013-04-25)
+==
+
+The “only partially opaque” release.
+
+Configuration changes:
+
+• On non-QNX Unix platforms, the default limit on fds per message in the
+ session bus configuration has reduced from 4096 to 1024. The default
+ limit used on the system bus was already 1024. On QNX, both limits are
+ reduced further, to 128.
+
+Enhancements:
+
+• D-Bus Specification 0.21
+ · Following Unicode Corrigendum #9, the noncharacters U+nFFFE, U+nFFFF,
+ U+FDD0..U+FDEF are allowed in UTF-8 strings again. (fd.o #63072,
+ Simon McVittie)
+
+Fixes:
• Diagnose incorrect use of dbus_connection_get_data() with negative slot
(i.e. before allocating the slot) rather than returning junk
(fd.o #63127, Dan Williams)
+• Fix a cmake build regression since 1.7.0 (fd.o #63682; Ralf Habacker,
+ Simon McVittie)
+
+• Unix-specific:
+ · On Linux, link successfully with glibc 2.17 (fd.o #63166, Simon McVittie)
+  · Under systemd, log to syslog only, not stderr, avoiding duplication
+ (fd.o #61399, #39987; Colin Walters, Dagobert Michelsen)
+ · Under systemd, remove unnecessary dependency on syslog.socket
+ (fd.o #63531, Cristian Rodríguez)
+ · Include alloca.h for alloca() if available, fixing compilation on
+ Solaris 10 (fd.o #63071, Dagobert Michelsen)
+ · Allow use of systemd-logind without the rest of systemd
+ (fd.o #62585, Martin Pitt)
+ · When built with CMake, link to librt and use the right path for
+ meinproc's XSLT stylesheets (fd.o #61637, Ralf Habacker)
+ · Reduce the default limit on number of fds per message to 128 under
+ QNX, working around an arbitrary OS limit (fd.o #61176, Matt Fischer)
+
+• Windows-specific:
+ · Do not claim that all bus clients have the dbus-daemon's credentials;
+ pick up local TCPv4 clients' credentials (process ID and security
+ identifier, i.e. user) using GetExtendedTcpTable() (fd.o #61787,
+ Ralf Habacker)
+
+D-Bus 1.7.0 (2013-02-22)
+==
+
+The "Disingenuous Assertions" release.
+
+This is a new development release, starting the 1.7.x branch. D-Bus 1.6
+remains the recommended version for long-term-supported distributions
+or the upcoming GNOME 3.8 release.
+
+Build-time configuration changes:
+
+• The --with-dbus-session-bus-default-address configure option is no longer
+ supported. Use the new --with-dbus-session-bus-connect-address and
+ --with-dbus-session-bus-listen-address options instead. On Windows, you
+ usually want them to have the same argument; on Unix, the defaults are
+ usually correct.
+
+• Similarly, the DBUS_SESSION_BUS_DEFAULT_ADDRESS CMake variable is no longer
+ supported; use the new DBUS_SESSION_BUS_LISTEN_ADDRESS and
+ DBUS_SESSION_BUS_CONNECT_ADDRESS variables instead.
+
+• cmake/cross-compile.sh has been removed. Instead, please use a
+ cross-toolchain file (-DCMAKE_TOOLCHAIN_FILE) as documented at
+ <http://www.vtk.org/Wiki/CMake_Cross_Compiling>; or use Autotools
+ as documented in "info automake Cross-Compilation", and set
+ PKG_CONFIG_PATH appropriately.
+
+Requirements:
+
+• Man pages now require xmlto (or either xmlto or meinproc, if using CMake).
+• man2html is no longer used.
+
+Enhancements:
+
+• D-Bus Specification 0.20
+ · actually say that /org/freedesktop/DBus is the object that
+ implements o.fd.DBus (fd.o #51865, Colin Walters)
+ · various reorganisation for better clarity (fd.o #38252, Simon McVittie)
+ · stop claiming that all basic types work just like INT32 (strings don't!)
+
+• The "source code" for the man pages is now Docbook XML, eliminating
+ the outdated duplicate copies used when building with CMake.
+ (fd.o #59805; Ralf Habacker, Simon McVittie)
+
+Fixes:
+
• In the activation helper, when compiled for tests, do not reset the system
bus address, fixing the regression tests. (fd.o #52202, Simon)
• Fix building with Valgrind 3.8, at the cost of causing harmless warnings
with Valgrind 3.6 on some compilers (fd.o #55932, Arun Raghavan)
-• Don't leak temporary fds pointing to /dev/null (fd.o #56927, Michel HERMIER)
+• Merge <servicehelper> from system-local.conf if necessary (fd.o #51560,
+ Krzysztof Konopko)
-• Create session.d, system.d directories under CMake (fd.o #41319,
+• Under CMake, prefer xmlto over meinproc (fd.o #59733, Ralf Habacker)
+
+• Stop duplicating CMake's own logic to find libexpat
+ (fd.o #59733, Ralf Habacker)
+
+• Don't assume CMake host and build system are the same (fd.o #59733,
Ralf Habacker)
+• Avoid deprecation warnings for GLib 2.35 (fd.o #59971, Simon McVittie)
+
• Unix-specific:
- · Include alloca.h for alloca() if available, fixing compilation on
- Solaris 10 (fd.o #63071, Dagobert Michelsen)
+ · Check for functions in libpthread correctly, fixing compilation on
+ (at least) OpenBSD (fd.o #47239, Simon)
+ · Don't leak temporary fds pointing to /dev/null (fd.o #56927,
+ Michel HERMIER)
+ · Update sd-daemon.[ch] from systemd (fd.o #60681)
+ · Add partial support for QNX (fd.o #60339, fd.o #61176; Matt Fischer)
+
+• Windows-specific:
+ · The default session bus listening and connecting address is now
+ "autolaunch:", which makes D-Bus on Windows interoperate with itself
+ and GDBus "out of the box". Use the configure options and cmake variables
+ described above if you require a different autolaunch scope.
+ (fd.o #38201, Simon McVittie)
+ · Avoid a CMake warning under Cygwin (fd.o #59401, Ralf Habacker)
+
+• Create session.d, system.d directories under CMake (fd.o #41319,
+ Ralf Habacker)
D-Bus 1.6.8 (2012-09-28)
==
diff --git a/README b/README
index fd832ca9..0257e69d 100644
--- a/README
+++ b/README
@@ -29,6 +29,25 @@ If your use-case isn't one of these, D-Bus may still be useful, but
only by accident; so you should evaluate carefully whether D-Bus makes
sense for your project.
+Security
+==
+
+If you find a security vulnerability that is not known to the public,
+please report it privately to dbus-security@lists.freedesktop.org
+or by reporting a freedesktop.org bug that is marked as
+restricted to the "D-BUS security group" (you might need to "Show
+Advanced Fields" to have that option).
+
+On Unix systems, the system bus (dbus-daemon --system) is designed
+to be a security boundary between users with different privileges.
+
+On Unix systems, the session bus (dbus-daemon --session) is designed
+to be used by a single user, and only accessible by that user.
+
+We do not currently consider D-Bus on Windows to be security-supported,
+and we do not recommend allowing untrusted users to access Windows
+D-Bus via TCP.
+
Note: low-level API vs. high-level binding APIs
===
@@ -66,7 +85,9 @@ Configuration
dbus could be build by using autotools or cmake.
When using autotools the configure step is initiated by running ./configure
-with or without additional configuration flags.
+with or without additional configuration flags. dbus requires GNU Make
+(on BSD systems, this is typically called gmake) or a "make" implementation
+with compatible extensions.
When using cmake the configure step is initiated by running the cmake
program with or without additional configuration flags.
diff --git a/README.valgrind b/README.valgrind
new file mode 100644
index 00000000..c13f5304
--- /dev/null
+++ b/README.valgrind
@@ -0,0 +1,24 @@
+Running D-Bus clients with Valgrind
+====
+
+When running programs using libdbus in Valgrind, some special care needs to be
+taken so as to avoid incorrect detection of leaks in libdbus. To avoid these
+false positives, do the following:
+
+* Grab a copy of the D-Bus source code
+
+* Run configure with the --enable-developer and --with-valgrind options
+
+* Run make
+
+* Either make sure your code calls dbus_shutdown() (at least while running in
+ Valgrind) or set DBUS_MESSAGE_CACHE=0 in your environment
+
+* Run Valgrind on your program with the /path/to/dbus/source/dbus/.libs in your
+ LD_LIBRARY_PATH
+
+Your Valgrind log should now be free of any (spurious) libdbus-related leaks.
+
+For the curious, the DBUS_MESSAGE_CACHE=0 is required because by
+default, libdbus uses a recyclable pool of message structs. These help
+performance a bit.
diff --git a/README.win b/README.win
index d18f23d0..8a5b3c0a 100644
--- a/README.win
+++ b/README.win
@@ -13,15 +13,13 @@ test not running yet and there is help needed to get them running.
Supported compilers
-------------------
-On windows Microsoft Visual Studio 2010 (Express and professional variants)
+On windows Microsoft Visual Studio 2010 (Express and professional variants)
and mingw-w64|32 are known to work.
Building
--------
DBus can be built on windows using automake or cmake. See the
-file README for more information.
-Special cmake build instructions can be found in cmake/readme-cmake.txt
-
+file INSTALL for more information.
windbus and dbus4win Ports
--------------------------
@@ -32,14 +30,19 @@ updated with windows specific stuff.
Tests
-----
+ - run complete test suite
+ make check
+ or
+ ctest [-V]
+
- dbus library check
- bin\dbus-test.exe <build-root>\test\data
+ ctest [-V] -R test-dbus
- bus daemon check
- bin\bus-test.exe <build-root>\test\data
+ ctest [-V] -R test-bus
- check available names
- bin\test_names.exe
+ ctest [-V] -R test-names
- check if dbus-daemon is accessable
bin\dbus-send.exe --session --type=method_call --print-reply --dest=org.freedesktop.DBus / org.freedesktop.DBus.ListNames method return sender=org.freedesktop.DBus -> dest=:1.4 array [ string "org.freedesktop.DBus"string ":1.4"]
@@ -88,13 +91,13 @@ FAQ
The OpenWengo dbus-c++ binding has been ported to windows see in WinDBus svn
(http://sf.net/projects/windbus)
- The related test applicationa are running well.
+ The related test applications are running well.
TODO
----
-Oktober 2010:
+October 2010:
- the code wrapped with DBUS_WIN_FIXME should be inspected if it required for windows
diff --git a/aclocal.m4 b/aclocal.m4
index a34b9793..c2c4011e 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,8 +1,7 @@
-# generated automatically by aclocal 1.11.6 -*- Autoconf -*-
+# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
-# Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -12,33 +11,31 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
+m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
[m4_warning([this file was generated for autoconf 2.69.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
-To do so, use the procedure documented by the package, typically `autoreconf'.])])
+To do so, use the procedure documented by the package, typically 'autoreconf'.])])
-# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
-# Foundation, Inc.
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 1
-
# AM_AUTOMAKE_VERSION(VERSION)
# ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.11'
+[am__api_version='1.14'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.11.6], [],
+m4_if([$1], [1.14.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -54,24 +51,22 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.11.6])dnl
+[AM_AUTOMAKE_VERSION([1.14.1])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 1
-
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
+# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
#
# Of course, Automake must honor this variable whenever it calls a
# tool from the auxiliary directory. The problem is that $srcdir (and
@@ -90,7 +85,7 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
#
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
# are both prefixed by $srcdir. In an in-source build this is usually
-# harmless because $srcdir is `.', but things will broke when you
+# harmless because $srcdir is '.', but things will broke when you
# start a VPATH build or use an absolute $srcdir.
#
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
@@ -108,30 +103,26 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# configured tree to be moved without reconfiguration.
AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
+[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
])
# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 9
-
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ(2.52)dnl
- ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
- [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+[AC_PREREQ([2.52])dnl
+ m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_SUBST([$1_TRUE])dnl
AC_SUBST([$1_FALSE])dnl
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
@@ -150,16 +141,14 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
-# 2010, 2011 Free Software Foundation, Inc.
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 12
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
# will think it sees a *use*, and therefore will trigger all it's
# C support machinery. Also note that it means that autoscan, seeing
@@ -169,7 +158,7 @@ fi])])
# _AM_DEPENDENCIES(NAME)
# ----------------------
# See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
# We try a few techniques and use that to set a single cache variable.
#
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
@@ -182,12 +171,13 @@ AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
AC_REQUIRE([AM_DEP_TRACK])dnl
-ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
- [$1], CXX, [depcc="$CXX" am_compiler_list=],
- [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
- [$1], UPC, [depcc="$UPC" am_compiler_list=],
- [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
- [depcc="$$1" am_compiler_list=])
+m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
+ [$1], [CXX], [depcc="$CXX" am_compiler_list=],
+ [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
+ [$1], [UPC], [depcc="$UPC" am_compiler_list=],
+ [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
AC_CACHE_CHECK([dependency style of $depcc],
[am_cv_$1_dependencies_compiler_type],
@@ -195,8 +185,8 @@ AC_CACHE_CHECK([dependency style of $depcc],
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
rm -rf conftest.dir
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
@@ -236,16 +226,16 @@ AC_CACHE_CHECK([dependency style of $depcc],
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
am__obj=sub/conftest.${OBJEXT-o}
am__minus_obj="-o $am__obj"
case $depmode in
@@ -254,8 +244,8 @@ AC_CACHE_CHECK([dependency style of $depcc],
test "$am__universal" = false || continue
;;
nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
if test "x$enable_dependency_tracking" = xyes; then
continue
else
@@ -263,7 +253,7 @@ AC_CACHE_CHECK([dependency style of $depcc],
fi
;;
msvc7 | msvc7msys | msvisualcpp | msvcmsys)
- # This compiler won't grok `-c -o', but also, the minuso test has
+ # This compiler won't grok '-c -o', but also, the minuso test has
# not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted.
am__obj=conftest.${OBJEXT-o}
@@ -311,7 +301,7 @@ AM_CONDITIONAL([am__fastdep$1], [
# AM_SET_DEPDIR
# -------------
# Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
AC_DEFUN([AM_SET_DEPDIR],
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
@@ -321,9 +311,13 @@ AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
# AM_DEP_TRACK
# ------------
AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE(dependency-tracking,
-[ --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors])
+[AC_ARG_ENABLE([dependency-tracking], [dnl
+AS_HELP_STRING(
+ [--enable-dependency-tracking],
+ [do not reject slow dependency extractors])
+AS_HELP_STRING(
+ [--disable-dependency-tracking],
+ [speeds up one-time build])])
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
@@ -338,20 +332,18 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
# Generate code to set up dependency tracking. -*- Autoconf -*-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-#serial 5
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
[{
- # Autoconf 2.62 quotes --file arguments for eval, but not when files
+ # Older Autoconf quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
case $CONFIG_FILES in
@@ -364,7 +356,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
+ # We used to match only the files named 'Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
@@ -376,21 +368,19 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
+ # from the Makefile without running 'make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
+ test -z "$am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`AS_DIRNAME(["$file"])`
@@ -408,7 +398,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
# This macro should only be invoked once -- use via AC_REQUIRE.
#
# This code is only required when automatic dependency tracking
-# is enabled. FIXME. This creates each `.P' file that we will
+# is enabled. FIXME. This creates each '.P' file that we will
# need in order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AC_CONFIG_COMMANDS([depfiles],
@@ -418,18 +408,21 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# Do all the work for Automake. -*- Autoconf -*-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 16
-
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
+dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
+m4_define([AC_PROG_CC],
+m4_defn([AC_PROG_CC])
+[_AM_PROG_CC_C_O
+])
+
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
# AM_INIT_AUTOMAKE([OPTIONS])
# -----------------------------------------------
@@ -442,7 +435,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# arguments mandatory, and then we can depend on a new Autoconf
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.62])dnl
+[AC_PREREQ([2.65])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
@@ -471,31 +464,40 @@ AC_SUBST([CYGPATH_W])
# Define the identity of the package.
dnl Distinguish between old-style and new-style calls.
m4_ifval([$2],
-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+[AC_DIAGNOSE([obsolete],
+ [$0: two- and three-arguments forms are deprecated.])
+m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
AC_SUBST([PACKAGE], [$1])dnl
AC_SUBST([VERSION], [$2])],
[_AM_SET_OPTIONS([$1])dnl
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
-m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+m4_if(
+ m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+ [ok:ok],,
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
_AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
+ AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
# Some tools Automake needs.
AC_REQUIRE([AM_SANITY_CHECK])dnl
AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
-AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
-AM_MISSING_PROG(AUTOHEADER, autoheader)
-AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
+AM_MISSING_PROG([AUTOCONF], [autoconf])
+AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
+AM_MISSING_PROG([AUTOHEADER], [autoheader])
+AM_MISSING_PROG([MAKEINFO], [makeinfo])
AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
-AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+# For better backward compatibility. To be removed once Automake 1.9.x
+# dies out for good. For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
@@ -506,34 +508,79 @@ _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
[_AM_PROG_TAR([v7])])])
_AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_CC],
- [_AM_DEPENDENCIES(CC)],
- [define([AC_PROG_CC],
- defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+ [_AM_DEPENDENCIES([CC])],
+ [m4_define([AC_PROG_CC],
+ m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [_AM_DEPENDENCIES(CXX)],
- [define([AC_PROG_CXX],
- defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+ [_AM_DEPENDENCIES([CXX])],
+ [m4_define([AC_PROG_CXX],
+ m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
- [_AM_DEPENDENCIES(OBJC)],
- [define([AC_PROG_OBJC],
- defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+ [_AM_DEPENDENCIES([OBJC])],
+ [m4_define([AC_PROG_OBJC],
+ m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
+ [_AM_DEPENDENCIES([OBJCXX])],
+ [m4_define([AC_PROG_OBJCXX],
+ m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
])
-_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
-dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
-dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
-dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_REQUIRE([AM_SILENT_RULES])dnl
+dnl The testsuite driver may need to know about EXEEXT, so add the
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
+dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
AC_CONFIG_COMMANDS_PRE(dnl
[m4_provide_if([_AM_COMPILER_EXEEXT],
[AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes. So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+ cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present. This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message. This
+can help us improve future automake versions.
+
+END
+ if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+ echo 'Configuration will proceed anyway, since you have set the' >&2
+ echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+ echo >&2
+ else
+ cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+ AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
+ fi
+fi
])
-dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
+dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
dnl mangled by Autoconf and run in a shell conditional statement.
m4_define([_AC_COMPILER_EXEEXT],
m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
-
# When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header
# that is generated. The stamp files are numbered to have different names.
@@ -555,15 +602,12 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
-# Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 1
-
# AM_PROG_INSTALL_SH
# ------------------
# Define $install_sh.
@@ -577,16 +621,14 @@ if test x"${install_sh}" != xset; then
install_sh="\${SHELL} $am_aux_dir/install-sh"
esac
fi
-AC_SUBST(install_sh)])
+AC_SUBST([install_sh])])
-# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2003-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 2
-
# Check whether the underlying file-system supports filenames
# with a leading dot. For instance MS-DOS doesn't.
AC_DEFUN([AM_SET_LEADING_DOT],
@@ -603,20 +645,17 @@ AC_SUBST([am__leading_dot])])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering
-# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008,
-# 2011 Free Software Foundation, Inc.
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 5
-
# AM_MAINTAINER_MODE([DEFAULT-MODE])
# ----------------------------------
# Control maintainer-specific portions of Makefiles.
-# Default is to disable them, unless `enable' is passed literally.
-# For symmetry, `disable' may be passed as well. Anyway, the user
+# Default is to disable them, unless 'enable' is passed literally.
+# For symmetry, 'disable' may be passed as well. Anyway, the user
# can override the default with the --enable/--disable switch.
AC_DEFUN([AM_MAINTAINER_MODE],
[m4_case(m4_default([$1], [disable]),
@@ -627,10 +666,11 @@ AC_DEFUN([AM_MAINTAINER_MODE],
AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
dnl maintainer-mode's default is 'disable' unless 'enable' is passed
AC_ARG_ENABLE([maintainer-mode],
-[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful
- (and sometimes confusing) to the casual installer],
- [USE_MAINTAINER_MODE=$enableval],
- [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+ [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
+ am_maintainer_other[ make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer])],
+ [USE_MAINTAINER_MODE=$enableval],
+ [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
AC_MSG_RESULT([$USE_MAINTAINER_MODE])
AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
MAINT=$MAINTAINER_MODE_TRUE
@@ -638,18 +678,14 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
]
)
-AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
-
# Check to see how 'make' treats includes. -*- Autoconf -*-
-# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 4
-
# AM_MAKE_INCLUDE()
# -----------------
# Check to see how make treats includes.
@@ -667,7 +703,7 @@ am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
+# Ignore all kinds of additional output from 'make'.
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=include
@@ -692,52 +728,14 @@ AC_MSG_RESULT([$_am_result])
rm -f confinc confmf
])
-# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 6
-
-# AM_PROG_CC_C_O
-# --------------
-# Like AC_PROG_CC_C_O, but changed for automake.
-AC_DEFUN([AM_PROG_CC_C_O],
-[AC_REQUIRE([AC_PROG_CC_C_O])dnl
-AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-AC_REQUIRE_AUX_FILE([compile])dnl
-# FIXME: we rely on the cache variable name because
-# there is no other way.
-set dummy $CC
-am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
-eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
-if test "$am_t" != yes; then
- # Losing compiler, so override with the script.
- # FIXME: It is wrong to rewrite CC.
- # But if we don't then we get into trouble of one sort or another.
- # A longer-term fix would be to have automake use am__CC in this case,
- # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
- CC="$am_aux_dir/compile $CC"
-fi
-dnl Make sure AC_PROG_CC is never called again, or it will override our
-dnl setting of CC.
-m4_define([AC_PROG_CC],
- [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
-])
-
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 6
-
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
AC_DEFUN([AM_MISSING_PROG],
@@ -745,11 +743,10 @@ AC_DEFUN([AM_MISSING_PROG],
$1=${$1-"${am_missing_run}$2"}
AC_SUBST($1)])
-
# AM_MISSING_HAS_RUN
# ------------------
-# Define MISSING if not defined so far and test if it supports --run.
-# If it does, set am_missing_run to use it, otherwise, to nothing.
+# Define MISSING if not defined so far and test if it is modern enough.
+# If it is, set am_missing_run to use it, otherwise, to nothing.
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([missing])dnl
@@ -762,54 +759,22 @@ if test x"${MISSING+set}" != xset; then
esac
fi
# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
+if eval "$MISSING --is-lightweight"; then
+ am_missing_run="$MISSING "
else
am_missing_run=
- AC_MSG_WARN([`missing' script is too old or missing])
+ AC_MSG_WARN(['missing' script is too old or missing])
fi
])
-# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
-# Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 1
-
-# AM_PROG_MKDIR_P
-# ---------------
-# Check for `mkdir -p'.
-AC_DEFUN([AM_PROG_MKDIR_P],
-[AC_PREREQ([2.60])dnl
-AC_REQUIRE([AC_PROG_MKDIR_P])dnl
-dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
-dnl while keeping a definition of mkdir_p for backward compatibility.
-dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
-dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
-dnl Makefile.ins that do not define MKDIR_P, so we do our own
-dnl adjustment using top_builddir (which is defined more often than
-dnl MKDIR_P).
-AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
-case $mkdir_p in
- [[\\/$]]* | ?:[[\\/]]*) ;;
- */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-])
-
# Helper functions for option handling. -*- Autoconf -*-
-# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 5
-
# _AM_MANGLE_OPTION(NAME)
# -----------------------
AC_DEFUN([_AM_MANGLE_OPTION],
@@ -819,7 +784,7 @@ AC_DEFUN([_AM_MANGLE_OPTION],
# --------------------
# Set option NAME. Presently that only means defining a flag for this option.
AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
# _AM_SET_OPTIONS(OPTIONS)
# ------------------------
@@ -833,14 +798,59 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009,
-# 2011 Free Software Foundation, Inc.
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_CC_C_O
+# ---------------
+# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
+# to automatically call this.
+AC_DEFUN([_AM_PROG_CC_C_O],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+AC_LANG_PUSH([C])dnl
+AC_CACHE_CHECK(
+ [whether $CC understands -c and -o together],
+ [am_cv_prog_cc_c_o],
+ [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
+ # Make sure it works both with $CC and with simple cc.
+ # Following AC_PROG_CC_C_O, we do the test twice because some
+ # compilers refuse to overwrite an existing .o file with -o,
+ # though they will create one.
+ am_cv_prog_cc_c_o=yes
+ for am_i in 1 2; do
+ if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
+ && test -f conftest2.$ac_objext; then
+ : OK
+ else
+ am_cv_prog_cc_c_o=no
+ break
+ fi
+ done
+ rm -f core conftest*
+ unset am_i])
+if test "$am_cv_prog_cc_c_o" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+AC_LANG_POP([C])])
+
+# For backward compatibility.
+AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 2
# AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
# ---------------------------------------------------------------------------
@@ -869,7 +879,7 @@ AC_DEFUN([AM_PATH_PYTHON],
dnl Find a Python interpreter. Python versions prior to 2.0 are not
dnl supported. (2.0 was released on October 16, 2000).
m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
-[python python2 python3 python3.2 python3.1 python3.0 python2.7 dnl
+[python python2 python3 python3.3 python3.2 python3.1 python3.0 python2.7 dnl
python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0])
AC_ARG_VAR([PYTHON], [the Python interpreter])
@@ -885,10 +895,11 @@ AC_DEFUN([AM_PATH_PYTHON],
dnl A version check is needed.
if test -n "$PYTHON"; then
# If the user set $PYTHON, use it and don't search something else.
- AC_MSG_CHECKING([whether $PYTHON version >= $1])
+ AC_MSG_CHECKING([whether $PYTHON version is >= $1])
AM_PYTHON_CHECK_VERSION([$PYTHON], [$1],
- [AC_MSG_RESULT(yes)],
- [AC_MSG_ERROR(too old)])
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])
+ AC_MSG_ERROR([Python interpreter is too old])])
am_display_PYTHON=$PYTHON
else
# Otherwise, try each interpreter until we find one that satisfies
@@ -937,6 +948,25 @@ AC_DEFUN([AM_PATH_PYTHON],
[am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`])
AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform])
+ # Just factor out some code duplication.
+ am_python_setup_sysconfig="\
+import sys
+# Prefer sysconfig over distutils.sysconfig, for better compatibility
+# with python 3.x. See automake bug#10227.
+try:
+ import sysconfig
+except ImportError:
+ can_use_sysconfig = 0
+else:
+ can_use_sysconfig = 1
+# Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs:
+# <https://github.com/pypa/virtualenv/issues/118>
+try:
+ from platform import python_implementation
+ if python_implementation() == 'CPython' and sys.version[[:3]] == '2.7':
+ can_use_sysconfig = 0
+except ImportError:
+ pass"
dnl Set up 4 directories:
@@ -953,7 +983,14 @@ AC_DEFUN([AM_PATH_PYTHON],
else
am_py_prefix=$prefix
fi
- am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null`
+ am_cv_python_pythondir=`$PYTHON -c "
+$am_python_setup_sysconfig
+if can_use_sysconfig:
+ sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'})
+else:
+ from distutils import sysconfig
+ sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix')
+sys.stdout.write(sitedir)"`
case $am_cv_python_pythondir in
$am_py_prefix*)
am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
@@ -988,7 +1025,14 @@ AC_DEFUN([AM_PATH_PYTHON],
else
am_py_exec_prefix=$exec_prefix
fi
- am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null`
+ am_cv_python_pyexecdir=`$PYTHON -c "
+$am_python_setup_sysconfig
+if can_use_sysconfig:
+ sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'})
+else:
+ from distutils import sysconfig
+ sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix')
+sys.stdout.write(sitedir)"`
case $am_cv_python_pyexecdir in
$am_py_exec_prefix*)
am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
@@ -1036,14 +1080,12 @@ for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]]
sys.exit(sys.hexversion < minverhex)"
AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])])
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 1
-
# AM_RUN_LOG(COMMAND)
# -------------------
# Run COMMAND, save the exit status in ac_status, and log it.
@@ -1057,22 +1099,16 @@ AC_DEFUN([AM_RUN_LOG],
# Check to make sure that the build environment is sane. -*- Autoconf -*-
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 5
-
# AM_SANITY_CHECK
# ---------------
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
-# Just in case
-sleep 1
-echo timestamp > conftest.file
# Reject unsafe characters in $srcdir or the absolute working directory
# name. Accept space and tab only in the latter.
am_lf='
@@ -1083,32 +1119,40 @@ case `pwd` in
esac
case $srcdir in
*[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
- AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+ AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
esac
-# Do `set' in a subshell so we don't clobber the current shell's
+# Do 'set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
- set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
- if test "$[*]" = "X"; then
- # -L didn't work.
- set X `ls -t "$srcdir/configure" conftest.file`
- fi
- rm -f conftest.file
- if test "$[*]" != "X $srcdir/configure conftest.file" \
- && test "$[*]" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
-alias in your environment])
- fi
-
+ am_has_slept=no
+ for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+ alias in your environment])
+ fi
+ if test "$[2]" = conftest.file || test $am_try -eq 2; then
+ break
+ fi
+ # Just in case.
+ sleep 1
+ am_has_slept=yes
+ done
test "$[2]" = conftest.file
)
then
@@ -1118,31 +1162,50 @@ else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
-AC_MSG_RESULT(yes)])
+AC_MSG_RESULT([yes])
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+ ( sleep 1 ) &
+ am_sleep_pid=$!
+fi
+AC_CONFIG_COMMANDS_PRE(
+ [AC_MSG_CHECKING([that generated files are newer than configure])
+ if test -n "$am_sleep_pid"; then
+ # Hide warnings about reused PIDs.
+ wait $am_sleep_pid 2>/dev/null
+ fi
+ AC_MSG_RESULT([done])])
+rm -f conftest.file
+])
-# Copyright (C) 2009, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2009-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 2
-
# AM_SILENT_RULES([DEFAULT])
# --------------------------
# Enable less verbose build rules; with the default set to DEFAULT
-# (`yes' being less verbose, `no' or empty being verbose).
+# ("yes" being less verbose, "no" or empty being verbose).
AC_DEFUN([AM_SILENT_RULES],
-[AC_ARG_ENABLE([silent-rules],
-[ --enable-silent-rules less verbose build output (undo: `make V=1')
- --disable-silent-rules verbose build output (undo: `make V=0')])
-case $enable_silent_rules in
-yes) AM_DEFAULT_VERBOSITY=0;;
-no) AM_DEFAULT_VERBOSITY=1;;
-*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+[AC_ARG_ENABLE([silent-rules], [dnl
+AS_HELP_STRING(
+ [--enable-silent-rules],
+ [less verbose build output (undo: "make V=1")])
+AS_HELP_STRING(
+ [--disable-silent-rules],
+ [verbose build output (undo: "make V=0")])dnl
+])
+case $enable_silent_rules in @%:@ (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
esac
dnl
-dnl A few `make' implementations (e.g., NonStop OS and NextStep)
+dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
dnl do not support nested variable expansions.
dnl See automake bug#9928 and bug#10237.
am_make=${MAKE-make}
@@ -1160,7 +1223,7 @@ else
am_cv_make_support_nested_variables=no
fi])
if test $am_cv_make_support_nested_variables = yes; then
- dnl Using `$V' instead of `$(V)' breaks IRIX make.
+ dnl Using '$V' instead of '$(V)' breaks IRIX make.
AM_V='$(V)'
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
else
@@ -1177,44 +1240,40 @@ AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 1
-
# AM_PROG_INSTALL_STRIP
# ---------------------
-# One issue with vendor `install' (even GNU) is that you can't
+# One issue with vendor 'install' (even GNU) is that you can't
# specify the program used to strip binaries. This is especially
# annoying in cross-compiling environments, where the build's strip
# is unlikely to handle the host's binaries.
# Fortunately install-sh will honor a STRIPPROG variable, so we
-# always use install-sh in `make install-strip', and initialize
+# always use install-sh in "make install-strip", and initialize
# STRIPPROG with the value of the STRIP variable (set by the user).
AC_DEFUN([AM_PROG_INSTALL_STRIP],
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'. However `strip' might not be the right
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip". However 'strip' might not be the right
# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+# will honor the 'STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
if test "$cross_compiling" != no; then
AC_CHECK_TOOL([STRIP], [strip], :)
fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
-# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2006-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 3
-
# _AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
@@ -1228,18 +1287,16 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
-# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
+# Copyright (C) 2004-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 2
-
# _AM_PROG_TAR(FORMAT)
# --------------------
# Check how to create a tarball in format FORMAT.
-# FORMAT should be one of `v7', `ustar', or `pax'.
+# FORMAT should be one of 'v7', 'ustar', or 'pax'.
#
# Substitute a variable $(am__tar) that is a command
# writing to stdout a FORMAT-tarball containing the directory
@@ -1249,76 +1306,114 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Substitute a variable $(am__untar) that extract such
# a tarball read from stdin.
# $(am__untar) < result.tar
+#
AC_DEFUN([_AM_PROG_TAR],
[# Always define AMTAR for backward compatibility. Yes, it's still used
# in the wild :-( We should find a proper way to deprecate it ...
AC_SUBST([AMTAR], ['$${TAR-tar}'])
-m4_if([$1], [v7],
- [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
- [m4_case([$1], [ustar],, [pax],,
- [m4_fatal([Unknown tar format])])
-AC_MSG_CHECKING([how to create a $1 tar archive])
-# Loop over all known methods to create a tar archive until one works.
+
+# We'll loop over all known methods to create a tar archive until one works.
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
-_am_tools=${am_cv_prog_tar_$1-$_am_tools}
-# Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of `-'.
-for _am_tool in $_am_tools
-do
- case $_am_tool in
- gnutar)
- for _am_tar in tar gnutar gtar;
- do
- AM_RUN_LOG([$_am_tar --version]) && break
- done
- am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
- am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
- am__untar="$_am_tar -xf -"
- ;;
- plaintar)
- # Must skip GNU tar: if it does not support --format= it doesn't create
- # ustar tarball either.
- (tar --version) >/dev/null 2>&1 && continue
- am__tar='tar chf - "$$tardir"'
- am__tar_='tar chf - "$tardir"'
- am__untar='tar xf -'
- ;;
- pax)
- am__tar='pax -L -x $1 -w "$$tardir"'
- am__tar_='pax -L -x $1 -w "$tardir"'
- am__untar='pax -r'
- ;;
- cpio)
- am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
- am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
- am__untar='cpio -i -H $1 -d'
- ;;
- none)
- am__tar=false
- am__tar_=false
- am__untar=false
- ;;
- esac
- # If the value was cached, stop now. We just wanted to have am__tar
- # and am__untar set.
- test -n "${am_cv_prog_tar_$1}" && break
+m4_if([$1], [v7],
+ [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+
+ [m4_case([$1],
+ [ustar],
+ [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
+ # There is notably a 21 bits limit for the UID and the GID. In fact,
+ # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
+ # and bug#13588).
+ am_max_uid=2097151 # 2^21 - 1
+ am_max_gid=$am_max_uid
+ # The $UID and $GID variables are not portable, so we need to resort
+ # to the POSIX-mandated id(1) utility. Errors in the 'id' calls
+ # below are definitely unexpected, so allow the users to see them
+ # (that is, avoid stderr redirection).
+ am_uid=`id -u || echo unknown`
+ am_gid=`id -g || echo unknown`
+ AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
+ if test $am_uid -le $am_max_uid; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ _am_tools=none
+ fi
+ AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
+ if test $am_gid -le $am_max_gid; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ _am_tools=none
+ fi],
+
+ [pax],
+ [],
+
+ [m4_fatal([Unknown tar format])])
+
+ AC_MSG_CHECKING([how to create a $1 tar archive])
+
+ # Go ahead even if we have the value already cached. We do so because we
+ # need to set the values for the 'am__tar' and 'am__untar' variables.
+ _am_tools=${am_cv_prog_tar_$1-$_am_tools}
+
+ for _am_tool in $_am_tools; do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar; do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
- # tar/untar a dummy directory, and stop if the command works
- rm -rf conftest.dir
- mkdir conftest.dir
- echo GrepMe > conftest.dir/file
- AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works.
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ AM_RUN_LOG([cat conftest.dir/file])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+ done
rm -rf conftest.dir
- if test -s conftest.tar; then
- AM_RUN_LOG([$am__untar <conftest.tar])
- grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
- fi
-done
-rm -rf conftest.dir
-AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
-AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+ AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+ AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+
AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 00000000..91d4b09d
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,105 @@
+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+PROJECT=dbus
+TEST_TYPE=-f
+FILE=dbus-1.pc.in
+
+DIE=0
+
+if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then
+ echo "Activating pre-commit hook."
+ cp .git/hooks/pre-commit.sample .git/hooks/pre-commit
+ chmod +x .git/hooks/pre-commit
+fi
+
+(autoconf --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "You must have autoconf installed to compile $PROJECT."
+ echo "Download the appropriate package for your distribution,"
+ echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
+ DIE=1
+}
+
+# If the user hasn't explicitly chosen an Automake version, use 1.11. This is
+# the earliest version that gives us silent rules.
+if test -z "$AUTOMAKE"; then
+ AUTOMAKE=automake-1.11
+ ACLOCAL=aclocal-1.11
+fi
+
+($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || {
+ AUTOMAKE=automake
+ ACLOCAL=aclocal
+}
+
+($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "You must have automake installed to compile $PROJECT."
+ echo "Get ftp://ftp.cygnus.com/pub/home/tromey/automake-1.2d.tar.gz"
+ echo "(or a newer version if it is available)"
+ DIE=1
+}
+
+LIBTOOLIZE=`which libtoolize`
+if ! test -f "$LIBTOOLIZE"; then
+ LIBTOOLIZE=`which glibtoolize`
+fi
+
+($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "You must have libtoolize installed to compile $PROJECT."
+ echo "Install the libtool package from ftp.gnu.org or a mirror."
+ DIE=1
+}
+
+if test "$DIE" -eq 1; then
+ exit 1
+fi
+
+test $TEST_TYPE $FILE || {
+ echo "You must run this script in the top-level $PROJECT directory"
+ exit 1
+}
+
+if test -z "$*"; then
+ echo "I am going to run ./configure with no arguments - if you wish "
+ echo "to pass any to it, please specify them on the $0 command line."
+fi
+
+$LIBTOOLIZE --copy --force
+
+$ACLOCAL -I m4 $ACLOCAL_FLAGS
+
+## optionally feature autoheader
+(autoheader --version) < /dev/null > /dev/null 2>&1 && autoheader
+
+$AUTOMAKE -a $am_opt
+autoconf || echo "autoconf failed - version 2.5x is probably required"
+
+cd $ORIGDIR
+
+if test x"$NOCONFIGURE" = x; then
+ run_configure=true
+ for arg in $*; do
+ case $arg in
+ --no-configure)
+ run_configure=false
+ ;;
+ *)
+ ;;
+ esac
+ done
+else
+ run_configure=false
+fi
+
+if $run_configure; then
+ $srcdir/configure --enable-developer --config-cache "$@"
+fi
diff --git a/bus/Makefile.am b/bus/Makefile.am
index 6cbc09a6..f335e30c 100644
--- a/bus/Makefile.am
+++ b/bus/Makefile.am
@@ -42,12 +42,7 @@ agentdir=$(LAUNCHD_AGENT_DIR)
agent_DATA=org.freedesktop.dbus-session.plist
endif
-if DBUS_USE_LIBXML
-XML_SOURCES=config-loader-libxml.c
-endif
-if DBUS_USE_EXPAT
XML_SOURCES=config-loader-expat.c
-endif
if DBUS_BUS_ENABLE_KQUEUE
DIR_WATCH_SOURCE=dir-watch-kqueue.c
@@ -55,13 +50,9 @@ else
if DBUS_BUS_ENABLE_INOTIFY
DIR_WATCH_SOURCE=dir-watch-inotify.c
else
-if DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX
-DIR_WATCH_SOURCE=dir-watch-dnotify.c
-else
DIR_WATCH_SOURCE=dir-watch-default.c
endif
endif
-endif
BUS_SOURCES= \
activation.c \
@@ -149,15 +140,15 @@ dbus_daemon_launch_helper_test_CPPFLAGS = \
## we build yet another binary so we can do the OOM tests
## DO NOT INSTALL THIS FILE
-bus_test_launch_helper_SOURCES= \
+test_bus_launch_helper_SOURCES= \
test-launch-helper.c \
$(LAUNCH_HELPER_SOURCES)
-bus_test_launch_helper_LDADD= \
+test_bus_launch_helper_LDADD= \
$(top_builddir)/dbus/libdbus-internal.la \
$(DBUS_LAUNCHER_LIBS)
-bus_test_launch_helper_CPPFLAGS = \
+test_bus_launch_helper_CPPFLAGS = \
$(AM_CPPFLAGS) \
-DACTIVATION_LAUNCHER_TEST \
-DACTIVATION_LAUNCHER_DO_OOM
@@ -173,23 +164,23 @@ endif DBUS_UNIX
## compiled, so we don't put them in TESTS here; we run them in test/
## instead.
-if DBUS_BUILD_TESTS
+if DBUS_ENABLE_EMBEDDED_TESTS
## we use noinst_PROGRAMS not check_PROGRAMS so that we build
## even when not doing "make check"
# run as a test by test/Makefile.am
-noinst_PROGRAMS += bus-test bus-test-system
+noinst_PROGRAMS += test-bus test-bus-system
if DBUS_UNIX
# run as a test by test/Makefile.am
-noinst_PROGRAMS += bus-test-launch-helper
+noinst_PROGRAMS += test-bus-launch-helper
# this is used by the tests but is not,itself, a test
noinst_PROGRAMS += dbus-daemon-launch-helper-test
endif DBUS_UNIX
-endif DBUS_BUILD_TESTS
+endif DBUS_ENABLE_EMBEDDED_TESTS
-bus_test_system_SOURCES= \
+test_bus_system_SOURCES= \
$(XML_SOURCES) \
config-parser-common.c \
config-parser-common.h \
@@ -199,13 +190,13 @@ bus_test_system_SOURCES= \
utils.h \
test-system.c
-bus_test_system_LDADD=$(top_builddir)/dbus/libdbus-internal.la $(DBUS_BUS_LIBS)
+test_bus_system_LDADD=$(top_builddir)/dbus/libdbus-internal.la $(DBUS_BUS_LIBS)
-bus_test_SOURCES= \
+test_bus_SOURCES= \
$(BUS_SOURCES) \
test-main.c
-bus_test_LDADD=$(top_builddir)/dbus/libdbus-internal.la $(DBUS_BUS_LIBS)
+test_bus_LDADD=$(top_builddir)/dbus/libdbus-internal.la $(DBUS_BUS_LIBS)
## mop up the gcov files
clean-local:
diff --git a/bus/Makefile.in b/bus/Makefile.in
index f8835e3f..4425b030 100644
--- a/bus/Makefile.in
+++ b/bus/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.6 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -18,23 +17,51 @@
VPATH = @srcdir@
-am__make_dryrun = \
- { \
- am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
- *) \
- for am__flg in $$MAKEFLAGS; do \
- case $$am__flg in \
- *=*|--*) ;; \
- *n*) am__dry=yes; break;; \
- esac; \
- done;; \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
- test $$am__dry = yes; \
- }
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -58,24 +85,23 @@ dbus_daemon_exec_PROGRAMS = dbus-daemon$(EXEEXT)
@DBUS_UNIX_TRUE@libexec_PROGRAMS = dbus-daemon-launch-helper$(EXEEXT)
# run as a test by test/Makefile.am
-@DBUS_BUILD_TESTS_TRUE@am__append_1 = bus-test bus-test-system
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@am__append_1 = test-bus test-bus-system
# run as a test by test/Makefile.am
# this is used by the tests but is not,itself, a test
-@DBUS_BUILD_TESTS_TRUE@@DBUS_UNIX_TRUE@am__append_2 = \
-@DBUS_BUILD_TESTS_TRUE@@DBUS_UNIX_TRUE@ bus-test-launch-helper \
-@DBUS_BUILD_TESTS_TRUE@@DBUS_UNIX_TRUE@ dbus-daemon-launch-helper-test
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@@DBUS_UNIX_TRUE@am__append_2 = test-bus-launch-helper \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@@DBUS_UNIX_TRUE@ dbus-daemon-launch-helper-test
@HAVE_SYSTEMD_TRUE@am__append_3 = \
@HAVE_SYSTEMD_TRUE@ dbus.service.in \
@HAVE_SYSTEMD_TRUE@ dbus.socket.in
subdir = bus
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- $(srcdir)/dbus.service.in $(srcdir)/dbus.socket.in \
- $(srcdir)/messagebus-config.in $(srcdir)/messagebus.in \
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+ $(srcdir)/system.conf.in $(srcdir)/session.conf.in \
+ $(srcdir)/messagebus.in $(srcdir)/messagebus-config.in \
$(srcdir)/org.freedesktop.dbus-session.plist.in \
- $(srcdir)/rc.messagebus.in $(srcdir)/session.conf.in \
- $(srcdir)/system.conf.in
+ $(srcdir)/rc.messagebus.in $(srcdir)/dbus.service.in \
+ $(srcdir)/dbus.socket.in $(top_srcdir)/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/libtool.m4 \
@@ -96,29 +122,27 @@ am__installdirs = "$(DESTDIR)$(dbus_daemon_execdir)" \
"$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(bindir)" \
"$(DESTDIR)$(initddir)" "$(DESTDIR)$(agentdir)" \
"$(DESTDIR)$(configdir)" "$(DESTDIR)$(systemdsystemunitdir)"
-@DBUS_BUILD_TESTS_TRUE@am__EXEEXT_1 = bus-test$(EXEEXT) \
-@DBUS_BUILD_TESTS_TRUE@ bus-test-system$(EXEEXT)
-@DBUS_BUILD_TESTS_TRUE@@DBUS_UNIX_TRUE@am__EXEEXT_2 = bus-test-launch-helper$(EXEEXT) \
-@DBUS_BUILD_TESTS_TRUE@@DBUS_UNIX_TRUE@ dbus-daemon-launch-helper-test$(EXEEXT)
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@am__EXEEXT_1 = test-bus$(EXEEXT) \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-bus-system$(EXEEXT)
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@@DBUS_UNIX_TRUE@am__EXEEXT_2 = test-bus-launch-helper$(EXEEXT) \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@@DBUS_UNIX_TRUE@ dbus-daemon-launch-helper-test$(EXEEXT)
PROGRAMS = $(dbus_daemon_exec_PROGRAMS) $(libexec_PROGRAMS) \
$(noinst_PROGRAMS)
-am__bus_test_SOURCES_DIST = activation.c activation.h \
+am__dbus_daemon_SOURCES_DIST = activation.c activation.h \
activation-exit-codes.h bus.c bus.h config-parser.c \
config-parser.h config-parser-common.c config-parser-common.h \
connection.c connection.h desktop-file.c desktop-file.h \
- dir-watch-default.c dir-watch-dnotify.c dir-watch-inotify.c \
- dir-watch-kqueue.c dir-watch.h dispatch.c dispatch.h driver.c \
- driver.h expirelist.c expirelist.h policy.c policy.h selinux.h \
+ dir-watch-default.c dir-watch-inotify.c dir-watch-kqueue.c \
+ dir-watch.h dispatch.c dispatch.h driver.c driver.h \
+ expirelist.c expirelist.h policy.c policy.h selinux.h \
selinux.c services.c services.h signals.c signals.h stats.c \
stats.h test.c test.h utils.c utils.h config-loader-expat.c \
- config-loader-libxml.c test-main.c
-@DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX_FALSE@@DBUS_BUS_ENABLE_INOTIFY_FALSE@@DBUS_BUS_ENABLE_KQUEUE_FALSE@am__objects_1 = dir-watch-default.$(OBJEXT)
-@DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX_TRUE@@DBUS_BUS_ENABLE_INOTIFY_FALSE@@DBUS_BUS_ENABLE_KQUEUE_FALSE@am__objects_1 = dir-watch-dnotify.$(OBJEXT)
+ main.c
+@DBUS_BUS_ENABLE_INOTIFY_FALSE@@DBUS_BUS_ENABLE_KQUEUE_FALSE@am__objects_1 = dir-watch-default.$(OBJEXT)
@DBUS_BUS_ENABLE_INOTIFY_TRUE@@DBUS_BUS_ENABLE_KQUEUE_FALSE@am__objects_1 = dir-watch-inotify.$(OBJEXT)
@DBUS_BUS_ENABLE_KQUEUE_TRUE@am__objects_1 = \
@DBUS_BUS_ENABLE_KQUEUE_TRUE@ dir-watch-kqueue.$(OBJEXT)
-@DBUS_USE_EXPAT_FALSE@@DBUS_USE_LIBXML_TRUE@am__objects_2 = config-loader-libxml.$(OBJEXT)
-@DBUS_USE_EXPAT_TRUE@am__objects_2 = config-loader-expat.$(OBJEXT)
+am__objects_2 = config-loader-expat.$(OBJEXT)
am__objects_3 = activation.$(OBJEXT) bus.$(OBJEXT) \
config-parser.$(OBJEXT) config-parser-common.$(OBJEXT) \
connection.$(OBJEXT) desktop-file.$(OBJEXT) $(am__objects_1) \
@@ -126,99 +150,76 @@ am__objects_3 = activation.$(OBJEXT) bus.$(OBJEXT) \
policy.$(OBJEXT) selinux.$(OBJEXT) services.$(OBJEXT) \
signals.$(OBJEXT) stats.$(OBJEXT) test.$(OBJEXT) \
utils.$(OBJEXT) $(am__objects_2)
-am_bus_test_OBJECTS = $(am__objects_3) test-main.$(OBJEXT)
-bus_test_OBJECTS = $(am_bus_test_OBJECTS)
+am_dbus_daemon_OBJECTS = $(am__objects_3) main.$(OBJEXT)
+dbus_daemon_OBJECTS = $(am_dbus_daemon_OBJECTS)
am__DEPENDENCIES_1 =
am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
-bus_test_DEPENDENCIES = $(top_builddir)/dbus/libdbus-internal.la \
- $(am__DEPENDENCIES_2)
+dbus_daemon_DEPENDENCIES = $(top_builddir)/dbus/libdbus-internal.la \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
-am__bus_test_launch_helper_SOURCES_DIST = test-launch-helper.c \
- config-loader-expat.c config-loader-libxml.c \
- config-parser-common.c config-parser-common.h \
- config-parser-trivial.c config-parser-trivial.h desktop-file.c \
- desktop-file.h utils.c utils.h activation-exit-codes.h \
- activation-helper.h activation-helper.c
-@DBUS_USE_EXPAT_FALSE@@DBUS_USE_LIBXML_TRUE@am__objects_4 = bus_test_launch_helper-config-loader-libxml.$(OBJEXT)
-@DBUS_USE_EXPAT_TRUE@am__objects_4 = bus_test_launch_helper-config-loader-expat.$(OBJEXT)
-am__objects_5 = $(am__objects_4) \
- bus_test_launch_helper-config-parser-common.$(OBJEXT) \
- bus_test_launch_helper-config-parser-trivial.$(OBJEXT) \
- bus_test_launch_helper-desktop-file.$(OBJEXT) \
- bus_test_launch_helper-utils.$(OBJEXT) \
- bus_test_launch_helper-activation-helper.$(OBJEXT)
-am_bus_test_launch_helper_OBJECTS = \
- bus_test_launch_helper-test-launch-helper.$(OBJEXT) \
- $(am__objects_5)
-bus_test_launch_helper_OBJECTS = $(am_bus_test_launch_helper_OBJECTS)
-am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
-bus_test_launch_helper_DEPENDENCIES = \
- $(top_builddir)/dbus/libdbus-internal.la $(am__DEPENDENCIES_3)
-am__bus_test_system_SOURCES_DIST = config-loader-expat.c \
- config-loader-libxml.c config-parser-common.c \
- config-parser-common.h config-parser-trivial.c \
- config-parser-trivial.h utils.c utils.h test-system.c
-am_bus_test_system_OBJECTS = $(am__objects_2) \
- config-parser-common.$(OBJEXT) config-parser-trivial.$(OBJEXT) \
- utils.$(OBJEXT) test-system.$(OBJEXT)
-bus_test_system_OBJECTS = $(am_bus_test_system_OBJECTS)
-bus_test_system_DEPENDENCIES = \
- $(top_builddir)/dbus/libdbus-internal.la $(am__DEPENDENCIES_2)
-am__dbus_daemon_SOURCES_DIST = activation.c activation.h \
- activation-exit-codes.h bus.c bus.h config-parser.c \
- config-parser.h config-parser-common.c config-parser-common.h \
- connection.c connection.h desktop-file.c desktop-file.h \
- dir-watch-default.c dir-watch-dnotify.c dir-watch-inotify.c \
- dir-watch-kqueue.c dir-watch.h dispatch.c dispatch.h driver.c \
- driver.h expirelist.c expirelist.h policy.c policy.h selinux.h \
- selinux.c services.c services.h signals.c signals.h stats.c \
- stats.h test.c test.h utils.c utils.h config-loader-expat.c \
- config-loader-libxml.c main.c
-am_dbus_daemon_OBJECTS = $(am__objects_3) main.$(OBJEXT)
-dbus_daemon_OBJECTS = $(am_dbus_daemon_OBJECTS)
-dbus_daemon_DEPENDENCIES = $(top_builddir)/dbus/libdbus-internal.la \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
-am__dbus_daemon_launch_helper_SOURCES_DIST = activation-helper-bin.c \
- config-loader-expat.c config-loader-libxml.c \
- config-parser-common.c config-parser-common.h \
- config-parser-trivial.c config-parser-trivial.h desktop-file.c \
- desktop-file.h utils.c utils.h activation-exit-codes.h \
- activation-helper.h activation-helper.c
-am__objects_6 = $(am__objects_2) config-parser-common.$(OBJEXT) \
+am__v_lt_1 =
+am__objects_4 = $(am__objects_2) config-parser-common.$(OBJEXT) \
config-parser-trivial.$(OBJEXT) desktop-file.$(OBJEXT) \
utils.$(OBJEXT) activation-helper.$(OBJEXT)
am_dbus_daemon_launch_helper_OBJECTS = \
- activation-helper-bin.$(OBJEXT) $(am__objects_6)
+ activation-helper-bin.$(OBJEXT) $(am__objects_4)
dbus_daemon_launch_helper_OBJECTS = \
$(am_dbus_daemon_launch_helper_OBJECTS)
+am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
dbus_daemon_launch_helper_DEPENDENCIES = \
$(top_builddir)/dbus/libdbus-internal.la $(am__DEPENDENCIES_3)
-am__dbus_daemon_launch_helper_test_SOURCES_DIST = \
- activation-helper-bin.c config-loader-expat.c \
- config-loader-libxml.c config-parser-common.c \
- config-parser-common.h config-parser-trivial.c \
- config-parser-trivial.h desktop-file.c desktop-file.h utils.c \
- utils.h activation-exit-codes.h activation-helper.h \
- activation-helper.c
-@DBUS_USE_EXPAT_FALSE@@DBUS_USE_LIBXML_TRUE@am__objects_7 = dbus_daemon_launch_helper_test-config-loader-libxml.$(OBJEXT)
-@DBUS_USE_EXPAT_TRUE@am__objects_7 = dbus_daemon_launch_helper_test-config-loader-expat.$(OBJEXT)
-am__objects_8 = $(am__objects_7) \
+am__objects_5 = \
+ dbus_daemon_launch_helper_test-config-loader-expat.$(OBJEXT)
+am__objects_6 = $(am__objects_5) \
dbus_daemon_launch_helper_test-config-parser-common.$(OBJEXT) \
dbus_daemon_launch_helper_test-config-parser-trivial.$(OBJEXT) \
dbus_daemon_launch_helper_test-desktop-file.$(OBJEXT) \
dbus_daemon_launch_helper_test-utils.$(OBJEXT) \
dbus_daemon_launch_helper_test-activation-helper.$(OBJEXT)
am_dbus_daemon_launch_helper_test_OBJECTS = dbus_daemon_launch_helper_test-activation-helper-bin.$(OBJEXT) \
- $(am__objects_8)
+ $(am__objects_6)
dbus_daemon_launch_helper_test_OBJECTS = \
$(am_dbus_daemon_launch_helper_test_OBJECTS)
dbus_daemon_launch_helper_test_DEPENDENCIES = \
$(top_builddir)/dbus/libdbus-internal.la $(am__DEPENDENCIES_3)
+am__test_bus_SOURCES_DIST = activation.c activation.h \
+ activation-exit-codes.h bus.c bus.h config-parser.c \
+ config-parser.h config-parser-common.c config-parser-common.h \
+ connection.c connection.h desktop-file.c desktop-file.h \
+ dir-watch-default.c dir-watch-inotify.c dir-watch-kqueue.c \
+ dir-watch.h dispatch.c dispatch.h driver.c driver.h \
+ expirelist.c expirelist.h policy.c policy.h selinux.h \
+ selinux.c services.c services.h signals.c signals.h stats.c \
+ stats.h test.c test.h utils.c utils.h config-loader-expat.c \
+ test-main.c
+am_test_bus_OBJECTS = $(am__objects_3) test-main.$(OBJEXT)
+test_bus_OBJECTS = $(am_test_bus_OBJECTS)
+test_bus_DEPENDENCIES = $(top_builddir)/dbus/libdbus-internal.la \
+ $(am__DEPENDENCIES_2)
+am__objects_7 = test_bus_launch_helper-config-loader-expat.$(OBJEXT)
+am__objects_8 = $(am__objects_7) \
+ test_bus_launch_helper-config-parser-common.$(OBJEXT) \
+ test_bus_launch_helper-config-parser-trivial.$(OBJEXT) \
+ test_bus_launch_helper-desktop-file.$(OBJEXT) \
+ test_bus_launch_helper-utils.$(OBJEXT) \
+ test_bus_launch_helper-activation-helper.$(OBJEXT)
+am_test_bus_launch_helper_OBJECTS = \
+ test_bus_launch_helper-test-launch-helper.$(OBJEXT) \
+ $(am__objects_8)
+test_bus_launch_helper_OBJECTS = $(am_test_bus_launch_helper_OBJECTS)
+test_bus_launch_helper_DEPENDENCIES = \
+ $(top_builddir)/dbus/libdbus-internal.la $(am__DEPENDENCIES_3)
+am_test_bus_system_OBJECTS = $(am__objects_2) \
+ config-parser-common.$(OBJEXT) config-parser-trivial.$(OBJEXT) \
+ utils.$(OBJEXT) test-system.$(OBJEXT)
+test_bus_system_OBJECTS = $(am_test_bus_system_OBJECTS)
+test_bus_system_DEPENDENCIES = \
+ $(top_builddir)/dbus/libdbus-internal.la $(am__DEPENDENCIES_2)
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -247,6 +248,18 @@ am__uninstall_files_from_dir = { \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
SCRIPTS = $(bin_SCRIPTS) $(initd_SCRIPTS)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@@ -259,36 +272,47 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-SOURCES = $(bus_test_SOURCES) $(bus_test_launch_helper_SOURCES) \
- $(bus_test_system_SOURCES) $(dbus_daemon_SOURCES) \
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(dbus_daemon_SOURCES) $(dbus_daemon_launch_helper_SOURCES) \
+ $(dbus_daemon_launch_helper_test_SOURCES) $(test_bus_SOURCES) \
+ $(test_bus_launch_helper_SOURCES) $(test_bus_system_SOURCES)
+DIST_SOURCES = $(am__dbus_daemon_SOURCES_DIST) \
$(dbus_daemon_launch_helper_SOURCES) \
- $(dbus_daemon_launch_helper_test_SOURCES)
-DIST_SOURCES = $(am__bus_test_SOURCES_DIST) \
- $(am__bus_test_launch_helper_SOURCES_DIST) \
- $(am__bus_test_system_SOURCES_DIST) \
- $(am__dbus_daemon_SOURCES_DIST) \
- $(am__dbus_daemon_launch_helper_SOURCES_DIST) \
- $(am__dbus_daemon_launch_helper_test_SOURCES_DIST)
+ $(dbus_daemon_launch_helper_test_SOURCES) \
+ $(am__test_bus_SOURCES_DIST) $(test_bus_launch_helper_SOURCES) \
+ $(test_bus_system_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
DATA = $(agent_DATA) $(config_DATA) $(systemdsystemunit_DATA)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -320,7 +344,6 @@ 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@
DBUS_INT64_CONSTANT = @DBUS_INT64_CONSTANT@
@@ -331,7 +354,8 @@ DBUS_MICRO_VERSION = @DBUS_MICRO_VERSION@
DBUS_MINOR_VERSION = @DBUS_MINOR_VERSION@
DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@
DBUS_PREFIX = @DBUS_PREFIX@
-DBUS_SESSION_BUS_DEFAULT_ADDRESS = @DBUS_SESSION_BUS_DEFAULT_ADDRESS@
+DBUS_SESSION_BUS_CONNECT_ADDRESS = @DBUS_SESSION_BUS_CONNECT_ADDRESS@
+DBUS_SESSION_BUS_LISTEN_ADDRESS = @DBUS_SESSION_BUS_LISTEN_ADDRESS@
DBUS_SESSION_SOCKET_DIR = @DBUS_SESSION_SOCKET_DIR@
DBUS_STATIC_BUILD_CPPFLAGS = @DBUS_STATIC_BUILD_CPPFLAGS@
DBUS_SYSTEM_BUS_DEFAULT_ADDRESS = @DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@
@@ -380,8 +404,6 @@ LIBDBUS_LIBS = @LIBDBUS_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
-LIBXML_CFLAGS = @LIBXML_CFLAGS@
-LIBXML_LIBS = @LIBXML_LIBS@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
@@ -390,7 +412,6 @@ LT_CURRENT = @LT_CURRENT@
LT_REVISION = @LT_REVISION@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
-MAN2HTML = @MAN2HTML@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NETWORK_libs = @NETWORK_libs@
@@ -424,7 +445,6 @@ SHELL = @SHELL@
STRIP = @STRIP@
SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
SYSTEMD_LIBS = @SYSTEMD_LIBS@
-TEST_BUS_BINARY = @TEST_BUS_BINARY@
TEST_LAUNCH_HELPER_BINARY = @TEST_LAUNCH_HELPER_BINARY@
TEST_LISTEN = @TEST_LISTEN@
TEST_SOCKET_DIR = @TEST_SOCKET_DIR@
@@ -539,10 +559,8 @@ config_DATA = \
@DBUS_ENABLE_LAUNCHD_TRUE@agentdir = $(LAUNCHD_AGENT_DIR)
@DBUS_ENABLE_LAUNCHD_TRUE@agent_DATA = org.freedesktop.dbus-session.plist
-@DBUS_USE_EXPAT_TRUE@XML_SOURCES = config-loader-expat.c
-@DBUS_USE_LIBXML_TRUE@XML_SOURCES = config-loader-libxml.c
-@DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX_FALSE@@DBUS_BUS_ENABLE_INOTIFY_FALSE@@DBUS_BUS_ENABLE_KQUEUE_FALSE@DIR_WATCH_SOURCE = dir-watch-default.c
-@DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX_TRUE@@DBUS_BUS_ENABLE_INOTIFY_FALSE@@DBUS_BUS_ENABLE_KQUEUE_FALSE@DIR_WATCH_SOURCE = dir-watch-dnotify.c
+XML_SOURCES = config-loader-expat.c
+@DBUS_BUS_ENABLE_INOTIFY_FALSE@@DBUS_BUS_ENABLE_KQUEUE_FALSE@DIR_WATCH_SOURCE = dir-watch-default.c
@DBUS_BUS_ENABLE_INOTIFY_TRUE@@DBUS_BUS_ENABLE_KQUEUE_FALSE@DIR_WATCH_SOURCE = dir-watch-inotify.c
@DBUS_BUS_ENABLE_KQUEUE_TRUE@DIR_WATCH_SOURCE = dir-watch-kqueue.c
BUS_SOURCES = \
@@ -626,20 +644,20 @@ dbus_daemon_launch_helper_test_CPPFLAGS = \
$(AM_CPPFLAGS) \
-DACTIVATION_LAUNCHER_TEST
-bus_test_launch_helper_SOURCES = \
+test_bus_launch_helper_SOURCES = \
test-launch-helper.c \
$(LAUNCH_HELPER_SOURCES)
-bus_test_launch_helper_LDADD = \
+test_bus_launch_helper_LDADD = \
$(top_builddir)/dbus/libdbus-internal.la \
$(DBUS_LAUNCHER_LIBS)
-bus_test_launch_helper_CPPFLAGS = \
+test_bus_launch_helper_CPPFLAGS = \
$(AM_CPPFLAGS) \
-DACTIVATION_LAUNCHER_TEST \
-DACTIVATION_LAUNCHER_DO_OOM
-bus_test_system_SOURCES = \
+test_bus_system_SOURCES = \
$(XML_SOURCES) \
config-parser-common.c \
config-parser-common.h \
@@ -649,12 +667,12 @@ bus_test_system_SOURCES = \
utils.h \
test-system.c
-bus_test_system_LDADD = $(top_builddir)/dbus/libdbus-internal.la $(DBUS_BUS_LIBS)
-bus_test_SOURCES = \
+test_bus_system_LDADD = $(top_builddir)/dbus/libdbus-internal.la $(DBUS_BUS_LIBS)
+test_bus_SOURCES = \
$(BUS_SOURCES) \
test-main.c
-bus_test_LDADD = $(top_builddir)/dbus/libdbus-internal.la $(DBUS_BUS_LIBS)
+test_bus_LDADD = $(top_builddir)/dbus/libdbus-internal.la $(DBUS_BUS_LIBS)
#### Init scripts fun
SCRIPT_IN_FILES = messagebus.in messagebus-config.in rc.messagebus.in \
@@ -736,10 +754,12 @@ install-dbus_daemon_execPROGRAMS: $(dbus_daemon_exec_PROGRAMS)
fi; \
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; \
+ 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|.*|.|' \
+ 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 } \
@@ -760,7 +780,8 @@ uninstall-dbus_daemon_execPROGRAMS:
@list='$(dbus_daemon_exec_PROGRAMS)'; test -n "$(dbus_daemon_execdir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
- -e 's/$$/$(EXEEXT)/' `; \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(dbus_daemon_execdir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(dbus_daemon_execdir)" && rm -f $$files
@@ -782,10 +803,12 @@ install-libexecPROGRAMS: $(libexec_PROGRAMS)
fi; \
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; \
+ 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|.*|.|' \
+ 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 } \
@@ -806,7 +829,8 @@ uninstall-libexecPROGRAMS:
@list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
- -e 's/$$/$(EXEEXT)/' `; \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(libexecdir)" && rm -f $$files
@@ -828,24 +852,30 @@ clean-noinstPROGRAMS:
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
-bus-test$(EXEEXT): $(bus_test_OBJECTS) $(bus_test_DEPENDENCIES) $(EXTRA_bus_test_DEPENDENCIES)
- @rm -f bus-test$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(bus_test_OBJECTS) $(bus_test_LDADD) $(LIBS)
-bus-test-launch-helper$(EXEEXT): $(bus_test_launch_helper_OBJECTS) $(bus_test_launch_helper_DEPENDENCIES) $(EXTRA_bus_test_launch_helper_DEPENDENCIES)
- @rm -f bus-test-launch-helper$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(bus_test_launch_helper_OBJECTS) $(bus_test_launch_helper_LDADD) $(LIBS)
-bus-test-system$(EXEEXT): $(bus_test_system_OBJECTS) $(bus_test_system_DEPENDENCIES) $(EXTRA_bus_test_system_DEPENDENCIES)
- @rm -f bus-test-system$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(bus_test_system_OBJECTS) $(bus_test_system_LDADD) $(LIBS)
+
dbus-daemon$(EXEEXT): $(dbus_daemon_OBJECTS) $(dbus_daemon_DEPENDENCIES) $(EXTRA_dbus_daemon_DEPENDENCIES)
@rm -f dbus-daemon$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(dbus_daemon_OBJECTS) $(dbus_daemon_LDADD) $(LIBS)
+
dbus-daemon-launch-helper$(EXEEXT): $(dbus_daemon_launch_helper_OBJECTS) $(dbus_daemon_launch_helper_DEPENDENCIES) $(EXTRA_dbus_daemon_launch_helper_DEPENDENCIES)
@rm -f dbus-daemon-launch-helper$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(dbus_daemon_launch_helper_OBJECTS) $(dbus_daemon_launch_helper_LDADD) $(LIBS)
+
dbus-daemon-launch-helper-test$(EXEEXT): $(dbus_daemon_launch_helper_test_OBJECTS) $(dbus_daemon_launch_helper_test_DEPENDENCIES) $(EXTRA_dbus_daemon_launch_helper_test_DEPENDENCIES)
@rm -f dbus-daemon-launch-helper-test$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(dbus_daemon_launch_helper_test_OBJECTS) $(dbus_daemon_launch_helper_test_LDADD) $(LIBS)
+
+test-bus$(EXEEXT): $(test_bus_OBJECTS) $(test_bus_DEPENDENCIES) $(EXTRA_test_bus_DEPENDENCIES)
+ @rm -f test-bus$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_bus_OBJECTS) $(test_bus_LDADD) $(LIBS)
+
+test-bus-launch-helper$(EXEEXT): $(test_bus_launch_helper_OBJECTS) $(test_bus_launch_helper_DEPENDENCIES) $(EXTRA_test_bus_launch_helper_DEPENDENCIES)
+ @rm -f test-bus-launch-helper$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_bus_launch_helper_OBJECTS) $(test_bus_launch_helper_LDADD) $(LIBS)
+
+test-bus-system$(EXEEXT): $(test_bus_system_OBJECTS) $(test_bus_system_DEPENDENCIES) $(EXTRA_test_bus_system_DEPENDENCIES)
+ @rm -f test-bus-system$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_bus_system_OBJECTS) $(test_bus_system_LDADD) $(LIBS)
install-binSCRIPTS: $(bin_SCRIPTS)
@$(NORMAL_INSTALL)
@list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
@@ -927,16 +957,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/activation-helper.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/activation.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bus.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bus_test_launch_helper-activation-helper.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bus_test_launch_helper-config-loader-expat.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bus_test_launch_helper-config-loader-libxml.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bus_test_launch_helper-config-parser-common.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bus_test_launch_helper-config-parser-trivial.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bus_test_launch_helper-desktop-file.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bus_test_launch_helper-test-launch-helper.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bus_test_launch_helper-utils.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config-loader-expat.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config-loader-libxml.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config-parser-common.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config-parser-trivial.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config-parser.Po@am__quote@
@@ -944,14 +965,12 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus_daemon_launch_helper_test-activation-helper-bin.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus_daemon_launch_helper_test-activation-helper.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus_daemon_launch_helper_test-config-loader-expat.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus_daemon_launch_helper_test-config-loader-libxml.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus_daemon_launch_helper_test-config-parser-common.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus_daemon_launch_helper_test-config-parser-trivial.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus_daemon_launch_helper_test-desktop-file.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus_daemon_launch_helper_test-utils.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/desktop-file.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dir-watch-default.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dir-watch-dnotify.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dir-watch-inotify.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dir-watch-kqueue.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dispatch.Po@am__quote@
@@ -966,6 +985,13 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-main.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-system.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_bus_launch_helper-activation-helper.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_bus_launch_helper-config-loader-expat.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_bus_launch_helper-config-parser-common.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_bus_launch_helper-config-parser-trivial.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_bus_launch_helper-desktop-file.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_bus_launch_helper-test-launch-helper.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_bus_launch_helper-utils.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Po@am__quote@
.c.o:
@@ -973,14 +999,14 @@ distclean-compile:
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -989,118 +1015,6 @@ distclean-compile:
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-bus_test_launch_helper-test-launch-helper.o: test-launch-helper.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bus_test_launch_helper-test-launch-helper.o -MD -MP -MF $(DEPDIR)/bus_test_launch_helper-test-launch-helper.Tpo -c -o bus_test_launch_helper-test-launch-helper.o `test -f 'test-launch-helper.c' || echo '$(srcdir)/'`test-launch-helper.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bus_test_launch_helper-test-launch-helper.Tpo $(DEPDIR)/bus_test_launch_helper-test-launch-helper.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-launch-helper.c' object='bus_test_launch_helper-test-launch-helper.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bus_test_launch_helper-test-launch-helper.o `test -f 'test-launch-helper.c' || echo '$(srcdir)/'`test-launch-helper.c
-
-bus_test_launch_helper-test-launch-helper.obj: test-launch-helper.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bus_test_launch_helper-test-launch-helper.obj -MD -MP -MF $(DEPDIR)/bus_test_launch_helper-test-launch-helper.Tpo -c -o bus_test_launch_helper-test-launch-helper.obj `if test -f 'test-launch-helper.c'; then $(CYGPATH_W) 'test-launch-helper.c'; else $(CYGPATH_W) '$(srcdir)/test-launch-helper.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bus_test_launch_helper-test-launch-helper.Tpo $(DEPDIR)/bus_test_launch_helper-test-launch-helper.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-launch-helper.c' object='bus_test_launch_helper-test-launch-helper.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bus_test_launch_helper-test-launch-helper.obj `if test -f 'test-launch-helper.c'; then $(CYGPATH_W) 'test-launch-helper.c'; else $(CYGPATH_W) '$(srcdir)/test-launch-helper.c'; fi`
-
-bus_test_launch_helper-config-loader-expat.o: config-loader-expat.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bus_test_launch_helper-config-loader-expat.o -MD -MP -MF $(DEPDIR)/bus_test_launch_helper-config-loader-expat.Tpo -c -o bus_test_launch_helper-config-loader-expat.o `test -f 'config-loader-expat.c' || echo '$(srcdir)/'`config-loader-expat.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bus_test_launch_helper-config-loader-expat.Tpo $(DEPDIR)/bus_test_launch_helper-config-loader-expat.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config-loader-expat.c' object='bus_test_launch_helper-config-loader-expat.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bus_test_launch_helper-config-loader-expat.o `test -f 'config-loader-expat.c' || echo '$(srcdir)/'`config-loader-expat.c
-
-bus_test_launch_helper-config-loader-expat.obj: config-loader-expat.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bus_test_launch_helper-config-loader-expat.obj -MD -MP -MF $(DEPDIR)/bus_test_launch_helper-config-loader-expat.Tpo -c -o bus_test_launch_helper-config-loader-expat.obj `if test -f 'config-loader-expat.c'; then $(CYGPATH_W) 'config-loader-expat.c'; else $(CYGPATH_W) '$(srcdir)/config-loader-expat.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bus_test_launch_helper-config-loader-expat.Tpo $(DEPDIR)/bus_test_launch_helper-config-loader-expat.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config-loader-expat.c' object='bus_test_launch_helper-config-loader-expat.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bus_test_launch_helper-config-loader-expat.obj `if test -f 'config-loader-expat.c'; then $(CYGPATH_W) 'config-loader-expat.c'; else $(CYGPATH_W) '$(srcdir)/config-loader-expat.c'; fi`
-
-bus_test_launch_helper-config-loader-libxml.o: config-loader-libxml.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bus_test_launch_helper-config-loader-libxml.o -MD -MP -MF $(DEPDIR)/bus_test_launch_helper-config-loader-libxml.Tpo -c -o bus_test_launch_helper-config-loader-libxml.o `test -f 'config-loader-libxml.c' || echo '$(srcdir)/'`config-loader-libxml.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bus_test_launch_helper-config-loader-libxml.Tpo $(DEPDIR)/bus_test_launch_helper-config-loader-libxml.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config-loader-libxml.c' object='bus_test_launch_helper-config-loader-libxml.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bus_test_launch_helper-config-loader-libxml.o `test -f 'config-loader-libxml.c' || echo '$(srcdir)/'`config-loader-libxml.c
-
-bus_test_launch_helper-config-loader-libxml.obj: config-loader-libxml.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bus_test_launch_helper-config-loader-libxml.obj -MD -MP -MF $(DEPDIR)/bus_test_launch_helper-config-loader-libxml.Tpo -c -o bus_test_launch_helper-config-loader-libxml.obj `if test -f 'config-loader-libxml.c'; then $(CYGPATH_W) 'config-loader-libxml.c'; else $(CYGPATH_W) '$(srcdir)/config-loader-libxml.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bus_test_launch_helper-config-loader-libxml.Tpo $(DEPDIR)/bus_test_launch_helper-config-loader-libxml.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config-loader-libxml.c' object='bus_test_launch_helper-config-loader-libxml.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bus_test_launch_helper-config-loader-libxml.obj `if test -f 'config-loader-libxml.c'; then $(CYGPATH_W) 'config-loader-libxml.c'; else $(CYGPATH_W) '$(srcdir)/config-loader-libxml.c'; fi`
-
-bus_test_launch_helper-config-parser-common.o: config-parser-common.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bus_test_launch_helper-config-parser-common.o -MD -MP -MF $(DEPDIR)/bus_test_launch_helper-config-parser-common.Tpo -c -o bus_test_launch_helper-config-parser-common.o `test -f 'config-parser-common.c' || echo '$(srcdir)/'`config-parser-common.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bus_test_launch_helper-config-parser-common.Tpo $(DEPDIR)/bus_test_launch_helper-config-parser-common.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config-parser-common.c' object='bus_test_launch_helper-config-parser-common.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bus_test_launch_helper-config-parser-common.o `test -f 'config-parser-common.c' || echo '$(srcdir)/'`config-parser-common.c
-
-bus_test_launch_helper-config-parser-common.obj: config-parser-common.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bus_test_launch_helper-config-parser-common.obj -MD -MP -MF $(DEPDIR)/bus_test_launch_helper-config-parser-common.Tpo -c -o bus_test_launch_helper-config-parser-common.obj `if test -f 'config-parser-common.c'; then $(CYGPATH_W) 'config-parser-common.c'; else $(CYGPATH_W) '$(srcdir)/config-parser-common.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bus_test_launch_helper-config-parser-common.Tpo $(DEPDIR)/bus_test_launch_helper-config-parser-common.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config-parser-common.c' object='bus_test_launch_helper-config-parser-common.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bus_test_launch_helper-config-parser-common.obj `if test -f 'config-parser-common.c'; then $(CYGPATH_W) 'config-parser-common.c'; else $(CYGPATH_W) '$(srcdir)/config-parser-common.c'; fi`
-
-bus_test_launch_helper-config-parser-trivial.o: config-parser-trivial.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bus_test_launch_helper-config-parser-trivial.o -MD -MP -MF $(DEPDIR)/bus_test_launch_helper-config-parser-trivial.Tpo -c -o bus_test_launch_helper-config-parser-trivial.o `test -f 'config-parser-trivial.c' || echo '$(srcdir)/'`config-parser-trivial.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bus_test_launch_helper-config-parser-trivial.Tpo $(DEPDIR)/bus_test_launch_helper-config-parser-trivial.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config-parser-trivial.c' object='bus_test_launch_helper-config-parser-trivial.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bus_test_launch_helper-config-parser-trivial.o `test -f 'config-parser-trivial.c' || echo '$(srcdir)/'`config-parser-trivial.c
-
-bus_test_launch_helper-config-parser-trivial.obj: config-parser-trivial.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bus_test_launch_helper-config-parser-trivial.obj -MD -MP -MF $(DEPDIR)/bus_test_launch_helper-config-parser-trivial.Tpo -c -o bus_test_launch_helper-config-parser-trivial.obj `if test -f 'config-parser-trivial.c'; then $(CYGPATH_W) 'config-parser-trivial.c'; else $(CYGPATH_W) '$(srcdir)/config-parser-trivial.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bus_test_launch_helper-config-parser-trivial.Tpo $(DEPDIR)/bus_test_launch_helper-config-parser-trivial.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config-parser-trivial.c' object='bus_test_launch_helper-config-parser-trivial.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bus_test_launch_helper-config-parser-trivial.obj `if test -f 'config-parser-trivial.c'; then $(CYGPATH_W) 'config-parser-trivial.c'; else $(CYGPATH_W) '$(srcdir)/config-parser-trivial.c'; fi`
-
-bus_test_launch_helper-desktop-file.o: desktop-file.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bus_test_launch_helper-desktop-file.o -MD -MP -MF $(DEPDIR)/bus_test_launch_helper-desktop-file.Tpo -c -o bus_test_launch_helper-desktop-file.o `test -f 'desktop-file.c' || echo '$(srcdir)/'`desktop-file.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bus_test_launch_helper-desktop-file.Tpo $(DEPDIR)/bus_test_launch_helper-desktop-file.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='desktop-file.c' object='bus_test_launch_helper-desktop-file.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bus_test_launch_helper-desktop-file.o `test -f 'desktop-file.c' || echo '$(srcdir)/'`desktop-file.c
-
-bus_test_launch_helper-desktop-file.obj: desktop-file.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bus_test_launch_helper-desktop-file.obj -MD -MP -MF $(DEPDIR)/bus_test_launch_helper-desktop-file.Tpo -c -o bus_test_launch_helper-desktop-file.obj `if test -f 'desktop-file.c'; then $(CYGPATH_W) 'desktop-file.c'; else $(CYGPATH_W) '$(srcdir)/desktop-file.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bus_test_launch_helper-desktop-file.Tpo $(DEPDIR)/bus_test_launch_helper-desktop-file.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='desktop-file.c' object='bus_test_launch_helper-desktop-file.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bus_test_launch_helper-desktop-file.obj `if test -f 'desktop-file.c'; then $(CYGPATH_W) 'desktop-file.c'; else $(CYGPATH_W) '$(srcdir)/desktop-file.c'; fi`
-
-bus_test_launch_helper-utils.o: utils.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bus_test_launch_helper-utils.o -MD -MP -MF $(DEPDIR)/bus_test_launch_helper-utils.Tpo -c -o bus_test_launch_helper-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bus_test_launch_helper-utils.Tpo $(DEPDIR)/bus_test_launch_helper-utils.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utils.c' object='bus_test_launch_helper-utils.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bus_test_launch_helper-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c
-
-bus_test_launch_helper-utils.obj: utils.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bus_test_launch_helper-utils.obj -MD -MP -MF $(DEPDIR)/bus_test_launch_helper-utils.Tpo -c -o bus_test_launch_helper-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bus_test_launch_helper-utils.Tpo $(DEPDIR)/bus_test_launch_helper-utils.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utils.c' object='bus_test_launch_helper-utils.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bus_test_launch_helper-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi`
-
-bus_test_launch_helper-activation-helper.o: activation-helper.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bus_test_launch_helper-activation-helper.o -MD -MP -MF $(DEPDIR)/bus_test_launch_helper-activation-helper.Tpo -c -o bus_test_launch_helper-activation-helper.o `test -f 'activation-helper.c' || echo '$(srcdir)/'`activation-helper.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bus_test_launch_helper-activation-helper.Tpo $(DEPDIR)/bus_test_launch_helper-activation-helper.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='activation-helper.c' object='bus_test_launch_helper-activation-helper.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bus_test_launch_helper-activation-helper.o `test -f 'activation-helper.c' || echo '$(srcdir)/'`activation-helper.c
-
-bus_test_launch_helper-activation-helper.obj: activation-helper.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bus_test_launch_helper-activation-helper.obj -MD -MP -MF $(DEPDIR)/bus_test_launch_helper-activation-helper.Tpo -c -o bus_test_launch_helper-activation-helper.obj `if test -f 'activation-helper.c'; then $(CYGPATH_W) 'activation-helper.c'; else $(CYGPATH_W) '$(srcdir)/activation-helper.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bus_test_launch_helper-activation-helper.Tpo $(DEPDIR)/bus_test_launch_helper-activation-helper.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='activation-helper.c' object='bus_test_launch_helper-activation-helper.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bus_test_launch_helper-activation-helper.obj `if test -f 'activation-helper.c'; then $(CYGPATH_W) 'activation-helper.c'; else $(CYGPATH_W) '$(srcdir)/activation-helper.c'; fi`
-
dbus_daemon_launch_helper_test-activation-helper-bin.o: activation-helper-bin.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dbus_daemon_launch_helper_test-activation-helper-bin.o -MD -MP -MF $(DEPDIR)/dbus_daemon_launch_helper_test-activation-helper-bin.Tpo -c -o dbus_daemon_launch_helper_test-activation-helper-bin.o `test -f 'activation-helper-bin.c' || echo '$(srcdir)/'`activation-helper-bin.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dbus_daemon_launch_helper_test-activation-helper-bin.Tpo $(DEPDIR)/dbus_daemon_launch_helper_test-activation-helper-bin.Po
@@ -1129,20 +1043,6 @@ dbus_daemon_launch_helper_test-config-loader-expat.obj: config-loader-expat.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dbus_daemon_launch_helper_test-config-loader-expat.obj `if test -f 'config-loader-expat.c'; then $(CYGPATH_W) 'config-loader-expat.c'; else $(CYGPATH_W) '$(srcdir)/config-loader-expat.c'; fi`
-dbus_daemon_launch_helper_test-config-loader-libxml.o: config-loader-libxml.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dbus_daemon_launch_helper_test-config-loader-libxml.o -MD -MP -MF $(DEPDIR)/dbus_daemon_launch_helper_test-config-loader-libxml.Tpo -c -o dbus_daemon_launch_helper_test-config-loader-libxml.o `test -f 'config-loader-libxml.c' || echo '$(srcdir)/'`config-loader-libxml.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dbus_daemon_launch_helper_test-config-loader-libxml.Tpo $(DEPDIR)/dbus_daemon_launch_helper_test-config-loader-libxml.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config-loader-libxml.c' object='dbus_daemon_launch_helper_test-config-loader-libxml.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dbus_daemon_launch_helper_test-config-loader-libxml.o `test -f 'config-loader-libxml.c' || echo '$(srcdir)/'`config-loader-libxml.c
-
-dbus_daemon_launch_helper_test-config-loader-libxml.obj: config-loader-libxml.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dbus_daemon_launch_helper_test-config-loader-libxml.obj -MD -MP -MF $(DEPDIR)/dbus_daemon_launch_helper_test-config-loader-libxml.Tpo -c -o dbus_daemon_launch_helper_test-config-loader-libxml.obj `if test -f 'config-loader-libxml.c'; then $(CYGPATH_W) 'config-loader-libxml.c'; else $(CYGPATH_W) '$(srcdir)/config-loader-libxml.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dbus_daemon_launch_helper_test-config-loader-libxml.Tpo $(DEPDIR)/dbus_daemon_launch_helper_test-config-loader-libxml.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config-loader-libxml.c' object='dbus_daemon_launch_helper_test-config-loader-libxml.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dbus_daemon_launch_helper_test-config-loader-libxml.obj `if test -f 'config-loader-libxml.c'; then $(CYGPATH_W) 'config-loader-libxml.c'; else $(CYGPATH_W) '$(srcdir)/config-loader-libxml.c'; fi`
-
dbus_daemon_launch_helper_test-config-parser-common.o: config-parser-common.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dbus_daemon_launch_helper_test-config-parser-common.o -MD -MP -MF $(DEPDIR)/dbus_daemon_launch_helper_test-config-parser-common.Tpo -c -o dbus_daemon_launch_helper_test-config-parser-common.o `test -f 'config-parser-common.c' || echo '$(srcdir)/'`config-parser-common.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dbus_daemon_launch_helper_test-config-parser-common.Tpo $(DEPDIR)/dbus_daemon_launch_helper_test-config-parser-common.Po
@@ -1213,6 +1113,104 @@ dbus_daemon_launch_helper_test-activation-helper.obj: activation-helper.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dbus_daemon_launch_helper_test-activation-helper.obj `if test -f 'activation-helper.c'; then $(CYGPATH_W) 'activation-helper.c'; else $(CYGPATH_W) '$(srcdir)/activation-helper.c'; fi`
+test_bus_launch_helper-test-launch-helper.o: test-launch-helper.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bus_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_bus_launch_helper-test-launch-helper.o -MD -MP -MF $(DEPDIR)/test_bus_launch_helper-test-launch-helper.Tpo -c -o test_bus_launch_helper-test-launch-helper.o `test -f 'test-launch-helper.c' || echo '$(srcdir)/'`test-launch-helper.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_bus_launch_helper-test-launch-helper.Tpo $(DEPDIR)/test_bus_launch_helper-test-launch-helper.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-launch-helper.c' object='test_bus_launch_helper-test-launch-helper.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bus_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_bus_launch_helper-test-launch-helper.o `test -f 'test-launch-helper.c' || echo '$(srcdir)/'`test-launch-helper.c
+
+test_bus_launch_helper-test-launch-helper.obj: test-launch-helper.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bus_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_bus_launch_helper-test-launch-helper.obj -MD -MP -MF $(DEPDIR)/test_bus_launch_helper-test-launch-helper.Tpo -c -o test_bus_launch_helper-test-launch-helper.obj `if test -f 'test-launch-helper.c'; then $(CYGPATH_W) 'test-launch-helper.c'; else $(CYGPATH_W) '$(srcdir)/test-launch-helper.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_bus_launch_helper-test-launch-helper.Tpo $(DEPDIR)/test_bus_launch_helper-test-launch-helper.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-launch-helper.c' object='test_bus_launch_helper-test-launch-helper.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bus_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_bus_launch_helper-test-launch-helper.obj `if test -f 'test-launch-helper.c'; then $(CYGPATH_W) 'test-launch-helper.c'; else $(CYGPATH_W) '$(srcdir)/test-launch-helper.c'; fi`
+
+test_bus_launch_helper-config-loader-expat.o: config-loader-expat.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bus_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_bus_launch_helper-config-loader-expat.o -MD -MP -MF $(DEPDIR)/test_bus_launch_helper-config-loader-expat.Tpo -c -o test_bus_launch_helper-config-loader-expat.o `test -f 'config-loader-expat.c' || echo '$(srcdir)/'`config-loader-expat.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_bus_launch_helper-config-loader-expat.Tpo $(DEPDIR)/test_bus_launch_helper-config-loader-expat.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config-loader-expat.c' object='test_bus_launch_helper-config-loader-expat.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bus_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_bus_launch_helper-config-loader-expat.o `test -f 'config-loader-expat.c' || echo '$(srcdir)/'`config-loader-expat.c
+
+test_bus_launch_helper-config-loader-expat.obj: config-loader-expat.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bus_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_bus_launch_helper-config-loader-expat.obj -MD -MP -MF $(DEPDIR)/test_bus_launch_helper-config-loader-expat.Tpo -c -o test_bus_launch_helper-config-loader-expat.obj `if test -f 'config-loader-expat.c'; then $(CYGPATH_W) 'config-loader-expat.c'; else $(CYGPATH_W) '$(srcdir)/config-loader-expat.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_bus_launch_helper-config-loader-expat.Tpo $(DEPDIR)/test_bus_launch_helper-config-loader-expat.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config-loader-expat.c' object='test_bus_launch_helper-config-loader-expat.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bus_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_bus_launch_helper-config-loader-expat.obj `if test -f 'config-loader-expat.c'; then $(CYGPATH_W) 'config-loader-expat.c'; else $(CYGPATH_W) '$(srcdir)/config-loader-expat.c'; fi`
+
+test_bus_launch_helper-config-parser-common.o: config-parser-common.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bus_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_bus_launch_helper-config-parser-common.o -MD -MP -MF $(DEPDIR)/test_bus_launch_helper-config-parser-common.Tpo -c -o test_bus_launch_helper-config-parser-common.o `test -f 'config-parser-common.c' || echo '$(srcdir)/'`config-parser-common.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_bus_launch_helper-config-parser-common.Tpo $(DEPDIR)/test_bus_launch_helper-config-parser-common.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config-parser-common.c' object='test_bus_launch_helper-config-parser-common.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bus_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_bus_launch_helper-config-parser-common.o `test -f 'config-parser-common.c' || echo '$(srcdir)/'`config-parser-common.c
+
+test_bus_launch_helper-config-parser-common.obj: config-parser-common.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bus_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_bus_launch_helper-config-parser-common.obj -MD -MP -MF $(DEPDIR)/test_bus_launch_helper-config-parser-common.Tpo -c -o test_bus_launch_helper-config-parser-common.obj `if test -f 'config-parser-common.c'; then $(CYGPATH_W) 'config-parser-common.c'; else $(CYGPATH_W) '$(srcdir)/config-parser-common.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_bus_launch_helper-config-parser-common.Tpo $(DEPDIR)/test_bus_launch_helper-config-parser-common.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config-parser-common.c' object='test_bus_launch_helper-config-parser-common.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bus_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_bus_launch_helper-config-parser-common.obj `if test -f 'config-parser-common.c'; then $(CYGPATH_W) 'config-parser-common.c'; else $(CYGPATH_W) '$(srcdir)/config-parser-common.c'; fi`
+
+test_bus_launch_helper-config-parser-trivial.o: config-parser-trivial.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bus_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_bus_launch_helper-config-parser-trivial.o -MD -MP -MF $(DEPDIR)/test_bus_launch_helper-config-parser-trivial.Tpo -c -o test_bus_launch_helper-config-parser-trivial.o `test -f 'config-parser-trivial.c' || echo '$(srcdir)/'`config-parser-trivial.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_bus_launch_helper-config-parser-trivial.Tpo $(DEPDIR)/test_bus_launch_helper-config-parser-trivial.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config-parser-trivial.c' object='test_bus_launch_helper-config-parser-trivial.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bus_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_bus_launch_helper-config-parser-trivial.o `test -f 'config-parser-trivial.c' || echo '$(srcdir)/'`config-parser-trivial.c
+
+test_bus_launch_helper-config-parser-trivial.obj: config-parser-trivial.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bus_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_bus_launch_helper-config-parser-trivial.obj -MD -MP -MF $(DEPDIR)/test_bus_launch_helper-config-parser-trivial.Tpo -c -o test_bus_launch_helper-config-parser-trivial.obj `if test -f 'config-parser-trivial.c'; then $(CYGPATH_W) 'config-parser-trivial.c'; else $(CYGPATH_W) '$(srcdir)/config-parser-trivial.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_bus_launch_helper-config-parser-trivial.Tpo $(DEPDIR)/test_bus_launch_helper-config-parser-trivial.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config-parser-trivial.c' object='test_bus_launch_helper-config-parser-trivial.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bus_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_bus_launch_helper-config-parser-trivial.obj `if test -f 'config-parser-trivial.c'; then $(CYGPATH_W) 'config-parser-trivial.c'; else $(CYGPATH_W) '$(srcdir)/config-parser-trivial.c'; fi`
+
+test_bus_launch_helper-desktop-file.o: desktop-file.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bus_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_bus_launch_helper-desktop-file.o -MD -MP -MF $(DEPDIR)/test_bus_launch_helper-desktop-file.Tpo -c -o test_bus_launch_helper-desktop-file.o `test -f 'desktop-file.c' || echo '$(srcdir)/'`desktop-file.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_bus_launch_helper-desktop-file.Tpo $(DEPDIR)/test_bus_launch_helper-desktop-file.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='desktop-file.c' object='test_bus_launch_helper-desktop-file.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bus_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_bus_launch_helper-desktop-file.o `test -f 'desktop-file.c' || echo '$(srcdir)/'`desktop-file.c
+
+test_bus_launch_helper-desktop-file.obj: desktop-file.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bus_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_bus_launch_helper-desktop-file.obj -MD -MP -MF $(DEPDIR)/test_bus_launch_helper-desktop-file.Tpo -c -o test_bus_launch_helper-desktop-file.obj `if test -f 'desktop-file.c'; then $(CYGPATH_W) 'desktop-file.c'; else $(CYGPATH_W) '$(srcdir)/desktop-file.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_bus_launch_helper-desktop-file.Tpo $(DEPDIR)/test_bus_launch_helper-desktop-file.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='desktop-file.c' object='test_bus_launch_helper-desktop-file.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bus_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_bus_launch_helper-desktop-file.obj `if test -f 'desktop-file.c'; then $(CYGPATH_W) 'desktop-file.c'; else $(CYGPATH_W) '$(srcdir)/desktop-file.c'; fi`
+
+test_bus_launch_helper-utils.o: utils.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bus_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_bus_launch_helper-utils.o -MD -MP -MF $(DEPDIR)/test_bus_launch_helper-utils.Tpo -c -o test_bus_launch_helper-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_bus_launch_helper-utils.Tpo $(DEPDIR)/test_bus_launch_helper-utils.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utils.c' object='test_bus_launch_helper-utils.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bus_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_bus_launch_helper-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c
+
+test_bus_launch_helper-utils.obj: utils.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bus_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_bus_launch_helper-utils.obj -MD -MP -MF $(DEPDIR)/test_bus_launch_helper-utils.Tpo -c -o test_bus_launch_helper-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_bus_launch_helper-utils.Tpo $(DEPDIR)/test_bus_launch_helper-utils.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utils.c' object='test_bus_launch_helper-utils.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bus_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_bus_launch_helper-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi`
+
+test_bus_launch_helper-activation-helper.o: activation-helper.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bus_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_bus_launch_helper-activation-helper.o -MD -MP -MF $(DEPDIR)/test_bus_launch_helper-activation-helper.Tpo -c -o test_bus_launch_helper-activation-helper.o `test -f 'activation-helper.c' || echo '$(srcdir)/'`activation-helper.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_bus_launch_helper-activation-helper.Tpo $(DEPDIR)/test_bus_launch_helper-activation-helper.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='activation-helper.c' object='test_bus_launch_helper-activation-helper.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bus_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_bus_launch_helper-activation-helper.o `test -f 'activation-helper.c' || echo '$(srcdir)/'`activation-helper.c
+
+test_bus_launch_helper-activation-helper.obj: activation-helper.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bus_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_bus_launch_helper-activation-helper.obj -MD -MP -MF $(DEPDIR)/test_bus_launch_helper-activation-helper.Tpo -c -o test_bus_launch_helper-activation-helper.obj `if test -f 'activation-helper.c'; then $(CYGPATH_W) 'activation-helper.c'; else $(CYGPATH_W) '$(srcdir)/activation-helper.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_bus_launch_helper-activation-helper.Tpo $(DEPDIR)/test_bus_launch_helper-activation-helper.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='activation-helper.c' object='test_bus_launch_helper-activation-helper.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_bus_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_bus_launch_helper-activation-helper.obj `if test -f 'activation-helper.c'; then $(CYGPATH_W) 'activation-helper.c'; else $(CYGPATH_W) '$(srcdir)/activation-helper.c'; fi`
+
mostlyclean-libtool:
-rm -f *.lo
@@ -1282,26 +1280,15 @@ uninstall-systemdsystemunitDATA:
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(systemdsystemunitdir)'; $(am__uninstall_files_from_dir)
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
+ $(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
@@ -1313,15 +1300,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$$unique; \
fi; \
fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
@@ -1330,6 +1313,21 @@ GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -1483,24 +1481,24 @@ uninstall-am: uninstall-agentDATA uninstall-binSCRIPTS \
.MAKE: install-am install-data-am install-exec-am install-strip
-.PHONY: CTAGS GTAGS all all-am check check-am clean \
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
clean-dbus_daemon_execPROGRAMS clean-generic \
clean-libexecPROGRAMS clean-libtool clean-local \
- clean-noinstPROGRAMS ctags distclean distclean-compile \
- distclean-generic distclean-libtool distclean-tags distdir dvi \
- dvi-am html html-am info info-am install install-agentDATA \
- install-am install-binSCRIPTS install-configDATA install-data \
- install-data-am install-data-hook \
- install-dbus_daemon_execPROGRAMS install-dvi install-dvi-am \
- install-exec install-exec-am install-exec-hook install-html \
- install-html-am install-info install-info-am \
+ clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-agentDATA install-am install-binSCRIPTS \
+ install-configDATA install-data install-data-am \
+ install-data-hook install-dbus_daemon_execPROGRAMS install-dvi \
+ install-dvi-am install-exec install-exec-am install-exec-hook \
+ install-html install-html-am install-info install-info-am \
install-initdSCRIPTS install-libexecPROGRAMS install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip install-systemdsystemunitDATA installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags uninstall uninstall-agentDATA uninstall-am \
+ tags tags-am uninstall uninstall-agentDATA uninstall-am \
uninstall-binSCRIPTS uninstall-configDATA \
uninstall-dbus_daemon_execPROGRAMS uninstall-initdSCRIPTS \
uninstall-libexecPROGRAMS uninstall-systemdsystemunitDATA
diff --git a/bus/activation-helper-bin.c b/bus/activation-helper-bin.c
index a360acc7..f5f16d2c 100644
--- a/bus/activation-helper-bin.c
+++ b/bus/activation-helper-bin.c
@@ -45,6 +45,9 @@ convert_error_to_exit_code (DBusError *error)
return BUS_SPAWN_EXIT_CODE_SETUP_FAILED;
if (dbus_error_has_name (error, DBUS_ERROR_SPAWN_SERVICE_INVALID))
+ return BUS_SPAWN_EXIT_CODE_NAME_INVALID;
+
+ if (dbus_error_has_name (error, DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND))
return BUS_SPAWN_EXIT_CODE_SERVICE_NOT_FOUND;
if (dbus_error_has_name (error, DBUS_ERROR_SPAWN_PERMISSIONS_INVALID))
@@ -65,7 +68,7 @@ convert_error_to_exit_code (DBusError *error)
/* should we assert? */
fprintf(stderr, "%s: %s\n", error->name, error->message);
- return BUS_SPAWN_EXIT_CODE_SETUP_FAILED;
+ return BUS_SPAWN_EXIT_CODE_GENERIC_FAILURE;
}
int
diff --git a/bus/activation-helper.c b/bus/activation-helper.c
index 8d7ae36f..394f3938 100644
--- a/bus/activation-helper.c
+++ b/bus/activation-helper.c
@@ -40,6 +40,7 @@
#include <pwd.h>
#include <grp.h>
+#include <dbus/dbus-misc.h>
#include <dbus/dbus-shell.h>
#include <dbus/dbus-marshal-validate.h>
@@ -156,8 +157,8 @@ clear_environment (DBusError *error)
}
/* Ensure the bus is set to system */
- _dbus_setenv ("DBUS_STARTER_ADDRESS", DBUS_SYSTEM_BUS_DEFAULT_ADDRESS);
- _dbus_setenv ("DBUS_STARTER_BUS_TYPE", "system");
+ dbus_setenv ("DBUS_STARTER_ADDRESS", DBUS_SYSTEM_BUS_DEFAULT_ADDRESS);
+ dbus_setenv ("DBUS_STARTER_BUS_TYPE", "system");
#endif
return TRUE;
@@ -371,7 +372,7 @@ check_bus_name (const char *bus_name,
_dbus_string_init_const (&str, bus_name);
if (!_dbus_validate_bus_name (&str, 0, _dbus_string_get_length (&str)))
{
- dbus_set_error (error, DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND,
+ dbus_set_error (error, DBUS_ERROR_SPAWN_SERVICE_INVALID,
"bus name '%s' is not a valid bus name\n",
bus_name);
return FALSE;
diff --git a/bus/activation.c b/bus/activation.c
index 3dfba787..ecd19bb4 100644
--- a/bus/activation.c
+++ b/bus/activation.c
@@ -80,7 +80,14 @@ typedef struct BusPendingActivationEntry BusPendingActivationEntry;
struct BusPendingActivationEntry
{
+ /* Normally a method call, but if connection is NULL, this is a signal
+ * instead.
+ */
DBusMessage *activation_message;
+ /* NULL if this activation entry is for the dbus-daemon itself,
+ * waiting for systemd to start. In this case, auto_activation is always
+ * TRUE.
+ */
DBusConnection *connection;
dbus_bool_t auto_activation;
@@ -1106,7 +1113,8 @@ bus_activation_service_created (BusActivation *activation,
BusPendingActivationEntry *entry = link->data;
DBusList *next = _dbus_list_get_next_link (&pending_activation->entries, link);
- if (dbus_connection_get_is_connected (entry->connection))
+ /* entry->connection is NULL for activating systemd */
+ if (entry->connection && dbus_connection_get_is_connected (entry->connection))
{
/* Only send activation replies to regular activation requests. */
if (!entry->auto_activation)
@@ -1154,14 +1162,11 @@ bus_activation_service_created (BusActivation *activation,
dbus_bool_t
bus_activation_send_pending_auto_activation_messages (BusActivation *activation,
BusService *service,
- BusTransaction *transaction,
- DBusError *error)
+ BusTransaction *transaction)
{
BusPendingActivation *pending_activation;
DBusList *link;
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
/* Check if it's a pending activation */
pending_activation = _dbus_hash_table_lookup_string (activation->pending_activations,
bus_service_get_name (service));
@@ -1175,9 +1180,12 @@ bus_activation_send_pending_auto_activation_messages (BusActivation *activation
BusPendingActivationEntry *entry = link->data;
DBusList *next = _dbus_list_get_next_link (&pending_activation->entries, link);
- if (entry->auto_activation && dbus_connection_get_is_connected (entry->connection))
+ if (entry->auto_activation && (entry->connection == NULL || dbus_connection_get_is_connected (entry->connection)))
{
DBusConnection *addressed_recipient;
+ DBusError error;
+
+ dbus_error_init (&error);
addressed_recipient = bus_service_get_primary_owners_connection (service);
@@ -1185,8 +1193,22 @@ bus_activation_send_pending_auto_activation_messages (BusActivation *activation
if (!bus_dispatch_matches (transaction,
entry->connection,
addressed_recipient,
- entry->activation_message, error))
- goto error;
+ entry->activation_message, &error))
+ {
+ /* If permission is denied, we just want to return the error
+ * to the original method invoker; in particular, we don't
+ * want to make the RequestName call fail with that error
+ * (see fd.o #78979, CVE-2014-3477). */
+ if (!bus_transaction_send_error_reply (transaction, entry->connection,
+ &error, entry->activation_message))
+ {
+ bus_connection_send_oom_error (entry->connection,
+ entry->activation_message);
+ }
+
+ link = next;
+ continue;
+ }
}
link = next;
@@ -1195,7 +1217,6 @@ bus_activation_send_pending_auto_activation_messages (BusActivation *activation
if (!add_restore_pending_to_transaction (transaction, pending_activation))
{
_dbus_verbose ("Could not add cancel hook to transaction to revert removing pending activation\n");
- BUS_SET_OOM (error);
goto error;
}
@@ -1233,7 +1254,7 @@ try_send_activation_failure (BusPendingActivation *pending_activation,
BusPendingActivationEntry *entry = link->data;
DBusList *next = _dbus_list_get_next_link (&pending_activation->entries, link);
- if (dbus_connection_get_is_connected (entry->connection))
+ if (entry->connection && dbus_connection_get_is_connected (entry->connection))
{
if (!bus_transaction_send_error_reply (transaction,
entry->connection,
@@ -1281,6 +1302,10 @@ handle_servicehelper_exit_error (int exit_code,
{
switch (exit_code)
{
+ case BUS_SPAWN_EXIT_CODE_CONFIG_INVALID:
+ dbus_set_error (error, DBUS_ERROR_SPAWN_CONFIG_INVALID,
+ "Invalid configuration (missing or empty <user>?)");
+ break;
case BUS_SPAWN_EXIT_CODE_NO_MEMORY:
dbus_set_error (error, DBUS_ERROR_NO_MEMORY,
"Launcher could not run (out of memory)");
@@ -1317,6 +1342,7 @@ handle_servicehelper_exit_error (int exit_code,
dbus_set_error (error, DBUS_ERROR_SPAWN_CHILD_SIGNALED,
"Launched child was signaled, it probably crashed");
break;
+ case BUS_SPAWN_EXIT_CODE_GENERIC_FAILURE:
default:
dbus_set_error (error, DBUS_ERROR_SPAWN_CHILD_EXITED,
"Launch helper exited with unknown return code %i", exit_code);
@@ -1662,6 +1688,31 @@ out:
return retval;
}
+static void
+child_setup (void *user_data)
+{
+#ifdef DBUS_UNIX
+ BusActivation *activation = user_data;
+ DBusRLimit *initial_fd_limit;
+ DBusError error;
+
+ dbus_error_init (&error);
+ initial_fd_limit = bus_context_get_initial_fd_limit (activation->context);
+
+ if (initial_fd_limit != NULL &&
+ !_dbus_rlimit_restore_fd_limit (initial_fd_limit, &error))
+ {
+ /* unfortunately we don't actually know the service name here */
+ bus_context_log (activation->context,
+ DBUS_SYSTEM_LOG_INFO,
+ "Failed to reset fd limit before activating "
+ "service: %s: %s",
+ error.name, error.message);
+ }
+#endif
+}
+
+
dbus_bool_t
bus_activation_activate_service (BusActivation *activation,
DBusConnection *connection,
@@ -1759,7 +1810,8 @@ bus_activation_activate_service (BusActivation *activation,
pending_activation_entry->activation_message = activation_message;
dbus_message_ref (activation_message);
pending_activation_entry->connection = connection;
- dbus_connection_ref (connection);
+ if (connection)
+ dbus_connection_ref (connection);
/* Check if the service is being activated */
pending_activation = _dbus_hash_table_lookup_string (activation->pending_activations, service_name);
@@ -1972,7 +2024,7 @@ bus_activation_activate_service (BusActivation *activation,
service_name,
entry->systemd_service);
/* systemd is not around, let's "activate" it. */
- retval = bus_activation_activate_service (activation, connection, activation_transaction, TRUE,
+ retval = bus_activation_activate_service (activation, NULL, activation_transaction, TRUE,
message, "org.freedesktop.systemd1", error);
}
@@ -2090,9 +2142,12 @@ bus_activation_activate_service (BusActivation *activation,
dbus_error_init (&tmp_error);
- if (!_dbus_spawn_async_with_babysitter (&pending_activation->babysitter, argv,
+ if (!_dbus_spawn_async_with_babysitter (&pending_activation->babysitter,
+ service_name,
+ argv,
envp,
- NULL, activation,
+ child_setup,
+ activation,
&tmp_error))
{
_dbus_verbose ("Failed to spawn child\n");
@@ -2170,7 +2225,7 @@ bus_activation_list_services (BusActivation *activation,
error:
for (j = 0; j < i; j++)
- dbus_free (retval[i]);
+ dbus_free (retval[j]);
dbus_free (retval);
return FALSE;
@@ -2223,7 +2278,7 @@ dbus_activation_systemd_failure (BusActivation *activation,
return TRUE;
}
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#include <stdio.h>
@@ -2530,11 +2585,17 @@ dbus_bool_t
bus_activation_service_reload_test (const DBusString *test_data_dir)
{
DBusString directory;
+ const char *tmp;
if (!_dbus_string_init (&directory))
return FALSE;
- if (!_dbus_string_append (&directory, _dbus_get_tmpdir()))
+ tmp = _dbus_get_tmpdir ();
+
+ if (tmp == NULL)
+ return FALSE;
+
+ if (!_dbus_string_append (&directory, tmp))
return FALSE;
if (!_dbus_string_append (&directory, "/dbus-reload-test-") ||
@@ -2570,4 +2631,4 @@ bus_activation_service_reload_test (const DBusString *test_data_dir)
return TRUE;
}
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/bus/activation.h b/bus/activation.h
index 97f25b1f..fc5d426f 100644
--- a/bus/activation.h
+++ b/bus/activation.h
@@ -62,8 +62,7 @@ dbus_bool_t dbus_activation_systemd_failure (BusActivation *activation,
dbus_bool_t bus_activation_send_pending_auto_activation_messages (BusActivation *activation,
BusService *service,
- BusTransaction *transaction,
- DBusError *error);
+ BusTransaction *transaction);
#endif /* BUS_ACTIVATION_H */
diff --git a/bus/bus.c b/bus/bus.c
index e80e7080..f0d980e5 100644
--- a/bus/bus.c
+++ b/bus/bus.c
@@ -39,6 +39,7 @@
#include <dbus/dbus-hash.h>
#include <dbus/dbus-credentials.h>
#include <dbus/dbus-internals.h>
+#include <dbus/dbus-server-protected.h>
#ifdef DBUS_CYGWIN
#include <signal.h>
@@ -63,11 +64,13 @@ struct BusContext
BusPolicy *policy;
BusMatchmaker *matchmaker;
BusLimits limits;
+ DBusRLimit *initial_fd_limit;
unsigned int fork : 1;
unsigned int syslog : 1;
unsigned int keep_umask : 1;
unsigned int allow_anonymous : 1;
unsigned int systemd_activation : 1;
+ dbus_bool_t watches_enabled;
};
static dbus_int32_t server_data_slot = -1;
@@ -287,7 +290,7 @@ process_config_first_time_only (BusContext *context,
auth_mechanisms = NULL;
pidfile = NULL;
- _dbus_init_system_log ();
+ _dbus_init_system_log (TRUE);
if (flags & BUS_CONTEXT_FLAG_SYSTEMD_ACTIVATION)
context->systemd_activation = TRUE;
@@ -526,6 +529,18 @@ process_config_every_time (BusContext *context,
context->policy = bus_config_parser_steal_policy (parser);
_dbus_assert (context->policy != NULL);
+ /* context->connections is NULL when creating new BusContext */
+ if (context->connections)
+ {
+ _dbus_verbose ("Reload policy rules for completed connections\n");
+ retval = bus_connections_reload_policy (context->connections, error);
+ if (!retval)
+ {
+ _DBUS_ASSERT_ERROR_IS_SET (error);
+ goto failed;
+ }
+ }
+
/* We have to build the address backward, so that
* <listen> later in the config file have priority
*/
@@ -645,19 +660,38 @@ oom:
static void
raise_file_descriptor_limit (BusContext *context)
{
+#ifdef DBUS_UNIX
+ DBusError error = DBUS_ERROR_INIT;
- /* I just picked this out of thin air; we need some extra
- * descriptors for things like any internal pipes we create,
- * inotify, connections to SELinux, etc.
- */
- unsigned int arbitrary_extra_fds = 32;
- unsigned int limit;
+ /* we only do this once */
+ if (context->initial_fd_limit != NULL)
+ return;
- limit = context->limits.max_completed_connections +
- context->limits.max_incomplete_connections
- + arbitrary_extra_fds;
+ context->initial_fd_limit = _dbus_rlimit_save_fd_limit (&error);
+
+ if (context->initial_fd_limit == NULL)
+ {
+ bus_context_log (context, DBUS_SYSTEM_LOG_INFO,
+ "%s: %s", error.name, error.message);
+ dbus_error_free (&error);
+ return;
+ }
- _dbus_request_file_descriptor_limit (limit);
+ /* We used to compute a suitable rlimit based on the configured number
+ * of connections, but that breaks down as soon as we allow fd-passing,
+ * because each connection is allowed to pass 64 fds to us, and if
+ * they all did, we'd hit kernel limits. We now hard-code 64k as a
+ * good limit, like systemd does: that's enough to avoid DoS from
+ * anything short of multiple uids conspiring against us.
+ */
+ if (!_dbus_rlimit_raise_fd_limit_if_privileged (65536, &error))
+ {
+ bus_context_log (context, DBUS_SYSTEM_LOG_INFO,
+ "%s: %s", error.name, error.message);
+ dbus_error_free (&error);
+ return;
+ }
+#endif
}
static dbus_bool_t
@@ -746,6 +780,8 @@ bus_context_new (const DBusString *config_file,
goto failed;
}
+ context->watches_enabled = TRUE;
+
context->registry = bus_registry_new (context);
if (context->registry == NULL)
{
@@ -894,7 +930,7 @@ bus_context_new (const DBusString *config_file,
if (!bus_selinux_full_init ())
{
- bus_context_log (context, DBUS_SYSTEM_LOG_FATAL, "SELinux enabled but AVC initialization failed; check system log\n");
+ bus_context_log (context, DBUS_SYSTEM_LOG_FATAL, "SELinux enabled but D-Bus initialization failed; check system log\n");
}
if (!process_config_postinit (context, parser, error))
@@ -1114,6 +1150,10 @@ bus_context_unref (BusContext *context)
dbus_free (context->pidfile);
}
+
+ if (context->initial_fd_limit)
+ _dbus_rlimit_free (context->initial_fd_limit);
+
dbus_free (context);
dbus_server_free_data_slot (&server_data_slot);
@@ -1225,6 +1265,12 @@ bus_context_get_auth_timeout (BusContext *context)
}
int
+bus_context_get_pending_fd_timeout (BusContext *context)
+{
+ return context->limits.pending_fd_timeout;
+}
+
+int
bus_context_get_max_completed_connections (BusContext *context)
{
return context->limits.max_completed_connections;
@@ -1272,6 +1318,12 @@ bus_context_get_reply_timeout (BusContext *context)
return context->limits.reply_timeout;
}
+DBusRLimit *
+bus_context_get_initial_fd_limit (BusContext *context)
+{
+ return context->initial_fd_limit;
+}
+
void
bus_context_log (BusContext *context, DBusSystemLogSeverity severity, const char *msg, ...) _DBUS_GNUC_PRINTF (3, 4);
@@ -1608,7 +1660,7 @@ bus_context_check_security_policy (BusContext *context,
complain_about_message (context, DBUS_ERROR_ACCESS_DENIED,
"Rejected receive message", toggles,
message, sender, proposed_recipient, requested_reply,
- (addressed_recipient == proposed_recipient), NULL);
+ (addressed_recipient == proposed_recipient), error);
_dbus_verbose ("security policy disallowing message due to recipient policy\n");
return FALSE;
}
@@ -1646,3 +1698,36 @@ bus_context_check_security_policy (BusContext *context,
_dbus_verbose ("security policy allowing message\n");
return TRUE;
}
+
+void
+bus_context_check_all_watches (BusContext *context)
+{
+ DBusList *link;
+ dbus_bool_t enabled = TRUE;
+
+ if (bus_connections_get_n_incomplete (context->connections) >=
+ bus_context_get_max_incomplete_connections (context))
+ {
+ enabled = FALSE;
+ }
+
+ if (context->watches_enabled == enabled)
+ return;
+
+ context->watches_enabled = enabled;
+
+ for (link = _dbus_list_get_first_link (&context->servers);
+ link != NULL;
+ link = _dbus_list_get_next_link (&context->servers, link))
+ {
+ /* A BusContext might contains several DBusServer (if there are
+ * several <listen> configuration items) and a DBusServer might
+ * contain several DBusWatch in its DBusWatchList (if getaddrinfo
+ * returns several addresses on a dual IPv4-IPv6 stack or if
+ * systemd passes several fds).
+ * We want to enable/disable them all.
+ */
+ DBusServer *server = link->data;
+ _dbus_server_toggle_all_watches (server, enabled);
+ }
+}
diff --git a/bus/bus.h b/bus/bus.h
index 35978841..dac6ea5e 100644
--- a/bus/bus.h
+++ b/bus/bus.h
@@ -54,6 +54,7 @@ typedef struct
long max_message_unix_fds; /**< Max number of unix fds of a single message*/
int activation_timeout; /**< How long to wait for an activation to time out */
int auth_timeout; /**< How long to wait for an authentication to time out */
+ int pending_fd_timeout; /**< How long to wait for a D-Bus message with a fd to time out */
int max_completed_connections; /**< Max number of authorized connections */
int max_incomplete_connections; /**< Max number of incomplete connections */
int max_connections_per_user; /**< Max number of connections auth'd as same user */
@@ -106,6 +107,7 @@ BusClientPolicy* bus_context_create_client_policy (BusContext
DBusError *error);
int bus_context_get_activation_timeout (BusContext *context);
int bus_context_get_auth_timeout (BusContext *context);
+int bus_context_get_pending_fd_timeout (BusContext *context);
int bus_context_get_max_completed_connections (BusContext *context);
int bus_context_get_max_incomplete_connections (BusContext *context);
int bus_context_get_max_connections_per_user (BusContext *context);
@@ -114,6 +116,7 @@ int bus_context_get_max_services_per_connection (BusContext
int bus_context_get_max_match_rules_per_connection (BusContext *context);
int bus_context_get_max_replies_per_connection (BusContext *context);
int bus_context_get_reply_timeout (BusContext *context);
+DBusRLimit * bus_context_get_initial_fd_limit (BusContext *context);
void bus_context_log (BusContext *context,
DBusSystemLogSeverity severity,
const char *msg,
@@ -125,5 +128,6 @@ dbus_bool_t bus_context_check_security_policy (BusContext
DBusConnection *proposed_recipient,
DBusMessage *message,
DBusError *error);
+void bus_context_check_all_watches (BusContext *context);
#endif /* BUS_BUS_H */
diff --git a/bus/config-loader-libxml.c b/bus/config-loader-libxml.c
deleted file mode 100644
index c73a1815..00000000
--- a/bus/config-loader-libxml.c
+++ /dev/null
@@ -1,324 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* config-loader-libxml.c libxml2 XML loader
- *
- * Copyright (C) 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-#include "config-parser.h"
-#include <dbus/dbus-internals.h>
-#include <libxml/xmlreader.h>
-#include <libxml/parser.h>
-#include <libxml/globals.h>
-#include <libxml/xmlmemory.h>
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-#include <string.h>
-
-/* About the error handling:
- * - setup a "structured" error handler that catches structural
- * errors and some oom errors
- * - assume that a libxml function returning an error code means
- * out-of-memory
- */
-#define _DBUS_MAYBE_SET_OOM(e) (dbus_error_is_set(e) ? (void)0 : _DBUS_SET_OOM(e))
-
-
-static dbus_bool_t
-xml_text_start_element (BusConfigParser *parser,
- xmlTextReader *reader,
- DBusError *error)
-{
- const char *name;
- int n_attributes;
- const char **attribute_names, **attribute_values;
- dbus_bool_t ret;
- int i, status, is_empty;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- ret = FALSE;
- attribute_names = NULL;
- attribute_values = NULL;
-
- name = xmlTextReaderConstName (reader);
- n_attributes = xmlTextReaderAttributeCount (reader);
- is_empty = xmlTextReaderIsEmptyElement (reader);
-
- if (name == NULL || n_attributes < 0 || is_empty == -1)
- {
- _DBUS_MAYBE_SET_OOM (error);
- goto out;
- }
-
- attribute_names = dbus_new0 (const char *, n_attributes + 1);
- attribute_values = dbus_new0 (const char *, n_attributes + 1);
- if (attribute_names == NULL || attribute_values == NULL)
- {
- _DBUS_SET_OOM (error);
- goto out;
- }
- i = 0;
- while ((status = xmlTextReaderMoveToNextAttribute (reader)) == 1)
- {
- _dbus_assert (i < n_attributes);
- attribute_names[i] = xmlTextReaderConstName (reader);
- attribute_values[i] = xmlTextReaderConstValue (reader);
- if (attribute_names[i] == NULL || attribute_values[i] == NULL)
- {
- _DBUS_MAYBE_SET_OOM (error);
- goto out;
- }
- i++;
- }
- if (status == -1)
- {
- _DBUS_MAYBE_SET_OOM (error);
- goto out;
- }
- _dbus_assert (i == n_attributes);
-
- ret = bus_config_parser_start_element (parser, name,
- attribute_names, attribute_values,
- error);
- if (ret && is_empty == 1)
- ret = bus_config_parser_end_element (parser, name, error);
-
- out:
- dbus_free (attribute_names);
- dbus_free (attribute_values);
-
- return ret;
-}
-
-static void xml_shut_up (void *ctx, const char *msg, ...)
-{
- return;
-}
-
-static void
-xml_text_reader_error (void *arg, xmlErrorPtr xml_error)
-{
- DBusError *error = arg;
-
-#if 0
- _dbus_verbose ("XML_ERROR level=%d, domain=%d, code=%d, msg=%s\n",
- xml_error->level, xml_error->domain,
- xml_error->code, xml_error->message);
-#endif
-
- if (!dbus_error_is_set (error))
- {
- if (xml_error->code == XML_ERR_NO_MEMORY)
- _DBUS_SET_OOM (error);
- else if (xml_error->level == XML_ERR_ERROR ||
- xml_error->level == XML_ERR_FATAL)
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Error loading config file: '%s'",
- xml_error->message);
- }
-}
-
-
-BusConfigParser*
-bus_config_load (const DBusString *file,
- dbus_bool_t is_toplevel,
- const BusConfigParser *parent,
- DBusError *error)
-
-{
- xmlTextReader *reader;
- BusConfigParser *parser;
- DBusString dirname, data;
- DBusError tmp_error;
- int ret;
-
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- parser = NULL;
- reader = NULL;
-
- if (!_dbus_string_init (&dirname))
- {
- _DBUS_SET_OOM (error);
- return NULL;
- }
-
- if (!_dbus_string_init (&data))
- {
- _DBUS_SET_OOM (error);
- _dbus_string_free (&dirname);
- return NULL;
- }
-
- if (is_toplevel)
- {
- /* xmlMemSetup only fails if one of the functions is NULL */
- xmlMemSetup (dbus_free,
- dbus_malloc,
- dbus_realloc,
- _dbus_strdup);
- xmlInitParser ();
- xmlSetGenericErrorFunc (NULL, xml_shut_up);
- }
-
- if (!_dbus_string_get_dirname (file, &dirname))
- {
- _DBUS_SET_OOM (error);
- goto failed;
- }
-
- parser = bus_config_parser_new (&dirname, is_toplevel, parent);
- if (parser == NULL)
- {
- _DBUS_SET_OOM (error);
- goto failed;
- }
-
- if (!_dbus_file_get_contents (&data, file, error))
- goto failed;
-
- reader = xmlReaderForMemory (_dbus_string_get_const_data (&data),
- _dbus_string_get_length (&data),
- NULL, NULL, 0);
- if (reader == NULL)
- {
- _DBUS_SET_OOM (error);
- goto failed;
- }
-
- xmlTextReaderSetParserProp (reader, XML_PARSER_SUBST_ENTITIES, 1);
-
- dbus_error_init (&tmp_error);
- xmlTextReaderSetStructuredErrorHandler (reader, xml_text_reader_error, &tmp_error);
-
- while ((ret = xmlTextReaderRead (reader)) == 1)
- {
- int type;
-
- if (dbus_error_is_set (&tmp_error))
- goto reader_out;
-
- type = xmlTextReaderNodeType (reader);
- if (type == -1)
- {
- _DBUS_MAYBE_SET_OOM (&tmp_error);
- goto reader_out;
- }
-
- switch ((xmlReaderTypes) type) {
- case XML_READER_TYPE_ELEMENT:
- xml_text_start_element (parser, reader, &tmp_error);
- break;
-
- case XML_READER_TYPE_TEXT:
- case XML_READER_TYPE_CDATA:
- {
- DBusString content;
- const char *value;
- value = xmlTextReaderConstValue (reader);
- if (value != NULL)
- {
- _dbus_string_init_const (&content, value);
- bus_config_parser_content (parser, &content, &tmp_error);
- }
- else
- _DBUS_MAYBE_SET_OOM (&tmp_error);
- break;
- }
-
- case XML_READER_TYPE_DOCUMENT_TYPE:
- {
- const char *name;
- name = xmlTextReaderConstName (reader);
- if (name != NULL)
- bus_config_parser_check_doctype (parser, name, &tmp_error);
- else
- _DBUS_MAYBE_SET_OOM (&tmp_error);
- break;
- }
-
- case XML_READER_TYPE_END_ELEMENT:
- {
- const char *name;
- name = xmlTextReaderConstName (reader);
- if (name != NULL)
- bus_config_parser_end_element (parser, name, &tmp_error);
- else
- _DBUS_MAYBE_SET_OOM (&tmp_error);
- break;
- }
-
- case XML_READER_TYPE_DOCUMENT:
- case XML_READER_TYPE_DOCUMENT_FRAGMENT:
- case XML_READER_TYPE_PROCESSING_INSTRUCTION:
- case XML_READER_TYPE_COMMENT:
- case XML_READER_TYPE_ENTITY:
- case XML_READER_TYPE_NOTATION:
- case XML_READER_TYPE_WHITESPACE:
- case XML_READER_TYPE_SIGNIFICANT_WHITESPACE:
- case XML_READER_TYPE_END_ENTITY:
- case XML_READER_TYPE_XML_DECLARATION:
- /* nothing to do, just read on */
- break;
-
- case XML_READER_TYPE_NONE:
- case XML_READER_TYPE_ATTRIBUTE:
- case XML_READER_TYPE_ENTITY_REFERENCE:
- _dbus_assert_not_reached ("unexpected nodes in XML");
- }
-
- if (dbus_error_is_set (&tmp_error))
- goto reader_out;
- }
-
- if (ret == -1)
- _DBUS_MAYBE_SET_OOM (&tmp_error);
-
- reader_out:
- xmlFreeTextReader (reader);
- reader = NULL;
- if (dbus_error_is_set (&tmp_error))
- {
- dbus_move_error (&tmp_error, error);
- goto failed;
- }
-
- if (!bus_config_parser_finished (parser, error))
- goto failed;
- _dbus_string_free (&dirname);
- _dbus_string_free (&data);
- if (is_toplevel)
- xmlCleanupParser();
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
- return parser;
-
- failed:
- _DBUS_ASSERT_ERROR_IS_SET (error);
- _dbus_string_free (&dirname);
- _dbus_string_free (&data);
- if (is_toplevel)
- xmlCleanupParser();
- if (parser)
- bus_config_parser_unref (parser);
- _dbus_assert (reader == NULL); /* must go to reader_out first */
- return NULL;
-}
diff --git a/bus/config-parser-trivial.c b/bus/config-parser-trivial.c
index 6ef50f8e..64a05c3a 100644
--- a/bus/config-parser-trivial.c
+++ b/bus/config-parser-trivial.c
@@ -330,7 +330,7 @@ bus_config_parser_get_service_dirs (BusConfigParser *parser)
return &parser->service_dirs;
}
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#include <stdio.h>
#include "test.h"
@@ -712,5 +712,5 @@ finish:
return retval;
}
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/bus/config-parser.c b/bus/config-parser.c
index 07e8fbb6..ee2d4e7d 100644
--- a/bus/config-parser.c
+++ b/bus/config-parser.c
@@ -30,6 +30,7 @@
#include "selinux.h"
#include <dbus/dbus-list.h>
#include <dbus/dbus-internals.h>
+#include <dbus/dbus-misc.h>
#include <dbus/dbus-sysdeps.h>
#include <string.h>
@@ -317,13 +318,23 @@ merge_included (BusConfigParser *parser,
if (included->keep_umask)
parser->keep_umask = TRUE;
+ if (included->allow_anonymous)
+ parser->allow_anonymous = TRUE;
+
if (included->pidfile != NULL)
{
dbus_free (parser->pidfile);
parser->pidfile = included->pidfile;
included->pidfile = NULL;
}
-
+
+ if (included->servicehelper != NULL)
+ {
+ dbus_free (parser->servicehelper);
+ parser->servicehelper = included->servicehelper;
+ included->servicehelper = NULL;
+ }
+
while ((link = _dbus_list_pop_first_link (&included->listen_on)))
_dbus_list_append_link (&parser->listen_on, link);
@@ -413,9 +424,9 @@ bus_config_parser_new (const DBusString *basedir,
maximum number of file descriptors we can receive. Picking a
high value here thus translates directly to more memory
allocation. */
- parser->limits.max_incoming_unix_fds = 1024*4;
- parser->limits.max_outgoing_unix_fds = 1024*4;
- parser->limits.max_message_unix_fds = 1024;
+ parser->limits.max_incoming_unix_fds = DBUS_DEFAULT_MESSAGE_UNIX_FDS*4;
+ parser->limits.max_outgoing_unix_fds = DBUS_DEFAULT_MESSAGE_UNIX_FDS*4;
+ parser->limits.max_message_unix_fds = DBUS_DEFAULT_MESSAGE_UNIX_FDS;
/* Making this long means the user has to wait longer for an error
* message if something screws up, but making it too short means
@@ -428,6 +439,11 @@ bus_config_parser_new (const DBusString *basedir,
* password) is allowed, then potentially it has to be quite long.
*/
parser->limits.auth_timeout = 30000; /* 30 seconds */
+
+ /* Do not allow a fd to stay forever in dbus-daemon
+ * https://bugs.freedesktop.org/show_bug.cgi?id=80559
+ */
+ parser->limits.pending_fd_timeout = 150000; /* 2.5 minutes */
parser->limits.max_incomplete_connections = 64;
parser->limits.max_connections_per_user = 256;
@@ -456,7 +472,7 @@ bus_config_parser_new (const DBusString *basedir,
/* this is effectively a limit on message queue size for messages
* that require a reply
*/
- parser->limits.max_replies_per_connection = 1024*8;
+ parser->limits.max_replies_per_connection = 128;
}
parser->refcount = 1;
@@ -1891,6 +1907,12 @@ set_limit (BusConfigParser *parser,
must_be_int = TRUE;
parser->limits.auth_timeout = value;
}
+ else if (strcmp (name, "pending_fd_timeout") == 0)
+ {
+ must_be_positive = TRUE;
+ must_be_int = TRUE;
+ parser->limits.pending_fd_timeout = value;
+ }
else if (strcmp (name, "reply_timeout") == 0)
{
must_be_positive = TRUE;
@@ -2735,7 +2757,7 @@ bus_config_parser_steal_service_context_table (BusConfigParser *parser)
return table;
}
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#include <stdio.h>
typedef enum
@@ -3097,6 +3119,7 @@ limits_equal (const BusLimits *a,
|| a->max_message_unix_fds == b->max_message_unix_fds
|| a->activation_timeout == b->activation_timeout
|| a->auth_timeout == b->auth_timeout
+ || a->pending_fd_timeout == b->pending_fd_timeout
|| a->max_completed_connections == b->max_completed_connections
|| a->max_incomplete_connections == b->max_incomplete_connections
|| a->max_connections_per_user == b->max_connections_per_user
@@ -3410,10 +3433,10 @@ test_default_session_servicedirs (void)
}
#ifdef DBUS_UNIX
- if (!_dbus_setenv ("XDG_DATA_HOME", "/testhome/foo/.testlocal/testshare"))
+ if (!dbus_setenv ("XDG_DATA_HOME", "/testhome/foo/.testlocal/testshare"))
_dbus_assert_not_reached ("couldn't setenv XDG_DATA_HOME");
- if (!_dbus_setenv ("XDG_DATA_DIRS", ":/testusr/testlocal/testshare: :/testusr/testshare:"))
+ if (!dbus_setenv ("XDG_DATA_DIRS", ":/testusr/testlocal/testshare: :/testusr/testshare:"))
_dbus_assert_not_reached ("couldn't setenv XDG_DATA_DIRS");
#endif
if (!_dbus_get_standard_session_servicedirs (&dirs))
@@ -3543,10 +3566,10 @@ test_default_system_servicedirs (void)
}
#ifdef DBUS_UNIX
- if (!_dbus_setenv ("XDG_DATA_HOME", "/testhome/foo/.testlocal/testshare"))
+ if (!dbus_setenv ("XDG_DATA_HOME", "/testhome/foo/.testlocal/testshare"))
_dbus_assert_not_reached ("couldn't setenv XDG_DATA_HOME");
- if (!_dbus_setenv ("XDG_DATA_DIRS", ":/testusr/testlocal/testshare: :/testusr/testshare:"))
+ if (!dbus_setenv ("XDG_DATA_DIRS", ":/testusr/testlocal/testshare: :/testusr/testshare:"))
_dbus_assert_not_reached ("couldn't setenv XDG_DATA_DIRS");
#endif
if (!_dbus_get_standard_system_servicedirs (&dirs))
@@ -3629,5 +3652,5 @@ bus_config_parser_test (const DBusString *test_data_dir)
return TRUE;
}
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/bus/connection.c b/bus/connection.c
index d69758c9..7107434f 100644
--- a/bus/connection.c
+++ b/bus/connection.c
@@ -33,6 +33,7 @@
#include <dbus/dbus-list.h>
#include <dbus/dbus-hash.h>
#include <dbus/dbus-timeout.h>
+#include <dbus/dbus-connection-internal.h>
/* Trim executed commands to this length; we want to keep logs readable */
#define MAX_LOG_COMMAND_LEN 50
@@ -102,6 +103,8 @@ typedef struct
int peak_match_rules;
int peak_bus_names;
#endif
+ int n_pending_unix_fds;
+ DBusTimeout *pending_unix_fds_timeout;
} BusConnectionData;
static dbus_bool_t bus_pending_reply_expired (BusExpireList *list,
@@ -268,6 +271,15 @@ bus_connection_disconnected (DBusConnection *connection)
dbus_connection_set_dispatch_status_function (connection,
NULL, NULL, NULL);
+
+ if (d->pending_unix_fds_timeout)
+ {
+ _dbus_loop_remove_timeout (bus_context_get_loop (d->connections->context),
+ d->pending_unix_fds_timeout);
+ _dbus_timeout_unref (d->pending_unix_fds_timeout);
+ }
+ d->pending_unix_fds_timeout = NULL;
+ _dbus_connection_set_pending_fds_function (connection, NULL, NULL);
bus_connection_remove_transactions (connection);
@@ -293,6 +305,10 @@ bus_connection_disconnected (DBusConnection *connection)
_dbus_list_remove_link (&d->connections->incomplete, d->link_in_connection_list);
d->link_in_connection_list = NULL;
d->connections->n_incomplete -= 1;
+
+ /* If we have dropped below the max. number of incomplete
+ * connections, start accept()ing again */
+ bus_context_check_all_watches (d->connections->context);
}
_dbus_assert (d->connections->n_incomplete >= 0);
@@ -588,6 +604,42 @@ oom:
return FALSE;
}
+static void
+check_pending_fds_cb (DBusConnection *connection)
+{
+ BusConnectionData *d = BUS_CONNECTION_DATA (connection);
+ int n_pending_unix_fds_old = d->n_pending_unix_fds;
+ int n_pending_unix_fds_new;
+
+ n_pending_unix_fds_new = _dbus_connection_get_pending_fds_count (connection);
+
+ _dbus_verbose ("Pending fds count changed on connection %p: %d -> %d\n",
+ connection, n_pending_unix_fds_old, n_pending_unix_fds_new);
+
+ if (n_pending_unix_fds_old == 0 && n_pending_unix_fds_new > 0)
+ {
+ _dbus_timeout_set_interval (d->pending_unix_fds_timeout,
+ bus_context_get_pending_fd_timeout (d->connections->context));
+ _dbus_timeout_set_enabled (d->pending_unix_fds_timeout, TRUE);
+ }
+
+ if (n_pending_unix_fds_old > 0 && n_pending_unix_fds_new == 0)
+ {
+ _dbus_timeout_set_enabled (d->pending_unix_fds_timeout, FALSE);
+ }
+
+
+ d->n_pending_unix_fds = n_pending_unix_fds_new;
+}
+
+static dbus_bool_t
+pending_unix_fds_timeout_cb (void *data)
+{
+ DBusConnection *connection = data;
+ dbus_connection_close (connection);
+ return TRUE;
+}
+
dbus_bool_t
bus_connections_setup_connection (BusConnections *connections,
DBusConnection *connection)
@@ -683,36 +735,38 @@ bus_connections_setup_connection (BusConnections *connections,
}
}
+ /* Setup pending fds timeout (see #80559) */
+ d->pending_unix_fds_timeout = _dbus_timeout_new (100, /* irrelevant */
+ pending_unix_fds_timeout_cb,
+ connection, NULL);
+ if (d->pending_unix_fds_timeout == NULL)
+ goto out;
+
+ _dbus_timeout_set_enabled (d->pending_unix_fds_timeout, FALSE);
+ if (!_dbus_loop_add_timeout (bus_context_get_loop (connections->context),
+ d->pending_unix_fds_timeout))
+ goto out;
+
+ _dbus_connection_set_pending_fds_function (connection,
+ (DBusPendingFdsChangeFunction) check_pending_fds_cb,
+ connection);
+
_dbus_list_append_link (&connections->incomplete, d->link_in_connection_list);
connections->n_incomplete += 1;
dbus_connection_ref (connection);
- /* Note that we might disconnect ourselves here, but it only takes
- * effect on return to the main loop. We call this to free up
- * expired connections if possible, and to queue the timeout for our
- * own expiration.
- */
bus_connections_expire_incomplete (connections);
- /* And we might also disconnect ourselves here, but again it
- * only takes effect on return to main loop.
- */
- if (connections->n_incomplete >
- bus_context_get_max_incomplete_connections (connections->context))
- {
- _dbus_verbose ("Number of incomplete connections exceeds max, dropping oldest one\n");
-
- _dbus_assert (connections->incomplete != NULL);
- /* Disconnect the oldest unauthenticated connection. FIXME
- * would it be more secure to drop a *random* connection? This
- * algorithm seems to mean that if someone can create new
- * connections quickly enough, they can keep anyone else from
- * completing authentication. But random may or may not really
- * help with that, a more elaborate solution might be required.
- */
- dbus_connection_close (connections->incomplete->data);
- }
+ /* The listening socket is removed from the main loop,
+ * i.e. does not accept(), while n_incomplete is at its
+ * maximum value; so we shouldn't get here in that case */
+ _dbus_assert (connections->n_incomplete <=
+ bus_context_get_max_incomplete_connections (connections->context));
+
+ /* If we have the maximum number of incomplete connections,
+ * stop accept()ing any more, to avert a DoS. See fd.o #80919 */
+ bus_context_check_all_watches (d->connections->context);
retval = TRUE;
@@ -744,6 +798,13 @@ bus_connections_setup_connection (BusConnections *connections,
dbus_connection_set_dispatch_status_function (connection,
NULL, NULL, NULL);
+ if (d->pending_unix_fds_timeout)
+ _dbus_timeout_unref (d->pending_unix_fds_timeout);
+
+ d->pending_unix_fds_timeout = NULL;
+
+ _dbus_connection_set_pending_fds_function (connection, NULL, NULL);
+
if (d->link_in_connection_list != NULL)
{
_dbus_assert (d->link_in_connection_list->next == NULL);
@@ -799,6 +860,14 @@ bus_connections_expire_incomplete (BusConnections *connections)
if (elapsed >= (double) auth_timeout)
{
+ /* Unfortunately, we can't identify the connection: it doesn't
+ * have a unique name yet, we don't know its uid/pid yet,
+ * and so on. */
+ bus_context_log (connections->context, DBUS_SYSTEM_LOG_INFO,
+ "Connection has not authenticated soon enough, closing it "
+ "(auth_timeout=%dms, elapsed: %.0fms)",
+ auth_timeout, elapsed);
+
_dbus_verbose ("Timing out authentication for connection %p\n", connection);
dbus_connection_close (connection);
}
@@ -1419,6 +1488,10 @@ bus_connection_complete (DBusConnection *connection,
_dbus_assert (d->connections->n_incomplete >= 0);
_dbus_assert (d->connections->n_completed > 0);
+ /* If we have dropped below the max. number of incomplete
+ * connections, start accept()ing again */
+ bus_context_check_all_watches (d->connections->context);
+
/* See if we can remove the timeout */
bus_connections_expire_incomplete (d->connections);
@@ -1435,6 +1508,42 @@ fail:
return FALSE;
}
+dbus_bool_t
+bus_connections_reload_policy (BusConnections *connections,
+ DBusError *error)
+{
+ BusConnectionData *d;
+ DBusConnection *connection;
+ DBusList *link;
+
+ _dbus_assert (connections != NULL);
+ _DBUS_ASSERT_ERROR_IS_CLEAR (error);
+
+ for (link = _dbus_list_get_first_link (&(connections->completed));
+ link;
+ link = _dbus_list_get_next_link (&(connections->completed), link))
+ {
+ connection = link->data;
+ d = BUS_CONNECTION_DATA (connection);
+ _dbus_assert (d != NULL);
+ _dbus_assert (d->policy != NULL);
+
+ bus_client_policy_unref (d->policy);
+ d->policy = bus_context_create_client_policy (connections->context,
+ connection,
+ error);
+ if (d->policy == NULL)
+ {
+ _dbus_verbose ("Failed to create security policy for connection %p\n",
+ connection);
+ _DBUS_ASSERT_ERROR_IS_SET (error);
+ return FALSE;
+ }
+ }
+
+ return TRUE;
+}
+
const char *
bus_connection_get_name (DBusConnection *connection)
{
@@ -1990,12 +2099,6 @@ bus_transaction_get_context (BusTransaction *transaction)
return transaction->context;
}
-BusConnections*
-bus_transaction_get_connections (BusTransaction *transaction)
-{
- return bus_context_get_connections (transaction->context);
-}
-
dbus_bool_t
bus_transaction_send_from_driver (BusTransaction *transaction,
DBusConnection *connection,
@@ -2126,6 +2229,16 @@ bus_transaction_send (BusTransaction *transaction,
}
static void
+transaction_free (BusTransaction *transaction)
+{
+ _dbus_assert (transaction->connections == NULL);
+
+ free_cancel_hooks (transaction);
+
+ dbus_free (transaction);
+}
+
+static void
connection_cancel_transaction (DBusConnection *connection,
BusTransaction *transaction)
{
@@ -2163,14 +2276,10 @@ bus_transaction_cancel_and_free (BusTransaction *transaction)
while ((connection = _dbus_list_pop_first (&transaction->connections)))
connection_cancel_transaction (connection, transaction);
- _dbus_assert (transaction->connections == NULL);
-
_dbus_list_foreach (&transaction->cancel_hooks,
cancel_hook_cancel, NULL);
- free_cancel_hooks (transaction);
-
- dbus_free (transaction);
+ transaction_free (transaction);
}
static void
@@ -2224,11 +2333,7 @@ bus_transaction_execute_and_free (BusTransaction *transaction)
while ((connection = _dbus_list_pop_first (&transaction->connections)))
connection_execute_transaction (connection, transaction);
- _dbus_assert (transaction->connections == NULL);
-
- free_cancel_hooks (transaction);
-
- dbus_free (transaction);
+ transaction_free (transaction);
}
static void
@@ -2316,7 +2421,6 @@ bus_transaction_add_cancel_hook (BusTransaction *transaction,
return TRUE;
}
-#ifdef DBUS_ENABLE_STATS
int
bus_connections_get_n_active (BusConnections *connections)
{
@@ -2329,6 +2433,7 @@ bus_connections_get_n_incomplete (BusConnections *connections)
return connections->n_incomplete;
}
+#ifdef DBUS_ENABLE_STATS
int
bus_connections_get_total_match_rules (BusConnections *connections)
{
diff --git a/bus/connection.h b/bus/connection.h
index c9360212..6fbcd38d 100644
--- a/bus/connection.h
+++ b/bus/connection.h
@@ -45,6 +45,8 @@ void bus_connections_foreach_active (BusConnections
void *data);
BusContext* bus_connections_get_context (BusConnections *connections);
void bus_connections_increment_stamp (BusConnections *connections);
+dbus_bool_t bus_connections_reload_policy (BusConnections *connections,
+ DBusError *error);
BusContext* bus_connection_get_context (DBusConnection *connection);
BusConnections* bus_connection_get_connections (DBusConnection *connection);
BusRegistry* bus_connection_get_registry (DBusConnection *connection);
@@ -120,7 +122,6 @@ typedef void (* BusTransactionCancelFunction) (void *data);
BusTransaction* bus_transaction_new (BusContext *context);
BusContext* bus_transaction_get_context (BusTransaction *transaction);
-BusConnections* bus_transaction_get_connections (BusTransaction *transaction);
dbus_bool_t bus_transaction_send (BusTransaction *transaction,
DBusConnection *connection,
DBusMessage *message);
@@ -138,9 +139,10 @@ dbus_bool_t bus_transaction_add_cancel_hook (BusTransaction *
void *data,
DBusFreeFunction free_data_function);
-/* called by stats.c, only present if DBUS_ENABLE_STATS */
int bus_connections_get_n_active (BusConnections *connections);
int bus_connections_get_n_incomplete (BusConnections *connections);
+
+/* called by stats.c, only present if DBUS_ENABLE_STATS */
int bus_connections_get_total_match_rules (BusConnections *connections);
int bus_connections_get_peak_match_rules (BusConnections *connections);
int bus_connections_get_peak_match_rules_per_conn (BusConnections *connections);
diff --git a/bus/dbus.service.in b/bus/dbus.service.in
index 160947c7..3bc4726a 100644
--- a/bus/dbus.service.in
+++ b/bus/dbus.service.in
@@ -1,7 +1,7 @@
[Unit]
Description=D-Bus System Message Bus
+Documentation=man:dbus-daemon(1)
Requires=dbus.socket
-After=syslog.target
[Service]
ExecStart=@EXPANDED_BINDIR@/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
diff --git a/bus/desktop-file.c b/bus/desktop-file.c
index ae441c5e..bfeb72e2 100644
--- a/bus/desktop-file.c
+++ b/bus/desktop-file.c
@@ -688,6 +688,12 @@ bus_desktop_file_load (DBusString *filename,
else if (is_blank_line (&parser) ||
_dbus_string_get_byte (&parser.data, parser.pos) == '#')
parse_comment_or_blank (&parser);
+ else if (parser.current_section < 0)
+ {
+ dbus_set_error(error, DBUS_ERROR_FAILED,
+ "invalid service file: key=value before [Section]");
+ return NULL;
+ }
else
{
if (!parse_key_value (&parser, error))
diff --git a/bus/desktop-file.h b/bus/desktop-file.h
index 58e78e8f..e405625c 100644
--- a/bus/desktop-file.h
+++ b/bus/desktop-file.h
@@ -34,7 +34,6 @@
#define DBUS_SERVICE_NAME "Name"
#define DBUS_SERVICE_EXEC "Exec"
#define DBUS_SERVICE_USER "User"
-#define DBUS_SERVICE_GROUP "Group"
#define DBUS_SERVICE_SYSTEMD_SERVICE "SystemdService"
typedef struct BusDesktopFile BusDesktopFile;
diff --git a/bus/dir-watch-dnotify.c b/bus/dir-watch-dnotify.c
deleted file mode 100644
index b38d7d19..00000000
--- a/bus/dir-watch-dnotify.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dir-watch-dnotify.c OS specific directory change notification for message bus
- *
- * Copyright (C) 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#include <config.h>
-
-#define _GNU_SOURCE
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-
-#include <dbus/dbus-internals.h>
-#include "dir-watch.h"
-
-#define MAX_DIRS_TO_WATCH 128
-
-/* use a static array to avoid handling OOM */
-static int fds[MAX_DIRS_TO_WATCH];
-static int num_fds = 0;
-
-void
-bus_watch_directory (const char *dir, BusContext *context)
-{
- int fd;
-
- _dbus_assert (dir != NULL);
-
- if (num_fds >= MAX_DIRS_TO_WATCH )
- {
- _dbus_warn ("Cannot watch config directory '%s'. Already watching %d directories\n", dir, MAX_DIRS_TO_WATCH);
- goto out;
- }
-
- fd = open (dir, O_RDONLY);
- if (fd < 0)
- {
- _dbus_warn ("Cannot open directory '%s'; error '%s'\n", dir, _dbus_strerror (errno));
- goto out;
- }
-
- if (fcntl (fd, F_NOTIFY, DN_CREATE|DN_DELETE|DN_RENAME|DN_MODIFY) == -1)
- {
- _dbus_warn ("Cannot setup D_NOTIFY for '%s' error '%s'\n", dir, _dbus_strerror (errno));
- close (fd);
- goto out;
- }
-
- fds[num_fds++] = fd;
- _dbus_verbose ("Added watch on config directory '%s'\n", dir);
-
- out:
- ;
-}
-
-void
-bus_drop_all_directory_watches (void)
-{
- int i;
-
- _dbus_verbose ("Dropping all watches on config directories\n");
-
- for (i = 0; i < num_fds; i++)
- {
- if (close (fds[i]) != 0)
- {
- _dbus_verbose ("Error closing fd %d for config directory watch\n", fds[i]);
- }
- }
-
- num_fds = 0;
-}
diff --git a/bus/dir-watch-inotify.c b/bus/dir-watch-inotify.c
index 2e9be988..49ebc721 100644
--- a/bus/dir-watch-inotify.c
+++ b/bus/dir-watch-inotify.c
@@ -22,11 +22,15 @@
*
*/
+/* Be careful, this file is not Linux-only: QNX also uses it */
+
#include <config.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
+/* QNX's inotify is broken, and requires stdint.h to be manually included first */
+#include <stdint.h>
#include <sys/inotify.h>
#include <sys/types.h>
#include <signal.h>
@@ -55,32 +59,30 @@ _handle_inotify_watch (DBusWatch *passed_watch, unsigned int flags, void *data)
char buffer[INOTIFY_BUF_LEN];
ssize_t ret = 0;
int i = 0;
- pid_t pid;
- dbus_bool_t have_change = FALSE;
ret = read (inotify_fd, buffer, INOTIFY_BUF_LEN);
if (ret < 0)
_dbus_verbose ("Error reading inotify event: '%s'\n", _dbus_strerror(errno));
else if (!ret)
_dbus_verbose ("Error reading inotify event: buffer too small\n");
+ else
+ {
+ _dbus_verbose ("Sending SIGHUP signal on reception of %ld inotify event(s)\n", (long) ret);
+ (void) kill (_dbus_getpid (), SIGHUP);
+ }
+#ifdef DBUS_ENABLE_VERBOSE_MODE
while (i < ret)
{
struct inotify_event *ev;
- pid = _dbus_getpid ();
ev = (struct inotify_event *) &buffer[i];
i += INOTIFY_EVENT_SIZE + ev->len;
-#ifdef DBUS_ENABLE_VERBOSE_MODE
if (ev->len)
_dbus_verbose ("event name: '%s'\n", ev->name);
_dbus_verbose ("inotify event: wd=%d mask=%u cookie=%u len=%u\n", ev->wd, ev->mask, ev->cookie, ev->len);
-#endif
- _dbus_verbose ("Sending SIGHUP signal on reception of a inotify event\n");
- have_change = TRUE;
}
- if (have_change)
- (void) kill (pid, SIGHUP);
+#endif
return TRUE;
}
diff --git a/bus/dir-watch-kqueue.c b/bus/dir-watch-kqueue.c
index ac6290cc..33d5e95d 100644
--- a/bus/dir-watch-kqueue.c
+++ b/bus/dir-watch-kqueue.c
@@ -73,12 +73,12 @@ _handle_kqueue_watch (DBusWatch *watch, unsigned int flags, void *data)
{
kq = -1;
if (watch != NULL)
- {
- _dbus_loop_remove_watch (loop, watch);
+ {
+ _dbus_loop_remove_watch (loop, watch);
_dbus_watch_invalidate (watch);
_dbus_watch_unref (watch);
- watch = NULL;
- }
+ watch = NULL;
+ }
pid = getpid ();
_dbus_verbose ("Sending SIGHUP signal since kqueue has been closed\n");
(void) kill (pid, SIGHUP);
@@ -87,11 +87,49 @@ _handle_kqueue_watch (DBusWatch *watch, unsigned int flags, void *data)
return TRUE;
}
+static void _shutdown_kqueue (void *data)
+{
+ int i;
+
+ if (kq < 0)
+ return;
+
+ for (i = 0; i < MAX_DIRS_TO_WATCH; i++)
+ {
+ if (fds[i] >= 0)
+ {
+ close (fds[i]);
+ fds[i] = -1;
+ }
+ if (dirs[i] != NULL)
+ {
+ /* dbus_free() is necessary to pass memleak check */
+ dbus_free (dirs[i]);
+ dirs[i] = NULL;
+ }
+ }
+
+ if (loop)
+ {
+ _dbus_loop_remove_watch (loop, watch);
+ _dbus_loop_unref (loop);
+ loop = NULL;
+ }
+
+ if (watch)
+ {
+ _dbus_watch_invalidate (watch);
+ _dbus_watch_unref (watch);
+ watch = NULL;
+ }
+
+ close (kq);
+ kq = -1;
+}
+
static int
_init_kqueue (BusContext *context)
{
- int ret = 0;
-
if (kq < 0)
{
@@ -99,38 +137,61 @@ _init_kqueue (BusContext *context)
if (kq < 0)
{
_dbus_warn ("Cannot create kqueue; error '%s'\n", _dbus_strerror (errno));
- goto out;
- }
-
- loop = bus_context_get_loop (context);
-
- watch = _dbus_watch_new (kq, DBUS_WATCH_READABLE, TRUE,
- _handle_kqueue_watch, NULL, NULL);
-
- if (watch == NULL)
- {
- _dbus_warn ("Unable to create kqueue watch\n");
- close (kq);
- kq = -1;
- goto out;
- }
-
- if (!_dbus_loop_add_watch (loop, watch))
- {
- _dbus_warn ("Unable to add reload watch to main loop");
- _dbus_watch_invalidate (watch);
- _dbus_watch_unref (watch);
- watch = NULL;
- close (kq);
- kq = -1;
- goto out;
- }
+ goto out;
+ }
+
+ loop = bus_context_get_loop (context);
+ _dbus_loop_ref (loop);
+
+ watch = _dbus_watch_new (kq, DBUS_WATCH_READABLE, TRUE,
+ _handle_kqueue_watch, NULL, NULL);
+
+ if (watch == NULL)
+ {
+ _dbus_warn ("Unable to create kqueue watch\n");
+ goto out1;
+ }
+
+ if (!_dbus_loop_add_watch (loop, watch))
+ {
+ _dbus_warn ("Unable to add reload watch to main loop");
+ goto out2;
+ }
+
+ if (!_dbus_register_shutdown_func (_shutdown_kqueue, NULL))
+ {
+ _dbus_warn ("Unable to register shutdown function");
+ goto out3;
+ }
+ }
+
+ return 1;
+
+out3:
+ _dbus_loop_remove_watch (loop, watch);
+
+out2:
+ if (watch)
+ {
+ _dbus_watch_invalidate (watch);
+ _dbus_watch_unref (watch);
+ watch = NULL;
}
- ret = 1;
+out1:
+ if (kq >= 0)
+ {
+ close (kq);
+ kq = -1;
+ }
+ if (loop)
+ {
+ _dbus_loop_unref (loop);
+ loop = NULL;
+ }
out:
- return ret;
+ return 0;
}
void
@@ -139,7 +200,7 @@ bus_set_watched_dirs (BusContext *context, DBusList **directories)
int new_fds[MAX_DIRS_TO_WATCH];
char *new_dirs[MAX_DIRS_TO_WATCH];
DBusList *link;
- int i, j, f, fd;
+ int i, j, fd;
struct kevent ev;
if (!_init_kqueue (context))
@@ -169,12 +230,12 @@ bus_set_watched_dirs (BusContext *context, DBusList **directories)
if (dirs[j] && strcmp (new_dirs[i], dirs[j]) == 0)
{
new_fds[i] = fds[j];
- new_dirs[i] = dirs[j];
- fds[j] = -1;
- dirs[j] = NULL;
- break;
- }
- }
+ new_dirs[i] = dirs[j];
+ fds[j] = -1;
+ dirs[j] = NULL;
+ break;
+ }
+ }
}
/* Any directory we find in "fds" with a nonzero fd must
@@ -185,10 +246,10 @@ bus_set_watched_dirs (BusContext *context, DBusList **directories)
if (fds[j] != -1)
{
close (fds[j]);
- dbus_free (dirs[j]);
- fds[j] = -1;
- dirs[j] = NULL;
- }
+ dbus_free (dirs[j]);
+ fds[j] = -1;
+ dirs[j] = NULL;
+ }
}
for (i = 0; new_dirs[i]; i++)
@@ -196,9 +257,9 @@ bus_set_watched_dirs (BusContext *context, DBusList **directories)
if (new_fds[i] == -1)
{
/* FIXME - less lame error handling for failing to add a watch;
- * we may need to sleep.
- */
- fd = open (new_dirs[i], O_RDONLY);
+ * we may need to sleep.
+ */
+ fd = open (new_dirs[i], O_RDONLY | O_CLOEXEC);
if (fd < 0)
{
if (errno != ENOENT)
@@ -223,18 +284,18 @@ bus_set_watched_dirs (BusContext *context, DBusList **directories)
goto out;
}
- new_fds[i] = fd;
- new_dirs[i] = _dbus_strdup (new_dirs[i]);
- if (!new_dirs[i])
+ new_fds[i] = fd;
+ new_dirs[i] = _dbus_strdup (new_dirs[i]);
+ if (!new_dirs[i])
{
/* FIXME have less lame handling for OOM, we just silently fail to
- * watch. (In reality though, the whole OOM handling in dbus is
- * stupid but we won't go into that in this comment =) )
- */
+ * watch. (In reality though, the whole OOM handling in dbus is
+ * stupid but we won't go into that in this comment =) )
+ */
close (fd);
- new_fds[i] = -1;
- }
- }
+ new_fds[i] = -1;
+ }
+ }
}
num_fds = i;
diff --git a/bus/dispatch.c b/bus/dispatch.c
index 7a96f9dc..7a61953f 100644
--- a/bus/dispatch.c
+++ b/bus/dispatch.c
@@ -34,6 +34,7 @@
#include "signals.h"
#include "test.h"
#include <dbus/dbus-internals.h>
+#include <dbus/dbus-misc.h>
#include <string.h>
#ifdef HAVE_UNIX_FD_PASSING
@@ -132,7 +133,7 @@ bus_dispatch_matches (BusTransaction *transaction,
}
/* Now dispatch to others who look interested in this message */
- connections = bus_transaction_get_connections (transaction);
+ connections = bus_context_get_connections (context);
dbus_error_init (&tmp_error);
matchmaker = bus_context_get_matchmaker (context);
@@ -428,7 +429,7 @@ bus_dispatch_remove_connection (DBusConnection *connection)
NULL);
}
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#include <stdio.h>
@@ -1306,9 +1307,15 @@ check_get_connection_unix_process_id (BusContext *context,
#endif
else
{
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
+ defined(__linux__) || \
+ defined(__OpenBSD__)
warn_unexpected (connection, message, "not this error");
goto out;
+#else
+ _dbus_verbose ("does not support GetConnectionUnixProcessID but perhaps that's OK?\n");
+#endif
}
}
else
@@ -4466,7 +4473,7 @@ setenv_TEST_LAUNCH_HELPER_CONFIG(const DBusString *test_data_dir,
_dbus_verbose ("Setting TEST_LAUNCH_HELPER_CONFIG to '%s'\n",
_dbus_string_get_const_data (&full));
- _dbus_setenv ("TEST_LAUNCH_HELPER_CONFIG", _dbus_string_get_const_data (&full));
+ dbus_setenv ("TEST_LAUNCH_HELPER_CONFIG", _dbus_string_get_const_data (&full));
_dbus_string_free (&full);
@@ -4907,4 +4914,4 @@ bus_unix_fds_passing_test(const DBusString *test_data_dir)
}
#endif
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/bus/driver.c b/bus/driver.c
index 574e0f3d..f5d3ebe2 100644
--- a/bus/driver.c
+++ b/bus/driver.c
@@ -32,12 +32,56 @@
#include "signals.h"
#include "stats.h"
#include "utils.h"
+
+#include <dbus/dbus-asv-util.h>
#include <dbus/dbus-string.h>
#include <dbus/dbus-internals.h>
#include <dbus/dbus-message.h>
#include <dbus/dbus-marshal-recursive.h>
#include <string.h>
+static DBusConnection *
+bus_driver_get_conn_helper (DBusConnection *connection,
+ DBusMessage *message,
+ const char *what_we_want,
+ const char **name_p,
+ DBusError *error)
+{
+ const char *name;
+ BusRegistry *registry;
+ BusService *serv;
+ DBusString str;
+ DBusConnection *conn;
+
+ if (!dbus_message_get_args (message, error,
+ DBUS_TYPE_STRING, &name,
+ DBUS_TYPE_INVALID))
+ return NULL;
+
+ _dbus_assert (name != NULL);
+ _dbus_verbose ("asked for %s of connection %s\n", what_we_want, name);
+
+ registry = bus_connection_get_registry (connection);
+ _dbus_string_init_const (&str, name);
+ serv = bus_registry_lookup (registry, &str);
+
+ if (serv == NULL)
+ {
+ dbus_set_error (error, DBUS_ERROR_NAME_HAS_NO_OWNER,
+ "Could not get %s of name '%s': no such name",
+ what_we_want, name);
+ return NULL;
+ }
+
+ conn = bus_service_get_primary_owners_connection (serv);
+ _dbus_assert (conn != NULL);
+
+ if (name_p != NULL)
+ *name_p = name;
+
+ return conn;
+}
+
static dbus_bool_t bus_driver_send_welcome_message (DBusConnection *connection,
DBusMessage *hello_message,
BusTransaction *transaction,
@@ -834,6 +878,44 @@ bus_driver_handle_update_activation_environment (DBusConnection *connection,
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
+ if (!bus_driver_check_message_is_for_us (message, error))
+ return FALSE;
+
+#ifdef DBUS_UNIX
+ {
+ /* UpdateActivationEnvironment is basically a recipe for privilege
+ * escalation so let's be extra-careful: do not allow the sysadmin
+ * to shoot themselves in the foot. */
+ unsigned long uid;
+
+ if (!dbus_connection_get_unix_user (connection, &uid))
+ {
+ bus_context_log (bus_transaction_get_context (transaction),
+ DBUS_SYSTEM_LOG_SECURITY,
+ "rejected attempt to call UpdateActivationEnvironment by "
+ "unknown uid");
+ dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED,
+ "rejected attempt to call UpdateActivationEnvironment by "
+ "unknown uid");
+ return FALSE;
+ }
+
+ /* On the system bus, we could in principle allow uid 0 to call
+ * UpdateActivationEnvironment; but they should know better anyway,
+ * and our default system.conf has always forbidden it */
+ if (!_dbus_unix_user_is_process_owner (uid))
+ {
+ bus_context_log (bus_transaction_get_context (transaction),
+ DBUS_SYSTEM_LOG_SECURITY,
+ "rejected attempt to call UpdateActivationEnvironment by uid %lu",
+ uid);
+ dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED,
+ "rejected attempt to call UpdateActivationEnvironment");
+ return FALSE;
+ }
+ }
+#endif
+
activation = bus_connection_get_activation (connection);
dbus_message_iter_init (message, &iter);
@@ -841,13 +923,7 @@ bus_driver_handle_update_activation_environment (DBusConnection *connection,
/* The message signature has already been checked for us,
* so let's just assert it's right.
*/
-#ifndef DBUS_DISABLE_ASSERT
- {
- int msg_type = dbus_message_iter_get_arg_type (&iter);
-
- _dbus_assert (msg_type == DBUS_TYPE_ARRAY);
- }
-#endif
+ _dbus_assert (dbus_message_iter_get_arg_type (&iter) == DBUS_TYPE_ARRAY);
dbus_message_iter_recurse (&iter, &dict_iter);
@@ -1262,40 +1338,21 @@ bus_driver_handle_get_connection_unix_user (DBusConnection *connection,
DBusMessage *message,
DBusError *error)
{
- const char *service;
- DBusString str;
- BusRegistry *registry;
- BusService *serv;
DBusConnection *conn;
DBusMessage *reply;
unsigned long uid;
dbus_uint32_t uid32;
+ const char *service;
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
- registry = bus_connection_get_registry (connection);
-
- service = NULL;
reply = NULL;
- if (! dbus_message_get_args (message, error,
- DBUS_TYPE_STRING, &service,
- DBUS_TYPE_INVALID))
- goto failed;
-
- _dbus_verbose ("asked for UID of connection %s\n", service);
-
- _dbus_string_init_const (&str, service);
- serv = bus_registry_lookup (registry, &str);
- if (serv == NULL)
- {
- dbus_set_error (error,
- DBUS_ERROR_NAME_HAS_NO_OWNER,
- "Could not get UID of name '%s': no such name", service);
- goto failed;
- }
+ conn = bus_driver_get_conn_helper (connection, message, "UID", &service,
+ error);
- conn = bus_service_get_primary_owners_connection (serv);
+ if (conn == NULL)
+ goto failed;
reply = dbus_message_new_method_return (message);
if (reply == NULL)
@@ -1338,40 +1395,21 @@ bus_driver_handle_get_connection_unix_process_id (DBusConnection *connection,
DBusMessage *message,
DBusError *error)
{
- const char *service;
- DBusString str;
- BusRegistry *registry;
- BusService *serv;
DBusConnection *conn;
DBusMessage *reply;
unsigned long pid;
dbus_uint32_t pid32;
+ const char *service;
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
- registry = bus_connection_get_registry (connection);
-
- service = NULL;
reply = NULL;
- if (! dbus_message_get_args (message, error,
- DBUS_TYPE_STRING, &service,
- DBUS_TYPE_INVALID))
- goto failed;
-
- _dbus_verbose ("asked for PID of connection %s\n", service);
-
- _dbus_string_init_const (&str, service);
- serv = bus_registry_lookup (registry, &str);
- if (serv == NULL)
- {
- dbus_set_error (error,
- DBUS_ERROR_NAME_HAS_NO_OWNER,
- "Could not get PID of name '%s': no such name", service);
- goto failed;
- }
+ conn = bus_driver_get_conn_helper (connection, message, "PID", &service,
+ error);
- conn = bus_service_get_primary_owners_connection (serv);
+ if (conn == NULL)
+ goto failed;
reply = dbus_message_new_method_return (message);
if (reply == NULL)
@@ -1414,40 +1452,21 @@ bus_driver_handle_get_adt_audit_session_data (DBusConnection *connection,
DBusMessage *message,
DBusError *error)
{
- const char *service;
- DBusString str;
- BusRegistry *registry;
- BusService *serv;
DBusConnection *conn;
DBusMessage *reply;
void *data = NULL;
dbus_uint32_t data_size;
+ const char *service;
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
- registry = bus_connection_get_registry (connection);
-
- service = NULL;
reply = NULL;
- if (! dbus_message_get_args (message, error,
- DBUS_TYPE_STRING, &service,
- DBUS_TYPE_INVALID))
- goto failed;
-
- _dbus_verbose ("asked for audit session data for connection %s\n", service);
-
- _dbus_string_init_const (&str, service);
- serv = bus_registry_lookup (registry, &str);
- if (serv == NULL)
- {
- dbus_set_error (error,
- DBUS_ERROR_NAME_HAS_NO_OWNER,
- "Could not get audit session data for name '%s': no such name", service);
- goto failed;
- }
+ conn = bus_driver_get_conn_helper (connection, message,
+ "audit session data", &service, error);
- conn = bus_service_get_primary_owners_connection (serv);
+ if (conn == NULL)
+ goto failed;
reply = dbus_message_new_method_return (message);
if (reply == NULL)
@@ -1489,39 +1508,20 @@ bus_driver_handle_get_connection_selinux_security_context (DBusConnection *conne
DBusMessage *message,
DBusError *error)
{
- const char *service;
- DBusString str;
- BusRegistry *registry;
- BusService *serv;
DBusConnection *conn;
DBusMessage *reply;
BusSELinuxID *context;
+ const char *service;
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
- registry = bus_connection_get_registry (connection);
-
- service = NULL;
reply = NULL;
- if (! dbus_message_get_args (message, error,
- DBUS_TYPE_STRING, &service,
- DBUS_TYPE_INVALID))
- goto failed;
-
- _dbus_verbose ("asked for security context of connection %s\n", service);
+ conn = bus_driver_get_conn_helper (connection, message, "security context",
+ &service, error);
- _dbus_string_init_const (&str, service);
- serv = bus_registry_lookup (registry, &str);
- if (serv == NULL)
- {
- dbus_set_error (error,
- DBUS_ERROR_NAME_HAS_NO_OWNER,
- "Could not get security context of name '%s': no such name", service);
- goto failed;
- }
-
- conn = bus_service_get_primary_owners_connection (serv);
+ if (conn == NULL)
+ goto failed;
reply = dbus_message_new_method_return (message);
if (reply == NULL)
@@ -1557,6 +1557,80 @@ bus_driver_handle_get_connection_selinux_security_context (DBusConnection *conne
}
static dbus_bool_t
+bus_driver_handle_get_connection_credentials (DBusConnection *connection,
+ BusTransaction *transaction,
+ DBusMessage *message,
+ DBusError *error)
+{
+ DBusConnection *conn;
+ DBusMessage *reply;
+ DBusMessageIter reply_iter;
+ DBusMessageIter array_iter;
+ unsigned long ulong_val;
+ const char *service;
+
+ _DBUS_ASSERT_ERROR_IS_CLEAR (error);
+
+ reply = NULL;
+
+ conn = bus_driver_get_conn_helper (connection, message, "credentials",
+ &service, error);
+
+ if (conn == NULL)
+ goto failed;
+
+ reply = _dbus_asv_new_method_return (message, &reply_iter, &array_iter);
+ if (reply == NULL)
+ goto oom;
+
+ /* we can't represent > 32-bit pids; if your system needs them, please
+ * add ProcessID64 to the spec or something */
+ if (dbus_connection_get_unix_process_id (conn, &ulong_val) &&
+ ulong_val <= _DBUS_UINT32_MAX)
+ {
+ if (!_dbus_asv_add_uint32 (&array_iter, "ProcessID", ulong_val))
+ goto oom;
+ }
+
+ /* we can't represent > 32-bit uids; if your system needs them, please
+ * add UnixUserID64 to the spec or something */
+ if (dbus_connection_get_unix_user (conn, &ulong_val) &&
+ ulong_val <= _DBUS_UINT32_MAX)
+ {
+ if (!_dbus_asv_add_uint32 (&array_iter, "UnixUserID", ulong_val))
+ goto oom;
+ }
+
+ if (!_dbus_asv_close (&reply_iter, &array_iter))
+ goto oom;
+
+ if (! bus_transaction_send_from_driver (transaction, connection, reply))
+ {
+ /* this time we don't want to close the iterator again, so just
+ * get rid of the message */
+ dbus_message_unref (reply);
+ reply = NULL;
+ goto oom;
+ }
+
+ return TRUE;
+
+ oom:
+ BUS_SET_OOM (error);
+
+ failed:
+ _DBUS_ASSERT_ERROR_IS_SET (error);
+
+ if (reply)
+ {
+ _dbus_asv_abandon (&reply_iter, &array_iter);
+ dbus_message_unref (reply);
+ }
+
+ return FALSE;
+}
+
+static dbus_bool_t
bus_driver_handle_reload_config (DBusConnection *connection,
BusTransaction *transaction,
DBusMessage *message,
@@ -1736,6 +1810,8 @@ static const MessageHandler dbus_message_handlers[] = {
"",
DBUS_TYPE_STRING_AS_STRING,
bus_driver_handle_get_id },
+ { "GetConnectionCredentials", "s", "a{sv}",
+ bus_driver_handle_get_connection_credentials },
{ NULL, NULL, NULL, NULL }
};
@@ -1927,6 +2003,38 @@ bus_driver_handle_introspect (DBusConnection *connection,
return FALSE;
}
+/*
+ * Set @error and return FALSE if the message is not directed to the
+ * dbus-daemon by its canonical object path. This is hardening against
+ * system services with poorly-written security policy files, which
+ * might allow sending dangerously broad equivalence classes of messages
+ * such as "anything with this assumed-to-be-safe object path".
+ *
+ * dbus-daemon is unusual in that it normally ignores the object path
+ * of incoming messages; we need to keep that behaviour for the "read"
+ * read-only method calls like GetConnectionUnixUser for backwards
+ * compatibility, but it seems safer to be more restrictive for things
+ * intended to be root-only or privileged-developers-only.
+ *
+ * It is possible that there are other system services with the same
+ * quirk as dbus-daemon.
+ */
+dbus_bool_t
+bus_driver_check_message_is_for_us (DBusMessage *message,
+ DBusError *error)
+{
+ if (!dbus_message_has_path (message, DBUS_PATH_DBUS))
+ {
+ dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED,
+ "Method '%s' is only available at the canonical object path '%s'",
+ dbus_message_get_member (message), DBUS_PATH_DBUS);
+
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
dbus_bool_t
bus_driver_handle_message (DBusConnection *connection,
BusTransaction *transaction,
@@ -1964,13 +2072,8 @@ bus_driver_handle_message (DBusConnection *connection,
_dbus_verbose ("Driver got a method call: %s\n", name);
/* security checks should have kept this from getting here */
-#ifndef DBUS_DISABLE_ASSERT
- {
- const char *sender = dbus_message_get_sender (message);
-
- _dbus_assert (sender != NULL || strcmp (name, "Hello") == 0);
- }
-#endif
+ _dbus_assert (dbus_message_get_sender (message) != NULL ||
+ strcmp (name, "Hello") == 0);
for (ih = interface_handlers; ih->name != NULL; ih++)
{
diff --git a/bus/driver.h b/bus/driver.h
index 713b2764..201709c4 100644
--- a/bus/driver.h
+++ b/bus/driver.h
@@ -46,7 +46,7 @@ dbus_bool_t bus_driver_send_service_owner_changed (const char *service_name
BusTransaction *transaction,
DBusError *error);
dbus_bool_t bus_driver_generate_introspect_string (DBusString *xml);
-
-
+dbus_bool_t bus_driver_check_message_is_for_us (DBusMessage *message,
+ DBusError *error);
#endif /* BUS_DRIVER_H */
diff --git a/bus/expirelist.c b/bus/expirelist.c
index 1a12ea45..9a3886e9 100644
--- a/bus/expirelist.c
+++ b/bus/expirelist.c
@@ -281,7 +281,7 @@ bus_expire_list_contains_item (BusExpireList *list,
return _dbus_list_find_last (&list->items, item) != NULL;
}
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
typedef struct
{
@@ -399,4 +399,4 @@ bus_expire_list_test (const DBusString *test_data_dir)
return result;
}
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/bus/main.c b/bus/main.c
index ca0be3ce..e060baa8 100644
--- a/bus/main.c
+++ b/bus/main.c
@@ -61,11 +61,6 @@ signal_handler (int sig)
{
switch (sig)
{
-#ifdef DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX
- case SIGIO:
- /* explicit fall-through */
-#endif /* DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX */
-#ifdef SIGHUP
case SIGHUP:
{
DBusString str;
@@ -91,11 +86,13 @@ signal_handler (int sig)
static const char message[] =
"Unable to write to reload pipe - buffer full?\n";
- write (STDERR_FILENO, message, strlen (message));
+ if (write (STDERR_FILENO, message, strlen (message)) != strlen (message))
+ {
+ /* ignore failure to write out a warning */
+ }
}
}
break;
-#endif
case SIGTERM:
{
@@ -113,7 +110,10 @@ signal_handler (int sig)
"Unable to write termination signal to pipe - buffer full?\n"
"Will exit instead.\n";
- write (STDERR_FILENO, message, strlen (message));
+ if (write (STDERR_FILENO, message, strlen (message)) != strlen (message))
+ {
+ /* ignore failure to write out a warning */
+ }
_exit (1);
}
}
@@ -125,7 +125,23 @@ signal_handler (int sig)
static void
usage (void)
{
- fprintf (stderr, DBUS_DAEMON_NAME " [--version] [--session] [--system] [--config-file=FILE] [--print-address[=DESCRIPTOR]] [--print-pid[=DESCRIPTOR]] [--fork] [--nofork] [--introspect] [--address=ADDRESS] [--systemd-activation] [--nopidfile]\n");
+ fprintf (stderr,
+ DBUS_DAEMON_NAME
+ " [--version]"
+ " [--session]"
+ " [--system]"
+ " [--config-file=FILE]"
+ " [--print-address[=DESCRIPTOR]]"
+ " [--print-pid[=DESCRIPTOR]]"
+ " [--introspect]"
+ " [--address=ADDRESS]"
+ " [--nopidfile]"
+ " [--nofork]"
+#ifdef DBUS_UNIX
+ " [--fork]"
+ " [--systemd-activation]"
+#endif
+ "\n");
exit (1);
}
@@ -399,19 +415,21 @@ main (int argc, char **argv)
flags &= ~BUS_CONTEXT_FLAG_FORK_ALWAYS;
flags |= BUS_CONTEXT_FLAG_FORK_NEVER;
}
+#ifdef DBUS_UNIX
else if (strcmp (arg, "--fork") == 0)
{
flags &= ~BUS_CONTEXT_FLAG_FORK_NEVER;
flags |= BUS_CONTEXT_FLAG_FORK_ALWAYS;
}
- else if (strcmp (arg, "--nopidfile") == 0)
- {
- flags &= ~BUS_CONTEXT_FLAG_WRITE_PID_FILE;
- }
else if (strcmp (arg, "--systemd-activation") == 0)
{
flags |= BUS_CONTEXT_FLAG_SYSTEMD_ACTIVATION;
}
+#endif
+ else if (strcmp (arg, "--nopidfile") == 0)
+ {
+ flags &= ~BUS_CONTEXT_FLAG_WRITE_PID_FILE;
+ }
else if (strcmp (arg, "--system") == 0)
{
check_two_config_files (&config_file, "system");
@@ -622,12 +640,7 @@ main (int argc, char **argv)
* no point in trying to make the handler portable to non-Unix. */
_dbus_set_signal_handler (SIGTERM, signal_handler);
-#ifdef SIGHUP
_dbus_set_signal_handler (SIGHUP, signal_handler);
-#endif
-#ifdef DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX
- _dbus_set_signal_handler (SIGIO, signal_handler);
-#endif /* DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX */
#endif /* DBUS_UNIX */
_dbus_verbose ("We are on D-Bus...\n");
diff --git a/bus/policy.c b/bus/policy.c
index 379cea95..082f3853 100644
--- a/bus/policy.c
+++ b/bus/policy.c
@@ -1302,12 +1302,12 @@ bus_client_policy_check_can_own (BusClientPolicy *policy,
return bus_rules_check_can_own (policy->rules, service_name);
}
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
dbus_bool_t
bus_policy_check_can_own (BusPolicy *policy,
const DBusString *service_name)
{
return bus_rules_check_can_own (policy->default_rules, service_name);
}
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/bus/policy.h b/bus/policy.h
index 3ff6f482..d1d3e72b 100644
--- a/bus/policy.h
+++ b/bus/policy.h
@@ -161,7 +161,7 @@ dbus_bool_t bus_client_policy_append_rule (BusClientPolicy *policy,
BusPolicyRule *rule);
void bus_client_policy_optimize (BusClientPolicy *policy);
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
dbus_bool_t bus_policy_check_can_own (BusPolicy *policy,
const DBusString *service_name);
#endif
diff --git a/bus/selinux.c b/bus/selinux.c
index 36287e9f..99994ca9 100644
--- a/bus/selinux.c
+++ b/bus/selinux.c
@@ -44,8 +44,6 @@
#include <syslog.h>
#include <selinux/selinux.h>
#include <selinux/avc.h>
-#include <selinux/av_permissions.h>
-#include <selinux/flask.h>
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
@@ -314,8 +312,27 @@ bus_selinux_pre_init (void)
#endif
}
+/*
+ * Private Flask definitions; the order of these constants must
+ * exactly match that of the structure array below!
+ */
+/* security dbus class constants */
+#define SECCLASS_DBUS 1
+
+/* dbus's per access vector constants */
+#define DBUS__ACQUIRE_SVC 1
+#define DBUS__SEND_MSG 2
+
+#ifdef HAVE_SELINUX
+static struct security_class_mapping dbus_map[] = {
+ { "dbus", { "acquire_svc", "send_msg", NULL } },
+ { NULL }
+};
+#endif /* HAVE_SELINUX */
+
/**
- * Initialize the user space access vector cache (AVC) for D-Bus and set up
+ * Establish dynamic object class and permission mapping and
+ * initialize the user space access vector cache (AVC) for D-Bus and set up
* logging callbacks.
*/
dbus_bool_t
@@ -334,6 +351,13 @@ bus_selinux_full_init (void)
_dbus_verbose ("SELinux is enabled in this kernel.\n");
+ if (selinux_set_mapping (dbus_map) < 0)
+ {
+ _dbus_warn ("Failed to set up security class mapping (selinux_set_mapping():%s).\n",
+ strerror (errno));
+ return FALSE;
+ }
+
avc_entry_ref_init (&aeref);
if (avc_init ("avc", &mem_cb, &log_cb, &thread_cb, &lock_cb) < 0)
{
@@ -936,8 +960,7 @@ bus_selinux_get_policy_root (void)
void
bus_selinux_id_table_print (DBusHashTable *service_table)
{
-#ifdef DBUS_ENABLE_VERBOSE_MODE
-#ifdef HAVE_SELINUX
+#if defined (DBUS_ENABLE_VERBOSE_MODE) && defined (HAVE_SELINUX)
DBusHashIter iter;
if (!selinux_enabled)
@@ -953,19 +976,18 @@ bus_selinux_id_table_print (DBusHashTable *service_table)
_dbus_verbose ("The context is %s\n", sid->ctx);
_dbus_verbose ("The refcount is %d\n", sid->refcnt);
}
-#endif /* HAVE_SELINUX */
-#endif /* DBUS_ENABLE_VERBOSE_MODE */
+#endif /* DBUS_ENABLE_VERBOSE_MODE && HAVE_SELINUX */
}
-#ifdef DBUS_ENABLE_VERBOSE_MODE
-#ifdef HAVE_SELINUX
/**
* Print out some AVC statistics.
*/
+#ifdef HAVE_SELINUX
static void
bus_avc_print_stats (void)
{
+#ifdef DBUS_ENABLE_VERBOSE_MODE
struct avc_cache_stats cstats;
if (!selinux_enabled)
@@ -983,10 +1005,9 @@ bus_avc_print_stats (void)
_dbus_verbose ("CAV hits: %d\n", cstats.cav_hits);
_dbus_verbose ("CAV probes: %d\n", cstats.cav_probes);
_dbus_verbose ("CAV misses: %d\n", cstats.cav_misses);
+#endif /* DBUS_ENABLE_VERBOSE_MODE */
}
#endif /* HAVE_SELINUX */
-#endif /* DBUS_ENABLE_VERBOSE_MODE */
-
/**
* Destroy the AVC before we terminate.
@@ -1005,12 +1026,7 @@ bus_selinux_shutdown (void)
sidput (bus_sid);
bus_sid = SECSID_WILD;
-#ifdef DBUS_ENABLE_VERBOSE_MODE
-
- if (_dbus_is_verbose())
- bus_avc_print_stats ();
-
-#endif /* DBUS_ENABLE_VERBOSE_MODE */
+ bus_avc_print_stats ();
avc_destroy ();
#ifdef HAVE_LIBAUDIT
@@ -1051,10 +1067,17 @@ _dbus_change_to_daemon_user (const char *user,
if (_dbus_geteuid () == 0)
{
int rc;
+ int have_audit_write;
+ have_audit_write = capng_have_capability (CAPNG_PERMITTED, CAP_AUDIT_WRITE);
capng_clear (CAPNG_SELECT_BOTH);
- capng_update (CAPNG_ADD, CAPNG_EFFECTIVE | CAPNG_PERMITTED,
- CAP_AUDIT_WRITE);
+ /* Only attempt to retain CAP_AUDIT_WRITE if we had it when
+ * starting. See:
+ * https://bugs.freedesktop.org/show_bug.cgi?id=49062#c9
+ */
+ if (have_audit_write)
+ capng_update (CAPNG_ADD, CAPNG_EFFECTIVE | CAPNG_PERMITTED,
+ CAP_AUDIT_WRITE);
rc = capng_change_id (uid, gid, CAPNG_DROP_SUPP_GRP);
if (rc)
{
diff --git a/bus/services.c b/bus/services.c
index 6f380fac..584485b1 100644
--- a/bus/services.c
+++ b/bus/services.c
@@ -368,7 +368,7 @@ bus_registry_list_services (BusRegistry *registry,
error:
for (j = 0; j < i; j++)
- dbus_free (retval[i]);
+ dbus_free (retval[j]);
dbus_free (retval);
return FALSE;
@@ -588,8 +588,9 @@ bus_registry_acquire_service (BusRegistry *registry,
activation = bus_context_get_activation (registry->context);
retval = bus_activation_send_pending_auto_activation_messages (activation,
service,
- transaction,
- error);
+ transaction);
+ if (!retval)
+ BUS_SET_OOM (error);
out:
return retval;
diff --git a/bus/session.conf.in b/bus/session.conf.in
index e121ff93..cfe9544f 100644
--- a/bus/session.conf.in
+++ b/bus/session.conf.in
@@ -12,7 +12,7 @@
the behavior of child processes. -->
<keep_umask/>
- <listen>@DBUS_SESSION_BUS_DEFAULT_ADDRESS@</listen>
+ <listen>@DBUS_SESSION_BUS_LISTEN_ADDRESS@</listen>
<standard_session_servicedirs />
@@ -49,9 +49,11 @@
<limit name="max_outgoing_bytes">1000000000</limit>
<limit name="max_outgoing_unix_fds">250000000</limit>
<limit name="max_message_size">1000000000</limit>
- <limit name="max_message_unix_fds">4096</limit>
+ <!-- We do not override max_message_unix_fds here since the in-kernel
+ limit is also relatively low -->
<limit name="service_start_timeout">120000</limit>
<limit name="auth_timeout">240000</limit>
+ <limit name="pending_fd_timeout">150000</limit>
<limit name="max_completed_connections">100000</limit>
<limit name="max_incomplete_connections">10000</limit>
<limit name="max_connections_per_user">100000</limit>
diff --git a/bus/signals.c b/bus/signals.c
index 28506d3f..4c500c67 100644
--- a/bus/signals.c
+++ b/bus/signals.c
@@ -64,7 +64,7 @@ bus_match_rule_new (DBusConnection *matches_go_to)
rule->refcount = 1;
rule->matches_go_to = matches_go_to;
-#ifndef DBUS_BUILD_TESTS
+#ifndef DBUS_ENABLE_EMBEDDED_TESTS
_dbus_assert (rule->matches_go_to != NULL);
#endif
@@ -1836,8 +1836,11 @@ match_rule_matches (BusMatchRule *rule,
* namespace, rather than just starting with that string,
* by checking that the matched prefix is followed by a '/'
* or the end of the path.
+ *
+ * Special case: the only valid path of length 1, "/",
+ * matches everything.
*/
- if (path[len] != '\0' && path[len] != '/')
+ if (len > 1 && path[len] != '\0' && path[len] != '/')
return FALSE;
}
@@ -1980,12 +1983,10 @@ get_recipients_from_list (DBusList **rules,
if (!_dbus_list_append (recipients_p, rule->matches_go_to))
return FALSE;
}
-#ifdef DBUS_ENABLE_VERBOSE_MODE
else
{
_dbus_verbose ("Connection already receiving this message, so not adding again\n");
}
-#endif /* DBUS_ENABLE_VERBOSE_MODE */
}
link = _dbus_list_get_next_link (rules, link);
@@ -2056,7 +2057,7 @@ bus_matchmaker_get_recipients (BusMatchmaker *matchmaker,
return TRUE;
}
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#include "test.h"
#include <stdlib.h>
@@ -2719,6 +2720,7 @@ test_path_matching (void)
static const char*
path_namespace_should_match_message_1[] = {
+ "type='signal',path_namespace='/'",
"type='signal',path_namespace='/foo'",
"type='signal',path_namespace='/foo/TheObjectManager'",
NULL
@@ -2733,6 +2735,7 @@ path_namespace_should_not_match_message_1[] = {
static const char*
path_namespace_should_match_message_2[] = {
+ "type='signal',path_namespace='/'",
"type='signal',path_namespace='/foo/TheObjectManager'",
NULL
};
@@ -2744,6 +2747,7 @@ path_namespace_should_not_match_message_2[] = {
static const char*
path_namespace_should_match_message_3[] = {
+ "type='signal',path_namespace='/'",
NULL
};
@@ -2753,12 +2757,25 @@ path_namespace_should_not_match_message_3[] = {
NULL
};
+static const char*
+path_namespace_should_match_message_4[] = {
+ "type='signal',path_namespace='/'",
+ NULL
+};
+
+static const char*
+path_namespace_should_not_match_message_4[] = {
+ "type='signal',path_namespace='/foo/TheObjectManager'",
+ NULL
+};
+
static void
test_matching_path_namespace (void)
{
DBusMessage *message1;
DBusMessage *message2;
DBusMessage *message3;
+ DBusMessage *message4;
message1 = dbus_message_new (DBUS_MESSAGE_TYPE_SIGNAL);
_dbus_assert (message1 != NULL);
@@ -2775,6 +2792,11 @@ test_matching_path_namespace (void)
if (!dbus_message_set_path (message3, "/foo/TheObjectManagerOther"))
_dbus_assert_not_reached ("oom");
+ message4 = dbus_message_new (DBUS_MESSAGE_TYPE_SIGNAL);
+ _dbus_assert (message4 != NULL);
+ if (!dbus_message_set_path (message4, "/"))
+ _dbus_assert_not_reached ("oom");
+
check_matching (message1, 1,
path_namespace_should_match_message_1,
path_namespace_should_not_match_message_1);
@@ -2784,7 +2806,11 @@ test_matching_path_namespace (void)
check_matching (message3, 3,
path_namespace_should_match_message_3,
path_namespace_should_not_match_message_3);
+ check_matching (message4, 4,
+ path_namespace_should_match_message_4,
+ path_namespace_should_not_match_message_4);
+ dbus_message_unref (message4);
dbus_message_unref (message3);
dbus_message_unref (message2);
dbus_message_unref (message1);
@@ -2811,5 +2837,5 @@ bus_signals_test (const DBusString *test_data_dir)
return TRUE;
}
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/bus/stats.c b/bus/stats.c
index 28fd49ba..20321e5e 100644
--- a/bus/stats.c
+++ b/bus/stats.c
@@ -1,5 +1,8 @@
/* stats.c - statistics from the bus driver
*
+ * Copyright © 2011-2012 Nokia Corporation
+ * Copyright © 2012-2013 Collabora Ltd.
+ *
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
@@ -21,168 +24,24 @@
#include <config.h>
#include "stats.h"
+#include <dbus/dbus-asv-util.h>
#include <dbus/dbus-internals.h>
#include <dbus/dbus-connection-internal.h>
#include "connection.h"
+#include "driver.h"
#include "services.h"
#include "utils.h"
#ifdef DBUS_ENABLE_STATS
-static DBusMessage *
-new_asv_reply (DBusMessage *message,
- DBusMessageIter *iter,
- DBusMessageIter *arr_iter)
-{
- DBusMessage *reply = dbus_message_new_method_return (message);
-
- if (reply == NULL)
- return NULL;
-
- dbus_message_iter_init_append (reply, iter);
-
- if (!dbus_message_iter_open_container (iter, DBUS_TYPE_ARRAY, "{sv}",
- arr_iter))
- {
- dbus_message_unref (reply);
- return NULL;
- }
-
- return reply;
-}
-
-static dbus_bool_t
-open_asv_entry (DBusMessageIter *arr_iter,
- DBusMessageIter *entry_iter,
- const char *key,
- const char *type,
- DBusMessageIter *var_iter)
-{
- if (!dbus_message_iter_open_container (arr_iter, DBUS_TYPE_DICT_ENTRY,
- NULL, entry_iter))
- return FALSE;
-
- if (!dbus_message_iter_append_basic (entry_iter, DBUS_TYPE_STRING, &key))
- {
- dbus_message_iter_abandon_container (arr_iter, entry_iter);
- return FALSE;
- }
-
- if (!dbus_message_iter_open_container (entry_iter, DBUS_TYPE_VARIANT,
- type, var_iter))
- {
- dbus_message_iter_abandon_container (arr_iter, entry_iter);
- return FALSE;
- }
-
- return TRUE;
-}
-
-static dbus_bool_t
-close_asv_entry (DBusMessageIter *arr_iter,
- DBusMessageIter *entry_iter,
- DBusMessageIter *var_iter)
-{
- if (!dbus_message_iter_close_container (entry_iter, var_iter))
- {
- dbus_message_iter_abandon_container (arr_iter, entry_iter);
- return FALSE;
- }
-
- if (!dbus_message_iter_close_container (arr_iter, entry_iter))
- return FALSE;
-
- return TRUE;
-}
-
-static dbus_bool_t
-close_asv_reply (DBusMessageIter *iter,
- DBusMessageIter *arr_iter)
-{
- return dbus_message_iter_close_container (iter, arr_iter);
-}
-
-static void
-abandon_asv_entry (DBusMessageIter *arr_iter,
- DBusMessageIter *entry_iter,
- DBusMessageIter *var_iter)
-{
- dbus_message_iter_abandon_container (entry_iter, var_iter);
- dbus_message_iter_abandon_container (arr_iter, entry_iter);
-}
-
-static void
-abandon_asv_reply (DBusMessageIter *iter,
- DBusMessageIter *arr_iter)
-{
- dbus_message_iter_abandon_container (iter, arr_iter);
-}
-
-static dbus_bool_t
-asv_add_uint32 (DBusMessageIter *iter,
- DBusMessageIter *arr_iter,
- const char *key,
- dbus_uint32_t value)
-{
- DBusMessageIter entry_iter, var_iter;
-
- if (!open_asv_entry (arr_iter, &entry_iter, key, DBUS_TYPE_UINT32_AS_STRING,
- &var_iter))
- goto oom;
-
- if (!dbus_message_iter_append_basic (&var_iter, DBUS_TYPE_UINT32,
- &value))
- {
- abandon_asv_entry (arr_iter, &entry_iter, &var_iter);
- goto oom;
- }
-
- if (!close_asv_entry (arr_iter, &entry_iter, &var_iter))
- goto oom;
-
- return TRUE;
-
-oom:
- abandon_asv_reply (iter, arr_iter);
- return FALSE;
-}
-
-static dbus_bool_t
-asv_add_string (DBusMessageIter *iter,
- DBusMessageIter *arr_iter,
- const char *key,
- const char *value)
-{
- DBusMessageIter entry_iter, var_iter;
-
- if (!open_asv_entry (arr_iter, &entry_iter, key, DBUS_TYPE_STRING_AS_STRING,
- &var_iter))
- goto oom;
-
- if (!dbus_message_iter_append_basic (&var_iter, DBUS_TYPE_STRING,
- &value))
- {
- abandon_asv_entry (arr_iter, &entry_iter, &var_iter);
- goto oom;
- }
-
- if (!close_asv_entry (arr_iter, &entry_iter, &var_iter))
- goto oom;
-
- return TRUE;
-
-oom:
- abandon_asv_reply (iter, arr_iter);
- return FALSE;
-}
-
dbus_bool_t
bus_stats_handle_get_stats (DBusConnection *connection,
BusTransaction *transaction,
DBusMessage *message,
DBusError *error)
{
+ BusContext *context;
BusConnections *connections;
DBusMessage *reply = NULL;
DBusMessageIter iter, arr_iter;
@@ -191,49 +50,56 @@ bus_stats_handle_get_stats (DBusConnection *connection,
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
- connections = bus_transaction_get_connections (transaction);
+ if (!bus_driver_check_message_is_for_us (message, error))
+ return FALSE;
+
+ context = bus_transaction_get_context (transaction);
+ connections = bus_context_get_connections (context);
- reply = new_asv_reply (message, &iter, &arr_iter);
+ reply = _dbus_asv_new_method_return (message, &iter, &arr_iter);
if (reply == NULL)
goto oom;
/* Globals */
- if (!asv_add_uint32 (&iter, &arr_iter, "Serial", stats_serial++))
- goto oom;
-
_dbus_list_get_stats (&in_use, &in_free_list, &allocated);
- if (!asv_add_uint32 (&iter, &arr_iter, "ListMemPoolUsedBytes", in_use) ||
- !asv_add_uint32 (&iter, &arr_iter, "ListMemPoolCachedBytes",
- in_free_list) ||
- !asv_add_uint32 (&iter, &arr_iter, "ListMemPoolAllocatedBytes",
- allocated))
- goto oom;
+
+ if (!_dbus_asv_add_uint32 (&arr_iter, "Serial", stats_serial++) ||
+ !_dbus_asv_add_uint32 (&arr_iter, "ListMemPoolUsedBytes", in_use) ||
+ !_dbus_asv_add_uint32 (&arr_iter, "ListMemPoolCachedBytes", in_free_list) ||
+ !_dbus_asv_add_uint32 (&arr_iter, "ListMemPoolAllocatedBytes", allocated))
+ {
+ _dbus_asv_abandon (&iter, &arr_iter);
+ goto oom;
+ }
/* Connections */
- if (!asv_add_uint32 (&iter, &arr_iter, "ActiveConnections",
+ if (!_dbus_asv_add_uint32 (&arr_iter, "ActiveConnections",
bus_connections_get_n_active (connections)) ||
- !asv_add_uint32 (&iter, &arr_iter, "IncompleteConnections",
+ !_dbus_asv_add_uint32 (&arr_iter, "IncompleteConnections",
bus_connections_get_n_incomplete (connections)) ||
- !asv_add_uint32 (&iter, &arr_iter, "MatchRules",
+ !_dbus_asv_add_uint32 (&arr_iter, "MatchRules",
bus_connections_get_total_match_rules (connections)) ||
- !asv_add_uint32 (&iter, &arr_iter, "PeakMatchRules",
+ !_dbus_asv_add_uint32 (&arr_iter, "PeakMatchRules",
bus_connections_get_peak_match_rules (connections)) ||
- !asv_add_uint32 (&iter, &arr_iter, "PeakMatchRulesPerConnection",
+ !_dbus_asv_add_uint32 (&arr_iter, "PeakMatchRulesPerConnection",
bus_connections_get_peak_match_rules_per_conn (connections)) ||
- !asv_add_uint32 (&iter, &arr_iter, "BusNames",
+ !_dbus_asv_add_uint32 (&arr_iter, "BusNames",
bus_connections_get_total_bus_names (connections)) ||
- !asv_add_uint32 (&iter, &arr_iter, "PeakBusNames",
+ !_dbus_asv_add_uint32 (&arr_iter, "PeakBusNames",
bus_connections_get_peak_bus_names (connections)) ||
- !asv_add_uint32 (&iter, &arr_iter, "PeakBusNamesPerConnection",
+ !_dbus_asv_add_uint32 (&arr_iter, "PeakBusNamesPerConnection",
bus_connections_get_peak_bus_names_per_conn (connections)))
- goto oom;
+ {
+ _dbus_asv_abandon (&iter, &arr_iter);
+ goto oom;
+ }
/* end */
- if (!close_asv_reply (&iter, &arr_iter))
+ if (!_dbus_asv_close (&iter, &arr_iter))
goto oom;
if (!bus_transaction_send_from_driver (transaction, connection, reply))
@@ -269,6 +135,9 @@ bus_stats_handle_get_connection_stats (DBusConnection *caller_connection,
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
+ if (!bus_driver_check_message_is_for_us (message, error))
+ return FALSE;
+
registry = bus_connection_get_registry (caller_connection);
if (! dbus_message_get_args (message, error,
@@ -289,25 +158,28 @@ bus_stats_handle_get_connection_stats (DBusConnection *caller_connection,
stats_connection = bus_service_get_primary_owners_connection (service);
_dbus_assert (stats_connection != NULL);
- reply = new_asv_reply (message, &iter, &arr_iter);
+ reply = _dbus_asv_new_method_return (message, &iter, &arr_iter);
if (reply == NULL)
goto oom;
/* Bus daemon per-connection stats */
- if (!asv_add_uint32 (&iter, &arr_iter, "Serial", stats_serial++) ||
- !asv_add_uint32 (&iter, &arr_iter, "MatchRules",
+ if (!_dbus_asv_add_uint32 (&arr_iter, "Serial", stats_serial++) ||
+ !_dbus_asv_add_uint32 (&arr_iter, "MatchRules",
bus_connection_get_n_match_rules (stats_connection)) ||
- !asv_add_uint32 (&iter, &arr_iter, "PeakMatchRules",
+ !_dbus_asv_add_uint32 (&arr_iter, "PeakMatchRules",
bus_connection_get_peak_match_rules (stats_connection)) ||
- !asv_add_uint32 (&iter, &arr_iter, "BusNames",
+ !_dbus_asv_add_uint32 (&arr_iter, "BusNames",
bus_connection_get_n_services_owned (stats_connection)) ||
- !asv_add_uint32 (&iter, &arr_iter, "PeakBusNames",
+ !_dbus_asv_add_uint32 (&arr_iter, "PeakBusNames",
bus_connection_get_peak_bus_names (stats_connection)) ||
- !asv_add_string (&iter, &arr_iter, "UniqueName",
+ !_dbus_asv_add_string (&arr_iter, "UniqueName",
bus_connection_get_name (stats_connection)))
- goto oom;
+ {
+ _dbus_asv_abandon (&iter, &arr_iter);
+ goto oom;
+ }
/* DBusConnection per-connection stats */
@@ -317,21 +189,24 @@ bus_stats_handle_get_connection_stats (DBusConnection *caller_connection,
&out_messages, &out_bytes, &out_fds,
&out_peak_bytes, &out_peak_fds);
- if (!asv_add_uint32 (&iter, &arr_iter, "IncomingMessages", in_messages) ||
- !asv_add_uint32 (&iter, &arr_iter, "IncomingBytes", in_bytes) ||
- !asv_add_uint32 (&iter, &arr_iter, "IncomingFDs", in_fds) ||
- !asv_add_uint32 (&iter, &arr_iter, "PeakIncomingBytes", in_peak_bytes) ||
- !asv_add_uint32 (&iter, &arr_iter, "PeakIncomingFDs", in_peak_fds) ||
- !asv_add_uint32 (&iter, &arr_iter, "OutgoingMessages", out_messages) ||
- !asv_add_uint32 (&iter, &arr_iter, "OutgoingBytes", out_bytes) ||
- !asv_add_uint32 (&iter, &arr_iter, "OutgoingFDs", out_fds) ||
- !asv_add_uint32 (&iter, &arr_iter, "PeakOutgoingBytes", out_peak_bytes) ||
- !asv_add_uint32 (&iter, &arr_iter, "PeakOutgoingFDs", out_peak_fds))
- goto oom;
+ if (!_dbus_asv_add_uint32 (&arr_iter, "IncomingMessages", in_messages) ||
+ !_dbus_asv_add_uint32 (&arr_iter, "IncomingBytes", in_bytes) ||
+ !_dbus_asv_add_uint32 (&arr_iter, "IncomingFDs", in_fds) ||
+ !_dbus_asv_add_uint32 (&arr_iter, "PeakIncomingBytes", in_peak_bytes) ||
+ !_dbus_asv_add_uint32 (&arr_iter, "PeakIncomingFDs", in_peak_fds) ||
+ !_dbus_asv_add_uint32 (&arr_iter, "OutgoingMessages", out_messages) ||
+ !_dbus_asv_add_uint32 (&arr_iter, "OutgoingBytes", out_bytes) ||
+ !_dbus_asv_add_uint32 (&arr_iter, "OutgoingFDs", out_fds) ||
+ !_dbus_asv_add_uint32 (&arr_iter, "PeakOutgoingBytes", out_peak_bytes) ||
+ !_dbus_asv_add_uint32 (&arr_iter, "PeakOutgoingFDs", out_peak_fds))
+ {
+ _dbus_asv_abandon (&iter, &arr_iter);
+ goto oom;
+ }
/* end */
- if (!close_asv_reply (&iter, &arr_iter))
+ if (!_dbus_asv_close (&iter, &arr_iter))
goto oom;
if (!bus_transaction_send_from_driver (transaction, caller_connection,
diff --git a/bus/system.conf.in b/bus/system.conf.in
index 92f4cc42..851b9e63 100644
--- a/bus/system.conf.in
+++ b/bus/system.conf.in
@@ -68,6 +68,14 @@
<deny send_destination="org.freedesktop.DBus"
send_interface="org.freedesktop.DBus"
send_member="UpdateActivationEnvironment"/>
+ <deny send_destination="org.freedesktop.DBus"
+ send_interface="org.freedesktop.systemd1.Activator"/>
+ </policy>
+
+ <!-- Only systemd, which runs as root, may report activation failures. -->
+ <policy user="root">
+ <allow send_destination="org.freedesktop.DBus"
+ send_interface="org.freedesktop.systemd1.Activator"/>
</policy>
<!-- Config files are placed here that among other things, punch
diff --git a/bus/test-launch-helper.c b/bus/test-launch-helper.c
index ab36b6ec..e9ba412a 100644
--- a/bus/test-launch-helper.c
+++ b/bus/test-launch-helper.c
@@ -28,8 +28,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <dbus/dbus-internals.h>
+#include <dbus/dbus-misc.h>
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
static void
die (const char *failure)
{
@@ -56,7 +57,7 @@ test_post_hook (const char *name)
{
check_memleaks (name);
}
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
#ifdef ACTIVATION_LAUNCHER_DO_OOM
@@ -97,7 +98,7 @@ bus_activation_helper_oom_test (void *data)
int
main (int argc, char **argv)
{
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
const char *dir;
DBusString config_file;
@@ -122,8 +123,8 @@ main (int argc, char **argv)
return 1;
/* use a config file that will actually work... */
- _dbus_setenv ("TEST_LAUNCH_HELPER_CONFIG",
- _dbus_string_get_const_data (&config_file));
+ dbus_setenv ("TEST_LAUNCH_HELPER_CONFIG",
+ _dbus_string_get_const_data (&config_file));
_dbus_string_free (&config_file);
@@ -137,7 +138,7 @@ main (int argc, char **argv)
printf ("%s: Success\n", argv[0]);
return 0;
-#else /* DBUS_BUILD_TESTS */
+#else /* DBUS_ENABLE_EMBEDDED_TESTS */
printf ("Not compiled with test support\n");
diff --git a/bus/test-main.c b/bus/test-main.c
index 0f736c7c..01d22870 100644
--- a/bus/test-main.c
+++ b/bus/test-main.c
@@ -31,7 +31,7 @@
#include <dbus/dbus-message-internal.h>
#include "selinux.h"
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
static void
die (const char *failure)
{
@@ -52,7 +52,7 @@ check_memleaks (const char *name)
die ("memleaks");
}
}
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
static DBusInitialFDs *initial_fds = NULL;
@@ -84,7 +84,7 @@ test_post_hook (void)
int
main (int argc, char **argv)
{
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
const char *dir;
const char *only;
DBusString test_data_dir;
@@ -181,7 +181,7 @@ main (int argc, char **argv)
return 0;
-#else /* DBUS_BUILD_TESTS */
+#else /* DBUS_ENABLE_EMBEDDED_TESTS */
printf ("Not compiled with test support\n");
diff --git a/bus/test-system.c b/bus/test-system.c
index 56a7d4ea..5f02d0ab 100644
--- a/bus/test-system.c
+++ b/bus/test-system.c
@@ -29,7 +29,7 @@
#include <dbus/dbus-sysdeps.h>
#include <dbus/dbus-internals.h>
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
static void
die (const char *failure)
{
@@ -50,7 +50,7 @@ check_memleaks (const char *name)
die ("memleaks");
}
}
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
static void
test_pre_hook (void)
@@ -67,7 +67,7 @@ test_post_hook (void)
int
main (int argc, char **argv)
{
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
const char *dir;
DBusString test_data_dir;
@@ -98,7 +98,7 @@ main (int argc, char **argv)
printf ("%s: Success\n", argv[0]);
return 0;
-#else /* DBUS_BUILD_TESTS */
+#else /* DBUS_ENABLE_EMBEDDED_TESTS */
printf ("Not compiled with test support\n");
diff --git a/bus/test.c b/bus/test.c
index 1ca96070..31ef4c8f 100644
--- a/bus/test.c
+++ b/bus/test.c
@@ -23,7 +23,7 @@
#include <config.h>
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#include "test.h"
#include <dbus/dbus-internals.h>
#include <dbus/dbus-list.h>
diff --git a/bus/test.h b/bus/test.h
index 98a2c6ba..38b74e89 100644
--- a/bus/test.h
+++ b/bus/test.h
@@ -24,7 +24,7 @@
#ifndef BUS_TEST_H
#define BUS_TEST_H
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#include <dbus/dbus.h>
#include <dbus/dbus-string.h>
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index 000acda2..c767c171 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -1,3 +1,9 @@
+# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/modules")
+
+# we do not need to have WIN32 defined
+set(CMAKE_LEGACY_CYGWIN_WIN32 0)
+
project(dbus)
# we need to be up to date
@@ -6,8 +12,6 @@ if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
-# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
-set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/modules")
# detect version
include(MacrosAutotools)
@@ -15,6 +19,14 @@ autoversion(../configure.ac dbus)
# used by file version info
set (DBUS_PATCH_VERSION "0")
+# set PACKAGE_... variables
+autopackage(
+ dbus
+ ${DBUS_VERSION_STRING}
+ "http://dbus.freedesktop.org"
+ "https://bugs.freedesktop.org/enter_bug.cgi?product=dbus"
+)
+
include(Macros)
TIMESTAMP(DBUS_BUILD_TIMESTAMP)
@@ -60,12 +72,18 @@ set(EXPANDED_SYSCONFDIR ${DBUS_INSTALL_DIR}/etc)
set(EXPANDED_DATADIR ${DBUS_INSTALL_DIR}/${DBUS_DATADIR})
set(DBUS_MACHINE_UUID_FILE ${DBUS_INSTALL_DIR}/lib/dbus/machine-id)
set(DBUS_BINDIR ${EXPANDED_BINDIR})
-set(DBUS_DAEMONDIR ${EXPANDED_BINDIR})
+set(DBUS_DAEMONDIR ${EXPANDED_BINDIR})
#enable building of shared library
SET(BUILD_SHARED_LIBS ON)
+if(WIN32)
+ set(INSTALL_TARGETS_DEFAULT_ARGS RUNTIME DESTINATION "bin" LIBRARY DESTINATION "lib" ARCHIVE DESTINATION "lib")
+else()
+ set(INSTALL_TARGETS_DEFAULT_ARGS RUNTIME DESTINATION "${EXPANDED_LIBDIR}" LIBRARY DESTINATION "${EXPANDED_LIBDIR}" ARCHIVE DESTINATION "${EXPANDED_LIBDIR}")
+endif()
+
if (CYGWIN)
set (WIN32)
endif (CYGWIN)
@@ -79,30 +97,30 @@ if (WIN32)
addExplorerWrapper(${CMAKE_PROJECT_NAME})
endif (WIN32)
-option (DBUS_USE_EXPAT "Use expat (== ON) or libxml2 (==OFF)" ON)
-
if(NOT WIN32)
option (DBUS_ENABLE_ABSTRACT_SOCKETS "enable support for abstract sockets" ON)
set (CMAKE_THREAD_PREFER_PTHREAD ON)
include (FindThreads)
endif(NOT WIN32)
-#AC_ARG_ENABLE(asserts, AS_HELP_STRING([--enable-asserts],[include assertion checks]),enable_asserts=$enableval,enable_asserts=$USE_MAINTAINER_MODE)
-option (DBUS_DISABLE_ASSERTS "Disable assertion checking" OFF)
+option (DBUS_DISABLE_ASSERT "Disable assertion checking" OFF)
option (DBUS_ENABLE_STATS "enable bus daemon usage statistics" OFF)
-option (DBUS_ENABLE_STATS "enable bus daemon usage statistics" OFF)
+if(WIN32)
+ set(FD_SETSIZE "8192" CACHE STRING "The maximum number of connections that can be handled at once")
+endif()
-if (DBUS_USE_EXPAT)
- find_package(LibExpat)
-else ()
- find_package(LibXml2)
-endif ()
+find_package(EXPAT)
find_package(X11)
+find_package(GLib2)
+find_package(GObject)
+if(GLIB2_FOUND AND GOBJECT_FOUND)
+ option (DBUS_WITH_GLIB "build with glib" ON)
+endif()
# analogous to AC_USE_SYSTEM_EXTENSIONS in configure.ac
-add_definitions(-D_POSIX_C_SOURCE=199309L -D_GNU_SOURCE)
+add_definitions(-D_GNU_SOURCE)
# do config checks
INCLUDE(ConfigureChecks.cmake)
@@ -157,12 +175,12 @@ if(WIN32)
endif(MSVC)
endif(WIN32)
-if (UNIX AND NOT DBUS_DISABLE_ASSERTS)
+if (UNIX AND NOT DBUS_DISABLE_ASSERT)
# required for backtrace
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wl,--export-dynamic")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wl,--export-dynamic")
add_definitions(-DDBUS_BUILT_R_DYNAMIC)
-endif (UNIX AND NOT DBUS_DISABLE_ASSERTS)
+endif (UNIX AND NOT DBUS_DISABLE_ASSERT)
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG")
@@ -227,11 +245,12 @@ ENABLE_TESTING()
########### command line options ###############
# TODO: take check from configure.in
-#AC_ARG_ENABLE(tests, AS_HELP_STRING([--enable-tests],[enable unit test code]),enable_tests=$enableval,enable_tests=$USE_MAINTAINER_MODE)
option (DBUS_BUILD_TESTS "enable unit test code" ON)
if(DBUS_BUILD_TESTS)
- add_definitions(-DDBUS_BUILD_TESTS -DDBUS_ENABLE_EMBEDDED_TESTS)
+ set (DBUS_ENABLE_EMBEDDED_TESTS ON)
+ set (DBUS_ENABLE_MODULAR_TESTS ON)
+ add_definitions(-DDBUS_ENABLE_EMBEDDED_TESTS -DDBUS_ENABLE_MODULAR_TESTS)
endif(DBUS_BUILD_TESTS)
option (DBUS_USE_OUTPUT_DEBUG_STRING "enable win32 debug port for message output" OFF)
@@ -244,7 +263,6 @@ if(WIN32)
option (DBUS_SERVICE "enable dbus service installer" OFF)
endif(WIN32)
-#AC_ARG_ENABLE(ansi, AS_HELP_STRING([--enable-ansi],[enable -ansi -pedantic gcc flags]),enable_ansi=$enableval,enable_ansi=no)
option (DBUS_ENABLE_ANSI "enable -ansi -pedantic gcc flags" OFF)
if(DBUS_ENABLE_ANSI)
if(NOT MSVC)
@@ -254,14 +272,11 @@ if(DBUS_ENABLE_ANSI)
endif(NOT MSVC)
endif(DBUS_ENABLE_ANSI)
-#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)
option (DBUS_ENABLE_VERBOSE_MODE "support verbose debug mode" ON)
-#AC_ARG_ENABLE(checks, AS_HELP_STRING([--enable-checks],[include sanity checks on public API]),enable_checks=$enableval,enable_checks=yes)
option (DBUS_DISABLE_CHECKS "Disable public API sanity checking" OFF)
if(NOT MSVC)
- #AC_ARG_ENABLE(gcov, AS_HELP_STRING([--enable-gcov],[compile with coverage profiling instrumentation (gcc only)]),enable_gcov=$enableval,enable_gcov=no)
option (DBUS_GCOV_ENABLED "compile with coverage profiling instrumentation (gcc only)" OFF)
if(DBUS_GCOV_ENABLED)
add_definitions(-fprofile-arcs -ftest-coverage)
@@ -271,21 +286,27 @@ if(NOT MSVC)
endif(DBUS_GCOV_ENABLED)
endif(NOT MSVC)
-#AC_ARG_ENABLE(abstract-sockets, AS_HELP_STRING([--enable-abstract-sockets],[use abstract socket namespace (linux only)]),enable_abstract_sockets=$enableval,enable_abstract_sockets=auto)
-# -> moved before include(ConfigureChecks.cmake)
-
-#AC_ARG_ENABLE(selinux, AS_HELP_STRING([--enable-selinux],[build with SELinux support]),enable_selinux=$enableval,enable_selinux=auto)
-#selinux missing
-
-#AC_ARG_ENABLE(dnotify, AS_HELP_STRING([--enable-dnotify],[build with dnotify support (linux only)]),enable_dnotify=$enableval,enable_dnotify=auto)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
- option (DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX "build with dnotify support (linux only)" ON) # add a check !
+ option (DBUS_BUS_ENABLE_INOTIFY "build with inotify support (linux only)" ON)
+ if(DBUS_BUS_ENABLE_INOTIFY)
+ check_include_file(sys/inotify.h HAVE_SYS_INOTIFY_H)
+ if(NOT HAVE_SYS_INOTIFY_H)
+ message(FATAL_ERROR "sys/inotify.h not found!")
+ endif(NOT HAVE_SYS_INOTIFY_H)
+ endif(DBUS_BUS_ENABLE_INOTIFY)
+elseif("${CMAKE_SYSTEM_NAME}" MATCHES ".*BSD")
+ option (DBUS_BUS_ENABLE_KQUEUE "build with kqueue support (FreeBSD only)" ON)
+ if(DBUS_BUS_ENABLE_KQUEUE)
+ # cmake check a header by compiling a test program with
+ # the header, sys/event.h needs stdint.h and sys/types.h
+ # to work.
+ check_include_files("stdint.h;sys/types.h;sys/event.h" HAVE_SYS_EVENT_H)
+ if(NOT HAVE_SYS_EVENT_H)
+ message(FATAL_ERROR "sys/event.h not found!")
+ endif(NOT HAVE_SYS_EVENT_H)
+ endif(DBUS_BUS_ENABLE_KQUEUE)
endif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
-#AC_ARG_ENABLE(kqueue, AS_HELP_STRING([--enable-kqueue],[build with kqueue support (FreeBSD only)]),enable_kqueue=$enableval,enable_kqueue=auto)
-#missing
-
-#AC_ARG_ENABLE(console-owner-file, AS_HELP_STRING([--enable-console-owner-file],[enable console owner file]),enable_console_owner_file=$enableval,enable_console_owner_file=auto)
STRING(TOUPPER ${CMAKE_SYSTEM_NAME} sysname)
if("${sysname}" MATCHES ".*SOLARIS.*")
option (HAVE_CONSOLE_OWNER_FILE "enable console owner file (solaris only)" ON)
@@ -294,31 +315,14 @@ if("${sysname}" MATCHES ".*SOLARIS.*")
endif(HAVE_CONSOLE_OWNER_FILE)
endif("${sysname}" MATCHES ".*SOLARIS.*")
-#AC_ARG_WITH(xml, AS_HELP_STRING([--with-xml=[libxml/expat]],[XML library to use]))
-if(NOT LIBXML2_FOUND AND NOT LIBEXPAT_FOUND)
- message(FATAL "Neither expat nor libxml2 found!")
-endif(NOT LIBXML2_FOUND AND NOT LIBEXPAT_FOUND)
-
-if(DBUS_USE_EXPAT)
- SET(XML_LIB "Expat")
- SET(XML_LIBRARY ${LIBEXPAT_LIBRARIES})
- SET(XML_INCLUDE_DIR ${LIBEXPAT_INCLUDE_DIR})
-else(DBUS_USE_EXPAT)
- SET(XML_LIB "LibXML2")
- SET(XML_LIBRARY ${LIBXML2_LIBRARIES})
- SET(XML_INCLUDE_DIR ${LIBXML2_INCLUDE_DIR})
-endif(DBUS_USE_EXPAT)
-
-
-#AC_ARG_WITH(init-scripts, AS_HELP_STRING([--with-init-scripts=[redhat]],[Style of init scripts to install]))
-#AC_ARG_WITH(session-socket-dir, AS_HELP_STRING([--with-session-socket-dir=[dirname]],[Where to put sockets for the per-login-session message bus]))
-#AC_ARG_WITH(test-socket-dir, AS_HELP_STRING([--with-test-socket-dir=[dirname]],[Where to put sockets for make check]))
-#AC_ARG_WITH(system-pid-file, AS_HELP_STRING([--with-system-pid-file=[pidfile]],[PID file for systemwide daemon]))
-#AC_ARG_WITH(system-socket, AS_HELP_STRING([--with-system-socket=[filename]],[UNIX domain socket for systemwide daemon]))
-#AC_ARG_WITH(console-auth-dir, AS_HELP_STRING([--with-console-auth-dir=[dirname]],[directory to check for console ownerhip]))
-#AC_ARG_WITH(console-owner-file, AS_HELP_STRING([--with-console-owner-file=[filename]],[file whose owner determines current console owner]))
-#AC_ARG_WITH(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]))
+if(NOT EXPAT_FOUND)
+ message(FATAL_ERROR "expat not found!")
+endif(NOT EXPAT_FOUND)
+
+SET(XML_LIB "Expat")
+SET(XML_LIBRARY ${EXPAT_LIBRARIES})
+SET(XML_INCLUDE_DIR ${EXPAT_INCLUDE_DIR})
+
# all missing or hardcoded for now
# 'hidden' ones
@@ -353,9 +357,8 @@ endif(X11_FOUND)
# test binary names
if (WIN32)
- # Automake calls this EXEEXT, and CMake doesn't have a standard name
- # for it; follow Automake's naming convention so we can share .in files
- set (EXEEXT ".exe")
+ # follow Automake's naming convention so we can share .in files
+ set (EXEEXT ${CMAKE_EXECUTABLE_SUFFIX})
endif(WIN32)
if (MSVC_IDE)
@@ -390,7 +393,7 @@ endif (MSVC_IDE)
else (NOT $ENV{TMP} STREQUAL "")
if (WIN32)
#Should never happen, both TMP and TEMP seem always set on Windows
- message(FATAL "Could not determine a usable temporary directory")
+ message(FATAL_ERROR "Could not determine a usable temporary directory")
else(WIN32)
set (DBUS_SESSION_SOCKET_DIR /tmp)
endif(WIN32)
@@ -398,17 +401,6 @@ endif (MSVC_IDE)
endif (NOT $ENV{TEMP} STREQUAL "")
endif (NOT $ENV{TMPDIR} STREQUAL "")
-#AC_ARG_WITH(test-socket-dir, AS_HELP_STRING([--with-test-socket-dir=[dirname]],[Where to put sockets for make check]))
-
-#AC_ARG_WITH(system-pid-file, AS_HELP_STRING([--with-system-pid-file=[pidfile]],[PID file for systemwide daemon]))
-
-#if ! test -z "$with_system_pid_file"; then
-# DBUS_SYSTEM_PID_FILE=$with_system_pid_file
-#elif test x$operating_system = xredhat ; then
-# DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/messagebus.pid
-#else
-# DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/dbus/pid
-#fi
# TODO: fix redhet
if (WIN32)
# bus-test expects a non empty string
@@ -417,32 +409,35 @@ else (WIN32)
set (DBUS_SYSTEM_PID_FILE ${EXPANDED_LOCALSTATEDIR}/run/dbus/pid)
endif (WIN32)
-#AC_ARG_WITH(system-socket, AS_HELP_STRING([--with-system-socket=[filename]],[UNIX domain socket for systemwide daemon]))
-
-#AC_ARG_WITH(console-auth-dir, AS_HELP_STRING([--with-console-auth-dir=[dirname]],[directory to check for console ownerhip]))
-
if (WIN32)
set (DBUS_CONSOLE_AUTH_DIR "")
else (WIN32)
set (DBUS_CONSOLE_AUTH_DIR "/var/run/console/")
endif (WIN32)
-#AC_ARG_WITH(dbus_user, AS_HELP_STRING([--with-dbus-user=<user>],[User for running the DBUS daemon (messagebus)]))
-
set (DBUS_USER )
+# This won't work on Windows. It's not meant to - the system bus is
+# meaningless on Windows anyway.
+#
+# This has to be suitable for hard-coding in client libraries as well as
+# in the dbus-daemon's configuration, so it has to be valid to listen on
+# and also to connect to. If this ever changes, it'll need to be split into
+# two variables, one for the listening address and one for the connecting
+# address.
+set (DBUS_SYSTEM_BUS_DEFAULT_ADDRESS "unix:path=${EXPANDED_LOCALSTATEDIR}/run/dbus/system_bus_socket" CACHE STRING "system bus default address")
if (WIN32)
- set (DBUS_SYSTEM_BUS_DEFAULT_ADDRESS "nonce-tcp:" CACHE STRING "system bus default address")
- set (DBUS_SESSION_BUS_DEFAULT_ADDRESS "nonce-tcp:" CACHE STRING "session bus default address")
+ set (DBUS_SESSION_BUS_LISTEN_ADDRESS "autolaunch:" CACHE STRING "session bus default listening address")
+ set (DBUS_SESSION_BUS_CONNECT_ADDRESS "autolaunch:" CACHE STRING "session bus fallback address for clients")
set (DBUS_SYSTEM_CONFIG_FILE "etc/dbus-1/system.conf")
set (DBUS_SESSION_CONFIG_FILE "etc/dbus-1/session.conf")
# bus-test expects a non empty string
set (DBUS_USER "Administrator")
else (WIN32)
- set (DBUS_SYSTEM_BUS_DEFAULT_ADDRESS "unix:tmpdir=" CACHE STRING "system bus default address")
- set (DBUS_SESSION_BUS_DEFAULT_ADDRESS "unix:path=${DBUS_SESSION_SOCKET_DIR}" CACHE STRING "session bus default address")
+ set (DBUS_SESSION_BUS_LISTEN_ADDRESS "unix:tmpdir=${DBUS_SESSION_SOCKET_DIR}" CACHE STRING "session bus default listening address")
+ set (DBUS_SESSION_BUS_CONNECT_ADDRESS "autolaunch:" CACHE STRING "session bus fallback address for clients")
set (sysconfdir "")
set (configdir ${sysconfdir}/dbus-1 )
set (DBUS_SYSTEM_CONFIG_FILE ${configdir}/system.conf)
@@ -472,6 +467,7 @@ if (DBUS_BUILD_TESTS)
set(DBUS_TEST_DATA ${CMAKE_BINARY_DIR}/test/data)
set(TEST_SOCKET_DIR ${DBUS_SESSION_SOCKET_DIR} )
set(TEST_LAUNCH_HELPER_BINARY ${EXECUTABLE_OUTPUT_PATH}/dbus-daemon-launch-helper-test)
+ set(TEST_BUS_LAUNCH_BINARY ${EXECUTABLE_OUTPUT_PATH}/dbus-launch${EXEEXT})
if (UNIX)
set (TEST_LISTEN "unix:tmpdir=${TEST_SOCKET_DIR}")
endif (UNIX)
@@ -487,7 +483,9 @@ set(DBUS_INTERNAL_LIBRARIES dbus-internal)
# important note: DBUS_INTERNAL_xxxxx_DEFINITIONS must *not* be set when building dbus-1 library
set (DBUS_INTERNAL_ADD_LIBRARY_OPTIONS STATIC)
set (DBUS_INTERNAL_LIBRARY_DEFINITIONS "-DDBUS_STATIC_BUILD")
-set (DBUS_INTERNAL_CLIENT_DEFINITIONS "-DDBUS_STATIC_BUILD")
+# For now, the CMake build system doesn't support replacing the internal
+# main loop with dbus-glib
+set (DBUS_INTERNAL_CLIENT_DEFINITIONS "-DDBUS_STATIC_BUILD -DDBUS_COMPILATION -DDBUS_TEST_USE_INTERNAL")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h )
@@ -526,7 +524,6 @@ message(" install exec_prefix: ${exec_prefix} "
message(" install libdir: ${EXPANDED_LIBDIR} ")
message(" install bindir: ${EXPANDED_BINDIR} ")
message(" install sysconfdir: ${EXPANDED_SYSCONFDIR} ")
-#message(" install localstatedir: ${EXPANDED_LOCALSTATEDIR} ")
message(" install datadir: ${EXPANDED_DATADIR} ")
message(" source code location: ${DBUS_SOURCE_DIR} ")
message(" build dir: ${CMAKE_BINARY_DIR} ")
@@ -545,27 +542,24 @@ message(" Doxygen: ${DOXYGEN} "
message(" Docbook Generator: ${DOCBOOK_GENERATOR_NAME} ")
-#message(" Maintainer mode: ${USE_MAINTAINER_MODE} ")
message(" gcc coverage profiling: ${DBUS_GCOV_ENABLED} ")
message(" Building unit tests: ${DBUS_BUILD_TESTS} ")
+message(" Building with GLib: ${DBUS_WITH_GLIB} ")
message(" Building verbose mode: ${DBUS_ENABLE_VERBOSE_MODE} ")
-message(" Building w/o assertions: ${DBUS_DISABLE_ASSERTS} ")
+message(" Building w/o assertions: ${DBUS_DISABLE_ASSERT} ")
message(" Building w/o checks: ${DBUS_DISABLE_CHECKS} ")
message(" Building bus stats API: ${DBUS_ENABLE_STATS} ")
message(" installing system libs: ${DBUS_INSTALL_SYSTEM_LIBS} ")
-#message(" Building SELinux support: ${have_selinux} ")
-#message(" Building dnotify support: ${have_dnotify} ")
+message(" Building inotify support: ${DBUS_BUS_ENABLE_INOTIFY} ")
+message(" Building kqueue support: ${DBUS_BUS_ENABLE_KQUEUE} ")
message(" Building Doxygen docs: ${DBUS_ENABLE_DOXYGEN_DOCS} ")
message(" Building XML docs: ${DBUS_ENABLE_XML_DOCS} ")
-#message(" Gettext libs (empty OK): ${INTLLIBS} ")
-message(" Using XML parser: ${XML_LIB} ")
message(" Daemon executable name: ${DBUS_DAEMON_NAME}")
if (WIN32)
message(" System bus address: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS} ")
-message(" Session bus address: ${DBUS_SESSION_BUS_DEFAULT_ADDRESS} ")
+message(" Session bus listens on: ${DBUS_SESSION_BUS_LISTEN_ADDRESS} ")
+message(" Session clients connect to: ${DBUS_SESSION_BUS_CONNECT_ADDRESS} ")
else (WIN32)
-#message(" Init scripts style: ${with_init_scripts} ")
-#message(" Abstract socket names: ${have_abstract_sockets} ")
message(" System bus socket: ${DBUS_SYSTEM_SOCKET} ")
message(" System bus address: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS} ")
message(" System bus PID file: ${DBUS_SYSTEM_PID_FILE} ")
@@ -584,9 +578,9 @@ if (DBUS_BUILD_TESTS)
message("NOTE: building with unit tests increases the size of the installed library and renders it insecure.")
endif(DBUS_BUILD_TESTS)
-if (DBUS_BUILD_TESTS AND DBUS_DISABLE_ASSERTS)
+if (DBUS_BUILD_TESTS AND DBUS_DISABLE_ASSERT)
message("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)")
-endif(DBUS_BUILD_TESTS AND DBUS_DISABLE_ASSERTS)
+endif(DBUS_BUILD_TESTS AND DBUS_DISABLE_ASSERT)
if (DBUS_GCOV_ENABLED)
message("NOTE: building with coverage profiling is definitely for developers only.")
@@ -596,13 +590,18 @@ if (DBUS_ENABLE_VERBOSE_MODE)
message("NOTE: building with verbose mode increases library size, may slightly increase security risk, and decreases performance.")
endif(DBUS_ENABLE_VERBOSE_MODE)
-if(NOT DBUS_DISABLE_ASSERTS)
+if(NOT DBUS_DISABLE_ASSERT)
message("NOTE: building with assertions increases library size and decreases performance.")
-endif(NOT DBUS_DISABLE_ASSERTS)
+endif(NOT DBUS_DISABLE_ASSERT)
if (DBUS_DISABLE_CHECKS)
message("NOTE: building without checks for arguments passed to public API makes it harder to debug apps using D-BUS, but will slightly decrease D-BUS library size and _very_ slightly improve performance.")
endif(DBUS_DISABLE_CHECKS)
+
+foreach(_note ${FOOTNOTES})
+ message(${_note})
+endforeach()
+
MESSAGE(" ")
INCLUDE(modules/CPackInstallConfig.cmake)
diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake
index 33a9cee2..d290b0f2 100644
--- a/cmake/ConfigureChecks.cmake
+++ b/cmake/ConfigureChecks.cmake
@@ -11,7 +11,6 @@ check_include_file(sys/time.h HAVE_SYS_TIME_H)# dbus-sysdeps-win.c
check_include_file(sys/wait.h HAVE_SYS_WAIT_H)# dbus-sysdeps-win.c
check_include_file(time.h HAVE_TIME_H) # dbus-sysdeps-win.c
check_include_file(ws2tcpip.h HAVE_WS2TCPIP_H)# dbus-sysdeps-win.c
-check_include_file(wspiapi.h HAVE_WSPIAPI_H) # dbus-sysdeps-win.c
check_include_file(unistd.h HAVE_UNISTD_H) # dbus-sysdeps-util-win.c
check_include_file(stdio.h HAVE_STDIO_H) # dbus-sysdeps.h
check_include_file(sys/syslimits.h HAVE_SYS_SYSLIMITS_H) # dbus-sysdeps-unix.c
@@ -52,25 +51,23 @@ check_type_size("__int64" SIZEOF___INT64)
# DBUS_INT64_TYPE
if(SIZEOF_INT EQUAL 8)
- set (DBUS_HAVE_INT64 1)
set (DBUS_INT64_TYPE "int")
set (DBUS_INT64_CONSTANT "(val)")
set (DBUS_UINT64_CONSTANT "(val##U)")
elseif(SIZEOF_LONG EQUAL 8)
- set (DBUS_HAVE_INT64 1)
set (DBUS_INT64_TYPE "long")
set (DBUS_INT64_CONSTANT "(val##L)")
set (DBUS_UINT64_CONSTANT "(val##UL)")
elseif(SIZEOF_LONG_LONG EQUAL 8)
- set (DBUS_HAVE_INT64 1)
set (DBUS_INT64_TYPE "long long")
set (DBUS_INT64_CONSTANT "(val##LL)")
set (DBUS_UINT64_CONSTANT "(val##ULL)")
elseif(SIZEOF___INT64 EQUAL 8)
- set (DBUS_HAVE_INT64 1)
set (DBUS_INT64_TYPE "__int64")
set (DBUS_INT64_CONSTANT "(val##i64)")
set (DBUS_UINT64_CONSTANT "(val##ui64)")
+else(SIZEOF_INT EQUAL 8)
+ message (FATAL_ERROR "Could not find a 64-bit integer type")
endif(SIZEOF_INT EQUAL 8)
# DBUS_INT32_TYPE
@@ -93,7 +90,7 @@ find_program(DOXYGEN doxygen)
find_program(XMLTO xmlto)
if(MSVC)
- SET(DBUS_VA_COPY_FUNC "_DBUS_VA_COPY_ASSIGN";)
+ SET(DBUS_VA_COPY_FUNC "_DBUS_VA_COPY_ASSIGN")
else(MSVC)
write_file("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/cmake_try_compile.c" "#include <stdarg.h>
#include <stdlib.h>
diff --git a/cmake/Doxyfile.cmake b/cmake/Doxyfile.cmake
deleted file mode 100644
index e00984e7..00000000
--- a/cmake/Doxyfile.cmake
+++ /dev/null
@@ -1,182 +0,0 @@
-# Doxyfile 0.1
-
-#---------------------------------------------------------------------------
-# General configuration options
-#---------------------------------------------------------------------------
-PROJECT_NAME = D-Bus
-PROJECT_NUMBER = @VERSION@
-OUTPUT_DIRECTORY = api
-OUTPUT_LANGUAGE = English
-EXTRACT_ALL = NO
-EXTRACT_PRIVATE = NO
-EXTRACT_STATIC = NO
-HIDE_UNDOC_MEMBERS = NO
-HIDE_UNDOC_CLASSES = NO
-BRIEF_MEMBER_DESC = YES
-REPEAT_BRIEF = YES
-ALWAYS_DETAILED_SEC = NO
-FULL_PATH_NAMES = NO
-STRIP_FROM_PATH =
-INTERNAL_DOCS = NO
-STRIP_CODE_COMMENTS = YES
-CASE_SENSE_NAMES = YES
-SHORT_NAMES = NO
-HIDE_SCOPE_NAMES = NO
-VERBATIM_HEADERS = YES
-SHOW_INCLUDE_FILES = YES
-JAVADOC_AUTOBRIEF = YES
-INHERIT_DOCS = YES
-INLINE_INFO = YES
-SORT_MEMBER_DOCS = YES
-DISTRIBUTE_GROUP_DOC = NO
-TAB_SIZE = 8
-GENERATE_TODOLIST = YES
-GENERATE_TESTLIST = YES
-GENERATE_BUGLIST = YES
-ALIASES =
-ENABLED_SECTIONS =
-MAX_INITIALIZER_LINES = 30
-OPTIMIZE_OUTPUT_FOR_C = YES
-SHOW_USED_FILES = YES
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-QUIET = YES
-WARNINGS = YES
-WARN_IF_UNDOCUMENTED = YES
-WARN_FORMAT =
-WARN_LOGFILE =
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-INPUT = @top_srcdir@/dbus
-FILE_PATTERNS = *.c *.h
-RECURSIVE = YES
-#EXCLUDE = test
-
-# If the value of the INPUT tag contains directories, you can use the
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories.
-
-EXCLUDE_PATTERNS = Makefile.* ChangeLog CHANGES CHANGES.* README \
- README.* *.png AUTHORS DESIGN DESIGN.* *.desktop \
- DESKTOP* COMMENTS HOWTO magic NOTES TODO THANKS
-
-# The EXAMPLE_PATH tag can be used to specify one or more files or
-# directories that contain example code fragments that are included (see
-# the \include command).
-
-EXAMPLE_PATH =
-EXAMPLE_PATTERNS =
-EXAMPLE_RECURSIVE = NO
-IMAGE_PATH =
-INPUT_FILTER =
-FILTER_SOURCE_FILES = NO
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-SOURCE_BROWSER = YES
-INLINE_SOURCES = NO
-REFERENCED_BY_RELATION = YES
-REFERENCES_RELATION = YES
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-ALPHABETICAL_INDEX = NO
-COLS_IN_ALPHA_INDEX = 5
-IGNORE_PREFIX =
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-GENERATE_HTML = YES
-HTML_OUTPUT =
-HTML_HEADER =
-HTML_FOOTER =
-HTML_STYLESHEET =
-HTML_ALIGN_MEMBERS = YES
-GENERATE_HTMLHELP = NO
-GENERATE_CHI = NO
-BINARY_TOC = NO
-TOC_EXPAND = NO
-DISABLE_INDEX = NO
-ENUM_VALUES_PER_LINE = 4
-GENERATE_TREEVIEW = NO
-TREEVIEW_WIDTH = 250
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-GENERATE_LATEX = NO
-LATEX_OUTPUT =
-COMPACT_LATEX = NO
-PAPER_TYPE = a4wide
-EXTRA_PACKAGES =
-LATEX_HEADER =
-PDF_HYPERLINKS = NO
-USE_PDFLATEX = NO
-LATEX_BATCHMODE = NO
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-GENERATE_RTF = NO
-RTF_OUTPUT =
-COMPACT_RTF = NO
-RTF_HYPERLINKS = NO
-RTF_STYLESHEET_FILE =
-RTF_EXTENSIONS_FILE =
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-GENERATE_MAN = YES
-MAN_OUTPUT = man
-MAN_EXTENSION = .3dbus
-MAN_LINKS = YES
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-GENERATE_XML = NO
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-ENABLE_PREPROCESSING = YES
-MACRO_EXPANSION = YES
-EXPAND_ONLY_PREDEF = YES
-SEARCH_INCLUDES = YES
-INCLUDE_PATH =
-INCLUDE_FILE_PATTERNS =
-PREDEFINED = "DBUS_BEGIN_DECLS=" \
- "DBUS_END_DECLS=" \
- "DOXYGEN_SHOULD_SKIP_THIS" \
- "DBUS_GNUC_DEPRECATED=" \
- "_DBUS_DEFINE_GLOBAL_LOCK(name)=" \
- "_DBUS_GNUC_PRINTF(from,to)=" \
- "DBUS_EXPORT="
-SKIP_FUNCTION_MACROS = YES
-#---------------------------------------------------------------------------
-# Configuration::addtions related to external references
-#---------------------------------------------------------------------------
-TAGFILES =
-GENERATE_TAGFILE =
-ALLEXTERNALS = NO
-PERL_PATH =
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-CLASS_DIAGRAMS = YES
-HAVE_DOT = NO
-CLASS_GRAPH = YES
-COLLABORATION_GRAPH = YES
-TEMPLATE_RELATIONS = YES
-HIDE_UNDOC_RELATIONS = YES
-INCLUDE_GRAPH = YES
-INCLUDED_BY_GRAPH = YES
-GRAPHICAL_HIERARCHY = YES
-DOT_PATH =
-DOTFILE_DIRS =
-MAX_DOT_GRAPH_WIDTH = 640
-MAX_DOT_GRAPH_HEIGHT = 1024
-GENERATE_LEGEND = YES
-DOT_CLEANUP = YES
-#---------------------------------------------------------------------------
-# Configuration::addtions related to the search engine
-#---------------------------------------------------------------------------
-SEARCHENGINE = NO
diff --git a/cmake/bus/CMakeLists.txt b/cmake/bus/CMakeLists.txt
index 2657605e..f5b41cd8 100644
--- a/cmake/bus/CMakeLists.txt
+++ b/cmake/bus/CMakeLists.txt
@@ -1,5 +1,3 @@
-project(bus)
-
add_definitions(-DDBUS_COMPILATION)
SET(EFENCE "")
@@ -29,15 +27,15 @@ FOREACH(FILE ${FILES})
configure_file(${FILE} ${TARGET} )
ENDFOREACH(FILE)
-if(DBUS_USE_EXPAT)
- SET (XML_SOURCES ${BUS_DIR}/config-loader-expat.c)
-else(DBUS_USE_EXPAT)
- SET (XML_SOURCES ${BUS_DIR}/config-loader-libxml.c)
-endif (DBUS_USE_EXPAT)
+SET (XML_SOURCES ${BUS_DIR}/config-loader-expat.c)
-# after next cvs update
-#set (DIR_WATCH_SOURCE ${BUS_DIR}/dir-watch-default.c)
-set (DIR_WATCH_SOURCE )
+if (DBUS_BUS_ENABLE_INOTIFY)
+ set (DIR_WATCH_SOURCE ${BUS_DIR}/dir-watch-inotify.c)
+elseif (DBUS_BUS_ENABLE_KQUEUE)
+ set (DIR_WATCH_SOURCE ${BUS_DIR}/dir-watch-kqueue.c)
+else (DBUS_BUS_ENABLE_INOTIFY)
+ set (DIR_WATCH_SOURCE ${BUS_DIR}/dir-watch-default.c)
+endif (DBUS_BUS_ENABLE_INOTIFY)
set (BUS_SOURCES
${BUS_DIR}/activation.c
@@ -46,14 +44,13 @@ set (BUS_SOURCES
${BUS_DIR}/bus.h
${BUS_DIR}/config-parser.c
${BUS_DIR}/config-parser.h
- ${BUS_DIR}/config-parser-common.c
- ${BUS_DIR}/config-parser-common.h
+ ${BUS_DIR}/config-parser-common.c
+ ${BUS_DIR}/config-parser-common.h
# ${BUS_DIR}/config-parser-trivial.c
${BUS_DIR}/connection.c
${BUS_DIR}/connection.h
${BUS_DIR}/desktop-file.c
${BUS_DIR}/desktop-file.h
- ${BUS_DIR}/dir-watch-default.c
${BUS_DIR}/dir-watch.h
${BUS_DIR}/dispatch.c
${BUS_DIR}/dispatch.h
@@ -81,7 +78,7 @@ if(DBUS_ENABLE_STATS)
${BUS_DIR}/stats.c
${BUS_DIR}/stats.h
)
-endif()
+endif(DBUS_ENABLE_STATS)
include_directories(${XML_INCLUDE_DIR})
@@ -108,12 +105,11 @@ if (DBUS_SERVICE)
install_targets(/bin dbus-service )
endif (DBUS_SERVICE)
-if (DBUS_BUILD_TESTS)
- add_executable(bus-test ${BUS_SOURCES} ${BUS_DIR}/test-main.c)
- target_link_libraries(bus-test ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY})
- set_target_properties(bus-test PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
- add_test(bus-test ${EXECUTABLE_OUTPUT_PATH}/bus-test ${CMAKE_BINARY_DIR}/test/data)
-endif (DBUS_BUILD_TESTS)
+if (DBUS_ENABLE_EMBEDDED_TESTS)
+ set(SOURCES ${BUS_SOURCES} ${BUS_DIR}/test-main.c)
+ add_test_executable(test-bus "${SOURCES}" ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY})
+ set_target_properties(test-bus PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
+endif (DBUS_ENABLE_EMBEDDED_TESTS)
if(MSVC)
project_source_group(${GROUP_CODE} bus_test_SOURCES dummy)
@@ -149,11 +145,9 @@ if(NOT WIN32)
set_target_properties(dbus-daemon-launch-helper-test PROPERTIES COMPILE_FLAGS "-DACTIVATION_LAUNCHER_TEST")
target_link_libraries(dbus-daemon-launch-helper-test ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY} )
- add_executable(bus-test-launch-helper ${LAUNCH_HELPER_SOURCES} ${BUS_DIR}/test-launch-helper.c)
- set_target_properties(bus-test-launch-helper PROPERTIES COMPILE_FLAGS "-DACTIVATION_LAUNCHER_TEST -DACTIVATION_LAUNCHER_DO_OOM")
- target_link_libraries(bus-test-launch-helper ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY} )
- add_test(bus-test-launch-helper ${EXECUTABLE_OUTPUT_PATH}/bus-test-launch-helper )
-
+ set (SOURCES ${LAUNCH_HELPER_SOURCES} ${BUS_DIR}/test-launch-helper.c)
+ add_test_executable(test-bus-launch-helper "${SOURCES}" ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY})
+ set_target_properties(test-bus-launch-helper PROPERTIES COMPILE_FLAGS "-DACTIVATION_LAUNCHER_TEST -DACTIVATION_LAUNCHER_DO_OOM")
endif(NOT WIN32)
#### Init scripts fun
diff --git a/cmake/config.h.cmake b/cmake/config.h.cmake
index 6221c190..729080f7 100644
--- a/cmake/config.h.cmake
+++ b/cmake/config.h.cmake
@@ -6,6 +6,12 @@
/* indicate that we are building with cmake */
#define DBUS_CMAKE 1
+@AUTOPACKAGE_CONFIG_H_TEMPLATE@
+
+/*
+ * Variables defined by AC_DEFINE in ../configure.ac
+ * should be placed in this file
+*/
#cmakedefine HAVE_GNUC_VARARGS 1
#cmakedefine DBUS_CONSOLE_AUTH_DIR "@DBUS_CONSOLE_AUTH_DIR@"
@@ -15,35 +21,30 @@
#cmakedefine DBUS_SESSION_CONFIG_FILE "@DBUS_SESSION_CONFIG_FILE@"
#cmakedefine DBUS_DAEMON_NAME "@DBUS_DAEMON_NAME@"
#cmakedefine DBUS_SYSTEM_BUS_DEFAULT_ADDRESS "@DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@"
+#cmakedefine DBUS_SESSION_BUS_CONNECT_ADDRESS "@DBUS_SESSION_BUS_CONNECT_ADDRESS@"
#cmakedefine DBUS_MACHINE_UUID_FILE "@DBUS_MACHINE_UUID_FILE@"
-#cmakedefine DBUS_SESSION_BUS_DEFAULT_ADDRESS "@DBUS_SESSION_BUS_DEFAULT_ADDRESS@"
#cmakedefine DBUS_DAEMONDIR "@DBUS_DAEMONDIR@"
-#cmakedefine PACKAGE "@PACKAGE@"
-/* Version number of package */
-#cmakedefine DBUS_MAJOR_VERSION @DBUS_MAJOR_VERSION@
-#cmakedefine DBUS_MINOR_VERSION @DBUS_MINOR_VERSION@
-#cmakedefine DBUS_MICRO_VERSION @DBUS_MICRO_VERSION@
-#cmakedefine DBUS_VERSION ((@DBUS_MAJOR_VERSION@ << 16) | (@DBUS_MINOR_VERSION@ << 8) | (@DBUS_MICRO_VERSION@))
-#cmakedefine DBUS_VERSION_STRING "@DBUS_VERSION_STRING@"
-#cmakedefine DBUS_ENABLE_STATS
-#define VERSION DBUS_VERSION_STRING
+#cmakedefine DBUS_ENABLE_STATS
#define TEST_LISTEN "@TEST_LISTEN@"
// test binaries
#define DBUS_TEST_EXEC "@DBUS_TEST_EXEC@"
#define DBUS_EXEEXT "@EXEEXT@"
-
-/* Full path to test file test/test-exit in builddir */
-#define TEST_BUS_BINARY "@TEST_BUS_BINARY@"
+#cmakedefine TEST_BUS_LAUNCH_BINARY "@TEST_BUS_LAUNCH_BINARY@"
/* Some dbus features */
-#cmakedefine DBUS_BUILD_TESTS 1
#cmakedefine DBUS_ENABLE_ANSI 1
#cmakedefine DBUS_ENABLE_VERBOSE_MODE 1
-#cmakedefine DBUS_DISABLE_ASSERTS 1
+#cmakedefine DBUS_DISABLE_ASSERT 1
+#ifndef DBUS_DISABLE_ASSERT
+# define DBUS_ENABLE_ASSERT 1
+#endif
#cmakedefine DBUS_DISABLE_CHECKS 1
+#ifndef DBUS_DISABLE_CHECKS
+# define DBUS_ENABLE_CHECKS 1
+#endif
/* xmldocs */
/* doxygen */
#cmakedefine DBUS_GCOV_ENABLED 1
@@ -63,7 +64,6 @@
#endif
/* selinux */
-#cmakedefine DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX 1
/* kqueue */
#cmakedefine HAVE_CONSOLE_OWNER_FILE 1
#define DBUS_CONSOLE_OWNER_FILE "@DBUS_CONSOLE_OWNER_FILE@"
@@ -120,9 +120,6 @@
/* Define to 1 if you have ws2tcpip.h */
#cmakedefine HAVE_WS2TCPIP_H
-/* Define to 1 if you have wspiapi.h */
-#cmakedefine HAVE_WSPIAPI_H 1
-
/* Define to 1 if you have unistd.h */
#cmakedefine HAVE_UNISTD_H 1
@@ -197,6 +194,8 @@
/* Define to 1 if you have struct cmsgred */
#cmakedefine HAVE_CMSGCRED 1
+#cmakedefine FD_SETSIZE @FD_SETSIZE@
+
// system type defines
#if defined(_WIN32) || defined(_WIN64) || defined (_WIN32_WCE)
# define DBUS_WIN
@@ -249,4 +248,8 @@
#define inline __inline
#endif
+#ifdef DBUS_WIN
+#define FD_SETSIZE @FD_SETSIZE@
+#endif
+
#endif // _DBUS_CONFIG_H
diff --git a/cmake/cross-compile.sh b/cmake/cross-compile.sh
deleted file mode 100755
index 49e66e50..00000000
--- a/cmake/cross-compile.sh
+++ /dev/null
@@ -1,110 +0,0 @@
-#!/bin/sh
-#
-# cross compile script for cmake
-#
-# initial written by Fridrich Strba
-# refactored to debian/lenny by Ralf Habacker
-#
-# reported to work at least on debian/lenny
-#
-
-if test -f /usr/bin/i686-pc-mingw32-gcc; then
- cross_cc=i686-pc-mingw32
-elif test -f /usr/bin/i586-mingw32msvc-gcc; then
- cross_cc=i586-mingw32msvc
-else
- echo "could not determine mingw cross compiler"
- exit 1
-fi
-
-if test -d ~/$cross_cc; then
- cross_root=~/$cross_cc
-elif test -d /usr/$cross_cc/sys-root/mingw; then
- cross_root=/usr/$cross_cc/sys-root/mingw
-elif test -d /usr/$cross_cc/lib; then
- cross_root=/usr/$cross_cc
-else
- echo "could not determine mingw cross compiler sdk"
- exit 1
-fi
-
-if ! TEMP=`mktemp --tmpdir -d dbus-cross-compile.XXXXXX`; then
- echo "mktemp failed, try with coreutils 6.10 or later?" >&2
- exit 1
-fi
-
-# make cmake happy
-export TEMP
-
-HOST_CC=gcc; export HOST_CC;
-
-if test -d $cross_root/lib/pkgconfig; then
- PKG_CONFIG_PATH="$cross_root/lib/pkgconfig:$cross_root/share/pkgconfig"; export PKG_CONFIG_PATH;
-fi
-
-if test -d "$MINGW32_CLASSPATH" || test -f "$cross_root/share/java/libgcj.jar"; then
- CLASSPATH="$CLASSPATH:${MINGW32_CLASSPATH:-$cross_root/share/java/libgcj.jar:$cross_root/share/java/libgcj-tools.jar}"; export CLASSPATH;
-fi
-
-_PREFIX="/usr/bin/$cross_cc-";
-for i in `ls -1 ${_PREFIX}* | grep -v 'gcc-'`; do
- x=`echo $i|sed "s,${_PREFIX},,"|sed "s,\.awk*,,"|tr "a-z+-" "A-ZX_"`;
- declare -x $x="$i" ; export $x;
-done;
-unset _PREFIX;
-
-CC="${MINGW32_CC:-$cross_cc-gcc}"; export CC;
-CFLAGS="${MINGW32_CFLAGS:--O2 -g -pipe -Wall -fexceptions -fno-omit-frame-pointer -fno-optimize-sibling-calls --param=ssp-buffer-size=4 -mms-bitfields}"; export CFLAGS;
-LDFLAGS="${MINGW32_LDFLAGS:--Wl,--exclude-libs=libintl.a -Wl,--exclude-libs=libiconv.a}"; export LDFLAGS;
-
-if [ -x "/usr/bin/$cross_cc-g++" ]; then
- CXX="${MINGW32_CXX:-$cross_cc-g++}"; export CXX;
- CXXFLAGS="${MINGW32_CXXFLAGS:--O2 -g -pipe -Wall -fexceptions -fno-omit-frame-pointer -fno-optimize-sibling-calls --param=ssp-buffer-size=4 -mms-bitfields}"; export CXXFLAGS;
-else
- CXX=; export CXX;
- ac_cv_prog_CXX=no; export ac_cv_prog_CXX;
- CXXFLAGS=; export CXXFLAGS;
-fi;
-for i in `ls $cross_root/bin/*|grep -- "-config$"` ; do
- x=`basename $i|tr "a-z+-" "A-ZX_"|sed "s,\.,,"`;
- declare -x $x="$i" ; export $x;
-done;
-unset x i ;
-
-if ! test -f "$cross_root/lib/libexpat.dll.a"; then
- (cd $TEMP && wget http://www.winkde.org/pub/kde/ports/win32/repository/win32libs/expat-2.0.1-bin.zip)
- (cd $TEMP && wget http://www.winkde.org/pub/kde/ports/win32/repository/win32libs/expat-2.0.1-lib.zip)
- (cd $cross_root && unzip -x $TMP/expat-2.0.1-bin.zip)
- (cd $cross_root && unzip -x $TMP/expat-2.0.1-lib.zip)
-fi
-
-if test -f "$cross_root/lib/libexpat.dll.a"; then
- xml_library=-DDBUS_USE_EXPAT=On -DLIBEXPAT_INCLUDE_DIR:PATH=$cross_root/include -DLIBEXPAT_LIBRARIES:PATH=$cross_root/lib/libexpat.dll.a
-else
- echo "could not find a cross compile xml libraray"
- exit 1
-fi
-
-cmake \
- -DCMAKE_SYSTEM_NAME="Windows" \
- -DCMAKE_VERBOSE_MAKEFILE=ON \
- -DCMAKE_INSTALL_PREFIX:PATH=$cross_root \
- -DCMAKE_INSTALL_LIBDIR:PATH=$cross_root/lib \
- -DINCLUDE_INSTALL_DIR:PATH=$cross_root/include \
- -DLIB_INSTALL_DIR:PATH=$cross_root/lib \
- -DSYSCONF_INSTALL_DIR:PATH=$cross_root/etc \
- -DSHARE_INSTALL_PREFIX:PATH=$cross_root/share \
- -DBUILD_SHARED_LIBS:BOOL=ON \
- -DCMAKE_C_COMPILER="/usr/bin/$cross_cc-gcc" \
- -DCMAKE_CXX_COMPILER="/usr/bin/$cross_cc-g++" \
- -DCMAKE_FIND_ROOT_PATH="$cross_root" \
- -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
- -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
- -DCMAKE_CXX_COMPILER="/usr/bin/$cross_cc-g++" \
- -DCMAKE_FIND_ROOT_PATH="$cross_root" \
- -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
- -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
- $xml_library \
- -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
- $*
-
diff --git a/cmake/dbus-env.bat.cmake b/cmake/dbus-env.bat.cmake
index 85f70051..d859ce03 100644
--- a/cmake/dbus-env.bat.cmake
+++ b/cmake/dbus-env.bat.cmake
@@ -2,7 +2,7 @@
@echo off
:: session bus address
-set DBUS_SESSION_BUS_ADDRESS=@DBUS_SESSION_BUS_DEFAULT_ADDRESS@
+set DBUS_SESSION_BUS_ADDRESS=@DBUS_SESSION_BUS_CONNECT_ADDRESS@
:: system bus address
-set DBUS_SYSTEM_BUS_DEFAULT_ADDRESS=@DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@ \ No newline at end of file
+set DBUS_SYSTEM_BUS_DEFAULT_ADDRESS=@DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@
diff --git a/cmake/dbus/CMakeLists.txt b/cmake/dbus/CMakeLists.txt
index d09e63df..a5481b78 100644
--- a/cmake/dbus/CMakeLists.txt
+++ b/cmake/dbus/CMakeLists.txt
@@ -1,5 +1,3 @@
-project(dbus-lib)
-
SET(DBUS_DIR ${CMAKE_SOURCE_DIR}/../dbus)
configure_file(${DBUS_DIR}/dbus-arch-deps.h.in ${CMAKE_CURRENT_BINARY_DIR}/dbus-arch-deps.h )
@@ -149,6 +147,7 @@ set (DBUS_SHARED_HEADERS
### should be underscore-prefixed but don't really need
### to be unless they move to DBUS_SHARED_SOURCES later)
set (DBUS_UTIL_SOURCES
+ ${DBUS_DIR}/dbus-asv-util.c
${DBUS_DIR}/dbus-auth-script.c
${DBUS_DIR}/dbus-auth-util.c
${DBUS_DIR}/dbus-credentials-util.c
@@ -165,14 +164,15 @@ set (DBUS_UTIL_SOURCES
${DBUS_DIR}/dbus-sysdeps-util.c
)
-if (DBUS_BUILD_TESTS)
+if (DBUS_ENABLE_EMBEDDED_TESTS)
set (DBUS_UTIL_SOURCES
${DBUS_UTIL_SOURCES}
${DBUS_DIR}/dbus-test.c
)
-endif (DBUS_BUILD_TESTS)
+endif (DBUS_ENABLE_EMBEDDED_TESTS)
set (DBUS_UTIL_HEADERS
+ ${DBUS_DIR}/dbus-asv-util.h
${DBUS_DIR}/dbus-auth-script.h
${DBUS_DIR}/dbus-mainloop.h
${DBUS_DIR}/dbus-message-factory.h
@@ -186,6 +186,7 @@ set (DBUS_UTIL_HEADERS
if (WIN32)
set (DBUS_SHARED_SOURCES ${DBUS_SHARED_SOURCES}
${DBUS_DIR}/dbus-file-win.c
+ ${DBUS_DIR}/dbus-init-win.cpp
${DBUS_DIR}/dbus-sysdeps-win.c
${DBUS_DIR}/dbus-pipe-win.c
${DBUS_DIR}/dbus-sysdeps-thread-win.c
@@ -264,13 +265,13 @@ if(WIN32)
if(WINCE)
target_link_libraries(dbus-1 ws2)
else(WINCE)
- target_link_libraries(dbus-1 ws2_32 advapi32 netapi32)
+ target_link_libraries(dbus-1 ws2_32 advapi32 netapi32 iphlpapi)
endif(WINCE)
else(WIN32)
- target_link_libraries(dbus-1 ${CMAKE_THREAD_LIBS_INIT})
+ target_link_libraries(dbus-1 ${CMAKE_THREAD_LIBS_INIT} rt)
endif(WIN32)
-install_targets(/lib dbus-1 )
+install(TARGETS dbus-1 ${INSTALL_TARGETS_DEFAULT_ARGS})
install_files(/include/dbus FILES ${dbusinclude_HEADERS})
### Internal library, used for the daemon, tools and tests, compiled statically.
@@ -289,19 +290,16 @@ if(WIN32)
if(WINCE)
target_link_libraries(dbus-internal ws2)
else(WINCE)
- target_link_libraries(dbus-internal ws2_32 advapi32 netapi32)
+ target_link_libraries(dbus-internal ws2_32 advapi32 netapi32 iphlpapi)
endif(WINCE)
else(WIN32)
- target_link_libraries(dbus-internal ${CMAKE_THREAD_LIBS_INIT})
+ target_link_libraries(dbus-internal ${CMAKE_THREAD_LIBS_INIT} rt)
endif(WIN32)
-if (DBUS_BUILD_TESTS)
- set (TESTS_ENVIRONMENT "DBUS_TEST_DATA=${CMAKE_SOURCE_DIR}/test/data DBUS_TEST_HOMEDIR=${CMAKE_BUILD_DIR}/dbus")
- ADD_EXECUTABLE(dbus-test ${CMAKE_SOURCE_DIR}/../dbus/dbus-test-main.c)
- target_link_libraries(dbus-test ${DBUS_INTERNAL_LIBRARIES})
- add_test(dbus-test ${EXECUTABLE_OUTPUT_PATH}/dbus-test ${CMAKE_SOURCE_DIR}/../test/data)
- set_target_properties(dbus-test PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
-ENDIF (DBUS_BUILD_TESTS)
+if (DBUS_ENABLE_EMBEDDED_TESTS)
+ add_test_executable(test-dbus ${CMAKE_SOURCE_DIR}/../dbus/dbus-test-main.c ${DBUS_INTERNAL_LIBRARIES})
+ set_target_properties(test-dbus PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
+ENDIF (DBUS_ENABLE_EMBEDDED_TESTS)
if (UNIX)
# set version info
diff --git a/cmake/doc/CMakeLists.txt b/cmake/doc/CMakeLists.txt
index df6b587b..7fdfc219 100644
--- a/cmake/doc/CMakeLists.txt
+++ b/cmake/doc/CMakeLists.txt
@@ -6,9 +6,10 @@ endif(DOXYGEN_EXECUTABLE)
if (DBUS_ENABLE_DOXYGEN_DOCS)
set (top_srcdir ${CMAKE_SOURCE_DIR}/..)
- configure_file(${CMAKE_SOURCE_DIR}/Doxyfile.cmake ${CMAKE_BINARY_DIR}/Doxyfile )
+ configure_file(${CMAKE_SOURCE_DIR}/../Doxyfile.in ${CMAKE_BINARY_DIR}/Doxyfile )
add_custom_target(doc
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
endif (DBUS_ENABLE_DOXYGEN_DOCS)
@@ -21,54 +22,72 @@ find_program(XMLTO_EXECUTABLE xmlto)
if (MEINPROC4_EXECUTABLE OR XMLTO_EXECUTABLE)
OPTION(DBUS_ENABLE_XML_DOCS "build XML documentation (requires xmlto or meinproc4)" ON)
+ ADD_CUSTOM_TARGET(xmldoc ALL)
endif (MEINPROC4_EXECUTABLE OR XMLTO_EXECUTABLE)
-if (MEINPROC4_EXECUTABLE)
+if (XMLTO_EXECUTABLE)
+ set (DOCBOOK_GENERATOR_NAME "xmlto" PARENT_SCOPE)
+ set(DBUS_XML_DOCS_ENABLED 1)
+ set(MEINPROC4_EXECUTABLE 0)
+ MESSAGE(STATUS "xmlto docbook generator found")
+ set(STYLESHEET_MAN "${DOCBOOKXSL_DIR}/manpages/docbook.xsl")
+ set(STYLESHEET_HTML "${DOCBOOKXSL_DIR}/html/docbook.xsl")
+
+elseif (MEINPROC4_EXECUTABLE)
set(DOCBOOK_GENERATOR_NAME "meinproc4" PARENT_SCOPE)
set(DBUS_XML_DOCS_ENABLED 1)
if(WIN32)
get_filename_component(_a ${MEINPROC4_EXECUTABLE} PATH)
get_filename_component(_meinproc_install_path ${_a} PATH)
+ set(STYLESHEET_HTML "${_meinproc_install_path}/share/apps/ksgmltools2/docbook/xsl/html/docbook.xsl")
else(WIN32)
- set(_meinproc_install_path ${CMAKE_INSTALL_PREFIX})
+ set(STYLESHEET_HTML file:///usr/share/kde4/apps/ksgmltools2/customization/kde-nochunk.xsl)
endif(WIN32)
- set(STYLESHEET "${_meinproc_install_path}/share/apps/ksgmltools2/docbook/xsl/html/docbook.xsl")
-endif (MEINPROC4_EXECUTABLE)
-
-
-if (XMLTO_EXECUTABLE)
- set (DOCBOOK_GENERATOR_NAME "xmlto" PARENT_SCOPE)
- set(DBUS_XML_DOCS_ENABLED 1)
- MESSAGE(STATUS "xmlto docbook generator found")
-endif (XMLTO_EXECUTABLE)
+endif ()
if (DBUS_ENABLE_XML_DOCS)
-macro (DOCBOOK _sources _options)
+macro (DOCBOOK _sources _format)
get_filename_component(_infile ${_sources} ABSOLUTE)
- get_filename_component(_basename ${_infile} NAME_WE)
- set(_outfile ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.html)
+ get_filename_component(_name ${_infile} NAME)
+ set(_deps ${CMAKE_SOURCE_DIR}/CMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt)
+
+ if (${_format} STREQUAL "man")
+ string(REPLACE ".xml" "" _outname ${_name})
+ set(STYLESHEET ${STYLESHEET_MAN})
+ else()
+ string(REPLACE ".xml" ".html" _outname ${_name})
+ set(STYLESHEET ${STYLESHEET_HTML})
+ endif ()
+ set(_outfile ${CMAKE_CURRENT_BINARY_DIR}/${_outname})
if (EXISTS ${_sources})
if (MEINPROC4_EXECUTABLE)
- ADD_CUSTOM_TARGET(${_basename}.html ALL
- ${MEINPROC4_EXECUTABLE} --stylesheet ${STYLESHEET} -o ${_outfile} ${_infile}
- DEPENDS ${_infile}
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${_outfile}
+ COMMAND ${MEINPROC4_EXECUTABLE} --stylesheet ${STYLESHEET} -o ${_outfile} ${_infile}
+ DEPENDS ${_infile} ${STYLESHEET} ${_deps}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
endif ()
if (XMLTO_EXECUTABLE)
- ADD_CUSTOM_TARGET(${_basename}.html ALL
- ${XMLTO_EXECUTABLE} -vv ${_options} ${_infile}
- DEPENDS ${_infile}
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${_outfile}
+ COMMAND ${XMLTO_EXECUTABLE} -vv ${_format} ${_infile}
+ DEPENDS ${_infile} ${_deps}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
endif ()
- install(FILES ${_outfile} DESTINATION share/doc/dbus)
+ if (${_format} STREQUAL "man")
+ install(FILES ${_outfile} DESTINATION share/man/man1)
+ else ()
+ install(FILES ${_outfile} DESTINATION share/doc/dbus)
+ endif ()
else ()
MESSAGE(STATUS "skipping xml doc generating for ${_infile}, file not found")
endif ()
-
+ ADD_CUSTOM_TARGET(${_outname} DEPENDS ${_outfile})
+ ADD_DEPENDENCIES(xmldoc ${_outname})
endmacro (DOCBOOK)
### copy tests to builddir so that generated tests and static tests
@@ -98,11 +117,26 @@ DOCBOOK(${CMAKE_SOURCE_DIR}/../doc/dbus-test-plan.xml html-nochunks)
DOCBOOK(${CMAKE_SOURCE_DIR}/../doc/dbus-tutorial.xml html-nochunks)
DOCBOOK(${CMAKE_SOURCE_DIR}/../doc/dbus-specification.xml html-nochunks)
DOCBOOK(${CMAKE_SOURCE_DIR}/../doc/dbus-faq.xml html-nochunks)
-DOCBOOK(${CMAKE_SOURCE_DIR}/bus/dbus-daemon.xml html-nochunks)
-DOCBOOK(${CMAKE_SOURCE_DIR}/tools/dbus-monitor.xml html-nochunks)
-DOCBOOK(${CMAKE_SOURCE_DIR}/tools/dbus-send.xml html-nochunks)
-DOCBOOK(${CMAKE_SOURCE_DIR}/tools/dbus-launch.xml html-nochunks)
-
+configure_file(${CMAKE_SOURCE_DIR}/../doc/dbus-cleanup-sockets.1.xml.in ${CMAKE_BINARY_DIR}/doc/dbus-cleanup-sockets.1.xml)
+configure_file(${CMAKE_SOURCE_DIR}/../doc/dbus-daemon.1.xml.in ${CMAKE_BINARY_DIR}/doc/dbus-daemon.1.xml)
+configure_file(${CMAKE_SOURCE_DIR}/../doc/dbus-launch.1.xml.in ${CMAKE_BINARY_DIR}/doc/dbus-launch.1.xml)
+configure_file(${CMAKE_SOURCE_DIR}/../doc/dbus-monitor.1.xml.in ${CMAKE_BINARY_DIR}/doc/dbus-monitor.1.xml)
+configure_file(${CMAKE_SOURCE_DIR}/../doc/dbus-send.1.xml.in ${CMAKE_BINARY_DIR}/doc/dbus-send.1.xml)
+configure_file(${CMAKE_SOURCE_DIR}/../doc/dbus-uuidgen.1.xml.in ${CMAKE_BINARY_DIR}/doc/dbus-uuidgen.1.xml)
+DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-cleanup-sockets.1.xml html-nochunks)
+DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-daemon.1.xml html-nochunks)
+DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-launch.1.xml html-nochunks)
+DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-monitor.1.xml html-nochunks)
+DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-send.1.xml html-nochunks)
+DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-uuidgen.1.xml html-nochunks)
+if (UNIX)
+ DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-daemon.1.xml man)
+ DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-monitor.1.xml man)
+ DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-send.1.xml man)
+ DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-launch.1.xml man)
+ DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-uuidgen.1.xml man)
+ DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-cleanup-sockets.1.xml man)
+endif()
#
# handle html index file
#
diff --git a/cmake/modules/COPYING-CMAKE-SCRIPTS b/cmake/modules/COPYING-CMAKE-SCRIPTS
new file mode 100644
index 00000000..53b6b71e
--- /dev/null
+++ b/cmake/modules/COPYING-CMAKE-SCRIPTS
@@ -0,0 +1,22 @@
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/cmake/modules/CPackInstallConfig.cmake b/cmake/modules/CPackInstallConfig.cmake
index f8073a25..74b66898 100644
--- a/cmake/modules/CPackInstallConfig.cmake
+++ b/cmake/modules/CPackInstallConfig.cmake
@@ -1,14 +1,7 @@
if (DBUS_INSTALL_SYSTEM_LIBS)
if (MINGW)
- if (DBUS_USE_EXPAT)
- # expat
- install_files(/bin FILES ${LIBEXPAT_LIBRARIES})
- else (DBUS_USE_EXPAT)
- # xml2
- install_files(/bin FILES ${LIBXML2_LIBRARIES})
- install_files(/bin FILES ${LIBICONV_LIBRARIES})
- endif (DBUS_USE_EXPAT)
+ install_files(/bin FILES ${LIBEXPAT_LIBRARIES})
else (MINGW)
INCLUDE(InstallRequiredSystemLibraries)
endif (MINGW)
diff --git a/cmake/modules/FindGLIB.cmake b/cmake/modules/FindGLIB.cmake
deleted file mode 100644
index 1fdaee95..00000000
--- a/cmake/modules/FindGLIB.cmake
+++ /dev/null
@@ -1,42 +0,0 @@
-# - Try to find the GLIB library
-# Once done this will define
-#
-# GLIB_FOUND - system has GLIB
-# GLIB_INCLUDES - the GLIB include directories
-# GLIB_LIBRARIES - The libraries needed to use GLIB
-
-if (WIN32)
-
-INCLUDE(MacroGetenvWinPath)
-
-MACRO_GETENV_WIN_PATH(_program_FILES_DIR PROGRAMFILES)
-
-FIND_PATH(GLIB_INCLUDE_DIR glib.h
- ${_program_FILES_DIR}/glib/include/glib-2.0
-)
-
-
-# search for GLIB in the default install directory for applications (default of (n)make install)
-FIND_LIBRARY(GLIB_LIBRARY NAMES glib-2.0
- PATHS
- ${_program_FILES_DIR}/glib/lib
-)
-
-if (GLIB_LIBRARY AND GLIB_INCLUDE_DIR)
- set(GLIB_FOUND TRUE)
- set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${GLIB_INCLUDES})
- set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${GLIB_LIBRARIES})
-
-endif (GLIB_LIBRARY AND GLIB_INCLUDE_DIR)
-
-if (GLIB_FOUND)
- if (NOT GLIB_FIND_QUIETLY)
- message(STATUS "Found GLIB: ${GLIB_LIBRARY}")
- endif (NOT GLIB_FIND_QUIETLY)
-else (GLIB_FOUND)
- if (GLIB_FIND_REQUIRED)
- message(FATAL_ERROR "Could NOT find GLIB library")
- endif (GLIB_FIND_REQUIRED)
-endif (GLIB_FOUND)
-
-endif (WIN32)
diff --git a/cmake/modules/FindGLib2.cmake b/cmake/modules/FindGLib2.cmake
new file mode 100644
index 00000000..d72b2a09
--- /dev/null
+++ b/cmake/modules/FindGLib2.cmake
@@ -0,0 +1,60 @@
+# - Try to find the GLIB2 libraries
+# Once done this will define
+#
+# GLIB2_FOUND - system has glib2
+# GLIB2_INCLUDE_DIR - the glib2 include directory
+# GLIB2_LIBRARIES - glib2 library
+
+# Copyright (c) 2008 Laurent Montel, <montel@kde.org>
+# Copyright (c) 2013 Ralf Habacker, <ralf.habacker@freenet.de>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+if(GLIB2_INCLUDE_DIR AND GLIB2_LIBRARIES)
+ # Already in cache, be silent
+ set(GLIB2_FIND_QUIETLY TRUE)
+endif(GLIB2_INCLUDE_DIR AND GLIB2_LIBRARIES)
+
+if (NOT WIN32)
+ find_package(PkgConfig)
+ pkg_check_modules(PC_LibGLIB2 QUIET glib-2.0)
+endif()
+
+find_path(GLIB2_MAIN_INCLUDE_DIR
+ NAMES glib.h
+ HINTS ${PC_LibGLIB2_INCLUDEDIR}
+ PATH_SUFFIXES glib-2.0)
+
+find_library(GLIB2_LIBRARY
+ NAMES glib-2.0
+ HINTS ${PC_LibGLIB2_LIBDIR}
+)
+
+find_library(GIO2_LIBRARY
+ NAMES gio-2.0
+ HINTS ${PC_LibGLIB2_LIBDIR}
+)
+
+set(GLIB2_LIBRARIES ${GLIB2_LIBRARY} ${GIO2_LIBRARY})
+
+# search the glibconfig.h include dir under the same root where the library is found
+get_filename_component(glib2LibDir "${GLIB2_LIBRARY}" PATH)
+
+find_path(GLIB2_INTERNAL_INCLUDE_DIR glibconfig.h
+ PATH_SUFFIXES glib-2.0/include
+ HINTS ${PC_LibGLIB2_INCLUDEDIR} "${glib2LibDir}" ${CMAKE_SYSTEM_LIBRARY_PATH})
+
+set(GLIB2_INCLUDE_DIR "${GLIB2_MAIN_INCLUDE_DIR}")
+
+# not sure if this include dir is optional or required
+# for now it is optional
+if(GLIB2_INTERNAL_INCLUDE_DIR)
+ set(GLIB2_INCLUDE_DIR ${GLIB2_INCLUDE_DIR} "${GLIB2_INTERNAL_INCLUDE_DIR}")
+endif(GLIB2_INTERNAL_INCLUDE_DIR)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(GLIB2 DEFAULT_MSG GLIB2_LIBRARIES GLIB2_MAIN_INCLUDE_DIR)
+
+mark_as_advanced(GLIB2_INCLUDE_DIR GLIB2_LIBRARIES)
diff --git a/cmake/modules/FindGObject.cmake b/cmake/modules/FindGObject.cmake
new file mode 100644
index 00000000..af0c9f73
--- /dev/null
+++ b/cmake/modules/FindGObject.cmake
@@ -0,0 +1,52 @@
+# - Try to find GObject
+# Once done this will define
+#
+# GOBJECT_FOUND - system has GObject
+# GOBJECT_INCLUDE_DIR - the GObject include directory
+# GOBJECT_LIBRARIES - the libraries needed to use GObject
+# GOBJECT_DEFINITIONS - Compiler switches required for using GObject
+
+# Copyright (c) 2011, Raphael Kubo da Costa <kubito@gmail.com>
+# Copyright (c) 2006, Tim Beaulen <tbscope@gmail.com>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+FIND_PACKAGE(PkgConfig)
+PKG_CHECK_MODULES(PC_GOBJECT gobject-2.0)
+SET(GOBJECT_DEFINITIONS ${PC_GOBJECT_CFLAGS_OTHER})
+
+FIND_PATH(GOBJECT_INCLUDE_DIR gobject.h
+ HINTS
+ ${PC_GOBJECT_INCLUDEDIR}
+ ${PC_GOBJECT_INCLUDE_DIRS}
+ PATH_SUFFIXES glib-2.0/gobject/
+ )
+
+FIND_LIBRARY(_GObjectLibs NAMES gobject-2.0
+ HINTS
+ ${PC_GOBJECT_LIBDIR}
+ ${PC_GOBJECT_LIBRARY_DIRS}
+ )
+FIND_LIBRARY(_GModuleLibs NAMES gmodule-2.0
+ HINTS
+ ${PC_GOBJECT_LIBDIR}
+ ${PC_GOBJECT_LIBRARY_DIRS}
+ )
+FIND_LIBRARY(_GThreadLibs NAMES gthread-2.0
+ HINTS
+ ${PC_GOBJECT_LIBDIR}
+ ${PC_GOBJECT_LIBRARY_DIRS}
+ )
+FIND_LIBRARY(_GLibs NAMES glib-2.0
+ HINTS
+ ${PC_GOBJECT_LIBDIR}
+ ${PC_GOBJECT_LIBRARY_DIRS}
+ )
+
+SET( GOBJECT_LIBRARIES ${_GObjectLibs} ${_GModuleLibs} ${_GThreadLibs} ${_GLibs} )
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(GOBJECT DEFAULT_MSG GOBJECT_LIBRARIES GOBJECT_INCLUDE_DIR)
+
+MARK_AS_ADVANCED(GOBJECT_INCLUDE_DIR _GObjectLibs _GModuleLibs _GThreadLibs _GLibs)
diff --git a/cmake/modules/FindLibExpat.cmake b/cmake/modules/FindLibExpat.cmake
deleted file mode 100644
index a07c8de4..00000000
--- a/cmake/modules/FindLibExpat.cmake
+++ /dev/null
@@ -1,61 +0,0 @@
-# - Try to find LIBEXPAT
-# Once done this will define
-#
-# LIBEXPAT_FOUND - system has LIBEXPAT
-# LIBEXPAT_INCLUDE_DIR - the LIBEXPAT include directory
-# LIBEXPAT_LIBRARIES - the libraries needed to use LIBEXPAT
-# LIBEXPAT_DEFINITIONS - Compiler switches required for using LIBEXPAT
-
-if (LIBEXPAT_INCLUDE_DIR AND LIBEXPAT_LIBRARIES)
-
- # in cache already
- SET(LIBEXPAT_FOUND TRUE)
-
-else (LIBEXPAT_INCLUDE_DIR AND LIBEXPAT_LIBRARIES)
-
- IF (WIN32)
- file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _progFiles)
- find_FILE(LIBEXPAT_DIR expat Source/lib/expat.h
- PATHS
- "${_progFiles}"
- )
- if (LIBEXPAT_DIR)
- set (_LIBEXPATIncDir ${LIBEXPAT_DIR}/Source/lib)
- set (_LIBEXPATLinkDir ${LIBEXPAT_DIR}/libs)
- endif (LIBEXPAT_DIR)
- ELSE (WIN32)
- # use pkg-config to get the directories and then use these values
- # in the FIND_PATH() and FIND_LIBRARY() calls
- INCLUDE(UsePkgConfig)
- PKGCONFIG(LIBEXPAT-2.0 _LIBEXPATIncDir _LIBEXPATLinkDir _LIBEXPATLinkFlags _LiIconvCflags)
- SET(LIBEXPAT_DEFINITIONS ${_LIBEXPATCflags})
- ENDIF (WIN32)
-
- FIND_PATH(LIBEXPAT_INCLUDE_DIR expat.h
- PATHS
- ${_LIBEXPATIncDir}
- PATH_SUFFIXES LIBEXPAT
- )
-
- FIND_LIBRARY(LIBEXPAT_LIBRARIES NAMES expat libexpat
- PATHS
- ${_LIBEXPATLinkDir}
- )
-
- if (LIBEXPAT_INCLUDE_DIR AND LIBEXPAT_LIBRARIES)
- set(LIBEXPAT_FOUND TRUE)
- endif (LIBEXPAT_INCLUDE_DIR AND LIBEXPAT_LIBRARIES)
-
- if (LIBEXPAT_FOUND)
- if (NOT LIBEXPAT_FIND_QUIETLY)
- message(STATUS "Found libexpat: ${LIBEXPAT_LIBRARIES}")
- endif (NOT LIBEXPAT_FIND_QUIETLY)
- else (LIBEXPAT_FOUND)
- if (LIBEXPAT_FIND_REQUIRED)
- message(SEND_ERROR "Could NOT find libexpat")
- endif (LIBEXPAT_FIND_REQUIRED)
- endif (LIBEXPAT_FOUND)
-
- MARK_AS_ADVANCED(LIBEXPAT_INCLUDE_DIR LIBEXPAT_LIBRARIES)
-
-endif (LIBEXPAT_INCLUDE_DIR AND LIBEXPAT_LIBRARIES)
diff --git a/cmake/modules/Macros.cmake b/cmake/modules/Macros.cmake
index b6371568..fd3f62c4 100644
--- a/cmake/modules/Macros.cmake
+++ b/cmake/modules/Macros.cmake
@@ -1,15 +1,62 @@
+if(DBUS_BUILD_TESTS AND CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_NAME STREQUAL "Windows")
+ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
+ find_file(WINE_EXECUTABLE
+ NAMES wine
+ PATHS /usr/bin /usr/local/bin
+ NO_CMAKE_FIND_ROOT_PATH
+ )
+ find_file(HAVE_BINFMT_WINE_SUPPORT
+ NAMES DOSWin wine Wine windows Windows
+ PATHS /proc/sys/fs/binfmt_misc
+ NO_SYSTEM_PATH NO_CMAKE_FIND_ROOT_PATH
+ )
+ if(WINE_EXECUTABLE AND HAVE_BINFMT_WINE_SUPPORT)
+ list(APPEND FOOTNOTES "NOTE: The requirements to run cross compiled applications on your host system are achieved. You may run 'make check'.")
+ endif()
+ if(NOT WINE_EXECUTABLE)
+ list(APPEND FOOTNOTES "NOTE: You may install the Windows emulator 'wine' to be able to run cross compiled test applications.")
+ endif()
+ if(NOT HAVE_BINFMT_WINE_SUPPORT)
+ list(APPEND FOOTNOTES "NOTE: You may activate binfmt_misc support for wine to be able to run cross compiled test applications.")
+ endif()
+ else()
+ list(APPEND FOOTNOTES "NOTE: You will not be able to run cross compiled applications on your host system.")
+ endif()
+endif()
MACRO(TIMESTAMP RESULT)
- IF(WIN32)
+ if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
EXECUTE_PROCESS(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE DATE)
string(REGEX REPLACE "(..)[/.](..)[/.](....).*" "\\3\\2\\1" DATE ${DATE})
EXECUTE_PROCESS(COMMAND "cmd" " /C time /T" OUTPUT_VARIABLE TIME)
string(REGEX REPLACE "(..):(..)" "\\1\\2" TIME ${TIME})
set (${RESULT} "${DATE}${TIME}")
- ELSEIF(UNIX)
+ else ()
EXECUTE_PROCESS(COMMAND "date" "+%Y%m%d%H%M" OUTPUT_VARIABLE ${RESULT})
- ELSE()
- MESSAGE(SEND_ERROR "date not implemented")
- SET(${RESULT} 000000000000)
- ENDIF()
+ endif ()
ENDMACRO()
+
+macro(add_test_executable _target _source)
+ add_executable(${_target} ${_source})
+ target_link_libraries(${_target} ${ARGN})
+ if (CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_NAME STREQUAL "Windows")
+ # run tests with binfmt_misc
+ set(PREFIX "z:")
+ set(_env "DBUS_TEST_DAEMON=${PREFIX}${CMAKE_BINARY_DIR}/bin/dbus-daemon${EXEEXT}")
+ add_test(NAME ${_target} COMMAND $<TARGET_FILE:${_target}>)
+ else()
+ set(PREFIX)
+ set(_env "DBUS_TEST_DAEMON=${CMAKE_BINARY_DIR}/bin/dbus-daemon${EXEEXT}")
+ add_test(NAME ${_target} COMMAND $<TARGET_FILE:${_target}>)
+ endif()
+ list(APPEND _env "DBUS_SESSION_BUS_ADDRESS=")
+ list(APPEND _env "DBUS_FATAL_WARNINGS=1")
+ list(APPEND _env "DBUS_TEST_DATA=${PREFIX}${CMAKE_BINARY_DIR}/test/data")
+ list(APPEND _env "DBUS_TEST_HOMEDIR=${PREFIX}${CMAKE_BINARY_DIR}/dbus")
+ set_tests_properties(${_target} PROPERTIES ENVIRONMENT "${_env}")
+endmacro(add_test_executable)
+
+macro(add_helper_executable _target _source)
+ add_executable(${_target} ${_source})
+ target_link_libraries(${_target} ${ARGN})
+endmacro(add_helper_executable)
diff --git a/cmake/modules/MacrosAutotools.cmake b/cmake/modules/MacrosAutotools.cmake
index ff30eaf9..68e8ae51 100644
--- a/cmake/modules/MacrosAutotools.cmake
+++ b/cmake/modules/MacrosAutotools.cmake
@@ -23,6 +23,66 @@ macro(autoversion config prefix)
endmacro()
#
+# Defines package related variables (PACKAGE_..., PACKAGE and VERSION)
+# as done by autotools.
+#
+# Additional it defines a cmake variable named PACKAGE_CONFIG_H_TEMPLATE
+# which could be placed in config.h templates to have those variables
+# defined at code level like shown below:
+#
+# config.h.template
+# ...
+# @AUTOPACKAGE_CONFIG_H_TEMPLATE@
+# ...
+#
+macro(autopackage name version url support_url)
+ # Define to the full name of this package.
+ set(PACKAGE_NAME ${name})
+
+ # Define to the version of this package.
+ set(PACKAGE_VERSION ${version})
+
+ # Define to the home page for this package.
+ set(PACKAGE_URL ${url})
+
+ # Define to the address where bug reports for this package should be sent.
+ set(PACKAGE_BUGREPORT ${support_url})
+
+ # Define to the full name and version of this package.
+ set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
+
+ # Define to the one symbol short name of this package.
+ set(PACKAGE_TARNAME ${PACKAGE_NAME})
+
+ set(PACKAGE ${name})
+ set(VERSION ${DBUS_VERSION_STRING})
+
+ set(AUTOPACKAGE_CONFIG_H_TEMPLATE "/* generated by cmake macro autopackage */\n
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT \"@PACKAGE_BUGREPORT@\"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME \"@PACKAGE_NAME@\"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING \"@PACKAGE_STRING@\"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME \"@PACKAGE_TARNAME@\"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL \"@PACKAGE_URL@\"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION \"@PACKAGE_VERSION@\"
+
+/* defined by autotools package */
+#define PACKAGE \"@PACKAGE@\"
+#define VERSION \"@VERSION@\"
+")
+endmacro(autopackage)
+
+#
# parses config.h template and create cmake equivalent
# not implemented yet
#
diff --git a/cmake/test/CMakeLists.txt b/cmake/test/CMakeLists.txt
index 8657e4c7..ecad3046 100644
--- a/cmake/test/CMakeLists.txt
+++ b/cmake/test/CMakeLists.txt
@@ -1,7 +1,9 @@
-project(test)
+include_directories(${CMAKE_SOURCE_DIR}/../test)
add_definitions(${DBUS_INTERNAL_CLIENT_DEFINITIONS})
+set(DBUS_SESSION_BUS_LISTEN_ADDRESS ${TEST_LISTEN})
+
add_library(dbus-testutils STATIC
${CMAKE_SOURCE_DIR}/../test/test-utils.h
${CMAKE_SOURCE_DIR}/../test/test-utils.c
@@ -26,11 +28,11 @@ set (test-shell-service_SOURCES
${CMAKE_SOURCE_DIR}/../test/test-shell-service.c
)
-set (shell-test_SOURCES
+set (test-shell_SOURCES
${CMAKE_SOURCE_DIR}/../test/shell-test.c
)
-set (spawn-test_SOURCES
+set (test-spawn_SOURCES
${CMAKE_SOURCE_DIR}/../test/spawn-test.c
)
@@ -46,30 +48,39 @@ set (test-sleep-forever_SOURCES
${CMAKE_SOURCE_DIR}/../test/test-sleep-forever.c
)
-add_executable(test-service ${test-service_SOURCES})
-target_link_libraries(test-service dbus-testutils)
-
-add_executable(test-names ${test-names_SOURCES})
-target_link_libraries(test-names dbus-testutils)
-
-add_executable(shell-test ${shell-test_SOURCES})
-target_link_libraries(shell-test ${DBUS_INTERNAL_LIBRARIES})
-ADD_TEST(shell-test ${EXECUTABLE_OUTPUT_PATH}/shell-test${EXEEXT})
-
-add_executable(test-shell-service ${test-shell-service_SOURCES})
-target_link_libraries(test-shell-service dbus-testutils)
-
-add_executable(spawn-test ${spawn-test_SOURCES})
-target_link_libraries(spawn-test ${DBUS_INTERNAL_LIBRARIES})
-
-add_executable(test-exit ${test-exit_SOURCES})
-target_link_libraries(test-exit ${DBUS_INTERNAL_LIBRARIES})
-
-add_executable(test-segfault ${test-segfault_SOURCES})
-target_link_libraries(test-segfault ${DBUS_INTERNAL_LIBRARIES})
-
-add_executable(test-sleep-forever ${test-sleep-forever_SOURCES})
-target_link_libraries(test-sleep-forever ${DBUS_INTERNAL_LIBRARIES})
+add_helper_executable(test-service ${test-service_SOURCES} dbus-testutils)
+add_helper_executable(test-names ${test-names_SOURCES} dbus-testutils)
+add_test_executable(test-shell ${test-shell_SOURCES} ${DBUS_INTERNAL_LIBRARIES})
+add_test_executable(test-printf ${CMAKE_SOURCE_DIR}/../test/internals/printf.c dbus-testutils)
+add_helper_executable(test-shell-service ${test-shell-service_SOURCES} dbus-testutils)
+add_helper_executable(test-spawn ${test-spawn_SOURCES} ${DBUS_INTERNAL_LIBRARIES})
+add_helper_executable(test-exit ${test-exit_SOURCES} ${DBUS_INTERNAL_LIBRARIES})
+add_helper_executable(test-segfault ${test-segfault_SOURCES} ${DBUS_INTERNAL_LIBRARIES})
+add_helper_executable(test-sleep-forever ${test-sleep-forever_SOURCES} ${DBUS_INTERNAL_LIBRARIES})
+
+if(DBUS_WITH_GLIB)
+ message(STATUS "with glib test apps")
+ add_definitions(
+ ${GLIB2_DEFINITIONS}
+ ${GOBJECT_DEFINITIONS}
+ )
+ include_directories(
+ ${GLIB2_INCLUDE_DIR}
+ ${GOBJECT_INCLUDE_DIR}
+ )
+ set(TEST_LIBRARIES ${DBUS_INTERNAL_LIBRARIES} dbus-testutils ${GLIB2_LIBRARIES} ${GOBJECT_LIBRARIES})
+
+ add_test_executable(test-corrupt ${CMAKE_SOURCE_DIR}/../test/corrupt.c ${TEST_LIBRARIES})
+ add_test_executable(test-dbus-daemon ${CMAKE_SOURCE_DIR}/../test/dbus-daemon.c ${TEST_LIBRARIES})
+ add_test_executable(test-dbus-daemon-eavesdrop ${CMAKE_SOURCE_DIR}/../test/dbus-daemon-eavesdrop.c ${TEST_LIBRARIES})
+ add_test_executable(test-loopback ${CMAKE_SOURCE_DIR}/../test/loopback.c ${TEST_LIBRARIES})
+ add_test_executable(test-marshal ${CMAKE_SOURCE_DIR}/../test/marshal.c ${TEST_LIBRARIES})
+ add_test_executable(test-refs ${CMAKE_SOURCE_DIR}/../test/internals/refs.c ${TEST_LIBRARIES})
+ add_test_executable(test-relay ${CMAKE_SOURCE_DIR}/../test/relay.c ${TEST_LIBRARIES})
+ add_test_executable(test-syntax ${CMAKE_SOURCE_DIR}/../test/syntax.c ${TEST_LIBRARIES})
+ add_test_executable(test-syslog ${CMAKE_SOURCE_DIR}/../test/internals/syslog.c ${TEST_LIBRARIES})
+ add_helper_executable(manual-authz ${CMAKE_SOURCE_DIR}/../test/manual-authz.c ${TEST_LIBRARIES})
+endif()
### keep these in creation order, i.e. uppermost dirs first
set (TESTDIRS
@@ -81,6 +92,7 @@ set (TESTDIRS
test/data/sha-1
test/data/valid-config-files
test/data/valid-config-files/basic.d
+ test/data/valid-config-files/session.d
test/data/valid-config-files/system.d
test/data/valid-config-files-system
test/data/valid-introspection-files
@@ -139,17 +151,18 @@ ENDFOREACH(FILE_TYPE)
MESSAGE(STATUS "Copying generated bus config files to test directory")
set (OUTDIR ${CMAKE_BINARY_DIR}/test/data/valid-config-files)
-FILE(GLOB FILES "${CMAKE_BINARY_DIR}/bus/*.conf" )
+FILE(GLOB FILES "${CMAKE_SOURCE_DIR}/../bus/*.conf.in" )
FILE(MAKE_DIRECTORY ${OUTDIR})
FOREACH(FILE ${FILES})
GET_FILENAME_COMPONENT(FILENAME ${FILE} NAME)
+ STRING(REGEX REPLACE "\\.in$" "" FILENAME ${FILENAME})
SET (TARGET ${OUTDIR}/${FILENAME})
- configure_file(${FILE} ${TARGET} COPYONLY)
+ configure_file(${FILE} ${TARGET} @ONLY)
IF (CONFIG_VERBOSE)
MESSAGE("FROM: ${FILE}\nTO: ${TARGET}\n")
ENDIF (CONFIG_VERBOSE)
ENDFOREACH(FILE)
-# todo: for installation the TEST_..._BINARY variables must reflect the
-# installation dir or has to be defined relative
-#
+add_custom_target(check
+ COMMAND ctest -R ^test-.*
+)
diff --git a/cmake/test/name-test/CMakeLists.txt b/cmake/test/name-test/CMakeLists.txt
index 80b9908b..befb28f9 100644
--- a/cmake/test/name-test/CMakeLists.txt
+++ b/cmake/test/name-test/CMakeLists.txt
@@ -1,39 +1,15 @@
-if (DBUS_BUILD_TESTS)
+if (DBUS_ENABLE_EMBEDDED_TESTS)
set (NAMEtest-DIR ../../../test/name-test)
-add_definitions(-DDBUS_COMPILATION)
-
-add_executable(test-pending-call-dispatch ${NAMEtest-DIR}/test-pending-call-dispatch.c)
-target_link_libraries(test-pending-call-dispatch ${DBUS_INTERNAL_LIBRARIES})
-ADD_TEST(test-pending-call-dispatch ${EXECUTABLE_OUTPUT_PATH}/test-pending-call-dispatch)
-
-add_executable(test-pending-call-timeout ${NAMEtest-DIR}/test-pending-call-timeout.c)
-target_link_libraries(test-pending-call-timeout ${DBUS_INTERNAL_LIBRARIES})
-ADD_TEST(test-pending-call-timeout ${EXECUTABLE_OUTPUT_PATH}/test-pending-call-timeout)
-
-add_executable(test-thread-init ${NAMEtest-DIR}/test-threads-init.c)
-target_link_libraries(test-thread-init ${DBUS_INTERNAL_LIBRARIES})
-ADD_TEST(test-thread-init ${EXECUTABLE_OUTPUT_PATH}/test-thread-init)
-
-add_executable(test-ids ${NAMEtest-DIR}/test-ids.c)
-target_link_libraries(test-ids ${DBUS_INTERNAL_LIBRARIES})
-ADD_TEST(test-ids ${EXECUTABLE_OUTPUT_PATH}/test-ids)
-
-add_executable(test-shutdown ${NAMEtest-DIR}/test-shutdown.c)
-target_link_libraries(test-shutdown dbus-testutils)
-ADD_TEST(test-shutdown ${EXECUTABLE_OUTPUT_PATH}/test-shutdown)
-
-add_executable(test-privserver ${NAMEtest-DIR}/test-privserver.c)
-target_link_libraries(test-privserver dbus-testutils)
-ADD_TEST(test-privserver ${EXECUTABLE_OUTPUT_PATH}/test-privserver)
-
-add_executable(test-privserver-client ${NAMEtest-DIR}/test-privserver-client.c)
-target_link_libraries(test-privserver-client dbus-testutils)
-ADD_TEST(test-privserver-client ${EXECUTABLE_OUTPUT_PATH}/test-privserver-client)
-
-add_executable(test-autolaunch ${NAMEtest-DIR}/test-autolaunch.c)
-target_link_libraries(test-autolaunch dbus-testutils)
-ADD_TEST(test-autolaunch ${EXECUTABLE_OUTPUT_PATH}/test-autolaunch)
-
-endif (DBUS_BUILD_TESTS)
+add_definitions(${DBUS_INTERNAL_CLIENT_DEFINITIONS})
+
+add_helper_executable(test-pending-call-dispatch ${NAMEtest-DIR}/test-pending-call-dispatch.c ${DBUS_INTERNAL_LIBRARIES})
+add_helper_executable(test-pending-call-timeout ${NAMEtest-DIR}/test-pending-call-timeout.c ${DBUS_INTERNAL_LIBRARIES})
+add_helper_executable(test-thread-init ${NAMEtest-DIR}/test-threads-init.c ${DBUS_INTERNAL_LIBRARIES})
+add_helper_executable(test-ids ${NAMEtest-DIR}/test-ids.c ${DBUS_INTERNAL_LIBRARIES})
+add_helper_executable(test-shutdown ${NAMEtest-DIR}/test-shutdown.c dbus-testutils)
+add_helper_executable(test-privserver ${NAMEtest-DIR}/test-privserver.c dbus-testutils)
+add_helper_executable(test-privserver-client ${NAMEtest-DIR}/test-privserver-client.c dbus-testutils)
+add_helper_executable(test-autolaunch ${NAMEtest-DIR}/test-autolaunch.c dbus-testutils)
+endif (DBUS_ENABLE_EMBEDDED_TESTS)
diff --git a/cmake/tools/CMakeLists.txt b/cmake/tools/CMakeLists.txt
index 101c7e60..ddbd5bcf 100644
--- a/cmake/tools/CMakeLists.txt
+++ b/cmake/tools/CMakeLists.txt
@@ -1,5 +1,3 @@
-project(tools)
-
set (dbus_send_SOURCES
../../tools/dbus-print-message.c
../../tools/dbus-print-message.h
diff --git a/compile b/compile
index 862a14e8..531136b0 100755
--- a/compile
+++ b/compile
@@ -1,10 +1,9 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
-scriptversion=2012-03-05.13; # UTC
+scriptversion=2012-10-14.11; # UTC
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010, 2012 Free
-# Software Foundation, Inc.
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
@@ -113,6 +112,11 @@ func_cl_dashl ()
lib=$dir/$lib.lib
break
fi
+ if test -f "$dir/lib$lib.a"; then
+ found=yes
+ lib=$dir/lib$lib.a
+ break
+ fi
done
IFS=$save_IFS
diff --git a/config.guess b/config.guess
index d622a44e..1f5c50c0 100755
--- a/config.guess
+++ b/config.guess
@@ -1,14 +1,12 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-# 2011, 2012 Free Software Foundation, Inc.
+# Copyright 1992-2014 Free Software Foundation, Inc.
-timestamp='2012-02-10'
+timestamp='2014-03-23'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
@@ -22,19 +20,17 @@ timestamp='2012-02-10'
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Originally written by Per Bothner. Please send patches (context
-# diff format) to <config-patches@gnu.org> and include a ChangeLog
-# entry.
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
#
-# This script attempts to guess a canonical system name similar to
-# config.sub. If it succeeds, it prints the system name on stdout, and
-# exits with 0. Otherwise, it exits with 1.
+# Originally written by Per Bothner.
#
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+#
+# Please send patches with a ChangeLog entry to config-patches@gnu.org.
+
me=`echo "$0" | sed -e 's,.*/,,'`
@@ -54,9 +50,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
-Free Software Foundation, Inc.
+Copyright 1992-2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -138,6 +132,27 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+case "${UNAME_SYSTEM}" in
+Linux|GNU|GNU/*)
+ # If the system lacks a compiler, then just pick glibc.
+ # We could probably try harder.
+ LIBC=gnu
+
+ eval $set_cc_for_build
+ cat <<-EOF > $dummy.c
+ #include <features.h>
+ #if defined(__UCLIBC__)
+ LIBC=uclibc
+ #elif defined(__dietlibc__)
+ LIBC=dietlibc
+ #else
+ LIBC=gnu
+ #endif
+ EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+ ;;
+esac
+
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
@@ -200,6 +215,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
exit ;;
+ *:Bitrig:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+ exit ;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
@@ -302,7 +321,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit ;;
- arm:riscos:*:*|arm:RISCOS:*:*)
+ arm*:riscos:*:*|arm*:RISCOS:*:*)
echo arm-unknown-riscos
exit ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
@@ -801,10 +820,13 @@ EOF
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit ;;
+ *:MINGW64*:*)
+ echo ${UNAME_MACHINE}-pc-mingw64
+ exit ;;
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
- i*:MSYS*:*)
+ *:MSYS*:*)
echo ${UNAME_MACHINE}-pc-msys
exit ;;
i*:windows32*:*)
@@ -852,21 +874,21 @@ EOF
exit ;;
*:GNU:*:*)
# the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
exit ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit ;;
aarch64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
@@ -879,59 +901,54 @@ EOF
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ arc:Linux:*:* | arceb:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
arm*:Linux:*:*)
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
else
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
- echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
else
- echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
fi
fi
exit ;;
avr32*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
cris:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-gnu
+ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;;
crisv32:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-gnu
+ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;;
frv:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
hexagon:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
i*86:Linux:*:*)
- LIBC=gnu
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #ifdef __dietlibc__
- LIBC=dietlibc
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
- echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+ echo ${UNAME_MACHINE}-pc-linux-${LIBC}
exit ;;
ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
mips:Linux:*:* | mips64:Linux:*:*)
eval $set_cc_for_build
@@ -950,54 +967,63 @@ EOF
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
;;
- or32:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ openrisc*:Linux:*:*)
+ echo or1k-unknown-linux-${LIBC}
+ exit ;;
+ or32:Linux:*:* | or1k*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
padre:Linux:*:*)
- echo sparc-unknown-linux-gnu
+ echo sparc-unknown-linux-${LIBC}
exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-gnu
+ echo hppa64-unknown-linux-${LIBC}
exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-gnu ;;
- PA8*) echo hppa2.0-unknown-linux-gnu ;;
- *) echo hppa-unknown-linux-gnu ;;
+ PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
+ PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
+ *) echo hppa-unknown-linux-${LIBC} ;;
esac
exit ;;
ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-gnu
+ echo powerpc64-unknown-linux-${LIBC}
exit ;;
ppc:Linux:*:*)
- echo powerpc-unknown-linux-gnu
+ echo powerpc-unknown-linux-${LIBC}
+ exit ;;
+ ppc64le:Linux:*:*)
+ echo powerpc64le-unknown-linux-${LIBC}
+ exit ;;
+ ppcle:Linux:*:*)
+ echo powerpcle-unknown-linux-${LIBC}
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux
+ echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
exit ;;
sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
tile*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-gnu
+ echo ${UNAME_MACHINE}-dec-linux-${LIBC}
exit ;;
x86_64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -1201,6 +1227,9 @@ EOF
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
echo i586-pc-haiku
exit ;;
+ x86_64:Haiku:*:*)
+ echo x86_64-unknown-haiku
+ exit ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit ;;
@@ -1227,19 +1256,31 @@ EOF
exit ;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- case $UNAME_PROCESSOR in
- i386)
- eval $set_cc_for_build
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
- if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
- then
- UNAME_PROCESSOR="x86_64"
- fi
- fi ;;
- unknown) UNAME_PROCESSOR=powerpc ;;
- esac
+ eval $set_cc_for_build
+ if test "$UNAME_PROCESSOR" = unknown ; then
+ UNAME_PROCESSOR=powerpc
+ fi
+ if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ case $UNAME_PROCESSOR in
+ i386) UNAME_PROCESSOR=x86_64 ;;
+ powerpc) UNAME_PROCESSOR=powerpc64 ;;
+ esac
+ fi
+ fi
+ elif test "$UNAME_PROCESSOR" = i386 ; then
+ # Avoid executing cc on OS X 10.9, as it ships with a stub
+ # that puts up a graphical alert prompting to install
+ # developer tools. Any system running Mac OS X 10.7 or
+ # later (Darwin 11 and later) is required to have a 64-bit
+ # processor. This is not true of the ARM version of Darwin
+ # that Apple uses in portable devices.
+ UNAME_PROCESSOR=x86_64
+ fi
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
@@ -1256,7 +1297,7 @@ EOF
NEO-?:NONSTOP_KERNEL:*:*)
echo neo-tandem-nsk${UNAME_RELEASE}
exit ;;
- NSE-?:NONSTOP_KERNEL:*:*)
+ NSE-*:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk${UNAME_RELEASE}
exit ;;
NSR-?:NONSTOP_KERNEL:*:*)
@@ -1330,157 +1371,6 @@ EOF
exit ;;
esac
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
- /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
- I don't know.... */
- printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
- printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
- "4"
-#else
- ""
-#endif
- ); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
- printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
- int version;
- version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
- if (version < 4)
- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
- else
- printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
- exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
- printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
- printf ("ns32k-encore-mach\n"); exit (0);
-#else
- printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
- printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
- printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
- printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
- struct utsname un;
-
- uname(&un);
-
- if (strncmp(un.version, "V2", 2) == 0) {
- printf ("i386-sequent-ptx2\n"); exit (0);
- }
- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
- printf ("i386-sequent-ptx1\n"); exit (0);
- }
- printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-# include <sys/param.h>
-# if defined (BSD)
-# if BSD == 43
- printf ("vax-dec-bsd4.3\n"); exit (0);
-# else
-# if BSD == 199006
- printf ("vax-dec-bsd4.3reno\n"); exit (0);
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# endif
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# else
- printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
- printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
- exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
- { echo "$SYSTEM_NAME"; exit; }
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
- case `getsysinfo -f cpu_type` in
- c1*)
- echo c1-convex-bsd
- exit ;;
- c2*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit ;;
- c34*)
- echo c34-convex-bsd
- exit ;;
- c38*)
- echo c38-convex-bsd
- exit ;;
- c4*)
- echo c4-convex-bsd
- exit ;;
- esac
-fi
-
cat >&2 <<EOF
$0: unable to guess system type
diff --git a/config.h.in b/config.h.in
index bea071e0..5d624fb3 100644
--- a/config.h.in
+++ b/config.h.in
@@ -9,18 +9,12 @@
/* Directory for installing the binaries */
#undef DBUS_BINDIR
-/* Define to build test code into the library and binaries */
-#undef DBUS_BUILD_TESTS
-
/* Define to build X11 functionality */
#undef DBUS_BUILD_X11
/* whether -export-dynamic was passed to libtool */
#undef DBUS_BUILT_R_DYNAMIC
-/* Use dnotify on Linux */
-#undef DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX
-
/* Use inotify */
#undef DBUS_BUS_ENABLE_INOTIFY
@@ -63,9 +57,6 @@
/* Define to enable bus daemon usage statistics */
#undef DBUS_ENABLE_STATS
-/* Build with caching of user data */
-#undef DBUS_ENABLE_USERDB_CACHE
-
/* Support a verbose mode */
#undef DBUS_ENABLE_VERBOSE_MODE
@@ -90,6 +81,9 @@
/* Prefix for installing DBUS */
#undef DBUS_PREFIX
+/* Fallback address for session bus clients */
+#undef DBUS_SESSION_BUS_CONNECT_ADDRESS
+
/* Where per-session bus puts its sockets */
#undef DBUS_SESSION_SOCKET_DIR
@@ -132,6 +126,9 @@
/* Define if GLib, GObject, GIO are available */
#undef DBUS_WITH_GLIB
+/* The maximum number of connections that can be handled at once */
+#undef FD_SETSIZE
+
/* The name of the gettext domain */
#undef GETTEXT_PACKAGE
@@ -269,6 +266,12 @@
/* Have POSIX function getpwnam_r */
#undef HAVE_POSIX_GETPWNAM_R
+/* Define to 1 if you have the `prctl' function. */
+#undef HAVE_PRCTL
+
+/* Define to 1 if you have the `raise' function. */
+#undef HAVE_RAISE
+
/* SELinux support */
#undef HAVE_SELINUX
@@ -317,6 +320,9 @@
/* Define to 1 if you have the <sys/inotify.h> header file. */
#undef HAVE_SYS_INOTIFY_H
+/* Define to 1 if you have the <sys/prctl.h> header file. */
+#undef HAVE_SYS_PRCTL_H
+
/* Define to 1 if you have the <sys/resource.h> header file. */
#undef HAVE_SYS_RESOURCE_H
@@ -356,16 +362,10 @@
/* Define to 1 if you have the <ws2tcpip.h> header file. */
#undef HAVE_WS2TCPIP_H
-/* Define to 1 if you have the <wspiapi.h> header file. */
-#undef HAVE_WSPIAPI_H
-
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#undef LT_OBJDIR
-/* Define to 1 if your C compiler doesn't accept -c and -o together. */
-#undef NO_MINUS_C_MINUS_O
-
/* Name of package */
#undef PACKAGE
@@ -411,8 +411,8 @@
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
-/* Full path to the daemon in the builddir */
-#undef TEST_BUS_BINARY
+/* Full path to the dbus-launch in the builddir */
+#undef TEST_BUS_LAUNCH_BINARY
/* Listening address for regression tests */
#undef TEST_LISTEN
@@ -493,3 +493,12 @@
#ifndef __cplusplus
#undef inline
#endif
+
+
+/* explicitly define these macros to get less confusing conditions */
+#ifndef DBUS_DISABLE_ASSERT
+# define DBUS_ENABLE_ASSERT 1
+#endif
+#ifndef DBUS_DISABLE_CHECKS
+# define DBUS_ENABLE_CHECKS 1
+#endif
diff --git a/config.sub b/config.sub
index 6205f842..bba4efb8 100755
--- a/config.sub
+++ b/config.sub
@@ -1,24 +1,18 @@
#! /bin/sh
# Configuration validation subroutine script.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-# 2011, 2012 Free Software Foundation, Inc.
+# Copyright 1992-2014 Free Software Foundation, Inc.
-timestamp='2012-04-18'
+timestamp='2014-09-11'
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine. It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
@@ -26,11 +20,12 @@ timestamp='2012-04-18'
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
-# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted GNU ChangeLog entry.
+# Please send patches with a ChangeLog entry to config-patches@gnu.org.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
@@ -73,9 +68,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
-Free Software Foundation, Inc.
+Copyright 1992-2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -123,7 +116,7 @@ esac
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
- linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | \
kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
@@ -156,7 +149,7 @@ case $os in
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray | -microblaze)
+ -apple | -axis | -knuth | -cray | -microblaze*)
os=
basic_machine=$1
;;
@@ -259,10 +252,12 @@ case $basic_machine in
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
- | be32 | be64 \
+ | arc | arceb \
+ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+ | avr | avr32 \
+ | be32 | be64 \
| bfin \
- | c4x | clipper \
+ | c4x | c8051 | clipper \
| d10v | d30v | dlx | dsp16xx \
| epiphany \
| fido | fr30 | frv \
@@ -270,10 +265,11 @@ case $basic_machine in
| hexagon \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
+ | k1om \
| le32 | le64 \
| lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | mcore | mep | metag \
+ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
@@ -287,23 +283,26 @@ case $basic_machine in
| mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
+ | mipsisa32r6 | mipsisa32r6el \
| mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64r6 | mipsisa64r6el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
+ | mipsr5900 | mipsr5900el \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
| moxie \
| mt \
| msp430 \
| nds32 | nds32le | nds32be \
- | nios | nios2 \
+ | nios | nios2 | nios2eb | nios2el \
| ns16k | ns32k \
- | open8 \
- | or32 \
+ | open8 | or1k | or1knd | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \
+ | riscv32 | riscv64 \
| rl78 | rx \
| score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
@@ -328,7 +327,7 @@ case $basic_machine in
c6x)
basic_machine=tic6x-unknown
;;
- m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
+ m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
basic_machine=$basic_machine-unknown
os=-none
;;
@@ -370,13 +369,13 @@ case $basic_machine in
| aarch64-* | aarch64_be-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
| be32-* | be64-* \
| bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* \
- | clipper-* | craynv-* | cydra-* \
+ | c8051-* | clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
@@ -385,11 +384,13 @@ case $basic_machine in
| hexagon-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
+ | k1om-* \
| le32-* | le64-* \
| lm32-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+ | microblaze-* | microblazeel-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
@@ -403,18 +404,22 @@ case $basic_machine in
| mips64vr5900-* | mips64vr5900el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa32r6-* | mipsisa32r6el-* \
| mipsisa64-* | mipsisa64el-* \
| mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64r6-* | mipsisa64r6el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipsr5900-* | mipsr5900el-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| mt-* \
| msp430-* \
| nds32-* | nds32le-* | nds32be-* \
- | nios-* | nios2-* \
+ | nios-* | nios2-* | nios2eb-* | nios2el-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| open8-* \
+ | or1k*-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
@@ -788,11 +793,15 @@ case $basic_machine in
basic_machine=ns32k-utek
os=-sysv
;;
- microblaze)
+ microblaze*)
basic_machine=microblaze-xilinx
;;
+ mingw64)
+ basic_machine=x86_64-pc
+ os=-mingw64
+ ;;
mingw32)
- basic_machine=i386-pc
+ basic_machine=i686-pc
os=-mingw32
;;
mingw32ce)
@@ -820,6 +829,10 @@ case $basic_machine in
basic_machine=powerpc-unknown
os=-morphos
;;
+ moxiebox)
+ basic_machine=moxie-unknown
+ os=-moxiebox
+ ;;
msdos)
basic_machine=i386-pc
os=-msdos
@@ -828,7 +841,7 @@ case $basic_machine in
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
;;
msys)
- basic_machine=i386-pc
+ basic_machine=i686-pc
os=-msys
;;
mvs)
@@ -1019,7 +1032,11 @@ case $basic_machine in
basic_machine=i586-unknown
os=-pw32
;;
- rdos)
+ rdos | rdos64)
+ basic_machine=x86_64-pc
+ os=-rdos
+ ;;
+ rdos32)
basic_machine=i386-pc
os=-rdos
;;
@@ -1346,29 +1363,29 @@ case $os in
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
- | -sym* | -kopensolaris* \
+ | -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* | -aros* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
- | -openbsd* | -solidbsd* \
+ | -bitrig* | -openbsd* | -solidbsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* | -cegcc* \
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -linux-android* \
- | -linux-newlib* | -linux-uclibc* \
- | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+ | -linux-newlib* | -linux-musl* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@@ -1492,9 +1509,6 @@ case $os in
-aros*)
os=-aros
;;
- -kaos*)
- os=-kaos
- ;;
-zvmoe)
os=-zvmoe
;;
@@ -1543,6 +1557,9 @@ case $basic_machine in
c4x-* | tic4x-*)
os=-coff
;;
+ c8051-*)
+ os=-elf
+ ;;
hexagon-*)
os=-elf
;;
diff --git a/configure b/configure
index 585f9a4d..d3219757 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.69 for dbus 1.6.10.
+# Generated by GNU Autoconf 2.69 for dbus 1.8.16.
#
# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=dbus>.
#
@@ -591,8 +591,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='dbus'
PACKAGE_TARNAME='dbus'
-PACKAGE_VERSION='1.6.10'
-PACKAGE_STRING='dbus 1.6.10'
+PACKAGE_VERSION='1.8.16'
+PACKAGE_STRING='dbus 1.8.16'
PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=dbus'
PACKAGE_URL=''
@@ -632,16 +632,18 @@ ac_includes_default="\
# include <unistd.h>
#endif"
+ac_header_list=
+ac_func_list=
ac_subst_vars='am__EXEEXT_FALSE
am__EXEEXT_TRUE
LTLIBOBJS
LIBOBJS
-DBUS_SESSION_BUS_DEFAULT_ADDRESS
+DBUS_SESSION_BUS_CONNECT_ADDRESS
+DBUS_SESSION_BUS_LISTEN_ADDRESS
DBUS_SESSION_SOCKET_DIR
TEST_LISTEN
TEST_SOCKET_DIR
TEST_LAUNCH_HELPER_BINARY
-TEST_BUS_BINARY
DBUS_TEST_EXEC
DBUS_TEST_DATA
DBUS_LIBEXECDIR
@@ -673,9 +675,6 @@ EXPANDED_LOCALSTATEDIR
EXPANDED_PREFIX
DBUS_CAN_UPLOAD_DOCS_FALSE
DBUS_CAN_UPLOAD_DOCS_TRUE
-DBUS_HAVE_MAN2HTML_FALSE
-DBUS_HAVE_MAN2HTML_TRUE
-MAN2HTML
DBUS_XML_DOCS_ENABLED_FALSE
DBUS_XML_DOCS_ENABLED_TRUE
XMLTO
@@ -712,8 +711,6 @@ DBUS_BUS_ENABLE_KQUEUE_FALSE
DBUS_BUS_ENABLE_KQUEUE_TRUE
HAVE_LINUX_EPOLL_FALSE
HAVE_LINUX_EPOLL_TRUE
-DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX_FALSE
-DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX_TRUE
DBUS_BUS_ENABLE_INOTIFY_FALSE
DBUS_BUS_ENABLE_INOTIFY_TRUE
HAVE_SELINUX_FALSE
@@ -721,16 +718,9 @@ HAVE_SELINUX_TRUE
THREAD_LIBS
XML_LIBS
XML_CFLAGS
-DBUS_USE_LIBXML_FALSE
-DBUS_USE_LIBXML_TRUE
-DBUS_USE_EXPAT_FALSE
-DBUS_USE_EXPAT_TRUE
-LIBXML_LIBS
-LIBXML_CFLAGS
DBUS_PATH_OR_ABSTRACT
DBUS_INT16_TYPE
DBUS_INT32_TYPE
-DBUS_HAVE_INT64
DBUS_UINT64_CONSTANT
DBUS_INT64_CONSTANT
DBUS_INT64_TYPE
@@ -750,14 +740,14 @@ DBUS_WITH_GLIB_FALSE
DBUS_WITH_GLIB_TRUE
DBUS_ENABLE_MODULAR_TESTS_FALSE
DBUS_ENABLE_MODULAR_TESTS_TRUE
+DBUS_WITH_DBUS_GLIB_FALSE
+DBUS_WITH_DBUS_GLIB_TRUE
DBUS_GLIB_LIBS
DBUS_GLIB_CFLAGS
GLIB_LIBS
GLIB_CFLAGS
DBUS_ENABLE_EMBEDDED_TESTS_FALSE
DBUS_ENABLE_EMBEDDED_TESTS_TRUE
-DBUS_BUILD_TESTS_FALSE
-DBUS_BUILD_TESTS_TRUE
DBUS_STATIC_BUILD_CPPFLAGS
DBUS_CYGWIN_FALSE
DBUS_CYGWIN_TRUE
@@ -825,14 +815,14 @@ DBUS_MAJOR_VERSION
LT_AGE
LT_REVISION
LT_CURRENT
-AM_BACKSLASH
-AM_DEFAULT_VERBOSITY
-AM_DEFAULT_V
-AM_V
MAINT
MAINTAINER_MODE_FALSE
MAINTAINER_MODE_TRUE
GETTEXT_PACKAGE
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+AM_DEFAULT_V
+AM_V
am__untar
am__tar
AMTAR
@@ -905,8 +895,8 @@ SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
-enable_maintainer_mode
enable_silent_rules
+enable_maintainer_mode
enable_dependency_tracking
enable_shared
enable_static
@@ -927,14 +917,11 @@ enable_doxygen_docs
enable_abstract_sockets
enable_selinux
enable_libaudit
-enable_dnotify
enable_inotify
enable_kqueue
enable_console_owner_file
-enable_userdb_cache
enable_launchd
enable_systemd
-with_xml
with_init_scripts
with_session_socket_dir
with_test_socket_dir
@@ -945,12 +932,11 @@ with_console_owner_file
with_launchd_agent_dir
with_dbus_user
with_dbus_daemondir
-with_dbus_session_bus_default_address
enable_embedded_tests
enable_modular_tests
enable_tests
+with_dbus_glib
enable_installed_tests
-with_64_bit
enable_epoll
with_valgrind
enable_x11_autolaunch
@@ -958,6 +944,8 @@ with_x
enable_Werror
with_systemdsystemunitdir
with_dbus_test_dir
+with_dbus_session_bus_listen_address
+with_dbus_session_bus_connect_address
enable_stats
'
ac_precious_vars='build_alias
@@ -979,14 +967,12 @@ GLIB_LIBS
DBUS_GLIB_CFLAGS
DBUS_GLIB_LIBS
PYTHON
-LIBXML_CFLAGS
-LIBXML_LIBS
+THREAD_LIBS
SYSTEMD_CFLAGS
SYSTEMD_LIBS
VALGRIND_CFLAGS
VALGRIND_LIBS
-XMKMF
-MAN2HTML'
+XMKMF'
# Initialize some variables set by options.
@@ -1527,7 +1513,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.6.10 to adapt to many kinds of systems.
+\`configure' configures dbus 1.8.16 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1601,7 +1587,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of dbus 1.6.10:";;
+ short | recursive ) echo "Configuration of dbus 1.8.16:";;
esac
cat <<\_ACEOF
@@ -1609,12 +1595,15 @@ Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --disable-maintainer-mode disable make rules and dependencies not useful
- (and sometimes confusing) to the casual installer
- --enable-silent-rules less verbose build output (undo: `make V=1')
- --disable-silent-rules verbose build output (undo: `make V=0')
- --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors
+ --enable-silent-rules less verbose build output (undo: "make V=1")
+ --disable-silent-rules verbose build output (undo: "make V=0")
+ --disable-maintainer-mode
+ disable make rules and dependencies not useful (and
+ sometimes confusing) to the casual installer
+ --enable-dependency-tracking
+ do not reject slow dependency extractors
+ --disable-dependency-tracking
+ speeds up one-time build
--enable-shared[=PKGS] build shared libraries [default=yes]
--enable-static[=PKGS] build static libraries [default=yes]
--enable-fast-install[=PKGS]
@@ -1636,12 +1625,10 @@ Optional Features:
use abstract socket namespace (linux only)
--enable-selinux build with SELinux support
--enable-libaudit build audit daemon support for SELinux
- --enable-dnotify build with dnotify support (linux only)
--enable-inotify build with inotify support (linux only)
--enable-kqueue build with kqueue support
--enable-console-owner-file
enable console owner file
- --enable-userdb-cache build with userdb-cache support
--enable-launchd build with launchd auto-launch support
--enable-systemd build with systemd at_console support
--enable-embedded-tests enable unit test code in the library and binaries
@@ -1664,8 +1651,6 @@ Optional Packages:
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
--with-sysroot=DIR Search for dependent libraries within DIR
(or the compiler's sysroot if not specified).
- --with-xml=libxml/expat XML library to use (libxml may be named libxml2 on
- some systems)
--with-init-scripts=redhat
Style of init scripts to install
--with-session-socket-dir=dirname
@@ -1687,10 +1672,7 @@ Optional Packages:
--with-dbus-user=<user> User for running the DBUS daemon (messagebus)
--with-dbus-daemondir=dirname
Directory for installing the DBUS daemon
- --with-dbus-session-bus-default-address=nonce-tcp:/autolaunch:/tcp:host:port
- Transport Type to be used (default: nonce-tcp:)
- --without-64-bit If you have to use this option, please report it as
- a bug
+ --with-dbus-glib Use dbus-glib for regression tests
--with-valgrind Add instrumentation to help valgrind to understand
our allocator
--with-x use the X Window System
@@ -1698,6 +1680,12 @@ Optional Packages:
Directory for systemd service files
--with-dbus-test-dir=dirname
path where the tests tools are available
+ --with-dbus-session-bus-listen-address=ADDRESS
+ default address for a session bus to listen on (see
+ configure.ac)
+ --with-dbus-session-bus-connect-address=ADDRESS
+ fallback address for a session bus client to connect
+ to (see configure.ac)
Some influential environment variables:
CC C compiler command
@@ -1719,9 +1707,7 @@ Some influential environment variables:
DBUS_GLIB_LIBS
linker flags for DBUS_GLIB, overriding pkg-config
PYTHON the Python interpreter
- LIBXML_CFLAGS
- C compiler flags for LIBXML, overriding pkg-config
- LIBXML_LIBS linker flags for LIBXML, overriding pkg-config
+ THREAD_LIBS
SYSTEMD_CFLAGS
C compiler flags for SYSTEMD, overriding pkg-config
SYSTEMD_LIBS
@@ -1731,7 +1717,6 @@ Some influential environment variables:
VALGRIND_LIBS
linker flags for VALGRIND, overriding pkg-config
XMKMF Path to xmkmf, Makefile generator for X Window System
- MAN2HTML Path to man2html (optional)
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
@@ -1799,7 +1784,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-dbus configure 1.6.10
+dbus configure 1.8.16
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2518,7 +2503,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.6.10, which was
+It was created by dbus $as_me 1.8.16, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2798,6 +2783,9 @@ $as_echo "$as_me: creating cache $cache_file" >&6;}
>$cache_file
fi
+as_fn_append ac_header_list " sys/prctl.h"
+as_fn_append ac_func_list " prctl"
+as_fn_append ac_func_list " raise"
# Check that the precious variables saved in the cache have kept the same
# value.
ac_cache_corrupted=false
@@ -2972,7 +2960,7 @@ ac_config_headers="$ac_config_headers config.h"
-am__api_version='1.11'
+am__api_version='1.14'
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
@@ -3069,9 +3057,6 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
$as_echo_n "checking whether build environment is sane... " >&6; }
-# Just in case
-sleep 1
-echo timestamp > conftest.file
# Reject unsafe characters in $srcdir or the absolute working directory
# name. Accept space and tab only in the latter.
am_lf='
@@ -3082,32 +3067,40 @@ case `pwd` in
esac
case $srcdir in
*[\\\"\#\$\&\'\`$am_lf\ \ ]*)
- as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+ as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
esac
-# Do `set' in a subshell so we don't clobber the current shell's
+# Do 'set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
- set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
- if test "$*" = "X"; then
- # -L didn't work.
- set X `ls -t "$srcdir/configure" conftest.file`
- fi
- rm -f conftest.file
- if test "$*" != "X $srcdir/configure conftest.file" \
- && test "$*" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
-alias in your environment" "$LINENO" 5
- fi
-
+ am_has_slept=no
+ for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
+ alias in your environment" "$LINENO" 5
+ fi
+ if test "$2" = conftest.file || test $am_try -eq 2; then
+ break
+ fi
+ # Just in case.
+ sleep 1
+ am_has_slept=yes
+ done
test "$2" = conftest.file
)
then
@@ -3119,6 +3112,16 @@ Check your system clock" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+ ( sleep 1 ) &
+ am_sleep_pid=$!
+fi
+
+rm -f conftest.file
+
test "$program_prefix" != NONE &&
program_transform_name="s&^&$program_prefix&;$program_transform_name"
# Use a double $ so make ignores it.
@@ -3129,8 +3132,8 @@ test "$program_suffix" != NONE &&
ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
if test x"${MISSING+set}" != xset; then
case $am_aux_dir in
@@ -3141,12 +3144,12 @@ if test x"${MISSING+set}" != xset; then
esac
fi
# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
+if eval "$MISSING --is-lightweight"; then
+ am_missing_run="$MISSING "
else
am_missing_run=
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
-$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
fi
if test x"${install_sh}" != xset; then
@@ -3158,10 +3161,10 @@ if test x"${install_sh}" != xset; then
esac
fi
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'. However `strip' might not be the right
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip". However 'strip' might not be the right
# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
+# will honor the 'STRIP' environment variable to overrule this program.
if test "$cross_compiling" != no; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
@@ -3300,12 +3303,6 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
$as_echo "$MKDIR_P" >&6; }
-mkdir_p="$MKDIR_P"
-case $mkdir_p in
- [\\/$]* | ?:[\\/]*) ;;
- */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-
for ac_prog in gawk mawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -3388,6 +3385,45 @@ else
fi
rmdir .tst 2>/dev/null
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+ enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in # (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=1;;
+esac
+am_make=${MAKE-make}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
+if ${am_cv_make_support_nested_variables+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if $as_echo 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+ @$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+ am_cv_make_support_nested_variables=yes
+else
+ am_cv_make_support_nested_variables=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AM_BACKSLASH='\'
+
if test "`cd $srcdir && pwd`" != "`pwd`"; then
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output
# is not polluted with repeated "-I."
@@ -3410,7 +3446,7 @@ fi
# Define the identity of the package.
PACKAGE='dbus'
- VERSION='1.6.10'
+ VERSION='1.8.16'
cat >>confdefs.h <<_ACEOF
@@ -3438,6 +3474,12 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+# For better backward compatibility. To be removed once Automake 1.9.x
+# dies out for good. For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+mkdir_p='$(MKDIR_P)'
+
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
# Always define AMTAR for backward compatibility. Yes, it's still used
@@ -3445,86 +3487,125 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
AMTAR='$${TAR-tar}'
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5
-$as_echo_n "checking how to create a ustar tar archive... " >&6; }
-# Loop over all known methods to create a tar archive until one works.
+# We'll loop over all known methods to create a tar archive until one works.
_am_tools='gnutar plaintar pax cpio none'
-_am_tools=${am_cv_prog_tar_ustar-$_am_tools}
-# Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of `-'.
-for _am_tool in $_am_tools
-do
- case $_am_tool in
- gnutar)
- for _am_tar in tar gnutar gtar;
- do
- { echo "$as_me:$LINENO: $_am_tar --version" >&5
+
+# The POSIX 1988 'ustar' format is defined with fixed-size fields.
+ # There is notably a 21 bits limit for the UID and the GID. In fact,
+ # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
+ # and bug#13588).
+ am_max_uid=2097151 # 2^21 - 1
+ am_max_gid=$am_max_uid
+ # The $UID and $GID variables are not portable, so we need to resort
+ # to the POSIX-mandated id(1) utility. Errors in the 'id' calls
+ # below are definitely unexpected, so allow the users to see them
+ # (that is, avoid stderr redirection).
+ am_uid=`id -u || echo unknown`
+ am_gid=`id -g || echo unknown`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5
+$as_echo_n "checking whether UID '$am_uid' is supported by ustar format... " >&6; }
+ if test $am_uid -le $am_max_uid; 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; }
+ _am_tools=none
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5
+$as_echo_n "checking whether GID '$am_gid' is supported by ustar format... " >&6; }
+ if test $am_gid -le $am_max_gid; 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; }
+ _am_tools=none
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5
+$as_echo_n "checking how to create a ustar tar archive... " >&6; }
+
+ # Go ahead even if we have the value already cached. We do so because we
+ # need to set the values for the 'am__tar' and 'am__untar' variables.
+ _am_tools=${am_cv_prog_tar_ustar-$_am_tools}
+
+ for _am_tool in $_am_tools; do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar; do
+ { echo "$as_me:$LINENO: $_am_tar --version" >&5
($_am_tar --version) >&5 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && break
- done
- am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"'
- am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"'
- am__untar="$_am_tar -xf -"
- ;;
- plaintar)
- # Must skip GNU tar: if it does not support --format= it doesn't create
- # ustar tarball either.
- (tar --version) >/dev/null 2>&1 && continue
- am__tar='tar chf - "$$tardir"'
- am__tar_='tar chf - "$tardir"'
- am__untar='tar xf -'
- ;;
- pax)
- am__tar='pax -L -x ustar -w "$$tardir"'
- am__tar_='pax -L -x ustar -w "$tardir"'
- am__untar='pax -r'
- ;;
- cpio)
- am__tar='find "$$tardir" -print | cpio -o -H ustar -L'
- am__tar_='find "$tardir" -print | cpio -o -H ustar -L'
- am__untar='cpio -i -H ustar -d'
- ;;
- none)
- am__tar=false
- am__tar_=false
- am__untar=false
- ;;
- esac
+ done
+ am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x ustar -w "$$tardir"'
+ am__tar_='pax -L -x ustar -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H ustar -L'
+ am__tar_='find "$tardir" -print | cpio -o -H ustar -L'
+ am__untar='cpio -i -H ustar -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
- # If the value was cached, stop now. We just wanted to have am__tar
- # and am__untar set.
- test -n "${am_cv_prog_tar_ustar}" && break
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_ustar}" && break
- # tar/untar a dummy directory, and stop if the command works
- rm -rf conftest.dir
- mkdir conftest.dir
- echo GrepMe > conftest.dir/file
- { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5
+ # tar/untar a dummy directory, and stop if the command works.
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5
(tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
- rm -rf conftest.dir
- if test -s conftest.tar; then
- { echo "$as_me:$LINENO: $am__untar <conftest.tar" >&5
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ { echo "$as_me:$LINENO: $am__untar <conftest.tar" >&5
($am__untar <conftest.tar) >&5 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
- grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
- fi
-done
-rm -rf conftest.dir
+ { echo "$as_me:$LINENO: cat conftest.dir/file" >&5
+ (cat conftest.dir/file) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+ done
+ rm -rf conftest.dir
-if ${am_cv_prog_tar_ustar+:} false; then :
+ if ${am_cv_prog_tar_ustar+:} false; then :
$as_echo_n "(cached) " >&6
else
am_cv_prog_tar_ustar=$_am_tool
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5
$as_echo "$am_cv_prog_tar_ustar" >&6; }
@@ -3532,6 +3613,49 @@ $as_echo "$am_cv_prog_tar_ustar" >&6; }
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes. So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+ cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present. This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message. This
+can help us improve future automake versions.
+
+END
+ if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+ echo 'Configuration will proceed anyway, since you have set the' >&2
+ echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+ echo >&2
+ else
+ cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+ as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
+ fi
+fi
+
+
GETTEXT_PACKAGE=dbus-1
@@ -3571,10 +3695,10 @@ if test "${enable_silent_rules+set}" = set; then :
enableval=$enable_silent_rules;
fi
-case $enable_silent_rules in
-yes) AM_DEFAULT_VERBOSITY=0;;
-no) AM_DEFAULT_VERBOSITY=1;;
-*) AM_DEFAULT_VERBOSITY=0;;
+case $enable_silent_rules in # (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=0;;
esac
am_make=${MAKE-make}
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
@@ -3618,25 +3742,25 @@ _ACEOF
#
## increment if the interface has additions, changes, removals.
-LT_CURRENT=10
+LT_CURRENT=11
## increment any time the source changes; set to
## 0 if you increment CURRENT
-LT_REVISION=3
+LT_REVISION=11
## increment if any interfaces have been added; set to 0
## if any interfaces have been changed or removed. removal has
## precedence over adding, so set to 0 if both happened.
-LT_AGE=7
+LT_AGE=8
DBUS_MAJOR_VERSION=1
-DBUS_MINOR_VERSION=6
-DBUS_MICRO_VERSION=10
-DBUS_VERSION=1.6.10
+DBUS_MINOR_VERSION=8
+DBUS_MICRO_VERSION=16
+DBUS_VERSION=1.8.16
@@ -4431,6 +4555,65 @@ ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ # Make sure it works both with $CC and with simple cc.
+ # Following AC_PROG_CC_C_O, we do the test twice because some
+ # compilers refuse to overwrite an existing .o file with -o,
+ # though they will create one.
+ am_cv_prog_cc_c_o=yes
+ for am_i in 1 2; do
+ if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+ ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } \
+ && test -f conftest2.$ac_objext; then
+ : OK
+ else
+ am_cv_prog_cc_c_o=no
+ break
+ fi
+ done
+ rm -f core conftest*
+ unset am_i
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
DEPDIR="${am__leading_dot}deps"
ac_config_commands="$ac_config_commands depfiles"
@@ -4450,7 +4633,7 @@ am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
+# Ignore all kinds of additional output from 'make'.
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=include
@@ -4506,8 +4689,8 @@ else
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
rm -rf conftest.dir
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
@@ -4542,16 +4725,16 @@ else
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
am__obj=sub/conftest.${OBJEXT-o}
am__minus_obj="-o $am__obj"
case $depmode in
@@ -4560,8 +4743,8 @@ else
test "$am__universal" = false || continue
;;
nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
if test "x$enable_dependency_tracking" = xyes; then
continue
else
@@ -4569,7 +4752,7 @@ else
fi
;;
msvc7 | msvc7msys | msvisualcpp | msvcmsys)
- # This compiler won't grok `-c -o', but also, the minuso test has
+ # This compiler won't grok '-c -o', but also, the minuso test has
# not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted.
am__obj=conftest.${OBJEXT-o}
@@ -4623,131 +4806,6 @@ else
fi
-if test "x$CC" != xcc; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5
-$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5
-$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
-fi
-set dummy $CC; ac_cc=`$as_echo "$2" |
- sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
-if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-# Make sure it works both with $CC and with simple cc.
-# We do the test twice because some compilers refuse to overwrite an
-# existing .o file with -o, though they will create one.
-ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
-rm -f conftest2.*
-if { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } &&
- test -f conftest2.$ac_objext && { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; };
-then
- eval ac_cv_prog_cc_${ac_cc}_c_o=yes
- if test "x$CC" != xcc; then
- # Test first that cc exists at all.
- if { ac_try='cc -c conftest.$ac_ext >&5'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
- ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
- rm -f conftest2.*
- if { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } &&
- test -f conftest2.$ac_objext && { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; };
- then
- # cc works too.
- :
- else
- # cc exists but doesn't like -o.
- eval ac_cv_prog_cc_${ac_cc}_c_o=no
- fi
- fi
- fi
-else
- eval ac_cv_prog_cc_${ac_cc}_c_o=no
-fi
-rm -f core conftest*
-
-fi
-if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; 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; }
-
-$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h
-
-fi
-
-# FIXME: we rely on the cache variable name because
-# there is no other way.
-set dummy $CC
-am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
-eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
-if test "$am_t" != yes; then
- # Losing compiler, so override with the script.
- # FIXME: It is wrong to rewrite CC.
- # But if we don't then we get into trouble of one sort or another.
- # A longer-term fix would be to have automake use am__CC in this case,
- # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
- CC="$am_aux_dir/compile $CC"
-fi
-
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
@@ -5017,8 +5075,8 @@ else
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
rm -rf conftest.dir
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
@@ -5053,16 +5111,16 @@ else
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
am__obj=sub/conftest.${OBJEXT-o}
am__minus_obj="-o $am__obj"
case $depmode in
@@ -5071,8 +5129,8 @@ else
test "$am__universal" = false || continue
;;
nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
if test "x$enable_dependency_tracking" = xyes; then
continue
else
@@ -5080,7 +5138,7 @@ else
fi
;;
msvc7 | msvc7msys | msvisualcpp | msvcmsys)
- # This compiler won't grok `-c -o', but also, the minuso test has
+ # This compiler won't grok '-c -o', but also, the minuso test has
# not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted.
am__obj=conftest.${OBJEXT-o}
@@ -8008,7 +8066,7 @@ ia64-*-hpux*)
rm -rf conftest*
;;
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
@@ -8033,7 +8091,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
;;
esac
;;
- ppc64-*linux*|powerpc64-*linux*)
+ powerpc64le-*)
+ LD="${LD-ld} -m elf32lppclinux"
+ ;;
+ powerpc64-*)
LD="${LD-ld} -m elf32ppclinux"
;;
s390x-*linux*)
@@ -8052,7 +8113,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
x86_64-*linux*)
LD="${LD-ld} -m elf_x86_64"
;;
- ppc*-*linux*|powerpc*-*linux*)
+ powerpcle-*)
+ LD="${LD-ld} -m elf64lppc"
+ ;;
+ powerpc-*)
LD="${LD-ld} -m elf64ppc"
;;
s390*-*linux*|s390*-*tpf*)
@@ -16133,6 +16197,8 @@ if test "${enable_compiler_coverage+set}" = set; then :
CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
fi
fi
+else
+ enable_compiler_coverage=no
fi
# Check whether --enable-compiler-optimisations was given.
@@ -16465,6 +16531,11 @@ if test "$dbus_win" = yes; then
$as_echo "#define DBUS_WIN 1" >>confdefs.h
+ # Yes, on Windows it really does work like this.
+ # http://support.microsoft.com/kb/111855
+
+$as_echo "#define FD_SETSIZE 8192" >>confdefs.h
+
BUILD_TIMESTAMP=`date --iso-8601=minutes`
# Assume DBUS_VERSION is always three numbers
@@ -16699,13 +16770,6 @@ else
enable_libaudit=auto
fi
-# Check whether --enable-dnotify was given.
-if test "${enable_dnotify+set}" = set; then :
- enableval=$enable_dnotify; enable_dnotify=$enableval
-else
- enable_dnotify=auto
-fi
-
# Check whether --enable-inotify was given.
if test "${enable_inotify+set}" = set; then :
enableval=$enable_inotify; enable_inotify=$enableval
@@ -16727,13 +16791,6 @@ else
enable_console_owner_file=auto
fi
-# Check whether --enable-userdb-cache was given.
-if test "${enable_userdb_cache+set}" = set; then :
- enableval=$enable_userdb_cache; enable_userdb_cache=$enableval
-else
- enable_userdb_cache=yes
-fi
-
# Check whether --enable-launchd was given.
if test "${enable_launchd+set}" = set; then :
enableval=$enable_launchd; enable_launchd=$enableval
@@ -16750,12 +16807,6 @@ fi
-# Check whether --with-xml was given.
-if test "${with_xml+set}" = set; then :
- withval=$with_xml;
-fi
-
-
# Check whether --with-init-scripts was given.
if test "${with_init_scripts+set}" = set; then :
withval=$with_init_scripts;
@@ -16816,14 +16867,6 @@ if test "${with_dbus_daemondir+set}" = set; then :
fi
-# Check whether --with-dbus_session_bus_default_address was given.
-if test "${with_dbus_session_bus_default_address+set}" = set; then :
- withval=$with_dbus_session_bus_default_address; with_dbus_session_bus_default_address=$withval
-else
- with_dbus_session_bus_default_address=nonce-tcp:
-fi
-
-
# Check whether --enable-embedded-tests was given.
if test "${enable_embedded_tests+set}" = set; then :
enableval=$enable_embedded_tests;
@@ -16856,16 +16899,7 @@ 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
- DBUS_BUILD_TESTS_TRUE='#'
- DBUS_BUILD_TESTS_FALSE=
-fi
-
+# and also some stuff in the test/ subdir.
if test "x$enable_embedded_tests" = xyes; then
DBUS_ENABLE_EMBEDDED_TESTS_TRUE=
DBUS_ENABLE_EMBEDDED_TESTS_FALSE='#'
@@ -16878,9 +16912,6 @@ 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.
@@ -16897,7 +16928,8 @@ $as_echo "#define GLIB_VERSION_MAX_ALLOWED GLIB_VERSION_2_32" >>confdefs.h
with_glib=yes
-if test "x$enable_modular_tests" != xno; then
+if test "x$enable_modular_tests" != xno; then :
+
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5
@@ -16977,7 +17009,22 @@ else
$as_echo "yes" >&6; }
:
fi
- # If dbus-gmain.[ch] returned to libdbus then we wouldn't need this
+
+else
+ with_glib=no
+fi
+
+# Not required, because we can use internal APIs (but that makes the
+# "installable tests" less useful as integration tests)
+
+# Check whether --with-dbus_glib was given.
+if test "${with_dbus_glib+set}" = set; then :
+ withval=$with_dbus_glib;
+else
+ with_dbus_glib=auto
+fi
+
+if test "x$with_dbus_glib" != xno; then :
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBUS_GLIB" >&5
@@ -17035,21 +17082,17 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
- if test "x$enable_modular_tests" = xyes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Full test coverage (--enable-modular-tests=yes or --enable-tests=yes) requires dbus-glib" >&5
-$as_echo "$as_me: Full test coverage (--enable-modular-tests=yes or --enable-tests=yes) requires dbus-glib" >&6;}
- as_fn_error $? "$DBUS_GLIB_ERRORS" "$LINENO" 5
- else # assumed to be "auto"
- with_glib=no
- fi
+ if test "x$with_dbus_glib" = xyes; then :
+ as_fn_error $? "$DBUS_GLIB_ERRORS" "$LINENO" 5
+else
+ with_dbus_glib=no
+fi
elif test $pkg_failed = untried; then
- if test "x$enable_modular_tests" = xyes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Full test coverage (--enable-modular-tests=yes or --enable-tests=yes) requires dbus-glib" >&5
-$as_echo "$as_me: Full test coverage (--enable-modular-tests=yes or --enable-tests=yes) requires dbus-glib" >&6;}
- as_fn_error $? "$DBUS_GLIB_ERRORS" "$LINENO" 5
- else # assumed to be "auto"
- with_glib=no
- fi
+ if test "x$with_dbus_glib" = xyes; then :
+ as_fn_error $? "$DBUS_GLIB_ERRORS" "$LINENO" 5
+else
+ with_dbus_glib=no
+fi
else
DBUS_GLIB_CFLAGS=$pkg_cv_DBUS_GLIB_CFLAGS
DBUS_GLIB_LIBS=$pkg_cv_DBUS_GLIB_LIBS
@@ -17058,6 +17101,15 @@ $as_echo "yes" >&6; }
:
fi
fi
+ if test "x$with_dbus_glib" != xno; then
+ DBUS_WITH_DBUS_GLIB_TRUE=
+ DBUS_WITH_DBUS_GLIB_FALSE='#'
+else
+ DBUS_WITH_DBUS_GLIB_TRUE='#'
+ DBUS_WITH_DBUS_GLIB_FALSE=
+fi
+
+
if test "x$enable_modular_tests" != xno; then
$as_echo "#define DBUS_ENABLE_MODULAR_TESTS 1" >>confdefs.h
@@ -17114,8 +17166,8 @@ $as_echo "$as_me: Full test coverage (--enable-tests=yes) requires Python, dbus-
if test -n "$PYTHON"; then
# If the user set $PYTHON, use it and don't search something else.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version >= 2.6" >&5
-$as_echo_n "checking whether $PYTHON version >= 2.6... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version is >= 2.6" >&5
+$as_echo_n "checking whether $PYTHON version is >= 2.6... " >&6; }
prog="import sys
# split strings by '.' and convert to numeric. Append some zeros
# because we need at least 4 digits for the hex conversion.
@@ -17133,7 +17185,9 @@ sys.exit(sys.hexversion < minverhex)"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
- as_fn_error $? "too old" "$LINENO" 5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ as_fn_error $? "Python interpreter is too old" "$LINENO" 5
fi
am_display_PYTHON=$PYTHON
else
@@ -17145,7 +17199,7 @@ if ${am_cv_pathless_PYTHON+:} false; then :
$as_echo_n "(cached) " >&6
else
- for am_cv_pathless_PYTHON in python python2 python3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 none; do
+ for am_cv_pathless_PYTHON in python python2 python3 python3.3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 none; do
test "$am_cv_pathless_PYTHON" = none && break
prog="import sys
# split strings by '.' and convert to numeric. Append some zeros
@@ -17252,6 +17306,25 @@ $as_echo "$am_cv_python_platform" >&6; }
PYTHON_PLATFORM=$am_cv_python_platform
+ # Just factor out some code duplication.
+ am_python_setup_sysconfig="\
+import sys
+# Prefer sysconfig over distutils.sysconfig, for better compatibility
+# with python 3.x. See automake bug#10227.
+try:
+ import sysconfig
+except ImportError:
+ can_use_sysconfig = 0
+else:
+ can_use_sysconfig = 1
+# Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs:
+# <https://github.com/pypa/virtualenv/issues/118>
+try:
+ from platform import python_implementation
+ if python_implementation() == 'CPython' and sys.version[:3] == '2.7':
+ can_use_sysconfig = 0
+except ImportError:
+ pass"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5
@@ -17265,7 +17338,14 @@ else
else
am_py_prefix=$prefix
fi
- am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null`
+ am_cv_python_pythondir=`$PYTHON -c "
+$am_python_setup_sysconfig
+if can_use_sysconfig:
+ sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'})
+else:
+ from distutils import sysconfig
+ sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix')
+sys.stdout.write(sitedir)"`
case $am_cv_python_pythondir in
$am_py_prefix*)
am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
@@ -17302,7 +17382,14 @@ else
else
am_py_exec_prefix=$exec_prefix
fi
- am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null`
+ am_cv_python_pyexecdir=`$PYTHON -c "
+$am_python_setup_sysconfig
+if can_use_sysconfig:
+ sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'})
+else:
+ from distutils import sysconfig
+ sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix')
+sys.stdout.write(sitedir)"`
case $am_cv_python_pyexecdir in
$am_py_exec_prefix*)
am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
@@ -17352,8 +17439,8 @@ else
if test -n "$PYTHON"; then
# If the user set $PYTHON, use it and don't search something else.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version >= 2.6" >&5
-$as_echo_n "checking whether $PYTHON version >= 2.6... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version is >= 2.6" >&5
+$as_echo_n "checking whether $PYTHON version is >= 2.6... " >&6; }
prog="import sys
# split strings by '.' and convert to numeric. Append some zeros
# because we need at least 4 digits for the hex conversion.
@@ -17371,7 +17458,9 @@ sys.exit(sys.hexversion < minverhex)"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
- as_fn_error $? "too old" "$LINENO" 5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ as_fn_error $? "Python interpreter is too old" "$LINENO" 5
fi
am_display_PYTHON=$PYTHON
else
@@ -17383,7 +17472,7 @@ if ${am_cv_pathless_PYTHON+:} false; then :
$as_echo_n "(cached) " >&6
else
- for am_cv_pathless_PYTHON in python python2 python3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 none; do
+ for am_cv_pathless_PYTHON in python python2 python3 python3.3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 none; do
test "$am_cv_pathless_PYTHON" = none && break
prog="import sys
# split strings by '.' and convert to numeric. Append some zeros
@@ -17490,6 +17579,25 @@ $as_echo "$am_cv_python_platform" >&6; }
PYTHON_PLATFORM=$am_cv_python_platform
+ # Just factor out some code duplication.
+ am_python_setup_sysconfig="\
+import sys
+# Prefer sysconfig over distutils.sysconfig, for better compatibility
+# with python 3.x. See automake bug#10227.
+try:
+ import sysconfig
+except ImportError:
+ can_use_sysconfig = 0
+else:
+ can_use_sysconfig = 1
+# Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs:
+# <https://github.com/pypa/virtualenv/issues/118>
+try:
+ from platform import python_implementation
+ if python_implementation() == 'CPython' and sys.version[:3] == '2.7':
+ can_use_sysconfig = 0
+except ImportError:
+ pass"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5
@@ -17503,7 +17611,14 @@ else
else
am_py_prefix=$prefix
fi
- am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null`
+ am_cv_python_pythondir=`$PYTHON -c "
+$am_python_setup_sysconfig
+if can_use_sysconfig:
+ sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'})
+else:
+ from distutils import sysconfig
+ sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix')
+sys.stdout.write(sitedir)"`
case $am_cv_python_pythondir in
$am_py_prefix*)
am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
@@ -17540,7 +17655,14 @@ else
else
am_py_exec_prefix=$exec_prefix
fi
- am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null`
+ am_cv_python_pyexecdir=`$PYTHON -c "
+$am_python_setup_sysconfig
+if can_use_sysconfig:
+ sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'})
+else:
+ from distutils import sysconfig
+ sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix')
+sys.stdout.write(sitedir)"`
case $am_cv_python_pyexecdir in
$am_py_exec_prefix*)
am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
@@ -17584,6 +17706,11 @@ $as_echo "#define DBUS_DISABLE_ASSERT 1" >>confdefs.h
DISABLE_UNUSED_WARNINGS="unused-label"
R_DYNAMIC_LDFLAG=""
+ if test x$enable_embedded_tests = xyes; then
+ DISABLE_UNUSED_WARNINGS="$DISABLE_UNUSED_WARNINGS \
+ unused-but-set-variable unused-variable \
+ unused-function"
+ fi
else
# -rdynamic is needed for glibc's backtrace_symbols to work.
# No clue how much overhead this adds, but it's useful
@@ -17609,11 +17736,7 @@ $as_echo "#define G_DISABLE_CHECKS 1" >>confdefs.h
DISABLE_UNUSED_WARNINGS="unused-label"
fi
-if test x$enable_userdb_cache = xyes; then
-$as_echo "#define DBUS_ENABLE_USERDB_CACHE 1" >>confdefs.h
-
-fi
if test x$enable_compiler_coverage = xyes; then
## so that config.h changes when you toggle gcov support
@@ -17893,15 +18016,6 @@ _ACEOF
-
-# Check whether --with-64-bit was given.
-if test "${with_64_bit+set}" = set; then :
- withval=$with_64_bit;
-else
- with_64_bit=yes
-fi
-
-
### See what our 64 bit type is called
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking 64-bit integer type" >&5
$as_echo_n "checking 64-bit integer type... " >&6; }
@@ -17940,34 +18054,18 @@ $ac_cv_sizeof___int64)
;;
esac
-if test "x$with_64_bit" = xno; then :
-
- DBUS_INT64_TYPE="no_int64_type_detected"
- DBUS_HAVE_INT64=0
- DBUS_INT64_CONSTANT=
- DBUS_UINT64_CONSTANT=
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled via --without-64-bit" >&5
-$as_echo "disabled via --without-64-bit" >&6; }
-
-elif test -z "$dbusint64"; then :
+if test -z "$dbusint64"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
$as_echo "not found" >&6; }
as_fn_error $? "Could not find a 64-bit integer type.
Please report a bug here with details of your platform and compiler:
- http://bugs.freedesktop.org/enter_bug.cgi?product=DBus&component=core
-
-To compile D-Bus with all 64-bit integer types removed (not recommended), use
-the option \"--without-64-bit\".
-
-This option is likely to be removed in future, unless you report that your
-platform needs it." "$LINENO" 5
+ http://bugs.freedesktop.org/enter_bug.cgi?product=DBus&component=core" "$LINENO" 5
else
DBUS_INT64_TYPE="$dbusint64"
- DBUS_HAVE_INT64=1
DBUS_INT64_CONSTANT="$dbusint64_constant"
DBUS_UINT64_CONSTANT="$dbusuint64_constant"
if test x"$dbusint64_printf_modifier" != x; then
@@ -17986,7 +18084,6 @@ fi
-
### see what 32-bit int is called
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking 32-bit integer type" >&5
$as_echo_n "checking 32-bit integer type... " >&6; }
@@ -18617,6 +18714,48 @@ _ACEOF
fi
+# For test-segfault.c
+
+
+
+ for ac_header in $ac_header_list
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+
+
+ for ac_func in $ac_func_list
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+
+
+
+
#### Check for broken poll; taken from Glib's configure
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken poll" >&5
@@ -18861,19 +19000,6 @@ fi
done
-for ac_header in wspiapi.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "wspiapi.h" "ac_cv_header_wspiapi_h" "$ac_includes_default"
-if test "x$ac_cv_header_wspiapi_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_WSPIAPI_H 1
-_ACEOF
-
-fi
-
-done
-
-
for ac_header in alloca.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "alloca.h" "ac_cv_header_alloca_h" "$ac_includes_default"
@@ -19324,126 +19450,8 @@ fi
# unix:path=/foo or unix:abstract=/foo
-
-
-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 as_fn_executable_p "$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 as_fn_executable_p "$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
-
#### Sort out XML library
-# see what we have
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML_ParserCreate_MM in -lexpat" >&5
$as_echo_n "checking for XML_ParserCreate_MM in -lexpat... " >&6; }
if ${ac_cv_lib_expat_XML_ParserCreate_MM+:} false; then :
@@ -19488,149 +19496,226 @@ if test "x$ac_cv_header_expat_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_EXPAT_H 1
_ACEOF
- have_expat=true
+
else
- have_expat=false
+ as_fn_error $? "Could not find expat.h, check config.log for failed attempts" "$LINENO" 5
fi
done
else
- have_expat=false
+ as_fn_error $? "Explicitly requested expat but expat not found" "$LINENO" 5
fi
-# see what we want to use
-dbus_use_libxml=false
-dbus_use_expat=false
-if test x$with_xml = xexpat; then
- if ! $have_expat ; then
- as_fn_error $? "Explicitly requested expat but expat not found" "$LINENO" 5
- fi
- dbus_use_expat=true
-elif test x$with_xml = xlibxml; then
+XML_LIBS=-lexpat
+XML_CFLAGS=
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBXML" >&5
-$as_echo_n "checking for LIBXML... " >&6; }
-if test -n "$LIBXML_CFLAGS"; then
- pkg_cv_LIBXML_CFLAGS="$LIBXML_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0 >= 2.6.0\""; } >&5
- ($PKG_CONFIG --exists --print-errors "libxml-2.0 >= 2.6.0") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_LIBXML_CFLAGS=`$PKG_CONFIG --cflags "libxml-2.0 >= 2.6.0" 2>/dev/null`
-else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
-fi
-if test -n "$LIBXML_LIBS"; then
- pkg_cv_LIBXML_LIBS="$LIBXML_LIBS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0 >= 2.6.0\""; } >&5
- ($PKG_CONFIG --exists --print-errors "libxml-2.0 >= 2.6.0") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_LIBXML_LIBS=`$PKG_CONFIG --libs "libxml-2.0 >= 2.6.0" 2>/dev/null`
-else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
-fi
+# Thread lib detection
+save_libs="$LIBS"
+LIBS="$LIBS $THREAD_LIBS"
-if test $pkg_failed = yes; then
+is_missing_pthread_function="is required when compiling D-Bus on Unix platforms, but is not in your libc or libpthread. Please open a bug on https://bugs.freedesktop.org/enter_bug.cgi?product=dbus with details of your platform."
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
- _pkg_short_errors_supported=yes
+# Don't do these automatic checks if the user set THREAD_LIBS on the
+# configure command-line. If they did, we assume they're right.
+#
+# We also don't do these checks on Windows, because you don't need magical
+# linker flags to have threading support there.
+if test "x$dbus_unix" = xyes && test "x$THREAD_LIBS" = x; then :
+
+ # Mandatory pthread functions. In principle, some of these could be made
+ # optional if there are platforms that don't have them.
+ #
+ # Currently, we only look in -lpthread.
+ # In principle we might need to look in -lpthreads, -lthreads, ...
+ # as well - please file a bug if your platform needs this.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_cond_timedwait" >&5
+$as_echo_n "checking for library containing pthread_cond_timedwait... " >&6; }
+if ${ac_cv_search_pthread_cond_timedwait+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- _pkg_short_errors_supported=no
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_cond_timedwait ();
+int
+main ()
+{
+return pthread_cond_timedwait ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' pthread; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_pthread_cond_timedwait=$ac_res
fi
- if test $_pkg_short_errors_supported = yes; then
- LIBXML_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libxml-2.0 >= 2.6.0" 2>&1`
- else
- LIBXML_PKG_ERRORS=`$PKG_CONFIG --print-errors "libxml-2.0 >= 2.6.0" 2>&1`
- fi
- # Put the nasty error message in config.log where it belongs
- echo "$LIBXML_PKG_ERRORS" >&5
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_pthread_cond_timedwait+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_pthread_cond_timedwait+:} false; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- have_libxml=false
-elif test $pkg_failed = untried; then
- have_libxml=false
else
- LIBXML_CFLAGS=$pkg_cv_LIBXML_CFLAGS
- LIBXML_LIBS=$pkg_cv_LIBXML_LIBS
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- have_libxml=true
+ ac_cv_search_pthread_cond_timedwait=no
fi
- if ! $have_libxml ; then
- as_fn_error $? "Explicitly requested libxml but libxml not found" "$LINENO" 5
- fi
- dbus_use_libxml=true
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_cond_timedwait" >&5
+$as_echo "$ac_cv_search_pthread_cond_timedwait" >&6; }
+ac_res=$ac_cv_search_pthread_cond_timedwait
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ THREAD_LIBS="$LIBS"
else
- ### expat is the default because libxml can't currently survive
- ### our brutal OOM-handling unit test setup.
- ### http://bugzilla.gnome.org/show_bug.cgi?id=109368
- if test x$have_expat = xfalse; then
- as_fn_error $? "Could not find expat.h, check config.log for failed attempts" "$LINENO" 5
- fi
- ### By default, only use Expat since it's tested and known to work. If you're a
- ### general-purpose OS vendor, please don't enable libxml. For embedded use
- ### if your OS is built around libxml, that's another case.
- dbus_use_expat=true
+ as_fn_error $? "pthread_cond_timedwait $is_missing_pthread_function" "$LINENO" 5
fi
- if $dbus_use_expat; then
- DBUS_USE_EXPAT_TRUE=
- DBUS_USE_EXPAT_FALSE='#'
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_mutexattr_init" >&5
+$as_echo_n "checking for library containing pthread_mutexattr_init... " >&6; }
+if ${ac_cv_search_pthread_mutexattr_init+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- DBUS_USE_EXPAT_TRUE='#'
- DBUS_USE_EXPAT_FALSE=
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_mutexattr_init ();
+int
+main ()
+{
+return pthread_mutexattr_init ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' pthread; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_pthread_mutexattr_init=$ac_res
fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_pthread_mutexattr_init+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_pthread_mutexattr_init+:} false; then :
- if $dbus_use_libxml; then
- DBUS_USE_LIBXML_TRUE=
- DBUS_USE_LIBXML_FALSE='#'
else
- DBUS_USE_LIBXML_TRUE='#'
- DBUS_USE_LIBXML_FALSE=
+ ac_cv_search_pthread_mutexattr_init=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_mutexattr_init" >&5
+$as_echo "$ac_cv_search_pthread_mutexattr_init" >&6; }
+ac_res=$ac_cv_search_pthread_mutexattr_init
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ THREAD_LIBS="$LIBS"
+else
+ as_fn_error $? "pthread_mutexattr_init $is_missing_pthread_function" "$LINENO" 5
fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_mutexattr_settype" >&5
+$as_echo_n "checking for library containing pthread_mutexattr_settype... " >&6; }
+if ${ac_cv_search_pthread_mutexattr_settype+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
-if $dbus_use_expat; then
- XML_LIBS=-lexpat
- XML_CFLAGS=
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_mutexattr_settype ();
+int
+main ()
+{
+return pthread_mutexattr_settype ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' pthread; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_pthread_mutexattr_settype=$ac_res
fi
-if $dbus_use_libxml; then
- XML_LIBS=$LIBXML_LIBS
- XML_CFLAGS=$LIBXML_CFLAGS
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_pthread_mutexattr_settype+:} false; then :
+ break
fi
+done
+if ${ac_cv_search_pthread_mutexattr_settype+:} false; then :
+else
+ ac_cv_search_pthread_mutexattr_settype=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_mutexattr_settype" >&5
+$as_echo "$ac_cv_search_pthread_mutexattr_settype" >&6; }
+ac_res=$ac_cv_search_pthread_mutexattr_settype
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ THREAD_LIBS="$LIBS"
+else
+ as_fn_error $? "pthread_mutexattr_settype $is_missing_pthread_function" "$LINENO" 5
+fi
-# Thread lib detection
-ac_fn_c_check_func "$LINENO" "pthread_cond_timedwait" "ac_cv_func_pthread_cond_timedwait"
-if test "x$ac_cv_func_pthread_cond_timedwait" = xyes; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_cond_timedwait in -lpthread" >&5
-$as_echo_n "checking for pthread_cond_timedwait in -lpthread... " >&6; }
-if ${ac_cv_lib_pthread_pthread_cond_timedwait+:} false; then :
+ # Optional, for monotonic clocks. Because it's optional, this check
+ # is non-fatal if we don't find it.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_condattr_setclock" >&5
+$as_echo_n "checking for library containing pthread_condattr_setclock... " >&6; }
+if ${ac_cv_search_pthread_condattr_setclock+:} false; then :
$as_echo_n "(cached) " >&6
else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread $LIBS"
+ ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -19640,43 +19725,51 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char pthread_cond_timedwait ();
+char pthread_condattr_setclock ();
int
main ()
{
-return pthread_cond_timedwait ();
+return pthread_condattr_setclock ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_pthread_pthread_cond_timedwait=yes
-else
- ac_cv_lib_pthread_pthread_cond_timedwait=no
+for ac_lib in '' pthread; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_pthread_condattr_setclock=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_cond_timedwait" >&5
-$as_echo "$ac_cv_lib_pthread_pthread_cond_timedwait" >&6; }
-if test "x$ac_cv_lib_pthread_pthread_cond_timedwait" = xyes; then :
- THREAD_LIBS="-lpthread"
-fi
-
+ conftest$ac_exeext
+ if ${ac_cv_search_pthread_condattr_setclock+:} false; then :
+ break
fi
+done
+if ${ac_cv_search_pthread_condattr_setclock+:} false; then :
-save_libs="$LIBS"
-LIBS="$LIBS $THREAD_LIBS"
-ac_fn_c_check_func "$LINENO" "pthread_condattr_setclock" "ac_cv_func_pthread_condattr_setclock"
-if test "x$ac_cv_func_pthread_condattr_setclock" = xyes; then :
- have_pthread_condattr_setclock=true
else
- have_pthread_condattr_setclock=false
+ ac_cv_search_pthread_condattr_setclock=no
fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_condattr_setclock" >&5
+$as_echo "$ac_cv_search_pthread_condattr_setclock" >&6; }
+ac_res=$ac_cv_search_pthread_condattr_setclock
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ THREAD_LIBS="$LIBS"
+fi
+
-if test x$have_pthread_condattr_setclock = xtrue; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_getres" >&5
+ if test "x$ac_cv_search_pthread_condattr_setclock" != xno; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_getres" >&5
$as_echo_n "checking for library containing clock_getres... " >&6; }
if ${ac_cv_search_clock_getres+:} false; then :
$as_echo_n "(cached) " >&6
@@ -19729,12 +19822,12 @@ $as_echo "$ac_cv_search_clock_getres" >&6; }
ac_res=$ac_cv_search_clock_getres
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
- THREAD_LIBS="$THREAD_LIBS -lrt"
+ THREAD_LIBS="$LIBS"
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CLOCK_MONOTONIC" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CLOCK_MONOTONIC" >&5
$as_echo_n "checking for CLOCK_MONOTONIC... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <time.h>
#include <pthread.h>
@@ -19759,16 +19852,20 @@ else
have_clock_monotonic=false
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-if test x$have_clock_monotonic = xtrue; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5
+ if test x$have_clock_monotonic = xtrue; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5
$as_echo "found" >&6; }
$as_echo "#define HAVE_MONOTONIC_CLOCK 1" >>confdefs.h
+
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
$as_echo "not found" >&6; }
fi
+
+fi
fi
LIBS="$save_libs"
@@ -19975,32 +20072,6 @@ else
fi
-# dnotify checks
-if test x$enable_dnotify = xno ; then
- have_dnotify=no;
-else
- if test x$have_inotify = xno -a x$host_os = xlinux-gnu -o x$host_os = xlinux; then
- have_dnotify=yes;
- else
- have_dnotify=no;
- fi
-fi
-
-if test x$have_dnotify = xyes; then
-
-$as_echo "#define DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX 1" >>confdefs.h
-
-fi
-
- if test x$have_dnotify = xyes; then
- DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX_TRUE=
- DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX_FALSE='#'
-else
- DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX_TRUE='#'
- DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX_FALSE=
-fi
-
-
# For simplicity, we require the userland API for epoll_create1 at
# compile-time (glibc 2.9), but we'll run on kernels that turn out
# not to have it at runtime.
@@ -20222,12 +20293,137 @@ if test -n "$SYSTEMD_CFLAGS"; then
pkg_cv_SYSTEMD_CFLAGS="$SYSTEMD_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-login >= 32, libsystemd-daemon >= 32\""; } >&5
- ($PKG_CONFIG --exists --print-errors "libsystemd-login >= 32, libsystemd-daemon >= 32") 2>&5
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd >= 209\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libsystemd >= 209") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_SYSTEMD_CFLAGS=`$PKG_CONFIG --cflags "libsystemd >= 209" 2>/dev/null`
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$SYSTEMD_LIBS"; then
+ pkg_cv_SYSTEMD_LIBS="$SYSTEMD_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd >= 209\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libsystemd >= 209") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_SYSTEMD_LIBS=`$PKG_CONFIG --libs "libsystemd >= 209" 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
+ SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libsystemd >= 209" 2>&1`
+ else
+ SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --print-errors "libsystemd >= 209" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$SYSTEMD_PKG_ERRORS" >&5
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD" >&5
+$as_echo_n "checking for SYSTEMD... " >&6; }
+
+if test -n "$SYSTEMD_CFLAGS"; then
+ pkg_cv_SYSTEMD_CFLAGS="$SYSTEMD_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-login >= 32, libsystemd-daemon >= 32, libsystemd-journal >= 32\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libsystemd-login >= 32, libsystemd-daemon >= 32, libsystemd-journal >= 32") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_SYSTEMD_CFLAGS=`$PKG_CONFIG --cflags "libsystemd-login >= 32, libsystemd-daemon >= 32, libsystemd-journal >= 32" 2>/dev/null`
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$SYSTEMD_LIBS"; then
+ pkg_cv_SYSTEMD_LIBS="$SYSTEMD_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-login >= 32, libsystemd-daemon >= 32, libsystemd-journal >= 32\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libsystemd-login >= 32, libsystemd-daemon >= 32, libsystemd-journal >= 32") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_SYSTEMD_LIBS=`$PKG_CONFIG --libs "libsystemd-login >= 32, libsystemd-daemon >= 32, libsystemd-journal >= 32" 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
+ SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libsystemd-login >= 32, libsystemd-daemon >= 32, libsystemd-journal >= 32" 2>&1`
+ else
+ SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --print-errors "libsystemd-login >= 32, libsystemd-daemon >= 32, libsystemd-journal >= 32" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$SYSTEMD_PKG_ERRORS" >&5
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ have_systemd=no
+elif test $pkg_failed = untried; then
+ have_systemd=no
+else
+ SYSTEMD_CFLAGS=$pkg_cv_SYSTEMD_CFLAGS
+ SYSTEMD_LIBS=$pkg_cv_SYSTEMD_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ have_systemd=yes
+fi
+elif test $pkg_failed = untried; then
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD" >&5
+$as_echo_n "checking for SYSTEMD... " >&6; }
+
+if test -n "$SYSTEMD_CFLAGS"; then
+ pkg_cv_SYSTEMD_CFLAGS="$SYSTEMD_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-login >= 32, libsystemd-daemon >= 32, libsystemd-journal >= 32\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libsystemd-login >= 32, libsystemd-daemon >= 32, libsystemd-journal >= 32") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- pkg_cv_SYSTEMD_CFLAGS=`$PKG_CONFIG --cflags "libsystemd-login >= 32, libsystemd-daemon >= 32" 2>/dev/null`
+ pkg_cv_SYSTEMD_CFLAGS=`$PKG_CONFIG --cflags "libsystemd-login >= 32, libsystemd-daemon >= 32, libsystemd-journal >= 32" 2>/dev/null`
else
pkg_failed=yes
fi
@@ -20238,12 +20434,12 @@ if test -n "$SYSTEMD_LIBS"; then
pkg_cv_SYSTEMD_LIBS="$SYSTEMD_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-login >= 32, libsystemd-daemon >= 32\""; } >&5
- ($PKG_CONFIG --exists --print-errors "libsystemd-login >= 32, libsystemd-daemon >= 32") 2>&5
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-login >= 32, libsystemd-daemon >= 32, libsystemd-journal >= 32\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libsystemd-login >= 32, libsystemd-daemon >= 32, libsystemd-journal >= 32") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- pkg_cv_SYSTEMD_LIBS=`$PKG_CONFIG --libs "libsystemd-login >= 32, libsystemd-daemon >= 32" 2>/dev/null`
+ pkg_cv_SYSTEMD_LIBS=`$PKG_CONFIG --libs "libsystemd-login >= 32, libsystemd-daemon >= 32, libsystemd-journal >= 32" 2>/dev/null`
else
pkg_failed=yes
fi
@@ -20261,9 +20457,9 @@ else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
- SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libsystemd-login >= 32, libsystemd-daemon >= 32" 2>&1`
+ SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libsystemd-login >= 32, libsystemd-daemon >= 32, libsystemd-journal >= 32" 2>&1`
else
- SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --print-errors "libsystemd-login >= 32, libsystemd-daemon >= 32" 2>&1`
+ SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --print-errors "libsystemd-login >= 32, libsystemd-daemon >= 32, libsystemd-journal >= 32" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$SYSTEMD_PKG_ERRORS" >&5
@@ -20280,6 +20476,13 @@ else
$as_echo "yes" >&6; }
have_systemd=yes
fi
+else
+ SYSTEMD_CFLAGS=$pkg_cv_SYSTEMD_CFLAGS
+ SYSTEMD_LIBS=$pkg_cv_SYSTEMD_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ have_systemd=yes
+fi
fi
if test x$have_systemd = xyes; then
@@ -20478,7 +20681,7 @@ if test x$dbus_win = xyes ; then
if test x$dbus_wince = xyes ; then
NETWORK_libs="-lws2"
else
- NETWORK_libs="-lws2_32"
+ NETWORK_libs="-lws2_32 -liphlpapi"
fi
fi
@@ -20493,6 +20696,19 @@ else
fi
+if test "x$with_valgrind" = xauto; then :
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"valgrind >= 3.6\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "valgrind >= 3.6") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ with_valgrind=yes
+else
+ with_valgrind=no
+fi
+fi
+
if test x$with_valgrind != xno; then
pkg_failed=no
@@ -21949,58 +22165,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_xml_docs" >&5
$as_echo "$enable_xml_docs" >&6; }
-# Extract the first word of "man2html", so it can be a program name with args.
-set dummy man2html; 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_MAN2HTML+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $MAN2HTML in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_MAN2HTML="$MAN2HTML" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_MAN2HTML="$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
-MAN2HTML=$ac_cv_path_MAN2HTML
-if test -n "$MAN2HTML"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAN2HTML" >&5
-$as_echo "$MAN2HTML" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
- if test x$MAN2HTML != x; then
- DBUS_HAVE_MAN2HTML_TRUE=
- DBUS_HAVE_MAN2HTML_FALSE='#'
-else
- DBUS_HAVE_MAN2HTML_TRUE='#'
- DBUS_HAVE_MAN2HTML_FALSE=
-fi
-
-
- if test x$enable_doxygen_docs = xyes -a x$enable_xml_docs = xyes -a \
- x$MAN2HTML != x; then
+ if test x$enable_doxygen_docs = xyes && test x$enable_xml_docs = xyes; then
DBUS_CAN_UPLOAD_DOCS_TRUE=
DBUS_CAN_UPLOAD_DOCS_FALSE='#'
else
@@ -22285,7 +22450,7 @@ if test "x$with_systemdsystemunitdir" != xno; then
systemdsystemunitdir=$with_systemdsystemunitdir
fi
- if test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ; then
+ if test "x$have_systemd" != "xno" -a -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ; then
HAVE_SYSTEMD_TRUE=
HAVE_SYSTEMD_FALSE='#'
else
@@ -22308,8 +22473,17 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
-## system bus only listens on local domain sockets, and never
-## on an abstract socket (so only root can create the socket)
+## System bus only listens on local domain sockets, and never
+## on an abstract socket (so only root can create the socket).
+##
+## This won't work on Windows. It's not meant to - the system bus is
+## meaningless on Windows anyway.
+##
+## This has to be suitable for hard-coding in client libraries as well as
+## in the dbus-daemon's configuration, so it has to be valid to listen on
+## and also to connect to. If this ever changes, it'll need to be split into
+## two variables, one for the listening address and one for the connecting
+## address.
DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=$DBUS_SYSTEM_SOCKET"
@@ -22453,11 +22627,10 @@ _ACEOF
cat >>confdefs.h <<_ACEOF
-#define TEST_BUS_BINARY "$DBUS_PWD/bus/dbus-daemon$EXEEXT"
+#define TEST_BUS_LAUNCH_BINARY "$DBUS_PWD/tools/dbus-launch$EXEEXT"
_ACEOF
-
## Export the non-setuid external helper
TEST_LAUNCH_HELPER_BINARY="$DBUS_PWD/bus/dbus-daemon-launch-helper-test$EXEEXT"
@@ -22516,15 +22689,73 @@ _ACEOF
-if test x$dbus_win = xyes; then
- DBUS_SESSION_BUS_DEFAULT_ADDRESS="$with_dbus_session_bus_default_address"
+# This must be a listening address. It doesn't necessarily need to be an
+# address you can connect to - it can be something vague like
+# "nonce-tcp:".
+#
+# The default varies by platform.
+
+# Check whether --with-dbus_session_bus_listen_address was given.
+if test "${with_dbus_session_bus_listen_address+set}" = set; then :
+ withval=$with_dbus_session_bus_listen_address; with_dbus_session_bus_listen_address=$withval
+else
+ with_dbus_session_bus_listen_address=
+fi
+
+
+if test "x$with_dbus_session_bus_listen_address" != "x"; then
+ # the user specified something, trust them
+ DBUS_SESSION_BUS_LISTEN_ADDRESS="$with_dbus_session_bus_listen_address"
+elif test x$dbus_win = xyes; then
+ # On Windows, you can (and should) listen on autolaunch addresses,
+ # because autolaunching is different.
+ # See https://bugs.freedesktop.org/show_bug.cgi?id=38201
+ DBUS_SESSION_BUS_LISTEN_ADDRESS="autolaunch:"
elif test x$have_launchd = xyes; then
- DBUS_SESSION_BUS_DEFAULT_ADDRESS="launchd:env=DBUS_LAUNCHD_SESSION_BUS_SOCKET"
+ # Mac OS X default is to use launchd
+ DBUS_SESSION_BUS_LISTEN_ADDRESS="launchd:env=DBUS_LAUNCHD_SESSION_BUS_SOCKET"
else
- DBUS_SESSION_BUS_DEFAULT_ADDRESS="unix:tmpdir=$DBUS_SESSION_SOCKET_DIR"
+ # The default on all other Unix platforms (notably Linux)
+ # is to create a randomly named socket in /tmp or similar
+ DBUS_SESSION_BUS_LISTEN_ADDRESS="unix:tmpdir=$DBUS_SESSION_SOCKET_DIR"
fi
+# This must be an address you can connect to. It doesn't necessarily
+# need to be an address you can listen on - it can be "autolaunch:",
+# even on Unix.
+#
+# The default varies by platform.
+
+# Check whether --with-dbus_session_bus_connect_address was given.
+if test "${with_dbus_session_bus_connect_address+set}" = set; then :
+ withval=$with_dbus_session_bus_connect_address; with_dbus_session_bus_connect_address=$withval
+else
+ with_dbus_session_bus_connect_address=
+fi
+
+
+if test "x$with_dbus_session_bus_connect_address" != "x"; then
+ # the user specified something, trust them
+ DBUS_SESSION_BUS_CONNECT_ADDRESS="$with_dbus_session_bus_connect_address"
+elif test x$dbus_win = xyes; then
+ # Windows autolaunching is a bit different; leaving it in its own
+ # branch of the conditional because the default might conceivably
+ # change (see #38201)
+ DBUS_SESSION_BUS_CONNECT_ADDRESS="autolaunch:"
+else
+ # The default on all other Unix platforms (notably Linux)
+ # is to use auto-launching - this works a bit differently on Mac OS X
+ # but comes out basically the same in the end
+ DBUS_SESSION_BUS_CONNECT_ADDRESS="autolaunch:"
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define DBUS_SESSION_BUS_CONNECT_ADDRESS "$DBUS_SESSION_BUS_CONNECT_ADDRESS"
+_ACEOF
+
+
# darwin needs this to initialize the environment
for ac_header in crt_externs.h
do :
@@ -22560,7 +22791,7 @@ $as_echo "#define DBUS_ENABLE_STATS 1" >>confdefs.h
fi
-ac_config_files="$ac_config_files Doxyfile dbus/versioninfo.rc dbus/dbus-arch-deps.h bus/system.conf bus/session.conf bus/messagebus bus/messagebus-config bus/org.freedesktop.dbus-session.plist bus/rc.messagebus bus/dbus.service bus/dbus.socket Makefile dbus/Makefile bus/Makefile tools/Makefile test/Makefile test/name-test/Makefile doc/Makefile doc/dbus-daemon.1 dbus-1.pc dbus-1-uninstalled.pc test/data/valid-config-files/debug-allow-all.conf test/data/valid-config-files/debug-allow-all-sha1.conf test/data/valid-config-files-system/debug-allow-all-pass.conf test/data/valid-config-files-system/debug-allow-all-fail.conf test/data/valid-service-files/org.freedesktop.DBus.TestSuite.PrivServer.service test/data/valid-service-files/org.freedesktop.DBus.TestSuiteEchoService.service test/data/valid-service-files/org.freedesktop.DBus.TestSuiteForkingEchoService.service test/data/valid-service-files/org.freedesktop.DBus.TestSuiteSegfaultService.service test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteEchoService.service test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteSegfaultService.service test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoExec.service test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoUser.service test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoService.service"
+ac_config_files="$ac_config_files Doxyfile dbus/versioninfo.rc dbus/dbus-arch-deps.h bus/system.conf bus/session.conf bus/messagebus bus/messagebus-config bus/org.freedesktop.dbus-session.plist bus/rc.messagebus bus/dbus.service bus/dbus.socket Makefile dbus/Makefile bus/Makefile tools/Makefile test/Makefile test/name-test/Makefile doc/Makefile doc/dbus-cleanup-sockets.1.xml doc/dbus-daemon.1.xml doc/dbus-launch.1.xml doc/dbus-monitor.1.xml doc/dbus-run-session.1.xml doc/dbus-send.1.xml doc/dbus-uuidgen.1.xml dbus-1.pc dbus-1-uninstalled.pc test/data/valid-config-files/debug-allow-all.conf test/data/valid-config-files/debug-allow-all-sha1.conf test/data/valid-config-files/incoming-limit.conf test/data/valid-config-files-system/debug-allow-all-pass.conf test/data/valid-config-files-system/debug-allow-all-fail.conf test/data/valid-service-files/org.freedesktop.DBus.TestSuite.PrivServer.service test/data/valid-service-files/org.freedesktop.DBus.TestSuiteEchoService.service test/data/valid-service-files/org.freedesktop.DBus.TestSuiteForkingEchoService.service test/data/valid-service-files/org.freedesktop.DBus.TestSuiteSegfaultService.service test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteEchoService.service test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteSegfaultService.service test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoExec.service test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoUser.service test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoService.service"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -22671,6 +22902,14 @@ LIBOBJS=$ac_libobjs
LTLIBOBJS=$ac_ltlibobjs
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+$as_echo_n "checking that generated files are newer than configure... " >&6; }
+ if test -n "$am_sleep_pid"; then
+ # Hide warnings about reused PIDs.
+ wait $am_sleep_pid 2>/dev/null
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
if test -n "$EXEEXT"; then
am__EXEEXT_TRUE=
am__EXEEXT_FALSE='#'
@@ -22711,14 +22950,14 @@ if test -z "${DBUS_CYGWIN_TRUE}" && test -z "${DBUS_CYGWIN_FALSE}"; then
as_fn_error $? "conditional \"DBUS_CYGWIN\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
-if test -z "${DBUS_BUILD_TESTS_TRUE}" && test -z "${DBUS_BUILD_TESTS_FALSE}"; then
- 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_WITH_DBUS_GLIB_TRUE}" && test -z "${DBUS_WITH_DBUS_GLIB_FALSE}"; then
+ as_fn_error $? "conditional \"DBUS_WITH_DBUS_GLIB\" 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
@@ -22732,14 +22971,6 @@ if test -z "${DBUS_ENABLE_INSTALLED_TESTS_TRUE}" && test -z "${DBUS_ENABLE_INSTA
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.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${DBUS_USE_LIBXML_TRUE}" && test -z "${DBUS_USE_LIBXML_FALSE}"; then
- as_fn_error $? "conditional \"DBUS_USE_LIBXML\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
if test -z "${HAVE_SELINUX_TRUE}" && test -z "${HAVE_SELINUX_FALSE}"; then
as_fn_error $? "conditional \"HAVE_SELINUX\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -22748,10 +22979,6 @@ if test -z "${DBUS_BUS_ENABLE_INOTIFY_TRUE}" && test -z "${DBUS_BUS_ENABLE_INOTI
as_fn_error $? "conditional \"DBUS_BUS_ENABLE_INOTIFY\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
-if test -z "${DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX_TRUE}" && test -z "${DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX_FALSE}"; then
- as_fn_error $? "conditional \"DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
if test -z "${HAVE_LINUX_EPOLL_TRUE}" && test -z "${HAVE_LINUX_EPOLL_FALSE}"; then
as_fn_error $? "conditional \"HAVE_LINUX_EPOLL\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -22784,10 +23011,6 @@ if test -z "${DBUS_XML_DOCS_ENABLED_TRUE}" && test -z "${DBUS_XML_DOCS_ENABLED_F
as_fn_error $? "conditional \"DBUS_XML_DOCS_ENABLED\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
-if test -z "${DBUS_HAVE_MAN2HTML_TRUE}" && test -z "${DBUS_HAVE_MAN2HTML_FALSE}"; then
- as_fn_error $? "conditional \"DBUS_HAVE_MAN2HTML\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
if test -z "${DBUS_CAN_UPLOAD_DOCS_TRUE}" && test -z "${DBUS_CAN_UPLOAD_DOCS_FALSE}"; then
as_fn_error $? "conditional \"DBUS_CAN_UPLOAD_DOCS\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -23205,7 +23428,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.6.10, which was
+This file was extended by dbus $as_me 1.8.16, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -23271,7 +23494,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.6.10
+dbus config.status 1.8.16
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
@@ -23882,11 +24105,18 @@ do
"test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;;
"test/name-test/Makefile") CONFIG_FILES="$CONFIG_FILES test/name-test/Makefile" ;;
"doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
- "doc/dbus-daemon.1") CONFIG_FILES="$CONFIG_FILES doc/dbus-daemon.1" ;;
+ "doc/dbus-cleanup-sockets.1.xml") CONFIG_FILES="$CONFIG_FILES doc/dbus-cleanup-sockets.1.xml" ;;
+ "doc/dbus-daemon.1.xml") CONFIG_FILES="$CONFIG_FILES doc/dbus-daemon.1.xml" ;;
+ "doc/dbus-launch.1.xml") CONFIG_FILES="$CONFIG_FILES doc/dbus-launch.1.xml" ;;
+ "doc/dbus-monitor.1.xml") CONFIG_FILES="$CONFIG_FILES doc/dbus-monitor.1.xml" ;;
+ "doc/dbus-run-session.1.xml") CONFIG_FILES="$CONFIG_FILES doc/dbus-run-session.1.xml" ;;
+ "doc/dbus-send.1.xml") CONFIG_FILES="$CONFIG_FILES doc/dbus-send.1.xml" ;;
+ "doc/dbus-uuidgen.1.xml") CONFIG_FILES="$CONFIG_FILES doc/dbus-uuidgen.1.xml" ;;
"dbus-1.pc") CONFIG_FILES="$CONFIG_FILES dbus-1.pc" ;;
"dbus-1-uninstalled.pc") CONFIG_FILES="$CONFIG_FILES dbus-1-uninstalled.pc" ;;
"test/data/valid-config-files/debug-allow-all.conf") CONFIG_FILES="$CONFIG_FILES test/data/valid-config-files/debug-allow-all.conf" ;;
"test/data/valid-config-files/debug-allow-all-sha1.conf") CONFIG_FILES="$CONFIG_FILES test/data/valid-config-files/debug-allow-all-sha1.conf" ;;
+ "test/data/valid-config-files/incoming-limit.conf") CONFIG_FILES="$CONFIG_FILES test/data/valid-config-files/incoming-limit.conf" ;;
"test/data/valid-config-files-system/debug-allow-all-pass.conf") CONFIG_FILES="$CONFIG_FILES test/data/valid-config-files-system/debug-allow-all-pass.conf" ;;
"test/data/valid-config-files-system/debug-allow-all-fail.conf") CONFIG_FILES="$CONFIG_FILES test/data/valid-config-files-system/debug-allow-all-fail.conf" ;;
"test/data/valid-service-files/org.freedesktop.DBus.TestSuite.PrivServer.service") CONFIG_FILES="$CONFIG_FILES test/data/valid-service-files/org.freedesktop.DBus.TestSuite.PrivServer.service" ;;
@@ -24498,7 +24728,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
case $ac_file$ac_mode in
"depfiles":C) test x"$AMDEP_TRUE" != x"" || {
- # Autoconf 2.62 quotes --file arguments for eval, but not when files
+ # Older Autoconf quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
case $CONFIG_FILES in
@@ -24511,7 +24741,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
+ # We used to match only the files named 'Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
@@ -24545,21 +24775,19 @@ $as_echo X"$mf" |
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
+ # from the Makefile without running 'make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
+ test -z "$am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`$as_dirname -- "$file" ||
@@ -25602,8 +25830,7 @@ echo "
32-bit int: ${DBUS_INT32_TYPE}
16-bit int: ${DBUS_INT16_TYPE}
Doxygen: ${DOXYGEN:-not found}
- xmlto: ${XMLTO:-not found}
- man2html: ${MAN2HTML:-not found}"
+ xmlto: ${XMLTO:-not found}"
echo "
Rebuilding generated files: ${USE_MAINTAINER_MODE}
@@ -25611,27 +25838,26 @@ echo "
Building embedded tests: ${enable_embedded_tests}
Building modular tests: ${enable_modular_tests}
- with GLib: ${with_glib}
+ - with dbus-glib: ${with_dbus_glib}
Building verbose mode: ${enable_verbose_mode}
Building assertions: ${enable_asserts}
Building checks: ${enable_checks}
Building bus stats API: ${enable_stats}
Building SELinux support: ${have_selinux}
Building inotify support: ${have_inotify}
- Building dnotify support: ${have_dnotify}
Building kqueue support: ${have_kqueue}
Building systemd support: ${have_systemd}
- Building X11 code: ${enable_x11}
+ Building X11 code: ${have_x11}
Building Doxygen docs: ${enable_doxygen_docs}
Building XML docs: ${enable_xml_docs}
- Building cache support: ${enable_userdb_cache}
Building launchd support: ${have_launchd}
- Using XML parser: ${with_xml}
Init scripts style: ${with_init_scripts}
Abstract socket names: ${ac_cv_have_abstract_sockets}
System bus socket: ${DBUS_SYSTEM_SOCKET}
System bus address: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS}
System bus PID file: ${DBUS_SYSTEM_PID_FILE}
- Session bus address: ${DBUS_SESSION_BUS_DEFAULT_ADDRESS}
+ Session bus listens on: ${DBUS_SESSION_BUS_LISTEN_ADDRESS}
+ Session clients connect to: ${DBUS_SESSION_BUS_CONNECT_ADDRESS}
Console auth dir: ${DBUS_CONSOLE_AUTH_DIR}
Console owner file: ${have_console_owner_file}
Console owner file path: ${DBUS_CONSOLE_OWNER_FILE}
@@ -25662,30 +25888,3 @@ fi
if test x$enable_checks = xno; then
echo "NOTE: building without checks for arguments passed to public API makes it harder to debug apps using D-Bus, but will slightly decrease D-Bus library size and _very_ slightly improve performance."
fi
-if test x$dbus_use_libxml = xtrue; then
- echo
- echo "WARNING: You have chosen to use libxml as your xml parser however this code path is not maintained by the D-Bus developers and if it breaks you get to keep the pieces. If you have selected this option in err please reconfigure with expat (e.g. --with-xml=expat)."
-fi
-
-if test "x$DBUS_HAVE_INT64" = x0; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You have disabled 64-bit integers via --without-64-bit.
-
- This removes parts of the standard D-Bus API and ABI (the 't' and 'x'
- typecodes, the dbus_int64_t and dbus_uint64_t types, etc.) and should only be
- used if your compiler lacks support for 64-bit integers. Please report a bug
- with details of your platform and compiler.
-
- This option is likely to be removed in future, unless the D-Bus developers
- receive reports that it is still needed.
- " >&5
-$as_echo "$as_me: WARNING: You have disabled 64-bit integers via --without-64-bit.
-
- This removes parts of the standard D-Bus API and ABI (the 't' and 'x'
- typecodes, the dbus_int64_t and dbus_uint64_t types, etc.) and should only be
- used if your compiler lacks support for 64-bit integers. Please report a bug
- with details of your platform and compiler.
-
- This option is likely to be removed in future, unless the D-Bus developers
- receive reports that it is still needed.
- " >&2;}
-fi
diff --git a/configure.ac b/configure.ac
index f860232e..0d0d5d5d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,8 +2,8 @@ dnl -*- mode: m4 -*-
AC_PREREQ([2.63])
m4_define([dbus_major_version], [1])
-m4_define([dbus_minor_version], [6])
-m4_define([dbus_micro_version], [10])
+m4_define([dbus_minor_version], [8])
+m4_define([dbus_micro_version], [16])
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])
@@ -33,16 +33,16 @@ AC_DEFINE_UNQUOTED(DBUS_DAEMON_NAME,"dbus-daemon",[Name of executable])
#
## increment if the interface has additions, changes, removals.
-LT_CURRENT=10
+LT_CURRENT=11
## increment any time the source changes; set to
## 0 if you increment CURRENT
-LT_REVISION=3
+LT_REVISION=11
## increment if any interfaces have been added; set to 0
## if any interfaces have been changed or removed. removal has
## precedence over adding, so set to 0 if both happened.
-LT_AGE=7
+LT_AGE=8
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
@@ -99,6 +99,9 @@ esac
# Special defines for certain platforms
if test "$dbus_win" = yes; then
AC_DEFINE(DBUS_WIN,1,[Defined if we run on a W32 API based system])
+ # Yes, on Windows it really does work like this.
+ # http://support.microsoft.com/kb/111855
+ AC_DEFINE(FD_SETSIZE,8192,[The maximum number of connections that can be handled at once])
BUILD_TIMESTAMP=`date --iso-8601=minutes`
AC_SUBST(BUILD_TIMESTAMP)
# Assume DBUS_VERSION is always three numbers
@@ -150,15 +153,12 @@ AC_ARG_ENABLE(doxygen-docs, AS_HELP_STRING([--enable-doxygen-docs],[build DOXYGE
AC_ARG_ENABLE(abstract-sockets, AS_HELP_STRING([--enable-abstract-sockets],[use abstract socket namespace (linux only)]),enable_abstract_sockets=$enableval,enable_abstract_sockets=auto)
AC_ARG_ENABLE(selinux, AS_HELP_STRING([--enable-selinux],[build with SELinux support]),enable_selinux=$enableval,enable_selinux=auto)
AC_ARG_ENABLE(libaudit,AS_HELP_STRING([--enable-libaudit],[build audit daemon support for SELinux]),enable_libaudit=$enableval,enable_libaudit=auto)
-AC_ARG_ENABLE(dnotify, AS_HELP_STRING([--enable-dnotify],[build with dnotify support (linux only)]),enable_dnotify=$enableval,enable_dnotify=auto)
AC_ARG_ENABLE(inotify, AS_HELP_STRING([--enable-inotify],[build with inotify support (linux only)]),enable_inotify=$enableval,enable_inotify=auto)
AC_ARG_ENABLE(kqueue, AS_HELP_STRING([--enable-kqueue],[build with kqueue support]),enable_kqueue=$enableval,enable_kqueue=auto)
AC_ARG_ENABLE(console-owner-file, AS_HELP_STRING([--enable-console-owner-file],[enable console owner file]),enable_console_owner_file=$enableval,enable_console_owner_file=auto)
-AC_ARG_ENABLE(userdb-cache, AS_HELP_STRING([--enable-userdb-cache],[build with userdb-cache support]),enable_userdb_cache=$enableval,enable_userdb_cache=yes)
AC_ARG_ENABLE(launchd, AS_HELP_STRING([--enable-launchd],[build with launchd auto-launch support]),enable_launchd=$enableval,enable_launchd=auto)
AC_ARG_ENABLE(systemd, AS_HELP_STRING([--enable-systemd],[build with systemd at_console support]),enable_systemd=$enableval,enable_systemd=auto)
-AC_ARG_WITH(xml, AS_HELP_STRING([--with-xml=[libxml/expat]],[XML library to use (libxml may be named libxml2 on some systems)]))
AC_ARG_WITH(init-scripts, AS_HELP_STRING([--with-init-scripts=[redhat]],[Style of init scripts to install]))
AC_ARG_WITH(session-socket-dir, AS_HELP_STRING([--with-session-socket-dir=[dirname]],[Where to put sockets for the per-login-session message bus]))
AC_ARG_WITH(test-socket-dir, AS_HELP_STRING([--with-test-socket-dir=[dirname]],[Where to put sockets for make check]))
@@ -169,7 +169,6 @@ AC_ARG_WITH(console-owner-file, AS_HELP_STRING([--with-console-owner-file=[filen
AC_ARG_WITH(launchd-agent-dir, AS_HELP_STRING([--with-launchd-agent-dir=[dirname]],[directory to put the launchd agent (default: /Library/LaunchAgents)]))
AC_ARG_WITH(dbus_user, AS_HELP_STRING([--with-dbus-user=<user>],[User for running the DBUS daemon (messagebus)]))
AC_ARG_WITH(dbus_daemondir, AS_HELP_STRING([--with-dbus-daemondir=[dirname]],[Directory for installing the DBUS daemon]))
-AC_ARG_WITH(dbus_session_bus_default_address, AS_HELP_STRING([--with-dbus-session-bus-default-address=[nonce-tcp:/autolaunch:/tcp:host:port]],[Transport Type to be used (default: nonce-tcp:)]),with_dbus_session_bus_default_address=$withval,with_dbus_session_bus_default_address=nonce-tcp:)
AC_ARG_ENABLE([embedded-tests],
AS_HELP_STRING([--enable-embedded-tests],
@@ -195,16 +194,12 @@ AC_ARG_ENABLE([tests],
[])
# 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])
+# and also some stuff in the test/ subdir.
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.
@@ -217,7 +212,8 @@ AC_DEFINE([GLIB_VERSION_MAX_ALLOWED], [GLIB_VERSION_2_32], [Prevent post-2.32 AP
with_glib=yes
-if test "x$enable_modular_tests" != xno; then
+AS_IF([test "x$enable_modular_tests" != xno],
+ [
PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.24, gio-2.0 >= 2.24],
[],
[if test "x$enable_modular_tests" = xyes; then
@@ -226,16 +222,25 @@ if test "x$enable_modular_tests" != xno; then
else # assumed to be "auto"
with_glib=no
fi])
- # If dbus-gmain.[ch] returned to libdbus then we wouldn't need this
- PKG_CHECK_MODULES([DBUS_GLIB], [dbus-glib-1],
+ ],
+ [with_glib=no])
+
+# Not required, because we can use internal APIs (but that makes the
+# "installable tests" less useful as integration tests)
+AC_ARG_WITH([dbus_glib],
+ [AS_HELP_STRING([--with-dbus-glib], [Use dbus-glib for regression tests])],
+ [],
+ [with_dbus_glib=auto])
+AS_IF([test "x$with_dbus_glib" != xno],
+ [PKG_CHECK_MODULES([DBUS_GLIB], [dbus-glib-1],
[],
- [if test "x$enable_modular_tests" = xyes; then
- AC_MSG_NOTICE([Full test coverage (--enable-modular-tests=yes or --enable-tests=yes) requires dbus-glib])
- AC_MSG_ERROR([$DBUS_GLIB_ERRORS])
- else # assumed to be "auto"
- with_glib=no
- fi])
-fi
+ [AS_IF([test "x$with_dbus_glib" = xyes],
+ dnl specifically requested, but not found
+ [AC_MSG_ERROR([$DBUS_GLIB_ERRORS])],
+ dnl else: assumed to be "auto"
+ [with_dbus_glib=no])])])
+AM_CONDITIONAL([DBUS_WITH_DBUS_GLIB], [test "x$with_dbus_glib" != xno])
+
if test "x$enable_modular_tests" != xno; then
AC_DEFINE([DBUS_ENABLE_MODULAR_TESTS], [1],
[Define to build independent test binaries])
@@ -280,6 +285,11 @@ if test x$enable_asserts = xno; then
AC_DEFINE(DBUS_DISABLE_ASSERT,1,[Disable assertion checking])
DISABLE_UNUSED_WARNINGS="unused-label"
R_DYNAMIC_LDFLAG=""
+ if test x$enable_embedded_tests = xyes; then
+ DISABLE_UNUSED_WARNINGS="$DISABLE_UNUSED_WARNINGS \
+ unused-but-set-variable unused-variable \
+ unused-function"
+ fi
else
# -rdynamic is needed for glibc's backtrace_symbols to work.
# No clue how much overhead this adds, but it's useful
@@ -299,9 +309,14 @@ if test x$enable_checks = xno; then
DISABLE_UNUSED_WARNINGS="unused-label"
fi
-if test x$enable_userdb_cache = xyes; then
- AC_DEFINE(DBUS_ENABLE_USERDB_CACHE,1,[Build with caching of user data])
-fi
+AH_BOTTOM([
+/* explicitly define these macros to get less confusing conditions */
+#ifndef DBUS_DISABLE_ASSERT
+# define DBUS_ENABLE_ASSERT 1
+#endif
+#ifndef DBUS_DISABLE_CHECKS
+# define DBUS_ENABLE_CHECKS 1
+#endif])
if test x$enable_compiler_coverage = xyes; then
## so that config.h changes when you toggle gcov support
@@ -343,12 +358,6 @@ AC_CHECK_SIZEOF(void *)
AC_CHECK_SIZEOF(long long)
AC_CHECK_SIZEOF(__int64)
-AC_ARG_WITH([64-bit],
- [AS_HELP_STRING([--without-64-bit],
- [If you have to use this option, please report it as a bug])],
- [],
- [with_64_bit=yes])
-
### See what our 64 bit type is called
AC_MSG_CHECKING([64-bit integer type])
@@ -387,33 +396,17 @@ $ac_cv_sizeof___int64)
esac
AS_IF(
- [test "x$with_64_bit" = xno],
- [
- DBUS_INT64_TYPE="no_int64_type_detected"
- DBUS_HAVE_INT64=0
- DBUS_INT64_CONSTANT=
- DBUS_UINT64_CONSTANT=
- AC_MSG_RESULT([disabled via --without-64-bit])
- ],
- dnl else if
[test -z "$dbusint64"],
[AC_MSG_RESULT([not found])
AC_MSG_ERROR([Could not find a 64-bit integer type.
Please report a bug here with details of your platform and compiler:
- http://bugs.freedesktop.org/enter_bug.cgi?product=DBus&component=core
-
-To compile D-Bus with all 64-bit integer types removed (not recommended), use
-the option "--without-64-bit".
-
-This option is likely to be removed in future, unless you report that your
-platform needs it.])
+ http://bugs.freedesktop.org/enter_bug.cgi?product=DBus&component=core])
],
dnl else
[
DBUS_INT64_TYPE="$dbusint64"
- DBUS_HAVE_INT64=1
DBUS_INT64_CONSTANT="$dbusint64_constant"
DBUS_UINT64_CONSTANT="$dbusuint64_constant"
if test x"$dbusint64_printf_modifier" != x; then
@@ -425,7 +418,6 @@ platform needs it.])
AC_SUBST(DBUS_INT64_TYPE)
AC_SUBST(DBUS_INT64_CONSTANT)
AC_SUBST(DBUS_UINT64_CONSTANT)
-AC_SUBST(DBUS_HAVE_INT64)
### see what 32-bit int is called
AC_MSG_CHECKING([32-bit integer type])
@@ -606,6 +598,10 @@ if test "x$ac_cv_header_syslog_h" = "xyes"; then
AC_CHECK_DECLS([LOG_PERROR], [], [], [[#include <syslog.h>]])
fi
+# For test-segfault.c
+AC_CHECK_HEADERS_ONCE([sys/prctl.h])
+AC_CHECK_FUNCS_ONCE([prctl raise])
+
#### Check for broken poll; taken from Glib's configure
AC_MSG_CHECKING([for broken poll])
@@ -687,8 +683,6 @@ AC_CHECK_HEADERS(unistd.h)
AC_CHECK_HEADERS(ws2tcpip.h)
-AC_CHECK_HEADERS(wspiapi.h)
-
AC_CHECK_HEADERS(alloca.h)
# Add -D_POSIX_PTHREAD_SEMANTICS if on Solaris
@@ -907,66 +901,66 @@ fi
# unix:path=/foo or unix:abstract=/foo
AC_SUBST(DBUS_PATH_OR_ABSTRACT)
-PKG_PROG_PKG_CONFIG
-
#### Sort out XML library
-# see what we have
AC_CHECK_LIB(expat, XML_ParserCreate_MM,
- [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ],
- have_expat=false)
-
-# see what we want to use
-dbus_use_libxml=false
-dbus_use_expat=false
-if test x$with_xml = xexpat; then
- if ! $have_expat ; then
- AC_MSG_ERROR([Explicitly requested expat but expat not found])
- fi
- dbus_use_expat=true
-elif test x$with_xml = xlibxml; then
- PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.6.0, have_libxml=true, have_libxml=false)
- if ! $have_libxml ; then
- AC_MSG_ERROR([Explicitly requested libxml but libxml not found])
- fi
- dbus_use_libxml=true
-else
- ### expat is the default because libxml can't currently survive
- ### our brutal OOM-handling unit test setup.
- ### http://bugzilla.gnome.org/show_bug.cgi?id=109368
- if test x$have_expat = xfalse; then
- AC_MSG_ERROR([Could not find expat.h, check config.log for failed attempts])
- fi
- ### By default, only use Expat since it's tested and known to work. If you're a
- ### general-purpose OS vendor, please don't enable libxml. For embedded use
- ### if your OS is built around libxml, that's another case.
- dbus_use_expat=true
-fi
+ [ AC_CHECK_HEADERS(expat.h, [],
+ [AC_MSG_ERROR([Could not find expat.h, check config.log for failed attempts])]) ],
+ [ AC_MSG_ERROR([Explicitly requested expat but expat not found]) ])
-AM_CONDITIONAL(DBUS_USE_EXPAT, $dbus_use_expat)
-AM_CONDITIONAL(DBUS_USE_LIBXML, $dbus_use_libxml)
-
-if $dbus_use_expat; then
- XML_LIBS=-lexpat
- XML_CFLAGS=
-fi
-if $dbus_use_libxml; then
- XML_LIBS=$LIBXML_LIBS
- XML_CFLAGS=$LIBXML_CFLAGS
-fi
+XML_LIBS=-lexpat
+XML_CFLAGS=
AC_SUBST([XML_CFLAGS])
AC_SUBST([XML_LIBS])
# Thread lib detection
-AC_CHECK_FUNC(pthread_cond_timedwait,[AC_CHECK_LIB(pthread,pthread_cond_timedwait,
- [THREAD_LIBS="-lpthread"])])
+AC_ARG_VAR([THREAD_LIBS])
save_libs="$LIBS"
LIBS="$LIBS $THREAD_LIBS"
-AC_CHECK_FUNC(pthread_condattr_setclock,have_pthread_condattr_setclock=true,have_pthread_condattr_setclock=false)
-if test x$have_pthread_condattr_setclock = xtrue; then
- AC_SEARCH_LIBS([clock_getres],[rt],[THREAD_LIBS="$THREAD_LIBS -lrt"])
- AC_MSG_CHECKING([for CLOCK_MONOTONIC])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>
+
+is_missing_pthread_function="is required when compiling D-Bus on Unix platforms, but is not in your libc or libpthread. Please open a bug on https://bugs.freedesktop.org/enter_bug.cgi?product=dbus with details of your platform."
+
+# Don't do these automatic checks if the user set THREAD_LIBS on the
+# configure command-line. If they did, we assume they're right.
+#
+# We also don't do these checks on Windows, because you don't need magical
+# linker flags to have threading support there.
+AS_IF([test "x$dbus_unix" = xyes && test "x$THREAD_LIBS" = x],
+ [
+ # Mandatory pthread functions. In principle, some of these could be made
+ # optional if there are platforms that don't have them.
+ #
+ # Currently, we only look in -lpthread.
+ # In principle we might need to look in -lpthreads, -lthreads, ...
+ # as well - please file a bug if your platform needs this.
+ AC_SEARCH_LIBS([pthread_cond_timedwait],
+ [pthread],
+ [THREAD_LIBS="$LIBS"],
+ [AC_MSG_ERROR([pthread_cond_timedwait $is_missing_pthread_function])],
+ [])
+ AC_SEARCH_LIBS([pthread_mutexattr_init],
+ [pthread],
+ [THREAD_LIBS="$LIBS"],
+ [AC_MSG_ERROR([pthread_mutexattr_init $is_missing_pthread_function])],
+ [])
+ AC_SEARCH_LIBS([pthread_mutexattr_settype],
+ [pthread],
+ [THREAD_LIBS="$LIBS"],
+ [AC_MSG_ERROR([pthread_mutexattr_settype $is_missing_pthread_function])],
+ [])
+
+ # Optional, for monotonic clocks. Because it's optional, this check
+ # is non-fatal if we don't find it.
+ AC_SEARCH_LIBS([pthread_condattr_setclock],
+ [pthread],
+ [THREAD_LIBS="$LIBS"])
+
+ AS_IF([test "x$ac_cv_search_pthread_condattr_setclock" != xno],
+ [
+ AC_SEARCH_LIBS([clock_getres], [rt], [THREAD_LIBS="$LIBS"])
+ AC_MSG_CHECKING([for CLOCK_MONOTONIC])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[#include <time.h>
#include <pthread.h>
]], [[
struct timespec monotonic_timer;
@@ -975,15 +969,17 @@ pthread_condattr_init (&attr);
pthread_condattr_setclock (&attr, CLOCK_MONOTONIC);
clock_getres (CLOCK_MONOTONIC,&monotonic_timer);
]])],
-[have_clock_monotonic=true],
-[have_clock_monotonic=false])
-if test x$have_clock_monotonic = xtrue; then
- AC_MSG_RESULT([found])
- AC_DEFINE(HAVE_MONOTONIC_CLOCK, 1, [Define if we have CLOCK_MONOTONIC])
-else
- AC_MSG_RESULT([not found])
-fi
-fi
+ [have_clock_monotonic=true],
+ [have_clock_monotonic=false])
+ AS_IF([test x$have_clock_monotonic = xtrue],
+ [
+ AC_MSG_RESULT([found])
+ AC_DEFINE(HAVE_MONOTONIC_CLOCK, 1, [Define if we have CLOCK_MONOTONIC])
+ ],
+ [AC_MSG_RESULT([not found])])
+ ]) dnl have pthread_condattr_setclock
+ ]) dnl on Unix
+
LIBS="$save_libs"
AC_SUBST([THREAD_LIBS])
@@ -1049,24 +1045,6 @@ fi
AM_CONDITIONAL(DBUS_BUS_ENABLE_INOTIFY, test x$have_inotify = xyes)
-# dnotify checks
-if test x$enable_dnotify = xno ; then
- have_dnotify=no;
-else
- if test x$have_inotify = xno -a x$host_os = xlinux-gnu -o x$host_os = xlinux; then
- have_dnotify=yes;
- else
- have_dnotify=no;
- fi
-fi
-
-dnl check if dnotify backend is enabled
-if test x$have_dnotify = xyes; then
- AC_DEFINE(DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX,1,[Use dnotify on Linux])
-fi
-
-AM_CONDITIONAL(DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX, test x$have_dnotify = xyes)
-
# For simplicity, we require the userland API for epoll_create1 at
# compile-time (glibc 2.9), but we'll run on kernels that turn out
# not to have it at runtime.
@@ -1169,10 +1147,13 @@ dnl systemd detection
if test x$enable_systemd = xno ; then
have_systemd=no;
else
- PKG_CHECK_MODULES(SYSTEMD,
- [libsystemd-login >= 32, libsystemd-daemon >= 32],
- have_systemd=yes,
- have_systemd=no)
+ PKG_CHECK_MODULES([SYSTEMD],
+ [libsystemd >= 209],
+ [have_systemd=yes],
+ [PKG_CHECK_MODULES([SYSTEMD],
+ [libsystemd-login >= 32, libsystemd-daemon >= 32, libsystemd-journal >= 32],
+ [have_systemd=yes],
+ [have_systemd=no])])
fi
if test x$have_systemd = xyes; then
@@ -1240,7 +1221,7 @@ if test x$dbus_win = xyes ; then
if test x$dbus_wince = xyes ; then
NETWORK_libs="-lws2"
else
- NETWORK_libs="-lws2_32"
+ NETWORK_libs="-lws2_32 -liphlpapi"
fi
fi
@@ -1252,6 +1233,10 @@ AC_ARG_WITH([valgrind],
[],
[with_valgrind=no])
+AS_IF([test "x$with_valgrind" = xauto],
+ [PKG_CHECK_EXISTS([valgrind >= 3.6],
+ [with_valgrind=yes], [with_valgrind=no])])
+
if test x$with_valgrind != xno; then
PKG_CHECK_MODULES([VALGRIND], [valgrind >= 3.6])
AC_DEFINE([WITH_VALGRIND], [1], [Define to add Valgrind instrumentation])
@@ -1454,13 +1439,8 @@ fi
AM_CONDITIONAL(DBUS_XML_DOCS_ENABLED, test x$enable_xml_docs = xyes)
AC_MSG_RESULT($enable_xml_docs)
-AC_PATH_PROG([MAN2HTML], [man2html])
-AC_ARG_VAR([MAN2HTML], [Path to man2html (optional)])
-AM_CONDITIONAL(DBUS_HAVE_MAN2HTML, test x$MAN2HTML != x)
-
AM_CONDITIONAL(DBUS_CAN_UPLOAD_DOCS,
- test x$enable_doxygen_docs = xyes -a x$enable_xml_docs = xyes -a \
- x$MAN2HTML != x)
+ [test x$enable_doxygen_docs = xyes && test x$enable_xml_docs = xyes])
#### Have to go $localstatedir->$prefix/var->/usr/local/var
@@ -1516,7 +1496,7 @@ AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service
if test "x$with_systemdsystemunitdir" != xno; then
AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
fi
-AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
+AM_CONDITIONAL(HAVE_SYSTEMD, [test "x$have_systemd" != "xno" -a -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
##### Set up location for system bus socket
if ! test -z "$with_system_socket"; then
@@ -1528,8 +1508,17 @@ fi
AC_SUBST(DBUS_SYSTEM_SOCKET)
AC_DEFINE_UNQUOTED(DBUS_SYSTEM_SOCKET,"$DBUS_SYSTEM_SOCKET",[The name of the socket the system bus listens on by default])
-## system bus only listens on local domain sockets, and never
-## on an abstract socket (so only root can create the socket)
+## System bus only listens on local domain sockets, and never
+## on an abstract socket (so only root can create the socket).
+##
+## This won't work on Windows. It's not meant to - the system bus is
+## meaningless on Windows anyway.
+##
+## This has to be suitable for hard-coding in client libraries as well as
+## in the dbus-daemon's configuration, so it has to be valid to listen on
+## and also to connect to. If this ever changes, it'll need to be split into
+## two variables, one for the listening address and one for the connecting
+## address.
DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=$DBUS_SYSTEM_SOCKET"
AC_SUBST(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS)
AC_DEFINE_UNQUOTED(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS, "$DBUS_SYSTEM_BUS_DEFAULT_ADDRESS",[The default D-Bus address of the system bus])
@@ -1625,9 +1614,8 @@ AC_DEFINE_UNQUOTED([DBUS_TEST_EXEC], ["$DBUS_TEST_EXEC"],
AC_DEFINE_UNQUOTED([DBUS_EXEEXT], ["$EXEEXT"],
[Extension for executables, typically empty or .exe])
-AC_DEFINE_UNQUOTED(TEST_BUS_BINARY, ["$DBUS_PWD/bus/dbus-daemon$EXEEXT"],
- [Full path to the daemon in the builddir])
-AC_SUBST(TEST_BUS_BINARY)
+AC_DEFINE_UNQUOTED(TEST_BUS_LAUNCH_BINARY, ["$DBUS_PWD/tools/dbus-launch$EXEEXT"],
+ [Full path to the dbus-launch in the builddir])
## Export the non-setuid external helper
TEST_LAUNCH_HELPER_BINARY="$DBUS_PWD/bus/dbus-daemon-launch-helper-test$EXEEXT"
@@ -1673,14 +1661,64 @@ fi
AC_DEFINE_UNQUOTED(DBUS_SESSION_SOCKET_DIR, "$DBUS_SESSION_SOCKET_DIR", [Where per-session bus puts its sockets])
AC_SUBST(DBUS_SESSION_SOCKET_DIR)
-if test x$dbus_win = xyes; then
- DBUS_SESSION_BUS_DEFAULT_ADDRESS="$with_dbus_session_bus_default_address"
+# This must be a listening address. It doesn't necessarily need to be an
+# address you can connect to - it can be something vague like
+# "nonce-tcp:".
+#
+# The default varies by platform.
+AC_ARG_WITH([dbus_session_bus_listen_address],
+ AS_HELP_STRING([--with-dbus-session-bus-listen-address=[ADDRESS]],
+ [default address for a session bus to listen on (see configure.ac)]),
+ [with_dbus_session_bus_listen_address=$withval],
+ [with_dbus_session_bus_listen_address=])
+
+if test "x$with_dbus_session_bus_listen_address" != "x"; then
+ # the user specified something, trust them
+ DBUS_SESSION_BUS_LISTEN_ADDRESS="$with_dbus_session_bus_listen_address"
+elif test x$dbus_win = xyes; then
+ # On Windows, you can (and should) listen on autolaunch addresses,
+ # because autolaunching is different.
+ # See https://bugs.freedesktop.org/show_bug.cgi?id=38201
+ DBUS_SESSION_BUS_LISTEN_ADDRESS="autolaunch:"
elif test x$have_launchd = xyes; then
- DBUS_SESSION_BUS_DEFAULT_ADDRESS="launchd:env=DBUS_LAUNCHD_SESSION_BUS_SOCKET"
+ # Mac OS X default is to use launchd
+ DBUS_SESSION_BUS_LISTEN_ADDRESS="launchd:env=DBUS_LAUNCHD_SESSION_BUS_SOCKET"
else
- DBUS_SESSION_BUS_DEFAULT_ADDRESS="unix:tmpdir=$DBUS_SESSION_SOCKET_DIR"
+ # The default on all other Unix platforms (notably Linux)
+ # is to create a randomly named socket in /tmp or similar
+ DBUS_SESSION_BUS_LISTEN_ADDRESS="unix:tmpdir=$DBUS_SESSION_SOCKET_DIR"
fi
-AC_SUBST(DBUS_SESSION_BUS_DEFAULT_ADDRESS)
+AC_SUBST([DBUS_SESSION_BUS_LISTEN_ADDRESS])
+
+# This must be an address you can connect to. It doesn't necessarily
+# need to be an address you can listen on - it can be "autolaunch:",
+# even on Unix.
+#
+# The default varies by platform.
+AC_ARG_WITH([dbus_session_bus_connect_address],
+ AS_HELP_STRING([--with-dbus-session-bus-connect-address=[ADDRESS]],
+ [fallback address for a session bus client to connect to (see configure.ac)]),
+ [with_dbus_session_bus_connect_address=$withval],
+ [with_dbus_session_bus_connect_address=])
+
+if test "x$with_dbus_session_bus_connect_address" != "x"; then
+ # the user specified something, trust them
+ DBUS_SESSION_BUS_CONNECT_ADDRESS="$with_dbus_session_bus_connect_address"
+elif test x$dbus_win = xyes; then
+ # Windows autolaunching is a bit different; leaving it in its own
+ # branch of the conditional because the default might conceivably
+ # change (see #38201)
+ DBUS_SESSION_BUS_CONNECT_ADDRESS="autolaunch:"
+else
+ # The default on all other Unix platforms (notably Linux)
+ # is to use auto-launching - this works a bit differently on Mac OS X
+ # but comes out basically the same in the end
+ DBUS_SESSION_BUS_CONNECT_ADDRESS="autolaunch:"
+fi
+AC_SUBST([DBUS_SESSION_BUS_CONNECT_ADDRESS])
+AC_DEFINE_UNQUOTED([DBUS_SESSION_BUS_CONNECT_ADDRESS],
+ ["$DBUS_SESSION_BUS_CONNECT_ADDRESS"],
+ [Fallback address for session bus clients])
# darwin needs this to initialize the environment
AC_CHECK_HEADERS(crt_externs.h)
@@ -1722,11 +1760,18 @@ tools/Makefile
test/Makefile
test/name-test/Makefile
doc/Makefile
-doc/dbus-daemon.1
+doc/dbus-cleanup-sockets.1.xml
+doc/dbus-daemon.1.xml
+doc/dbus-launch.1.xml
+doc/dbus-monitor.1.xml
+doc/dbus-run-session.1.xml
+doc/dbus-send.1.xml
+doc/dbus-uuidgen.1.xml
dbus-1.pc
dbus-1-uninstalled.pc
test/data/valid-config-files/debug-allow-all.conf
test/data/valid-config-files/debug-allow-all-sha1.conf
+test/data/valid-config-files/incoming-limit.conf
test/data/valid-config-files-system/debug-allow-all-pass.conf
test/data/valid-config-files-system/debug-allow-all-fail.conf
test/data/valid-service-files/org.freedesktop.DBus.TestSuite.PrivServer.service
@@ -1767,8 +1812,7 @@ echo "
32-bit int: ${DBUS_INT32_TYPE}
16-bit int: ${DBUS_INT16_TYPE}
Doxygen: ${DOXYGEN:-not found}
- xmlto: ${XMLTO:-not found}
- man2html: ${MAN2HTML:-not found}"
+ xmlto: ${XMLTO:-not found}"
echo "
Rebuilding generated files: ${USE_MAINTAINER_MODE}
@@ -1776,27 +1820,26 @@ echo "
Building embedded tests: ${enable_embedded_tests}
Building modular tests: ${enable_modular_tests}
- with GLib: ${with_glib}
+ - with dbus-glib: ${with_dbus_glib}
Building verbose mode: ${enable_verbose_mode}
Building assertions: ${enable_asserts}
Building checks: ${enable_checks}
Building bus stats API: ${enable_stats}
Building SELinux support: ${have_selinux}
Building inotify support: ${have_inotify}
- Building dnotify support: ${have_dnotify}
Building kqueue support: ${have_kqueue}
Building systemd support: ${have_systemd}
- Building X11 code: ${enable_x11}
+ Building X11 code: ${have_x11}
Building Doxygen docs: ${enable_doxygen_docs}
Building XML docs: ${enable_xml_docs}
- Building cache support: ${enable_userdb_cache}
Building launchd support: ${have_launchd}
- Using XML parser: ${with_xml}
Init scripts style: ${with_init_scripts}
Abstract socket names: ${ac_cv_have_abstract_sockets}
System bus socket: ${DBUS_SYSTEM_SOCKET}
System bus address: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS}
System bus PID file: ${DBUS_SYSTEM_PID_FILE}
- Session bus address: ${DBUS_SESSION_BUS_DEFAULT_ADDRESS}
+ Session bus listens on: ${DBUS_SESSION_BUS_LISTEN_ADDRESS}
+ Session clients connect to: ${DBUS_SESSION_BUS_CONNECT_ADDRESS}
Console auth dir: ${DBUS_CONSOLE_AUTH_DIR}
Console owner file: ${have_console_owner_file}
Console owner file path: ${DBUS_CONSOLE_OWNER_FILE}
@@ -1827,20 +1870,3 @@ fi
if test x$enable_checks = xno; then
echo "NOTE: building without checks for arguments passed to public API makes it harder to debug apps using D-Bus, but will slightly decrease D-Bus library size and _very_ slightly improve performance."
fi
-if test x$dbus_use_libxml = xtrue; then
- echo
- echo "WARNING: You have chosen to use libxml as your xml parser however this code path is not maintained by the D-Bus developers and if it breaks you get to keep the pieces. If you have selected this option in err please reconfigure with expat (e.g. --with-xml=expat)."
-fi
-
-if test "x$DBUS_HAVE_INT64" = x0; then
- AC_MSG_WARN([You have disabled 64-bit integers via --without-64-bit.
-
- This removes parts of the standard D-Bus API and ABI (the 't' and 'x'
- typecodes, the dbus_int64_t and dbus_uint64_t types, etc.) and should only be
- used if your compiler lacks support for 64-bit integers. Please report a bug
- with details of your platform and compiler.
-
- This option is likely to be removed in future, unless the D-Bus developers
- receive reports that it is still needed.
- ])
-fi
diff --git a/dbus/Makefile.am b/dbus/Makefile.am
index bb5cccaf..b2481073 100644
--- a/dbus/Makefile.am
+++ b/dbus/Makefile.am
@@ -12,6 +12,10 @@ AM_CPPFLAGS = \
-DDBUS_SESSION_CONFIG_FILE=\""$(configdir)/session.conf"\" \
$(NULL)
+# On Linux with glibc 2.17, sd-daemon.c support for POSIX message queues
+# results in an otherwise unnecessary dependency on librt. Disable it.
+AM_CPPFLAGS += -DSD_DAEMON_DISABLE_MQ
+
# if assertions are enabled, improve backtraces
AM_LDFLAGS = @R_DYNAMIC_LDFLAG@
@@ -35,7 +39,7 @@ dbus_res_ldflag = -Wl,$(dbus_res)
no_undefined = -no-undefined
export_symbols =
-libdbus_1_la_DEPENDENCIES = $(dbus_res)
+EXTRA_libdbus_1_la_DEPENDENCIES = $(dbus_res)
intllibs =
else
@@ -233,6 +237,8 @@ DBUS_SHARED_SOURCES= \
### should be underscore-prefixed but don't really need
### to be unless they move to DBUS_SHARED_SOURCES later)
DBUS_UTIL_SOURCES= \
+ dbus-asv-util.c \
+ dbus-asv-util.h \
dbus-auth-script.c \
dbus-auth-script.h \
dbus-auth-util.c \
@@ -291,22 +297,33 @@ libdbus_internal_la_CPPFLAGS = \
$(NULL)
libdbus_internal_la_LIBADD=$(LIBDBUS_LIBS) $(SYSTEMD_LIBS)
+if DBUS_WIN
+# This must be a separate convenience library, otherwise libtool notices
+# that libdbus-1 might contain C++, links it with g++ and links in libstdc++,
+# even on Unix where in fact it doesn't contain any C++. For Windows, where
+# this code is used, we don't actually need libstdc++.
+noinst_LTLIBRARIES += libdbus-init-win.la
+libdbus_init_win_la_SOURCES = dbus-init-win.cpp
+libdbus_1_la_LIBADD += libdbus-init-win.la
+libdbus_internal_la_LIBADD += libdbus-init-win.la
+endif
+
noinst_PROGRAMS =
-if DBUS_BUILD_TESTS
+if DBUS_ENABLE_EMBEDDED_TESTS
# We can't actually run this til we've reached test/
-noinst_PROGRAMS += dbus-test
+noinst_PROGRAMS += test-dbus
endif
-dbus_test_SOURCES= \
+test_dbus_SOURCES= \
dbus-test-main.c
-dbus_test_LDADD = libdbus-internal.la
+test_dbus_LDADD = libdbus-internal.la
## mop up the gcov files
clean-local:
/bin/rm *.bb *.bbg *.da *.gcov .libs/*.da .libs/*.bbg || true
update-systemd:
- curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.c > sd-daemon.c
- curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.h > sd-daemon.h
+ curl http://cgit.freedesktop.org/systemd/systemd/plain/src/libsystemd-daemon/sd-daemon.c > $(srcdir)/sd-daemon.c
+ curl http://cgit.freedesktop.org/systemd/systemd/plain/src/systemd/sd-daemon.h > $(srcdir)/sd-daemon.h
diff --git a/dbus/Makefile.in b/dbus/Makefile.in
index d8448a3f..43e3c7d0 100644
--- a/dbus/Makefile.in
+++ b/dbus/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.6 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -18,23 +17,51 @@
VPATH = @srcdir@
-am__make_dryrun = \
- { \
- am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
- *) \
- for am__flg in $$MAKEFLAGS; do \
- case $$am__flg in \
- *=*|--*) ;; \
- *n*) am__dry=yes; break;; \
- esac; \
- done;; \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
- test $$am__dry = yes; \
- }
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -53,16 +80,23 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-@DBUS_WIN_FALSE@libdbus_1_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
@HAVE_LINUX_EPOLL_TRUE@am__append_1 = dbus-socket-set-epoll.c
+
+# This must be a separate convenience library, otherwise libtool notices
+# that libdbus-1 might contain C++, links it with g++ and links in libstdc++,
+# even on Unix where in fact it doesn't contain any C++. For Windows, where
+# this code is used, we don't actually need libstdc++.
+@DBUS_WIN_TRUE@am__append_2 = libdbus-init-win.la
+@DBUS_WIN_TRUE@am__append_3 = libdbus-init-win.la
+@DBUS_WIN_TRUE@am__append_4 = libdbus-init-win.la
noinst_PROGRAMS = $(am__EXEEXT_1)
# We can't actually run this til we've reached test/
-@DBUS_BUILD_TESTS_TRUE@am__append_2 = dbus-test
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@am__append_5 = test-dbus
subdir = dbus
-DIST_COMMON = $(dbusinclude_HEADERS) $(srcdir)/Makefile.am \
- $(srcdir)/Makefile.in $(srcdir)/dbus-arch-deps.h.in \
- $(srcdir)/versioninfo.rc.in
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+ $(srcdir)/versioninfo.rc.in $(srcdir)/dbus-arch-deps.h.in \
+ $(top_srcdir)/depcomp $(dbusinclude_HEADERS)
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/libtool.m4 \
@@ -108,6 +142,7 @@ am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(dbusincludedir)" \
"$(DESTDIR)$(dbusarchincludedir)"
LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES)
am__DEPENDENCIES_1 =
+libdbus_1_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__append_3)
am__libdbus_1_la_SOURCES_DIST = dbus-address.c dbus-auth.c dbus-auth.h \
dbus-bus.c dbus-connection.c dbus-connection-internal.h \
dbus-credentials.c dbus-credentials.h dbus-errors.c \
@@ -194,11 +229,17 @@ libdbus_1_la_OBJECTS = $(am_libdbus_1_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
+am__v_lt_1 =
libdbus_1_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(libdbus_1_la_LDFLAGS) $(LDFLAGS) -o $@
+libdbus_init_win_la_LIBADD =
+am__libdbus_init_win_la_SOURCES_DIST = dbus-init-win.cpp
+@DBUS_WIN_TRUE@am_libdbus_init_win_la_OBJECTS = dbus-init-win.lo
+libdbus_init_win_la_OBJECTS = $(am_libdbus_init_win_la_OBJECTS)
+@DBUS_WIN_TRUE@am_libdbus_init_win_la_rpath =
libdbus_internal_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
+ $(am__DEPENDENCIES_1) $(am__append_4)
am__libdbus_internal_la_SOURCES_DIST = dbus-address.c dbus-auth.c \
dbus-auth.h dbus-bus.c dbus-connection.c \
dbus-connection-internal.h dbus-credentials.c \
@@ -235,14 +276,14 @@ am__libdbus_internal_la_SOURCES_DIST = dbus-address.c dbus-auth.c \
dbus-sysdeps-win.c dbus-sysdeps-win.h \
dbus-sysdeps-thread-win.c dbus-transport-win.c \
dbus-transport-win.h dbus-sysdeps.c dbus-sysdeps.h \
- dbus-valgrind-internal.h dbus-auth-script.c dbus-auth-script.h \
- dbus-auth-util.c dbus-credentials-util.c dbus-mainloop.c \
- dbus-mainloop.h dbus-marshal-byteswap-util.c \
- dbus-marshal-recursive-util.c dbus-marshal-validate-util.c \
- dbus-message-factory.c dbus-message-factory.h \
- dbus-message-util.c dbus-shell.c dbus-shell.h \
- dbus-sysdeps-util-unix.c dbus-userdb-util.c dbus-spawn.c \
- dbus-socket-set-epoll.c dbus-sysdeps-util-win.c \
+ dbus-valgrind-internal.h dbus-asv-util.c dbus-asv-util.h \
+ dbus-auth-script.c dbus-auth-script.h dbus-auth-util.c \
+ dbus-credentials-util.c dbus-mainloop.c dbus-mainloop.h \
+ dbus-marshal-byteswap-util.c dbus-marshal-recursive-util.c \
+ dbus-marshal-validate-util.c dbus-message-factory.c \
+ dbus-message-factory.h dbus-message-util.c dbus-shell.c \
+ dbus-shell.h dbus-sysdeps-util-unix.c dbus-userdb-util.c \
+ dbus-spawn.c dbus-socket-set-epoll.c dbus-sysdeps-util-win.c \
dbus-spawn-win.c dbus-socket-set.h dbus-socket-set.c \
dbus-socket-set-poll.c dbus-spawn.h dbus-string-util.c \
dbus-sysdeps-util.c dbus-test.c dbus-test.h
@@ -314,7 +355,8 @@ am__objects_12 = libdbus_internal_la-dbus-dataslot.lo \
@DBUS_WIN_TRUE@ libdbus_internal_la-dbus-sysdeps-util-win.lo \
@DBUS_WIN_TRUE@ libdbus_internal_la-dbus-spawn-win.lo \
@DBUS_WIN_TRUE@ $(am__objects_13)
-am__objects_15 = libdbus_internal_la-dbus-auth-script.lo \
+am__objects_15 = libdbus_internal_la-dbus-asv-util.lo \
+ libdbus_internal_la-dbus-auth-script.lo \
libdbus_internal_la-dbus-auth-util.lo \
libdbus_internal_la-dbus-credentials-util.lo \
libdbus_internal_la-dbus-mainloop.lo \
@@ -332,11 +374,23 @@ am__objects_15 = libdbus_internal_la-dbus-auth-script.lo \
am_libdbus_internal_la_OBJECTS = $(am__objects_8) $(am__objects_12) \
$(am__objects_15)
libdbus_internal_la_OBJECTS = $(am_libdbus_internal_la_OBJECTS)
-@DBUS_BUILD_TESTS_TRUE@am__EXEEXT_1 = dbus-test$(EXEEXT)
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@am__EXEEXT_1 = test-dbus$(EXEEXT)
PROGRAMS = $(noinst_PROGRAMS)
-am_dbus_test_OBJECTS = dbus-test-main.$(OBJEXT)
-dbus_test_OBJECTS = $(am_dbus_test_OBJECTS)
-dbus_test_DEPENDENCIES = libdbus-internal.la
+am_test_dbus_OBJECTS = dbus-test-main.$(OBJEXT)
+test_dbus_OBJECTS = $(am_test_dbus_OBJECTS)
+test_dbus_DEPENDENCIES = libdbus-internal.la
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@@ -349,30 +403,62 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-SOURCES = $(libdbus_1_la_SOURCES) $(libdbus_internal_la_SOURCES) \
- $(dbus_test_SOURCES)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS)
+AM_V_CXX = $(am__v_CXX_@AM_V@)
+am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
+am__v_CXX_0 = @echo " CXX " $@;
+am__v_CXX_1 =
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
+am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
+am__v_CXXLD_0 = @echo " CXXLD " $@;
+am__v_CXXLD_1 =
+SOURCES = $(libdbus_1_la_SOURCES) $(libdbus_init_win_la_SOURCES) \
+ $(libdbus_internal_la_SOURCES) $(test_dbus_SOURCES)
DIST_SOURCES = $(am__libdbus_1_la_SOURCES_DIST) \
- $(am__libdbus_internal_la_SOURCES_DIST) $(dbus_test_SOURCES)
+ $(am__libdbus_init_win_la_SOURCES_DIST) \
+ $(am__libdbus_internal_la_SOURCES_DIST) $(test_dbus_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
HEADERS = $(dbusinclude_HEADERS) $(nodist_dbusarchinclude_HEADERS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -404,7 +490,6 @@ 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@
DBUS_INT64_CONSTANT = @DBUS_INT64_CONSTANT@
@@ -415,7 +500,8 @@ DBUS_MICRO_VERSION = @DBUS_MICRO_VERSION@
DBUS_MINOR_VERSION = @DBUS_MINOR_VERSION@
DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@
DBUS_PREFIX = @DBUS_PREFIX@
-DBUS_SESSION_BUS_DEFAULT_ADDRESS = @DBUS_SESSION_BUS_DEFAULT_ADDRESS@
+DBUS_SESSION_BUS_CONNECT_ADDRESS = @DBUS_SESSION_BUS_CONNECT_ADDRESS@
+DBUS_SESSION_BUS_LISTEN_ADDRESS = @DBUS_SESSION_BUS_LISTEN_ADDRESS@
DBUS_SESSION_SOCKET_DIR = @DBUS_SESSION_SOCKET_DIR@
DBUS_STATIC_BUILD_CPPFLAGS = @DBUS_STATIC_BUILD_CPPFLAGS@
DBUS_SYSTEM_BUS_DEFAULT_ADDRESS = @DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@
@@ -464,8 +550,6 @@ LIBDBUS_LIBS = @LIBDBUS_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
-LIBXML_CFLAGS = @LIBXML_CFLAGS@
-LIBXML_LIBS = @LIBXML_LIBS@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
@@ -474,7 +558,6 @@ LT_CURRENT = @LT_CURRENT@
LT_REVISION = @LT_REVISION@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
-MAN2HTML = @MAN2HTML@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NETWORK_libs = @NETWORK_libs@
@@ -508,7 +591,6 @@ SHELL = @SHELL@
STRIP = @STRIP@
SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
SYSTEMD_LIBS = @SYSTEMD_LIBS@
-TEST_BUS_BINARY = @TEST_BUS_BINARY@
TEST_LAUNCH_HELPER_BINARY = @TEST_LAUNCH_HELPER_BINARY@
TEST_LISTEN = @TEST_LISTEN@
TEST_SOCKET_DIR = @TEST_SOCKET_DIR@
@@ -585,17 +667,15 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
configdir = $(sysconfdir)/dbus-1
-AM_CPPFLAGS = \
- -I$(top_builddir) \
- -I$(top_srcdir) \
- $(SYSTEMD_CFLAGS) \
- $(VALGRIND_CFLAGS) \
- -DDBUS_COMPILATION \
+
+# On Linux with glibc 2.17, sd-daemon.c support for POSIX message queues
+# results in an otherwise unnecessary dependency on librt. Disable it.
+AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) $(SYSTEMD_CFLAGS) \
+ $(VALGRIND_CFLAGS) -DDBUS_COMPILATION \
-DDBUS_MACHINE_UUID_FILE=\""$(localstatedir)/lib/dbus/machine-id"\" \
-DDBUS_SYSTEM_CONFIG_FILE=\""$(configdir)/system.conf"\" \
-DDBUS_SESSION_CONFIG_FILE=\""$(configdir)/session.conf"\" \
- $(NULL)
-
+ $(NULL) -DSD_DAEMON_DISABLE_MQ
# if assertions are enabled, improve backtraces
AM_LDFLAGS = @R_DYNAMIC_LDFLAG@
@@ -615,7 +695,7 @@ lib_LTLIBRARIES = libdbus-1.la
@DBUS_WIN_TRUE@no_undefined = -no-undefined
@DBUS_WIN_FALSE@export_symbols = -export-symbols-regex "^[^_].*"
@DBUS_WIN_TRUE@export_symbols =
-@DBUS_WIN_TRUE@libdbus_1_la_DEPENDENCIES = $(dbus_res)
+@DBUS_WIN_TRUE@EXTRA_libdbus_1_la_DEPENDENCIES = $(dbus_res)
@DBUS_WIN_FALSE@intllibs = @LTLIBINTL@
@DBUS_WIN_TRUE@intllibs =
@DBUS_WIN_FALSE@DBUS_LIB_arch_sources = \
@@ -784,6 +864,8 @@ DBUS_SHARED_SOURCES = \
### should be underscore-prefixed but don't really need
### to be unless they move to DBUS_SHARED_SOURCES later)
DBUS_UTIL_SOURCES = \
+ dbus-asv-util.c \
+ dbus-asv-util.h \
dbus-auth-script.c \
dbus-auth-script.h \
dbus-auth-util.c \
@@ -819,13 +901,13 @@ libdbus_internal_la_SOURCES = \
BUILT_SOURCES = $(nodist_dbusarchinclude_HEADERS)
EXTRA_DIST = dbus-arch-deps.h.in
-noinst_LTLIBRARIES = libdbus-internal.la
+noinst_LTLIBRARIES = libdbus-internal.la $(am__append_2)
libdbus_1_la_CPPFLAGS = \
$(AM_CPPFLAGS) \
-Ddbus_1_EXPORTS \
$(NULL)
-libdbus_1_la_LIBADD = $(LIBDBUS_LIBS)
+libdbus_1_la_LIBADD = $(LIBDBUS_LIBS) $(am__append_3)
libdbus_1_la_LDFLAGS = \
$(AM_LDFLAGS) \
$(export_symbols) \
@@ -838,16 +920,18 @@ libdbus_internal_la_CPPFLAGS = \
-DDBUS_STATIC_BUILD \
$(NULL)
-libdbus_internal_la_LIBADD = $(LIBDBUS_LIBS) $(SYSTEMD_LIBS)
-dbus_test_SOURCES = \
+libdbus_internal_la_LIBADD = $(LIBDBUS_LIBS) $(SYSTEMD_LIBS) \
+ $(am__append_4)
+@DBUS_WIN_TRUE@libdbus_init_win_la_SOURCES = dbus-init-win.cpp
+test_dbus_SOURCES = \
dbus-test-main.c
-dbus_test_LDADD = libdbus-internal.la
+test_dbus_LDADD = libdbus-internal.la
all: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
-.SUFFIXES: rc .c .lo .o .obj .rc
+.SUFFIXES: rc .c .cpp .lo .o .obj .rc
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
@@ -882,6 +966,7 @@ versioninfo.rc: $(top_builddir)/config.status $(srcdir)/versioninfo.rc.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
dbus-arch-deps.h: $(top_builddir)/config.status $(srcdir)/dbus-arch-deps.h.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
@@ -908,23 +993,32 @@ uninstall-libLTLIBRARIES:
clean-libLTLIBRARIES:
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
- @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
- dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
- test "$$dir" != "$$p" || dir=.; \
- echo "rm -f \"$${dir}/so_locations\""; \
- rm -f "$${dir}/so_locations"; \
- done
+ @list='$(lib_LTLIBRARIES)'; \
+ locs=`for p in $$list; do echo $$p; done | \
+ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+ sort -u`; \
+ test -z "$$locs" || { \
+ echo rm -f $${locs}; \
+ rm -f $${locs}; \
+ }
clean-noinstLTLIBRARIES:
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
- dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
- test "$$dir" != "$$p" || dir=.; \
- echo "rm -f \"$${dir}/so_locations\""; \
- rm -f "$${dir}/so_locations"; \
- done
+ @list='$(noinst_LTLIBRARIES)'; \
+ locs=`for p in $$list; do echo $$p; done | \
+ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+ sort -u`; \
+ test -z "$$locs" || { \
+ echo rm -f $${locs}; \
+ rm -f $${locs}; \
+ }
+
libdbus-1.la: $(libdbus_1_la_OBJECTS) $(libdbus_1_la_DEPENDENCIES) $(EXTRA_libdbus_1_la_DEPENDENCIES)
$(AM_V_CCLD)$(libdbus_1_la_LINK) -rpath $(libdir) $(libdbus_1_la_OBJECTS) $(libdbus_1_la_LIBADD) $(LIBS)
+
+libdbus-init-win.la: $(libdbus_init_win_la_OBJECTS) $(libdbus_init_win_la_DEPENDENCIES) $(EXTRA_libdbus_init_win_la_DEPENDENCIES)
+ $(AM_V_CXXLD)$(CXXLINK) $(am_libdbus_init_win_la_rpath) $(libdbus_init_win_la_OBJECTS) $(libdbus_init_win_la_LIBADD) $(LIBS)
+
libdbus-internal.la: $(libdbus_internal_la_OBJECTS) $(libdbus_internal_la_DEPENDENCIES) $(EXTRA_libdbus_internal_la_DEPENDENCIES)
$(AM_V_CCLD)$(LINK) $(libdbus_internal_la_OBJECTS) $(libdbus_internal_la_LIBADD) $(LIBS)
@@ -936,9 +1030,10 @@ clean-noinstPROGRAMS:
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
-dbus-test$(EXEEXT): $(dbus_test_OBJECTS) $(dbus_test_DEPENDENCIES) $(EXTRA_dbus_test_DEPENDENCIES)
- @rm -f dbus-test$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(dbus_test_OBJECTS) $(dbus_test_LDADD) $(LIBS)
+
+test-dbus$(EXEEXT): $(test_dbus_OBJECTS) $(test_dbus_DEPENDENCIES) $(EXTRA_test_dbus_DEPENDENCIES)
+ @rm -f test-dbus$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_dbus_OBJECTS) $(test_dbus_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -946,6 +1041,7 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-init-win.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-test-main.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-address.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-auth.Plo@am__quote@
@@ -1004,6 +1100,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-dbus-watch.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_1_la-sd-daemon.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-address.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-asv-util.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-auth-script.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-auth-util.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_internal_la-dbus-auth.Plo@am__quote@
@@ -1086,14 +1183,14 @@ distclean-compile:
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -1886,6 +1983,13 @@ libdbus_internal_la-dbus-sysdeps.lo: dbus-sysdeps.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-sysdeps.lo `test -f 'dbus-sysdeps.c' || echo '$(srcdir)/'`dbus-sysdeps.c
+libdbus_internal_la-dbus-asv-util.lo: dbus-asv-util.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-asv-util.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-asv-util.Tpo -c -o libdbus_internal_la-dbus-asv-util.lo `test -f 'dbus-asv-util.c' || echo '$(srcdir)/'`dbus-asv-util.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-asv-util.Tpo $(DEPDIR)/libdbus_internal_la-dbus-asv-util.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-asv-util.c' object='libdbus_internal_la-dbus-asv-util.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-asv-util.lo `test -f 'dbus-asv-util.c' || echo '$(srcdir)/'`dbus-asv-util.c
+
libdbus_internal_la-dbus-auth-script.lo: dbus-auth-script.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_internal_la-dbus-auth-script.lo -MD -MP -MF $(DEPDIR)/libdbus_internal_la-dbus-auth-script.Tpo -c -o libdbus_internal_la-dbus-auth-script.lo `test -f 'dbus-auth-script.c' || echo '$(srcdir)/'`dbus-auth-script.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_internal_la-dbus-auth-script.Tpo $(DEPDIR)/libdbus_internal_la-dbus-auth-script.Plo
@@ -2033,6 +2137,27 @@ libdbus_internal_la-dbus-test.lo: dbus-test.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_internal_la-dbus-test.lo `test -f 'dbus-test.c' || echo '$(srcdir)/'`dbus-test.c
+.cpp.o:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
+
mostlyclean-libtool:
-rm -f *.lo
@@ -2081,26 +2206,15 @@ uninstall-nodist_dbusarchincludeHEADERS:
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(dbusarchincludedir)'; $(am__uninstall_files_from_dir)
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
+ $(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
@@ -2112,15 +2226,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$$unique; \
fi; \
fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
@@ -2129,6 +2239,21 @@ GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -2278,22 +2403,23 @@ uninstall-am: uninstall-dbusincludeHEADERS uninstall-libLTLIBRARIES \
.MAKE: all check install install-am install-strip
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
clean-libLTLIBRARIES clean-libtool clean-local \
- clean-noinstLTLIBRARIES clean-noinstPROGRAMS ctags distclean \
- distclean-compile distclean-generic distclean-libtool \
- distclean-tags distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am \
- install-dbusincludeHEADERS install-dvi install-dvi-am \
- install-exec install-exec-am install-html install-html-am \
- install-info install-info-am install-libLTLIBRARIES \
- install-man install-nodist_dbusarchincludeHEADERS install-pdf \
+ clean-noinstLTLIBRARIES clean-noinstPROGRAMS cscopelist-am \
+ ctags ctags-am 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-dbusincludeHEADERS install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am \
+ install-libLTLIBRARIES install-man \
+ install-nodist_dbusarchincludeHEADERS install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags uninstall uninstall-am uninstall-dbusincludeHEADERS \
- uninstall-libLTLIBRARIES \
+ tags tags-am uninstall uninstall-am \
+ uninstall-dbusincludeHEADERS uninstall-libLTLIBRARIES \
uninstall-nodist_dbusarchincludeHEADERS
@@ -2304,8 +2430,8 @@ clean-local:
/bin/rm *.bb *.bbg *.da *.gcov .libs/*.da .libs/*.bbg || true
update-systemd:
- curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.c > sd-daemon.c
- curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.h > sd-daemon.h
+ curl http://cgit.freedesktop.org/systemd/systemd/plain/src/libsystemd-daemon/sd-daemon.c > $(srcdir)/sd-daemon.c
+ curl http://cgit.freedesktop.org/systemd/systemd/plain/src/systemd/sd-daemon.h > $(srcdir)/sd-daemon.h
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/dbus/dbus-address.c b/dbus/dbus-address.c
index 90484dc1..c4cfbbe5 100644
--- a/dbus/dbus-address.c
+++ b/dbus/dbus-address.c
@@ -104,15 +104,15 @@ dbus_bool_t
_dbus_address_append_escaped (DBusString *escaped,
const DBusString *unescaped)
{
- const char *p;
- const char *end;
+ const unsigned char *p;
+ const unsigned char *end;
dbus_bool_t ret;
int orig_len;
ret = FALSE;
orig_len = _dbus_string_get_length (escaped);
- p = _dbus_string_get_const_data (unescaped);
+ p = (const unsigned char *) _dbus_string_get_const_data (unescaped);
end = p + _dbus_string_get_length (unescaped);
while (p != end)
{
@@ -648,7 +648,7 @@ dbus_address_unescape_value (const char *value,
/** @} */ /* End of public API */
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#ifndef DOXYGEN_SHOULD_SKIP_THIS
@@ -678,7 +678,9 @@ static const EscapeTest escape_tests[] = {
{ "Z", "Z" },
{ "a", "a" },
{ "i", "i" },
- { "z", "z" }
+ { "z", "z" },
+ /* Bug: https://bugs.freedesktop.org/show_bug.cgi?id=53499 */
+ { "%c3%b6", "\xc3\xb6" }
};
static const char* invalid_escaped_values[] = {
diff --git a/dbus/dbus-arch-deps.h.in b/dbus/dbus-arch-deps.h.in
index 45952cfb..dfc3589e 100644
--- a/dbus/dbus-arch-deps.h.in
+++ b/dbus/dbus-arch-deps.h.in
@@ -31,7 +31,7 @@
DBUS_BEGIN_DECLS
-#if @DBUS_HAVE_INT64@
+/* D-Bus no longer supports platforms with no 64-bit integer type. */
#define DBUS_HAVE_INT64 1
_DBUS_GNUC_EXTENSION typedef @DBUS_INT64_TYPE@ dbus_int64_t;
_DBUS_GNUC_EXTENSION typedef unsigned @DBUS_INT64_TYPE@ dbus_uint64_t;
@@ -39,12 +39,6 @@ _DBUS_GNUC_EXTENSION typedef unsigned @DBUS_INT64_TYPE@ dbus_uint64_t;
#define DBUS_INT64_CONSTANT(val) (_DBUS_GNUC_EXTENSION @DBUS_INT64_CONSTANT@)
#define DBUS_UINT64_CONSTANT(val) (_DBUS_GNUC_EXTENSION @DBUS_UINT64_CONSTANT@)
-#else
-#undef DBUS_HAVE_INT64
-#undef DBUS_INT64_CONSTANT
-#undef DBUS_UINT64_CONSTANT
-#endif
-
typedef @DBUS_INT32_TYPE@ dbus_int32_t;
typedef unsigned @DBUS_INT32_TYPE@ dbus_uint32_t;
diff --git a/dbus/dbus-asv-util.c b/dbus/dbus-asv-util.c
new file mode 100644
index 00000000..583e41fa
--- /dev/null
+++ b/dbus/dbus-asv-util.c
@@ -0,0 +1,260 @@
+/* dbus-asv-util.c - utility functions for a{sv}
+ *
+ * Copyright © 2011-2012 Nokia Corporation
+ * Copyright © 2012-2013 Collabora Ltd.
+ *
+ * Licensed under the Academic Free License version 2.1
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include <config.h>
+
+#include <dbus/dbus.h>
+
+#include "dbus/dbus-asv-util.h"
+
+/**
+ * Convenience function to create a method-call reply whose type is a{sv}
+ * (map from string to variant).
+ *
+ * Append values with 0 or more sequences of _dbus_asv_open_entry(),
+ * appending a value to var_iter, and _dbus_asv_close_entry(),
+ * then close the a{sv} with _dbus_asv_close() or _dbus_asv_abandon().
+ *
+ * This must be paired with a call to _dbus_asv_close() or _dbus_asv_abandon().
+ *
+ * @param message a method call message
+ * @param iter an iterator which will be initialized to append to the message
+ * @param arr_iter an iterator which will be initialized to append to the array
+ * @returns a new message, or #NULL if not enough memory
+ */
+DBusMessage *
+_dbus_asv_new_method_return (DBusMessage *message,
+ DBusMessageIter *iter,
+ DBusMessageIter *arr_iter)
+{
+ DBusMessage *reply = dbus_message_new_method_return (message);
+
+ if (reply == NULL)
+ return NULL;
+
+ dbus_message_iter_init_append (reply, iter);
+
+ if (!dbus_message_iter_open_container (iter, DBUS_TYPE_ARRAY, "{sv}",
+ arr_iter))
+ {
+ dbus_message_unref (reply);
+ return NULL;
+ }
+
+ return reply;
+}
+
+/*
+ * Open a new entry in an a{sv} (map from string to variant).
+ *
+ * This must be paired with a call to either _dbus_asv_close_entry()
+ * or _dbus_asv_abandon_entry().
+ *
+ * If this function fails, the a{sv} must be abandoned, for instance
+ * with _dbus_asv_abandon().
+ *
+ * @param arr_iter the iterator which is appending to the array
+ * @param entry_iter will be initialized to append to the dict-entry
+ * @param key a UTF-8 key for the map
+ * @param type the type of the variant value, e.g. DBUS_TYPE_STRING_AS_STRING
+ * @param var_iter will be initialized to append (i.e. write) to the variant
+ * @returns #TRUE on success, or #FALSE if not enough memory
+ */
+static dbus_bool_t
+_dbus_asv_open_entry (DBusMessageIter *arr_iter,
+ DBusMessageIter *entry_iter,
+ const char *key,
+ const char *type,
+ DBusMessageIter *var_iter)
+{
+ if (!dbus_message_iter_open_container (arr_iter, DBUS_TYPE_DICT_ENTRY,
+ NULL, entry_iter))
+ return FALSE;
+
+ if (!dbus_message_iter_append_basic (entry_iter, DBUS_TYPE_STRING, &key))
+ {
+ dbus_message_iter_abandon_container (arr_iter, entry_iter);
+ return FALSE;
+ }
+
+ if (!dbus_message_iter_open_container (entry_iter, DBUS_TYPE_VARIANT,
+ type, var_iter))
+ {
+ dbus_message_iter_abandon_container (arr_iter, entry_iter);
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/*
+ * Closes an a{sv} entry after successfully appending the value.
+ *
+ * If this function fails, the a{sv} must be abandoned, for instance
+ * with _dbus_asv_abandon().
+ *
+ * @param arr_iter the iterator which is appending to the array
+ * @param entry_iter the iterator appending to the dict-entry, will be closed
+ * @param var_iter the iterator appending to the variant, will be closed
+ * @returns #TRUE on success, or #FALSE if not enough memory
+ */
+static dbus_bool_t
+_dbus_asv_close_entry (DBusMessageIter *arr_iter,
+ DBusMessageIter *entry_iter,
+ DBusMessageIter *var_iter)
+{
+ if (!dbus_message_iter_close_container (entry_iter, var_iter))
+ {
+ dbus_message_iter_abandon_container (arr_iter, entry_iter);
+ return FALSE;
+ }
+
+ if (!dbus_message_iter_close_container (arr_iter, entry_iter))
+ return FALSE;
+
+ return TRUE;
+}
+
+/**
+ * Closes an a{sv} after successfully appending all values.
+ *
+ * If this function fails, you must abandon iter and whatever
+ * larger data structure (message, etc.) the a{sv} was embedded in.
+ *
+ * @param iter the iterator which is appending to the message or other data structure containing the a{sv}
+ * @param arr_iter the iterator appending to the array, will be closed
+ * @returns #TRUE on success, or #FALSE if not enough memory
+ */
+dbus_bool_t
+_dbus_asv_close (DBusMessageIter *iter,
+ DBusMessageIter *arr_iter)
+{
+ return dbus_message_iter_close_container (iter, arr_iter);
+}
+
+/*
+ * Closes an a{sv} entry after unsuccessfully appending a value.
+ * You must also abandon the a{sv} itself (for instance with
+ * _dbus_asv_abandon()), and abandon whatever larger data structure
+ * the a{sv} was embedded in.
+ *
+ * @param iter the iterator which is appending to the message or other data structure containing the a{sv}
+ * @param arr_iter the iterator appending to the array, will be closed
+ * @returns #TRUE on success, or #FALSE if not enough memory
+ */
+static void
+_dbus_asv_abandon_entry (DBusMessageIter *arr_iter,
+ DBusMessageIter *entry_iter,
+ DBusMessageIter *var_iter)
+{
+ dbus_message_iter_abandon_container (entry_iter, var_iter);
+ dbus_message_iter_abandon_container (arr_iter, entry_iter);
+}
+
+/**
+ * Closes an a{sv} after unsuccessfully appending a value.
+ *
+ * You must also abandon whatever larger data structure (message, etc.)
+ * the a{sv} was embedded in.
+ *
+ * @param iter the iterator which is appending to the message or other data structure containing the a{sv}
+ * @param arr_iter the iterator appending to the array, will be closed
+ */
+void
+_dbus_asv_abandon (DBusMessageIter *iter,
+ DBusMessageIter *arr_iter)
+{
+ dbus_message_iter_abandon_container (iter, arr_iter);
+}
+
+/**
+ * Create a new entry in an a{sv} (map from string to variant)
+ * with a 32-bit unsigned integer value.
+ *
+ * If this function fails, the a{sv} must be abandoned, for instance
+ * with _dbus_asv_abandon().
+ *
+ * @param arr_iter the iterator which is appending to the array
+ * @param key a UTF-8 key for the map
+ * @param value the value
+ * @returns #TRUE on success, or #FALSE if not enough memory
+ */
+dbus_bool_t
+_dbus_asv_add_uint32 (DBusMessageIter *arr_iter,
+ const char *key,
+ dbus_uint32_t value)
+{
+ DBusMessageIter entry_iter, var_iter;
+
+ if (!_dbus_asv_open_entry (arr_iter, &entry_iter, key,
+ DBUS_TYPE_UINT32_AS_STRING, &var_iter))
+ return FALSE;
+
+ if (!dbus_message_iter_append_basic (&var_iter, DBUS_TYPE_UINT32,
+ &value))
+ {
+ _dbus_asv_abandon_entry (arr_iter, &entry_iter, &var_iter);
+ return FALSE;
+ }
+
+ if (!_dbus_asv_close_entry (arr_iter, &entry_iter, &var_iter))
+ return FALSE;
+
+ return TRUE;
+}
+
+/**
+ * Create a new entry in an a{sv} (map from string to variant)
+ * with a UTF-8 string value.
+ *
+ * If this function fails, the a{sv} must be abandoned, for instance
+ * with _dbus_asv_abandon().
+ *
+ * @param arr_iter the iterator which is appending to the array
+ * @param key a UTF-8 key for the map
+ * @param value the value
+ * @returns #TRUE on success, or #FALSE if not enough memory
+ */
+dbus_bool_t
+_dbus_asv_add_string (DBusMessageIter *arr_iter,
+ const char *key,
+ const char *value)
+{
+ DBusMessageIter entry_iter, var_iter;
+
+ if (!_dbus_asv_open_entry (arr_iter, &entry_iter, key,
+ DBUS_TYPE_STRING_AS_STRING, &var_iter))
+ return FALSE;
+
+ if (!dbus_message_iter_append_basic (&var_iter, DBUS_TYPE_STRING,
+ &value))
+ {
+ _dbus_asv_abandon_entry (arr_iter, &entry_iter, &var_iter);
+ return FALSE;
+ }
+
+ if (!_dbus_asv_close_entry (arr_iter, &entry_iter, &var_iter))
+ return FALSE;
+
+ return TRUE;
+}
diff --git a/dbus/dbus-asv-util.h b/dbus/dbus-asv-util.h
new file mode 100644
index 00000000..0337260a
--- /dev/null
+++ b/dbus/dbus-asv-util.h
@@ -0,0 +1,46 @@
+/* dbus-asv-util.h - utility functions for a{sv}
+ *
+ * Copyright © 2011-2012 Nokia Corporation
+ * Copyright © 2012-2013 Collabora Ltd.
+ *
+ * Licensed under the Academic Free License version 2.1
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef DBUS_ASV_UTIL_H
+#define DBUS_ASV_UTIL_H
+
+#include <dbus/dbus-internals.h>
+
+DBUS_BEGIN_DECLS
+
+DBusMessage *_dbus_asv_new_method_return (DBusMessage *message,
+ DBusMessageIter *iter,
+ DBusMessageIter *arr_iter);
+dbus_bool_t _dbus_asv_close (DBusMessageIter *iter,
+ DBusMessageIter *arr_iter);
+void _dbus_asv_abandon (DBusMessageIter *iter,
+ DBusMessageIter *arr_iter);
+
+dbus_bool_t _dbus_asv_add_uint32 (DBusMessageIter *arr_iter,
+ const char *key,
+ dbus_uint32_t value);
+dbus_bool_t _dbus_asv_add_string (DBusMessageIter *arr_iter,
+ const char *key,
+ const char *value);
+
+#endif
diff --git a/dbus/dbus-auth-script.c b/dbus/dbus-auth-script.c
index 6285e3ba..164743b0 100644
--- a/dbus/dbus-auth-script.c
+++ b/dbus/dbus-auth-script.c
@@ -22,7 +22,7 @@
*/
#include <config.h>
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#include "dbus-auth-script.h"
#include "dbus-auth.h"
@@ -223,7 +223,7 @@ auth_set_unix_credentials(DBusAuth *auth,
if (uid != DBUS_UID_UNSET)
_dbus_credentials_add_unix_uid (credentials, uid);
if (pid != DBUS_PID_UNSET)
- _dbus_credentials_add_unix_pid (credentials, pid);
+ _dbus_credentials_add_pid (credentials, pid);
_dbus_auth_set_credentials (auth, credentials);
@@ -584,11 +584,11 @@ _dbus_auth_script_run (const DBusString *filename)
{
_dbus_warn ("not enough memory to call bytes_received, or can't add bytes to auth object already in end state\n");
_dbus_string_free (&to_send);
- _dbus_auth_return_buffer (auth, buffer, 0);
+ _dbus_auth_return_buffer (auth, buffer);
goto out;
}
- _dbus_auth_return_buffer (auth, buffer, _dbus_string_get_length (&to_send));
+ _dbus_auth_return_buffer (auth, buffer);
}
_dbus_string_free (&to_send);
@@ -800,4 +800,4 @@ _dbus_auth_script_run (const DBusString *filename)
}
/** @} */
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/dbus/dbus-auth-util.c b/dbus/dbus-auth-util.c
index 776e8e27..e88d6696 100644
--- a/dbus/dbus-auth-util.c
+++ b/dbus/dbus-auth-util.c
@@ -33,7 +33,7 @@
/** @} */
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#include "dbus-test.h"
#include "dbus-auth-script.h"
#include <stdio.h>
@@ -167,4 +167,4 @@ _dbus_auth_test (const char *test_data_dir)
return TRUE;
}
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/dbus/dbus-auth.c b/dbus/dbus-auth.c
index d2c37a7a..6a07665f 100644
--- a/dbus/dbus-auth.c
+++ b/dbus/dbus-auth.c
@@ -2238,8 +2238,8 @@ process_command (DBusAuth *auth)
/**
* Creates a new auth conversation object for the server side.
- * See doc/dbus-sasl-profile.txt for full details on what
- * this object does.
+ * See http://dbus.freedesktop.org/doc/dbus-specification.html#auth-protocol
+ * for full details on what this object does.
*
* @returns the new object or #NULL if no memory
*/
@@ -2284,8 +2284,8 @@ _dbus_auth_server_new (const DBusString *guid)
/**
* Creates a new auth conversation object for the client side.
- * See doc/dbus-sasl-profile.txt for full details on what
- * this object does.
+ * See http://dbus.freedesktop.org/doc/dbus-specification.html#auth-protocol
+ * for full details on what this object does.
*
* @returns the new object or #NULL if no memory
*/
@@ -2533,12 +2533,10 @@ _dbus_auth_get_buffer (DBusAuth *auth,
*
* @param auth the auth conversation
* @param buffer the buffer being returned
- * @param bytes_read number of new bytes added
*/
void
_dbus_auth_return_buffer (DBusAuth *auth,
- DBusString *buffer,
- int bytes_read)
+ DBusString *buffer)
{
_dbus_assert (buffer == &auth->incoming);
_dbus_assert (auth->buffer_outstanding);
diff --git a/dbus/dbus-auth.h b/dbus/dbus-auth.h
index ae3f3647..ba1975f7 100644
--- a/dbus/dbus-auth.h
+++ b/dbus/dbus-auth.h
@@ -55,8 +55,7 @@ void _dbus_auth_bytes_sent (DBusAuth *auth,
void _dbus_auth_get_buffer (DBusAuth *auth,
DBusString **buffer);
void _dbus_auth_return_buffer (DBusAuth *auth,
- DBusString *buffer,
- int bytes_read);
+ DBusString *buffer);
void _dbus_auth_get_unused_bytes (DBusAuth *auth,
const DBusString **str);
void _dbus_auth_delete_unused_bytes (DBusAuth *auth);
diff --git a/dbus/dbus-bus.c b/dbus/dbus-bus.c
index fadc3a8b..0fd48311 100644
--- a/dbus/dbus-bus.c
+++ b/dbus/dbus-bus.c
@@ -28,6 +28,7 @@
#include "dbus-internals.h"
#include "dbus-message.h"
#include "dbus-marshal-validate.h"
+#include "dbus-misc.h"
#include "dbus-threads-internal.h"
#include "dbus-connection-internal.h"
#include "dbus-string.h"
@@ -95,19 +96,6 @@ static DBusBusType activation_bus_type = DBUS_BUS_STARTER;
static dbus_bool_t initialized = FALSE;
-/**
- * Lock for globals in this file
- */
-_DBUS_DEFINE_GLOBAL_LOCK (bus);
-
-/**
- * Global lock covering all BusData on any connection. The bet is
- * that some lock contention is better than more memory
- * for a per-connection lock, but it's tough to imagine it mattering
- * either way.
- */
-_DBUS_DEFINE_GLOBAL_LOCK (bus_datas);
-
static void
addresses_shutdown_func (void *data)
{
@@ -192,12 +180,12 @@ init_session_address (void)
if (!retval)
return FALSE;
- /* The DBUS_SESSION_BUS_DEFAULT_ADDRESS should have really been named
- * DBUS_SESSION_BUS_FALLBACK_ADDRESS.
- */
+ /* We have a hard-coded (but compile-time-configurable) fallback address for
+ * the session bus. */
if (bus_connection_addresses[DBUS_BUS_SESSION] == NULL)
bus_connection_addresses[DBUS_BUS_SESSION] =
- _dbus_strdup (DBUS_SESSION_BUS_DEFAULT_ADDRESS);
+ _dbus_strdup (DBUS_SESSION_BUS_CONNECT_ADDRESS);
+
if (bus_connection_addresses[DBUS_BUS_SESSION] == NULL)
return FALSE;
@@ -306,12 +294,6 @@ init_connections_unlocked (void)
* the above code will work right
*/
- if (!_dbus_setenv ("DBUS_ACTIVATION_ADDRESS", NULL))
- return FALSE;
-
- if (!_dbus_setenv ("DBUS_ACTIVATION_BUS_TYPE", NULL))
- return FALSE;
-
if (!_dbus_register_shutdown_func (addresses_shutdown_func,
NULL))
return FALSE;
@@ -330,7 +312,11 @@ bus_data_free (void *data)
if (bd->is_well_known)
{
int i;
- _DBUS_LOCK (bus);
+
+ if (!_DBUS_LOCK (bus))
+ _dbus_assert_not_reached ("global locks should have been initialized "
+ "when we attached bus data");
+
/* We may be stored in more than one slot */
/* This should now be impossible - these slots are supposed to
* be cleared on disconnect, so should not need to be cleared on
@@ -401,8 +387,13 @@ void
_dbus_bus_notify_shared_connection_disconnected_unlocked (DBusConnection *connection)
{
int i;
-
- _DBUS_LOCK (bus);
+
+ if (!_DBUS_LOCK (bus))
+ {
+ /* If it was in bus_connections, we would have initialized global locks
+ * when we added it. So, it can't be. */
+ return;
+ }
/* We are expecting to have the connection saved in only one of these
* slots, but someone could in a pathological case set system and session
@@ -436,7 +427,12 @@ internal_bus_get (DBusBusType type,
connection = NULL;
- _DBUS_LOCK (bus);
+ if (!_DBUS_LOCK (bus))
+ {
+ _DBUS_SET_OOM (error);
+ /* do not "goto out", that would try to unlock */
+ return NULL;
+ }
if (!init_connections_unlocked ())
{
@@ -506,8 +502,10 @@ internal_bus_get (DBusBusType type,
*/
dbus_connection_set_exit_on_disconnect (connection,
TRUE);
-
- _DBUS_LOCK (bus_datas);
+
+ if (!_DBUS_LOCK (bus_datas))
+ _dbus_assert_not_reached ("global locks were initialized already");
+
bd = ensure_bus_data (connection);
_dbus_assert (bd != NULL); /* it should have been created on
register, so OOM not possible */
@@ -554,7 +552,7 @@ out:
*
* @param type bus type
* @param error address where an error can be returned.
- * @returns a #DBusConnection with new ref
+ * @returns a #DBusConnection with new ref or #NULL on error
*/
DBusConnection *
dbus_bus_get (DBusBusType type,
@@ -660,7 +658,12 @@ dbus_bus_register (DBusConnection *connection,
message = NULL;
reply = NULL;
- _DBUS_LOCK (bus_datas);
+ if (!_DBUS_LOCK (bus_datas))
+ {
+ _DBUS_SET_OOM (error);
+ /* do not "goto out", that would try to unlock */
+ return FALSE;
+ }
bd = ensure_bus_data (connection);
if (bd == NULL)
@@ -769,8 +772,12 @@ dbus_bus_set_unique_name (DBusConnection *connection,
_dbus_return_val_if_fail (connection != NULL, FALSE);
_dbus_return_val_if_fail (unique_name != NULL, FALSE);
- _DBUS_LOCK (bus_datas);
-
+ if (!_DBUS_LOCK (bus_datas))
+ {
+ /* do not "goto out", that would try to unlock */
+ return FALSE;
+ }
+
bd = ensure_bus_data (connection);
if (bd == NULL)
goto out;
@@ -812,8 +819,13 @@ dbus_bus_get_unique_name (DBusConnection *connection)
_dbus_return_val_if_fail (connection != NULL, NULL);
- _DBUS_LOCK (bus_datas);
-
+ if (!_DBUS_LOCK (bus_datas))
+ {
+ /* We'd have initialized locks when we gave it its unique name, if it
+ * had one. Don't "goto out", that would try to unlock. */
+ return NULL;
+ }
+
bd = ensure_bus_data (connection);
if (bd == NULL)
goto out;
diff --git a/dbus/dbus-connection-internal.h b/dbus/dbus-connection-internal.h
index 3d37f188..28974040 100644
--- a/dbus/dbus-connection-internal.h
+++ b/dbus/dbus-connection-internal.h
@@ -44,6 +44,8 @@ typedef enum
/** default timeout value when waiting for a message reply, 25 seconds */
#define _DBUS_DEFAULT_TIMEOUT_VALUE (25 * 1000)
+typedef void (* DBusPendingFdsChangeFunction) (void *data);
+
void _dbus_connection_lock (DBusConnection *connection);
void _dbus_connection_unlock (DBusConnection *connection);
DBusConnection * _dbus_connection_ref_unlocked (DBusConnection *connection);
@@ -100,6 +102,10 @@ void _dbus_connection_test_get_locks (DBusConnectio
DBusMutex **io_path_mutex_loc,
DBusCondVar **dispatch_cond_loc,
DBusCondVar **io_path_cond_loc);
+int _dbus_connection_get_pending_fds_count (DBusConnection *connection);
+void _dbus_connection_set_pending_fds_function (DBusConnection *connection,
+ DBusPendingFdsChangeFunction callback,
+ void *data);
/* if DBUS_ENABLE_STATS */
void _dbus_connection_get_stats (DBusConnection *connection,
@@ -115,7 +121,7 @@ void _dbus_connection_get_stats (DBusConnection *connection,
dbus_uint32_t *out_peak_fds);
-/* if DBUS_BUILD_TESTS */
+/* if DBUS_ENABLE_EMBEDDED_TESTS */
const char* _dbus_connection_get_address (DBusConnection *connection);
/* This _dbus_bus_* stuff doesn't really belong here, but dbus-bus-internal.h seems
diff --git a/dbus/dbus-connection.c b/dbus/dbus-connection.c
index 66315b3f..b574207d 100644
--- a/dbus/dbus-connection.c
+++ b/dbus/dbus-connection.c
@@ -203,26 +203,19 @@
* @{
*/
-#ifdef DBUS_ENABLE_VERBOSE_MODE
static void
_dbus_connection_trace_ref (DBusConnection *connection,
int old_refcount,
int new_refcount,
const char *why)
{
+#ifdef DBUS_ENABLE_VERBOSE_MODE
static int enabled = -1;
_dbus_trace_ref ("DBusConnection", connection, old_refcount, new_refcount,
why, "DBUS_CONNECTION_TRACE", &enabled);
-}
-#else
-#define _dbus_connection_trace_ref(c,o,n,w) \
- do \
- {\
- (void) (o); \
- (void) (n); \
- } while (0)
#endif
+}
/**
* Internal struct representing a message filter function
@@ -336,8 +329,8 @@ struct DBusConnection
#ifndef DBUS_DISABLE_CHECKS
unsigned int have_connection_lock : 1; /**< Used to check locking */
#endif
-
-#ifndef DBUS_DISABLE_CHECKS
+
+#if defined(DBUS_ENABLE_CHECKS) || defined(DBUS_ENABLE_ASSERT)
int generation; /**< _dbus_current_generation that should correspond to this connection */
#endif
};
@@ -446,7 +439,7 @@ _dbus_connection_wakeup_mainloop (DBusConnection *connection)
(*connection->wakeup_main_function) (connection->wakeup_main_data);
}
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
/**
* Gets the locks so we can examine them
*
@@ -490,9 +483,9 @@ _dbus_connection_queue_received_message_link (DBusConnection *connection,
DBusPendingCall *pending;
dbus_uint32_t reply_serial;
DBusMessage *message;
-
- _dbus_assert (_dbus_transport_get_is_authenticated (connection->transport));
-
+
+ _dbus_assert (_dbus_transport_peek_is_authenticated (connection->transport));
+
_dbus_list_append_link (&connection->incoming_messages,
link);
message = link->data;
@@ -1354,7 +1347,7 @@ _dbus_connection_new_for_transport (DBusTransport *transport)
connection->disconnected_message_arrived = FALSE;
connection->disconnected_message_processed = FALSE;
-#ifndef DBUS_DISABLE_CHECKS
+#if defined(DBUS_ENABLE_CHECKS) || defined(DBUS_ENABLE_ASSERT)
connection->generation = _dbus_current_generation;
#endif
@@ -1531,7 +1524,7 @@ _dbus_connection_handle_watch (DBusWatch *watch,
return retval;
}
-_DBUS_DEFINE_GLOBAL_LOCK (shared_connections);
+/* Protected by _DBUS_LOCK (shared_connections) */
static DBusHashTable *shared_connections = NULL;
static DBusList *shared_connections_no_guid = NULL;
@@ -1555,9 +1548,14 @@ static void
shared_connections_shutdown (void *data)
{
int n_entries;
-
- _DBUS_LOCK (shared_connections);
-
+
+ if (!_DBUS_LOCK (shared_connections))
+ {
+ /* We'd have initialized locks before adding anything, so there
+ * can't be anything there. */
+ return;
+ }
+
/* This is a little bit unpleasant... better ideas? */
while ((n_entries = _dbus_hash_table_get_n_entries (shared_connections)) > 0)
{
@@ -1571,7 +1569,8 @@ shared_connections_shutdown (void *data)
_DBUS_UNLOCK (shared_connections);
close_connection_on_shutdown (connection);
- _DBUS_LOCK (shared_connections);
+ if (!_DBUS_LOCK (shared_connections))
+ _dbus_assert_not_reached ("global locks were already initialized");
/* The connection should now be dead and not in our hash ... */
_dbus_assert (_dbus_hash_table_get_n_entries (shared_connections) < n_entries);
@@ -1590,7 +1589,8 @@ shared_connections_shutdown (void *data)
{
_DBUS_UNLOCK (shared_connections);
close_connection_on_shutdown (connection);
- _DBUS_LOCK (shared_connections);
+ if (!_DBUS_LOCK (shared_connections))
+ _dbus_assert_not_reached ("global locks were already initialized");
connection = _dbus_list_pop_first (&shared_connections_no_guid);
}
}
@@ -1607,8 +1607,13 @@ connection_lookup_shared (DBusAddressEntry *entry,
_dbus_verbose ("checking for existing connection\n");
*result = NULL;
-
- _DBUS_LOCK (shared_connections);
+
+ if (!_DBUS_LOCK (shared_connections))
+ {
+ /* If it was shared, we'd have initialized global locks when we put
+ * it in shared_connections. */
+ return FALSE;
+ }
if (shared_connections == NULL)
{
@@ -1706,7 +1711,8 @@ connection_record_shared_unlocked (DBusConnection *connection,
if (guid == NULL)
{
- _DBUS_LOCK (shared_connections);
+ if (!_DBUS_LOCK (shared_connections))
+ return FALSE;
if (!_dbus_list_prepend (&shared_connections_no_guid, connection))
{
@@ -1733,8 +1739,14 @@ connection_record_shared_unlocked (DBusConnection *connection,
dbus_free (guid_key);
return FALSE;
}
-
- _DBUS_LOCK (shared_connections);
+
+ if (!_DBUS_LOCK (shared_connections))
+ {
+ dbus_free (guid_in_connection);
+ dbus_free (guid_key);
+ return FALSE;
+ }
+
_dbus_assert (shared_connections != NULL);
if (!_dbus_hash_table_insert_string (shared_connections,
@@ -1765,9 +1777,14 @@ connection_forget_shared_unlocked (DBusConnection *connection)
if (!connection->shareable)
return;
-
- _DBUS_LOCK (shared_connections);
-
+
+ if (!_DBUS_LOCK (shared_connections))
+ {
+ /* If it was shared, we'd have initialized global locks when we put
+ * it in the table; so it can't be there. */
+ return;
+ }
+
if (connection->server_guid != NULL)
{
_dbus_verbose ("dropping connection to %s out of the shared table\n",
@@ -2150,7 +2167,7 @@ _dbus_connection_close_if_only_one_ref (DBusConnection *connection)
* relatively long time for memory, if they were only willing to block
* briefly then we retry for memory at a rapid rate.
*
- * @timeout_milliseconds the timeout requested for blocking
+ * @param timeout_milliseconds the timeout requested for blocking
*/
static void
_dbus_memory_pause_based_on_timeout (int timeout_milliseconds)
@@ -2532,6 +2549,33 @@ _dbus_connection_block_pending_call (DBusPendingCall *pending)
dbus_pending_call_unref (pending);
}
+/**
+ * Return how many file descriptors are pending in the loader
+ *
+ * @param connection the connection
+ */
+int
+_dbus_connection_get_pending_fds_count (DBusConnection *connection)
+{
+ return _dbus_transport_get_pending_fds_count (connection->transport);
+}
+
+/**
+ * Register a function to be called whenever the number of pending file
+ * descriptors in the loader change.
+ *
+ * @param connection the connection
+ * @param callback the callback
+ */
+void
+_dbus_connection_set_pending_fds_function (DBusConnection *connection,
+ DBusPendingFdsChangeFunction callback,
+ void *data)
+{
+ _dbus_transport_set_pending_fds_function (connection->transport,
+ callback, data);
+}
+
/** @} */
/**
@@ -2683,6 +2727,7 @@ _dbus_connection_last_unref (DBusConnection *connection)
dbus_connection_set_dispatch_status_function (connection, NULL, NULL, NULL);
dbus_connection_set_wakeup_main_function (connection, NULL, NULL, NULL);
dbus_connection_set_unix_user_function (connection, NULL, NULL, NULL);
+ dbus_connection_set_windows_user_function (connection, NULL, NULL, NULL);
_dbus_watch_list_free (connection->watches);
connection->watches = NULL;
@@ -2952,9 +2997,9 @@ dbus_connection_get_is_authenticated (DBusConnection *connection)
dbus_bool_t res;
_dbus_return_val_if_fail (connection != NULL, FALSE);
-
+
CONNECTION_LOCK (connection);
- res = _dbus_transport_get_is_authenticated (connection->transport);
+ res = _dbus_transport_try_to_authenticate (connection->transport);
CONNECTION_UNLOCK (connection);
return res;
@@ -3938,7 +3983,7 @@ _dbus_connection_pop_message_link_unlocked (DBusConnection *connection)
link = _dbus_list_pop_first_link (&connection->incoming_messages);
connection->n_incoming -= 1;
- _dbus_verbose ("Message %p (%s %s %s %s '%s') removed from incoming queue %p, %d incoming\n",
+ _dbus_verbose ("Message %p (%s %s %s %s sig:'%s' serial:%u) removed from incoming queue %p, %d incoming\n",
link->data,
dbus_message_type_to_string (dbus_message_get_type (link->data)),
dbus_message_get_path (link->data) ?
@@ -3951,6 +3996,7 @@ _dbus_connection_pop_message_link_unlocked (DBusConnection *connection)
dbus_message_get_member (link->data) :
"no member",
dbus_message_get_signature (link->data),
+ dbus_message_get_serial (link->data),
connection, connection->n_incoming);
_dbus_message_trace_ref (link->data, -1, -1,
@@ -5148,10 +5194,10 @@ dbus_connection_get_unix_user (DBusConnection *connection,
_dbus_return_val_if_fail (connection != NULL, FALSE);
_dbus_return_val_if_fail (uid != NULL, FALSE);
-
+
CONNECTION_LOCK (connection);
- if (!_dbus_transport_get_is_authenticated (connection->transport))
+ if (!_dbus_transport_try_to_authenticate (connection->transport))
result = FALSE;
else
result = _dbus_transport_get_unix_user (connection->transport,
@@ -5184,10 +5230,10 @@ dbus_connection_get_unix_process_id (DBusConnection *connection,
_dbus_return_val_if_fail (connection != NULL, FALSE);
_dbus_return_val_if_fail (pid != NULL, FALSE);
-
+
CONNECTION_LOCK (connection);
- if (!_dbus_transport_get_is_authenticated (connection->transport))
+ if (!_dbus_transport_try_to_authenticate (connection->transport))
result = FALSE;
else
result = _dbus_transport_get_unix_process_id (connection->transport,
@@ -5205,7 +5251,8 @@ dbus_connection_get_unix_process_id (DBusConnection *connection,
* connection.
*
* @param connection the connection
- * @param data return location for audit data
+ * @param data return location for audit data
+ * @param data_size return location for length of audit data
* @returns #TRUE if audit data is filled in with a valid ucred pointer
*/
dbus_bool_t
@@ -5218,10 +5265,10 @@ dbus_connection_get_adt_audit_session_data (DBusConnection *connection,
_dbus_return_val_if_fail (connection != NULL, FALSE);
_dbus_return_val_if_fail (data != NULL, FALSE);
_dbus_return_val_if_fail (data_size != NULL, FALSE);
-
+
CONNECTION_LOCK (connection);
- if (!_dbus_transport_get_is_authenticated (connection->transport))
+ if (!_dbus_transport_try_to_authenticate (connection->transport))
result = FALSE;
else
result = _dbus_transport_get_adt_audit_session_data (connection->transport,
@@ -5314,10 +5361,10 @@ dbus_connection_get_windows_user (DBusConnection *connection,
_dbus_return_val_if_fail (connection != NULL, FALSE);
_dbus_return_val_if_fail (windows_sid_p != NULL, FALSE);
-
+
CONNECTION_LOCK (connection);
- if (!_dbus_transport_get_is_authenticated (connection->transport))
+ if (!_dbus_transport_try_to_authenticate (connection->transport))
result = FALSE;
else
result = _dbus_transport_get_windows_user (connection->transport,
@@ -5435,7 +5482,7 @@ dbus_connection_set_route_peer_messages (DBusConnection *connection,
_dbus_return_if_fail (connection != NULL);
CONNECTION_LOCK (connection);
- connection->route_peer_messages = TRUE;
+ connection->route_peer_messages = value;
CONNECTION_UNLOCK (connection);
}
@@ -5852,8 +5899,8 @@ dbus_connection_list_registered (DBusConnection *connection,
return retval;
}
-static DBusDataSlotAllocator slot_allocator;
-_DBUS_DEFINE_GLOBAL_LOCK (connection_slots);
+static DBusDataSlotAllocator slot_allocator =
+ _DBUS_DATA_SLOT_ALLOCATOR_INIT (_DBUS_LOCK_NAME (connection_slots));
/**
* Allocates an integer ID to be used for storing application-specific
@@ -5873,7 +5920,6 @@ dbus_bool_t
dbus_connection_allocate_data_slot (dbus_int32_t *slot_p)
{
return _dbus_data_slot_allocator_alloc (&slot_allocator,
- &_DBUS_LOCK_NAME (connection_slots),
slot_p);
}
@@ -6044,7 +6090,7 @@ dbus_connection_get_max_message_size (DBusConnection *connection)
* result in disconnecting the connection.
*
* @param connection a #DBusConnection
- * @param size maximum message unix fds the connection can receive
+ * @param n maximum message unix fds the connection can receive
*/
void
dbus_connection_set_max_message_unix_fds (DBusConnection *connection,
@@ -6142,7 +6188,7 @@ dbus_connection_get_max_received_size (DBusConnection *connection)
* The semantics are analogous to those of dbus_connection_set_max_received_size().
*
* @param connection the connection
- * @param size the maximum size in bytes of all outstanding messages
+ * @param n the maximum size in bytes of all outstanding messages
*/
void
dbus_connection_set_max_received_unix_fds (DBusConnection *connection,
@@ -6259,7 +6305,7 @@ dbus_connection_get_outgoing_unix_fds (DBusConnection *connection)
return res;
}
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
/**
* Returns the address of the transport object of this connection
*
diff --git a/dbus/dbus-credentials-util.c b/dbus/dbus-credentials-util.c
index 02771966..d2d164f7 100644
--- a/dbus/dbus-credentials-util.c
+++ b/dbus/dbus-credentials-util.c
@@ -33,14 +33,14 @@
/** @} */
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#include "dbus-test.h"
#include <stdio.h>
#include <string.h>
static DBusCredentials*
make_credentials(dbus_uid_t unix_uid,
- dbus_pid_t unix_pid,
+ dbus_pid_t pid,
const char *windows_sid)
{
DBusCredentials *credentials;
@@ -56,9 +56,9 @@ make_credentials(dbus_uid_t unix_uid,
}
}
- if (unix_pid != DBUS_PID_UNSET)
+ if (pid != DBUS_PID_UNSET)
{
- if (!_dbus_credentials_add_unix_pid (credentials, unix_pid))
+ if (!_dbus_credentials_add_pid (credentials, pid))
{
_dbus_credentials_unref (credentials);
return NULL;
@@ -102,7 +102,7 @@ _dbus_credentials_test (const char *test_data_dir)
_dbus_assert (_dbus_credentials_include (creds, DBUS_CREDENTIAL_WINDOWS_SID));
_dbus_assert (_dbus_credentials_get_unix_uid (creds) == 12);
- _dbus_assert (_dbus_credentials_get_unix_pid (creds) == 511);
+ _dbus_assert (_dbus_credentials_get_pid (creds) == 511);
_dbus_assert (strcmp (_dbus_credentials_get_windows_sid (creds), SAMPLE_SID) == 0);
_dbus_assert (!_dbus_credentials_are_empty (creds));
@@ -118,7 +118,7 @@ _dbus_credentials_test (const char *test_data_dir)
_dbus_assert (_dbus_credentials_include (creds2, DBUS_CREDENTIAL_WINDOWS_SID));
_dbus_assert (_dbus_credentials_get_unix_uid (creds2) == 12);
- _dbus_assert (_dbus_credentials_get_unix_pid (creds2) == 511);
+ _dbus_assert (_dbus_credentials_get_pid (creds2) == 511);
_dbus_assert (strcmp (_dbus_credentials_get_windows_sid (creds2), SAMPLE_SID) == 0);
_dbus_assert (_dbus_credentials_are_superset (creds, creds2));
@@ -192,7 +192,7 @@ _dbus_credentials_test (const char *test_data_dir)
_dbus_assert (!_dbus_credentials_include (creds, DBUS_CREDENTIAL_WINDOWS_SID));
_dbus_assert (_dbus_credentials_get_unix_uid (creds) == DBUS_UID_UNSET);
- _dbus_assert (_dbus_credentials_get_unix_pid (creds) == DBUS_PID_UNSET);
+ _dbus_assert (_dbus_credentials_get_pid (creds) == DBUS_PID_UNSET);
_dbus_assert (_dbus_credentials_get_windows_sid (creds) == NULL);
_dbus_assert (_dbus_credentials_are_empty (creds));
@@ -203,4 +203,4 @@ _dbus_credentials_test (const char *test_data_dir)
return TRUE;
}
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/dbus/dbus-credentials.c b/dbus/dbus-credentials.c
index ff69f3b0..7325125c 100644
--- a/dbus/dbus-credentials.c
+++ b/dbus/dbus-credentials.c
@@ -48,7 +48,7 @@
struct DBusCredentials {
int refcount;
dbus_uid_t unix_uid;
- dbus_pid_t unix_pid;
+ dbus_pid_t pid;
char *windows_sid;
void *adt_audit_data;
dbus_int32_t adt_audit_data_size;
@@ -77,7 +77,7 @@ _dbus_credentials_new (void)
creds->refcount = 1;
creds->unix_uid = DBUS_UID_UNSET;
- creds->unix_pid = DBUS_PID_UNSET;
+ creds->pid = DBUS_PID_UNSET;
creds->windows_sid = NULL;
creds->adt_audit_data = NULL;
creds->adt_audit_data_size = 0;
@@ -146,10 +146,10 @@ _dbus_credentials_unref (DBusCredentials *credentials)
* @returns #FALSE if no memory
*/
dbus_bool_t
-_dbus_credentials_add_unix_pid (DBusCredentials *credentials,
- dbus_pid_t pid)
+_dbus_credentials_add_pid (DBusCredentials *credentials,
+ dbus_pid_t pid)
{
- credentials->unix_pid = pid;
+ credentials->pid = pid;
return TRUE;
}
@@ -231,7 +231,7 @@ _dbus_credentials_include (DBusCredentials *credentials,
switch (type)
{
case DBUS_CREDENTIAL_UNIX_PROCESS_ID:
- return credentials->unix_pid != DBUS_PID_UNSET;
+ return credentials->pid != DBUS_PID_UNSET;
case DBUS_CREDENTIAL_UNIX_USER_ID:
return credentials->unix_uid != DBUS_UID_UNSET;
case DBUS_CREDENTIAL_WINDOWS_SID:
@@ -252,9 +252,9 @@ _dbus_credentials_include (DBusCredentials *credentials,
* @returns UNIX process ID
*/
dbus_pid_t
-_dbus_credentials_get_unix_pid (DBusCredentials *credentials)
+_dbus_credentials_get_pid (DBusCredentials *credentials)
{
- return credentials->unix_pid;
+ return credentials->pid;
}
/**
@@ -322,8 +322,8 @@ _dbus_credentials_are_superset (DBusCredentials *credentials,
DBusCredentials *possible_subset)
{
return
- (possible_subset->unix_pid == DBUS_PID_UNSET ||
- possible_subset->unix_pid == credentials->unix_pid) &&
+ (possible_subset->pid == DBUS_PID_UNSET ||
+ possible_subset->pid == credentials->pid) &&
(possible_subset->unix_uid == DBUS_UID_UNSET ||
possible_subset->unix_uid == credentials->unix_uid) &&
(possible_subset->windows_sid == NULL ||
@@ -345,7 +345,7 @@ dbus_bool_t
_dbus_credentials_are_empty (DBusCredentials *credentials)
{
return
- credentials->unix_pid == DBUS_PID_UNSET &&
+ credentials->pid == DBUS_PID_UNSET &&
credentials->unix_uid == DBUS_UID_UNSET &&
credentials->windows_sid == NULL &&
credentials->adt_audit_data == NULL;
@@ -410,9 +410,9 @@ _dbus_credentials_add_credential (DBusCredentials *credentials,
DBusCredentials *other_credentials)
{
if (which == DBUS_CREDENTIAL_UNIX_PROCESS_ID &&
- other_credentials->unix_pid != DBUS_PID_UNSET)
+ other_credentials->pid != DBUS_PID_UNSET)
{
- if (!_dbus_credentials_add_unix_pid (credentials, other_credentials->unix_pid))
+ if (!_dbus_credentials_add_pid (credentials, other_credentials->pid))
return FALSE;
}
else if (which == DBUS_CREDENTIAL_UNIX_USER_ID &&
@@ -445,7 +445,7 @@ _dbus_credentials_add_credential (DBusCredentials *credentials,
void
_dbus_credentials_clear (DBusCredentials *credentials)
{
- credentials->unix_pid = DBUS_PID_UNSET;
+ credentials->pid = DBUS_PID_UNSET;
credentials->unix_uid = DBUS_UID_UNSET;
dbus_free (credentials->windows_sid);
credentials->windows_sid = NULL;
@@ -523,9 +523,9 @@ _dbus_credentials_to_string_append (DBusCredentials *credentials,
goto oom;
join = TRUE;
}
- if (credentials->unix_pid != DBUS_PID_UNSET)
+ if (credentials->pid != DBUS_PID_UNSET)
{
- if (!_dbus_string_append_printf (string, "%spid=" DBUS_PID_FORMAT, join ? " " : "", credentials->unix_pid))
+ if (!_dbus_string_append_printf (string, "%spid=" DBUS_PID_FORMAT, join ? " " : "", credentials->pid))
goto oom;
join = TRUE;
}
diff --git a/dbus/dbus-credentials.h b/dbus/dbus-credentials.h
index ef6124fd..abcc4bb3 100644
--- a/dbus/dbus-credentials.h
+++ b/dbus/dbus-credentials.h
@@ -41,7 +41,7 @@ DBusCredentials* _dbus_credentials_new_from_current_process (void);
DBusCredentials* _dbus_credentials_new (void);
void _dbus_credentials_ref (DBusCredentials *credentials);
void _dbus_credentials_unref (DBusCredentials *credentials);
-dbus_bool_t _dbus_credentials_add_unix_pid (DBusCredentials *credentials,
+dbus_bool_t _dbus_credentials_add_pid (DBusCredentials *credentials,
dbus_pid_t pid);
dbus_bool_t _dbus_credentials_add_unix_uid (DBusCredentials *credentials,
dbus_uid_t uid);
@@ -52,7 +52,7 @@ dbus_bool_t _dbus_credentials_add_adt_audit_data (DBusCredentials
dbus_int32_t size);
dbus_bool_t _dbus_credentials_include (DBusCredentials *credentials,
DBusCredentialType type);
-dbus_pid_t _dbus_credentials_get_unix_pid (DBusCredentials *credentials);
+dbus_pid_t _dbus_credentials_get_pid (DBusCredentials *credentials);
dbus_uid_t _dbus_credentials_get_unix_uid (DBusCredentials *credentials);
const char* _dbus_credentials_get_windows_sid (DBusCredentials *credentials);
void * _dbus_credentials_get_adt_audit_data (DBusCredentials *credentials);
diff --git a/dbus/dbus-dataslot.c b/dbus/dbus-dataslot.c
index 0369612e..e37c9dd5 100644
--- a/dbus/dbus-dataslot.c
+++ b/dbus/dbus-dataslot.c
@@ -43,13 +43,14 @@
* @param allocator the allocator to initialize
*/
dbus_bool_t
-_dbus_data_slot_allocator_init (DBusDataSlotAllocator *allocator)
+_dbus_data_slot_allocator_init (DBusDataSlotAllocator *allocator,
+ DBusGlobalLock lock)
{
allocator->allocated_slots = NULL;
allocator->n_allocated_slots = 0;
allocator->n_used_slots = 0;
- allocator->lock_loc = NULL;
-
+ allocator->lock = lock;
+
return TRUE;
}
@@ -61,29 +62,17 @@ _dbus_data_slot_allocator_init (DBusDataSlotAllocator *allocator)
* is allocated and stored at *slot_id_p.
*
* @param allocator the allocator
- * @param mutex_loc the location lock for this allocator
* @param slot_id_p address to fill with the slot ID
* @returns #TRUE on success
*/
dbus_bool_t
_dbus_data_slot_allocator_alloc (DBusDataSlotAllocator *allocator,
- DBusRMutex **mutex_loc,
dbus_int32_t *slot_id_p)
{
dbus_int32_t slot;
- _dbus_rmutex_lock (*mutex_loc);
-
- if (allocator->n_allocated_slots == 0)
- {
- _dbus_assert (allocator->lock_loc == NULL);
- allocator->lock_loc = mutex_loc;
- }
- else if (allocator->lock_loc != mutex_loc)
- {
- _dbus_warn_check_failed ("D-Bus threads were initialized after first using the D-Bus library. If your application does not directly initialize threads or use D-Bus, keep in mind that some library or plugin may have used D-Bus or initialized threads behind your back. You can often fix this problem by calling dbus_init_threads() or dbus_g_threads_init() early in your main() method, before D-Bus is used.\n");
- _dbus_assert_not_reached ("exiting");
- }
+ if (!_dbus_lock (allocator->lock))
+ return FALSE;
if (*slot_id_p >= 0)
{
@@ -146,7 +135,7 @@ _dbus_data_slot_allocator_alloc (DBusDataSlotAllocator *allocator,
slot, allocator, allocator->n_allocated_slots, allocator->n_used_slots);
out:
- _dbus_rmutex_unlock (*(allocator->lock_loc));
+ _dbus_unlock (allocator->lock);
return slot >= 0;
}
@@ -165,8 +154,10 @@ void
_dbus_data_slot_allocator_free (DBusDataSlotAllocator *allocator,
dbus_int32_t *slot_id_p)
{
- _dbus_rmutex_lock (*(allocator->lock_loc));
-
+ if (!_dbus_lock (allocator->lock))
+ _dbus_assert_not_reached ("we should have initialized global locks "
+ "before we allocated this slot");
+
_dbus_assert (*slot_id_p < allocator->n_allocated_slots);
_dbus_assert (allocator->allocated_slots[*slot_id_p].slot_id == *slot_id_p);
_dbus_assert (allocator->allocated_slots[*slot_id_p].refcount > 0);
@@ -175,7 +166,7 @@ _dbus_data_slot_allocator_free (DBusDataSlotAllocator *allocator,
if (allocator->allocated_slots[*slot_id_p].refcount > 0)
{
- _dbus_rmutex_unlock (*(allocator->lock_loc));
+ _dbus_unlock (allocator->lock);
return;
}
@@ -190,19 +181,12 @@ _dbus_data_slot_allocator_free (DBusDataSlotAllocator *allocator,
if (allocator->n_used_slots == 0)
{
- DBusRMutex **mutex_loc = allocator->lock_loc;
-
dbus_free (allocator->allocated_slots);
allocator->allocated_slots = NULL;
allocator->n_allocated_slots = 0;
- allocator->lock_loc = NULL;
-
- _dbus_rmutex_unlock (*mutex_loc);
- }
- else
- {
- _dbus_rmutex_unlock (*(allocator->lock_loc));
}
+
+ _dbus_unlock (allocator->lock);
}
/**
@@ -247,10 +231,13 @@ _dbus_data_slot_list_set (DBusDataSlotAllocator *allocator,
* be e.g. realloc()ing allocated_slots. We avoid doing this if asserts
* are disabled, since then the asserts are empty.
*/
- _dbus_rmutex_lock (*(allocator->lock_loc));
+ if (!_dbus_lock (allocator->lock))
+ _dbus_assert_not_reached ("we should have initialized global locks "
+ "before we allocated this slot");
+
_dbus_assert (slot < allocator->n_allocated_slots);
_dbus_assert (allocator->allocated_slots[slot].slot_id == slot);
- _dbus_rmutex_unlock (*(allocator->lock_loc));
+ _dbus_unlock (allocator->lock);
#endif
if (slot >= list->n_slots)
@@ -304,11 +291,14 @@ _dbus_data_slot_list_get (DBusDataSlotAllocator *allocator,
* be e.g. realloc()ing allocated_slots. We avoid doing this if asserts
* are disabled, since then the asserts are empty.
*/
- _dbus_rmutex_lock (*(allocator->lock_loc));
+ if (!_dbus_lock (allocator->lock))
+ _dbus_assert_not_reached ("we should have initialized global locks "
+ "before we allocated this slot");
+
_dbus_assert (slot >= 0);
_dbus_assert (slot < allocator->n_allocated_slots);
_dbus_assert (allocator->allocated_slots[slot].slot_id == slot);
- _dbus_rmutex_unlock (*(allocator->lock_loc));
+ _dbus_unlock (allocator->lock);
#endif
if (slot >= list->n_slots)
@@ -358,7 +348,7 @@ _dbus_data_slot_list_free (DBusDataSlotList *list)
/** @} */
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#include "dbus-test.h"
#include <stdio.h>
@@ -384,17 +374,12 @@ _dbus_data_slot_test (void)
int i;
DBusFreeFunction old_free_func;
void *old_data;
- DBusRMutex *mutex;
-
- if (!_dbus_data_slot_allocator_init (&allocator))
+
+ if (!_dbus_data_slot_allocator_init (&allocator, _DBUS_LOCK_server_slots))
_dbus_assert_not_reached ("no memory for allocator");
_dbus_data_slot_list_init (&list);
- _dbus_rmutex_new_at_location (&mutex);
- if (mutex == NULL)
- _dbus_assert_not_reached ("failed to alloc mutex");
-
#define N_SLOTS 100
i = 0;
@@ -405,8 +390,8 @@ _dbus_data_slot_test (void)
* here.
*/
dbus_int32_t tmp = -1;
-
- _dbus_data_slot_allocator_alloc (&allocator, &mutex, &tmp);
+
+ _dbus_data_slot_allocator_alloc (&allocator, &tmp);
if (tmp != i)
_dbus_assert_not_reached ("did not allocate slots in numeric order\n");
@@ -471,9 +456,7 @@ _dbus_data_slot_test (void)
++i;
}
- _dbus_rmutex_free_at_location (&mutex);
-
return TRUE;
}
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/dbus/dbus-dataslot.h b/dbus/dbus-dataslot.h
index 3d9d5edd..1e04fcbc 100644
--- a/dbus/dbus-dataslot.h
+++ b/dbus/dbus-dataslot.h
@@ -57,9 +57,11 @@ struct DBusDataSlotAllocator
DBusAllocatedSlot *allocated_slots; /**< Allocated slots */
int n_allocated_slots; /**< number of slots malloc'd */
int n_used_slots; /**< number of slots used */
- DBusRMutex **lock_loc; /**< location of thread lock */
+ DBusGlobalLock lock; /**< index of thread lock */
};
+#define _DBUS_DATA_SLOT_ALLOCATOR_INIT(x) { NULL, 0, 0, x }
+
/**
* Data structure that stores the actual user data set at a given
* slot.
@@ -70,9 +72,9 @@ struct DBusDataSlotList
int n_slots; /**< Slots we have storage for in data_slots */
};
-dbus_bool_t _dbus_data_slot_allocator_init (DBusDataSlotAllocator *allocator);
+dbus_bool_t _dbus_data_slot_allocator_init (DBusDataSlotAllocator *allocator,
+ DBusGlobalLock lock);
dbus_bool_t _dbus_data_slot_allocator_alloc (DBusDataSlotAllocator *allocator,
- DBusRMutex **mutex_loc,
int *slot_id_p);
void _dbus_data_slot_allocator_free (DBusDataSlotAllocator *allocator,
int *slot_id_p);
diff --git a/dbus/dbus-errors.c b/dbus/dbus-errors.c
index db3305b9..a0571a50 100644
--- a/dbus/dbus-errors.c
+++ b/dbus/dbus-errors.c
@@ -235,7 +235,7 @@ dbus_error_free (DBusError *error)
* must ensure the name and message are global data that won't be
* freed. You probably want dbus_set_error() instead, in most cases.
*
- * @param error the error.or #NULL
+ * @param error the error or #NULL
* @param name the error name (not copied!!!)
* @param message the error message (not copied!!!)
*/
@@ -379,7 +379,6 @@ dbus_set_error (DBusError *error,
message_from_error (name)))
{
_dbus_string_free (&str);
- va_end (args);
goto nomem;
}
}
diff --git a/dbus/dbus-hash.c b/dbus/dbus-hash.c
index c4c6f935..c80835aa 100644
--- a/dbus/dbus-hash.c
+++ b/dbus/dbus-hash.c
@@ -1401,7 +1401,7 @@ _dbus_hash_table_get_n_entries (DBusHashTable *table)
/** @} */
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#include "dbus-test.h"
#include <stdio.h>
@@ -1828,4 +1828,4 @@ _dbus_hash_test (void)
return ret;
}
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/dbus/dbus-init-win.cpp b/dbus/dbus-init-win.cpp
new file mode 100644
index 00000000..687f248c
--- /dev/null
+++ b/dbus/dbus-init-win.cpp
@@ -0,0 +1,52 @@
+/*
+ * dbus-init-win.cpp - once-per-process initialization
+ *
+ * Copyright © 2013 Intel Corporation
+ *
+ * Licensed under the Academic Free License version 2.1
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include <config.h>
+
+extern "C"
+{
+#include "dbus-sysdeps-win.h"
+}
+
+class DBusInternalInit
+ {
+ public:
+ DBusInternalInit ()
+ {
+ _dbus_threads_windows_init_global ();
+ }
+
+ void must_not_be_omitted ()
+ {
+ }
+ };
+
+static DBusInternalInit init;
+
+extern "C" void
+_dbus_threads_windows_ensure_ctor_linked ()
+{
+ /* Do nothing significant, just ensure that the global initializer gets
+ * linked in. */
+ init.must_not_be_omitted ();
+}
diff --git a/dbus/dbus-internals.c b/dbus/dbus-internals.c
index 0e5d807e..575a0875 100644
--- a/dbus/dbus-internals.c
+++ b/dbus/dbus-internals.c
@@ -163,26 +163,11 @@
*/
/**
- * @def _DBUS_DEFINE_GLOBAL_LOCK
- *
- * Defines a global lock variable with the given name.
- * The lock must be added to the list to initialize
- * in dbus_threads_init().
- */
-
-/**
- * @def _DBUS_DECLARE_GLOBAL_LOCK
- *
- * Expands to declaration of a global lock defined
- * with _DBUS_DEFINE_GLOBAL_LOCK.
- * The lock must be added to the list to initialize
- * in dbus_threads_init().
- */
-
-/**
* @def _DBUS_LOCK
*
- * Locks a global lock
+ * Locks a global lock, initializing it first if necessary.
+ *
+ * @returns #FALSE if not enough memory
*/
/**
@@ -347,25 +332,22 @@ _dbus_verbose_init (void)
*/
static char *_dbus_file_path_extract_elements_from_tail(const char *file,int level)
{
- static int prefix = -1;
+ int prefix = 0;
+ char *p = (char *)file + strlen(file);
+ int i = 0;
- if (prefix == -1)
+ for (;p >= file;p--)
{
- char *p = (char *)file + strlen(file);
- int i = 0;
- prefix = 0;
- for (;p >= file;p--)
+ if (DBUS_IS_DIR_SEPARATOR(*p))
{
- if (DBUS_IS_DIR_SEPARATOR(*p))
+ if (++i >= level)
{
- if (++i >= level)
- {
- prefix = p-file+1;
- break;
- }
- }
- }
+ prefix = p-file+1;
+ break;
+ }
+ }
}
+
return (char *)file+prefix;
}
@@ -763,10 +745,18 @@ _dbus_read_uuid_file_without_creating (const DBusString *filename,
return FALSE;
}
-static dbus_bool_t
-_dbus_create_uuid_file_exclusively (const DBusString *filename,
- DBusGUID *uuid,
- DBusError *error)
+/**
+ * Write the give UUID to a file.
+ *
+ * @param filename the file to write
+ * @param uuid the UUID to save
+ * @param error used to raise an error
+ * @returns #FALSE on error
+ */
+dbus_bool_t
+_dbus_write_uuid_file (const DBusString *filename,
+ const DBusGUID *uuid,
+ DBusError *error)
{
DBusString encoded;
@@ -775,8 +765,6 @@ _dbus_create_uuid_file_exclusively (const DBusString *filename,
_DBUS_SET_OOM (error);
return FALSE;
}
-
- _dbus_generate_uuid (uuid);
if (!_dbus_uuid_encode (uuid, &encoded))
{
@@ -843,11 +831,12 @@ _dbus_read_uuid_file (const DBusString *filename,
else
{
dbus_error_free (&read_error);
- return _dbus_create_uuid_file_exclusively (filename, uuid, error);
+ _dbus_generate_uuid (uuid);
+ return _dbus_write_uuid_file (filename, uuid, error);
}
}
-_DBUS_DEFINE_GLOBAL_LOCK (machine_uuid);
+/* Protected by _DBUS_LOCK (machine_uuid) */
static int machine_uuid_initialized_generation = 0;
static DBusGUID machine_uuid;
@@ -866,7 +855,9 @@ _dbus_get_local_machine_uuid_encoded (DBusString *uuid_str)
{
dbus_bool_t ok;
- _DBUS_LOCK (machine_uuid);
+ if (!_DBUS_LOCK (machine_uuid))
+ return FALSE;
+
if (machine_uuid_initialized_generation != _dbus_current_generation)
{
DBusError error = DBUS_ERROR_INIT;
@@ -874,7 +865,7 @@ _dbus_get_local_machine_uuid_encoded (DBusString *uuid_str)
if (!_dbus_read_local_machine_uuid (&machine_uuid, FALSE,
&error))
{
-#ifndef DBUS_BUILD_TESTS
+#ifndef DBUS_ENABLE_EMBEDDED_TESTS
/* For the test suite, we may not be installed so just continue silently
* here. But in a production build, we want to be nice and loud about
* this.
@@ -953,7 +944,7 @@ _dbus_real_assert_not_reached (const char *explanation,
}
#endif /* DBUS_DISABLE_ASSERT */
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
static dbus_bool_t
run_failing_each_malloc (int n_mallocs,
const char *description,
@@ -1048,6 +1039,6 @@ _dbus_test_oom_handling (const char *description,
return TRUE;
}
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
/** @} */
diff --git a/dbus/dbus-internals.h b/dbus/dbus-internals.h
index 8036a2ba..4658b67b 100644
--- a/dbus/dbus-internals.h
+++ b/dbus/dbus-internals.h
@@ -35,10 +35,6 @@
DBUS_BEGIN_DECLS
-#ifndef DBUS_SESSION_BUS_DEFAULT_ADDRESS
-#define DBUS_SESSION_BUS_DEFAULT_ADDRESS "autolaunch:"
-#endif
-
void _dbus_warn (const char *format,
...) _DBUS_GNUC_PRINTF (1, 2);
@@ -234,10 +230,8 @@ char** _dbus_dup_string_array (const char **array);
#define _DBUS_INT_MIN _DBUS_INT32_MIN
#define _DBUS_INT_MAX _DBUS_INT32_MAX
#define _DBUS_UINT_MAX _DBUS_UINT32_MAX
-#ifdef DBUS_HAVE_INT64
#define _DBUS_INT64_MAX DBUS_INT64_CONSTANT (0x7fffffffffffffff)
#define _DBUS_UINT64_MAX DBUS_UINT64_CONSTANT (0xffffffffffffffff)
-#endif
#define _DBUS_ONE_KILOBYTE 1024
#define _DBUS_ONE_MEGABYTE 1024 * _DBUS_ONE_KILOBYTE
#define _DBUS_ONE_HOUR_IN_MILLISECONDS (1000 * 60 * 60)
@@ -270,7 +264,7 @@ void _dbus_verbose_bytes_of_string (const DBusString *str,
extern const char *_dbus_no_memory_message;
#define _DBUS_SET_OOM(error) dbus_set_error_const ((error), DBUS_ERROR_NO_MEMORY, _dbus_no_memory_message)
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
/* Memory debugging */
void _dbus_set_fail_alloc_counter (int until_next_fail);
int _dbus_get_fail_alloc_counter (void);
@@ -294,45 +288,46 @@ dbus_bool_t _dbus_test_oom_handling (const char *description,
#define _dbus_decrement_fail_alloc_counter() (FALSE)
#define _dbus_disable_mem_pools() (FALSE)
#define _dbus_get_malloc_blocks_outstanding (0)
-#endif /* !DBUS_BUILD_TESTS */
+#endif /* !DBUS_ENABLE_EMBEDDED_TESTS */
typedef void (* DBusShutdownFunction) (void *data);
-dbus_bool_t _dbus_register_shutdown_func (DBusShutdownFunction function,
- void *data);
+dbus_bool_t _dbus_register_shutdown_func (DBusShutdownFunction function,
+ void *data);
+dbus_bool_t _dbus_register_shutdown_func_unlocked (DBusShutdownFunction function,
+ void *data);
extern int _dbus_current_generation;
-/* Thread initializers */
-#define _DBUS_LOCK_NAME(name) _dbus_lock_##name
-#define _DBUS_DECLARE_GLOBAL_LOCK(name) extern DBusRMutex *_dbus_lock_##name
-#define _DBUS_DEFINE_GLOBAL_LOCK(name) DBusRMutex *_dbus_lock_##name
-#define _DBUS_LOCK(name) _dbus_rmutex_lock (_dbus_lock_##name)
-#define _DBUS_UNLOCK(name) _dbus_rmutex_unlock (_dbus_lock_##name)
-
-/* 1-5 */
-_DBUS_DECLARE_GLOBAL_LOCK (list);
-_DBUS_DECLARE_GLOBAL_LOCK (connection_slots);
-_DBUS_DECLARE_GLOBAL_LOCK (pending_call_slots);
-_DBUS_DECLARE_GLOBAL_LOCK (server_slots);
-_DBUS_DECLARE_GLOBAL_LOCK (message_slots);
-/* 5-10 */
-_DBUS_DECLARE_GLOBAL_LOCK (bus);
-_DBUS_DECLARE_GLOBAL_LOCK (bus_datas);
-_DBUS_DECLARE_GLOBAL_LOCK (shutdown_funcs);
-_DBUS_DECLARE_GLOBAL_LOCK (system_users);
-_DBUS_DECLARE_GLOBAL_LOCK (message_cache);
-/* 10-14 */
-_DBUS_DECLARE_GLOBAL_LOCK (shared_connections);
-_DBUS_DECLARE_GLOBAL_LOCK (win_fds);
-_DBUS_DECLARE_GLOBAL_LOCK (sid_atom_cache);
-_DBUS_DECLARE_GLOBAL_LOCK (machine_uuid);
-
-#if !DBUS_USE_SYNC
-_DBUS_DECLARE_GLOBAL_LOCK (atomic);
-#define _DBUS_N_GLOBAL_LOCKS (15)
-#else
-#define _DBUS_N_GLOBAL_LOCKS (14)
-#endif
+/* The weird case convention is to avoid having to change all the callers,
+ * which would be quite a mega-patch. */
+typedef enum
+{
+ /* index 0-4 */
+ _DBUS_LOCK_list,
+ _DBUS_LOCK_connection_slots,
+ _DBUS_LOCK_pending_call_slots,
+ _DBUS_LOCK_server_slots,
+ _DBUS_LOCK_message_slots,
+ /* index 5-9 */
+ _DBUS_LOCK_bus,
+ _DBUS_LOCK_bus_datas,
+ _DBUS_LOCK_shutdown_funcs,
+ _DBUS_LOCK_system_users,
+ _DBUS_LOCK_message_cache,
+ /* index 10-12 */
+ _DBUS_LOCK_shared_connections,
+ _DBUS_LOCK_machine_uuid,
+ _DBUS_LOCK_sysdeps,
+
+ _DBUS_N_GLOBAL_LOCKS
+} DBusGlobalLock;
+
+dbus_bool_t _dbus_lock (DBusGlobalLock lock) _DBUS_GNUC_WARN_UNUSED_RESULT;
+void _dbus_unlock (DBusGlobalLock lock);
+
+#define _DBUS_LOCK_NAME(name) _DBUS_LOCK_##name
+#define _DBUS_LOCK(name) _dbus_lock (_DBUS_LOCK_##name)
+#define _DBUS_UNLOCK(name) _dbus_unlock (_DBUS_LOCK_##name)
dbus_bool_t _dbus_threads_init_debug (void);
@@ -366,13 +361,17 @@ dbus_bool_t _dbus_read_uuid_file (const DBusString *filename,
dbus_bool_t create_if_not_found,
DBusError *error);
+dbus_bool_t _dbus_write_uuid_file (const DBusString *filename,
+ const DBusGUID *uuid,
+ DBusError *error);
+
dbus_bool_t _dbus_get_local_machine_uuid_encoded (DBusString *uuid_str);
#define _DBUS_PASTE2(a, b) a ## b
#define _DBUS_PASTE(a, b) _DBUS_PASTE2 (a, b)
#define _DBUS_STATIC_ASSERT(expr) \
typedef struct { char _assertion[(expr) ? 1 : -1]; } \
- _DBUS_PASTE (_DBUS_STATIC_ASSERT_, __LINE__)
+ _DBUS_PASTE (_DBUS_STATIC_ASSERT_, __LINE__) _DBUS_GNUC_UNUSED
DBUS_END_DECLS
diff --git a/dbus/dbus-keyring.c b/dbus/dbus-keyring.c
index 3b9ce315..f0c64de3 100644
--- a/dbus/dbus-keyring.c
+++ b/dbus/dbus-keyring.c
@@ -80,7 +80,7 @@
* Maximum number of keys in the keyring before
* we just ignore the rest
*/
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#define MAX_KEYS_IN_FILE 10
#else
#define MAX_KEYS_IN_FILE 256
@@ -697,10 +697,10 @@ _dbus_keyring_unref (DBusKeyring *keyring)
/**
* Creates a new keyring that lives in the ~/.dbus-keyrings directory
- * of the given user credentials. If the credentials are #NULL or
- * empty, uses those of the current process.
+ * of the user represented by @p credentials. If the @p credentials are
+ * #NULL or empty, uses those of the current process.
*
- * @param username username to get keyring for, or #NULL
+ * @param credentials a set of credentials representing a user or #NULL
* @param context which keyring to get
* @param error return location for errors
* @returns the keyring or #NULL on error
@@ -1023,7 +1023,7 @@ _dbus_keyring_get_hex_key (DBusKeyring *keyring,
/** @} */ /* end of exposed API */
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#include "dbus-test.h"
#include <stdio.h>
@@ -1156,5 +1156,5 @@ _dbus_keyring_test (void)
return FALSE;
}
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/dbus/dbus-list.c b/dbus/dbus-list.c
index 7e11cc8d..c4c1856f 100644
--- a/dbus/dbus-list.c
+++ b/dbus/dbus-list.c
@@ -35,8 +35,8 @@
* Types and functions related to DBusList.
*/
+/* Protected by _DBUS_LOCK (list) */
static DBusMemPool *list_pool;
-_DBUS_DEFINE_GLOBAL_LOCK (list);
/**
* @defgroup DBusListInternals Linked list implementation details
@@ -56,7 +56,8 @@ alloc_link (void *data)
{
DBusList *link;
- _DBUS_LOCK (list);
+ if (!_DBUS_LOCK (list))
+ return FALSE;
if (list_pool == NULL)
{
@@ -93,7 +94,10 @@ alloc_link (void *data)
static void
free_link (DBusList *link)
{
- _DBUS_LOCK (list);
+ if (!_DBUS_LOCK (list))
+ _dbus_assert_not_reached ("we should have initialized global locks "
+ "before we allocated a linked-list link");
+
if (_dbus_mem_pool_dealloc (list_pool, link))
{
_dbus_mem_pool_free (list_pool);
@@ -152,7 +156,14 @@ _dbus_list_get_stats (dbus_uint32_t *in_use_p,
dbus_uint32_t *in_free_list_p,
dbus_uint32_t *allocated_p)
{
- _DBUS_LOCK (list);
+ if (!_DBUS_LOCK (list))
+ {
+ *in_use_p = 0;
+ *in_free_list_p = 0;
+ *allocated_p = 0;
+ return;
+ }
+
_dbus_mem_pool_get_stats (list_pool, in_use_p, in_free_list_p, allocated_p);
_DBUS_UNLOCK (list);
}
@@ -777,7 +788,7 @@ _dbus_list_length_is_one (DBusList **list)
/** @} */
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#include "dbus-test.h"
#include <stdio.h>
diff --git a/dbus/dbus-macros.h b/dbus/dbus-macros.h
index dcd3eebd..8d6c3000 100644
--- a/dbus/dbus-macros.h
+++ b/dbus/dbus-macros.h
@@ -69,9 +69,12 @@
__attribute__((__format__ (__printf__, format_idx, arg_idx)))
#define _DBUS_GNUC_NORETURN \
__attribute__((__noreturn__))
+#define _DBUS_GNUC_UNUSED \
+ __attribute__((__unused__))
#else /* !__GNUC__ */
#define _DBUS_GNUC_PRINTF( format_idx, arg_idx )
#define _DBUS_GNUC_NORETURN
+#define _DBUS_GNUC_UNUSED
#endif /* !__GNUC__ */
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
@@ -88,13 +91,21 @@
#define DBUS_ALLOC_SIZE2(x,y)
#endif
+#if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#define _DBUS_GNUC_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
+#else
+#define _DBUS_GNUC_WARN_UNUSED_RESULT
+#endif
+
/** @def _DBUS_GNUC_PRINTF
* used to tell gcc about printf format strings
*/
/** @def _DBUS_GNUC_NORETURN
* used to tell gcc about functions that never return, such as _dbus_abort()
*/
-
+/** @def _DBUS_GNUC_WARN_UNUSED_RESULT
+ * used to tell gcc about functions whose result must be used
+ */
/* Normally docs are in .c files, but there isn't a .c file for this. */
/**
diff --git a/dbus/dbus-mainloop.c b/dbus/dbus-mainloop.c
index cef676a3..7ff9dc2c 100644
--- a/dbus/dbus-mainloop.c
+++ b/dbus/dbus-mainloop.c
@@ -34,27 +34,6 @@
#define MAINLOOP_SPEW 0
-#if MAINLOOP_SPEW
-#ifdef DBUS_ENABLE_VERBOSE_MODE
-static const char*
-watch_flags_to_string (int flags)
-{
- const char *watch_type;
-
- if ((flags & DBUS_WATCH_READABLE) &&
- (flags & DBUS_WATCH_WRITABLE))
- watch_type = "readwrite";
- else if (flags & DBUS_WATCH_READABLE)
- watch_type = "read";
- else if (flags & DBUS_WATCH_WRITABLE)
- watch_type = "write";
- else
- watch_type = "not read or write";
- return watch_type;
-}
-#endif /* DBUS_ENABLE_VERBOSE_MODE */
-#endif /* MAINLOOP_SPEW */
-
struct DBusLoop
{
int refcount;
@@ -675,7 +654,7 @@ _dbus_loop_iterate (DBusLoop *loop,
timeout = MIN (timeout, _dbus_get_oom_wait ());
#if MAINLOOP_SPEW
- _dbus_verbose (" polling on %d descriptors timeout %ld\n", n_fds, timeout);
+ _dbus_verbose (" polling on %d descriptors timeout %ld\n", _DBUS_N_ELEMENTS (ready_fds), timeout);
#endif
n_ready = _dbus_socket_set_poll (loop->socket_set, ready_fds,
@@ -922,7 +901,7 @@ _dbus_loop_quit (DBusLoop *loop)
int
_dbus_get_oom_wait (void)
{
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
/* make tests go fast */
return 0;
#else
diff --git a/dbus/dbus-marshal-basic.c b/dbus/dbus-marshal-basic.c
index 88b19f36..eafc2a9a 100644
--- a/dbus/dbus-marshal-basic.c
+++ b/dbus/dbus-marshal-basic.c
@@ -58,12 +58,10 @@ _DBUS_ASSERT_ALIGNMENT (dbus_bool_t, <=, 4);
_DBUS_STATIC_ASSERT (sizeof (double) == 8);
_DBUS_ASSERT_ALIGNMENT (double, <=, 8);
-#ifdef DBUS_HAVE_INT64
_DBUS_STATIC_ASSERT (sizeof (dbus_int64_t) == 8);
_DBUS_ASSERT_ALIGNMENT (dbus_int64_t, <=, 8);
_DBUS_STATIC_ASSERT (sizeof (dbus_uint64_t) == 8);
_DBUS_ASSERT_ALIGNMENT (dbus_uint64_t, <=, 8);
-#endif
_DBUS_STATIC_ASSERT (sizeof (DBusBasicValue) >= 8);
/* The alignment of a DBusBasicValue might conceivably be > 8 because of the
@@ -120,15 +118,10 @@ pack_8_octets (DBusBasicValue value,
{
_dbus_assert (_DBUS_ALIGN_ADDRESS (data, 8) == data);
-#ifdef DBUS_HAVE_INT64
if ((byte_order) == DBUS_LITTLE_ENDIAN)
*((dbus_uint64_t*)(data)) = DBUS_UINT64_TO_LE (value.u64);
else
*((dbus_uint64_t*)(data)) = DBUS_UINT64_TO_BE (value.u64);
-#else
- *(DBus8ByteStruct*)data = value.eight;
- swap_8_octets ((DBusBasicValue*)data, byte_order);
-#endif
}
/**
@@ -146,65 +139,16 @@ _dbus_pack_uint32 (dbus_uint32_t value,
pack_4_octets (value, byte_order, data);
}
-#ifndef DBUS_HAVE_INT64
-/* from ORBit */
-static void
-swap_bytes (unsigned char *data,
- unsigned int len)
-{
- unsigned char *p1 = data;
- unsigned char *p2 = data + len - 1;
-
- while (p1 < p2)
- {
- unsigned char tmp = *p1;
- *p1 = *p2;
- *p2 = tmp;
-
- --p2;
- ++p1;
- }
-}
-#endif /* !DBUS_HAVE_INT64 */
-
static void
swap_8_octets (DBusBasicValue *value,
int byte_order)
{
if (byte_order != DBUS_COMPILER_BYTE_ORDER)
{
-#ifdef DBUS_HAVE_INT64
value->u64 = DBUS_UINT64_SWAP_LE_BE (value->u64);
-#else
- swap_bytes (&value->bytes, 8);
-#endif
}
}
-#if 0
-static DBusBasicValue
-unpack_8_octets (int byte_order,
- const unsigned char *data)
-{
- DBusBasicValue r;
-
- _dbus_assert (_DBUS_ALIGN_ADDRESS (data, 8) == data);
- _dbus_assert (sizeof (r) == 8);
-
-#ifdef DBUS_HAVE_INT64
- if (byte_order == DBUS_LITTLE_ENDIAN)
- r.u64 = DBUS_UINT64_FROM_LE (*(dbus_uint64_t*)data);
- else
- r.u64 = DBUS_UINT64_FROM_BE (*(dbus_uint64_t*)data);
-#else
- r.eight = *(DBus8ByteStruct*)data;
- swap_8_octets (&r, byte_order);
-#endif
-
- return r;
-}
-#endif
-
#ifndef _dbus_unpack_uint16
/**
* Unpacks a 16 bit unsigned integer from a data pointer
@@ -601,15 +545,10 @@ _dbus_marshal_read_basic (const DBusString *str,
{
volatile dbus_uint64_t *vp = value;
pos = _DBUS_ALIGN_VALUE (pos, 8);
-#ifdef DBUS_HAVE_INT64
if (byte_order != DBUS_COMPILER_BYTE_ORDER)
*vp = DBUS_UINT64_SWAP_LE_BE (*(dbus_uint64_t*)(str_data + pos));
else
*vp = *(dbus_uint64_t*)(str_data + pos);
-#else
- *vp = *(DBus8ByteStruct*) (str_data + pos);
- swap_8_octets (vp, byte_order);
-#endif
pos += 8;
}
break;
@@ -965,11 +904,7 @@ _dbus_swap_array (unsigned char *data,
{
while (d != end)
{
-#ifdef DBUS_HAVE_INT64
*((dbus_uint64_t*)d) = DBUS_UINT64_SWAP_LE_BE (*((dbus_uint64_t*)d));
-#else
- swap_8_bytes ((DBusBasicValue*) d);
-#endif
d += 8;
}
}
@@ -1501,7 +1436,7 @@ _dbus_first_type_in_signature_c_str (const char *str,
/** @} */
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#include "dbus-test.h"
#include <stdio.h>
@@ -1674,12 +1609,10 @@ _dbus_marshal_test (void)
unsigned char array1[5] = { 3, 4, 0, 1, 9 };
dbus_int16_t array2[3] = { 124, 457, 780 };
dbus_int32_t array4[3] = { 123, 456, 789 };
-#ifdef DBUS_HAVE_INT64
dbus_int64_t array8[3] = { DBUS_INT64_CONSTANT (0x123ffffffff),
DBUS_INT64_CONSTANT (0x456ffffffff),
DBUS_INT64_CONSTANT (0x789ffffffff) };
dbus_int64_t *v_ARRAY_INT64;
-#endif
unsigned char *v_ARRAY_BYTE;
dbus_int16_t *v_ARRAY_INT16;
dbus_uint16_t *v_ARRAY_UINT16;
@@ -1735,7 +1668,6 @@ _dbus_marshal_test (void)
MARSHAL_TEST (UINT32, DBUS_BIG_ENDIAN, 0x12345678);
MARSHAL_TEST (UINT32, DBUS_LITTLE_ENDIAN, 0x12345678);
-#ifdef DBUS_HAVE_INT64
/* Marshal signed integers */
MARSHAL_TEST (INT64, DBUS_BIG_ENDIAN, DBUS_INT64_CONSTANT (-0x123456789abc7));
MARSHAL_TEST (INT64, DBUS_LITTLE_ENDIAN, DBUS_INT64_CONSTANT (-0x123456789abc7));
@@ -1743,7 +1675,6 @@ _dbus_marshal_test (void)
/* Marshal unsigned integers */
MARSHAL_TEST (UINT64, DBUS_BIG_ENDIAN, DBUS_UINT64_CONSTANT (0x123456789abc7));
MARSHAL_TEST (UINT64, DBUS_LITTLE_ENDIAN, DBUS_UINT64_CONSTANT (0x123456789abc7));
-#endif /* DBUS_HAVE_INT64 */
/* Marshal byte */
MARSHAL_TEST (BYTE, DBUS_BIG_ENDIAN, 5);
@@ -1785,10 +1716,8 @@ _dbus_marshal_test (void)
MARSHAL_TEST_FIXED_ARRAY (BYTE, DBUS_BIG_ENDIAN, array1);
MARSHAL_TEST_FIXED_ARRAY (BYTE, DBUS_LITTLE_ENDIAN, array1);
-#ifdef DBUS_HAVE_INT64
MARSHAL_TEST_FIXED_ARRAY (INT64, DBUS_BIG_ENDIAN, array8);
MARSHAL_TEST_FIXED_ARRAY (INT64, DBUS_LITTLE_ENDIAN, array8);
-#endif
#if 0
@@ -1796,7 +1725,6 @@ _dbus_marshal_test (void)
* FIXME restore the set/pack tests
*/
-#ifdef DBUS_HAVE_INT64
/* set/pack 64-bit integers */
_dbus_string_set_length (&str, 8);
@@ -1867,7 +1795,6 @@ _dbus_marshal_test (void)
_dbus_assert (DBUS_UINT64_CONSTANT (0x123456789abc7) ==
_dbus_unpack_uint64 (DBUS_BIG_ENDIAN,
_dbus_string_get_const_data (&str)));
-#endif /* DBUS_HAVE_INT64 */
/* set/pack 32-bit integers */
_dbus_string_set_length (&str, 4);
@@ -1992,4 +1919,4 @@ _dbus_marshal_test (void)
return TRUE;
}
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/dbus/dbus-marshal-basic.h b/dbus/dbus-marshal-basic.h
index 034fdaba..9df67cb8 100644
--- a/dbus/dbus-marshal-basic.h
+++ b/dbus/dbus-marshal-basic.h
@@ -57,8 +57,6 @@
#endif /* HAVE_BYTESWAP_H */
-#ifdef DBUS_HAVE_INT64
-
#ifdef HAVE_BYTESWAP_H
#define DBUS_UINT64_SWAP_LE_BE_CONSTANT(val) bswap_64(val)
#else /* HAVE_BYTESWAP_H */
@@ -80,7 +78,6 @@
(dbus_uint64_t) DBUS_UINT64_CONSTANT (0x00ff000000000000)) >> 40) | \
(((dbus_uint64_t) (val) & \
(dbus_uint64_t) DBUS_UINT64_CONSTANT (0xff00000000000000)) >> 56)))
-#endif /* DBUS_HAVE_INT64 */
#endif /* HAVE_BYTESWAP_H */
@@ -90,10 +87,8 @@
#define DBUS_UINT32_SWAP_LE_BE(val) (DBUS_UINT32_SWAP_LE_BE_CONSTANT (val))
#define DBUS_INT32_SWAP_LE_BE(val) ((dbus_int32_t)DBUS_UINT32_SWAP_LE_BE_CONSTANT (val))
-#ifdef DBUS_HAVE_INT64
-# define DBUS_UINT64_SWAP_LE_BE(val) (DBUS_UINT64_SWAP_LE_BE_CONSTANT (val))
-# define DBUS_INT64_SWAP_LE_BE(val) ((dbus_int64_t)DBUS_UINT64_SWAP_LE_BE_CONSTANT (val))
-#endif /* DBUS_HAVE_INT64 */
+#define DBUS_UINT64_SWAP_LE_BE(val) (DBUS_UINT64_SWAP_LE_BE_CONSTANT (val))
+#define DBUS_INT64_SWAP_LE_BE(val) ((dbus_int64_t)DBUS_UINT64_SWAP_LE_BE_CONSTANT (val))
#ifdef WORDS_BIGENDIAN
@@ -105,12 +100,10 @@
# define DBUS_UINT32_TO_BE(val) ((dbus_uint32_t) (val))
# define DBUS_INT32_TO_LE(val) (DBUS_INT32_SWAP_LE_BE (val))
# define DBUS_UINT32_TO_LE(val) (DBUS_UINT32_SWAP_LE_BE (val))
-# ifdef DBUS_HAVE_INT64
-# define DBUS_INT64_TO_BE(val) ((dbus_int64_t) (val))
-# define DBUS_UINT64_TO_BE(val) ((dbus_uint64_t) (val))
-# define DBUS_INT64_TO_LE(val) (DBUS_INT64_SWAP_LE_BE (val))
-# define DBUS_UINT64_TO_LE(val) (DBUS_UINT64_SWAP_LE_BE (val))
-# endif /* DBUS_HAVE_INT64 */
+# define DBUS_INT64_TO_BE(val) ((dbus_int64_t) (val))
+# define DBUS_UINT64_TO_BE(val) ((dbus_uint64_t) (val))
+# define DBUS_INT64_TO_LE(val) (DBUS_INT64_SWAP_LE_BE (val))
+# define DBUS_UINT64_TO_LE(val) (DBUS_UINT64_SWAP_LE_BE (val))
#else /* WORDS_BIGENDIAN */
@@ -122,12 +115,10 @@
# define DBUS_UINT32_TO_LE(val) ((dbus_uint32_t) (val))
# define DBUS_INT32_TO_BE(val) ((dbus_int32_t) DBUS_UINT32_SWAP_LE_BE (val))
# define DBUS_UINT32_TO_BE(val) (DBUS_UINT32_SWAP_LE_BE (val))
-# ifdef DBUS_HAVE_INT64
-# define DBUS_INT64_TO_LE(val) ((dbus_int64_t) (val))
-# define DBUS_UINT64_TO_LE(val) ((dbus_uint64_t) (val))
-# define DBUS_INT64_TO_BE(val) ((dbus_int64_t) DBUS_UINT64_SWAP_LE_BE (val))
-# define DBUS_UINT64_TO_BE(val) (DBUS_UINT64_SWAP_LE_BE (val))
-# endif /* DBUS_HAVE_INT64 */
+# define DBUS_INT64_TO_LE(val) ((dbus_int64_t) (val))
+# define DBUS_UINT64_TO_LE(val) ((dbus_uint64_t) (val))
+# define DBUS_INT64_TO_BE(val) ((dbus_int64_t) DBUS_UINT64_SWAP_LE_BE (val))
+# define DBUS_UINT64_TO_BE(val) (DBUS_UINT64_SWAP_LE_BE (val))
#endif
/* The transformation is symmetric, so the FROM just maps to the TO. */
@@ -139,12 +130,10 @@
#define DBUS_UINT32_FROM_LE(val) (DBUS_UINT32_TO_LE (val))
#define DBUS_INT32_FROM_BE(val) (DBUS_INT32_TO_BE (val))
#define DBUS_UINT32_FROM_BE(val) (DBUS_UINT32_TO_BE (val))
-#ifdef DBUS_HAVE_INT64
-# define DBUS_INT64_FROM_LE(val) (DBUS_INT64_TO_LE (val))
-# define DBUS_UINT64_FROM_LE(val) (DBUS_UINT64_TO_LE (val))
-# define DBUS_INT64_FROM_BE(val) (DBUS_INT64_TO_BE (val))
-# define DBUS_UINT64_FROM_BE(val) (DBUS_UINT64_TO_BE (val))
-#endif /* DBUS_HAVE_INT64 */
+#define DBUS_INT64_FROM_LE(val) (DBUS_INT64_TO_LE (val))
+#define DBUS_UINT64_FROM_LE(val) (DBUS_UINT64_TO_LE (val))
+#define DBUS_INT64_FROM_BE(val) (DBUS_INT64_TO_BE (val))
+#define DBUS_UINT64_FROM_BE(val) (DBUS_UINT64_TO_BE (val))
#ifdef DBUS_DISABLE_ASSERT
#define _dbus_unpack_uint16(byte_order, data) \
diff --git a/dbus/dbus-marshal-byteswap-util.c b/dbus/dbus-marshal-byteswap-util.c
index edb74cad..57874859 100644
--- a/dbus/dbus-marshal-byteswap-util.c
+++ b/dbus/dbus-marshal-byteswap-util.c
@@ -23,7 +23,7 @@
#include <config.h>
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#include "dbus-marshal-byteswap.h"
#include "dbus-test.h"
#include <stdio.h>
@@ -102,4 +102,4 @@ _dbus_marshal_byteswap_test (void)
return TRUE;
}
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/dbus/dbus-marshal-byteswap.c b/dbus/dbus-marshal-byteswap.c
index 22d7e22b..e6711be6 100644
--- a/dbus/dbus-marshal-byteswap.c
+++ b/dbus/dbus-marshal-byteswap.c
@@ -73,11 +73,7 @@ byteswap_body_helper (DBusTypeReader *reader,
case DBUS_TYPE_DOUBLE:
{
p = _DBUS_ALIGN_ADDRESS (p, 8);
-#ifdef DBUS_HAVE_INT64
*((dbus_uint64_t*)p) = DBUS_UINT64_SWAP_LE_BE (*((dbus_uint64_t*)p));
-#else
- _dbus_swap_array (p, 1, 8);
-#endif
p += 8;
}
break;
diff --git a/dbus/dbus-marshal-header.c b/dbus/dbus-marshal-header.c
index 88887a82..48151c62 100644
--- a/dbus/dbus-marshal-header.c
+++ b/dbus/dbus-marshal-header.c
@@ -276,6 +276,7 @@ _dbus_header_cache_known_nonexistent (DBusHeader *header,
* Writes a struct of { byte, variant } with the given basic type.
*
* @param writer the writer (should be ready to write a struct)
+ * @param field the header field
* @param type the type of the value
* @param value the value as for _dbus_marshal_set_basic()
* @returns #FALSE if no memory
@@ -336,6 +337,7 @@ write_basic_field (DBusTypeWriter *writer,
* Sets a struct of { byte, variant } with the given basic type.
*
* @param reader the reader (should be iterating over the array pointing at the field to set)
+ * @param field the header field
* @param type the type of the value
* @param value the value as for _dbus_marshal_set_basic()
* @param realign_root where to realign from
@@ -452,7 +454,6 @@ _dbus_header_reinit (DBusHeader *header)
* to make the header valid, you have to call _dbus_header_create().
*
* @param header header to initialize
- * @param byte_order byte order of the header
* @returns #FALSE if not enough memory
*/
dbus_bool_t
@@ -514,6 +515,7 @@ _dbus_header_copy (const DBusHeader *header,
* sense, and passing them in will trigger an assertion failure.
*
* @param header the header
+ * @param byte_order byte order of the header
* @param message_type the message type
* @param destination destination field or #NULL
* @param path path field or #NULL
diff --git a/dbus/dbus-marshal-recursive-util.c b/dbus/dbus-marshal-recursive-util.c
index 95124140..0e2b4201 100644
--- a/dbus/dbus-marshal-recursive-util.c
+++ b/dbus/dbus-marshal-recursive-util.c
@@ -23,7 +23,7 @@
#include <config.h>
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#include "dbus-marshal-recursive.h"
#include "dbus-marshal-basic.h"
@@ -34,13 +34,7 @@
static void
basic_value_zero (DBusBasicValue *value)
{
-
-#ifdef DBUS_HAVE_INT64
value->u64 = 0;
-#else
- value->eight.first32 = 0;
- value->eight.second32 = 0;
-#endif
}
static dbus_bool_t
@@ -56,12 +50,7 @@ basic_value_equal (int type,
}
else
{
-#ifdef DBUS_HAVE_INT64
return lhs->u64 == rhs->u64;
-#else
- return lhs->eight.first32 == rhs->eight.first32 &&
- lhs->eight.second32 == rhs->eight.second32;
-#endif
}
}
@@ -1785,10 +1774,13 @@ make_and_run_test_nodes (void)
start_next_test ("All values in one big toplevel %d iteration\n", 1);
{
TestTypeNode *nodes[N_VALUES];
+ TestTypeNode *node;
i = 0;
- while ((nodes[i] = value_generator (&i)))
- ;
+ while ((node = value_generator (&i)))
+ {
+ nodes[i - 1] = node;
+ }
run_test_nodes (nodes, N_VALUES);
@@ -2337,7 +2329,6 @@ int32_read_multi (TestTypeNode *node,
return TRUE;
}
-#ifdef DBUS_HAVE_INT64
static dbus_int64_t
int64_from_seed (int seed)
{
@@ -2351,7 +2342,6 @@ int64_from_seed (int seed)
return v;
}
-#endif
static dbus_bool_t
int64_write_value (TestTypeNode *node,
@@ -2359,7 +2349,6 @@ int64_write_value (TestTypeNode *node,
DBusTypeWriter *writer,
int seed)
{
-#ifdef DBUS_HAVE_INT64
/* also used for uint64 */
dbus_int64_t v;
@@ -2368,9 +2357,6 @@ int64_write_value (TestTypeNode *node,
return _dbus_type_writer_write_basic (writer,
node->klass->typecode,
&v);
-#else
- return TRUE;
-#endif
}
static dbus_bool_t
@@ -2378,7 +2364,6 @@ int64_read_value (TestTypeNode *node,
DBusTypeReader *reader,
int seed)
{
-#ifdef DBUS_HAVE_INT64
/* also used for uint64 */
dbus_int64_t v;
@@ -2390,9 +2375,6 @@ int64_read_value (TestTypeNode *node,
_dbus_assert (v == int64_from_seed (seed));
return TRUE;
-#else
- return TRUE;
-#endif
}
static dbus_bool_t
@@ -2401,7 +2383,6 @@ int64_set_value (TestTypeNode *node,
DBusTypeReader *realign_root,
int seed)
{
-#ifdef DBUS_HAVE_INT64
/* also used for uint64 */
dbus_int64_t v;
@@ -2410,9 +2391,6 @@ int64_set_value (TestTypeNode *node,
return _dbus_type_reader_set_basic (reader,
&v,
realign_root);
-#else
- return TRUE;
-#endif
}
#define MAX_SAMPLE_STRING_LEN 10
@@ -3574,4 +3552,4 @@ container_destroy (TestTypeNode *node)
#endif /* !DOXYGEN_SHOULD_SKIP_THIS */
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/dbus/dbus-marshal-validate-util.c b/dbus/dbus-marshal-validate-util.c
index 81135bcf..d52cb6d8 100644
--- a/dbus/dbus-marshal-validate-util.c
+++ b/dbus/dbus-marshal-validate-util.c
@@ -22,7 +22,7 @@
*/
#include <config.h>
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#ifndef DOXYGEN_SHOULD_SKIP_THIS
@@ -585,4 +585,4 @@ _dbus_marshal_validate_test (void)
#endif /* !DOXYGEN_SHOULD_SKIP_THIS */
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/dbus/dbus-memory.c b/dbus/dbus-memory.c
index a033b540..22e80727 100644
--- a/dbus/dbus-memory.c
+++ b/dbus/dbus-memory.c
@@ -26,6 +26,7 @@
#include "dbus-internals.h"
#include "dbus-sysdeps.h"
#include "dbus-list.h"
+#include "dbus-threads.h"
#include <stdlib.h>
/**
@@ -96,7 +97,7 @@
* @{
*/
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
static dbus_bool_t debug_initialized = FALSE;
static int fail_nth = -1;
static size_t fail_size = 0;
@@ -239,7 +240,7 @@ _dbus_get_fail_alloc_failures (void)
return n_failures_per_failure;
}
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
/**
* Called when about to alloc some memory; if
* it returns #TRUE, then the allocation should
@@ -293,7 +294,7 @@ _dbus_decrement_fail_alloc_counter (void)
return FALSE;
}
}
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
/**
* Get the number of outstanding malloc()'d blocks.
@@ -459,7 +460,7 @@ set_guards (void *real_block,
void*
dbus_malloc (size_t bytes)
{
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
_dbus_initialize_malloc_debug ();
if (_dbus_decrement_fail_alloc_counter ())
@@ -471,7 +472,7 @@ dbus_malloc (size_t bytes)
if (bytes == 0) /* some system mallocs handle this, some don't */
return NULL;
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
else if (fail_size != 0 && bytes > fail_size)
return NULL;
else if (guards)
@@ -498,7 +499,7 @@ dbus_malloc (size_t bytes)
void *mem;
mem = malloc (bytes);
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
if (mem)
{
_dbus_atomic_inc (&n_blocks_outstanding);
@@ -529,7 +530,7 @@ dbus_malloc (size_t bytes)
void*
dbus_malloc0 (size_t bytes)
{
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
_dbus_initialize_malloc_debug ();
if (_dbus_decrement_fail_alloc_counter ())
@@ -542,7 +543,7 @@ dbus_malloc0 (size_t bytes)
if (bytes == 0)
return NULL;
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
else if (fail_size != 0 && bytes > fail_size)
return NULL;
else if (guards)
@@ -570,7 +571,7 @@ dbus_malloc0 (size_t bytes)
void *mem;
mem = calloc (bytes, 1);
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
if (mem)
{
_dbus_atomic_inc (&n_blocks_outstanding);
@@ -600,7 +601,7 @@ void*
dbus_realloc (void *memory,
size_t bytes)
{
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
_dbus_initialize_malloc_debug ();
if (_dbus_decrement_fail_alloc_counter ())
@@ -616,7 +617,7 @@ dbus_realloc (void *memory,
dbus_free (memory);
return NULL;
}
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
else if (fail_size != 0 && bytes > fail_size)
return NULL;
else if (guards)
@@ -676,7 +677,7 @@ dbus_realloc (void *memory,
void *mem;
mem = realloc (memory, bytes);
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
if (mem == NULL && malloc_cannot_fail)
{
_dbus_warn ("out of memory: malloc (%ld)\n", (long) bytes);
@@ -699,7 +700,7 @@ dbus_realloc (void *memory,
void
dbus_free (void *memory)
{
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
if (guards)
{
check_guards (memory, TRUE);
@@ -723,7 +724,7 @@ dbus_free (void *memory)
if (memory) /* we guarantee it's safe to free (NULL) */
{
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#ifdef DBUS_DISABLE_ASSERT
_dbus_atomic_dec (&n_blocks_outstanding);
#else
@@ -794,7 +795,7 @@ struct ShutdownClosure
void *data; /**< Data for function */
};
-_DBUS_DEFINE_GLOBAL_LOCK (shutdown_funcs);
+/* Protected by _DBUS_LOCK (shutdown_funcs) */
static ShutdownClosure *registered_globals = NULL;
/**
@@ -809,6 +810,20 @@ dbus_bool_t
_dbus_register_shutdown_func (DBusShutdownFunction func,
void *data)
{
+ dbus_bool_t ok;
+
+ if (!_DBUS_LOCK (shutdown_funcs))
+ return FALSE;
+
+ ok = _dbus_register_shutdown_func_unlocked (func, data);
+ _DBUS_UNLOCK (shutdown_funcs);
+ return ok;
+}
+
+dbus_bool_t
+_dbus_register_shutdown_func_unlocked (DBusShutdownFunction func,
+ void *data)
+{
ShutdownClosure *c;
c = dbus_new (ShutdownClosure, 1);
@@ -819,13 +834,9 @@ _dbus_register_shutdown_func (DBusShutdownFunction func,
c->func = func;
c->data = data;
- _DBUS_LOCK (shutdown_funcs);
-
c->next = registered_globals;
registered_globals = c;
- _DBUS_UNLOCK (shutdown_funcs);
-
return TRUE;
}
@@ -845,7 +856,7 @@ _dbus_register_shutdown_func (DBusShutdownFunction func,
* can be useful to free these internal data structures.
*
* dbus_shutdown() does NOT free memory that was returned
- * to the application. It only returns libdbus-internal
+ * to the application. It only frees libdbus-internal
* data structures.
*
* You MUST free all memory and release all reference counts
@@ -890,12 +901,18 @@ dbus_shutdown (void)
dbus_free (c);
}
+ /* We wrap this in the thread-initialization lock because
+ * dbus_threads_init() uses the current generation to tell whether
+ * we're initialized, so we need to make sure that un-initializing
+ * propagates into all threads. */
+ _dbus_threads_lock_platform_specific ();
_dbus_current_generation += 1;
+ _dbus_threads_unlock_platform_specific ();
}
/** @} */ /** End of public API docs block */
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#include "dbus-test.h"
/**
diff --git a/dbus/dbus-mempool.c b/dbus/dbus-mempool.c
index 0c3f117d..52466151 100644
--- a/dbus/dbus-mempool.c
+++ b/dbus/dbus-mempool.c
@@ -213,7 +213,7 @@ _dbus_mem_pool_free (DBusMemPool *pool)
void*
_dbus_mem_pool_alloc (DBusMemPool *pool)
{
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
if (_dbus_disable_mem_pools ())
{
DBusMemBlock *block;
@@ -280,7 +280,7 @@ _dbus_mem_pool_alloc (DBusMemPool *pool)
/* Need a new block */
DBusMemBlock *block;
int alloc_size;
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
int saved_counter;
#endif
@@ -294,7 +294,7 @@ _dbus_mem_pool_alloc (DBusMemPool *pool)
alloc_size = sizeof (DBusMemBlock) - ELEMENT_PADDING + pool->block_size;
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
/* We save/restore the counter, so that memory pools won't
* cause a given function to have different number of
* allocations on different invocations. i.e. when testing
@@ -310,7 +310,7 @@ _dbus_mem_pool_alloc (DBusMemPool *pool)
else
block = dbus_malloc (alloc_size);
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
_dbus_set_fail_alloc_counter (saved_counter);
_dbus_assert (saved_counter == _dbus_get_fail_alloc_counter ());
#endif
@@ -349,7 +349,7 @@ _dbus_mem_pool_dealloc (DBusMemPool *pool,
{
VALGRIND_MEMPOOL_FREE (pool, element);
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
if (_dbus_disable_mem_pools ())
{
DBusMemBlock *block;
@@ -393,7 +393,7 @@ _dbus_mem_pool_dealloc (DBusMemPool *pool,
freed = element;
/* used for internal mempool administration */
- VALGRIND_MAKE_MEM_UNDEFINED (freed, sizeof (freed));
+ VALGRIND_MAKE_MEM_UNDEFINED (freed, sizeof (*freed));
freed->next = pool->free_elements;
pool->free_elements = freed;
@@ -449,7 +449,7 @@ _dbus_mem_pool_get_stats (DBusMemPool *pool,
/** @} */
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#include "dbus-test.h"
#include <stdio.h>
#include <time.h>
@@ -459,8 +459,10 @@ time_for_size (int size)
{
int i;
int j;
+#ifdef DBUS_ENABLE_VERBOSE_MODE
clock_t start;
clock_t end;
+#endif
#define FREE_ARRAY_SIZE 512
#define N_ITERATIONS FREE_ARRAY_SIZE * 512
void *to_free[FREE_ARRAY_SIZE];
@@ -470,8 +472,10 @@ time_for_size (int size)
_dbus_verbose (" malloc\n");
+#ifdef DBUS_ENABLE_VERBOSE_MODE
start = clock ();
-
+#endif
+
i = 0;
j = 0;
while (i < N_ITERATIONS)
@@ -496,6 +500,7 @@ time_for_size (int size)
++i;
}
+#ifdef DBUS_ENABLE_VERBOSE_MODE
end = clock ();
_dbus_verbose (" created/destroyed %d elements in %g seconds\n",
@@ -506,6 +511,7 @@ time_for_size (int size)
_dbus_verbose (" mempools\n");
start = clock ();
+#endif
pool = _dbus_mem_pool_new (size, FALSE);
@@ -535,6 +541,7 @@ time_for_size (int size)
_dbus_mem_pool_free (pool);
+#ifdef DBUS_ENABLE_VERBOSE_MODE
end = clock ();
_dbus_verbose (" created/destroyed %d elements in %g seconds\n",
@@ -543,6 +550,7 @@ time_for_size (int size)
_dbus_verbose (" zeroed malloc\n");
start = clock ();
+#endif
i = 0;
j = 0;
@@ -568,6 +576,7 @@ time_for_size (int size)
++i;
}
+#ifdef DBUS_ENABLE_VERBOSE_MODE
end = clock ();
_dbus_verbose (" created/destroyed %d elements in %g seconds\n",
@@ -576,6 +585,7 @@ time_for_size (int size)
_dbus_verbose (" zeroed mempools\n");
start = clock ();
+#endif
pool = _dbus_mem_pool_new (size, TRUE);
@@ -605,10 +615,12 @@ time_for_size (int size)
_dbus_mem_pool_free (pool);
+#ifdef DBUS_ENABLE_VERBOSE_MODE
end = clock ();
_dbus_verbose (" created/destroyed %d elements in %g seconds\n",
N_ITERATIONS, (end - start) / (double) CLOCKS_PER_SEC);
+#endif
}
/**
@@ -632,4 +644,4 @@ _dbus_mem_pool_test (void)
return TRUE;
}
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/dbus/dbus-message-factory.c b/dbus/dbus-message-factory.c
index efa4e029..b742e4c1 100644
--- a/dbus/dbus-message-factory.c
+++ b/dbus/dbus-message-factory.c
@@ -24,7 +24,7 @@
#ifndef DOXYGEN_SHOULD_SKIP_THIS
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#include "dbus-message-factory.h"
#include "dbus-message-private.h"
#include "dbus-signature.h"
@@ -1302,4 +1302,4 @@ _dbus_message_data_iter_get_and_next (DBusMessageDataIter *iter,
#endif /* !DOXYGEN_SHOULD_SKIP_THIS */
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/dbus/dbus-message-factory.h b/dbus/dbus-message-factory.h
index b0747504..fd7a4764 100644
--- a/dbus/dbus-message-factory.h
+++ b/dbus/dbus-message-factory.h
@@ -24,7 +24,7 @@
#ifndef DBUS_MESSAGE_FACTORY_H
#define DBUS_MESSAGE_FACTORY_H
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#include <dbus/dbus-string.h>
#include <dbus/dbus-marshal-basic.h>
@@ -56,6 +56,6 @@ dbus_bool_t _dbus_message_data_iter_get_and_next (DBusMessageDataIter *iter,
DBUS_END_DECLS
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
#endif /* DBUS_MESSAGE_FACTORY_H */
diff --git a/dbus/dbus-message-internal.h b/dbus/dbus-message-internal.h
index c1948732..e9a9ec01 100644
--- a/dbus/dbus-message-internal.h
+++ b/dbus/dbus-message-internal.h
@@ -70,8 +70,7 @@ void _dbus_message_loader_unref (DBusMessageLoader
void _dbus_message_loader_get_buffer (DBusMessageLoader *loader,
DBusString **buffer);
void _dbus_message_loader_return_buffer (DBusMessageLoader *loader,
- DBusString *buffer,
- int bytes_read);
+ DBusString *buffer);
dbus_bool_t _dbus_message_loader_get_unix_fds (DBusMessageLoader *loader,
int **fds,
@@ -97,6 +96,10 @@ long _dbus_message_loader_get_max_message_size (DBusMessageLoader
void _dbus_message_loader_set_max_message_unix_fds(DBusMessageLoader *loader,
long n);
long _dbus_message_loader_get_max_message_unix_fds(DBusMessageLoader *loader);
+int _dbus_message_loader_get_pending_fds_count (DBusMessageLoader *loader);
+void _dbus_message_loader_set_pending_fds_function (DBusMessageLoader *loader,
+ void (* callback) (void *),
+ void *data);
typedef struct DBusInitialFDs DBusInitialFDs;
DBusInitialFDs *_dbus_check_fdleaks_enter (void);
diff --git a/dbus/dbus-message-private.h b/dbus/dbus-message-private.h
index e1578abd..a611b095 100644
--- a/dbus/dbus-message-private.h
+++ b/dbus/dbus-message-private.h
@@ -80,6 +80,8 @@ struct DBusMessageLoader
int *unix_fds; /**< File descriptors that have been read from the transport but not yet been handed to any message. Array will be allocated at first use. */
unsigned n_unix_fds_allocated; /**< Number of file descriptors this array has space for */
unsigned n_unix_fds; /**< Number of valid file descriptors in array */
+ void (* unix_fds_change) (void *); /**< Notify when the pending fds change */
+ void *unix_fds_change_data;
#endif
};
diff --git a/dbus/dbus-message-util.c b/dbus/dbus-message-util.c
index f7859520..f615af83 100644
--- a/dbus/dbus-message-util.c
+++ b/dbus/dbus-message-util.c
@@ -45,7 +45,7 @@
* @{
*/
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
/**
* Reads arguments from a message iterator given a variable argument
* list. Only arguments of basic type and arrays of fixed-length
@@ -76,11 +76,11 @@ dbus_message_iter_get_args (DBusMessageIter *iter,
return retval;
}
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
/** @} */
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#include "dbus-test.h"
#include "dbus-message-factory.h"
#include <stdio.h>
@@ -493,7 +493,7 @@ dbus_internal_do_not_use_try_message_data (const DBusString *data,
_dbus_message_loader_get_buffer (loader, &buffer);
_dbus_string_append_byte (buffer,
_dbus_string_get_byte (data, i));
- _dbus_message_loader_return_buffer (loader, buffer, 1);
+ _dbus_message_loader_return_buffer (loader, buffer);
}
if (!check_loader_results (loader, expected_validity))
@@ -512,7 +512,7 @@ dbus_internal_do_not_use_try_message_data (const DBusString *data,
_dbus_message_loader_get_buffer (loader, &buffer);
_dbus_string_copy (data, 0, buffer,
_dbus_string_get_length (buffer));
- _dbus_message_loader_return_buffer (loader, buffer, 1);
+ _dbus_message_loader_return_buffer (loader, buffer);
}
if (!check_loader_results (loader, expected_validity))
@@ -536,7 +536,7 @@ dbus_internal_do_not_use_try_message_data (const DBusString *data,
if ((i+1) < len)
_dbus_string_append_byte (buffer,
_dbus_string_get_byte (data, i+1));
- _dbus_message_loader_return_buffer (loader, buffer, 1);
+ _dbus_message_loader_return_buffer (loader, buffer);
}
if (!check_loader_results (loader, expected_validity))
@@ -754,10 +754,8 @@ message_iter_test (DBusMessage *message)
dbus_uint16_t v_UINT16;
dbus_int32_t v_INT32;
dbus_uint32_t v_UINT32;
-#ifdef DBUS_HAVE_INT64
dbus_int64_t v_INT64;
dbus_uint64_t v_UINT64;
-#endif
unsigned char v_BYTE;
dbus_bool_t v_BOOLEAN;
@@ -830,14 +828,12 @@ verify_test_message (DBusMessage *message)
int our_uint32_array_len;
dbus_int32_t *our_int32_array = (void*)0xdeadbeef;
int our_int32_array_len;
-#ifdef DBUS_HAVE_INT64
dbus_int64_t our_int64;
dbus_uint64_t our_uint64;
dbus_int64_t *our_uint64_array = (void*)0xdeadbeef;
int our_uint64_array_len;
const dbus_int64_t *our_int64_array = (void*)0xdeadbeef;
int our_int64_array_len;
-#endif
const double *our_double_array = (void*)0xdeadbeef;
int our_double_array_len;
const unsigned char *our_byte_array = (void*)0xdeadbeef;
@@ -854,10 +850,8 @@ verify_test_message (DBusMessage *message)
DBUS_TYPE_UINT16, &our_uint16,
DBUS_TYPE_INT32, &our_int,
DBUS_TYPE_UINT32, &our_uint,
-#ifdef DBUS_HAVE_INT64
DBUS_TYPE_INT64, &our_int64,
DBUS_TYPE_UINT64, &our_uint64,
-#endif
DBUS_TYPE_STRING, &our_str,
DBUS_TYPE_DOUBLE, &our_double,
DBUS_TYPE_BOOLEAN, &our_bool,
@@ -867,12 +861,10 @@ verify_test_message (DBusMessage *message)
&our_uint32_array, &our_uint32_array_len,
DBUS_TYPE_ARRAY, DBUS_TYPE_INT32,
&our_int32_array, &our_int32_array_len,
-#ifdef DBUS_HAVE_INT64
DBUS_TYPE_ARRAY, DBUS_TYPE_UINT64,
&our_uint64_array, &our_uint64_array_len,
DBUS_TYPE_ARRAY, DBUS_TYPE_INT64,
&our_int64_array, &our_int64_array_len,
-#endif
DBUS_TYPE_ARRAY, DBUS_TYPE_DOUBLE,
&our_double_array, &our_double_array_len,
DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE,
@@ -900,12 +892,10 @@ verify_test_message (DBusMessage *message)
if (our_uint != 0x12300042)
_dbus_assert_not_reached ("uints differ!");
-#ifdef DBUS_HAVE_INT64
if (our_int64 != DBUS_INT64_CONSTANT (-0x123456789abcd))
_dbus_assert_not_reached ("64-bit integers differ!");
if (our_uint64 != DBUS_UINT64_CONSTANT (0x123456789abcd))
_dbus_assert_not_reached ("64-bit unsigned integers differ!");
-#endif
v_DOUBLE = 3.14159;
if (! _DBUS_DOUBLES_BITWISE_EQUAL (our_double, v_DOUBLE))
@@ -937,7 +927,6 @@ verify_test_message (DBusMessage *message)
our_int32_array[3] != -0x45678123)
_dbus_assert_not_reached ("int array differs");
-#ifdef DBUS_HAVE_INT64
if (our_uint64_array_len != 4 ||
our_uint64_array[0] != 0x12345678 ||
our_uint64_array[1] != 0x23456781 ||
@@ -951,7 +940,6 @@ verify_test_message (DBusMessage *message)
our_int64_array[2] != 0x34567812 ||
our_int64_array[3] != -0x45678123)
_dbus_assert_not_reached ("int64 array differs");
-#endif /* DBUS_HAVE_INT64 */
if (our_double_array_len != 3)
_dbus_assert_not_reached ("double array had wrong length");
@@ -1003,6 +991,161 @@ verify_test_message (DBusMessage *message)
_dbus_assert_not_reached ("Didn't reach end of arguments");
}
+static void
+verify_test_message_args_ignored (DBusMessage *message)
+{
+ DBusMessageIter iter;
+ DBusError error = DBUS_ERROR_INIT;
+ dbus_uint32_t our_uint;
+ DBusInitialFDs *initial_fds;
+
+ initial_fds = _dbus_check_fdleaks_enter ();
+
+ /* parse with empty signature: "" */
+ dbus_message_iter_init (message, &iter);
+ if (!dbus_message_iter_get_args (&iter, &error,
+ DBUS_TYPE_INVALID))
+ {
+ _dbus_warn ("error: %s - %s\n", error.name,
+ (error.message != NULL) ? error.message : "no message");
+ }
+ else
+ {
+ _dbus_assert (!dbus_error_is_set (&error));
+ _dbus_verbose ("arguments ignored.\n");
+ }
+
+ /* parse with shorter signature: "u" */
+ dbus_message_iter_init (message, &iter);
+ if (!dbus_message_iter_get_args (&iter, &error,
+ DBUS_TYPE_UINT32, &our_uint,
+ DBUS_TYPE_INVALID))
+ {
+ _dbus_warn ("error: %s - %s\n", error.name,
+ (error.message != NULL) ? error.message : "no message");
+ }
+ else
+ {
+ _dbus_assert (!dbus_error_is_set (&error));
+ _dbus_verbose ("arguments ignored.\n");
+ }
+
+ _dbus_check_fdleaks_leave (initial_fds);
+}
+
+static void
+verify_test_message_memleak (DBusMessage *message)
+{
+ DBusMessageIter iter;
+ DBusError error = DBUS_ERROR_INIT;
+ dbus_uint32_t our_uint1;
+ dbus_uint32_t our_uint2;
+ dbus_uint32_t our_uint3;
+ char **our_string_array1;
+ int our_string_array_len1;
+ char **our_string_array2;
+ int our_string_array_len2;
+ int our_unix_fd1;
+ int our_unix_fd2;
+ DBusInitialFDs *initial_fds;
+
+ initial_fds = _dbus_check_fdleaks_enter ();
+
+ /* parse with wrong signature: "uashuu" */
+ dbus_error_free (&error);
+ dbus_message_iter_init (message, &iter);
+ if (!dbus_message_iter_get_args (&iter, &error,
+ DBUS_TYPE_UINT32, &our_uint1,
+ DBUS_TYPE_ARRAY, DBUS_TYPE_STRING,
+ &our_string_array1, &our_string_array_len1,
+#ifdef HAVE_UNIX_FD_PASSING
+ DBUS_TYPE_UNIX_FD, &our_unix_fd1,
+#endif
+ DBUS_TYPE_UINT32, &our_uint2,
+ DBUS_TYPE_UINT32, &our_uint3,
+ DBUS_TYPE_INVALID))
+ {
+ _dbus_verbose ("expected error: %s - %s\n", error.name,
+ (error.message != NULL) ? error.message : "no message");
+ /* ensure array of string and unix fd not leaked */
+ _dbus_assert (our_string_array1 == NULL);
+#ifdef HAVE_UNIX_FD_PASSING
+ _dbus_assert (our_unix_fd1 == -1);
+#endif
+ }
+ else
+ {
+ _dbus_warn ("error: parse with wrong signature: 'uashuu'.\n");
+ }
+
+ /* parse with wrong signature: "uashuashu" */
+ dbus_message_iter_init (message, &iter);
+ dbus_error_free (&error);
+ if (!dbus_message_iter_get_args (&iter, &error,
+ DBUS_TYPE_UINT32, &our_uint1,
+ DBUS_TYPE_ARRAY, DBUS_TYPE_STRING,
+ &our_string_array1, &our_string_array_len1,
+#ifdef HAVE_UNIX_FD_PASSING
+ DBUS_TYPE_UNIX_FD, &our_unix_fd1,
+#endif
+ DBUS_TYPE_UINT32, &our_uint2,
+ DBUS_TYPE_ARRAY, DBUS_TYPE_STRING,
+ &our_string_array2, &our_string_array_len2,
+#ifdef HAVE_UNIX_FD_PASSING
+ DBUS_TYPE_UNIX_FD, &our_unix_fd2,
+#endif
+ DBUS_TYPE_UINT32, &our_uint3,
+ DBUS_TYPE_INVALID))
+ {
+ _dbus_verbose ("expected error: %s - %s\n", error.name,
+ (error.message != NULL) ? error.message : "no message");
+ /* ensure array of string and unix fd not leaked */
+ _dbus_assert (our_string_array1 == NULL);
+ _dbus_assert (our_string_array2 == NULL);
+#ifdef HAVE_UNIX_FD_PASSING
+ _dbus_assert (our_unix_fd1 == -1);
+ _dbus_assert (our_unix_fd2 == -1);
+#endif
+ }
+ else
+ {
+ _dbus_warn ("error: parse with wrong signature: 'uashuashu'.\n");
+ }
+
+ /* parse with correct signature: "uashuash" */
+ dbus_message_iter_init (message, &iter);
+ dbus_error_free (&error);
+ if (!dbus_message_iter_get_args (&iter, &error,
+ DBUS_TYPE_UINT32, &our_uint1,
+ DBUS_TYPE_ARRAY, DBUS_TYPE_STRING,
+ &our_string_array1, &our_string_array_len1,
+#ifdef HAVE_UNIX_FD_PASSING
+ DBUS_TYPE_UNIX_FD, &our_unix_fd1,
+#endif
+ DBUS_TYPE_UINT32, &our_uint2,
+ DBUS_TYPE_ARRAY, DBUS_TYPE_STRING,
+ &our_string_array2, &our_string_array_len2,
+#ifdef HAVE_UNIX_FD_PASSING
+ DBUS_TYPE_UNIX_FD, &our_unix_fd2,
+#endif
+ DBUS_TYPE_INVALID))
+ {
+ _dbus_warn ("error: %s - %s\n", error.name,
+ (error.message != NULL) ? error.message : "no message");
+ _dbus_assert_not_reached ("Could not get arguments");
+ }
+ else
+ {
+ dbus_free_string_array (our_string_array1);
+ dbus_free_string_array (our_string_array2);
+#ifdef HAVE_UNIX_FD_PASSING
+ _dbus_close (our_unix_fd1, &error);
+ _dbus_close (our_unix_fd2, &error);
+#endif
+ }
+ _dbus_check_fdleaks_leave (initial_fds);
+}
+
/**
* @ingroup DBusMessageInternals
* Unit test for DBusMessage.
@@ -1025,16 +1168,16 @@ _dbus_message_test (const char *test_data_dir)
{ 0x12345678, -0x23456781, 0x34567812, -0x45678123 };
const dbus_uint32_t *v_ARRAY_UINT32 = our_uint32_array;
const dbus_int32_t *v_ARRAY_INT32 = our_int32_array;
-#ifdef DBUS_HAVE_INT64
const dbus_uint64_t our_uint64_array[] =
{ 0x12345678, 0x23456781, 0x34567812, 0x45678123 };
const dbus_int64_t our_int64_array[] =
{ 0x12345678, -0x23456781, 0x34567812, -0x45678123 };
const dbus_uint64_t *v_ARRAY_UINT64 = our_uint64_array;
const dbus_int64_t *v_ARRAY_INT64 = our_int64_array;
-#endif
const char *our_string_array[] = { "Foo", "bar", "", "woo woo woo woo" };
+ const char *our_string_array1[] = { "foo", "Bar", "", "Woo woo Woo woo" };
const char **v_ARRAY_STRING = our_string_array;
+ const char **v1_ARRAY_STRING = our_string_array1;
const double our_double_array[] = { 0.1234, 9876.54321, -300.0 };
const double *v_ARRAY_DOUBLE = our_double_array;
const unsigned char our_byte_array[] = { 'a', 'b', 'c', 234 };
@@ -1049,16 +1192,16 @@ _dbus_message_test (const char *test_data_dir)
dbus_uint16_t v_UINT16;
dbus_int32_t v_INT32;
dbus_uint32_t v_UINT32;
-#ifdef DBUS_HAVE_INT64
+ dbus_uint32_t v1_UINT32;
dbus_int64_t v_INT64;
dbus_uint64_t v_UINT64;
-#endif
unsigned char v_BYTE;
unsigned char v2_BYTE;
dbus_bool_t v_BOOLEAN;
DBusMessageIter iter, array_iter, struct_iter;
#ifdef HAVE_UNIX_FD_PASSING
int v_UNIX_FD;
+ int v1_UNIX_FD;
#endif
char **decomposed;
DBusInitialFDs *initial_fds;
@@ -1201,10 +1344,8 @@ _dbus_message_test (const char *test_data_dir)
v_UINT16 = 0x123;
v_INT32 = -0x12345678;
v_UINT32 = 0x12300042;
-#ifdef DBUS_HAVE_INT64
v_INT64 = DBUS_INT64_CONSTANT (-0x123456789abcd);
v_UINT64 = DBUS_UINT64_CONSTANT (0x123456789abcd);
-#endif
v_STRING = "Test string";
v_DOUBLE = 3.14159;
v_BOOLEAN = TRUE;
@@ -1212,6 +1353,7 @@ _dbus_message_test (const char *test_data_dir)
v2_BYTE = 24;
#ifdef HAVE_UNIX_FD_PASSING
v_UNIX_FD = 1;
+ v1_UNIX_FD = 2;
#endif
dbus_message_append_args (message,
@@ -1219,10 +1361,8 @@ _dbus_message_test (const char *test_data_dir)
DBUS_TYPE_UINT16, &v_UINT16,
DBUS_TYPE_INT32, &v_INT32,
DBUS_TYPE_UINT32, &v_UINT32,
-#ifdef DBUS_HAVE_INT64
DBUS_TYPE_INT64, &v_INT64,
DBUS_TYPE_UINT64, &v_UINT64,
-#endif
DBUS_TYPE_STRING, &v_STRING,
DBUS_TYPE_DOUBLE, &v_DOUBLE,
DBUS_TYPE_BOOLEAN, &v_BOOLEAN,
@@ -1232,12 +1372,10 @@ _dbus_message_test (const char *test_data_dir)
_DBUS_N_ELEMENTS (our_uint32_array),
DBUS_TYPE_ARRAY, DBUS_TYPE_INT32, &v_ARRAY_INT32,
_DBUS_N_ELEMENTS (our_int32_array),
-#ifdef DBUS_HAVE_INT64
DBUS_TYPE_ARRAY, DBUS_TYPE_UINT64, &v_ARRAY_UINT64,
_DBUS_N_ELEMENTS (our_uint64_array),
DBUS_TYPE_ARRAY, DBUS_TYPE_INT64, &v_ARRAY_INT64,
_DBUS_N_ELEMENTS (our_int64_array),
-#endif
DBUS_TYPE_ARRAY, DBUS_TYPE_DOUBLE, &v_ARRAY_DOUBLE,
_DBUS_N_ELEMENTS (our_double_array),
DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &v_ARRAY_BYTE,
@@ -1254,10 +1392,8 @@ _dbus_message_test (const char *test_data_dir)
sig[i++] = DBUS_TYPE_UINT16;
sig[i++] = DBUS_TYPE_INT32;
sig[i++] = DBUS_TYPE_UINT32;
-#ifdef DBUS_HAVE_INT64
sig[i++] = DBUS_TYPE_INT64;
sig[i++] = DBUS_TYPE_UINT64;
-#endif
sig[i++] = DBUS_TYPE_STRING;
sig[i++] = DBUS_TYPE_DOUBLE;
sig[i++] = DBUS_TYPE_BOOLEAN;
@@ -1267,12 +1403,10 @@ _dbus_message_test (const char *test_data_dir)
sig[i++] = DBUS_TYPE_UINT32;
sig[i++] = DBUS_TYPE_ARRAY;
sig[i++] = DBUS_TYPE_INT32;
-#ifdef DBUS_HAVE_INT64
sig[i++] = DBUS_TYPE_ARRAY;
sig[i++] = DBUS_TYPE_UINT64;
sig[i++] = DBUS_TYPE_ARRAY;
sig[i++] = DBUS_TYPE_INT64;
-#endif
sig[i++] = DBUS_TYPE_ARRAY;
sig[i++] = DBUS_TYPE_DOUBLE;
sig[i++] = DBUS_TYPE_ARRAY;
@@ -1353,7 +1487,7 @@ _dbus_message_test (const char *test_data_dir)
_dbus_message_loader_get_buffer (loader, &buffer);
_dbus_string_append_byte (buffer, data[i]);
- _dbus_message_loader_return_buffer (loader, buffer, 1);
+ _dbus_message_loader_return_buffer (loader, buffer);
}
/* Write the body data one byte at a time */
@@ -1364,7 +1498,7 @@ _dbus_message_test (const char *test_data_dir)
_dbus_message_loader_get_buffer (loader, &buffer);
_dbus_string_append_byte (buffer, data[i]);
- _dbus_message_loader_return_buffer (loader, buffer, 1);
+ _dbus_message_loader_return_buffer (loader, buffer);
}
#ifdef HAVE_UNIX_FD_PASSING
@@ -1489,6 +1623,51 @@ _dbus_message_test (const char *test_data_dir)
dbus_message_unref (message);
+ /* Check we should not leak array of string or unix fd, fd.o#21259 */
+ message = dbus_message_new_method_call ("org.freedesktop.DBus.TestService",
+ "/org/freedesktop/TestPath",
+ "Foo.TestInterface",
+ "Method");
+
+ /* signature "uashuash" */
+ dbus_message_append_args (message,
+ DBUS_TYPE_UINT32, &v_UINT32,
+ DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &v_ARRAY_STRING,
+ _DBUS_N_ELEMENTS (our_string_array),
+#ifdef HAVE_UNIX_FD_PASSING
+ DBUS_TYPE_UNIX_FD, &v_UNIX_FD,
+#endif
+ DBUS_TYPE_UINT32, &v1_UINT32,
+ DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &v1_ARRAY_STRING,
+ _DBUS_N_ELEMENTS (our_string_array1),
+#ifdef HAVE_UNIX_FD_PASSING
+ DBUS_TYPE_UNIX_FD, &v1_UNIX_FD,
+#endif
+
+ DBUS_TYPE_INVALID);
+
+ i = 0;
+ sig[i++] = DBUS_TYPE_UINT32;
+ sig[i++] = DBUS_TYPE_ARRAY;
+ sig[i++] = DBUS_TYPE_STRING;
+#ifdef HAVE_UNIX_FD_PASSING
+ sig[i++] = DBUS_TYPE_UNIX_FD;
+#endif
+ sig[i++] = DBUS_TYPE_UINT32;
+ sig[i++] = DBUS_TYPE_ARRAY;
+ sig[i++] = DBUS_TYPE_STRING;
+#ifdef HAVE_UNIX_FD_PASSING
+ sig[i++] = DBUS_TYPE_UNIX_FD;
+#endif
+ sig[i++] = DBUS_TYPE_INVALID;
+
+ _dbus_assert (i < (int) _DBUS_N_ELEMENTS (sig));
+
+ verify_test_message_args_ignored (message);
+ verify_test_message_memleak (message);
+
+ dbus_message_unref (message);
+
/* Load all the sample messages from the message factory */
{
DBusMessageDataIter diter;
@@ -1542,4 +1721,4 @@ _dbus_message_test (const char *test_data_dir)
return TRUE;
}
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/dbus/dbus-message.c b/dbus/dbus-message.c
index 71bcee60..3e74fc54 100644
--- a/dbus/dbus-message.c
+++ b/dbus/dbus-message.c
@@ -35,6 +35,7 @@
#include "dbus-list.h"
#include "dbus-threads-internal.h"
#ifdef HAVE_UNIX_FD_PASSING
+#include "dbus-sysdeps.h"
#include "dbus-sysdeps-unix.h"
#endif
@@ -56,7 +57,7 @@ static void dbus_message_finalize (DBusMessage *message);
* @{
*/
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
static dbus_bool_t
_dbus_enable_message_cache (void)
{
@@ -506,7 +507,7 @@ _dbus_message_set_signature (DBusMessage *message,
/** Avoid caching too many messages */
#define MAX_MESSAGE_CACHE_SIZE 5
-_DBUS_DEFINE_GLOBAL_LOCK (message_cache);
+/* Protected by _DBUS_LOCK (message_cache) */
static DBusMessage *message_cache[MAX_MESSAGE_CACHE_SIZE];
static int message_cache_count = 0;
static dbus_bool_t message_cache_shutdown_registered = FALSE;
@@ -516,7 +517,9 @@ dbus_message_cache_shutdown (void *data)
{
int i;
- _DBUS_LOCK (message_cache);
+ if (!_DBUS_LOCK (message_cache))
+ _dbus_assert_not_reached ("we would have initialized global locks "
+ "before registering a shutdown function");
i = 0;
while (i < MAX_MESSAGE_CACHE_SIZE)
@@ -548,7 +551,12 @@ dbus_message_get_cached (void)
message = NULL;
- _DBUS_LOCK (message_cache);
+ if (!_DBUS_LOCK (message_cache))
+ {
+ /* we'd have initialized global locks before caching anything,
+ * so there can't be anything in the cache */
+ return NULL;
+ }
_dbus_assert (message_cache_count >= 0);
@@ -660,7 +668,13 @@ dbus_message_cache_or_finalize (DBusMessage *message)
was_cached = FALSE;
- _DBUS_LOCK (message_cache);
+ if (!_DBUS_LOCK (message_cache))
+ {
+ /* The only way to get a non-null message goes through
+ * dbus_message_get_cached() which takes the lock. */
+ _dbus_assert_not_reached ("we would have initialized global locks "
+ "the first time we constructed a message");
+ }
if (!message_cache_shutdown_registered)
{
@@ -716,7 +730,7 @@ dbus_message_cache_or_finalize (DBusMessage *message)
dbus_message_finalize (message);
}
-#ifndef DBUS_DISABLE_CHECKS
+#if defined(DBUS_ENABLE_CHECKS) || defined(DBUS_ENABLE_ASSERT)
static dbus_bool_t
_dbus_message_iter_check (DBusMessageRealIter *iter)
{
@@ -764,15 +778,13 @@ _dbus_message_iter_check (DBusMessageRealIter *iter)
return TRUE;
}
-#endif /* DBUS_DISABLE_CHECKS */
+#endif /* DBUS_ENABLE_CHECKS || DBUS_ENABLE_ASSERT */
/**
* Implementation of the varargs arg-getting functions.
* dbus_message_get_args() is the place to go for complete
* documentation.
*
- * @todo This may leak memory and file descriptors if parsing fails. See #21259
- *
* @see dbus_message_get_args
* @param iter the message iter
* @param error error to be filled in
@@ -787,8 +799,9 @@ _dbus_message_iter_get_args_valist (DBusMessageIter *iter,
va_list var_args)
{
DBusMessageRealIter *real = (DBusMessageRealIter *)iter;
- int spec_type, msg_type, i;
+ int spec_type, msg_type, i, j;
dbus_bool_t retval;
+ va_list copy_args;
_dbus_assert (_dbus_message_iter_check (real));
@@ -797,12 +810,17 @@ _dbus_message_iter_get_args_valist (DBusMessageIter *iter,
spec_type = first_arg_type;
i = 0;
+ /* copy var_args first, then we can do another iteration over it to
+ * free memory and close unix fds if parse failed at some point.
+ */
+ DBUS_VA_COPY (copy_args, var_args);
+
while (spec_type != DBUS_TYPE_INVALID)
{
msg_type = dbus_message_iter_get_arg_type (iter);
if (msg_type != spec_type)
- {
+ {
dbus_set_error (error, DBUS_ERROR_INVALID_ARGS,
"Argument %d is specified to be of type \"%s\", but "
"is actually of type \"%s\"\n", i,
@@ -810,7 +828,7 @@ _dbus_message_iter_get_args_valist (DBusMessageIter *iter,
_dbus_type_to_string (msg_type));
goto out;
- }
+ }
if (spec_type == DBUS_TYPE_UNIX_FD)
{
@@ -923,30 +941,30 @@ _dbus_message_iter_get_args_valist (DBusMessageIter *iter,
/* Now go through and dup each string */
_dbus_type_reader_recurse (&real->u.reader, &array);
- i = 0;
- while (i < n_elements)
+ j = 0;
+ while (j < n_elements)
{
const char *s;
_dbus_type_reader_read_basic (&array,
(void *) &s);
- str_array[i] = _dbus_strdup (s);
- if (str_array[i] == NULL)
+ str_array[j] = _dbus_strdup (s);
+ if (str_array[j] == NULL)
{
dbus_free_string_array (str_array);
_DBUS_SET_OOM (error);
goto out;
}
- ++i;
+ ++j;
if (!_dbus_type_reader_next (&array))
- _dbus_assert (i == n_elements);
+ _dbus_assert (j == n_elements);
}
_dbus_assert (_dbus_type_reader_get_current_type (&array) == DBUS_TYPE_INVALID);
- _dbus_assert (i == n_elements);
- _dbus_assert (str_array[i] == NULL);
+ _dbus_assert (j == n_elements);
+ _dbus_assert (str_array[j] == NULL);
*str_array_p = str_array;
*n_elements_p = n_elements;
@@ -969,6 +987,9 @@ _dbus_message_iter_get_args_valist (DBusMessageIter *iter,
}
#endif
+ /* how many arguments already handled */
+ i++;
+
spec_type = va_arg (var_args, int);
if (!_dbus_type_reader_next (&real->u.reader) && spec_type != DBUS_TYPE_INVALID)
{
@@ -976,14 +997,71 @@ _dbus_message_iter_get_args_valist (DBusMessageIter *iter,
"Message has only %d arguments, but more were expected", i);
goto out;
}
-
- i++;
}
retval = TRUE;
out:
+ /* there may memory or unix fd leak in the above iteration if parse failed.
+ * so we have another iteration over copy_args to free memory and close
+ * unix fds.
+ */
+ if (!retval)
+ {
+ spec_type = first_arg_type;
+ j = 0;
+
+ while (j < i)
+ {
+ if (spec_type == DBUS_TYPE_UNIX_FD)
+ {
+#ifdef HAVE_UNIX_FD_PASSING
+ int *pfd;
+
+ pfd = va_arg (copy_args, int *);
+ _dbus_assert(pfd);
+ if (*pfd >= 0)
+ {
+ _dbus_close (*pfd, NULL);
+ *pfd = -1;
+ }
+#endif
+ }
+ else if (dbus_type_is_basic (spec_type))
+ {
+ /* move the index forward */
+ va_arg (copy_args, DBusBasicValue *);
+ }
+ else if (spec_type == DBUS_TYPE_ARRAY)
+ {
+ int spec_element_type;
+ spec_element_type = va_arg (copy_args, int);
+ if (dbus_type_is_fixed (spec_element_type))
+ {
+ /* move the index forward */
+ va_arg (copy_args, const DBusBasicValue **);
+ va_arg (copy_args, int *);
+ }
+ else if (_DBUS_TYPE_IS_STRINGLIKE (spec_element_type))
+ {
+ char ***str_array_p;
+
+ str_array_p = va_arg (copy_args, char ***);
+ /* move the index forward */
+ va_arg (copy_args, int *);
+ _dbus_assert (str_array_p != NULL);
+ dbus_free_string_array (*str_array_p);
+ *str_array_p = NULL;
+ }
+ }
+
+ spec_type = va_arg (copy_args, int);
+ j++;
+ }
+ }
+
+ va_end (copy_args);
return retval;
}
@@ -1246,7 +1324,7 @@ dbus_message_new (int message_type)
*
* @param destination name that the message should be sent to or #NULL
* @param path object path the message should be sent to
- * @param interface interface to invoke method on, or #NULL
+ * @param iface interface to invoke method on, or #NULL
* @param method method to invoke
*
* @returns a new DBusMessage, free with dbus_message_unref()
@@ -1254,7 +1332,7 @@ dbus_message_new (int message_type)
DBusMessage*
dbus_message_new_method_call (const char *destination,
const char *path,
- const char *interface,
+ const char *iface,
const char *method)
{
DBusMessage *message;
@@ -1264,8 +1342,8 @@ dbus_message_new_method_call (const char *destination,
_dbus_return_val_if_fail (destination == NULL ||
_dbus_check_is_valid_bus_name (destination), NULL);
_dbus_return_val_if_fail (_dbus_check_is_valid_path (path), NULL);
- _dbus_return_val_if_fail (interface == NULL ||
- _dbus_check_is_valid_interface (interface), NULL);
+ _dbus_return_val_if_fail (iface == NULL ||
+ _dbus_check_is_valid_interface (iface), NULL);
_dbus_return_val_if_fail (_dbus_check_is_valid_member (method), NULL);
message = dbus_message_new_empty_header ();
@@ -1275,7 +1353,7 @@ dbus_message_new_method_call (const char *destination,
if (!_dbus_header_create (&message->header,
DBUS_COMPILER_BYTE_ORDER,
DBUS_MESSAGE_TYPE_METHOD_CALL,
- destination, path, interface, method, NULL))
+ destination, path, iface, method, NULL))
{
dbus_message_unref (message);
return NULL;
@@ -1338,22 +1416,22 @@ dbus_message_new_method_return (DBusMessage *method_call)
* specification defines the syntax of these fields).
*
* @param path the path to the object emitting the signal
- * @param interface the interface the signal is emitted from
+ * @param iface the interface the signal is emitted from
* @param name name of the signal
* @returns a new DBusMessage, free with dbus_message_unref()
*/
DBusMessage*
dbus_message_new_signal (const char *path,
- const char *interface,
+ const char *iface,
const char *name)
{
DBusMessage *message;
_dbus_return_val_if_fail (path != NULL, NULL);
- _dbus_return_val_if_fail (interface != NULL, NULL);
+ _dbus_return_val_if_fail (iface != NULL, NULL);
_dbus_return_val_if_fail (name != NULL, NULL);
_dbus_return_val_if_fail (_dbus_check_is_valid_path (path), NULL);
- _dbus_return_val_if_fail (_dbus_check_is_valid_interface (interface), NULL);
+ _dbus_return_val_if_fail (_dbus_check_is_valid_interface (iface), NULL);
_dbus_return_val_if_fail (_dbus_check_is_valid_member (name), NULL);
message = dbus_message_new_empty_header ();
@@ -1363,7 +1441,7 @@ dbus_message_new_signal (const char *path,
if (!_dbus_header_create (&message->header,
DBUS_COMPILER_BYTE_ORDER,
DBUS_MESSAGE_TYPE_SIGNAL,
- NULL, path, interface, name, NULL))
+ NULL, path, iface, name, NULL))
{
dbus_message_unref (message);
return NULL;
@@ -3113,23 +3191,23 @@ dbus_message_get_path_decomposed (DBusMessage *message,
* in the D-Bus specification.
*
* @param message the message
- * @param interface the interface or #NULL to unset
+ * @param iface the interface or #NULL to unset
* @returns #FALSE if not enough memory
*/
dbus_bool_t
dbus_message_set_interface (DBusMessage *message,
- const char *interface)
+ const char *iface)
{
_dbus_return_val_if_fail (message != NULL, FALSE);
_dbus_return_val_if_fail (!message->locked, FALSE);
- _dbus_return_val_if_fail (interface == NULL ||
- _dbus_check_is_valid_interface (interface),
+ _dbus_return_val_if_fail (iface == NULL ||
+ _dbus_check_is_valid_interface (iface),
FALSE);
return set_or_delete_string_field (message,
DBUS_HEADER_FIELD_INTERFACE,
DBUS_TYPE_STRING,
- interface);
+ iface);
}
/**
@@ -3164,28 +3242,28 @@ dbus_message_get_interface (DBusMessage *message)
* Checks if the message has an interface
*
* @param message the message
- * @param interface the interface name
+ * @param iface the interface name
* @returns #TRUE if the interface field in the header matches
*/
dbus_bool_t
dbus_message_has_interface (DBusMessage *message,
- const char *interface)
+ const char *iface)
{
const char *msg_interface;
msg_interface = dbus_message_get_interface (message);
if (msg_interface == NULL)
{
- if (interface == NULL)
+ if (iface == NULL)
return TRUE;
else
return FALSE;
}
- if (interface == NULL)
+ if (iface == NULL)
return FALSE;
- if (strcmp (msg_interface, interface) == 0)
+ if (strcmp (msg_interface, iface) == 0)
return TRUE;
return FALSE;
@@ -3477,13 +3555,13 @@ dbus_message_get_signature (DBusMessage *message)
static dbus_bool_t
_dbus_message_has_type_interface_member (DBusMessage *message,
int type,
- const char *interface,
+ const char *iface,
const char *member)
{
const char *n;
_dbus_assert (message != NULL);
- _dbus_assert (interface != NULL);
+ _dbus_assert (iface != NULL);
_dbus_assert (member != NULL);
if (dbus_message_get_type (message) != type)
@@ -3499,7 +3577,7 @@ _dbus_message_has_type_interface_member (DBusMessage *message,
{
n = dbus_message_get_interface (message);
- if (n == NULL || strcmp (n, interface) == 0)
+ if (n == NULL || strcmp (n, iface) == 0)
return TRUE;
}
@@ -3515,18 +3593,18 @@ _dbus_message_has_type_interface_member (DBusMessage *message,
* protocol allows method callers to leave out the interface name.
*
* @param message the message
- * @param interface the name to check (must not be #NULL)
+ * @param iface the name to check (must not be #NULL)
* @param method the name to check (must not be #NULL)
*
* @returns #TRUE if the message is the specified method call
*/
dbus_bool_t
dbus_message_is_method_call (DBusMessage *message,
- const char *interface,
+ const char *iface,
const char *method)
{
_dbus_return_val_if_fail (message != NULL, FALSE);
- _dbus_return_val_if_fail (interface != NULL, FALSE);
+ _dbus_return_val_if_fail (iface != NULL, FALSE);
_dbus_return_val_if_fail (method != NULL, FALSE);
/* don't check that interface/method are valid since it would be
* expensive, and not catch many common errors
@@ -3534,7 +3612,7 @@ dbus_message_is_method_call (DBusMessage *message,
return _dbus_message_has_type_interface_member (message,
DBUS_MESSAGE_TYPE_METHOD_CALL,
- interface, method);
+ iface, method);
}
/**
@@ -3543,18 +3621,18 @@ dbus_message_is_method_call (DBusMessage *message,
* has a different interface or member field, returns #FALSE.
*
* @param message the message
- * @param interface the name to check (must not be #NULL)
+ * @param iface the name to check (must not be #NULL)
* @param signal_name the name to check (must not be #NULL)
*
* @returns #TRUE if the message is the specified signal
*/
dbus_bool_t
dbus_message_is_signal (DBusMessage *message,
- const char *interface,
+ const char *iface,
const char *signal_name)
{
_dbus_return_val_if_fail (message != NULL, FALSE);
- _dbus_return_val_if_fail (interface != NULL, FALSE);
+ _dbus_return_val_if_fail (iface != NULL, FALSE);
_dbus_return_val_if_fail (signal_name != NULL, FALSE);
/* don't check that interface/name are valid since it would be
* expensive, and not catch many common errors
@@ -3562,7 +3640,7 @@ dbus_message_is_signal (DBusMessage *message,
return _dbus_message_has_type_interface_member (message,
DBUS_MESSAGE_TYPE_SIGNAL,
- interface, signal_name);
+ iface, signal_name);
}
/**
@@ -3802,7 +3880,7 @@ _dbus_message_loader_new (void)
SCM_RIGHTS works we need to preallocate an fd array of the maximum
number of unix fds we want to receive in advance. A
try-and-reallocate loop is not possible. */
- loader->max_message_unix_fds = 1024;
+ loader->max_message_unix_fds = DBUS_DEFAULT_MESSAGE_UNIX_FDS;
if (!_dbus_string_init (&loader->data))
{
@@ -3899,12 +3977,10 @@ _dbus_message_loader_get_buffer (DBusMessageLoader *loader,
*
* @param loader the loader.
* @param buffer the buffer.
- * @param bytes_read number of bytes that were read into the buffer.
*/
void
_dbus_message_loader_return_buffer (DBusMessageLoader *loader,
- DBusString *buffer,
- int bytes_read)
+ DBusString *buffer)
{
_dbus_assert (loader->buffer_outstanding);
_dbus_assert (buffer == &loader->data);
@@ -3968,7 +4044,7 @@ _dbus_message_loader_get_unix_fds(DBusMessageLoader *loader,
*
* @param loader the message loader.
* @param fds the array fds were read into
- * @param max_n_fds how many fds were read
+ * @param n_fds how many fds were read
*/
void
@@ -3983,6 +4059,9 @@ _dbus_message_loader_return_unix_fds(DBusMessageLoader *loader,
loader->n_unix_fds += n_fds;
loader->unix_fds_outstanding = FALSE;
+
+ if (n_fds && loader->unix_fds_change)
+ loader->unix_fds_change (loader->unix_fds_change_data);
#else
_dbus_assert_not_reached("Platform doesn't support unix fd passing");
#endif
@@ -4129,7 +4208,10 @@ load_message (DBusMessageLoader *loader,
message->n_unix_fds_allocated = message->n_unix_fds = n_unix_fds;
loader->n_unix_fds -= n_unix_fds;
- memmove(loader->unix_fds + n_unix_fds, loader->unix_fds, loader->n_unix_fds);
+ memmove (loader->unix_fds, loader->unix_fds + n_unix_fds, loader->n_unix_fds * sizeof (loader->unix_fds[0]));
+
+ if (loader->unix_fds_change)
+ loader->unix_fds_change (loader->unix_fds_change_data);
}
else
message->unix_fds = NULL;
@@ -4396,7 +4478,7 @@ _dbus_message_loader_get_max_message_size (DBusMessageLoader *loader)
* Sets the maximum unix fds per message we allow.
*
* @param loader the loader
- * @param size the max number of unix fds in a message
+ * @param n the max number of unix fds in a message
*/
void
_dbus_message_loader_set_max_message_unix_fds (DBusMessageLoader *loader,
@@ -4423,8 +4505,42 @@ _dbus_message_loader_get_max_message_unix_fds (DBusMessageLoader *loader)
return loader->max_message_unix_fds;
}
-static DBusDataSlotAllocator slot_allocator;
-_DBUS_DEFINE_GLOBAL_LOCK (message_slots);
+/**
+ * Return how many file descriptors are pending in the loader
+ *
+ * @param loader the loader
+ */
+int
+_dbus_message_loader_get_pending_fds_count (DBusMessageLoader *loader)
+{
+#ifdef HAVE_UNIX_FD_PASSING
+ return loader->n_unix_fds;
+#else
+ return 0;
+#endif
+}
+
+/**
+ * Register a function to be called whenever the number of pending file
+ * descriptors in the loader change.
+ *
+ * @param loader the loader
+ * @param callback the callback
+ * @param data the data for the callback
+ */
+void
+_dbus_message_loader_set_pending_fds_function (DBusMessageLoader *loader,
+ void (* callback) (void *),
+ void *data)
+{
+#ifdef HAVE_UNIX_FD_PASSING
+ loader->unix_fds_change = callback;
+ loader->unix_fds_change_data = data;
+#endif
+}
+
+static DBusDataSlotAllocator slot_allocator =
+ _DBUS_DATA_SLOT_ALLOCATOR_INIT (_DBUS_LOCK_NAME (message_slots));
/**
* Allocates an integer ID to be used for storing application-specific
@@ -4444,7 +4560,6 @@ dbus_bool_t
dbus_message_allocate_data_slot (dbus_int32_t *slot_p)
{
return _dbus_data_slot_allocator_alloc (&slot_allocator,
- &_DBUS_LOCK_NAME (message_slots),
slot_p);
}
@@ -4682,7 +4797,7 @@ dbus_message_demarshal (const char *str,
_dbus_message_loader_get_buffer (loader, &buffer);
_dbus_string_append_len (buffer, str, len);
- _dbus_message_loader_return_buffer (loader, buffer, len);
+ _dbus_message_loader_return_buffer (loader, buffer);
if (!_dbus_message_loader_queue_messages (loader))
goto fail_oom;
@@ -4717,9 +4832,8 @@ dbus_message_demarshal (const char *str,
* Generally, this function is only useful for encapsulating D-Bus messages in
* a different protocol.
*
- * @param str data to be marshalled
- * @param len the length of str
- * @param error the location to save errors to
+ * @param buf data to be marshalled
+ * @param len the length of @p buf
* @returns -1 if there was no valid data to be demarshalled, 0 if there wasn't enough data to determine how much should be demarshalled. Otherwise returns the number of bytes to be demarshalled
*
*/
diff --git a/dbus/dbus-message.h b/dbus/dbus-message.h
index 5500492d..4fd44dab 100644
--- a/dbus/dbus-message.h
+++ b/dbus/dbus-message.h
@@ -71,13 +71,13 @@ DBusMessage* dbus_message_new (int message_type);
DBUS_EXPORT
DBusMessage* dbus_message_new_method_call (const char *bus_name,
const char *path,
- const char *interface,
+ const char *iface,
const char *method);
DBUS_EXPORT
DBusMessage* dbus_message_new_method_return (DBusMessage *method_call);
DBUS_EXPORT
DBusMessage* dbus_message_new_signal (const char *path,
- const char *interface,
+ const char *iface,
const char *name);
DBUS_EXPORT
DBusMessage* dbus_message_new_error (DBusMessage *reply_to,
@@ -108,12 +108,12 @@ dbus_bool_t dbus_message_has_path (DBusMessage *message,
const char *object_path);
DBUS_EXPORT
dbus_bool_t dbus_message_set_interface (DBusMessage *message,
- const char *interface);
+ const char *iface);
DBUS_EXPORT
const char* dbus_message_get_interface (DBusMessage *message);
DBUS_EXPORT
dbus_bool_t dbus_message_has_interface (DBusMessage *message,
- const char *interface);
+ const char *iface);
DBUS_EXPORT
dbus_bool_t dbus_message_set_member (DBusMessage *message,
const char *member);
@@ -146,11 +146,11 @@ DBUS_EXPORT
dbus_bool_t dbus_message_get_no_reply (DBusMessage *message);
DBUS_EXPORT
dbus_bool_t dbus_message_is_method_call (DBusMessage *message,
- const char *interface,
+ const char *iface,
const char *method);
DBUS_EXPORT
dbus_bool_t dbus_message_is_signal (DBusMessage *message,
- const char *interface,
+ const char *iface,
const char *signal_name);
DBUS_EXPORT
dbus_bool_t dbus_message_is_error (DBusMessage *message,
diff --git a/dbus/dbus-misc.c b/dbus/dbus-misc.c
index b1610133..6ca30f24 100644
--- a/dbus/dbus-misc.c
+++ b/dbus/dbus-misc.c
@@ -173,7 +173,7 @@ dbus_get_version (int *major_version_p,
/** @} */ /* End of public API */
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#ifndef DOXYGEN_SHOULD_SKIP_THIS
diff --git a/dbus/dbus-misc.h b/dbus/dbus-misc.h
index 3504bcaa..6e72d9ed 100644
--- a/dbus/dbus-misc.h
+++ b/dbus/dbus-misc.h
@@ -44,6 +44,10 @@ void dbus_get_version (int *major_version_p,
int *minor_version_p,
int *micro_version_p);
+DBUS_EXPORT
+dbus_bool_t dbus_setenv (const char *variable,
+ const char *value);
+
/** @} */
DBUS_END_DECLS
diff --git a/dbus/dbus-nonce.c b/dbus/dbus-nonce.c
index e74c2dd5..37f30f00 100644
--- a/dbus/dbus-nonce.c
+++ b/dbus/dbus-nonce.c
@@ -113,7 +113,15 @@ _dbus_read_nonce (const DBusString *fname, DBusString *nonce, DBusError* error)
fp = fopen (_dbus_string_get_const_data (fname), "rb");
if (!fp)
- return FALSE;
+ {
+ dbus_set_error (error,
+ _dbus_error_from_system_errno (),
+ "Failed to open %s for read: %s",
+ _dbus_string_get_const_data (fname),
+ _dbus_strerror_from_errno ());
+ return FALSE;
+ }
+
nread = fread (buffer, 1, sizeof buffer - 1, fp);
fclose (fp);
if (!nread)
@@ -240,6 +248,7 @@ do_noncefile_create (DBusNonceFile *noncefile,
dbus_bool_t use_subdir)
{
DBusString randomStr;
+ const char *tmp;
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
@@ -257,8 +266,11 @@ do_noncefile_create (DBusNonceFile *noncefile,
goto on_error;
}
+ tmp = _dbus_get_tmpdir ();
+
if (!_dbus_string_init (&noncefile->dir)
- || !_dbus_string_append (&noncefile->dir, _dbus_get_tmpdir()))
+ || tmp == NULL
+ || !_dbus_string_append (&noncefile->dir, tmp))
{
dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
goto on_error;
diff --git a/dbus/dbus-object-tree.c b/dbus/dbus-object-tree.c
index 172c9d95..d256018e 100644
--- a/dbus/dbus-object-tree.c
+++ b/dbus/dbus-object-tree.c
@@ -434,6 +434,185 @@ _dbus_object_tree_register (DBusObjectTree *tree,
}
/**
+ * Attempts to unregister the given subtree. If the subtree is registered,
+ * stores its unregister function and user data for later use and returns
+ * #TRUE. If subtree is not registered, simply returns #FALSE. Does not free
+ * subtree or remove it from the object tree.
+ *
+ * @param subtree the subtree to unregister
+ * @param unregister_function_out stores subtree's unregister_function
+ * @param user_data_out stores subtree's user_data
+ * @return #FALSE if the subtree was not registered, #TRUE on success
+ */
+static dbus_bool_t
+unregister_subtree (DBusObjectSubtree *subtree,
+ DBusObjectPathUnregisterFunction *unregister_function_out,
+ void **user_data_out)
+{
+ _dbus_assert (subtree != NULL);
+ _dbus_assert (unregister_function_out != NULL);
+ _dbus_assert (user_data_out != NULL);
+
+ /* Confirm subtree is registered */
+ if (subtree->message_function != NULL)
+ {
+ subtree->message_function = NULL;
+
+ *unregister_function_out = subtree->unregister_function;
+ *user_data_out = subtree->user_data;
+
+ subtree->unregister_function = NULL;
+ subtree->user_data = NULL;
+
+ return TRUE;
+ }
+ else
+ {
+ /* Assert that this unregistered subtree is either the root node or has
+ children, otherwise we have a dangling path which should never
+ happen */
+ _dbus_assert (subtree->parent == NULL || subtree->n_subtrees > 0);
+
+ /* The subtree is not registered */
+ return FALSE;
+ }
+}
+
+/**
+ * Attempts to remove a child subtree from its parent. If removal is
+ * successful, also frees the child. Returns #TRUE on success, #FALSE
+ * otherwise. A #FALSE return value tells unregister_and_free_path_recurse to
+ * stop attempting to remove ancestors, i.e., that no ancestors of the
+ * specified child are eligible for removal.
+ *
+ * @param parent parent from which to remove child
+ * @param child_index parent->subtrees index of child to remove
+ * @return #TRUE if removal and free succeed, #FALSE otherwise
+ */
+static dbus_bool_t
+attempt_child_removal (DBusObjectSubtree *parent,
+ int child_index)
+{
+ /* Candidate for removal */
+ DBusObjectSubtree* candidate;
+
+ _dbus_assert (parent != NULL);
+ _dbus_assert (child_index >= 0 && child_index < parent->n_subtrees);
+
+ candidate = parent->subtrees[child_index];
+ _dbus_assert (candidate != NULL);
+
+ if (candidate->n_subtrees == 0 && candidate->message_function == NULL)
+ {
+ /* The candidate node is childless and is not a registered
+ path, so... */
+
+ /* ... remove it from its parent... */
+ /* Assumes a 0-byte memmove is OK */
+ memmove (&parent->subtrees[child_index],
+ &parent->subtrees[child_index + 1],
+ (parent->n_subtrees - child_index - 1)
+ * sizeof (parent->subtrees[0]));
+ parent->n_subtrees -= 1;
+
+ /* ... and free it */
+ candidate->parent = NULL;
+ _dbus_object_subtree_unref (candidate);
+
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/**
+ * Searches the object tree for a registered subtree node at the given path.
+ * If a registered node is found, it is removed from the tree and freed, and
+ * TRUE is returned. If a registered subtree node is not found at the given
+ * path, the tree is not modified and FALSE is returned.
+ *
+ * The found node's unregister_function and user_data are returned in the
+ * corresponding _out arguments. The caller should define these variables and
+ * pass their addresses as arguments.
+ *
+ * Likewise, the caller should define and set to TRUE a boolean variable, then
+ * pass its address as the continue_removal_attempts argument.
+ *
+ * Once a matching registered node is found, removed and freed, the recursive
+ * return path is traversed. Along the way, eligible ancestor nodes are
+ * removed and freed. An ancestor node is eligible for removal if and only if
+ * 1) it has no children, i.e., it has become childless and 2) it is not itself
+ * a registered handler.
+ *
+ * For example, suppose /A/B and /A/C are registered paths, and that these are
+ * the only paths in the tree. If B is removed and freed, C is still reachable
+ * through A, so A cannot be removed and freed. If C is subsequently removed
+ * and freed, then A becomes a childless node and it becomes eligible for
+ * removal, and will be removed and freed.
+ *
+ * Similarly, suppose /A is a registered path, and /A/B is also a registered
+ * path, and that these are the only paths in the tree. If B is removed and
+ * freed, then even though A has become childless, it can't be freed because it
+ * refers to a path that is still registered.
+ *
+ * @param subtree subtree from which to start the search, root for initial call
+ * @param path path to subtree (same as _dbus_object_tree_unregister_and_unlock)
+ * @param continue_removal_attempts pointer to a bool, #TRUE for initial call
+ * @param unregister_function_out returns the found node's unregister_function
+ * @param user_data_out returns the found node's user_data
+ * @returns #TRUE if a registered node was found at path, #FALSE otherwise
+ */
+static dbus_bool_t
+unregister_and_free_path_recurse
+(DBusObjectSubtree *subtree,
+ const char **path,
+ dbus_bool_t *continue_removal_attempts,
+ DBusObjectPathUnregisterFunction *unregister_function_out,
+ void **user_data_out)
+{
+ int i, j;
+
+ _dbus_assert (continue_removal_attempts != NULL);
+ _dbus_assert (*continue_removal_attempts);
+ _dbus_assert (unregister_function_out != NULL);
+ _dbus_assert (user_data_out != NULL);
+
+ if (path[0] == NULL)
+ return unregister_subtree (subtree, unregister_function_out, user_data_out);
+
+ i = 0;
+ j = subtree->n_subtrees;
+ while (i < j)
+ {
+ int k, v;
+
+ k = (i + j) / 2;
+ v = strcmp (path[0], subtree->subtrees[k]->name);
+
+ if (v == 0)
+ {
+ dbus_bool_t freed;
+ freed = unregister_and_free_path_recurse (subtree->subtrees[k],
+ &path[1],
+ continue_removal_attempts,
+ unregister_function_out,
+ user_data_out);
+ if (freed && *continue_removal_attempts)
+ *continue_removal_attempts = attempt_child_removal (subtree, k);
+ return freed;
+ }
+ else if (v < 0)
+ {
+ j = k;
+ }
+ else
+ {
+ i = k + 1;
+ }
+ }
+ return FALSE;
+}
+
+/**
* Unregisters an object subtree that was registered with the
* same path.
*
@@ -444,66 +623,42 @@ void
_dbus_object_tree_unregister_and_unlock (DBusObjectTree *tree,
const char **path)
{
- int i;
- DBusObjectSubtree *subtree;
+ dbus_bool_t found_subtree;
+ dbus_bool_t continue_removal_attempts;
DBusObjectPathUnregisterFunction unregister_function;
void *user_data;
DBusConnection *connection;
+ _dbus_assert (tree != NULL);
_dbus_assert (path != NULL);
+ continue_removal_attempts = TRUE;
unregister_function = NULL;
user_data = NULL;
- subtree = find_subtree (tree, path, &i);
+ found_subtree = unregister_and_free_path_recurse (tree->root,
+ path,
+ &continue_removal_attempts,
+ &unregister_function,
+ &user_data);
#ifndef DBUS_DISABLE_CHECKS
- if (subtree == NULL)
+ if (found_subtree == FALSE)
{
_dbus_warn ("Attempted to unregister path (path[0] = %s path[1] = %s) which isn't registered\n",
path[0] ? path[0] : "null",
- path[1] ? path[1] : "null");
+ (path[0] && path[1]) ? path[1] : "null");
goto unlock;
}
#else
- _dbus_assert (subtree != NULL);
+ _dbus_assert (found_subtree == TRUE);
#endif
- _dbus_assert (subtree->parent == NULL ||
- (i >= 0 && subtree->parent->subtrees[i] == subtree));
-
- subtree->message_function = NULL;
-
- unregister_function = subtree->unregister_function;
- user_data = subtree->user_data;
-
- subtree->unregister_function = NULL;
- subtree->user_data = NULL;
-
- /* If we have no subtrees of our own, remove from
- * our parent (FIXME could also be more aggressive
- * and remove our parent if it becomes empty)
- */
- if (subtree->parent && subtree->n_subtrees == 0)
- {
- /* assumes a 0-byte memmove is OK */
- memmove (&subtree->parent->subtrees[i],
- &subtree->parent->subtrees[i+1],
- (subtree->parent->n_subtrees - i - 1) *
- sizeof (subtree->parent->subtrees[0]));
- subtree->parent->n_subtrees -= 1;
-
- subtree->parent = NULL;
-
- _dbus_object_subtree_unref (subtree);
- }
- subtree = NULL;
-
unlock:
connection = tree->connection;
/* Unlock and call application code */
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
if (connection)
#endif
{
@@ -515,7 +670,7 @@ unlock:
if (unregister_function)
(* unregister_function) (connection, user_data);
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
if (connection)
#endif
dbus_connection_unref (connection);
@@ -638,7 +793,7 @@ handle_default_introspect_and_unlock (DBusObjectTree *tree,
DBUS_INTERFACE_INTROSPECTABLE,
"Introspect"))
{
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
if (tree->connection)
#endif
{
@@ -653,7 +808,7 @@ handle_default_introspect_and_unlock (DBusObjectTree *tree,
if (!_dbus_string_init (&xml))
{
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
if (tree->connection)
#endif
{
@@ -698,7 +853,7 @@ handle_default_introspect_and_unlock (DBusObjectTree *tree,
if (!dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &v_STRING))
goto out;
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
if (tree->connection)
#endif
{
@@ -711,7 +866,7 @@ handle_default_introspect_and_unlock (DBusObjectTree *tree,
result = DBUS_HANDLER_RESULT_HANDLED;
out:
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
if (tree->connection)
#endif
{
@@ -741,6 +896,7 @@ handle_default_introspect_and_unlock (DBusObjectTree *tree,
*
* @param tree the global object tree
* @param message the message to dispatch
+ * @param found_object return location for the object
* @returns whether message was handled successfully
*/
DBusHandlerResult
@@ -762,7 +918,7 @@ _dbus_object_tree_dispatch_and_unlock (DBusObjectTree *tree,
path = NULL;
if (!dbus_message_get_path_decomposed (message, &path))
{
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
if (tree->connection)
#endif
{
@@ -777,7 +933,7 @@ _dbus_object_tree_dispatch_and_unlock (DBusObjectTree *tree,
if (path == NULL)
{
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
if (tree->connection)
#endif
{
@@ -846,7 +1002,7 @@ _dbus_object_tree_dispatch_and_unlock (DBusObjectTree *tree,
_dbus_verbose (" (invoking a handler)\n");
#endif
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
if (tree->connection)
#endif
{
@@ -863,7 +1019,7 @@ _dbus_object_tree_dispatch_and_unlock (DBusObjectTree *tree,
message,
user_data);
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
if (tree->connection)
#endif
_dbus_connection_lock (tree->connection);
@@ -886,7 +1042,7 @@ _dbus_object_tree_dispatch_and_unlock (DBusObjectTree *tree,
}
else
{
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
if (tree->connection)
#endif
{
@@ -1057,7 +1213,7 @@ _dbus_object_tree_list_registered_and_unlock (DBusObjectTree *tree,
parent_path,
child_entries);
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
if (tree->connection)
#endif
{
@@ -1214,7 +1370,7 @@ flatten_path (const char **path)
}
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#ifndef DOXYGEN_SHOULD_SKIP_THIS
@@ -1507,6 +1663,17 @@ run_decompose_tests (void)
return TRUE;
}
+static DBusObjectSubtree*
+find_subtree_registered_or_unregistered (DBusObjectTree *tree,
+ const char **path)
+{
+#if VERBOSE_FIND
+ _dbus_verbose ("Looking for exact subtree, registered or unregistered\n");
+#endif
+
+ return find_subtree_recurse (tree->root, path, FALSE, NULL, NULL);
+}
+
static dbus_bool_t
object_tree_test_iteration (void *data)
{
@@ -1519,6 +1686,13 @@ object_tree_test_iteration (void *data)
const char *path6[] = { "blah", "boof", NULL };
const char *path7[] = { "blah", "boof", "this", "is", "really", "long", NULL };
const char *path8[] = { "childless", NULL };
+ const char *path9[] = { "blah", "a", NULL };
+ const char *path10[] = { "blah", "b", NULL };
+ const char *path11[] = { "blah", "c", NULL };
+ const char *path12[] = { "blah", "a", "d", NULL };
+ const char *path13[] = { "blah", "b", "d", NULL };
+ const char *path14[] = { "blah", "c", "d", NULL };
+ DBusObjectPathVTable test_vtable = { NULL, test_message_function, NULL };
DBusObjectTree *tree;
TreeTestData tree_test_data[9];
int i;
@@ -1889,6 +2063,200 @@ object_tree_test_iteration (void *data)
++i;
}
+ /* Test removal of newly-childless unregistered nodes */
+ if (!do_register (tree, path2, TRUE, 2, tree_test_data))
+ goto out;
+
+ _dbus_object_tree_unregister_and_unlock (tree, path2);
+ _dbus_assert (!find_subtree_registered_or_unregistered (tree, path2));
+ _dbus_assert (!find_subtree_registered_or_unregistered (tree, path1));
+ _dbus_assert (find_subtree_registered_or_unregistered (tree, path0));
+
+ /* Test that unregistered parents cannot be freed out from under their
+ children */
+ if (!do_register (tree, path2, TRUE, 2, tree_test_data))
+ goto out;
+
+ _dbus_assert (!find_subtree (tree, path1, NULL));
+ _dbus_assert (find_subtree_registered_or_unregistered (tree, path1));
+ _dbus_assert (find_subtree_registered_or_unregistered (tree, path0));
+
+#if 0
+ /* This triggers the "Attempted to unregister path ..." warning message */
+ _dbus_object_tree_unregister_and_unlock (tree, path1);
+#endif
+ _dbus_assert (find_subtree (tree, path2, NULL));
+ _dbus_assert (!find_subtree (tree, path1, NULL));
+ _dbus_assert (find_subtree_registered_or_unregistered (tree, path1));
+ _dbus_assert (find_subtree_registered_or_unregistered (tree, path0));
+
+ _dbus_object_tree_unregister_and_unlock (tree, path2);
+ _dbus_assert (!find_subtree (tree, path2, NULL));
+ _dbus_assert (!find_subtree_registered_or_unregistered (tree, path2));
+ _dbus_assert (!find_subtree_registered_or_unregistered (tree, path1));
+ _dbus_assert (find_subtree_registered_or_unregistered (tree, path0));
+
+ /* Test that registered parents cannot be freed out from under their
+ children, and that if they are unregistered before their children, they
+ are still freed when their children are unregistered */
+ if (!do_register (tree, path1, TRUE, 1, tree_test_data))
+ goto out;
+ if (!do_register (tree, path2, TRUE, 2, tree_test_data))
+ goto out;
+
+ _dbus_assert (find_subtree (tree, path1, NULL));
+ _dbus_assert (find_subtree (tree, path2, NULL));
+
+ _dbus_object_tree_unregister_and_unlock (tree, path1);
+ _dbus_assert (!find_subtree (tree, path1, NULL));
+ _dbus_assert (find_subtree (tree, path2, NULL));
+ _dbus_assert (find_subtree_registered_or_unregistered (tree, path1));
+ _dbus_assert (find_subtree_registered_or_unregistered (tree, path0));
+
+ _dbus_object_tree_unregister_and_unlock (tree, path2);
+ _dbus_assert (!find_subtree (tree, path1, NULL));
+ _dbus_assert (!find_subtree_registered_or_unregistered (tree, path1));
+ _dbus_assert (!find_subtree (tree, path2, NULL));
+ _dbus_assert (!find_subtree_registered_or_unregistered (tree, path2));
+ _dbus_assert (find_subtree_registered_or_unregistered (tree, path0));
+
+ /* Test with NULL unregister_function and user_data */
+ if (!_dbus_object_tree_register (tree, TRUE, path2,
+ &test_vtable,
+ NULL,
+ NULL))
+ goto out;
+
+ _dbus_assert (_dbus_object_tree_get_user_data_unlocked (tree, path2) == NULL);
+ _dbus_object_tree_unregister_and_unlock (tree, path2);
+ _dbus_assert (!find_subtree (tree, path2, NULL));
+ _dbus_assert (!find_subtree_registered_or_unregistered (tree, path2));
+ _dbus_assert (!find_subtree_registered_or_unregistered (tree, path1));
+ _dbus_assert (find_subtree_registered_or_unregistered (tree, path0));
+
+ /* Test freeing a long path */
+ if (!do_register (tree, path3, TRUE, 3, tree_test_data))
+ goto out;
+
+ _dbus_object_tree_unregister_and_unlock (tree, path3);
+ _dbus_assert (!find_subtree (tree, path3, NULL));
+ _dbus_assert (!find_subtree_registered_or_unregistered (tree, path3));
+ _dbus_assert (!find_subtree_registered_or_unregistered (tree, path2));
+ _dbus_assert (!find_subtree_registered_or_unregistered (tree, path1));
+ _dbus_assert (find_subtree_registered_or_unregistered (tree, path0));
+
+ /* Test freeing multiple children from the same path */
+ if (!do_register (tree, path3, TRUE, 3, tree_test_data))
+ goto out;
+ if (!do_register (tree, path4, TRUE, 4, tree_test_data))
+ goto out;
+
+ _dbus_assert (find_subtree (tree, path3, NULL));
+ _dbus_assert (find_subtree (tree, path4, NULL));
+
+ _dbus_object_tree_unregister_and_unlock (tree, path3);
+ _dbus_assert (!find_subtree (tree, path3, NULL));
+ _dbus_assert (!find_subtree_registered_or_unregistered (tree, path3));
+ _dbus_assert (find_subtree (tree, path4, NULL));
+ _dbus_assert (find_subtree_registered_or_unregistered (tree, path4));
+ _dbus_assert (find_subtree_registered_or_unregistered (tree, path2));
+ _dbus_assert (find_subtree_registered_or_unregistered (tree, path1));
+
+ _dbus_object_tree_unregister_and_unlock (tree, path4);
+ _dbus_assert (!find_subtree (tree, path4, NULL));
+ _dbus_assert (!find_subtree_registered_or_unregistered (tree, path4));
+ _dbus_assert (!find_subtree (tree, path3, NULL));
+ _dbus_assert (!find_subtree_registered_or_unregistered (tree, path3));
+ _dbus_assert (!find_subtree_registered_or_unregistered (tree, path2));
+ _dbus_assert (!find_subtree_registered_or_unregistered (tree, path1));
+
+ /* Test subtree removal */
+ if (!_dbus_object_tree_register (tree, TRUE, path12,
+ &test_vtable,
+ NULL,
+ NULL))
+ goto out;
+
+ _dbus_assert (find_subtree (tree, path12, NULL));
+
+ if (!_dbus_object_tree_register (tree, TRUE, path13,
+ &test_vtable,
+ NULL,
+ NULL))
+ goto out;
+
+ _dbus_assert (find_subtree (tree, path13, NULL));
+
+ if (!_dbus_object_tree_register (tree, TRUE, path14,
+ &test_vtable,
+ NULL,
+ NULL))
+ goto out;
+
+ _dbus_assert (find_subtree (tree, path14, NULL));
+
+ _dbus_object_tree_unregister_and_unlock (tree, path12);
+
+ _dbus_assert (!find_subtree_registered_or_unregistered (tree, path12));
+ _dbus_assert (find_subtree (tree, path13, NULL));
+ _dbus_assert (find_subtree (tree, path14, NULL));
+ _dbus_assert (!find_subtree_registered_or_unregistered (tree, path9));
+ _dbus_assert (find_subtree_registered_or_unregistered (tree, path5));
+
+ if (!_dbus_object_tree_register (tree, TRUE, path12,
+ &test_vtable,
+ NULL,
+ NULL))
+ goto out;
+
+ _dbus_assert (find_subtree (tree, path12, NULL));
+
+ _dbus_object_tree_unregister_and_unlock (tree, path13);
+
+ _dbus_assert (find_subtree (tree, path12, NULL));
+ _dbus_assert (!find_subtree_registered_or_unregistered (tree, path13));
+ _dbus_assert (find_subtree (tree, path14, NULL));
+ _dbus_assert (!find_subtree_registered_or_unregistered (tree, path10));
+ _dbus_assert (find_subtree_registered_or_unregistered (tree, path5));
+
+ if (!_dbus_object_tree_register (tree, TRUE, path13,
+ &test_vtable,
+ NULL,
+ NULL))
+ goto out;
+
+ _dbus_assert (find_subtree (tree, path13, NULL));
+
+ _dbus_object_tree_unregister_and_unlock (tree, path14);
+
+ _dbus_assert (find_subtree (tree, path12, NULL));
+ _dbus_assert (find_subtree (tree, path13, NULL));
+ _dbus_assert (!find_subtree_registered_or_unregistered (tree, path14));
+ _dbus_assert (!find_subtree_registered_or_unregistered (tree, path11));
+ _dbus_assert (find_subtree_registered_or_unregistered (tree, path5));
+
+ _dbus_object_tree_unregister_and_unlock (tree, path12);
+
+ _dbus_assert (!find_subtree_registered_or_unregistered (tree, path12));
+ _dbus_assert (!find_subtree_registered_or_unregistered (tree, path9));
+ _dbus_assert (find_subtree_registered_or_unregistered (tree, path5));
+
+ _dbus_object_tree_unregister_and_unlock (tree, path13);
+
+ _dbus_assert (!find_subtree_registered_or_unregistered (tree, path13));
+ _dbus_assert (!find_subtree_registered_or_unregistered (tree, path10));
+ _dbus_assert (!find_subtree_registered_or_unregistered (tree, path5));
+
+#if 0
+ /* Test attempting to unregister non-existent paths. These trigger
+ "Attempted to unregister path ..." warning messages */
+ _dbus_object_tree_unregister_and_unlock (tree, path0);
+ _dbus_object_tree_unregister_and_unlock (tree, path1);
+ _dbus_object_tree_unregister_and_unlock (tree, path2);
+ _dbus_object_tree_unregister_and_unlock (tree, path3);
+ _dbus_object_tree_unregister_and_unlock (tree, path4);
+#endif
+
/* Register it all again, and test dispatch */
if (!do_register (tree, path0, TRUE, 0, tree_test_data))
@@ -1962,4 +2330,4 @@ _dbus_object_tree_test (void)
#endif /* !DOXYGEN_SHOULD_SKIP_THIS */
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/dbus/dbus-pending-call.c b/dbus/dbus-pending-call.c
index 62c6c748..be534105 100644
--- a/dbus/dbus-pending-call.c
+++ b/dbus/dbus-pending-call.c
@@ -79,26 +79,19 @@ struct DBusPendingCall
unsigned int timeout_added : 1; /**< Have added the timeout */
};
-#ifdef DBUS_ENABLE_VERBOSE_MODE
static void
_dbus_pending_call_trace_ref (DBusPendingCall *pending_call,
int old_refcount,
int new_refcount,
const char *why)
{
+#ifdef DBUS_ENABLE_VERBOSE_MODE
static int enabled = -1;
_dbus_trace_ref ("DBusPendingCall", pending_call, old_refcount,
new_refcount, why, "DBUS_PENDING_CALL_TRACE", &enabled);
-}
-#else
-#define _dbus_pending_call_trace_ref(p, o, n, w) \
- do \
- {\
- (void) (o); \
- (void) (n); \
- } while (0)
#endif
+}
static dbus_int32_t notify_user_data_slot = -1;
@@ -489,8 +482,8 @@ _dbus_pending_call_get_completed_unlocked (DBusPendingCall *pending)
return pending->completed;
}
-static DBusDataSlotAllocator slot_allocator;
-_DBUS_DEFINE_GLOBAL_LOCK (pending_call_slots);
+static DBusDataSlotAllocator slot_allocator =
+ _DBUS_DATA_SLOT_ALLOCATOR_INIT (_DBUS_LOCK_NAME (pending_call_slots));
/**
* Stores a pointer on a #DBusPendingCall, along
@@ -768,7 +761,6 @@ dbus_pending_call_allocate_data_slot (dbus_int32_t *slot_p)
_dbus_return_val_if_fail (slot_p != NULL, FALSE);
return _dbus_data_slot_allocator_alloc (&slot_allocator,
- &_DBUS_LOCK_NAME (pending_call_slots),
slot_p);
}
diff --git a/dbus/dbus-server-debug-pipe.c b/dbus/dbus-server-debug-pipe.c
index 419db5c5..8f5ff5fb 100644
--- a/dbus/dbus-server-debug-pipe.c
+++ b/dbus/dbus-server-debug-pipe.c
@@ -31,7 +31,7 @@
#include "dbus-string.h"
#include "dbus-protocol.h"
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
/**
* @defgroup DBusServerDebugPipe DBusServerDebugPipe
@@ -427,5 +427,5 @@ _dbus_transport_open_debug_pipe (DBusAddressEntry *entry,
/** @} */
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/dbus/dbus-server-launchd.c b/dbus/dbus-server-launchd.c
index db4673c5..9832875e 100644
--- a/dbus/dbus-server-launchd.c
+++ b/dbus/dbus-server-launchd.c
@@ -40,6 +40,7 @@
#include <launch.h>
#include <errno.h>
+#include "dbus-misc.h"
#include "dbus-server-socket.h"
/* put other private launchd functions here */
@@ -176,7 +177,7 @@ _dbus_server_new_for_launchd (const char *launchd_env_var, DBusError * error)
else
{
display = launch_data_get_string(environment_param);
- _dbus_setenv ("DISPLAY", display);
+ dbus_setenv ("DISPLAY", display);
}
}
}
diff --git a/dbus/dbus-server-protected.h b/dbus/dbus-server-protected.h
index dd5234b9..e6dbd1e1 100644
--- a/dbus/dbus-server-protected.h
+++ b/dbus/dbus-server-protected.h
@@ -99,9 +99,8 @@ dbus_bool_t _dbus_server_add_watch (DBusServer *server,
DBusWatch *watch);
void _dbus_server_remove_watch (DBusServer *server,
DBusWatch *watch);
-void _dbus_server_toggle_watch (DBusServer *server,
- DBusWatch *watch,
- dbus_bool_t enabled);
+void _dbus_server_toggle_all_watches (DBusServer *server,
+ dbus_bool_t enabled);
dbus_bool_t _dbus_server_add_timeout (DBusServer *server,
DBusTimeout *timeout);
void _dbus_server_remove_timeout (DBusServer *server,
diff --git a/dbus/dbus-server-socket.c b/dbus/dbus-server-socket.c
index ae4b602e..060a919e 100644
--- a/dbus/dbus-server-socket.c
+++ b/dbus/dbus-server-socket.c
@@ -101,7 +101,7 @@ handle_new_client_fd_and_unlock (DBusServer *server,
return TRUE;
}
- transport = _dbus_transport_new_for_socket (client_fd, &server->guid_hex, FALSE);
+ transport = _dbus_transport_new_for_socket (client_fd, &server->guid_hex, NULL);
if (transport == NULL)
{
_dbus_close_socket (client_fd, NULL);
@@ -478,7 +478,10 @@ _dbus_server_new_for_tcp_socket (const char *host,
if (server == NULL)
{
dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto failed_4;
+ if (noncefile != NULL)
+ goto failed_4;
+ else
+ goto failed_2;
}
_dbus_string_free (&port_str);
diff --git a/dbus/dbus-server-unix.c b/dbus/dbus-server-unix.c
index 130f66ec..d9952404 100644
--- a/dbus/dbus-server-unix.c
+++ b/dbus/dbus-server-unix.c
@@ -149,7 +149,7 @@ _dbus_server_listen_platform_specific (DBusAddressEntry *entry,
}
else if (strcmp (method, "systemd") == 0)
{
- int n, *fds;
+ int i, n, *fds;
DBusString address;
n = _dbus_listen_systemd_sockets (&fds, error);
@@ -159,27 +159,39 @@ _dbus_server_listen_platform_specific (DBusAddressEntry *entry,
return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
}
- _dbus_string_init_const (&address, "systemd:");
+ if (!_dbus_string_init (&address))
+ goto systemd_oom;
- *server_p = _dbus_server_new_for_socket (fds, n, &address, NULL);
- if (*server_p == NULL)
+ for (i = 0; i < n; i++)
{
- int i;
-
- for (i = 0; i < n; i++)
+ if (i > 0)
{
- _dbus_close_socket (fds[i], NULL);
+ if (!_dbus_string_append (&address, ";"))
+ goto systemd_oom;
}
- dbus_free (fds);
-
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
+ if (!_dbus_append_address_from_socket (fds[i], &address, error))
+ goto systemd_err;
}
+ *server_p = _dbus_server_new_for_socket (fds, n, &address, NULL);
+ if (*server_p == NULL)
+ goto systemd_oom;
+
dbus_free (fds);
return DBUS_SERVER_LISTEN_OK;
- }
+ systemd_oom:
+ _DBUS_SET_OOM (error);
+ systemd_err:
+ for (i = 0; i < n; i++)
+ {
+ _dbus_close_socket (fds[i], NULL);
+ }
+ dbus_free (fds);
+ _dbus_string_free (&address);
+
+ return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
+ }
#ifdef DBUS_ENABLE_LAUNCHD
else if (strcmp (method, "launchd") == 0)
{
diff --git a/dbus/dbus-server.c b/dbus/dbus-server.c
index b62c2b40..c1d5f6e5 100644
--- a/dbus/dbus-server.c
+++ b/dbus/dbus-server.c
@@ -26,7 +26,7 @@
#include "dbus-server-unix.h"
#include "dbus-server-socket.h"
#include "dbus-string.h"
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#include "dbus-server-debug-pipe.h"
#endif
#include "dbus-address.h"
@@ -312,26 +312,17 @@ _dbus_server_remove_watch (DBusServer *server,
}
/**
- * Toggles a watch and notifies app via server's
- * DBusWatchToggledFunction if available. It's an error to call this
- * function on a watch that was not previously added.
+ * Toggles all watch and notifies app via server's
+ * DBusWatchToggledFunction if available.
*
* @param server the server.
- * @param watch the watch to toggle.
* @param enabled whether to enable or disable
*/
void
-_dbus_server_toggle_watch (DBusServer *server,
- DBusWatch *watch,
- dbus_bool_t enabled)
+_dbus_server_toggle_all_watches (DBusServer *server,
+ dbus_bool_t enabled)
{
- _dbus_assert (watch != NULL);
-
- HAVE_LOCK_CHECK (server);
- protected_change_watch (server, watch,
- NULL, NULL,
- _dbus_watch_list_toggle_watch,
- enabled);
+ _dbus_watch_list_toggle_all_watches (server->watches, enabled);
}
/** Function to be called in protected_change_timeout() with refcount held */
@@ -529,7 +520,7 @@ static const struct {
} listen_funcs[] = {
{ _dbus_server_listen_socket }
, { _dbus_server_listen_platform_specific }
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
, { _dbus_server_listen_debug_pipe }
#endif
};
@@ -699,13 +690,11 @@ dbus_server_ref (DBusServer *server)
_dbus_return_val_if_fail (server != NULL, NULL);
- /* can't get the refcount without a side-effect */
old_refcount = _dbus_atomic_inc (&server->refcount);
#ifndef DBUS_DISABLE_CHECKS
if (_DBUS_UNLIKELY (old_refcount <= 0))
{
- /* undo side-effect first */
_dbus_atomic_dec (&server->refcount);
_dbus_warn_check_failed (_dbus_return_if_fail_warning_format,
_DBUS_FUNCTION_NAME, "old_refcount > 0",
@@ -736,13 +725,18 @@ dbus_server_unref (DBusServer *server)
_dbus_return_if_fail (server != NULL);
- /* can't get the refcount without a side-effect */
old_refcount = _dbus_atomic_dec (&server->refcount);
#ifndef DBUS_DISABLE_CHECKS
if (_DBUS_UNLIKELY (old_refcount <= 0))
{
- /* undo side-effect first */
+ /* undo side-effect first
+ * please do not try to simplify the code here by using
+ * _dbus_atomic_get(), why we don't use it is
+ * because it issues another atomic operation even though
+ * DBUS_DISABLE_CHECKS defined.
+ * Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68303
+ */
_dbus_atomic_inc (&server->refcount);
_dbus_warn_check_failed (_dbus_return_if_fail_warning_format,
_DBUS_FUNCTION_NAME, "old_refcount > 0",
@@ -777,16 +771,7 @@ dbus_server_disconnect (DBusServer *server)
{
_dbus_return_if_fail (server != NULL);
-#ifdef DBUS_DISABLE_CHECKS
- _dbus_atomic_inc (&server->refcount);
-#else
- {
- dbus_int32_t old_refcount = _dbus_atomic_inc (&server->refcount);
-
- _dbus_return_if_fail (old_refcount > 0);
- }
-#endif
-
+ dbus_server_ref (server);
SERVER_LOCK (server);
_dbus_assert (server->vtable->disconnect != NULL);
@@ -1071,9 +1056,8 @@ dbus_server_set_auth_mechanisms (DBusServer *server,
return TRUE;
}
-
-static DBusDataSlotAllocator slot_allocator;
-_DBUS_DEFINE_GLOBAL_LOCK (server_slots);
+static DBusDataSlotAllocator slot_allocator =
+ _DBUS_DATA_SLOT_ALLOCATOR_INIT (_DBUS_LOCK_NAME (server_slots));
/**
* Allocates an integer ID to be used for storing application-specific
@@ -1093,7 +1077,6 @@ dbus_bool_t
dbus_server_allocate_data_slot (dbus_int32_t *slot_p)
{
return _dbus_data_slot_allocator_alloc (&slot_allocator,
- (DBusRMutex **)&_DBUS_LOCK_NAME (server_slots),
slot_p);
}
@@ -1190,7 +1173,7 @@ dbus_server_get_data (DBusServer *server,
/** @} */
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#include "dbus-test.h"
#include <string.h>
@@ -1246,4 +1229,4 @@ _dbus_server_test (void)
return TRUE;
}
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/dbus/dbus-sha.c b/dbus/dbus-sha.c
index d1827522..febfba20 100644
--- a/dbus/dbus-sha.c
+++ b/dbus/dbus-sha.c
@@ -511,7 +511,7 @@ _dbus_sha_compute (const DBusString *data,
/** @} */ /* end of exported functions */
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#include "dbus-test.h"
#include <stdio.h>
@@ -966,4 +966,4 @@ _dbus_sha_test (const char *test_data_dir)
return TRUE;
}
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/dbus/dbus-shell.c b/dbus/dbus-shell.c
index 111d39df..2384961c 100644
--- a/dbus/dbus-shell.c
+++ b/dbus/dbus-shell.c
@@ -150,7 +150,7 @@ unquote_string_inplace (char* str, char** end)
* through literally instead of being expanded). This function is
* guaranteed to succeed if applied to the result of
* _dbus_shell_quote(). If it fails, it returns %NULL.
- * The @quoted_string need not actually contain quoted or
+ * The @p quoted_string need not actually contain quoted or
* escaped text; _dbus_shell_unquote() simply goes through the string and
* unquotes/unescapes anything that the shell would. Both single and
* double quotes are handled, as are escapes including escaped
@@ -163,7 +163,7 @@ unquote_string_inplace (char* str, char** end)
* be escaped with backslash. Otherwise double quotes preserve things
* literally.
*
- * @quoted_string: shell-quoted string
+ * @param quoted_string shell-quoted string
**/
char*
_dbus_shell_unquote (const char *quoted_string)
@@ -544,10 +544,10 @@ tokenize_command_line (const char *command_line, DBusError *error)
* does contain such expansions, they are passed through
* literally. Free the returned vector with dbus_free_string_array().
*
- * @command_line: command line to parse
- * @argcp: return location for number of args
- * @argvp: return location for array of args
- * @error: error information
+ * @param command_line command line to parse
+ * @param argcp return location for number of args
+ * @param argvp return location for array of args
+ * @param error error information
**/
dbus_bool_t
_dbus_shell_parse_argv (const char *command_line,
diff --git a/dbus/dbus-signature.c b/dbus/dbus-signature.c
index c130de5b..8a4701c9 100644
--- a/dbus/dbus-signature.c
+++ b/dbus/dbus-signature.c
@@ -410,7 +410,7 @@ dbus_type_is_valid (int typecode)
/** @} */ /* end of DBusSignature group */
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
/**
* @ingroup DBusSignatureInternals
diff --git a/dbus/dbus-socket-set-poll.c b/dbus/dbus-socket-set-poll.c
index 65a1fd23..e322a3b4 100644
--- a/dbus/dbus-socket-set-poll.c
+++ b/dbus/dbus-socket-set-poll.c
@@ -44,7 +44,7 @@ typedef struct {
#define MINIMUM_SIZE 8
/* If we're in the regression tests, force reallocation to happen sooner */
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#define DEFAULT_SIZE_HINT 1
#else
#define DEFAULT_SIZE_HINT MINIMUM_SIZE
diff --git a/dbus/dbus-spawn-win.c b/dbus/dbus-spawn-win.c
index 3dae4f38..7da7a431 100644
--- a/dbus/dbus-spawn-win.c
+++ b/dbus/dbus-spawn-win.c
@@ -63,12 +63,12 @@ struct DBusBabysitter
int refcount;
HANDLE start_sync_event;
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
HANDLE end_sync_event;
#endif
- char *executable;
+ char *log_name;
DBusSpawnChildSetupFunc child_setup;
void *user_data;
@@ -109,7 +109,7 @@ _dbus_babysitter_new (void)
return NULL;
}
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
sitter->end_sync_event = CreateEvent (NULL, FALSE, FALSE, NULL);
if (sitter->end_sync_event == NULL)
{
@@ -250,7 +250,7 @@ _dbus_babysitter_unref (DBusBabysitter *sitter)
sitter->start_sync_event = NULL;
}
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
if (sitter->end_sync_event != NULL)
{
CloseHandle (sitter->end_sync_event);
@@ -258,7 +258,7 @@ _dbus_babysitter_unref (DBusBabysitter *sitter)
}
#endif
- dbus_free (sitter->executable);
+ dbus_free (sitter->log_name);
dbus_free (sitter);
}
@@ -337,7 +337,7 @@ _dbus_babysitter_set_child_exit_error (DBusBabysitter *sitter,
char *emsg = _dbus_win_error_string (sitter->spawn_errno);
dbus_set_error (error, DBUS_ERROR_SPAWN_EXEC_FAILED,
"Failed to execute program %s: %s",
- sitter->executable, emsg);
+ sitter->log_name, emsg);
_dbus_win_free_error_string (emsg);
}
else if (sitter->have_child_status)
@@ -345,14 +345,14 @@ _dbus_babysitter_set_child_exit_error (DBusBabysitter *sitter,
PING();
dbus_set_error (error, DBUS_ERROR_SPAWN_CHILD_EXITED,
"Process %s exited with status %d",
- sitter->executable, sitter->child_status);
+ sitter->log_name, sitter->child_status);
}
else
{
PING();
dbus_set_error (error, DBUS_ERROR_FAILED,
"Process %s exited, status unknown",
- sitter->executable);
+ sitter->log_name);
}
PING();
}
@@ -593,10 +593,10 @@ babysitter (void *parameter)
(*sitter->child_setup) (sitter->user_data);
}
- _dbus_verbose ("babysitter: spawning %s\n", sitter->executable);
+ _dbus_verbose ("babysitter: spawning %s\n", sitter->log_name);
PING();
- sitter->child_handle = spawn_program (sitter->executable,
+ sitter->child_handle = spawn_program (sitter->log_name,
sitter->argv, sitter->envp);
PING();
@@ -628,7 +628,7 @@ babysitter (void *parameter)
sitter->child_handle = NULL;
}
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
SetEvent (sitter->end_sync_event);
#endif
@@ -642,6 +642,7 @@ babysitter (void *parameter)
dbus_bool_t
_dbus_spawn_async_with_babysitter (DBusBabysitter **sitter_p,
+ const char *log_name,
char **argv,
char **envp,
DBusSpawnChildSetupFunc child_setup,
@@ -653,6 +654,7 @@ _dbus_spawn_async_with_babysitter (DBusBabysitter **sitter_p,
DWORD sitter_thread_id;
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
+ _dbus_assert (argv[0] != NULL);
*sitter_p = NULL;
@@ -667,8 +669,17 @@ _dbus_spawn_async_with_babysitter (DBusBabysitter **sitter_p,
sitter->child_setup = child_setup;
sitter->user_data = user_data;
- sitter->executable = _dbus_strdup (argv[0]);
- if (sitter->executable == NULL)
+ sitter->log_name = _dbus_strdup (log_name);
+ if (sitter->log_name == NULL && log_name != NULL)
+ {
+ _DBUS_SET_OOM (error);
+ goto out0;
+ }
+
+ if (sitter->log_name == NULL)
+ sitter->log_name = _dbus_strdup (argv[0]);
+
+ if (sitter->log_name == NULL)
{
_DBUS_SET_OOM (error);
goto out0;
@@ -753,7 +764,7 @@ _dbus_babysitter_set_result_function (DBusBabysitter *sitter,
sitter->finished_data = user_data;
}
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
static char *
get_test_exec (const char *exe,
@@ -804,7 +815,7 @@ check_spawn_nonexistent (void *data)
/*** Test launching nonexistent binary */
argv[0] = "/this/does/not/exist/32542sdgafgafdg";
- if (_dbus_spawn_async_with_babysitter (&sitter, argv, NULL,
+ if (_dbus_spawn_async_with_babysitter (&sitter, "spawn_nonexistent", argv, NULL,
NULL, NULL,
&error))
{
@@ -857,7 +868,7 @@ check_spawn_segfault (void *data)
return TRUE;
}
- if (_dbus_spawn_async_with_babysitter (&sitter, argv, NULL,
+ if (_dbus_spawn_async_with_babysitter (&sitter, "spawn_segfault", argv, NULL,
NULL, NULL,
&error))
{
@@ -912,7 +923,7 @@ check_spawn_exit (void *data)
return TRUE;
}
- if (_dbus_spawn_async_with_babysitter (&sitter, argv, NULL,
+ if (_dbus_spawn_async_with_babysitter (&sitter, "spawn_exit", argv, NULL,
NULL, NULL,
&error))
{
@@ -967,7 +978,7 @@ check_spawn_and_kill (void *data)
return TRUE;
}
- if (_dbus_spawn_async_with_babysitter (&sitter, argv, NULL,
+ if (_dbus_spawn_async_with_babysitter (&sitter, "spawn_and_kill", argv, NULL,
NULL, NULL,
&error))
{
diff --git a/dbus/dbus-spawn.c b/dbus/dbus-spawn.c
index ef00801c..b95cad6e 100644
--- a/dbus/dbus-spawn.c
+++ b/dbus/dbus-spawn.c
@@ -38,6 +38,12 @@
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
+#ifdef HAVE_SYSTEMD
+#ifdef HAVE_SYSLOG_H
+#include <syslog.h>
+#endif
+#include <systemd/sd-journal.h>
+#endif
extern char **environ;
@@ -174,6 +180,48 @@ read_pid (int fd,
* and the grandchild. The grandchild is our spawned process. The intermediate
* child is a babysitter process; it keeps track of when the grandchild
* exits/crashes, and reaps the grandchild.
+ *
+ * We automatically reap the babysitter process, killing it if necessary,
+ * when the DBusBabysitter's refcount goes to zero.
+ *
+ * Processes:
+ *
+ * main process
+ * | fork() A
+ * \- babysitter
+ * | fork () B
+ * \- grandchild --> exec --> spawned process
+ *
+ * IPC:
+ * child_err_report_pipe
+ * /-----------<---------<--------------\
+ * | ^
+ * v |
+ * main process babysitter grandchild
+ * ^ ^
+ * v v
+ * \-------<->-------/
+ * babysitter_pipe
+ *
+ * child_err_report_pipe is genuinely a pipe.
+ * The READ_END (also called error_pipe_from_child) is used in the main
+ * process. The WRITE_END (also called child_err_report_fd) is used in
+ * the grandchild process.
+ *
+ * On failure, the grandchild process sends CHILD_EXEC_FAILED + errno.
+ * On success, the pipe just closes (because it's close-on-exec) without
+ * sending any bytes.
+ *
+ * babysitter_pipe is mis-named: it's really a bidirectional socketpair.
+ * The [0] end (also called socket_to_babysitter) is used in the main
+ * process, the [1] end (also called parent_pipe) is used in the babysitter.
+ *
+ * If the fork() labelled B in the diagram above fails, the babysitter sends
+ * CHILD_FORK_FAILED + errno.
+ * On success, the babysitter sends CHILD_PID + the grandchild's pid.
+ * On SIGCHLD, the babysitter sends CHILD_EXITED + the exit status.
+ * The main process doesn't explicitly send anything, but when it exits,
+ * the babysitter gets POLLHUP or POLLERR.
*/
/* Messages from children to parents */
@@ -192,7 +240,8 @@ struct DBusBabysitter
{
int refcount; /**< Reference count */
- char *executable; /**< executable name to use in error messages */
+ char *log_name; /**< the name under which to log messages about this
+ process being spawned */
int socket_to_babysitter; /**< Connection to the babysitter process */
int error_pipe_from_child; /**< Connection to the process that does the exec() */
@@ -308,15 +357,18 @@ _dbus_babysitter_unref (DBusBabysitter *sitter)
if (ret == 0)
kill (sitter->sitter_pid, SIGKILL);
- again:
if (ret == 0)
- ret = waitpid (sitter->sitter_pid, &status, 0);
+ {
+ do
+ {
+ ret = waitpid (sitter->sitter_pid, &status, 0);
+ }
+ while (_DBUS_UNLIKELY (ret < 0 && errno == EINTR));
+ }
if (ret < 0)
{
- if (errno == EINTR)
- goto again;
- else if (errno == ECHILD)
+ if (errno == ECHILD)
_dbus_warn ("Babysitter process not available to be reaped; should not happen\n");
else
_dbus_warn ("Unexpected error %d in waitpid() for babysitter: %s\n",
@@ -343,7 +395,7 @@ _dbus_babysitter_unref (DBusBabysitter *sitter)
if (sitter->watches)
_dbus_watch_list_free (sitter->watches);
- dbus_free (sitter->executable);
+ dbus_free (sitter->log_name);
dbus_free (sitter);
}
@@ -698,34 +750,34 @@ _dbus_babysitter_set_child_exit_error (DBusBabysitter *sitter,
{
dbus_set_error (error, DBUS_ERROR_SPAWN_EXEC_FAILED,
"Failed to execute program %s: %s",
- sitter->executable, _dbus_strerror (sitter->errnum));
+ sitter->log_name, _dbus_strerror (sitter->errnum));
}
else if (sitter->have_fork_errnum)
{
dbus_set_error (error, DBUS_ERROR_NO_MEMORY,
"Failed to fork a new process %s: %s",
- sitter->executable, _dbus_strerror (sitter->errnum));
+ sitter->log_name, _dbus_strerror (sitter->errnum));
}
else if (sitter->have_child_status)
{
if (WIFEXITED (sitter->status))
dbus_set_error (error, DBUS_ERROR_SPAWN_CHILD_EXITED,
"Process %s exited with status %d",
- sitter->executable, WEXITSTATUS (sitter->status));
+ sitter->log_name, WEXITSTATUS (sitter->status));
else if (WIFSIGNALED (sitter->status))
dbus_set_error (error, DBUS_ERROR_SPAWN_CHILD_SIGNALED,
"Process %s received signal %d",
- sitter->executable, WTERMSIG (sitter->status));
+ sitter->log_name, WTERMSIG (sitter->status));
else
dbus_set_error (error, DBUS_ERROR_FAILED,
"Process %s exited abnormally",
- sitter->executable);
+ sitter->log_name);
}
else
{
dbus_set_error (error, DBUS_ERROR_FAILED,
"Process %s exited, reason unknown",
- sitter->executable);
+ sitter->log_name);
}
}
@@ -807,9 +859,14 @@ handle_watch (DBusWatch *watch,
#define WRITE_END 1
-/* Avoids a danger in threaded situations (calling close()
- * on a file descriptor twice, and another thread has
- * re-opened it since the first close)
+/* Avoids a danger in re-entrant situations (calling close()
+ * on a file descriptor twice, and another module has
+ * re-opened it since the first close).
+ *
+ * This previously claimed to be relevant for threaded situations, but by
+ * trivial inspection, it is not thread-safe. It doesn't actually
+ * matter, since this module is only used in the -util variant of the
+ * library, which is only used in single-threaded situations.
*/
static int
close_and_invalidate (int *fd)
@@ -936,7 +993,7 @@ do_exec (int child_err_report_fd,
DBusSpawnChildSetupFunc child_setup,
void *user_data)
{
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
int i, max_open;
#endif
@@ -947,7 +1004,7 @@ do_exec (int child_err_report_fd,
if (child_setup)
(* child_setup) (user_data);
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
max_open = sysconf (_SC_OPEN_MAX);
for (i = 3; i < max_open; i++)
@@ -1115,8 +1172,7 @@ babysit (pid_t grandchild_pid,
}
/**
- * Spawns a new process. The executable name and argv[0]
- * are the same, both are provided in argv[0]. The child_setup
+ * Spawns a new process. The child_setup
* function is passed the given user_data and is run in the child
* just before calling exec().
*
@@ -1126,8 +1182,9 @@ babysit (pid_t grandchild_pid,
* If sitter_p is #NULL, no babysitter is kept.
*
* @param sitter_p return location for babysitter or #NULL
+ * @param log_name the name under which to log messages about this process being spawned
* @param argv the executable and arguments
- * @param env the environment (not used on unix yet)
+ * @param env the environment, or #NULL to copy the parent's
* @param child_setup function to call in child pre-exec()
* @param user_data user data for setup function
* @param error error object to be filled in if function fails
@@ -1135,6 +1192,7 @@ babysit (pid_t grandchild_pid,
*/
dbus_bool_t
_dbus_spawn_async_with_babysitter (DBusBabysitter **sitter_p,
+ const char *log_name,
char **argv,
char **env,
DBusSpawnChildSetupFunc child_setup,
@@ -1145,8 +1203,13 @@ _dbus_spawn_async_with_babysitter (DBusBabysitter **sitter_p,
int child_err_report_pipe[2] = { -1, -1 };
int babysitter_pipe[2] = { -1, -1 };
pid_t pid;
+#ifdef HAVE_SYSTEMD
+ int fd_out = -1;
+ int fd_err = -1;
+#endif
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
+ _dbus_assert (argv[0] != NULL);
if (sitter_p != NULL)
*sitter_p = NULL;
@@ -1160,8 +1223,17 @@ _dbus_spawn_async_with_babysitter (DBusBabysitter **sitter_p,
return FALSE;
}
- sitter->executable = _dbus_strdup (argv[0]);
- if (sitter->executable == NULL)
+ sitter->log_name = _dbus_strdup (log_name);
+ if (sitter->log_name == NULL && log_name != NULL)
+ {
+ dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
+ goto cleanup_and_fail;
+ }
+
+ if (sitter->log_name == NULL)
+ sitter->log_name = _dbus_strdup (argv[0]);
+
+ if (sitter->log_name == NULL)
{
dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
goto cleanup_and_fail;
@@ -1221,7 +1293,16 @@ _dbus_spawn_async_with_babysitter (DBusBabysitter **sitter_p,
}
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
+
+#ifdef HAVE_SYSTEMD
+ /* This may fail, but it's not critical.
+ * In particular, if we were compiled with journald support but are now
+ * running on a non-systemd system, this is going to fail, so we
+ * have to cope gracefully. */
+ fd_out = sd_journal_stream_fd (sitter->log_name, LOG_INFO, FALSE);
+ fd_err = sd_journal_stream_fd (sitter->log_name, LOG_WARNING, FALSE);
+#endif
+
pid = fork ();
if (pid < 0)
@@ -1256,7 +1337,21 @@ _dbus_spawn_async_with_babysitter (DBusBabysitter **sitter_p,
_dbus_assert_not_reached ("Got to code after write_err_and_exit()");
}
else if (grandchild_pid == 0)
- {
+ {
+ /* Go back to ignoring SIGPIPE, since it's evil
+ */
+ signal (SIGPIPE, SIG_IGN);
+
+ close_and_invalidate (&babysitter_pipe[1]);
+#ifdef HAVE_SYSTEMD
+ /* log to systemd journal if possible */
+ if (fd_out >= 0)
+ dup2 (fd_out, STDOUT_FILENO);
+ if (fd_err >= 0)
+ dup2 (fd_err, STDERR_FILENO);
+ close_and_invalidate (&fd_out);
+ close_and_invalidate (&fd_err);
+#endif
do_exec (child_err_report_pipe[WRITE_END],
argv,
env,
@@ -1265,6 +1360,11 @@ _dbus_spawn_async_with_babysitter (DBusBabysitter **sitter_p,
}
else
{
+ close_and_invalidate (&child_err_report_pipe[WRITE_END]);
+#ifdef HAVE_SYSTEMD
+ close_and_invalidate (&fd_out);
+ close_and_invalidate (&fd_err);
+#endif
babysit (grandchild_pid, babysitter_pipe[1]);
_dbus_assert_not_reached ("Got to code after babysit()");
}
@@ -1274,6 +1374,10 @@ _dbus_spawn_async_with_babysitter (DBusBabysitter **sitter_p,
/* Close the uncared-about ends of the pipes */
close_and_invalidate (&child_err_report_pipe[WRITE_END]);
close_and_invalidate (&babysitter_pipe[1]);
+#ifdef HAVE_SYSTEMD
+ close_and_invalidate (&fd_out);
+ close_and_invalidate (&fd_err);
+#endif
sitter->socket_to_babysitter = babysitter_pipe[0];
babysitter_pipe[0] = -1;
@@ -1303,6 +1407,10 @@ _dbus_spawn_async_with_babysitter (DBusBabysitter **sitter_p,
close_and_invalidate (&child_err_report_pipe[WRITE_END]);
close_and_invalidate (&babysitter_pipe[0]);
close_and_invalidate (&babysitter_pipe[1]);
+#ifdef HAVE_SYSTEMD
+ close_and_invalidate (&fd_out);
+ close_and_invalidate (&fd_err);
+#endif
if (sitter != NULL)
_dbus_babysitter_unref (sitter);
@@ -1321,7 +1429,7 @@ _dbus_babysitter_set_result_function (DBusBabysitter *sitter,
/** @} */
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
static char *
get_test_exec (const char *exe,
@@ -1364,7 +1472,7 @@ check_spawn_nonexistent (void *data)
/*** Test launching nonexistent binary */
argv[0] = "/this/does/not/exist/32542sdgafgafdg";
- if (_dbus_spawn_async_with_babysitter (&sitter, argv,
+ if (_dbus_spawn_async_with_babysitter (&sitter, "spawn_nonexistent", argv,
NULL, NULL, NULL,
&error))
{
@@ -1413,7 +1521,7 @@ check_spawn_segfault (void *data)
return TRUE;
}
- if (_dbus_spawn_async_with_babysitter (&sitter, argv,
+ if (_dbus_spawn_async_with_babysitter (&sitter, "spawn_segfault", argv,
NULL, NULL, NULL,
&error))
{
@@ -1464,7 +1572,7 @@ check_spawn_exit (void *data)
return TRUE;
}
- if (_dbus_spawn_async_with_babysitter (&sitter, argv,
+ if (_dbus_spawn_async_with_babysitter (&sitter, "spawn_exit", argv,
NULL, NULL, NULL,
&error))
{
@@ -1515,7 +1623,7 @@ check_spawn_and_kill (void *data)
return TRUE;
}
- if (_dbus_spawn_async_with_babysitter (&sitter, argv,
+ if (_dbus_spawn_async_with_babysitter (&sitter, "spawn_and_kill", argv,
NULL, NULL, NULL,
&error))
{
diff --git a/dbus/dbus-spawn.h b/dbus/dbus-spawn.h
index a8814fb9..e6baae97 100644
--- a/dbus/dbus-spawn.h
+++ b/dbus/dbus-spawn.h
@@ -39,6 +39,7 @@ typedef void (* DBusBabysitterFinishedFunc) (DBusBabysitter *sitter,
void *user_data);
dbus_bool_t _dbus_spawn_async_with_babysitter (DBusBabysitter **sitter_p,
+ const char *log_name,
char **argv,
char **env,
DBusSpawnChildSetupFunc child_setup,
diff --git a/dbus/dbus-string-util.c b/dbus/dbus-string-util.c
index 922580da..3babc053 100644
--- a/dbus/dbus-string-util.c
+++ b/dbus/dbus-string-util.c
@@ -115,7 +115,7 @@ _dbus_string_find_byte_backward (const DBusString *str,
/** @} */
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#include "dbus-test.h"
#include <stdio.h>
@@ -935,4 +935,4 @@ _dbus_string_test (void)
return TRUE;
}
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/dbus/dbus-string.c b/dbus/dbus-string.c
index e3766aad..c4e2e7fc 100644
--- a/dbus/dbus-string.c
+++ b/dbus/dbus-string.c
@@ -246,6 +246,14 @@ _dbus_string_free (DBusString *str)
if (real->constant)
return;
+
+ /* so it's safe if @p str returned by a failed
+ * _dbus_string_init call
+ * Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65959
+ */
+ if (real->str == NULL)
+ return;
+
dbus_free (real->str - real->align_offset);
real->invalid = TRUE;
@@ -277,9 +285,9 @@ compact (DBusRealString *real,
return TRUE;
}
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
/* Not using this feature at the moment,
- * so marked DBUS_BUILD_TESTS-only
+ * so marked DBUS_ENABLE_EMBEDDED_TESTS-only
*/
/**
* Locks a string such that any attempts to change the string will
@@ -303,7 +311,7 @@ _dbus_string_lock (DBusString *str)
#define MAX_WASTE 48
compact (real, MAX_WASTE);
}
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
static dbus_bool_t
reallocate_for_length (DBusRealString *real,
@@ -327,14 +335,11 @@ reallocate_for_length (DBusRealString *real,
* disable asserts to profile, you don't get this destroyer
* of profiles.
*/
-#ifdef DBUS_DISABLE_ASSERT
-#else
-#ifdef DBUS_BUILD_TESTS
+#if defined (DBUS_ENABLE_EMBEDDED_TESTS) && !defined (DBUS_DISABLE_ASSERT)
new_allocated = 0; /* ensure a realloc every time so that we go
* through all malloc failure codepaths
*/
-#endif /* DBUS_BUILD_TESTS */
-#endif /* !DBUS_DISABLE_ASSERT */
+#endif
/* But be sure we always alloc at least space for the new length */
new_allocated = MAX (new_allocated,
@@ -933,29 +938,9 @@ _dbus_string_append (DBusString *str,
#define ASSIGN_4_OCTETS(p, octets) \
*((dbus_uint32_t*)(p)) = *((dbus_uint32_t*)(octets));
-#ifdef DBUS_HAVE_INT64
/** assign 8 bytes from one string to another */
#define ASSIGN_8_OCTETS(p, octets) \
*((dbus_uint64_t*)(p)) = *((dbus_uint64_t*)(octets));
-#else
-/** assign 8 bytes from one string to another */
-#define ASSIGN_8_OCTETS(p, octets) \
-do { \
- unsigned char *b; \
- \
- b = p; \
- \
- *b++ = octets[0]; \
- *b++ = octets[1]; \
- *b++ = octets[2]; \
- *b++ = octets[3]; \
- *b++ = octets[4]; \
- *b++ = octets[5]; \
- *b++ = octets[6]; \
- *b++ = octets[7]; \
- _dbus_assert (b == p + 8); \
-} while (0)
-#endif /* DBUS_HAVE_INT64 */
/**
* Inserts 2 bytes aligned on a 2 byte boundary
@@ -969,7 +954,7 @@ do { \
dbus_bool_t
_dbus_string_insert_2_aligned (DBusString *str,
int insert_at,
- const unsigned char octets[4])
+ const unsigned char octets[2])
{
DBUS_STRING_PREAMBLE (str);
@@ -1896,7 +1881,7 @@ _dbus_string_skip_white_reverse (const DBusString *str,
* @todo owen correctly notes that this is a stupid function (it was
* written purely for test code,
* e.g. dbus-message-builder.c). Probably should be enforced as test
- * code only with ifdef DBUS_BUILD_TESTS
+ * code only with ifdef DBUS_ENABLE_EMBEDDED_TESTS
*
* @param source the source string
* @param dest the destination string (contents are replaced)
@@ -1940,7 +1925,7 @@ _dbus_string_pop_line (DBusString *source,
return TRUE;
}
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
/**
* Deletes up to and including the first blank space
* in the string.
@@ -1959,7 +1944,7 @@ _dbus_string_delete_first_word (DBusString *str)
}
#endif
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
/**
* Deletes any leading blanks in the string
*
@@ -2220,7 +2205,7 @@ _dbus_string_starts_with_c_str (const DBusString *a,
*/
dbus_bool_t
_dbus_string_append_byte_as_hex (DBusString *str,
- int byte)
+ unsigned char byte)
{
const char hexdigits[16] = {
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
diff --git a/dbus/dbus-string.h b/dbus/dbus-string.h
index 4ef59db1..86fb8c39 100644
--- a/dbus/dbus-string.h
+++ b/dbus/dbus-string.h
@@ -259,7 +259,7 @@ void _dbus_string_delete_first_word (DBusString *str);
void _dbus_string_delete_leading_blanks (DBusString *str);
void _dbus_string_chop_white (DBusString *str);
dbus_bool_t _dbus_string_append_byte_as_hex (DBusString *str,
- int byte);
+ unsigned char byte);
dbus_bool_t _dbus_string_hex_encode (const DBusString *source,
int start,
DBusString *dest,
diff --git a/dbus/dbus-syntax.c b/dbus/dbus-syntax.c
index 47922875..7ef659cb 100644
--- a/dbus/dbus-syntax.c
+++ b/dbus/dbus-syntax.c
@@ -93,7 +93,7 @@ dbus_validate_path (const char *path,
* is also checked, since it assumes that the string ends at the first zero
* byte according to normal C conventions.
*
- * @param path a potentially invalid interface name, which must not be #NULL
+ * @param name a potentially invalid interface name, which must not be #NULL
* @param error error return
* @returns #TRUE if name is valid
*/
@@ -140,7 +140,7 @@ dbus_validate_interface (const char *name,
* is also checked, since it assumes that the string ends at the first zero
* byte according to normal C conventions.
*
- * @param path a potentially invalid member name, which must not be #NULL
+ * @param name a potentially invalid member name, which must not be #NULL
* @param error error return
* @returns #TRUE if name is valid
*/
@@ -187,7 +187,7 @@ dbus_validate_member (const char *name,
* is also checked, since it assumes that the string ends at the first zero
* byte according to normal C conventions.
*
- * @param path a potentially invalid error name, which must not be #NULL
+ * @param name a potentially invalid error name, which must not be #NULL
* @param error error return
* @returns #TRUE if name is valid
*/
@@ -234,7 +234,7 @@ dbus_validate_error_name (const char *name,
* is also checked, since it assumes that the string ends at the first zero
* byte according to normal C conventions.
*
- * @param path a potentially invalid bus name, which must not be #NULL
+ * @param name a potentially invalid bus name, which must not be #NULL
* @param error error return
* @returns #TRUE if name is valid
*/
diff --git a/dbus/dbus-sysdeps-pthread.c b/dbus/dbus-sysdeps-pthread.c
index c60457be..1300ec35 100644
--- a/dbus/dbus-sysdeps-pthread.c
+++ b/dbus/dbus-sysdeps-pthread.c
@@ -36,12 +36,14 @@
#include <config.h>
+#ifdef HAVE_MONOTONIC_CLOCK
/* Whether we have a "monotonic" clock; i.e. a clock not affected by
* changes in system time.
* This is initialized once in check_monotonic_clock below.
* https://bugs.freedesktop.org/show_bug.cgi?id=18121
*/
static dbus_bool_t have_monotonic_clock = 0;
+#endif
struct DBusRMutex {
pthread_mutex_t lock; /**< the lock */
@@ -281,5 +283,20 @@ _dbus_threads_init_platform_specific (void)
*/
check_monotonic_clock ();
(void) _dbus_check_setuid ();
- return dbus_threads_init (NULL);
+
+ return TRUE;
+}
+
+static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
+
+void
+_dbus_threads_lock_platform_specific (void)
+{
+ pthread_mutex_lock (&init_mutex);
+}
+
+void
+_dbus_threads_unlock_platform_specific (void)
+{
+ pthread_mutex_unlock (&init_mutex);
}
diff --git a/dbus/dbus-sysdeps-thread-win.c b/dbus/dbus-sysdeps-thread-win.c
index e30e7b87..0887a549 100644
--- a/dbus/dbus-sysdeps-thread-win.c
+++ b/dbus/dbus-sysdeps-thread-win.c
@@ -30,6 +30,21 @@
#include <windows.h>
+static dbus_bool_t global_init_done = FALSE;
+static CRITICAL_SECTION init_lock;
+
+/* Called from C++ code in dbus-init-win.cpp. */
+void
+_dbus_threads_windows_init_global (void)
+{
+ /* this ensures that the object that acts as our global constructor
+ * actually gets linked in when we're linked statically */
+ _dbus_threads_windows_ensure_ctor_linked ();
+
+ InitializeCriticalSection (&init_lock);
+ global_init_done = TRUE;
+}
+
struct DBusCondVar {
DBusList *list; /**< list thread-local-stored events waiting on the cond variable */
CRITICAL_SECTION lock; /**< lock protecting the list */
@@ -269,6 +284,19 @@ _dbus_threads_init_platform_specific (void)
return FALSE;
}
- return dbus_threads_init (NULL);
+ return TRUE;
+}
+
+void
+_dbus_threads_lock_platform_specific (void)
+{
+ _dbus_assert (global_init_done);
+ EnterCriticalSection (&init_lock);
}
+void
+_dbus_threads_unlock_platform_specific (void)
+{
+ _dbus_assert (global_init_done);
+ LeaveCriticalSection (&init_lock);
+}
diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c
index fc677990..fe891ab7 100644
--- a/dbus/dbus-sysdeps-unix.c
+++ b/dbus/dbus-sysdeps-unix.c
@@ -55,6 +55,7 @@
#include <netinet/in.h>
#include <netdb.h>
#include <grp.h>
+#include <arpa/inet.h>
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -81,6 +82,10 @@
#include "sd-daemon.h"
+#if !DBUS_USE_SYNC
+#include <pthread.h>
+#endif
+
#ifndef O_BINARY
#define O_BINARY 0
#endif
@@ -139,7 +144,7 @@ _dbus_open_socket (int *fd_p,
cloexec_done = *fd_p >= 0;
/* Check if kernel seems to be too old to know SOCK_CLOEXEC */
- if (*fd_p < 0 && errno == EINVAL)
+ if (*fd_p < 0 && (errno == EINVAL || errno == EPROTOTYPE))
#endif
{
*fd_p = socket (domain, type, protocol);
@@ -315,6 +320,12 @@ _dbus_read_socket_with_unix_fds (int fd,
m.msg_control = alloca(m.msg_controllen);
memset(m.msg_control, 0, m.msg_controllen);
+ /* Do not include the padding at the end when we tell the kernel
+ * how much we're willing to receive. This avoids getting
+ * the padding filled with additional fds that we weren't expecting,
+ * if a (potentially malicious) sender included them. (fd.o #83622) */
+ m.msg_controllen = CMSG_LEN (*n_fds * sizeof(int));
+
again:
bytes_read = recvmsg(fd, &m, 0
@@ -354,18 +365,49 @@ _dbus_read_socket_with_unix_fds (int fd,
for (cm = CMSG_FIRSTHDR(&m); cm; cm = CMSG_NXTHDR(&m, cm))
if (cm->cmsg_level == SOL_SOCKET && cm->cmsg_type == SCM_RIGHTS)
{
- unsigned i;
-
- _dbus_assert(cm->cmsg_len <= CMSG_LEN(*n_fds * sizeof(int)));
- *n_fds = (cm->cmsg_len - CMSG_LEN(0)) / sizeof(int);
+ size_t i;
+ int *payload = (int *) CMSG_DATA (cm);
+ size_t payload_len_bytes = (cm->cmsg_len - CMSG_LEN (0));
+ size_t payload_len_fds = payload_len_bytes / sizeof (int);
+ size_t fds_to_use;
+
+ /* Every non-negative int fits in a size_t without truncation,
+ * and we already know that *n_fds is non-negative, so
+ * casting (size_t) *n_fds is OK */
+ _DBUS_STATIC_ASSERT (sizeof (size_t) >= sizeof (int));
+
+ if (_DBUS_LIKELY (payload_len_fds <= (size_t) *n_fds))
+ {
+ /* The fds in the payload will fit in our buffer */
+ fds_to_use = payload_len_fds;
+ }
+ else
+ {
+ /* Too many fds in the payload. This shouldn't happen
+ * any more because we're setting m.msg_controllen to
+ * the exact number we can accept, but be safe and
+ * truncate. */
+ fds_to_use = (size_t) *n_fds;
+
+ /* Close the excess fds to avoid DoS: if they stayed open,
+ * someone could send us an extra fd per message
+ * and we'd eventually run out. */
+ for (i = fds_to_use; i < payload_len_fds; i++)
+ {
+ close (payload[i]);
+ }
+ }
- memcpy(fds, CMSG_DATA(cm), *n_fds * sizeof(int));
+ memcpy (fds, payload, fds_to_use * sizeof (int));
found = TRUE;
+ /* This cannot overflow because we have chosen fds_to_use
+ * to be <= *n_fds */
+ *n_fds = (int) fds_to_use;
/* Linux doesn't tell us whether MSG_CMSG_CLOEXEC actually
worked, hence we need to go through this list and set
CLOEXEC everywhere in any case */
- for (i = 0; i < *n_fds; i++)
+ for (i = 0; i < fds_to_use; i++)
_dbus_fd_set_close_on_exec(fds[i]);
break;
@@ -736,7 +778,7 @@ _dbus_write_two (int fd,
}
#else /* HAVE_WRITEV */
{
- int ret1;
+ int ret1, ret2;
ret1 = _dbus_write (fd, buffer1, start1, len1);
if (ret1 == len1 && buffer2 != NULL)
@@ -887,16 +929,24 @@ _dbus_connect_exec (const char *path,
{
int fds[2];
pid_t pid;
+ int retval;
+ dbus_bool_t cloexec_done = 0;
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
_dbus_verbose ("connecting to process %s\n", path);
- if (socketpair (AF_UNIX, SOCK_STREAM
#ifdef SOCK_CLOEXEC
- |SOCK_CLOEXEC
+ retval = socketpair (AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0, fds);
+ cloexec_done = (retval >= 0);
+
+ if (retval < 0 && (errno == EINVAL || errno == EPROTOTYPE))
#endif
- , 0, fds) < 0)
+ {
+ retval = socketpair (AF_UNIX, SOCK_STREAM, 0, fds);
+ }
+
+ if (retval < 0)
{
dbus_set_error (error,
_dbus_error_from_errno (errno),
@@ -905,8 +955,11 @@ _dbus_connect_exec (const char *path,
return -1;
}
- _dbus_fd_set_close_on_exec (fds[0]);
- _dbus_fd_set_close_on_exec (fds[1]);
+ if (!cloexec_done)
+ {
+ _dbus_fd_set_close_on_exec (fds[0]);
+ _dbus_fd_set_close_on_exec (fds[1]);
+ }
pid = fork ();
if (pid < 0)
@@ -959,39 +1012,6 @@ _dbus_connect_exec (const char *path,
}
/**
- * Enables or disables the reception of credentials on the given socket during
- * the next message transmission. This is only effective if the #LOCAL_CREDS
- * system feature exists, in which case the other side of the connection does
- * not have to do anything special to send the credentials.
- *
- * @param fd socket on which to change the #LOCAL_CREDS flag.
- * @param on whether to enable or disable the #LOCAL_CREDS flag.
- */
-static dbus_bool_t
-_dbus_set_local_creds (int fd, dbus_bool_t on)
-{
- dbus_bool_t retval = TRUE;
-
-#if defined(HAVE_CMSGCRED)
- /* NOOP just to make sure only one codepath is used
- * and to prefer CMSGCRED
- */
-#elif defined(LOCAL_CREDS)
- int val = on ? 1 : 0;
- if (setsockopt (fd, 0, LOCAL_CREDS, &val, sizeof (val)) < 0)
- {
- _dbus_verbose ("Unable to set LOCAL_CREDS socket option on fd %d\n", fd);
- retval = FALSE;
- }
- else
- _dbus_verbose ("LOCAL_CREDS %s for further messages on fd %d\n",
- on ? "enabled" : "disabled", fd);
-#endif
-
- return retval;
-}
-
-/**
* Creates a socket and binds it to the given path,
* then listens on the socket. The socket is
* set to be nonblocking.
@@ -1016,7 +1036,6 @@ _dbus_listen_unix_socket (const char *path,
int listen_fd;
struct sockaddr_un addr;
size_t path_len;
- unsigned int reuseaddr;
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
@@ -1091,13 +1110,6 @@ _dbus_listen_unix_socket (const char *path,
strncpy (addr.sun_path, path, path_len);
}
- reuseaddr = 1;
- if (setsockopt (listen_fd, SOL_SOCKET, SO_REUSEADDR, &reuseaddr, sizeof(reuseaddr))==-1)
- {
- _dbus_warn ("Failed to set socket option\"%s\": %s",
- path, _dbus_strerror (errno));
- }
-
if (bind (listen_fd, (struct sockaddr*) &addr, _DBUS_STRUCT_OFFSET (struct sockaddr_un, sun_path) + path_len) < 0)
{
dbus_set_error (error, _dbus_error_from_errno (errno),
@@ -1116,15 +1128,6 @@ _dbus_listen_unix_socket (const char *path,
return -1;
}
- if (!_dbus_set_local_creds (listen_fd, TRUE))
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Failed to enable LOCAL_CREDS on socket \"%s\": %s",
- path, _dbus_strerror (errno));
- close (listen_fd);
- return -1;
- }
-
if (!_dbus_set_fd_nonblocking (listen_fd, error))
{
_DBUS_ASSERT_ERROR_IS_SET (error);
@@ -1148,7 +1151,7 @@ _dbus_listen_unix_socket (const char *path,
*
* This will set FD_CLOEXEC for the sockets returned.
*
- * @oaram fds the file descriptors
+ * @param fds the file descriptors
* @param error return location for errors
* @returns the number of file descriptors
*/
@@ -1210,14 +1213,6 @@ _dbus_listen_systemd_sockets (int **fds,
for (fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + n; fd ++)
{
- if (!_dbus_set_local_creds (fd, TRUE))
- {
- dbus_set_error (error, _dbus_error_from_errno (errno),
- "Failed to enable LOCAL_CREDS on systemd socket: %s",
- _dbus_strerror (errno));
- goto fail;
- }
-
if (!_dbus_set_fd_nonblocking (fd, error))
{
_DBUS_ASSERT_ERROR_IS_SET (error);
@@ -1606,13 +1601,19 @@ write_credentials_byte (int server_fd,
|MSG_NOSIGNAL
#endif
);
-#else
- bytes_written = send (server_fd, buf, 1, 0
-#if HAVE_DECL_MSG_NOSIGNAL
- |MSG_NOSIGNAL
+
+ /* If we HAVE_CMSGCRED, the OS still might not let us sendmsg()
+ * with a SOL_SOCKET/SCM_CREDS message - for instance, FreeBSD
+ * only allows that on AF_UNIX. Try just doing a send() instead. */
+ if (bytes_written < 0 && errno == EINVAL)
#endif
- );
+ {
+ bytes_written = send (server_fd, buf, 1, 0
+#if HAVE_DECL_MSG_NOSIGNAL
+ |MSG_NOSIGNAL
#endif
+ );
+ }
if (bytes_written < 0 && errno == EINTR)
goto again;
@@ -1676,12 +1677,6 @@ _dbus_read_credentials_socket (int client_fd,
struct cmsghdr hdr;
char cred[CMSG_SPACE (sizeof (struct cmsgcred))];
} cmsg;
-
-#elif defined(LOCAL_CREDS)
- struct {
- struct cmsghdr hdr;
- struct sockcred cred;
- } cmsg;
#endif
uid_read = DBUS_UID_UNSET;
@@ -1699,12 +1694,6 @@ _dbus_read_credentials_socket (int client_fd,
_dbus_credentials_clear (credentials);
- /* Systems supporting LOCAL_CREDS are configured to have this feature
- * enabled (if it does not conflict with HAVE_CMSGCRED) prior accepting
- * the connection. Therefore, the received message must carry the
- * credentials information without doing anything special.
- */
-
iov.iov_base = &buf;
iov.iov_len = 1;
@@ -1712,7 +1701,7 @@ _dbus_read_credentials_socket (int client_fd,
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
-#if defined(HAVE_CMSGCRED) || defined(LOCAL_CREDS)
+#if defined(HAVE_CMSGCRED)
_DBUS_ZERO(cmsg);
msg.msg_control = (caddr_t) &cmsg;
msg.msg_controllen = CMSG_SPACE (sizeof (struct cmsgcred));
@@ -1752,20 +1741,18 @@ _dbus_read_credentials_socket (int client_fd,
return FALSE;
}
-#if defined(HAVE_CMSGCRED) || defined(LOCAL_CREDS)
- if (cmsg.hdr.cmsg_len < CMSG_LEN (sizeof (struct cmsgcred))
- || cmsg.hdr.cmsg_type != SCM_CREDS)
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Message from recvmsg() was not SCM_CREDS");
- return FALSE;
- }
-#endif
-
_dbus_verbose ("read credentials byte\n");
{
#ifdef SO_PEERCRED
+ /* Supported by at least Linux and OpenBSD, with minor differences.
+ *
+ * This mechanism passes the process ID through and does not require
+ * the peer's cooperation, so we prefer it over all others. Notably,
+ * Linux also supports SCM_CREDENTIALS, which is similar to FreeBSD
+ * SCM_CREDS; it's implemented in GIO, but we don't use it in dbus at all,
+ * because this is much less fragile.
+ */
#ifdef __OpenBSD__
struct sockpeercred cr;
#else
@@ -1785,29 +1772,36 @@ _dbus_read_credentials_socket (int client_fd,
cr_len, (int) sizeof (cr), _dbus_strerror (errno));
}
#elif defined(HAVE_CMSGCRED)
+ /* We only check for HAVE_CMSGCRED, but we're really assuming that the
+ * presence of that struct implies SCM_CREDS. Supported by at least
+ * FreeBSD and DragonflyBSD.
+ *
+ * This mechanism requires the peer to help us (it has to send us a
+ * SCM_CREDS message) but it does pass the process ID through,
+ * which makes it better than getpeereid().
+ */
struct cmsgcred *cred;
+ struct cmsghdr *cmsgp;
- cred = (struct cmsgcred *) CMSG_DATA (&cmsg.hdr);
- pid_read = cred->cmcred_pid;
- uid_read = cred->cmcred_euid;
-#elif defined(LOCAL_CREDS)
- pid_read = DBUS_PID_UNSET;
- uid_read = cmsg.cred.sc_uid;
- /* Since we have already got the credentials from this socket, we can
- * disable its LOCAL_CREDS flag if it was ever set. */
- _dbus_set_local_creds (client_fd, FALSE);
-#elif defined(HAVE_GETPEEREID)
- uid_t euid;
- gid_t egid;
- if (getpeereid (client_fd, &euid, &egid) == 0)
- {
- uid_read = euid;
- }
- else
+ for (cmsgp = CMSG_FIRSTHDR (&msg);
+ cmsgp != NULL;
+ cmsgp = CMSG_NXTHDR (&msg, cmsgp))
{
- _dbus_verbose ("Failed to getpeereid() credentials: %s\n", _dbus_strerror (errno));
+ if (cmsgp->cmsg_type == SCM_CREDS &&
+ cmsgp->cmsg_level == SOL_SOCKET &&
+ cmsgp->cmsg_len >= CMSG_LEN (sizeof (struct cmsgcred)))
+ {
+ cred = (struct cmsgcred *) CMSG_DATA (cmsgp);
+ pid_read = cred->cmcred_pid;
+ uid_read = cred->cmcred_euid;
+ break;
+ }
}
+
#elif defined(HAVE_GETPEERUCRED)
+ /* Supported in at least Solaris >= 10. It should probably be higher
+ * up this list, because it carries the pid and we use this code path
+ * for audit data. */
ucred_t * ucred = NULL;
if (getpeerucred (client_fd, &ucred) == 0)
{
@@ -1851,7 +1845,54 @@ _dbus_read_credentials_socket (int client_fd,
}
if (ucred != NULL)
ucred_free (ucred);
-#else /* !SO_PEERCRED && !HAVE_CMSGCRED && !HAVE_GETPEEREID && !HAVE_GETPEERUCRED */
+
+ /* ----------------------------------------------------------------
+ * When adding new mechanisms, please add them above this point
+ * if they support passing the process ID through, or below if not.
+ * ---------------------------------------------------------------- */
+
+#elif defined(HAVE_GETPEEREID)
+ /* getpeereid() originates from D.J. Bernstein and is fairly
+ * widely-supported. According to a web search, it might be present in
+ * any/all of:
+ *
+ * - AIX?
+ * - Blackberry?
+ * - Cygwin
+ * - FreeBSD 4.6+ (but we prefer SCM_CREDS: it carries the pid)
+ * - Mac OS X
+ * - Minix 3.1.8+
+ * - MirBSD?
+ * - NetBSD 5.0+ (but LOCAL_PEEREID would be better: it carries the pid)
+ * - OpenBSD 3.0+ (but we prefer SO_PEERCRED: it carries the pid)
+ * - QNX?
+ */
+ uid_t euid;
+ gid_t egid;
+ if (getpeereid (client_fd, &euid, &egid) == 0)
+ {
+ uid_read = euid;
+ }
+ else
+ {
+ _dbus_verbose ("Failed to getpeereid() credentials: %s\n", _dbus_strerror (errno));
+ }
+#else /* no supported mechanism */
+
+#warning Socket credentials not supported on this Unix OS
+#warning Please tell https://bugs.freedesktop.org/enter_bug.cgi?product=DBus
+
+ /* Please add other operating systems known to support at least one of
+ * the mechanisms above to this list, keeping alphabetical order.
+ * Everything not in this list is best-effort.
+ */
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
+ defined(__linux__) || \
+ defined(__OpenBSD__) || \
+ defined(__NetBSD__)
+# error Credentials passing not working on this OS is a regression!
+#endif
+
_dbus_verbose ("Socket credentials not supported on this OS\n");
#endif
}
@@ -1865,7 +1906,7 @@ _dbus_read_credentials_socket (int client_fd,
if (pid_read != DBUS_PID_UNSET)
{
- if (!_dbus_credentials_add_unix_pid (credentials, pid_read))
+ if (!_dbus_credentials_add_pid (credentials, pid_read))
{
_DBUS_SET_OOM (error);
return FALSE;
@@ -1937,11 +1978,15 @@ _dbus_accept (int listen_fd)
retry:
#ifdef HAVE_ACCEPT4
- /* We assume that if accept4 is available SOCK_CLOEXEC is too */
+ /*
+ * At compile-time, we assume that if accept4() is available in
+ * libc headers, SOCK_CLOEXEC is too. At runtime, it is still
+ * not necessarily true that either is supported by the running kernel.
+ */
client_fd = accept4 (listen_fd, &addr, &addrlen, SOCK_CLOEXEC);
cloexec_done = client_fd >= 0;
- if (client_fd < 0 && errno == ENOSYS)
+ if (client_fd < 0 && (errno == ENOSYS || errno == EINVAL))
#endif
{
client_fd = accept (listen_fd, &addr, &addrlen);
@@ -1991,6 +2036,16 @@ _dbus_check_dir_is_private_to_user (DBusString *dir, DBusError *error)
return FALSE;
}
+ if (sb.st_uid != geteuid ())
+ {
+ dbus_set_error (error, DBUS_ERROR_FAILED,
+ "%s directory is owned by user %lu, not %lu",
+ directory,
+ (unsigned long) sb.st_uid,
+ (unsigned long) geteuid ());
+ return FALSE;
+ }
+
if ((S_IROTH & sb.st_mode) || (S_IWOTH & sb.st_mode) ||
(S_IRGRP & sb.st_mode) || (S_IWGRP & sb.st_mode))
{
@@ -2320,7 +2375,7 @@ _dbus_credentials_add_from_current_process (DBusCredentials *credentials)
_dbus_assert (sizeof (uid_t) <= sizeof (dbus_uid_t));
_dbus_assert (sizeof (gid_t) <= sizeof (dbus_gid_t));
- if (!_dbus_credentials_add_unix_pid(credentials, _dbus_getpid()))
+ if (!_dbus_credentials_add_pid(credentials, _dbus_getpid()))
return FALSE;
if (!_dbus_credentials_add_unix_uid(credentials, _dbus_geteuid()))
return FALSE;
@@ -2427,7 +2482,12 @@ _dbus_parse_uid (const DBusString *uid_str,
}
#if !DBUS_USE_SYNC
-_DBUS_DEFINE_GLOBAL_LOCK (atomic);
+/* To be thread-safe by default on platforms that don't necessarily have
+ * atomic operations (notably Debian armel, which is armv4t), we must
+ * use a mutex that can be initialized statically, like this.
+ * GLib >= 2.32 uses a similar system.
+ */
+static pthread_mutex_t atomic_mutex = PTHREAD_MUTEX_INITIALIZER;
#endif
/**
@@ -2443,10 +2503,12 @@ _dbus_atomic_inc (DBusAtomic *atomic)
return __sync_add_and_fetch(&atomic->value, 1)-1;
#else
dbus_int32_t res;
- _DBUS_LOCK (atomic);
+
+ pthread_mutex_lock (&atomic_mutex);
res = atomic->value;
atomic->value += 1;
- _DBUS_UNLOCK (atomic);
+ pthread_mutex_unlock (&atomic_mutex);
+
return res;
#endif
}
@@ -2465,10 +2527,11 @@ _dbus_atomic_dec (DBusAtomic *atomic)
#else
dbus_int32_t res;
- _DBUS_LOCK (atomic);
+ pthread_mutex_lock (&atomic_mutex);
res = atomic->value;
atomic->value -= 1;
- _DBUS_UNLOCK (atomic);
+ pthread_mutex_unlock (&atomic_mutex);
+
return res;
#endif
}
@@ -2489,9 +2552,10 @@ _dbus_atomic_get (DBusAtomic *atomic)
#else
dbus_int32_t res;
- _DBUS_LOCK (atomic);
+ pthread_mutex_lock (&atomic_mutex);
res = atomic->value;
- _DBUS_UNLOCK (atomic);
+ pthread_mutex_unlock (&atomic_mutex);
+
return res;
#endif
}
@@ -2915,6 +2979,7 @@ _dbus_close (int fd,
* (i.e. avoids stdin/stdout/stderr). Sets O_CLOEXEC.
*
* @param fd the file descriptor to duplicate
+ * @param error address of error location.
* @returns duplicated file descriptor
* */
int
@@ -3055,7 +3120,7 @@ _dbus_full_duplex_pipe (int *fd1,
retval = socketpair(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0, fds);
cloexec_done = retval >= 0;
- if (retval < 0 && errno == EINVAL)
+ if (retval < 0 && (errno == EINVAL || errno == EPROTOTYPE))
#endif
{
retval = socketpair(AF_UNIX, SOCK_STREAM, 0, fds);
@@ -3121,8 +3186,11 @@ _dbus_printf_string_upper_bound (const char *format,
char static_buf[1024];
int bufsize = sizeof (static_buf);
int len;
+ va_list args_copy;
- len = vsnprintf (static_buf, bufsize, format, args);
+ DBUS_VA_COPY (args_copy, args);
+ len = vsnprintf (static_buf, bufsize, format, args_copy);
+ va_end (args_copy);
/* If vsnprintf() returned non-negative, then either the string fits in
* static_buf, or this OS has the POSIX and C99 behaviour where vsnprintf
@@ -3138,8 +3206,12 @@ _dbus_printf_string_upper_bound (const char *format,
* or the real length could be coincidentally the same. Which is it?
* If vsnprintf returns the truncated length, we'll go to the slow
* path. */
- if (vsnprintf (static_buf, 1, format, args) == 1)
+ DBUS_VA_COPY (args_copy, args);
+
+ if (vsnprintf (static_buf, 1, format, args_copy) == 1)
len = -1;
+
+ va_end (args_copy);
}
/* If vsnprintf() returned negative, we have to do more work.
@@ -3155,7 +3227,10 @@ _dbus_printf_string_upper_bound (const char *format,
if (buf == NULL)
return -1;
- len = vsnprintf (buf, bufsize, format, args);
+ DBUS_VA_COPY (args_copy, args);
+ len = vsnprintf (buf, bufsize, format, args_copy);
+ va_end (args_copy);
+
dbus_free (buf);
/* If the reported length is exactly the buffer size, round up to the
@@ -3172,13 +3247,17 @@ _dbus_printf_string_upper_bound (const char *format,
* Gets the temporary files directory by inspecting the environment variables
* TMPDIR, TMP, and TEMP in that order. If none of those are set "/tmp" is returned
*
- * @returns location of temp directory
+ * @returns location of temp directory, or #NULL if no memory for locking
*/
const char*
_dbus_get_tmpdir(void)
{
+ /* Protected by _DBUS_LOCK_sysdeps */
static const char* tmpdir = NULL;
+ if (!_DBUS_LOCK (sysdeps))
+ return NULL;
+
if (tmpdir == NULL)
{
/* TMPDIR is what glibc uses, then
@@ -3201,11 +3280,14 @@ _dbus_get_tmpdir(void)
tmpdir = "/tmp";
}
+ _DBUS_UNLOCK (sysdeps);
+
_dbus_assert(tmpdir != NULL);
return tmpdir;
}
+#if defined(DBUS_ENABLE_X11_AUTOLAUNCH) || defined(DBUS_ENABLE_LAUNCHD)
/**
* Execute a subprocess, returning up to 1024 bytes of output
* into @p result.
@@ -3302,15 +3384,12 @@ _read_subprocess_line_argv (const char *progpath,
/* set-up stdXXX */
close (result_pipe[READ_END]);
close (errors_pipe[READ_END]);
- close (0); /* close stdin */
- close (1); /* close stdout */
- close (2); /* close stderr */
- if (dup2 (fd, 0) == -1)
+ if (dup2 (fd, 0) == -1) /* setup stdin */
_exit (1);
- if (dup2 (result_pipe[WRITE_END], 1) == -1)
+ if (dup2 (result_pipe[WRITE_END], 1) == -1) /* setup stdout */
_exit (1);
- if (dup2 (errors_pipe[WRITE_END], 2) == -1)
+ if (dup2 (errors_pipe[WRITE_END], 2) == -1) /* setup stderr */
_exit (1);
_dbus_close_all ();
@@ -3410,6 +3489,7 @@ _read_subprocess_line_argv (const char *progpath,
return retval;
}
+#endif
/**
* Returns the address of a new session bus.
@@ -3418,6 +3498,7 @@ _read_subprocess_line_argv (const char *progpath,
* address. If a failure happens, returns #FALSE and
* sets an error in @p error.
*
+ * @param scope scope of autolaunch (Windows only)
* @param address a DBusString where the address can be stored
* @param error a DBusError to store the error in case of failure
* @returns #TRUE on success, #FALSE if an error happened
@@ -3432,7 +3513,7 @@ _dbus_get_autolaunch_address (const char *scope,
* but that's done elsewhere, and if it worked, this function wouldn't
* be called.) */
const char *display;
- static char *argv[6];
+ char *argv[6];
int i;
DBusString uuid;
dbus_bool_t retval;
@@ -3472,7 +3553,12 @@ _dbus_get_autolaunch_address (const char *scope,
}
i = 0;
- argv[i] = "dbus-launch";
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
+ if (_dbus_getenv ("DBUS_USE_TEST_BINARY") != NULL)
+ argv[i] = TEST_BUS_LAUNCH_BINARY;
+ else
+#endif
+ argv[i] = DBUS_BINDIR "/dbus-launch";
++i;
argv[i] = "--autolaunch";
++i;
@@ -3487,7 +3573,7 @@ _dbus_get_autolaunch_address (const char *scope,
_dbus_assert (i == _DBUS_N_ELEMENTS (argv));
- retval = _read_subprocess_line_argv (DBUS_BINDIR "/dbus-launch",
+ retval = _read_subprocess_line_argv (argv[0],
TRUE,
argv, address, error);
@@ -3530,7 +3616,7 @@ _dbus_read_local_machine_uuid (DBusGUID *machine_id,
_dbus_string_init_const (&filename, DBUS_MACHINE_UUID_FILE);
- b = _dbus_read_uuid_file (&filename, machine_id, create_if_not_found, error);
+ b = _dbus_read_uuid_file (&filename, machine_id, FALSE, error);
if (b)
return TRUE;
@@ -3538,14 +3624,31 @@ _dbus_read_local_machine_uuid (DBusGUID *machine_id,
/* Fallback to the system machine ID */
_dbus_string_init_const (&filename, "/etc/machine-id");
- return _dbus_read_uuid_file (&filename, machine_id, FALSE, error);
-}
+ b = _dbus_read_uuid_file (&filename, machine_id, FALSE, error);
+
+ if (b)
+ {
+ /* try to copy it to the DBUS_MACHINE_UUID_FILE, but do not
+ * complain if that isn't possible for whatever reason */
+ _dbus_string_init_const (&filename, DBUS_MACHINE_UUID_FILE);
+ _dbus_write_uuid_file (&filename, machine_id, NULL);
+
+ return TRUE;
+ }
-#define DBUS_UNIX_STANDARD_SESSION_SERVICEDIR "/dbus-1/services"
-#define DBUS_UNIX_STANDARD_SYSTEM_SERVICEDIR "/dbus-1/system-services"
+ if (!create_if_not_found)
+ return FALSE;
+
+ /* if none found, try to make a new one */
+ dbus_error_free (error);
+ _dbus_string_init_const (&filename, DBUS_MACHINE_UUID_FILE);
+ _dbus_generate_uuid (machine_id);
+ return _dbus_write_uuid_file (&filename, machine_id, error);
+}
/**
* quries launchd for a specific env var which holds the socket path.
+ * @param socket_path append the socket path to this DBusString
* @param launchd_env_var the env var to look up
* @param error a DBusError to store the error in case of failure
* @return the value of the env var
@@ -3694,167 +3797,6 @@ _dbus_lookup_session_address (dbus_bool_t *supported,
}
/**
- * Returns the standard directories for a session bus to look for service
- * activation files
- *
- * On UNIX this should be the standard xdg freedesktop.org data directories:
- *
- * XDG_DATA_HOME=${XDG_DATA_HOME-$HOME/.local/share}
- * XDG_DATA_DIRS=${XDG_DATA_DIRS-/usr/local/share:/usr/share}
- *
- * and
- *
- * DBUS_DATADIR
- *
- * @param dirs the directory list we are returning
- * @returns #FALSE on OOM
- */
-
-dbus_bool_t
-_dbus_get_standard_session_servicedirs (DBusList **dirs)
-{
- const char *xdg_data_home;
- const char *xdg_data_dirs;
- DBusString servicedir_path;
-
- if (!_dbus_string_init (&servicedir_path))
- return FALSE;
-
- xdg_data_home = _dbus_getenv ("XDG_DATA_HOME");
- xdg_data_dirs = _dbus_getenv ("XDG_DATA_DIRS");
-
- if (xdg_data_home != NULL)
- {
- if (!_dbus_string_append (&servicedir_path, xdg_data_home))
- goto oom;
- }
- else
- {
- const DBusString *homedir;
- DBusString local_share;
-
- if (!_dbus_homedir_from_current_process (&homedir))
- goto oom;
-
- if (!_dbus_string_append (&servicedir_path, _dbus_string_get_const_data (homedir)))
- goto oom;
-
- _dbus_string_init_const (&local_share, "/.local/share");
- if (!_dbus_concat_dir_and_file (&servicedir_path, &local_share))
- goto oom;
- }
-
- if (!_dbus_string_append (&servicedir_path, ":"))
- goto oom;
-
- if (xdg_data_dirs != NULL)
- {
- if (!_dbus_string_append (&servicedir_path, xdg_data_dirs))
- goto oom;
-
- if (!_dbus_string_append (&servicedir_path, ":"))
- goto oom;
- }
- else
- {
- if (!_dbus_string_append (&servicedir_path, "/usr/local/share:/usr/share:"))
- goto oom;
- }
-
- /*
- * add configured datadir to defaults
- * this may be the same as an xdg dir
- * however the config parser should take
- * care of duplicates
- */
- if (!_dbus_string_append (&servicedir_path, DBUS_DATADIR))
- goto oom;
-
- if (!_dbus_split_paths_and_append (&servicedir_path,
- DBUS_UNIX_STANDARD_SESSION_SERVICEDIR,
- dirs))
- goto oom;
-
- _dbus_string_free (&servicedir_path);
- return TRUE;
-
- oom:
- _dbus_string_free (&servicedir_path);
- return FALSE;
-}
-
-
-/**
- * Returns the standard directories for a system bus to look for service
- * activation files
- *
- * On UNIX this should be the standard xdg freedesktop.org data directories:
- *
- * XDG_DATA_DIRS=${XDG_DATA_DIRS-/usr/local/share:/usr/share}
- *
- * and
- *
- * DBUS_DATADIR
- *
- * On Windows there is no system bus and this function can return nothing.
- *
- * @param dirs the directory list we are returning
- * @returns #FALSE on OOM
- */
-
-dbus_bool_t
-_dbus_get_standard_system_servicedirs (DBusList **dirs)
-{
- /*
- * DBUS_DATADIR may be the same as one of the standard directories. However,
- * the config parser should take care of the duplicates.
- *
- * Also, append /lib as counterpart of /usr/share on the root
- * directory (the root directory does not know /share), in order to
- * facilitate early boot system bus activation where /usr might not
- * be available.
- */
- static const char standard_search_path[] =
- "/usr/local/share:"
- "/usr/share:"
- DBUS_DATADIR ":"
- "/lib";
- DBusString servicedir_path;
-
- _dbus_string_init_const (&servicedir_path, standard_search_path);
-
- return _dbus_split_paths_and_append (&servicedir_path,
- DBUS_UNIX_STANDARD_SYSTEM_SERVICEDIR,
- dirs);
-}
-
-/**
- * Append the absolute path of the system.conf file
- * (there is no system bus on Windows so this can just
- * return FALSE and print a warning or something)
- *
- * @param str the string to append to
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_append_system_config_file (DBusString *str)
-{
- return _dbus_string_append (str, DBUS_SYSTEM_CONFIG_FILE);
-}
-
-/**
- * Append the absolute path of the session.conf file.
- *
- * @param str the string to append to
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_append_session_config_file (DBusString *str)
-{
- return _dbus_string_append (str, DBUS_SESSION_CONFIG_FILE);
-}
-
-/**
* Called when the bus daemon is signaled to reload its configuration; any
* caches should be nuked. Of course any caches that need explicit reload
* are probably broken, but c'est la vie.
@@ -3900,7 +3842,7 @@ _dbus_append_keyring_directory_for_credentials (DBusString *directory,
if (!_dbus_homedir_from_uid (uid, &homedir))
goto failed;
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
{
const char *override;
@@ -3916,6 +3858,8 @@ _dbus_append_keyring_directory_for_credentials (DBusString *directory,
}
else
{
+ /* Not strictly thread-safe, but if we fail at thread-safety here,
+ * the worst that will happen is some extra warnings. */
static dbus_bool_t already_warned = FALSE;
if (!already_warned)
{
@@ -4031,20 +3975,6 @@ _dbus_socket_can_pass_unix_fd(int fd) {
#endif
}
-
-/*
- * replaces the term DBUS_PREFIX in configure_time_path by the
- * current dbus installation directory. On unix this function is a noop
- *
- * @param configure_time_path
- * @return real path
- */
-const char *
-_dbus_replace_install_prefix (const char *configure_time_path)
-{
- return configure_time_path;
-}
-
/**
* Closes all file descriptors except the first three (i.e. stdin,
* stdout, stderr).
@@ -4138,6 +4068,8 @@ _dbus_check_setuid (void)
uid_t ruid, euid, suid; /* Real, effective and saved user ID's */
gid_t rgid, egid, sgid; /* Real, effective and saved group ID's */
+ /* We call into this function from _dbus_threads_init_platform_specific()
+ * to make sure these are initialized before we start threading. */
static dbus_bool_t check_setuid_initialised;
static dbus_bool_t is_setuid;
@@ -4163,4 +4095,78 @@ _dbus_check_setuid (void)
#endif
}
+/**
+ * Read the address from the socket and append it to the string
+ *
+ * @param fd the socket
+ * @param address
+ * @param error return location for error code
+ */
+dbus_bool_t
+_dbus_append_address_from_socket (int fd,
+ DBusString *address,
+ DBusError *error)
+{
+ union {
+ struct sockaddr sa;
+ struct sockaddr_storage storage;
+ struct sockaddr_un un;
+ struct sockaddr_in ipv4;
+ struct sockaddr_in6 ipv6;
+ } socket;
+ char hostip[INET6_ADDRSTRLEN];
+ int size = sizeof (socket);
+ DBusString path_str;
+
+ if (getsockname (fd, &socket.sa, &size))
+ goto err;
+
+ switch (socket.sa.sa_family)
+ {
+ case AF_UNIX:
+ if (socket.un.sun_path[0]=='\0')
+ {
+ _dbus_string_init_const (&path_str, &(socket.un.sun_path[1]));
+ if (_dbus_string_append (address, "unix:abstract=") &&
+ _dbus_address_append_escaped (address, &path_str))
+ return TRUE;
+ }
+ else
+ {
+ _dbus_string_init_const (&path_str, socket.un.sun_path);
+ if (_dbus_string_append (address, "unix:path=") &&
+ _dbus_address_append_escaped (address, &path_str))
+ return TRUE;
+ }
+ break;
+ case AF_INET:
+ if (inet_ntop (AF_INET, &socket.ipv4.sin_addr, hostip, sizeof (hostip)))
+ if (_dbus_string_append_printf (address, "tcp:family=ipv4,host=%s,port=%u",
+ hostip, ntohs (socket.ipv4.sin_port)))
+ return TRUE;
+ break;
+#ifdef AF_INET6
+ case AF_INET6:
+ _dbus_string_init_const (&path_str, hostip);
+ if (inet_ntop (AF_INET6, &socket.ipv6.sin6_addr, hostip, sizeof (hostip)))
+ if (_dbus_string_append_printf (address, "tcp:family=ipv6,port=%u,host=",
+ ntohs (socket.ipv6.sin6_port)) &&
+ _dbus_address_append_escaped (address, &path_str))
+ return TRUE;
+ break;
+#endif
+ default:
+ dbus_set_error (error,
+ _dbus_error_from_errno (EINVAL),
+ "Failed to read address from socket: Unknown socket type.");
+ return FALSE;
+ }
+ err:
+ dbus_set_error (error,
+ _dbus_error_from_errno (errno),
+ "Failed to open socket: %s",
+ _dbus_strerror (errno));
+ return FALSE;
+}
+
/* tests in dbus-sysdeps-util.c */
diff --git a/dbus/dbus-sysdeps-unix.h b/dbus/dbus-sysdeps-unix.h
index 9b708967..a265b335 100644
--- a/dbus/dbus-sysdeps-unix.h
+++ b/dbus/dbus-sysdeps-unix.h
@@ -138,6 +138,10 @@ dbus_bool_t _dbus_parse_uid (const DBusString *uid_str,
void _dbus_close_all (void);
+dbus_bool_t _dbus_append_address_from_socket (int fd,
+ DBusString *address,
+ DBusError *error);
+
/** @} */
DBUS_END_DECLS
diff --git a/dbus/dbus-sysdeps-util-unix.c b/dbus/dbus-sysdeps-util-unix.c
index 6cff3fe2..199eb3dd 100644
--- a/dbus/dbus-sysdeps-util-unix.c
+++ b/dbus/dbus-sysdeps-util-unix.c
@@ -49,12 +49,17 @@
#include <sys/socket.h>
#include <dirent.h>
#include <sys/un.h>
+
+#ifdef HAVE_SYSLOG_H
#include <syslog.h>
+#endif
#ifdef HAVE_SYS_SYSLIMITS_H
#include <sys/syslimits.h>
#endif
+#include "sd-daemon.h"
+
#ifndef O_BINARY
#define O_BINARY 0
#endif
@@ -373,62 +378,156 @@ _dbus_change_to_daemon_user (const char *user,
}
#endif /* !HAVE_LIBAUDIT */
+#ifdef HAVE_SETRLIMIT
-/**
- * Attempt to ensure that the current process can open
- * at least @limit file descriptors.
- *
- * If @limit is lower than the current, it will not be
- * lowered. No error is returned if the request can
- * not be satisfied.
- *
- * @limit Number of file descriptors
+/* We assume that if we have setrlimit, we also have getrlimit and
+ * struct rlimit.
*/
-void
-_dbus_request_file_descriptor_limit (unsigned int limit)
+
+struct DBusRLimit {
+ struct rlimit lim;
+};
+
+DBusRLimit *
+_dbus_rlimit_save_fd_limit (DBusError *error)
+{
+ DBusRLimit *self;
+
+ self = dbus_new0 (DBusRLimit, 1);
+
+ if (self == NULL)
+ {
+ _DBUS_SET_OOM (error);
+ return NULL;
+ }
+
+ if (getrlimit (RLIMIT_NOFILE, &self->lim) < 0)
+ {
+ dbus_set_error (error, _dbus_error_from_errno (errno),
+ "Failed to get fd limit: %s", _dbus_strerror (errno));
+ dbus_free (self);
+ return NULL;
+ }
+
+ return self;
+}
+
+dbus_bool_t
+_dbus_rlimit_raise_fd_limit_if_privileged (unsigned int desired,
+ DBusError *error)
{
-#ifdef HAVE_SETRLIMIT
struct rlimit lim;
- struct rlimit target_lim;
/* No point to doing this practically speaking
* if we're not uid 0. We expect the system
* bus to use this before we change UID, and
- * the session bus takes the Linux default
- * of 1024 for both cur and max.
+ * the session bus takes the Linux default,
+ * currently 1024 for cur and 4096 for max.
*/
if (getuid () != 0)
- return;
+ {
+ /* not an error, we're probably the session bus */
+ return TRUE;
+ }
if (getrlimit (RLIMIT_NOFILE, &lim) < 0)
- return;
+ {
+ dbus_set_error (error, _dbus_error_from_errno (errno),
+ "Failed to get fd limit: %s", _dbus_strerror (errno));
+ return FALSE;
+ }
- if (lim.rlim_cur >= limit)
- return;
+ if (lim.rlim_cur == RLIM_INFINITY || lim.rlim_cur >= desired)
+ {
+ /* not an error, everything is fine */
+ return TRUE;
+ }
/* Ignore "maximum limit", assume we have the "superuser"
* privileges. On Linux this is CAP_SYS_RESOURCE.
*/
- target_lim.rlim_cur = target_lim.rlim_max = limit;
- /* Also ignore errors; if we fail, we will at least work
- * up to whatever limit we had, which seems better than
- * just outright aborting.
- *
- * However, in the future we should probably log this so OS builders
- * have a chance to notice any misconfiguration like dbus-daemon
- * being started without CAP_SYS_RESOURCE.
- */
- setrlimit (RLIMIT_NOFILE, &target_lim);
+ lim.rlim_cur = lim.rlim_max = desired;
+
+ if (setrlimit (RLIMIT_NOFILE, &lim) < 0)
+ {
+ dbus_set_error (error, _dbus_error_from_errno (errno),
+ "Failed to set fd limit to %u: %s",
+ desired, _dbus_strerror (errno));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+dbus_bool_t
+_dbus_rlimit_restore_fd_limit (DBusRLimit *saved,
+ DBusError *error)
+{
+ if (setrlimit (RLIMIT_NOFILE, &saved->lim) < 0)
+ {
+ dbus_set_error (error, _dbus_error_from_errno (errno),
+ "Failed to restore old fd limit: %s",
+ _dbus_strerror (errno));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+#else /* !HAVE_SETRLIMIT */
+
+static void
+fd_limit_not_supported (DBusError *error)
+{
+ dbus_set_error (error, DBUS_ERROR_NOT_SUPPORTED,
+ "cannot change fd limit on this platform");
+}
+
+DBusRLimit *
+_dbus_rlimit_save_fd_limit (DBusError *error)
+{
+ fd_limit_not_supported (error);
+ return NULL;
+}
+
+dbus_bool_t
+_dbus_rlimit_raise_fd_limit_if_privileged (unsigned int desired,
+ DBusError *error)
+{
+ fd_limit_not_supported (error);
+ return FALSE;
+}
+
+dbus_bool_t
+_dbus_rlimit_restore_fd_limit (DBusRLimit *saved,
+ DBusError *error)
+{
+ fd_limit_not_supported (error);
+ return FALSE;
+}
+
#endif
+
+void
+_dbus_rlimit_free (DBusRLimit *lim)
+{
+ dbus_free (lim);
}
void
-_dbus_init_system_log (void)
+_dbus_init_system_log (dbus_bool_t is_daemon)
{
+#ifdef HAVE_SYSLOG_H
+ int logopts = LOG_PID;
+
#if HAVE_DECL_LOG_PERROR
- openlog ("dbus", LOG_PID | LOG_PERROR, LOG_DAEMON);
-#else
- openlog ("dbus", LOG_PID, LOG_DAEMON);
+#ifdef HAVE_SYSTEMD
+ if (!is_daemon || sd_booted () <= 0)
+#endif
+ logopts |= LOG_PERROR;
+#endif
+
+ openlog ("dbus", logopts, LOG_DAEMON);
#endif
}
@@ -437,8 +536,6 @@ _dbus_init_system_log (void)
*
* @param severity a severity value
* @param msg a printf-style format string
- * @param args arguments for the format string
- *
*/
void
_dbus_system_log (DBusSystemLogSeverity severity, const char *msg, ...)
@@ -465,6 +562,8 @@ _dbus_system_log (DBusSystemLogSeverity severity, const char *msg, ...)
void
_dbus_system_logv (DBusSystemLogSeverity severity, const char *msg, va_list args)
{
+ va_list tmp;
+#ifdef HAVE_SYSLOG_H
int flags;
switch (severity)
{
@@ -481,11 +580,14 @@ _dbus_system_logv (DBusSystemLogSeverity severity, const char *msg, va_list args
return;
}
-#ifndef HAVE_DECL_LOG_PERROR
+ DBUS_VA_COPY (tmp, args);
+ vsyslog (flags, msg, tmp);
+ va_end (tmp);
+#endif
+
+#if !defined(HAVE_SYSLOG_H) || !HAVE_DECL_LOG_PERROR
{
/* vsyslog() won't write to stderr, so we'd better do it */
- va_list tmp;
-
DBUS_VA_COPY (tmp, args);
fprintf (stderr, "dbus[" DBUS_PID_FORMAT "]: ", _dbus_getpid ());
vfprintf (stderr, msg, tmp);
@@ -494,8 +596,6 @@ _dbus_system_logv (DBusSystemLogSeverity severity, const char *msg, va_list args
}
#endif
- vsyslog (flags, msg, args);
-
if (severity == DBUS_SYSTEM_LOG_FATAL)
exit (1);
}
@@ -1144,6 +1244,7 @@ _dbus_command_for_pid (unsigned long pid,
"Failed to read from \"%s\": %s",
_dbus_string_get_const_data (&path),
_dbus_strerror (errno));
+ _dbus_close (fd, NULL);
goto fail;
}
@@ -1165,3 +1266,180 @@ fail:
_dbus_string_free (&path);
return FALSE;
}
+
+/*
+ * replaces the term DBUS_PREFIX in configure_time_path by the
+ * current dbus installation directory. On unix this function is a noop
+ *
+ * @param configure_time_path
+ * @return real path
+ */
+const char *
+_dbus_replace_install_prefix (const char *configure_time_path)
+{
+ return configure_time_path;
+}
+
+#define DBUS_UNIX_STANDARD_SESSION_SERVICEDIR "/dbus-1/services"
+#define DBUS_UNIX_STANDARD_SYSTEM_SERVICEDIR "/dbus-1/system-services"
+
+/**
+ * Returns the standard directories for a session bus to look for service
+ * activation files
+ *
+ * On UNIX this should be the standard xdg freedesktop.org data directories:
+ *
+ * XDG_DATA_HOME=${XDG_DATA_HOME-$HOME/.local/share}
+ * XDG_DATA_DIRS=${XDG_DATA_DIRS-/usr/local/share:/usr/share}
+ *
+ * and
+ *
+ * DBUS_DATADIR
+ *
+ * @param dirs the directory list we are returning
+ * @returns #FALSE on OOM
+ */
+
+dbus_bool_t
+_dbus_get_standard_session_servicedirs (DBusList **dirs)
+{
+ const char *xdg_data_home;
+ const char *xdg_data_dirs;
+ DBusString servicedir_path;
+
+ if (!_dbus_string_init (&servicedir_path))
+ return FALSE;
+
+ xdg_data_home = _dbus_getenv ("XDG_DATA_HOME");
+ xdg_data_dirs = _dbus_getenv ("XDG_DATA_DIRS");
+
+ if (xdg_data_home != NULL)
+ {
+ if (!_dbus_string_append (&servicedir_path, xdg_data_home))
+ goto oom;
+ }
+ else
+ {
+ const DBusString *homedir;
+ DBusString local_share;
+
+ if (!_dbus_homedir_from_current_process (&homedir))
+ goto oom;
+
+ if (!_dbus_string_append (&servicedir_path, _dbus_string_get_const_data (homedir)))
+ goto oom;
+
+ _dbus_string_init_const (&local_share, "/.local/share");
+ if (!_dbus_concat_dir_and_file (&servicedir_path, &local_share))
+ goto oom;
+ }
+
+ if (!_dbus_string_append (&servicedir_path, ":"))
+ goto oom;
+
+ if (xdg_data_dirs != NULL)
+ {
+ if (!_dbus_string_append (&servicedir_path, xdg_data_dirs))
+ goto oom;
+
+ if (!_dbus_string_append (&servicedir_path, ":"))
+ goto oom;
+ }
+ else
+ {
+ if (!_dbus_string_append (&servicedir_path, "/usr/local/share:/usr/share:"))
+ goto oom;
+ }
+
+ /*
+ * add configured datadir to defaults
+ * this may be the same as an xdg dir
+ * however the config parser should take
+ * care of duplicates
+ */
+ if (!_dbus_string_append (&servicedir_path, DBUS_DATADIR))
+ goto oom;
+
+ if (!_dbus_split_paths_and_append (&servicedir_path,
+ DBUS_UNIX_STANDARD_SESSION_SERVICEDIR,
+ dirs))
+ goto oom;
+
+ _dbus_string_free (&servicedir_path);
+ return TRUE;
+
+ oom:
+ _dbus_string_free (&servicedir_path);
+ return FALSE;
+}
+
+
+/**
+ * Returns the standard directories for a system bus to look for service
+ * activation files
+ *
+ * On UNIX this should be the standard xdg freedesktop.org data directories:
+ *
+ * XDG_DATA_DIRS=${XDG_DATA_DIRS-/usr/local/share:/usr/share}
+ *
+ * and
+ *
+ * DBUS_DATADIR
+ *
+ * On Windows there is no system bus and this function can return nothing.
+ *
+ * @param dirs the directory list we are returning
+ * @returns #FALSE on OOM
+ */
+
+dbus_bool_t
+_dbus_get_standard_system_servicedirs (DBusList **dirs)
+{
+ /*
+ * DBUS_DATADIR may be the same as one of the standard directories. However,
+ * the config parser should take care of the duplicates.
+ *
+ * Also, append /lib as counterpart of /usr/share on the root
+ * directory (the root directory does not know /share), in order to
+ * facilitate early boot system bus activation where /usr might not
+ * be available.
+ */
+ static const char standard_search_path[] =
+ "/usr/local/share:"
+ "/usr/share:"
+ DBUS_DATADIR ":"
+ "/lib";
+ DBusString servicedir_path;
+
+ _dbus_string_init_const (&servicedir_path, standard_search_path);
+
+ return _dbus_split_paths_and_append (&servicedir_path,
+ DBUS_UNIX_STANDARD_SYSTEM_SERVICEDIR,
+ dirs);
+}
+
+/**
+ * Append the absolute path of the system.conf file
+ * (there is no system bus on Windows so this can just
+ * return FALSE and print a warning or something)
+ *
+ * @param str the string to append to
+ * @returns #FALSE if no memory
+ */
+dbus_bool_t
+_dbus_append_system_config_file (DBusString *str)
+{
+ return _dbus_string_append (str, DBUS_SYSTEM_CONFIG_FILE);
+}
+
+/**
+ * Append the absolute path of the session.conf file.
+ *
+ * @param str the string to append to
+ * @returns #FALSE if no memory
+ */
+dbus_bool_t
+_dbus_append_session_config_file (DBusString *str)
+{
+ return _dbus_string_append (str, DBUS_SESSION_CONFIG_FILE);
+}
diff --git a/dbus/dbus-sysdeps-util-win.c b/dbus/dbus-sysdeps-util-win.c
index 111db9ea..ec9afbb6 100644
--- a/dbus/dbus-sysdeps-util-win.c
+++ b/dbus/dbus-sysdeps-util-win.c
@@ -54,7 +54,7 @@
* Does the chdir, fork, setsid, etc. to become a daemon process.
*
* @param pidfile #NULL, or pidfile to create
- * @param print_pid_fd file descriptor to print daemon's pid to, or -1 for none
+ * @param print_pid_pipe file descriptor to print daemon's pid to, or -1 for none
* @param error return location for errors
* @param keep_umask #TRUE to keep the original umask
* @returns #FALSE on failure
@@ -65,7 +65,9 @@ _dbus_become_daemon (const DBusString *pidfile,
DBusError *error,
dbus_bool_t keep_umask)
{
- return TRUE;
+ dbus_set_error (error, DBUS_ERROR_NOT_SUPPORTED,
+ "Cannot daemonize on Windows");
+ return FALSE;
}
/**
@@ -256,13 +258,46 @@ _dbus_change_to_daemon_user (const char *user,
return TRUE;
}
+static void
+fd_limit_not_supported (DBusError *error)
+{
+ dbus_set_error (error, DBUS_ERROR_NOT_SUPPORTED,
+ "cannot change fd limit on this platform");
+}
+
+DBusRLimit *
+_dbus_rlimit_save_fd_limit (DBusError *error)
+{
+ fd_limit_not_supported (error);
+ return NULL;
+}
+
+dbus_bool_t
+_dbus_rlimit_raise_fd_limit_if_privileged (unsigned int desired,
+ DBusError *error)
+{
+ fd_limit_not_supported (error);
+ return FALSE;
+}
+
+dbus_bool_t
+_dbus_rlimit_restore_fd_limit (DBusRLimit *saved,
+ DBusError *error)
+{
+ fd_limit_not_supported (error);
+ return FALSE;
+}
+
void
-_dbus_request_file_descriptor_limit (unsigned int limit)
+_dbus_rlimit_free (DBusRLimit *lim)
{
+ /* _dbus_rlimit_save_fd_limit() cannot return non-NULL on Windows
+ * so there cannot be anything to free */
+ _dbus_assert (lim == NULL);
}
void
-_dbus_init_system_log (void)
+_dbus_init_system_log (dbus_bool_t is_daemon)
{
/* OutputDebugStringA doesn't need any special initialization, do nothing */
}
@@ -272,8 +307,6 @@ _dbus_init_system_log (void)
*
* @param severity a severity value
* @param msg a printf-style format string
- * @param args arguments for the format string
- *
*/
void
_dbus_system_log (DBusSystemLogSeverity severity, const char *msg, ...)
@@ -1530,3 +1563,207 @@ _dbus_command_for_pid (unsigned long pid,
// FIXME
return FALSE;
}
+
+/*
+ * replaces the term DBUS_PREFIX in configure_time_path by the
+ * current dbus installation directory. On unix this function is a noop
+ *
+ * @param configure_time_path
+ * @return real path
+ */
+const char *
+_dbus_replace_install_prefix (const char *configure_time_path)
+{
+#ifndef DBUS_PREFIX
+ return configure_time_path;
+#else
+ static char retval[1000];
+ static char runtime_prefix[1000];
+ int len = 1000;
+ int i;
+
+ if (!configure_time_path)
+ return NULL;
+
+ if ((!_dbus_get_install_root(runtime_prefix, len) ||
+ strncmp (configure_time_path, DBUS_PREFIX "/",
+ strlen (DBUS_PREFIX) + 1))) {
+ strcat (retval, configure_time_path);
+ return retval;
+ }
+
+ strcpy (retval, runtime_prefix);
+ strcat (retval, configure_time_path + strlen (DBUS_PREFIX) + 1);
+
+ /* Somehow, in some situations, backslashes get collapsed in the string.
+ * Since windows C library accepts both forward and backslashes as
+ * path separators, convert all backslashes to forward slashes.
+ */
+
+ for(i = 0; retval[i] != '\0'; i++) {
+ if(retval[i] == '\\')
+ retval[i] = '/';
+ }
+ return retval;
+#endif
+}
+
+/**
+ * return the relocated DATADIR
+ *
+ * @returns relocated DATADIR static string
+ */
+
+static const char *
+_dbus_windows_get_datadir (void)
+{
+ return _dbus_replace_install_prefix(DBUS_DATADIR);
+}
+
+#undef DBUS_DATADIR
+#define DBUS_DATADIR _dbus_windows_get_datadir ()
+
+
+#define DBUS_STANDARD_SESSION_SERVICEDIR "/dbus-1/services"
+#define DBUS_STANDARD_SYSTEM_SERVICEDIR "/dbus-1/system-services"
+
+/**
+ * Returns the standard directories for a session bus to look for service
+ * activation files
+ *
+ * On Windows this should be data directories:
+ *
+ * %CommonProgramFiles%/dbus
+ *
+ * and
+ *
+ * relocated DBUS_DATADIR
+ *
+ * @param dirs the directory list we are returning
+ * @returns #FALSE on OOM
+ */
+
+dbus_bool_t
+_dbus_get_standard_session_servicedirs (DBusList **dirs)
+{
+ const char *common_progs;
+ DBusString servicedir_path;
+
+ if (!_dbus_string_init (&servicedir_path))
+ return FALSE;
+
+#ifdef DBUS_WINCE
+ {
+ /* On Windows CE, we adjust datadir dynamically to installation location. */
+ const char *data_dir = _dbus_getenv ("DBUS_DATADIR");
+
+ if (data_dir != NULL)
+ {
+ if (!_dbus_string_append (&servicedir_path, data_dir))
+ goto oom;
+
+ if (!_dbus_string_append (&servicedir_path, _DBUS_PATH_SEPARATOR))
+ goto oom;
+ }
+ }
+#else
+/*
+ the code for accessing services requires absolute base pathes
+ in case DBUS_DATADIR is relative make it absolute
+*/
+#ifdef DBUS_WIN
+ {
+ DBusString p;
+
+ _dbus_string_init_const (&p, DBUS_DATADIR);
+
+ if (!_dbus_path_is_absolute (&p))
+ {
+ char install_root[1000];
+ if (_dbus_get_install_root (install_root, sizeof(install_root)))
+ if (!_dbus_string_append (&servicedir_path, install_root))
+ goto oom;
+ }
+ }
+#endif
+ if (!_dbus_string_append (&servicedir_path, DBUS_DATADIR))
+ goto oom;
+
+ if (!_dbus_string_append (&servicedir_path, _DBUS_PATH_SEPARATOR))
+ goto oom;
+#endif
+
+ common_progs = _dbus_getenv ("CommonProgramFiles");
+
+ if (common_progs != NULL)
+ {
+ if (!_dbus_string_append (&servicedir_path, common_progs))
+ goto oom;
+
+ if (!_dbus_string_append (&servicedir_path, _DBUS_PATH_SEPARATOR))
+ goto oom;
+ }
+
+ if (!_dbus_split_paths_and_append (&servicedir_path,
+ DBUS_STANDARD_SESSION_SERVICEDIR,
+ dirs))
+ goto oom;
+
+ _dbus_string_free (&servicedir_path);
+ return TRUE;
+
+ oom:
+ _dbus_string_free (&servicedir_path);
+ return FALSE;
+}
+
+/**
+ * Returns the standard directories for a system bus to look for service
+ * activation files
+ *
+ * On UNIX this should be the standard xdg freedesktop.org data directories:
+ *
+ * XDG_DATA_DIRS=${XDG_DATA_DIRS-/usr/local/share:/usr/share}
+ *
+ * and
+ *
+ * DBUS_DATADIR
+ *
+ * On Windows there is no system bus and this function can return nothing.
+ *
+ * @param dirs the directory list we are returning
+ * @returns #FALSE on OOM
+ */
+
+dbus_bool_t
+_dbus_get_standard_system_servicedirs (DBusList **dirs)
+{
+ *dirs = NULL;
+ return TRUE;
+}
+
+/**
+ * Append the absolute path of the system.conf file
+ * (there is no system bus on Windows so this can just
+ * return FALSE and print a warning or something)
+ *
+ * @param str the string to append to
+ * @returns #FALSE if no memory
+ */
+dbus_bool_t
+_dbus_append_system_config_file (DBusString *str)
+{
+ return _dbus_get_config_file_name(str, "system.conf");
+}
+
+/**
+ * Append the absolute path of the session.conf file.
+ *
+ * @param str the string to append to
+ * @returns #FALSE if no memory
+ */
+dbus_bool_t
+_dbus_append_session_config_file (DBusString *str)
+{
+ return _dbus_get_config_file_name(str, "session.conf");
+}
diff --git a/dbus/dbus-sysdeps-util.c b/dbus/dbus-sysdeps-util.c
index 4b3d16f2..6b361ef0 100644
--- a/dbus/dbus-sysdeps-util.c
+++ b/dbus/dbus-sysdeps-util.c
@@ -80,7 +80,7 @@ _dbus_get_environment (void)
return environment;
}
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
static void
check_dirname (const char *filename,
const char *dirname)
@@ -196,4 +196,4 @@ _dbus_sysdeps_test (void)
return TRUE;
}
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c
index bc4951b5..00848363 100644
--- a/dbus/dbus-sysdeps-win.c
+++ b/dbus/dbus-sysdeps-win.c
@@ -6,7 +6,7 @@
* Copyright (C) 2005 Novell, Inc.
* Copyright (C) 2006 Peter Kümmel <syntheticpp@gmx.net>
* Copyright (C) 2006 Christian Ehrlicher <ch.ehrlicher@gmx.de>
- * Copyright (C) 2006-2010 Ralf Habacker <ralf.habacker@freenet.de>
+ * Copyright (C) 2006-2013 Ralf Habacker <ralf.habacker@freenet.de>
*
* Licensed under the Academic Free License version 2.1
*
@@ -54,12 +54,14 @@
#include <windows.h>
#include <ws2tcpip.h>
#include <wincrypt.h>
+#include <iphlpapi.h>
-/* Declarations missing in mingw's headers */
+/* Declarations missing in mingw's and windows sdk 7.0 headers */
extern BOOL WINAPI ConvertStringSidToSidA (LPCSTR StringSid, PSID *Sid);
extern BOOL WINAPI ConvertSidToStringSidA (PSID Sid, LPSTR *StringSid);
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#if HAVE_ERRNO_H
@@ -76,20 +78,15 @@ extern BOOL WINAPI ConvertSidToStringSidA (PSID Sid, LPSTR *StringSid);
#include <ws2tcpip.h>
#endif
-#ifdef HAVE_WSPIAPI_H
-// needed for w2k compatibility (getaddrinfo/freeaddrinfo/getnameinfo)
-#ifdef __GNUC__
-#define _inline
-#include "wspiapi.h"
-#else
-#include <wspiapi.h>
-#endif
-#endif // HAVE_WSPIAPI_H
-
#ifndef O_BINARY
#define O_BINARY 0
#endif
+#ifndef PROCESS_QUERY_LIMITED_INFORMATION
+/* MinGW32 < 4 does not define this value in its headers */
+#define PROCESS_QUERY_LIMITED_INFORMATION (0x1000)
+#endif
+
typedef int socklen_t;
@@ -103,6 +100,203 @@ _dbus_win_set_errno (int err)
#endif
}
+static BOOL is_winxp_sp3_or_lower();
+
+/*
+ * _MIB_TCPROW_EX and friends are not available in system headers
+ * and are mapped to attribute identical ...OWNER_PID typedefs.
+ */
+typedef MIB_TCPROW_OWNER_PID _MIB_TCPROW_EX;
+typedef MIB_TCPTABLE_OWNER_PID MIB_TCPTABLE_EX;
+typedef PMIB_TCPTABLE_OWNER_PID PMIB_TCPTABLE_EX;
+typedef DWORD (WINAPI *ProcAllocateAndGetTcpExtTableFromStack)(PMIB_TCPTABLE_EX*,BOOL,HANDLE,DWORD,DWORD);
+static ProcAllocateAndGetTcpExtTableFromStack lpfnAllocateAndGetTcpExTableFromStack = NULL;
+
+/**
+ * AllocateAndGetTcpExTableFromStack() is undocumented and not exported,
+ * but is the only way to do this in older XP versions.
+ * @return true if the procedures could be loaded
+ */
+static BOOL
+load_ex_ip_helper_procedures(void)
+{
+ HMODULE hModule = LoadLibrary ("iphlpapi.dll");
+ if (hModule == NULL)
+ {
+ _dbus_verbose ("could not load iphlpapi.dll\n");
+ return FALSE;
+ }
+
+ lpfnAllocateAndGetTcpExTableFromStack = (ProcAllocateAndGetTcpExtTableFromStack)GetProcAddress (hModule, "AllocateAndGetTcpExTableFromStack");
+ if (lpfnAllocateAndGetTcpExTableFromStack == NULL)
+ {
+ _dbus_verbose ("could not find function AllocateAndGetTcpExTableFromStack in iphlpapi.dll\n");
+ return FALSE;
+ }
+ return TRUE;
+}
+
+/**
+ * get pid from localhost tcp connection using peer_port
+ * This function is available on WinXP >= SP3
+ * @param peer_port peers tcp port
+ * @return process id or 0 if connection has not been found
+ */
+static dbus_pid_t
+get_pid_from_extended_tcp_table(int peer_port)
+{
+ dbus_pid_t result;
+ DWORD errorCode, size = 0, i;
+ MIB_TCPTABLE_OWNER_PID *tcp_table;
+
+ if ((errorCode =
+ GetExtendedTcpTable (NULL, &size, TRUE, AF_INET, TCP_TABLE_OWNER_PID_ALL, 0)) == ERROR_INSUFFICIENT_BUFFER)
+ {
+ tcp_table = (MIB_TCPTABLE_OWNER_PID *) dbus_malloc (size);
+ if (tcp_table == NULL)
+ {
+ _dbus_verbose ("Error allocating memory\n");
+ return 0;
+ }
+ }
+ else
+ {
+ _dbus_win_warn_win_error ("unexpected error returned from GetExtendedTcpTable", errorCode);
+ return 0;
+ }
+
+ if ((errorCode = GetExtendedTcpTable (tcp_table, &size, TRUE, AF_INET, TCP_TABLE_OWNER_PID_ALL, 0)) != NO_ERROR)
+ {
+ _dbus_verbose ("Error fetching tcp table %d\n", (int)errorCode);
+ dbus_free (tcp_table);
+ return 0;
+ }
+
+ result = 0;
+ for (i = 0; i < tcp_table->dwNumEntries; i++)
+ {
+ MIB_TCPROW_OWNER_PID *p = &tcp_table->table[i];
+ int local_address = ntohl (p->dwLocalAddr);
+ int local_port = ntohs (p->dwLocalPort);
+ if (p->dwState == MIB_TCP_STATE_ESTAB
+ && local_address == INADDR_LOOPBACK && local_port == peer_port)
+ result = p->dwOwningPid;
+ }
+
+ dbus_free (tcp_table);
+ _dbus_verbose ("got pid %lu\n", result);
+ return result;
+}
+
+/**
+ * get pid from localhost tcp connection using peer_port
+ * This function is available on all WinXP versions, but
+ * not in wine (at least version <= 1.6.0)
+ * @param peer_port peers tcp port
+ * @return process id or 0 if connection has not been found
+ */
+static dbus_pid_t
+get_pid_from_tcp_ex_table(int peer_port)
+{
+ dbus_pid_t result;
+ DWORD errorCode, i;
+ PMIB_TCPTABLE_EX tcp_table = NULL;
+
+ if (!load_ex_ip_helper_procedures ())
+ {
+ _dbus_verbose
+ ("Error not been able to load iphelper procedures\n");
+ return 0;
+ }
+
+ errorCode = lpfnAllocateAndGetTcpExTableFromStack (&tcp_table, TRUE, GetProcessHeap(), 0, 2);
+
+ if (errorCode != NO_ERROR)
+ {
+ _dbus_verbose
+ ("Error not been able to call AllocateAndGetTcpExTableFromStack()\n");
+ return 0;
+ }
+
+ result = 0;
+ for (i = 0; i < tcp_table->dwNumEntries; i++)
+ {
+ _MIB_TCPROW_EX *p = &tcp_table->table[i];
+ int local_port = ntohs (p->dwLocalPort);
+ int local_address = ntohl (p->dwLocalAddr);
+ if (local_address == INADDR_LOOPBACK && local_port == peer_port)
+ {
+ result = p->dwOwningPid;
+ break;
+ }
+ }
+
+ HeapFree (GetProcessHeap(), 0, tcp_table);
+ _dbus_verbose ("got pid %lu\n", result);
+ return result;
+}
+
+/**
+ * @brief return peer process id from tcp handle for localhost connections
+ * @param handle tcp socket descriptor
+ * @return process id or 0 in case the process id could not be fetched
+ */
+static dbus_pid_t
+_dbus_get_peer_pid_from_tcp_handle (int handle)
+{
+ struct sockaddr_storage addr;
+ socklen_t len = sizeof (addr);
+ int peer_port;
+
+ dbus_pid_t result;
+ dbus_bool_t is_localhost = FALSE;
+
+ getpeername (handle, (struct sockaddr *) &addr, &len);
+
+ if (addr.ss_family == AF_INET)
+ {
+ struct sockaddr_in *s = (struct sockaddr_in *) &addr;
+ peer_port = ntohs (s->sin_port);
+ is_localhost = (ntohl (s->sin_addr.s_addr) == INADDR_LOOPBACK);
+ }
+ else if (addr.ss_family == AF_INET6)
+ {
+ _dbus_verbose ("FIXME [61922]: IPV6 support not working on windows\n");
+ return 0;
+ /*
+ struct sockaddr_in6 *s = (struct sockaddr_in6 * )&addr;
+ peer_port = ntohs (s->sin6_port);
+ is_localhost = (memcmp(s->sin6_addr.s6_addr, in6addr_loopback.s6_addr, 16) == 0);
+ _dbus_verbose ("IPV6 %08x %08x\n", s->sin6_addr.s6_addr, in6addr_loopback.s6_addr);
+ */
+ }
+ else
+ {
+ _dbus_verbose ("no idea what address family %d is\n", addr.ss_family);
+ return 0;
+ }
+
+ if (!is_localhost)
+ {
+ _dbus_verbose ("could not fetch process id from remote process\n");
+ return 0;
+ }
+
+ if (peer_port == 0)
+ {
+ _dbus_verbose
+ ("Error not been able to fetch tcp peer port from connection\n");
+ return 0;
+ }
+
+ _dbus_verbose ("trying to get peers pid");
+
+ result = get_pid_from_extended_tcp_table (peer_port);
+ if (result > 0)
+ return result;
+ result = get_pid_from_tcp_ex_table (peer_port);
+ return result;
+}
/* Convert GetLastError() to a dbus error. */
const char*
@@ -324,7 +518,7 @@ _dbus_close_socket (int fd,
* on exec. Should be called for all file
* descriptors in D-Bus code.
*
- * @param fd the file descriptor
+ * @param handle the Windows HANDLE
*/
void
_dbus_fd_set_close_on_exec (intptr_t handle)
@@ -340,7 +534,7 @@ _dbus_fd_set_close_on_exec (intptr_t handle)
/**
* Sets a file descriptor to be nonblocking.
*
- * @param fd the file descriptor.
+ * @param handle the file descriptor.
* @param error address of error location.
* @returns #TRUE on success.
*/
@@ -474,21 +668,26 @@ _dbus_connect_named_pipe (const char *path,
#endif
-
-
-void
+/**
+ * @returns #FALSE if no memory
+ */
+dbus_bool_t
_dbus_win_startup_winsock (void)
{
/* Straight from MSDN, deuglified */
+ /* Protected by _DBUS_LOCK_sysdeps */
static dbus_bool_t beenhere = FALSE;
WORD wVersionRequested;
WSADATA wsaData;
int err;
+ if (!_DBUS_LOCK (sysdeps))
+ return FALSE;
+
if (beenhere)
- return;
+ goto out;
wVersionRequested = MAKEWORD (2, 0);
@@ -512,6 +711,10 @@ _dbus_win_startup_winsock (void)
}
beenhere = TRUE;
+
+out:
+ _DBUS_UNLOCK (sysdeps);
+ return TRUE;
}
@@ -538,9 +741,12 @@ int _dbus_printf_string_upper_bound (const char *format,
char buf[1024];
int bufsize;
int len;
+ va_list args_copy;
bufsize = sizeof (buf);
- len = _vsnprintf (buf, bufsize - 1, format, args);
+ DBUS_VA_COPY (args_copy, args);
+ len = _vsnprintf (buf, bufsize - 1, format, args_copy);
+ va_end (args_copy);
while (len == -1) /* try again */
{
@@ -553,7 +759,9 @@ int _dbus_printf_string_upper_bound (const char *format,
if (p == NULL)
return -1;
- len = _vsnprintf (p, bufsize - 1, format, args);
+ DBUS_VA_COPY (args_copy, args);
+ len = _vsnprintf (p, bufsize - 1, format, args_copy);
+ va_end (args_copy);
free (p);
}
@@ -738,22 +946,56 @@ _dbus_pid_for_log (void)
return _dbus_getpid ();
}
-
#ifndef DBUS_WINCE
+
+static BOOL is_winxp_sp3_or_lower()
+{
+ OSVERSIONINFOEX osvi;
+ DWORDLONG dwlConditionMask = 0;
+ int op=VER_LESS_EQUAL;
+
+ // Initialize the OSVERSIONINFOEX structure.
+
+ ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
+ osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
+ osvi.dwMajorVersion = 5;
+ osvi.dwMinorVersion = 1;
+ osvi.wServicePackMajor = 3;
+ osvi.wServicePackMinor = 0;
+
+ // Initialize the condition mask.
+
+ VER_SET_CONDITION( dwlConditionMask, VER_MAJORVERSION, op );
+ VER_SET_CONDITION( dwlConditionMask, VER_MINORVERSION, op );
+ VER_SET_CONDITION( dwlConditionMask, VER_SERVICEPACKMAJOR, op );
+ VER_SET_CONDITION( dwlConditionMask, VER_SERVICEPACKMINOR, op );
+
+ // Perform the test.
+
+ return VerifyVersionInfo(
+ &osvi,
+ VER_MAJORVERSION | VER_MINORVERSION |
+ VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR,
+ dwlConditionMask);
+}
+
/** Gets our SID
- * @param points to sid buffer, need to be freed with LocalFree()
+ * @param sid points to sid buffer, need to be freed with LocalFree()
+ * @param process_id the process id for which the sid should be returned
* @returns process sid
*/
static dbus_bool_t
-_dbus_getsid(char **sid)
+_dbus_getsid(char **sid, dbus_pid_t process_id)
{
HANDLE process_token = INVALID_HANDLE_VALUE;
TOKEN_USER *token_user = NULL;
DWORD n;
PSID psid;
int retval = FALSE;
-
- if (!OpenProcessToken (GetCurrentProcess (), TOKEN_QUERY, &process_token))
+
+ HANDLE process_handle = OpenProcess(is_winxp_sp3_or_lower() ? PROCESS_QUERY_INFORMATION : PROCESS_QUERY_LIMITED_INFORMATION, FALSE, process_id);
+
+ if (!OpenProcessToken (process_handle, TOKEN_QUERY, &process_token))
{
_dbus_win_warn_win_error ("OpenProcessToken failed", GetLastError ());
goto failed;
@@ -781,10 +1023,11 @@ _dbus_getsid(char **sid)
retval = TRUE;
failed:
+ CloseHandle (process_handle);
if (process_token != INVALID_HANDLE_VALUE)
CloseHandle (process_token);
- _dbus_verbose("_dbus_getsid() returns %d\n",retval);
+ _dbus_verbose("_dbus_getsid() got '%s' and returns %d\n", *sid, retval);
return retval;
}
#endif
@@ -816,7 +1059,11 @@ _dbus_full_duplex_pipe (int *fd1,
int len;
u_long arg;
- _dbus_win_startup_winsock ();
+ if (!_dbus_win_startup_winsock ())
+ {
+ _DBUS_SET_OOM (error);
+ return FALSE;
+ }
temp = socket (AF_INET, SOCK_STREAM, 0);
if (temp == INVALID_SOCKET)
@@ -1260,7 +1507,11 @@ _dbus_connect_tcp_socket_with_nonce (const char *host,
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
- _dbus_win_startup_winsock ();
+ if (!_dbus_win_startup_winsock ())
+ {
+ _DBUS_SET_OOM (error);
+ return -1;
+ }
_DBUS_ZERO (hints);
@@ -1405,7 +1656,11 @@ _dbus_listen_tcp_socket (const char *host,
*fds_p = NULL;
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
- _dbus_win_startup_winsock ();
+ if (!_dbus_win_startup_winsock ())
+ {
+ _DBUS_SET_OOM (error);
+ return -1;
+ }
_DBUS_ZERO (hints);
@@ -1665,13 +1920,13 @@ again:
* a byte was read, not whether we got valid credentials. On some
* systems, such as Linux, reading/writing the byte isn't actually
* required, but we do it anyway just to avoid multiple codepaths.
- *
+ *
* Fails if no byte is available, so you must select() first.
*
* The point of the byte is that on some systems we have to
* use sendmsg()/recvmsg() to transmit credentials.
*
- * @param client_fd the client file descriptor
+ * @param handle the client file descriptor
* @param credentials struct to fill with credentials of client
* @param error location to store error code
* @returns #TRUE on success
@@ -1683,22 +1938,41 @@ _dbus_read_credentials_socket (int handle,
{
int bytes_read = 0;
DBusString buf;
-
+
+ char *sid = NULL;
+ dbus_pid_t pid;
+ int retval = FALSE;
+
// could fail due too OOM
- if (_dbus_string_init(&buf))
+ if (_dbus_string_init (&buf))
{
- bytes_read = _dbus_read_socket(handle, &buf, 1 );
+ bytes_read = _dbus_read_socket (handle, &buf, 1 );
if (bytes_read > 0)
- _dbus_verbose("got one zero byte from server");
+ _dbus_verbose ("got one zero byte from server\n");
- _dbus_string_free(&buf);
+ _dbus_string_free (&buf);
}
- _dbus_credentials_add_from_current_process (credentials);
- _dbus_verbose("FIXME: get faked credentials from current process");
+ pid = _dbus_get_peer_pid_from_tcp_handle (handle);
+ if (pid == 0)
+ return TRUE;
- return TRUE;
+ _dbus_credentials_add_pid (credentials, pid);
+
+ if (_dbus_getsid (&sid, pid))
+ {
+ if (!_dbus_credentials_add_windows_sid (credentials, sid))
+ goto out;
+ }
+
+ retval = TRUE;
+
+out:
+ if (sid)
+ LocalFree (sid);
+
+ return retval;
}
/**
@@ -1792,10 +2066,10 @@ _dbus_credentials_add_from_current_process (DBusCredentials *credentials)
dbus_bool_t retval = FALSE;
char *sid = NULL;
- if (!_dbus_getsid(&sid))
+ if (!_dbus_getsid(&sid, _dbus_getpid()))
goto failed;
- if (!_dbus_credentials_add_unix_pid(credentials, _dbus_getpid()))
+ if (!_dbus_credentials_add_pid (credentials, _dbus_getpid()))
goto failed;
if (!_dbus_credentials_add_windows_sid (credentials,sid))
@@ -1830,7 +2104,7 @@ _dbus_append_user_from_current_process (DBusString *str)
dbus_bool_t retval = FALSE;
char *sid = NULL;
- if (!_dbus_getsid(&sid))
+ if (!_dbus_getsid(&sid, _dbus_getpid()))
return FALSE;
retval = _dbus_string_append (str,sid);
@@ -1999,14 +2273,18 @@ _dbus_generate_random_bytes (DBusString *str,
* Gets the temporary files directory by inspecting the environment variables
* TMPDIR, TMP, and TEMP in that order. If none of those are set "/tmp" is returned
*
- * @returns location of temp directory
+ * @returns location of temp directory, or #NULL if no memory for locking
*/
const char*
_dbus_get_tmpdir(void)
{
+ /* Protected by _DBUS_LOCK_sysdeps */
static const char* tmpdir = NULL;
static char buf[1000];
+ if (!_DBUS_LOCK (sysdeps))
+ return NULL;
+
if (tmpdir == NULL)
{
char *last_slash;
@@ -2028,6 +2306,8 @@ _dbus_get_tmpdir(void)
tmpdir = buf;
}
+ _DBUS_UNLOCK (sysdeps);
+
_dbus_assert(tmpdir != NULL);
return tmpdir;
@@ -2063,51 +2343,7 @@ _dbus_delete_file (const DBusString *filename,
return TRUE;
}
-/*
- * replaces the term DBUS_PREFIX in configure_time_path by the
- * current dbus installation directory. On unix this function is a noop
- *
- * @param configure_time_path
- * @return real path
- */
-const char *
-_dbus_replace_install_prefix (const char *configure_time_path)
-{
-#ifndef DBUS_PREFIX
- return configure_time_path;
-#else
- static char retval[1000];
- static char runtime_prefix[1000];
- int len = 1000;
- int i;
-
- if (!configure_time_path)
- return NULL;
-
- if ((!_dbus_get_install_root(runtime_prefix, len) ||
- strncmp (configure_time_path, DBUS_PREFIX "/",
- strlen (DBUS_PREFIX) + 1))) {
- strcat (retval, configure_time_path);
- return retval;
- }
-
- strcpy (retval, runtime_prefix);
- strcat (retval, configure_time_path + strlen (DBUS_PREFIX) + 1);
-
- /* Somehow, in some situations, backslashes get collapsed in the string.
- * Since windows C library accepts both forward and backslashes as
- * path separators, convert all backslashes to forward slashes.
- */
-
- for(i = 0; retval[i] != '\0'; i++) {
- if(retval[i] == '\\')
- retval[i] = '/';
- }
- return retval;
-#endif
-}
-
-#if !defined (DBUS_DISABLE_ASSERTS) || defined(DBUS_BUILD_TESTS)
+#if !defined (DBUS_DISABLE_ASSERT) || defined(DBUS_ENABLE_EMBEDDED_TESTS)
#if defined(_MSC_VER) || defined(DBUS_WINCE)
# ifdef BACKTRACES
@@ -2946,142 +3182,6 @@ _dbus_make_file_world_readable(const DBusString *filename,
}
/**
- * return the relocated DATADIR
- *
- * @returns relocated DATADIR static string
- */
-
-static const char *
-_dbus_windows_get_datadir (void)
-{
- return _dbus_replace_install_prefix(DBUS_DATADIR);
-}
-
-#undef DBUS_DATADIR
-#define DBUS_DATADIR _dbus_windows_get_datadir ()
-
-
-#define DBUS_STANDARD_SESSION_SERVICEDIR "/dbus-1/services"
-#define DBUS_STANDARD_SYSTEM_SERVICEDIR "/dbus-1/system-services"
-
-/**
- * Returns the standard directories for a session bus to look for service
- * activation files
- *
- * On Windows this should be data directories:
- *
- * %CommonProgramFiles%/dbus
- *
- * and
- *
- * relocated DBUS_DATADIR
- *
- * @param dirs the directory list we are returning
- * @returns #FALSE on OOM
- */
-
-dbus_bool_t
-_dbus_get_standard_session_servicedirs (DBusList **dirs)
-{
- const char *common_progs;
- DBusString servicedir_path;
-
- if (!_dbus_string_init (&servicedir_path))
- return FALSE;
-
-#ifdef DBUS_WINCE
- {
- /* On Windows CE, we adjust datadir dynamically to installation location. */
- const char *data_dir = _dbus_getenv ("DBUS_DATADIR");
-
- if (data_dir != NULL)
- {
- if (!_dbus_string_append (&servicedir_path, data_dir))
- goto oom;
-
- if (!_dbus_string_append (&servicedir_path, _DBUS_PATH_SEPARATOR))
- goto oom;
- }
- }
-#else
-/*
- the code for accessing services requires absolute base pathes
- in case DBUS_DATADIR is relative make it absolute
-*/
-#ifdef DBUS_WIN
- {
- DBusString p;
-
- _dbus_string_init_const (&p, DBUS_DATADIR);
-
- if (!_dbus_path_is_absolute (&p))
- {
- char install_root[1000];
- if (_dbus_get_install_root (install_root, sizeof(install_root)))
- if (!_dbus_string_append (&servicedir_path, install_root))
- goto oom;
- }
- }
-#endif
- if (!_dbus_string_append (&servicedir_path, DBUS_DATADIR))
- goto oom;
-
- if (!_dbus_string_append (&servicedir_path, _DBUS_PATH_SEPARATOR))
- goto oom;
-#endif
-
- common_progs = _dbus_getenv ("CommonProgramFiles");
-
- if (common_progs != NULL)
- {
- if (!_dbus_string_append (&servicedir_path, common_progs))
- goto oom;
-
- if (!_dbus_string_append (&servicedir_path, _DBUS_PATH_SEPARATOR))
- goto oom;
- }
-
- if (!_dbus_split_paths_and_append (&servicedir_path,
- DBUS_STANDARD_SESSION_SERVICEDIR,
- dirs))
- goto oom;
-
- _dbus_string_free (&servicedir_path);
- return TRUE;
-
- oom:
- _dbus_string_free (&servicedir_path);
- return FALSE;
-}
-
-/**
- * Returns the standard directories for a system bus to look for service
- * activation files
- *
- * On UNIX this should be the standard xdg freedesktop.org data directories:
- *
- * XDG_DATA_DIRS=${XDG_DATA_DIRS-/usr/local/share:/usr/share}
- *
- * and
- *
- * DBUS_DATADIR
- *
- * On Windows there is no system bus and this function can return nothing.
- *
- * @param dirs the directory list we are returning
- * @returns #FALSE on OOM
- */
-
-dbus_bool_t
-_dbus_get_standard_system_servicedirs (DBusList **dirs)
-{
- *dirs = NULL;
- return TRUE;
-}
-
-_DBUS_DEFINE_GLOBAL_LOCK (atomic);
-
-/**
* Atomically increments an integer
*
* @param atomic pointer to the integer to increment
@@ -3121,8 +3221,18 @@ _dbus_atomic_dec (DBusAtomic *atomic)
dbus_int32_t
_dbus_atomic_get (DBusAtomic *atomic)
{
- /* this is what GLib does, hopefully it's right... */
- MemoryBarrier ();
+ /* In this situation, GLib issues a MemoryBarrier() and then returns
+ * atomic->value. However, mingw from mingw.org (not to be confused with
+ * mingw-w64 from mingw-w64.sf.net) does not have MemoryBarrier in its
+ * headers, so we have to get a memory barrier some other way.
+ *
+ * InterlockedIncrement is older, and is documented on MSDN to be a full
+ * memory barrier, so let's use that.
+ */
+ long dummy = 0;
+
+ InterlockedExchange (&dummy, 1);
+
return atomic->value;
}
@@ -3153,7 +3263,7 @@ _dbus_get_is_errno_eagain_or_ewouldblock (void)
/**
* return the absolute path of the dbus installation
*
- * @param s buffer for installation path
+ * @param prefix buffer for installation path
* @param len length of buffer
* @returns #FALSE on failure
*/
@@ -3258,32 +3368,6 @@ _dbus_get_config_file_name(DBusString *config_file, char *s)
return TRUE;
}
-/**
- * Append the absolute path of the system.conf file
- * (there is no system bus on Windows so this can just
- * return FALSE and print a warning or something)
- *
- * @param str the string to append to
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_append_system_config_file (DBusString *str)
-{
- return _dbus_get_config_file_name(str, "system.conf");
-}
-
-/**
- * Append the absolute path of the session.conf file.
- *
- * @param str the string to append to
- * @returns #FALSE if no memory
- */
-dbus_bool_t
-_dbus_append_session_config_file (DBusString *str)
-{
- return _dbus_get_config_file_name(str, "session.conf");
-}
-
/* See comment in dbus-sysdeps-unix.c */
dbus_bool_t
_dbus_lookup_session_address (dbus_bool_t *supported,
@@ -3335,7 +3419,7 @@ _dbus_append_keyring_directory_for_credentials (DBusString *directory,
_dbus_string_append(&homedir,homepath);
}
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
{
const char *override;
@@ -3351,6 +3435,8 @@ _dbus_append_keyring_directory_for_credentials (DBusString *directory,
}
else
{
+ /* Not strictly thread-safe, but if we fail at thread-safety here,
+ * the worst that will happen is some extra warnings. */
static dbus_bool_t already_warned = FALSE;
if (!already_warned)
{
@@ -3575,7 +3661,7 @@ _dbus_win_set_error_from_win_error (DBusError *error,
void
_dbus_win_warn_win_error (const char *message,
- int code)
+ unsigned long code)
{
DBusError error;
diff --git a/dbus/dbus-sysdeps-win.h b/dbus/dbus-sysdeps-win.h
index 74624b75..02e7a83f 100644
--- a/dbus/dbus-sysdeps-win.h
+++ b/dbus/dbus-sysdeps-win.h
@@ -27,7 +27,7 @@
#define DBUS_SYSDEPS_WIN_H
extern void *_dbus_win_get_dll_hmodule (void);
-#define _WINSOCKAPI_
+#define WIN32_LEAN_AND_MEAN
#include "dbus-hash.h"
#include "dbus-string.h"
@@ -42,9 +42,9 @@ extern void *_dbus_win_get_dll_hmodule (void);
void _dbus_win_set_errno (int err);
const char* _dbus_win_error_from_last_error (void);
-void _dbus_win_startup_winsock (void);
+dbus_bool_t _dbus_win_startup_winsock (void);
void _dbus_win_warn_win_error (const char *message,
- int code);
+ unsigned long code);
char * _dbus_win_error_string (int error_number);
void _dbus_win_free_error_string (char *string);
@@ -85,6 +85,9 @@ dbus_bool_t _dbus_get_config_file_name(DBusString *config_file,
dbus_bool_t _dbus_get_install_root(char *prefix, int len);
+void _dbus_threads_windows_init_global (void);
+void _dbus_threads_windows_ensure_ctor_linked (void);
+
#endif
/** @} end of sysdeps-win.h */
diff --git a/dbus/dbus-sysdeps-wince-glue.c b/dbus/dbus-sysdeps-wince-glue.c
index 74b1371f..e276f046 100644
--- a/dbus/dbus-sysdeps-wince-glue.c
+++ b/dbus/dbus-sysdeps-wince-glue.c
@@ -491,7 +491,7 @@ SearchPathA (LPCSTR lpPath, LPCSTR lpFileName, LPCSTR lpExtension,
/** Gets our SID
- * @param points to sid buffer, need to be freed with LocalFree()
+ * @param sid points to sid buffer, need to be freed with LocalFree()
* @returns process sid
*/
dbus_bool_t
diff --git a/dbus/dbus-sysdeps.c b/dbus/dbus-sysdeps.c
index 04fb8d76..f4ba0fac 100644
--- a/dbus/dbus-sysdeps.c
+++ b/dbus/dbus-sysdeps.c
@@ -29,6 +29,7 @@
#include "dbus-protocol.h"
#include "dbus-string.h"
#include "dbus-list.h"
+#include "dbus-misc.h"
/* NOTE: If you include any unix/windows-specific headers here, you are probably doing something
* wrong and should be putting some code in dbus-sysdeps-unix.c or dbus-sysdeps-win.c.
@@ -46,10 +47,6 @@
#include <errno.h>
#endif
-_DBUS_DEFINE_GLOBAL_LOCK (win_fds);
-_DBUS_DEFINE_GLOBAL_LOCK (sid_atom_cache);
-_DBUS_DEFINE_GLOBAL_LOCK (system_users);
-
#ifdef DBUS_WIN
#include <stdlib.h>
#elif (defined __APPLE__)
@@ -96,6 +93,8 @@ _dbus_abort (void)
}
/**
+ * @ingroup DBusMisc
+ *
* Wrapper for setenv(). If the value is #NULL, unsets
* the environment variable.
*
@@ -104,13 +103,16 @@ _dbus_abort (void)
* we can not rely on internal implementation details of
* the underlying libc library.
*
+ * This function is not thread-safe, because altering the environment
+ * in Unix is not thread-safe in general.
+ *
* @param varname name of environment variable
- * @param value value of environment variable
- * @returns #TRUE on success.
+ * @param value value of environment variable, or #NULL to unset
+ * @returns #TRUE on success, #FALSE if not enough memory.
*/
dbus_bool_t
-_dbus_setenv (const char *varname,
- const char *value)
+dbus_setenv (const char *varname,
+ const char *value)
{
_dbus_assert (varname != NULL);
@@ -760,6 +762,20 @@ _dbus_get_is_errno_epipe (void)
}
/**
+ * See if errno is ETOOMANYREFS
+ * @returns #TRUE if errno == ETOOMANYREFS
+ */
+dbus_bool_t
+_dbus_get_is_errno_etoomanyrefs (void)
+{
+#ifdef ETOOMANYREFS
+ return errno == ETOOMANYREFS;
+#else
+ return FALSE;
+#endif
+}
+
+/**
* Get error message from errno
* @returns _dbus_strerror(errno)
*/
diff --git a/dbus/dbus-sysdeps.h b/dbus/dbus-sysdeps.h
index eee91608..5465128e 100644
--- a/dbus/dbus-sysdeps.h
+++ b/dbus/dbus-sysdeps.h
@@ -89,8 +89,6 @@ void _dbus_abort (void) _DBUS_GNUC_NORETURN;
dbus_bool_t _dbus_check_setuid (void);
const char* _dbus_getenv (const char *varname);
-dbus_bool_t _dbus_setenv (const char *varname,
- const char *value);
dbus_bool_t _dbus_clearenv (void);
char ** _dbus_get_environment (void);
@@ -278,6 +276,19 @@ dbus_int32_t _dbus_atomic_get (DBusAtomic *atomic);
#define _DBUS_POLLHUP 0x0080
/** Invalid request: fd not open */
#define _DBUS_POLLNVAL 0x1000
+#elif defined(__QNX__)
+/** Writing now will not block */
+#define _DBUS_POLLOUT 0x0002
+/** There is data to read */
+#define _DBUS_POLLIN 0x0005
+/** There is urgent data to read */
+#define _DBUS_POLLPRI 0x0008
+/** Error condition */
+#define _DBUS_POLLERR 0x0020
+/** Hung up */
+#define _DBUS_POLLHUP 0x0040
+/** Invalid request: fd not open */
+#define _DBUS_POLLNVAL 0x1000
#else
/** There is data to read */
#define _DBUS_POLLIN 0x0001
@@ -373,6 +384,7 @@ dbus_bool_t _dbus_get_is_errno_eagain_or_ewouldblock (void);
dbus_bool_t _dbus_get_is_errno_enomem (void);
dbus_bool_t _dbus_get_is_errno_eintr (void);
dbus_bool_t _dbus_get_is_errno_epipe (void);
+dbus_bool_t _dbus_get_is_errno_etoomanyrefs (void);
const char* _dbus_strerror_from_errno (void);
void _dbus_disable_sigpipe (void);
@@ -437,7 +449,7 @@ void _dbus_set_signal_handler (int sig,
dbus_bool_t _dbus_user_at_console (const char *username,
DBusError *error);
-void _dbus_init_system_log (void);
+void _dbus_init_system_log (dbus_bool_t is_daemon);
typedef enum {
DBUS_SYSTEM_LOG_INFO,
@@ -507,6 +519,16 @@ dbus_bool_t _dbus_read_local_machine_uuid (DBusGUID *machine_id,
*/
dbus_bool_t _dbus_threads_init_platform_specific (void);
+/**
+ * Lock a static mutex used to protect _dbus_threads_init_platform_specific().
+ */
+void _dbus_threads_lock_platform_specific (void);
+
+/**
+ * Undo _dbus_threads_lock_platform_specific().
+ */
+void _dbus_threads_unlock_platform_specific (void);
+
dbus_bool_t _dbus_split_paths_and_append (DBusString *dirs,
const char *suffix,
DBusList **dir_list);
@@ -524,8 +546,6 @@ dbus_bool_t _dbus_change_to_daemon_user (const char *user,
void _dbus_flush_caches (void);
-void _dbus_request_file_descriptor_limit (unsigned int limit);
-
/*
* replaces the term DBUS_PREFIX in configure_time_path by the
* current dbus installation directory. On unix this function is a noop
@@ -536,6 +556,23 @@ void _dbus_request_file_descriptor_limit (unsigned int limit);
const char *
_dbus_replace_install_prefix (const char *configure_time_path);
+/* Do not set this too high: it is a denial-of-service risk.
+ * See <https://bugs.freedesktop.org/show_bug.cgi?id=82820>
+ *
+ * (This needs to be in the non-Unix-specific header so that
+ * the config-parser can use it.)
+ */
+#define DBUS_DEFAULT_MESSAGE_UNIX_FDS 16
+
+typedef struct DBusRLimit DBusRLimit;
+
+DBusRLimit *_dbus_rlimit_save_fd_limit (DBusError *error);
+dbus_bool_t _dbus_rlimit_raise_fd_limit_if_privileged (unsigned int desired,
+ DBusError *error);
+dbus_bool_t _dbus_rlimit_restore_fd_limit (DBusRLimit *saved,
+ DBusError *error);
+void _dbus_rlimit_free (DBusRLimit *lim);
+
/** @} */
DBUS_END_DECLS
diff --git a/dbus/dbus-test.c b/dbus/dbus-test.c
index 224a6c8c..5990d6ec 100644
--- a/dbus/dbus-test.c
+++ b/dbus/dbus-test.c
@@ -28,7 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
static void
die (const char *failure)
{
@@ -41,7 +41,7 @@ check_memleaks (void)
{
dbus_shutdown ();
- printf ("%s: checking for memleaks\n", "dbus-test");
+ printf ("%s: checking for memleaks\n", "test-dbus");
if (_dbus_get_malloc_blocks_outstanding () != 0)
{
_dbus_warn ("%d dbus_malloc blocks were not freed\n",
@@ -60,7 +60,7 @@ run_test (const char *test_name,
{
if (!specific_test || strcmp (specific_test, test_name) == 0)
{
- printf ("%s: running %s tests\n", "dbus-test", test_name);
+ printf ("%s: running %s tests\n", "test-dbus", test_name);
if (!test ())
die (test_name);
@@ -76,7 +76,7 @@ run_data_test (const char *test_name,
{
if (!specific_test || strcmp (specific_test, test_name) == 0)
{
- printf ("%s: running %s tests\n", "dbus-test", test_name);
+ printf ("%s: running %s tests\n", "test-dbus", test_name);
if (!test (test_data_dir))
die (test_name);
@@ -84,7 +84,7 @@ run_data_test (const char *test_name,
}
}
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
/**
* An exported symbol to be run in order to execute
@@ -94,11 +94,12 @@ run_data_test (const char *test_name,
* (with --enable-tests=no)
*
* @param test_data_dir the directory with test data (test/data normally)
+ * @param specific_test run specific test or #NULL to run all tests
*/
void
dbus_internal_do_not_use_run_tests (const char *test_data_dir, const char *specific_test)
{
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
if (!_dbus_threads_init_debug ())
die ("debug threads init");
@@ -164,7 +165,7 @@ dbus_internal_do_not_use_run_tests (const char *test_data_dir, const char *speci
run_data_test ("auth", specific_test, _dbus_auth_test, test_data_dir);
- printf ("%s: completed successfully\n", "dbus-test");
+ printf ("%s: completed successfully\n", "test-dbus");
#else
printf ("Not compiled with unit tests, not running any\n");
#endif
diff --git a/dbus/dbus-threads.c b/dbus/dbus-threads.c
index bb1169db..12d40493 100644
--- a/dbus/dbus-threads.c
+++ b/dbus/dbus-threads.c
@@ -27,18 +27,6 @@
#include "dbus-list.h"
static int thread_init_generation = 0;
-
-static DBusList *uninitialized_rmutex_list = NULL;
-static DBusList *uninitialized_cmutex_list = NULL;
-static DBusList *uninitialized_condvar_list = NULL;
-
-/** This is used for the no-op default mutex pointer, just to be distinct from #NULL */
-#define _DBUS_DUMMY_MUTEX ((DBusMutex*)0xABCDEF)
-#define _DBUS_DUMMY_RMUTEX ((DBusRMutex *) _DBUS_DUMMY_MUTEX)
-#define _DBUS_DUMMY_CMUTEX ((DBusCMutex *) _DBUS_DUMMY_MUTEX)
-
-/** This is used for the no-op default mutex pointer, just to be distinct from #NULL */
-#define _DBUS_DUMMY_CONDVAR ((DBusCondVar*)0xABCDEF2)
/**
* @defgroup DBusThreadsInternals Thread functions
@@ -59,11 +47,6 @@ static DBusList *uninitialized_condvar_list = NULL;
* If possible, the mutex returned by this function is recursive, to
* avoid deadlocks. However, that cannot be relied on.
*
- * The extra level of indirection given by allocating a pointer
- * to point to the mutex location allows the threading
- * module to swap out dummy mutexes for a real mutex so libraries
- * can initialize threads even after the D-Bus API has been used.
- *
* @param location_p the location of the new mutex, can return #NULL on OOM
*/
void
@@ -71,17 +54,13 @@ _dbus_rmutex_new_at_location (DBusRMutex **location_p)
{
_dbus_assert (location_p != NULL);
- if (thread_init_generation == _dbus_current_generation)
+ if (!dbus_threads_init_default ())
{
- *location_p = _dbus_platform_rmutex_new ();
+ *location_p = NULL;
+ return;
}
- else
- {
- *location_p = _DBUS_DUMMY_RMUTEX;
- if (!_dbus_list_append (&uninitialized_rmutex_list, location_p))
- *location_p = NULL;
- }
+ *location_p = _dbus_platform_rmutex_new ();
}
/**
@@ -92,11 +71,6 @@ _dbus_rmutex_new_at_location (DBusRMutex **location_p)
*
* The returned mutex is suitable for use with condition variables.
*
- * The extra level of indirection given by allocating a pointer
- * to point to the mutex location allows the threading
- * module to swap out dummy mutexes for a real mutex so libraries
- * can initialize threads even after the D-Bus API has been used.
- *
* @param location_p the location of the new mutex, can return #NULL on OOM
*/
void
@@ -104,22 +78,17 @@ _dbus_cmutex_new_at_location (DBusCMutex **location_p)
{
_dbus_assert (location_p != NULL);
- if (thread_init_generation == _dbus_current_generation)
+ if (!dbus_threads_init_default ())
{
- *location_p = _dbus_platform_cmutex_new ();
+ *location_p = NULL;
+ return;
}
- else
- {
- *location_p = _DBUS_DUMMY_CMUTEX;
- if (!_dbus_list_append (&uninitialized_cmutex_list, location_p))
- *location_p = NULL;
- }
+ *location_p = _dbus_platform_cmutex_new ();
}
/**
- * Frees a DBusRMutex or removes it from the uninitialized mutex list;
- * does nothing if passed a #NULL pointer.
+ * Frees a DBusRMutex; does nothing if passed a #NULL pointer.
*/
void
_dbus_rmutex_free_at_location (DBusRMutex **location_p)
@@ -127,23 +96,12 @@ _dbus_rmutex_free_at_location (DBusRMutex **location_p)
if (location_p == NULL)
return;
- if (thread_init_generation == _dbus_current_generation)
- {
- if (*location_p != NULL)
- _dbus_platform_rmutex_free (*location_p);
- }
- else
- {
- _dbus_assert (*location_p == NULL || *location_p == _DBUS_DUMMY_RMUTEX);
-
- _dbus_list_remove (&uninitialized_rmutex_list, location_p);
- }
+ if (*location_p != NULL)
+ _dbus_platform_rmutex_free (*location_p);
}
/**
- * Frees a DBusCMutex and removes it from the
- * uninitialized mutex list;
- * does nothing if passed a #NULL pointer.
+ * Frees a DBusCMutex; does nothing if passed a #NULL pointer.
*/
void
_dbus_cmutex_free_at_location (DBusCMutex **location_p)
@@ -151,17 +109,8 @@ _dbus_cmutex_free_at_location (DBusCMutex **location_p)
if (location_p == NULL)
return;
- if (thread_init_generation == _dbus_current_generation)
- {
- if (*location_p != NULL)
- _dbus_platform_cmutex_free (*location_p);
- }
- else
- {
- _dbus_assert (*location_p == NULL || *location_p == _DBUS_DUMMY_CMUTEX);
-
- _dbus_list_remove (&uninitialized_cmutex_list, location_p);
- }
+ if (*location_p != NULL)
+ _dbus_platform_cmutex_free (*location_p);
}
/**
@@ -172,8 +121,10 @@ _dbus_cmutex_free_at_location (DBusCMutex **location_p)
void
_dbus_rmutex_lock (DBusRMutex *mutex)
{
- if (mutex && thread_init_generation == _dbus_current_generation)
- _dbus_platform_rmutex_lock (mutex);
+ if (mutex == NULL)
+ return;
+
+ _dbus_platform_rmutex_lock (mutex);
}
/**
@@ -184,8 +135,10 @@ _dbus_rmutex_lock (DBusRMutex *mutex)
void
_dbus_cmutex_lock (DBusCMutex *mutex)
{
- if (mutex && thread_init_generation == _dbus_current_generation)
- _dbus_platform_cmutex_lock (mutex);
+ if (mutex == NULL)
+ return;
+
+ _dbus_platform_cmutex_lock (mutex);
}
/**
@@ -196,8 +149,10 @@ _dbus_cmutex_lock (DBusCMutex *mutex)
void
_dbus_rmutex_unlock (DBusRMutex *mutex)
{
- if (mutex && thread_init_generation == _dbus_current_generation)
- _dbus_platform_rmutex_unlock (mutex);
+ if (mutex == NULL)
+ return;
+
+ _dbus_platform_rmutex_unlock (mutex);
}
/**
@@ -208,8 +163,10 @@ _dbus_rmutex_unlock (DBusRMutex *mutex)
void
_dbus_cmutex_unlock (DBusCMutex *mutex)
{
- if (mutex && thread_init_generation == _dbus_current_generation)
- _dbus_platform_cmutex_unlock (mutex);
+ if (mutex == NULL)
+ return;
+
+ _dbus_platform_cmutex_unlock (mutex);
}
/**
@@ -223,19 +180,17 @@ _dbus_cmutex_unlock (DBusCMutex *mutex)
DBusCondVar *
_dbus_condvar_new (void)
{
- if (thread_init_generation == _dbus_current_generation)
- return _dbus_platform_condvar_new ();
- else
- return _DBUS_DUMMY_CONDVAR;
+ if (!dbus_threads_init_default ())
+ return NULL;
+
+ return _dbus_platform_condvar_new ();
}
/**
* This does the same thing as _dbus_condvar_new. It however
* gives another level of indirection by allocating a pointer
- * to point to the condvar location. This allows the threading
- * module to swap out dummy condvars for a real condvar so libraries
- * can initialize threads even after the D-Bus API has been used.
+ * to point to the condvar location; this used to be useful.
*
* @returns the location of a new condvar or #NULL on OOM
*/
@@ -245,17 +200,7 @@ _dbus_condvar_new_at_location (DBusCondVar **location_p)
{
_dbus_assert (location_p != NULL);
- if (thread_init_generation == _dbus_current_generation)
- {
- *location_p = _dbus_condvar_new();
- }
- else
- {
- *location_p = _DBUS_DUMMY_CONDVAR;
-
- if (!_dbus_list_append (&uninitialized_condvar_list, location_p))
- *location_p = NULL;
- }
+ *location_p = _dbus_condvar_new();
}
@@ -266,14 +211,14 @@ _dbus_condvar_new_at_location (DBusCondVar **location_p)
void
_dbus_condvar_free (DBusCondVar *cond)
{
- if (cond && thread_init_generation == _dbus_current_generation)
- _dbus_platform_condvar_free (cond);
+ if (cond == NULL)
+ return;
+
+ _dbus_platform_condvar_free (cond);
}
/**
- * Frees a conditional variable and removes it from the
- * uninitialized_condvar_list;
- * does nothing if passed a #NULL pointer.
+ * Frees a condition variable; does nothing if passed a #NULL pointer.
*/
void
_dbus_condvar_free_at_location (DBusCondVar **location_p)
@@ -281,17 +226,8 @@ _dbus_condvar_free_at_location (DBusCondVar **location_p)
if (location_p == NULL)
return;
- if (thread_init_generation == _dbus_current_generation)
- {
- if (*location_p != NULL)
- _dbus_platform_condvar_free (*location_p);
- }
- else
- {
- _dbus_assert (*location_p == NULL || *location_p == _DBUS_DUMMY_CONDVAR);
-
- _dbus_list_remove (&uninitialized_condvar_list, location_p);
- }
+ if (*location_p != NULL)
+ _dbus_platform_condvar_free (*location_p);
}
/**
@@ -304,8 +240,10 @@ void
_dbus_condvar_wait (DBusCondVar *cond,
DBusCMutex *mutex)
{
- if (cond && mutex && thread_init_generation == _dbus_current_generation)
- _dbus_platform_condvar_wait (cond, mutex);
+ if (cond == NULL || mutex == NULL)
+ return;
+
+ _dbus_platform_condvar_wait (cond, mutex);
}
/**
@@ -324,11 +262,11 @@ _dbus_condvar_wait_timeout (DBusCondVar *cond,
DBusCMutex *mutex,
int timeout_milliseconds)
{
- if (cond && mutex && thread_init_generation == _dbus_current_generation)
- return _dbus_platform_condvar_wait_timeout (cond, mutex,
- timeout_milliseconds);
- else
+ if (cond == NULL || mutex == NULL)
return TRUE;
+
+ return _dbus_platform_condvar_wait_timeout (cond, mutex,
+ timeout_milliseconds);
}
/**
@@ -339,215 +277,83 @@ _dbus_condvar_wait_timeout (DBusCondVar *cond,
void
_dbus_condvar_wake_one (DBusCondVar *cond)
{
- if (cond && thread_init_generation == _dbus_current_generation)
- _dbus_platform_condvar_wake_one (cond);
+ if (cond == NULL)
+ return;
+
+ _dbus_platform_condvar_wake_one (cond);
}
+static DBusRMutex *global_locks[_DBUS_N_GLOBAL_LOCKS] = { NULL };
+
static void
-shutdown_global_locks (void *data)
+shutdown_global_locks (void *nil)
{
- DBusRMutex ***locks = data;
int i;
- i = 0;
- while (i < _DBUS_N_GLOBAL_LOCKS)
+ for (i = 0; i < _DBUS_N_GLOBAL_LOCKS; i++)
{
- if (*(locks[i]) != NULL)
- _dbus_platform_rmutex_free (*(locks[i]));
-
- *(locks[i]) = NULL;
- ++i;
+ _dbus_assert (global_locks[i] != NULL);
+ _dbus_platform_rmutex_free (global_locks[i]);
+ global_locks[i] = NULL;
}
-
- dbus_free (locks);
-}
-
-static void
-shutdown_uninitialized_locks (void *data)
-{
- _dbus_list_clear (&uninitialized_rmutex_list);
- _dbus_list_clear (&uninitialized_cmutex_list);
- _dbus_list_clear (&uninitialized_condvar_list);
}
static dbus_bool_t
-init_uninitialized_locks (void)
+init_global_locks (void)
{
- DBusList *link;
-
- _dbus_assert (thread_init_generation != _dbus_current_generation);
-
- link = uninitialized_rmutex_list;
- while (link != NULL)
- {
- DBusRMutex **mp;
-
- mp = link->data;
- _dbus_assert (*mp == _DBUS_DUMMY_RMUTEX);
-
- *mp = _dbus_platform_rmutex_new ();
- if (*mp == NULL)
- goto fail_mutex;
-
- link = _dbus_list_get_next_link (&uninitialized_rmutex_list, link);
- }
-
- link = uninitialized_cmutex_list;
- while (link != NULL)
- {
- DBusCMutex **mp;
-
- mp = link->data;
- _dbus_assert (*mp == _DBUS_DUMMY_CMUTEX);
-
- *mp = _dbus_platform_cmutex_new ();
- if (*mp == NULL)
- goto fail_mutex;
-
- link = _dbus_list_get_next_link (&uninitialized_cmutex_list, link);
- }
+ int i;
+ dbus_bool_t ok;
- link = uninitialized_condvar_list;
- while (link != NULL)
+ for (i = 0; i < _DBUS_N_GLOBAL_LOCKS; i++)
{
- DBusCondVar **cp;
-
- cp = (DBusCondVar **)link->data;
- _dbus_assert (*cp == _DBUS_DUMMY_CONDVAR);
+ _dbus_assert (global_locks[i] == NULL);
- *cp = _dbus_platform_condvar_new ();
- if (*cp == NULL)
- goto fail_condvar;
+ global_locks[i] = _dbus_platform_rmutex_new ();
- link = _dbus_list_get_next_link (&uninitialized_condvar_list, link);
+ if (global_locks[i] == NULL)
+ goto failed;
}
- _dbus_list_clear (&uninitialized_rmutex_list);
- _dbus_list_clear (&uninitialized_cmutex_list);
- _dbus_list_clear (&uninitialized_condvar_list);
+ _dbus_platform_rmutex_lock (global_locks[_DBUS_LOCK_shutdown_funcs]);
+ ok = _dbus_register_shutdown_func_unlocked (shutdown_global_locks, NULL);
+ _dbus_platform_rmutex_unlock (global_locks[_DBUS_LOCK_shutdown_funcs]);
- if (!_dbus_register_shutdown_func (shutdown_uninitialized_locks,
- NULL))
- goto fail_condvar;
+ if (!ok)
+ goto failed;
return TRUE;
- fail_condvar:
- link = uninitialized_condvar_list;
- while (link != NULL)
- {
- DBusCondVar **cp;
-
- cp = link->data;
-
- if (*cp != _DBUS_DUMMY_CONDVAR && *cp != NULL)
- _dbus_platform_condvar_free (*cp);
-
- *cp = _DBUS_DUMMY_CONDVAR;
-
- link = _dbus_list_get_next_link (&uninitialized_condvar_list, link);
- }
-
- fail_mutex:
- link = uninitialized_rmutex_list;
- while (link != NULL)
- {
- DBusRMutex **mp;
-
- mp = link->data;
-
- if (*mp != _DBUS_DUMMY_RMUTEX && *mp != NULL)
- _dbus_platform_rmutex_free (*mp);
-
- *mp = _DBUS_DUMMY_RMUTEX;
-
- link = _dbus_list_get_next_link (&uninitialized_rmutex_list, link);
- }
-
- link = uninitialized_cmutex_list;
- while (link != NULL)
+ failed:
+ for (i = i - 1; i >= 0; i--)
{
- DBusCMutex **mp;
-
- mp = link->data;
-
- if (*mp != _DBUS_DUMMY_CMUTEX && *mp != NULL)
- _dbus_platform_cmutex_free (*mp);
-
- *mp = _DBUS_DUMMY_CMUTEX;
-
- link = _dbus_list_get_next_link (&uninitialized_cmutex_list, link);
+ _dbus_platform_rmutex_free (global_locks[i]);
+ global_locks[i] = NULL;
}
return FALSE;
}
-static dbus_bool_t
-init_locks (void)
+dbus_bool_t
+_dbus_lock (DBusGlobalLock lock)
{
- int i;
- DBusRMutex ***dynamic_global_locks;
- DBusRMutex **global_locks[] = {
-#define LOCK_ADDR(name) (& _dbus_lock_##name)
- LOCK_ADDR (win_fds),
- LOCK_ADDR (sid_atom_cache),
- LOCK_ADDR (list),
- LOCK_ADDR (connection_slots),
- LOCK_ADDR (pending_call_slots),
- LOCK_ADDR (server_slots),
- LOCK_ADDR (message_slots),
-#if !DBUS_USE_SYNC
- LOCK_ADDR (atomic),
-#endif
- LOCK_ADDR (bus),
- LOCK_ADDR (bus_datas),
- LOCK_ADDR (shutdown_funcs),
- LOCK_ADDR (system_users),
- LOCK_ADDR (message_cache),
- LOCK_ADDR (shared_connections),
- LOCK_ADDR (machine_uuid)
-#undef LOCK_ADDR
- };
-
- _dbus_assert (_DBUS_N_ELEMENTS (global_locks) ==
- _DBUS_N_GLOBAL_LOCKS);
-
- i = 0;
-
- dynamic_global_locks = dbus_new (DBusRMutex**, _DBUS_N_GLOBAL_LOCKS);
- if (dynamic_global_locks == NULL)
- goto failed;
-
- while (i < _DBUS_N_ELEMENTS (global_locks))
- {
- *global_locks[i] = _dbus_platform_rmutex_new ();
-
- if (*global_locks[i] == NULL)
- goto failed;
+ _dbus_assert (lock >= 0);
+ _dbus_assert (lock < _DBUS_N_GLOBAL_LOCKS);
- dynamic_global_locks[i] = global_locks[i];
-
- ++i;
- }
-
- if (!_dbus_register_shutdown_func (shutdown_global_locks,
- dynamic_global_locks))
- goto failed;
+ if (thread_init_generation != _dbus_current_generation &&
+ !dbus_threads_init_default ())
+ return FALSE;
- if (!init_uninitialized_locks ())
- goto failed;
-
+ _dbus_platform_rmutex_lock (global_locks[lock]);
return TRUE;
+}
- failed:
- dbus_free (dynamic_global_locks);
-
- for (i = i - 1; i >= 0; i--)
- {
- _dbus_platform_rmutex_free (*global_locks[i]);
- *global_locks[i] = NULL;
- }
- return FALSE;
+void
+_dbus_unlock (DBusGlobalLock lock)
+{
+ _dbus_assert (lock >= 0);
+ _dbus_assert (lock < _DBUS_N_GLOBAL_LOCKS);
+
+ _dbus_platform_rmutex_unlock (global_locks[lock]);
}
/** @} */ /* end of internals */
@@ -584,14 +390,24 @@ init_locks (void)
dbus_bool_t
dbus_threads_init (const DBusThreadFunctions *functions)
{
+ _dbus_threads_lock_platform_specific ();
+
if (thread_init_generation == _dbus_current_generation)
- return TRUE;
+ {
+ _dbus_threads_unlock_platform_specific ();
+ return TRUE;
+ }
- if (!init_locks ())
- return FALSE;
+ if (!_dbus_threads_init_platform_specific() ||
+ !init_global_locks ())
+ {
+ _dbus_threads_unlock_platform_specific ();
+ return FALSE;
+ }
thread_init_generation = _dbus_current_generation;
-
+
+ _dbus_threads_unlock_platform_specific ();
return TRUE;
}
@@ -602,11 +418,16 @@ dbus_threads_init (const DBusThreadFunctions *functions)
/**
* Initializes threads. If this function is not called, the D-Bus
* library will not lock any data structures. If it is called, D-Bus
- * will do locking, at some cost in efficiency. Note that this
- * function must be called BEFORE the second thread is started.
+ * will do locking, at some cost in efficiency.
+ *
+ * Since D-Bus 1.7 it is safe to call this function from any thread,
+ * any number of times (but it must be called before any other
+ * libdbus API is used).
*
- * It's safe to call dbus_threads_init_default() as many times as you
- * want, but only the first time will have an effect.
+ * In D-Bus 1.6 or older, this function must be called in the main thread
+ * before any other thread starts. As a result, it is not sufficient to
+ * call this function in a library or plugin, unless the library or plugin
+ * imposes a similar requirement on its callers.
*
* dbus_shutdown() reverses the effects of this function when it
* resets all global state in libdbus.
@@ -616,18 +437,18 @@ dbus_threads_init (const DBusThreadFunctions *functions)
dbus_bool_t
dbus_threads_init_default (void)
{
- return _dbus_threads_init_platform_specific ();
+ return dbus_threads_init (NULL);
}
/** @} */
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
dbus_bool_t
_dbus_threads_init_debug (void)
{
- return _dbus_threads_init_platform_specific();
+ return dbus_threads_init (NULL);
}
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/dbus/dbus-transport-protected.h b/dbus/dbus-transport-protected.h
index 44b9d785..396f0ffd 100644
--- a/dbus/dbus-transport-protected.h
+++ b/dbus/dbus-transport-protected.h
@@ -111,7 +111,7 @@ struct DBusTransport
DBusFreeFunction free_windows_user_data; /**< Function to free windows_user_data */
unsigned int disconnected : 1; /**< #TRUE if we are disconnected. */
- unsigned int authenticated : 1; /**< Cache of auth state; use _dbus_transport_get_is_authenticated() to query value */
+ unsigned int authenticated : 1; /**< Cache of auth state; use _dbus_transport_peek_is_authenticated() to query value */
unsigned int send_credentials_pending : 1; /**< #TRUE if we need to send credentials */
unsigned int receive_credentials_pending : 1; /**< #TRUE if we need to receive credentials */
unsigned int is_server : 1; /**< #TRUE if on the server side */
diff --git a/dbus/dbus-transport-socket.c b/dbus/dbus-transport-socket.c
index 544d00a9..199d3b54 100644
--- a/dbus/dbus-transport-socket.c
+++ b/dbus/dbus-transport-socket.c
@@ -135,7 +135,7 @@ check_write_watch (DBusTransport *transport)
_dbus_transport_ref (transport);
- if (_dbus_transport_get_is_authenticated (transport))
+ if (_dbus_transport_try_to_authenticate (transport))
needed = _dbus_connection_has_messages_to_send_unlocked (transport->connection);
else
{
@@ -190,7 +190,7 @@ check_read_watch (DBusTransport *transport)
_dbus_transport_ref (transport);
- if (_dbus_transport_get_is_authenticated (transport))
+ if (_dbus_transport_try_to_authenticate (transport))
need_read_watch =
(_dbus_counter_get_size_value (transport->live_messages) < transport->max_live_messages_size) &&
(_dbus_counter_get_unix_fd_value (transport->live_messages) < transport->max_live_messages_unix_fds);
@@ -255,8 +255,7 @@ read_data_into_auth (DBusTransport *transport,
bytes_read = _dbus_read_socket (socket_transport->fd,
buffer, socket_transport->max_bytes_read_per_iteration);
- _dbus_auth_return_buffer (transport->auth, buffer,
- bytes_read > 0 ? bytes_read : 0);
+ _dbus_auth_return_buffer (transport->auth, buffer);
if (bytes_read > 0)
{
@@ -404,7 +403,7 @@ do_authentication (DBusTransport *transport,
oom = FALSE;
- orig_auth_state = _dbus_transport_get_is_authenticated (transport);
+ orig_auth_state = _dbus_transport_try_to_authenticate (transport);
/* This is essential to avoid the check_write_watch() at the end,
* we don't want to add a write watch in do_iteration before
@@ -419,7 +418,7 @@ do_authentication (DBusTransport *transport,
_dbus_transport_ref (transport);
- while (!_dbus_transport_get_is_authenticated (transport) &&
+ while (!_dbus_transport_try_to_authenticate (transport) &&
_dbus_transport_get_is_connected (transport))
{
if (!exchange_credentials (transport, do_reading, do_writing))
@@ -477,7 +476,7 @@ do_authentication (DBusTransport *transport,
out:
if (auth_completed)
- *auth_completed = (orig_auth_state != _dbus_transport_get_is_authenticated (transport));
+ *auth_completed = (orig_auth_state != _dbus_transport_try_to_authenticate (transport));
check_read_watch (transport);
check_write_watch (transport);
@@ -498,7 +497,7 @@ do_writing (DBusTransport *transport)
dbus_bool_t oom;
/* No messages without authentication! */
- if (!_dbus_transport_get_is_authenticated (transport))
+ if (!_dbus_transport_try_to_authenticate (transport))
{
_dbus_verbose ("Not authenticated, not writing anything\n");
return TRUE;
@@ -646,12 +645,44 @@ do_writing (DBusTransport *transport)
{
/* EINTR already handled for us */
- /* For some discussion of why we also ignore EPIPE here, see
+ /* If the other end closed the socket with close() or shutdown(), we
+ * receive EPIPE here but we must not close the socket yet: there
+ * might still be some data to read. See:
* http://lists.freedesktop.org/archives/dbus/2008-March/009526.html
*/
if (_dbus_get_is_errno_eagain_or_ewouldblock () || _dbus_get_is_errno_epipe ())
goto out;
+
+ /* Since Linux commit 25888e (from 2.6.37-rc4, Nov 2010), sendmsg()
+ * on Unix sockets returns -1 errno=ETOOMANYREFS when the passfd
+ * mechanism (SCM_RIGHTS) is used recursively with a recursion level
+ * of maximum 4. The kernel does not have an API to check whether
+ * the passed fds can be forwarded and it can change asynchronously.
+ * See:
+ * https://bugs.freedesktop.org/show_bug.cgi?id=80163
+ */
+
+ else if (_dbus_get_is_errno_etoomanyrefs ())
+ {
+ /* We only send fds in the first byte of the message.
+ * ETOOMANYREFS cannot happen after.
+ */
+ _dbus_assert (socket_transport->message_bytes_written == 0);
+
+ _dbus_verbose (" discard message of %d bytes due to ETOOMANYREFS\n",
+ total_bytes_to_write);
+
+ socket_transport->message_bytes_written = 0;
+ _dbus_string_set_length (&socket_transport->encoded_outgoing, 0);
+ _dbus_string_compact (&socket_transport->encoded_outgoing, 2048);
+
+ /* The message was not actually sent but it needs to be removed
+ * from the outgoing queue
+ */
+ _dbus_connection_message_sent_unlocked (transport->connection,
+ message);
+ }
else
{
_dbus_verbose ("Error writing to remote app: %s\n",
@@ -703,7 +734,7 @@ do_reading (DBusTransport *transport)
_dbus_verbose ("fd = %d\n",socket_transport->fd);
/* No messages without authentication! */
- if (!_dbus_transport_get_is_authenticated (transport))
+ if (!_dbus_transport_try_to_authenticate (transport))
return TRUE;
oom = FALSE;
@@ -748,29 +779,23 @@ do_reading (DBusTransport *transport)
if (bytes_read > 0)
{
- int orig_len;
-
_dbus_message_loader_get_buffer (transport->loader,
&buffer);
- orig_len = _dbus_string_get_length (buffer);
-
if (!_dbus_auth_decode_data (transport->auth,
&socket_transport->encoded_incoming,
buffer))
{
_dbus_verbose ("Out of memory decoding incoming data\n");
_dbus_message_loader_return_buffer (transport->loader,
- buffer,
- _dbus_string_get_length (buffer) - orig_len);
+ buffer);
oom = TRUE;
goto out;
}
_dbus_message_loader_return_buffer (transport->loader,
- buffer,
- _dbus_string_get_length (buffer) - orig_len);
+ buffer);
_dbus_string_set_length (&socket_transport->encoded_incoming, 0);
_dbus_string_compact (&socket_transport->encoded_incoming, 2048);
@@ -789,7 +814,7 @@ do_reading (DBusTransport *transport)
if (!_dbus_message_loader_get_unix_fds(transport->loader, &fds, &n_fds))
{
_dbus_verbose ("Out of memory reading file descriptors\n");
- _dbus_message_loader_return_buffer (transport->loader, buffer, 0);
+ _dbus_message_loader_return_buffer (transport->loader, buffer);
oom = TRUE;
goto out;
}
@@ -812,8 +837,7 @@ do_reading (DBusTransport *transport)
}
_dbus_message_loader_return_buffer (transport->loader,
- buffer,
- bytes_read < 0 ? 0 : bytes_read);
+ buffer);
}
if (bytes_read < 0)
@@ -1055,7 +1079,7 @@ socket_do_iteration (DBusTransport *transport,
poll_fd.fd = socket_transport->fd;
poll_fd.events = 0;
- if (_dbus_transport_get_is_authenticated (transport))
+ if (_dbus_transport_try_to_authenticate (transport))
{
/* This is kind of a hack; if we have stuff to write, then try
* to avoid the poll. This is probably about a 5% speedup on an
@@ -1299,7 +1323,7 @@ _dbus_transport_new_for_socket (int fd,
* @param host the host to connect to
* @param port the port to connect to
* @param family the address family to connect to
- * @param path to nonce file
+ * @param noncefile path to nonce file
* @param error location to store reason for failure.
* @returns a new transport, or #NULL on failure.
*/
diff --git a/dbus/dbus-transport-unix.c b/dbus/dbus-transport-unix.c
index 6ba5c0b5..9a9fea50 100644
--- a/dbus/dbus-transport-unix.c
+++ b/dbus/dbus-transport-unix.c
@@ -412,7 +412,7 @@ _dbus_transport_open_platform_specific (DBusAddressEntry *entry,
/** @} */
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
dbus_bool_t
_dbus_transport_unix_test (void)
diff --git a/dbus/dbus-transport.c b/dbus/dbus-transport.c
index 6b58fda2..f63e0ced 100644
--- a/dbus/dbus-transport.c
+++ b/dbus/dbus-transport.c
@@ -32,7 +32,7 @@
#include "dbus-credentials.h"
#include "dbus-mainloop.h"
#include "dbus-message.h"
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#include "dbus-server-debug-pipe.h"
#endif
@@ -242,6 +242,7 @@ _dbus_transport_finalize_base (DBusTransport *transport)
* opened DBusTransport object. If it isn't, returns #NULL
* and sets @p error.
*
+ * @param address the address to be checked.
* @param error address where an error can be returned.
* @returns a new transport, or #NULL on failure.
*/
@@ -272,6 +273,7 @@ check_address (const char *address, DBusError *error)
* Creates a new transport for the "autostart" method.
* This creates a client-side of a transport.
*
+ * @param scope scope of autolaunch (Windows only)
* @param error address where an error can be returned.
* @returns a new transport, or #NULL on failure.
*/
@@ -348,7 +350,7 @@ static const struct {
{ _dbus_transport_open_socket },
{ _dbus_transport_open_platform_specific },
{ _dbus_transport_open_autolaunch }
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
, { _dbus_transport_open_debug_pipe }
#endif
};
@@ -684,10 +686,33 @@ auth_via_default_rules (DBusTransport *transport)
return allow;
}
+/**
+ * Returns #TRUE if we have been authenticated. It will return #TRUE even if
+ * the transport is now disconnected, but was ever authenticated before
+ * disconnecting.
+ *
+ * This replaces the older _dbus_transport_get_is_authenticated() which
+ * had side-effects.
+ *
+ * @param transport the transport
+ * @returns whether we're authenticated
+ */
+dbus_bool_t
+_dbus_transport_peek_is_authenticated (DBusTransport *transport)
+{
+ return transport->authenticated;
+}
/**
- * Returns #TRUE if we have been authenticated. Will return #TRUE
- * even if the transport is disconnected.
+ * Returns #TRUE if we have been authenticated. It will return #TRUE even if
+ * the transport is now disconnected, but was ever authenticated before
+ * disconnecting.
+ *
+ * If we have not finished authenticating, but we have enough buffered input
+ * to finish the job, then this function will do so before it returns.
+ *
+ * This used to be called _dbus_transport_get_is_authenticated(), but that
+ * name seems inappropriate for a function with side-effects.
*
* @todo we drop connection->mutex when calling the unix_user_function,
* and windows_user_function, which may not be safe really.
@@ -696,7 +721,7 @@ auth_via_default_rules (DBusTransport *transport)
* @returns whether we're authenticated
*/
dbus_bool_t
-_dbus_transport_get_is_authenticated (DBusTransport *transport)
+_dbus_transport_try_to_authenticate (DBusTransport *transport)
{
if (transport->authenticated)
return TRUE;
@@ -1020,9 +1045,7 @@ recover_unused_bytes (DBusTransport *transport)
orig_len);
_dbus_message_loader_return_buffer (transport->loader,
- buffer,
- _dbus_string_get_length (buffer) -
- orig_len);
+ buffer);
_dbus_auth_delete_unused_bytes (transport->auth);
@@ -1052,9 +1075,7 @@ recover_unused_bytes (DBusTransport *transport)
orig_len);
_dbus_message_loader_return_buffer (transport->loader,
- buffer,
- _dbus_string_get_length (buffer) -
- orig_len);
+ buffer);
if (succeeded)
_dbus_auth_delete_unused_bytes (transport->auth);
@@ -1083,12 +1104,12 @@ _dbus_transport_get_dispatch_status (DBusTransport *transport)
_dbus_counter_get_unix_fd_value (transport->live_messages) >= transport->max_live_messages_unix_fds)
return DBUS_DISPATCH_COMPLETE; /* complete for now */
- if (!_dbus_transport_get_is_authenticated (transport))
+ if (!_dbus_transport_try_to_authenticate (transport))
{
if (_dbus_auth_do_work (transport->auth) ==
DBUS_AUTH_STATE_WAITING_FOR_MEMORY)
return DBUS_DISPATCH_NEED_MEMORY;
- else if (!_dbus_transport_get_is_authenticated (transport))
+ else if (!_dbus_transport_try_to_authenticate (transport))
return DBUS_DISPATCH_COMPLETE;
}
@@ -1337,7 +1358,7 @@ _dbus_transport_get_unix_process_id (DBusTransport *transport,
if (_dbus_credentials_include (auth_identity,
DBUS_CREDENTIAL_UNIX_PROCESS_ID))
{
- *pid = _dbus_credentials_get_unix_pid (auth_identity);
+ *pid = _dbus_credentials_get_pid (auth_identity);
return TRUE;
}
else
@@ -1491,6 +1512,33 @@ _dbus_transport_set_allow_anonymous (DBusTransport *transport,
transport->allow_anonymous = value != FALSE;
}
+/**
+ * Return how many file descriptors are pending in the loader
+ *
+ * @param transport the transport
+ */
+int
+_dbus_transport_get_pending_fds_count (DBusTransport *transport)
+{
+ return _dbus_message_loader_get_pending_fds_count (transport->loader);
+}
+
+/**
+ * Register a function to be called whenever the number of pending file
+ * descriptors in the loader change.
+ *
+ * @param transport the transport
+ * @param callback the callback
+ */
+void
+_dbus_transport_set_pending_fds_function (DBusTransport *transport,
+ void (* callback) (void *),
+ void *data)
+{
+ _dbus_message_loader_set_pending_fds_function (transport->loader,
+ callback, data);
+}
+
#ifdef DBUS_ENABLE_STATS
void
_dbus_transport_get_stats (DBusTransport *transport,
diff --git a/dbus/dbus-transport.h b/dbus/dbus-transport.h
index 4b821517..39c74c46 100644
--- a/dbus/dbus-transport.h
+++ b/dbus/dbus-transport.h
@@ -38,7 +38,8 @@ DBusTransport* _dbus_transport_ref (DBusTransport
void _dbus_transport_unref (DBusTransport *transport);
void _dbus_transport_disconnect (DBusTransport *transport);
dbus_bool_t _dbus_transport_get_is_connected (DBusTransport *transport);
-dbus_bool_t _dbus_transport_get_is_authenticated (DBusTransport *transport);
+dbus_bool_t _dbus_transport_peek_is_authenticated (DBusTransport *transport);
+dbus_bool_t _dbus_transport_try_to_authenticate (DBusTransport *transport);
dbus_bool_t _dbus_transport_get_is_anonymous (DBusTransport *transport);
dbus_bool_t _dbus_transport_can_pass_unix_fd (DBusTransport *transport);
@@ -96,6 +97,10 @@ dbus_bool_t _dbus_transport_set_auth_mechanisms (DBusTransport
const char **mechanisms);
void _dbus_transport_set_allow_anonymous (DBusTransport *transport,
dbus_bool_t value);
+int _dbus_transport_get_pending_fds_count (DBusTransport *transport);
+void _dbus_transport_set_pending_fds_function (DBusTransport *transport,
+ void (* callback) (void *),
+ void *data);
/* if DBUS_ENABLE_STATS */
void _dbus_transport_get_stats (DBusTransport *transport,
diff --git a/dbus/dbus-types.h b/dbus/dbus-types.h
index 57fc586a..021a55af 100644
--- a/dbus/dbus-types.h
+++ b/dbus/dbus-types.h
@@ -79,43 +79,23 @@ typedef dbus_uint32_t dbus_bool_t;
/**
* @typedef dbus_uint64_t
*
- * A 64-bit unsigned integer on all platforms that support it.
- * If supported, #DBUS_HAVE_INT64 will be defined.
- *
- * C99 requires a 64-bit type and most likely all interesting
- * compilers support one. GLib for example flat-out requires
- * a 64-bit type.
- *
- * You probably want to just assume #DBUS_HAVE_INT64 is always defined.
+ * A 64-bit unsigned integer.
*/
/**
* @typedef dbus_int64_t
*
- * A 64-bit signed integer on all platforms that support it.
- * If supported, #DBUS_HAVE_INT64 will be defined.
- *
- * C99 requires a 64-bit type and most likely all interesting
- * compilers support one. GLib for example flat-out requires
- * a 64-bit type.
- *
- * You probably want to just assume #DBUS_HAVE_INT64 is always defined.
+ * A 64-bit signed integer.
*/
/**
* @def DBUS_HAVE_INT64
*
- * Defined if 64-bit integers are available. Will be defined
- * on any platform you care about, unless you care about
- * some truly ancient UNIX, or some bizarre embedded platform.
+ * Always defined.
*
- * C99 requires a 64-bit type and most likely all interesting
- * compilers support one. GLib for example flat-out requires
- * a 64-bit type.
- *
- * You should feel comfortable ignoring this macro and just using
- * int64 unconditionally.
- *
+ * In older libdbus versions, this would be undefined if there was no
+ * 64-bit integer type on that platform. libdbus no longer supports
+ * such platforms.
*/
/**
@@ -136,7 +116,7 @@ typedef dbus_uint32_t dbus_bool_t;
/**
* An 8-byte struct you could use to access int64 without having
- * int64 support
+ * int64 support. Use #dbus_int64_t or #dbus_uint64_t instead.
*/
typedef struct
{
@@ -162,10 +142,8 @@ typedef union
dbus_int32_t i32; /**< as int32 */
dbus_uint32_t u32; /**< as int32 */
dbus_bool_t bool_val; /**< as boolean */
-#ifdef DBUS_HAVE_INT64
dbus_int64_t i64; /**< as int64 */
dbus_uint64_t u64; /**< as int64 */
-#endif
DBus8ByteStruct eight; /**< as 8-byte struct */
double dbl; /**< as double */
unsigned char byt; /**< as byte */
diff --git a/dbus/dbus-userdb-util.c b/dbus/dbus-userdb-util.c
index 16bf2291..888a23e9 100644
--- a/dbus/dbus-userdb-util.c
+++ b/dbus/dbus-userdb-util.c
@@ -21,6 +21,7 @@
*
*/
#include <config.h>
+#include <unistd.h>
#define DBUS_USERDB_INCLUDES_PRIVATE 1
#include "dbus-userdb.h"
#include "dbus-test.h"
@@ -29,7 +30,6 @@
#include <string.h>
#if HAVE_SYSTEMD
-#include <systemd/sd-daemon.h>
#include <systemd/sd-login.h>
#endif
@@ -55,7 +55,8 @@ _dbus_is_console_user (dbus_uid_t uid,
dbus_bool_t result = FALSE;
#ifdef HAVE_SYSTEMD
- if (sd_booted () > 0)
+ /* check if we have logind */
+ if (access ("/run/systemd/seats/", F_OK) >= 0)
{
int r;
@@ -103,7 +104,11 @@ _dbus_is_console_user (dbus_uid_t uid,
#endif /* HAVE_CONSOLE_OWNER_FILE */
- _dbus_user_database_lock_system ();
+ if (!_dbus_user_database_lock_system ())
+ {
+ _DBUS_SET_OOM (error);
+ return FALSE;
+ }
db = _dbus_user_database_get_system ();
if (db == NULL)
@@ -157,7 +162,10 @@ _dbus_get_group_id (const DBusString *groupname,
{
DBusUserDatabase *db;
const DBusGroupInfo *info;
- _dbus_user_database_lock_system ();
+
+ /* FIXME: this can't distinguish ENOMEM from other errors */
+ if (!_dbus_user_database_lock_system ())
+ return FALSE;
db = _dbus_user_database_get_system ();
if (db == NULL)
@@ -194,7 +202,10 @@ _dbus_get_user_id_and_primary_group (const DBusString *username,
{
DBusUserDatabase *db;
const DBusUserInfo *info;
- _dbus_user_database_lock_system ();
+
+ /* FIXME: this can't distinguish ENOMEM from other errors */
+ if (!_dbus_user_database_lock_system ())
+ return FALSE;
db = _dbus_user_database_get_system ();
if (db == NULL)
@@ -250,7 +261,6 @@ _dbus_user_database_lookup_group (DBusUserDatabase *db,
gid = n;
}
-#ifdef DBUS_ENABLE_USERDB_CACHE
if (gid != DBUS_GID_UNSET)
info = _dbus_hash_table_lookup_uintptr (db->groups, gid);
else
@@ -263,9 +273,6 @@ _dbus_user_database_lookup_group (DBusUserDatabase *db,
return info;
}
else
-#else
- if (1)
-#endif
{
if (gid != DBUS_GID_UNSET)
_dbus_verbose ("No cache for GID "DBUS_GID_FORMAT"\n",
@@ -387,7 +394,9 @@ _dbus_groups_from_uid (dbus_uid_t uid,
*group_ids = NULL;
*n_group_ids = 0;
- _dbus_user_database_lock_system ();
+ /* FIXME: this can't distinguish ENOMEM from other errors */
+ if (!_dbus_user_database_lock_system ())
+ return FALSE;
db = _dbus_user_database_get_system ();
if (db == NULL)
@@ -424,7 +433,7 @@ _dbus_groups_from_uid (dbus_uid_t uid,
}
/** @} */
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#include <stdio.h>
/**
@@ -477,4 +486,4 @@ _dbus_userdb_test (const char *test_data_dir)
return TRUE;
}
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/dbus/dbus-userdb.c b/dbus/dbus-userdb.c
index 4e8b39aa..52f927a3 100644
--- a/dbus/dbus-userdb.c
+++ b/dbus/dbus-userdb.c
@@ -144,7 +144,6 @@ _dbus_user_database_lookup (DBusUserDatabase *db,
uid = n;
}
-#ifdef DBUS_ENABLE_USERDB_CACHE
if (uid != DBUS_UID_UNSET)
info = _dbus_hash_table_lookup_uintptr (db->users, uid);
else
@@ -157,9 +156,6 @@ _dbus_user_database_lookup (DBusUserDatabase *db,
return info;
}
else
-#else
- if (1)
-#endif
{
if (uid != DBUS_UID_UNSET)
_dbus_verbose ("No cache for UID "DBUS_UID_FORMAT"\n",
@@ -306,11 +302,18 @@ init_system_db (void)
/**
* Locks global system user database.
*/
-void
+dbus_bool_t
_dbus_user_database_lock_system (void)
{
- _DBUS_LOCK (system_users);
- database_locked = TRUE;
+ if (_DBUS_LOCK (system_users))
+ {
+ database_locked = TRUE;
+ return TRUE;
+ }
+ else
+ {
+ return FALSE;
+ }
}
/**
@@ -345,8 +348,12 @@ _dbus_user_database_get_system (void)
void
_dbus_user_database_flush_system (void)
{
- _dbus_user_database_lock_system ();
-
+ if (!_dbus_user_database_lock_system ())
+ {
+ /* nothing to flush */
+ return;
+ }
+
if (system_db != NULL)
_dbus_user_database_flush (system_db);
@@ -363,7 +370,9 @@ _dbus_user_database_flush_system (void)
dbus_bool_t
_dbus_username_from_current_process (const DBusString **username)
{
- _dbus_user_database_lock_system ();
+ if (!_dbus_user_database_lock_system ())
+ return FALSE;
+
if (!init_system_db ())
{
_dbus_user_database_unlock_system ();
@@ -385,7 +394,9 @@ _dbus_username_from_current_process (const DBusString **username)
dbus_bool_t
_dbus_homedir_from_current_process (const DBusString **homedir)
{
- _dbus_user_database_lock_system ();
+ if (!_dbus_user_database_lock_system ())
+ return FALSE;
+
if (!init_system_db ())
{
_dbus_user_database_unlock_system ();
@@ -410,7 +421,10 @@ _dbus_homedir_from_username (const DBusString *username,
{
DBusUserDatabase *db;
const DBusUserInfo *info;
- _dbus_user_database_lock_system ();
+
+ /* FIXME: this can't distinguish ENOMEM from other errors */
+ if (!_dbus_user_database_lock_system ())
+ return FALSE;
db = _dbus_user_database_get_system ();
if (db == NULL)
@@ -449,7 +463,10 @@ _dbus_homedir_from_uid (dbus_uid_t uid,
{
DBusUserDatabase *db;
const DBusUserInfo *info;
- _dbus_user_database_lock_system ();
+
+ /* FIXME: this can't distinguish ENOMEM from other errors */
+ if (!_dbus_user_database_lock_system ())
+ return FALSE;
db = _dbus_user_database_get_system ();
if (db == NULL)
@@ -496,7 +513,9 @@ _dbus_credentials_add_from_user (DBusCredentials *credentials,
DBusUserDatabase *db;
const DBusUserInfo *info;
- _dbus_user_database_lock_system ();
+ /* FIXME: this can't distinguish ENOMEM from other errors */
+ if (!_dbus_user_database_lock_system ())
+ return FALSE;
db = _dbus_user_database_get_system ();
if (db == NULL)
@@ -579,7 +598,7 @@ _dbus_user_database_flush (DBusUserDatabase *db)
_dbus_hash_table_remove_all(db->groups);
}
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
/**
* Increments refcount of user database.
* @param db the database
@@ -594,7 +613,7 @@ _dbus_user_database_ref (DBusUserDatabase *db)
return db;
}
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
/**
* Decrements refcount of user database.
diff --git a/dbus/dbus-userdb.h b/dbus/dbus-userdb.h
index cb49d9e7..d6b72d8c 100644
--- a/dbus/dbus-userdb.h
+++ b/dbus/dbus-userdb.h
@@ -86,7 +86,7 @@ void _dbus_group_info_free_allocated (DBusGroupInfo *info);
#endif /* DBUS_USERDB_INCLUDES_PRIVATE */
DBusUserDatabase* _dbus_user_database_get_system (void);
-void _dbus_user_database_lock_system (void);
+dbus_bool_t _dbus_user_database_lock_system (void) _DBUS_GNUC_WARN_UNUSED_RESULT;
void _dbus_user_database_unlock_system (void);
void _dbus_user_database_flush_system (void);
diff --git a/dbus/dbus-watch.c b/dbus/dbus-watch.c
index b9f4ac23..76a5d641 100644
--- a/dbus/dbus-watch.c
+++ b/dbus/dbus-watch.c
@@ -259,6 +259,25 @@ _dbus_watch_list_free (DBusWatchList *watch_list)
dbus_free (watch_list);
}
+#ifdef DBUS_ENABLE_VERBOSE_MODE
+static const char*
+watch_flags_to_string (int flags)
+{
+ const char *watch_type;
+
+ if ((flags & DBUS_WATCH_READABLE) &&
+ (flags & DBUS_WATCH_WRITABLE))
+ watch_type = "readwrite";
+ else if (flags & DBUS_WATCH_READABLE)
+ watch_type = "read";
+ else if (flags & DBUS_WATCH_WRITABLE)
+ watch_type = "write";
+ else
+ watch_type = "not read or write";
+ return watch_type;
+}
+#endif /* DBUS_ENABLE_VERBOSE_MODE */
+
/**
* Sets the watch functions. This function is the "backend"
* for dbus_connection_set_watch_functions() and
@@ -292,27 +311,9 @@ _dbus_watch_list_set_functions (DBusWatchList *watch_list,
DBusList *next = _dbus_list_get_next_link (&watch_list->watches,
link);
-#ifdef DBUS_ENABLE_VERBOSE_MODE
- {
- const char *watch_type;
- int flags;
-
- flags = dbus_watch_get_flags (link->data);
- if ((flags & DBUS_WATCH_READABLE) &&
- (flags & DBUS_WATCH_WRITABLE))
- watch_type = "readwrite";
- else if (flags & DBUS_WATCH_READABLE)
- watch_type = "read";
- else if (flags & DBUS_WATCH_WRITABLE)
- watch_type = "write";
- else
- watch_type = "not read or write";
-
- _dbus_verbose ("Adding a %s watch on fd %d using newly-set add watch function\n",
- watch_type,
- dbus_watch_get_socket (link->data));
- }
-#endif /* DBUS_ENABLE_VERBOSE_MODE */
+ _dbus_verbose ("Adding a %s watch on fd %d using newly-set add watch function\n",
+ watch_flags_to_string (dbus_watch_get_flags (link->data)),
+ dbus_watch_get_socket (link->data));
if (!(* add_function) (link->data, data))
{
@@ -454,6 +455,27 @@ _dbus_watch_list_toggle_watch (DBusWatchList *watch_list,
}
/**
+ * Sets all watches to the given enabled state, invoking the
+ * application's DBusWatchToggledFunction if appropriate.
+ *
+ * @param watch_list the watch list.
+ * @param enabled #TRUE to enable
+ */
+void
+_dbus_watch_list_toggle_all_watches (DBusWatchList *watch_list,
+ dbus_bool_t enabled)
+{
+ DBusList *link;
+
+ for (link = _dbus_list_get_first_link (&watch_list->watches);
+ link != NULL;
+ link = _dbus_list_get_next_link (&watch_list->watches, link))
+ {
+ _dbus_watch_list_toggle_watch (watch_list, link->data, enabled);
+ }
+}
+
+/**
* Sets the handler for the watch.
*
* @todo this function only exists because of the weird
diff --git a/dbus/dbus-watch.h b/dbus/dbus-watch.h
index c5832141..321740ed 100644
--- a/dbus/dbus-watch.h
+++ b/dbus/dbus-watch.h
@@ -76,6 +76,8 @@ void _dbus_watch_list_remove_watch (DBusWatchList *watch_li
void _dbus_watch_list_toggle_watch (DBusWatchList *watch_list,
DBusWatch *watch,
dbus_bool_t enabled);
+void _dbus_watch_list_toggle_all_watches (DBusWatchList *watch_list,
+ dbus_bool_t enabled);
dbus_bool_t _dbus_watch_get_enabled (DBusWatch *watch);
dbus_bool_t _dbus_watch_get_oom_last_time (DBusWatch *watch);
diff --git a/dbus/sd-daemon.c b/dbus/sd-daemon.c
index 9c23b917..485b3010 100644
--- a/dbus/sd-daemon.c
+++ b/dbus/sd-daemon.c
@@ -25,14 +25,14 @@
***/
#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
+# define _GNU_SOURCE
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/un.h>
-#include <sys/fcntl.h>
+#include <fcntl.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <errno.h>
@@ -40,10 +40,28 @@
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
+#include <stddef.h>
+#include <limits.h>
+
+#if defined(__linux__) && !defined(SD_DAEMON_DISABLE_MQ)
+# include <mqueue.h>
+#endif
#include "sd-daemon.h"
-int sd_listen_fds(int unset_environment) {
+#if (__GNUC__ >= 4)
+# ifdef SD_EXPORT_SYMBOLS
+/* Export symbols */
+# define _sd_export_ __attribute__ ((visibility("default")))
+# else
+/* Don't export the symbols */
+# define _sd_export_ __attribute__ ((visibility("hidden")))
+# endif
+#else
+# define _sd_export_
+#endif
+
+_sd_export_ int sd_listen_fds(int unset_environment) {
#if defined(DISABLE_SYSTEMD) || !defined(__linux__)
return 0;
@@ -53,7 +71,8 @@ int sd_listen_fds(int unset_environment) {
char *p = NULL;
unsigned long l;
- if (!(e = getenv("LISTEN_PID"))) {
+ e = getenv("LISTEN_PID");
+ if (!e) {
r = 0;
goto finish;
}
@@ -61,12 +80,12 @@ int sd_listen_fds(int unset_environment) {
errno = 0;
l = strtoul(e, &p, 10);
- if (errno != 0) {
+ if (errno > 0) {
r = -errno;
goto finish;
}
- if (!p || *p || l <= 0) {
+ if (!p || p == e || *p || l <= 0) {
r = -EINVAL;
goto finish;
}
@@ -77,7 +96,8 @@ int sd_listen_fds(int unset_environment) {
goto finish;
}
- if (!(e = getenv("LISTEN_FDS"))) {
+ e = getenv("LISTEN_FDS");
+ if (!e) {
r = 0;
goto finish;
}
@@ -85,12 +105,12 @@ int sd_listen_fds(int unset_environment) {
errno = 0;
l = strtoul(e, &p, 10);
- if (errno != 0) {
+ if (errno > 0) {
r = -errno;
goto finish;
}
- if (!p || *p) {
+ if (!p || p == e || *p) {
r = -EINVAL;
goto finish;
}
@@ -98,7 +118,8 @@ int sd_listen_fds(int unset_environment) {
for (fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + (int) l; fd ++) {
int flags;
- if ((flags = fcntl(fd, F_GETFD)) < 0) {
+ flags = fcntl(fd, F_GETFD);
+ if (flags < 0) {
r = -errno;
goto finish;
}
@@ -124,13 +145,12 @@ finish:
#endif
}
-int sd_is_fifo(int fd, const char *path) {
+_sd_export_ int sd_is_fifo(int fd, const char *path) {
struct stat st_fd;
if (fd < 0)
return -EINVAL;
- memset(&st_fd, 0, sizeof(st_fd));
if (fstat(fd, &st_fd) < 0)
return -errno;
@@ -140,7 +160,6 @@ int sd_is_fifo(int fd, const char *path) {
if (path) {
struct stat st_path;
- memset(&st_path, 0, sizeof(st_path));
if (stat(path, &st_path) < 0) {
if (errno == ENOENT || errno == ENOTDIR)
@@ -157,6 +176,42 @@ int sd_is_fifo(int fd, const char *path) {
return 1;
}
+_sd_export_ int sd_is_special(int fd, const char *path) {
+ struct stat st_fd;
+
+ if (fd < 0)
+ return -EINVAL;
+
+ if (fstat(fd, &st_fd) < 0)
+ return -errno;
+
+ if (!S_ISREG(st_fd.st_mode) && !S_ISCHR(st_fd.st_mode))
+ return 0;
+
+ if (path) {
+ struct stat st_path;
+
+ if (stat(path, &st_path) < 0) {
+
+ if (errno == ENOENT || errno == ENOTDIR)
+ return 0;
+
+ return -errno;
+ }
+
+ if (S_ISREG(st_fd.st_mode) && S_ISREG(st_path.st_mode))
+ return
+ st_path.st_dev == st_fd.st_dev &&
+ st_path.st_ino == st_fd.st_ino;
+ else if (S_ISCHR(st_fd.st_mode) && S_ISCHR(st_path.st_mode))
+ return st_path.st_rdev == st_fd.st_rdev;
+ else
+ return 0;
+ }
+
+ return 1;
+}
+
static int sd_is_socket_internal(int fd, int type, int listening) {
struct stat st_fd;
@@ -208,21 +263,19 @@ union sockaddr_union {
struct sockaddr_storage storage;
};
-int sd_is_socket(int fd, int family, int type, int listening) {
+_sd_export_ int sd_is_socket(int fd, int family, int type, int listening) {
int r;
if (family < 0)
return -EINVAL;
- if ((r = sd_is_socket_internal(fd, type, listening)) <= 0)
+ r = sd_is_socket_internal(fd, type, listening);
+ if (r <= 0)
return r;
if (family > 0) {
- union sockaddr_union sockaddr;
- socklen_t l;
-
- memset(&sockaddr, 0, sizeof(sockaddr));
- l = sizeof(sockaddr);
+ union sockaddr_union sockaddr = {};
+ socklen_t l = sizeof(sockaddr);
if (getsockname(fd, &sockaddr.sa, &l) < 0)
return -errno;
@@ -236,20 +289,18 @@ int sd_is_socket(int fd, int family, int type, int listening) {
return 1;
}
-int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port) {
- union sockaddr_union sockaddr;
- socklen_t l;
+_sd_export_ int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port) {
+ union sockaddr_union sockaddr = {};
+ socklen_t l = sizeof(sockaddr);
int r;
if (family != 0 && family != AF_INET && family != AF_INET6)
return -EINVAL;
- if ((r = sd_is_socket_internal(fd, type, listening)) <= 0)
+ r = sd_is_socket_internal(fd, type, listening);
+ if (r <= 0)
return r;
- memset(&sockaddr, 0, sizeof(sockaddr));
- l = sizeof(sockaddr);
-
if (getsockname(fd, &sockaddr.sa, &l) < 0)
return -errno;
@@ -281,17 +332,15 @@ int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port
return 1;
}
-int sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length) {
- union sockaddr_union sockaddr;
- socklen_t l;
+_sd_export_ int sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length) {
+ union sockaddr_union sockaddr = {};
+ socklen_t l = sizeof(sockaddr);
int r;
- if ((r = sd_is_socket_internal(fd, type, listening)) <= 0)
+ r = sd_is_socket_internal(fd, type, listening);
+ if (r <= 0)
return r;
- memset(&sockaddr, 0, sizeof(sockaddr));
- l = sizeof(sockaddr);
-
if (getsockname(fd, &sockaddr.sa, &l) < 0)
return -errno;
@@ -302,29 +351,66 @@ int sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t
return 0;
if (path) {
- if (length <= 0)
+ if (length == 0)
length = strlen(path);
- if (length <= 0)
+ if (length == 0)
/* Unnamed socket */
- return l == sizeof(sa_family_t);
+ return l == offsetof(struct sockaddr_un, sun_path);
if (path[0])
/* Normal path socket */
return
- (l >= sizeof(sa_family_t) + length + 1) &&
+ (l >= offsetof(struct sockaddr_un, sun_path) + length + 1) &&
memcmp(path, sockaddr.un.sun_path, length+1) == 0;
else
/* Abstract namespace socket */
return
- (l == sizeof(sa_family_t) + length) &&
+ (l == offsetof(struct sockaddr_un, sun_path) + length) &&
memcmp(path, sockaddr.un.sun_path, length) == 0;
}
return 1;
}
-int sd_notify(int unset_environment, const char *state) {
+_sd_export_ int sd_is_mq(int fd, const char *path) {
+#if !defined(__linux__) || defined(SD_DAEMON_DISABLE_MQ)
+ return 0;
+#else
+ struct mq_attr attr;
+
+ if (fd < 0)
+ return -EINVAL;
+
+ if (mq_getattr(fd, &attr) < 0)
+ return -errno;
+
+ if (path) {
+ char fpath[PATH_MAX];
+ struct stat a, b;
+
+ if (path[0] != '/')
+ return -EINVAL;
+
+ if (fstat(fd, &a) < 0)
+ return -errno;
+
+ strncpy(stpcpy(fpath, "/dev/mqueue"), path, sizeof(fpath) - 12);
+ fpath[sizeof(fpath)-1] = 0;
+
+ if (stat(fpath, &b) < 0)
+ return -errno;
+
+ if (a.st_dev != b.st_dev ||
+ a.st_ino != b.st_ino)
+ return 0;
+ }
+
+ return 1;
+#endif
+}
+
+_sd_export_ int sd_notify(int unset_environment, const char *state) {
#if defined(DISABLE_SYSTEMD) || !defined(__linux__) || !defined(SOCK_CLOEXEC)
return 0;
#else
@@ -339,7 +425,8 @@ int sd_notify(int unset_environment, const char *state) {
goto finish;
}
- if (!(e = getenv("NOTIFY_SOCKET")))
+ e = getenv("NOTIFY_SOCKET");
+ if (!e)
return 0;
/* Must be an abstract socket, or an absolute path */
@@ -348,7 +435,8 @@ int sd_notify(int unset_environment, const char *state) {
goto finish;
}
- if ((fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0)) < 0) {
+ fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0);
+ if (fd < 0) {
r = -errno;
goto finish;
}
@@ -366,7 +454,7 @@ int sd_notify(int unset_environment, const char *state) {
memset(&msghdr, 0, sizeof(msghdr));
msghdr.msg_name = &sockaddr;
- msghdr.msg_namelen = sizeof(sa_family_t) + strlen(e);
+ msghdr.msg_namelen = offsetof(struct sockaddr_un, sun_path) + strlen(e);
if (msghdr.msg_namelen > sizeof(struct sockaddr_un))
msghdr.msg_namelen = sizeof(struct sockaddr_un);
@@ -392,7 +480,7 @@ finish:
#endif
}
-int sd_notifyf(int unset_environment, const char *format, ...) {
+_sd_export_ int sd_notifyf(int unset_environment, const char *format, ...) {
#if defined(DISABLE_SYSTEMD) || !defined(__linux__)
return 0;
#else
@@ -414,22 +502,19 @@ int sd_notifyf(int unset_environment, const char *format, ...) {
#endif
}
-int sd_booted(void) {
+_sd_export_ int sd_booted(void) {
#if defined(DISABLE_SYSTEMD) || !defined(__linux__)
return 0;
#else
+ struct stat st;
- struct stat a, b;
-
- /* We simply test whether the systemd cgroup hierarchy is
- * mounted */
-
- if (lstat("/sys/fs/cgroup", &a) < 0)
- return 0;
+ /* We test whether the runtime unit file directory has been
+ * created. This takes place in mount-setup.c, so is
+ * guaranteed to happen very early during boot. */
- if (lstat("/sys/fs/cgroup/systemd", &b) < 0)
+ if (lstat("/run/systemd/system/", &st) < 0)
return 0;
- return a.st_dev != b.st_dev;
+ return !!S_ISDIR(st.st_mode);
#endif
}
diff --git a/dbus/sd-daemon.h b/dbus/sd-daemon.h
index c68c96d2..fb7456d5 100644
--- a/dbus/sd-daemon.h
+++ b/dbus/sd-daemon.h
@@ -58,21 +58,21 @@ extern "C" {
You may find an up-to-date version of these source files online:
- http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.h
- http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.c
+ http://cgit.freedesktop.org/systemd/systemd/plain/src/systemd/sd-daemon.h
+ http://cgit.freedesktop.org/systemd/systemd/plain/src/libsystemd-daemon/sd-daemon.c
This should compile on non-Linux systems, too, but with the
exception of the sd_is_xxx() calls all functions will become NOPs.
- See sd-daemon(7) for more information.
+ See sd-daemon(3) for more information.
*/
+#ifndef _sd_printf_attr_
#if __GNUC__ >= 4
#define _sd_printf_attr_(a,b) __attribute__ ((format (printf, a, b)))
-#define _sd_hidden_ __attribute__ ((visibility("hidden")))
#else
#define _sd_printf_attr_(a,b)
-#define _sd_hidden_
+#endif
#endif
/*
@@ -109,7 +109,7 @@ extern "C" {
See sd_listen_fds(3) for more information.
*/
-int sd_listen_fds(int unset_environment) _sd_hidden_;
+int sd_listen_fds(int unset_environment);
/*
Helper call for identifying a passed file descriptor. Returns 1 if
@@ -121,7 +121,19 @@ int sd_listen_fds(int unset_environment) _sd_hidden_;
See sd_is_fifo(3) for more information.
*/
-int sd_is_fifo(int fd, const char *path) _sd_hidden_;
+int sd_is_fifo(int fd, const char *path);
+
+/*
+ Helper call for identifying a passed file descriptor. Returns 1 if
+ the file descriptor is a special character device on the file
+ system stored under the specified path, 0 otherwise.
+ If path is NULL a path name check will not be done and the call
+ only verifies if the file descriptor refers to a special character.
+ Returns a negative errno style error code on failure.
+
+ See sd_is_special(3) for more information.
+*/
+int sd_is_special(int fd, const char *path);
/*
Helper call for identifying a passed file descriptor. Returns 1 if
@@ -137,7 +149,7 @@ int sd_is_fifo(int fd, const char *path) _sd_hidden_;
See sd_is_socket(3) for more information.
*/
-int sd_is_socket(int fd, int family, int type, int listening) _sd_hidden_;
+int sd_is_socket(int fd, int family, int type, int listening);
/*
Helper call for identifying a passed file descriptor. Returns 1 if
@@ -151,7 +163,7 @@ int sd_is_socket(int fd, int family, int type, int listening) _sd_hidden_;
See sd_is_socket_inet(3) for more information.
*/
-int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port) _sd_hidden_;
+int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port);
/*
Helper call for identifying a passed file descriptor. Returns 1 if
@@ -167,17 +179,25 @@ int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port
See sd_is_socket_unix(3) for more information.
*/
-int sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length) _sd_hidden_;
+int sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length);
+
+/*
+ Helper call for identifying a passed file descriptor. Returns 1 if
+ the file descriptor is a POSIX Message Queue of the specified name,
+ 0 otherwise. If path is NULL a message queue name check is not
+ done. Returns a negative errno style error code on failure.
+*/
+int sd_is_mq(int fd, const char *path);
/*
Informs systemd about changed daemon state. This takes a number of
- newline seperated environment-style variable assignments in a
+ newline separated environment-style variable assignments in a
string. The following variables are known:
READY=1 Tells systemd that daemon startup is finished (only
relevant for services of Type=notify). The passed
argument is a boolean "1" or "0". Since there is
- little value in signalling non-readiness the only
+ little value in signaling non-readiness the only
value daemons should send is "READY=1".
STATUS=... Passes a single-line status string back to systemd
@@ -197,8 +217,13 @@ int sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t
MAINPID=... The main pid of a daemon, in case systemd did not
fork off the process itself. Example: "MAINPID=4711"
+ WATCHDOG=1 Tells systemd to update the watchdog timestamp.
+ Services using this feature should do this in
+ regular intervals. A watchdog framework can use the
+ timestamps to detect failed services.
+
Daemons can choose to send additional variables. However, it is
- recommened to prefix variable names not listed above with X_.
+ recommended to prefix variable names not listed above with X_.
Returns a negative errno-style error code on failure. Returns > 0
if systemd could be notified, 0 if it couldn't possibly because
@@ -213,7 +238,7 @@ int sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t
See sd_notify(3) for more information.
*/
-int sd_notify(int unset_environment, const char *state) _sd_hidden_;
+int sd_notify(int unset_environment, const char *state);
/*
Similar to sd_notify() but takes a format string.
@@ -235,7 +260,7 @@ int sd_notify(int unset_environment, const char *state) _sd_hidden_;
See sd_notifyf(3) for more information.
*/
-int sd_notifyf(int unset_environment, const char *format, ...) _sd_printf_attr_(2,3) _sd_hidden_;
+int sd_notifyf(int unset_environment, const char *format, ...) _sd_printf_attr_(2,3);
/*
Returns > 0 if the system was booted with systemd. Returns < 0 on
@@ -244,11 +269,11 @@ int sd_notifyf(int unset_environment, const char *format, ...) _sd_printf_attr_(
fine. You should NOT protect them with a call to this function. Also
note that this function checks whether the system, not the user
session is controlled by systemd. However the functions above work
- for both session and system services.
+ for both user and system services.
See sd_booted(3) for more information.
*/
-int sd_booted(void) _sd_hidden_;
+int sd_booted(void);
#ifdef __cplusplus
}
diff --git a/debian/changelog b/debian/changelog
index dfae0c03..160b6d75 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,324 @@
+dbus (1.8.16-1) unstable; urgency=high
+
+ * New upstream release fixes a local denial of service
+ when using systemd activation (CVE-2015-0245)
+
+ -- Simon McVittie <smcv@debian.org> Wed, 04 Feb 2015 20:14:46 +0000
+
+dbus (1.8.14-2) unstable; urgency=high
+
+ * Relax the triggers from interest to interest-noawait (Closes: #771989;
+ mitigates: #776063; partially reopens: #740139).
+
+ This is not strictly correct, because the purpose of the triggers
+ is to set up the .conf, .service files for system services before those
+ services satisfy dependencies. However, it mitigates #776063
+ (apt getting into a stuck state during upgrades), and should in
+ principle be redundant anyway, because dbus-daemon is meant to use
+ inotify to keep up with configuration changes. See #771989, #776063
+ for details.
+
+ -- Simon McVittie <smcv@debian.org> Tue, 03 Feb 2015 17:28:12 +0000
+
+dbus (1.8.14-1) unstable; urgency=medium
+
+ * New upstream release to harden dbus-daemon against packages that install
+ unsafe security policy configurations.
+
+ -- Simon McVittie <smcv@debian.org> Thu, 01 Jan 2015 13:07:23 +0000
+
+dbus (1.8.12-3) unstable; urgency=medium
+
+ * preinst: partially revert change from 1.8.12-2. It seems that the
+ preinst is too late to add a useful dpkg-statoverride entry: dpkg has
+ already loaded the statoverride database by this point, and if we add
+ the entry in the preinst, dpkg-statoverride won't run and have
+ its --update side-effect in the postinst. (Closes: #773107, #773838)
+ * postinst: don't run dpkg-statoverride with 2>/dev/null: in the unlikely
+ event that it fails for a reason other than "not overridden" (which
+ results in silently exiting 1), we'll want to know about it.
+
+ -- Simon McVittie <smcv@debian.org> Tue, 23 Dec 2014 21:21:20 +0000
+
+dbus (1.8.12-2) unstable; urgency=medium
+
+ * postinst: use dpkg-statoverride to set the permissions for
+ dbus-daemon-launch-helper (expected to be 04754 root:messagebus)
+ as suggested in Policy §10.9. This avoids a temporarily broken state
+ when an upgraded dbus is unpacked but not yet configured (Closes: #773107)
+ * preinst: opportunistically set up the same dpkg-statoverride entry
+ if the group already exists, to avoid the same broken state during
+ upgrades from older versions without needing Pre-Depends: adduser
+ * postrm: delete the dpkg-statoverride entry on purge
+
+ -- Simon McVittie <smcv@debian.org> Sun, 21 Dec 2014 15:02:22 +0000
+
+dbus (1.8.12-1) unstable; urgency=medium
+
+ * New upstream release 1.8.12
+ - increase auth_timeout from 5 seconds back to 30 seconds since it
+ appears to cause slow or failed boot on some systems, reverting a
+ change in 1.8.8 (Closes: #769069)
+ - add a README.Debian to the dbus package documenting how
+ sysadmins with hostile local users can get the lower timeout back,
+ if their systems are fast enough to boot correctly like that
+
+ -- Simon McVittie <smcv@debian.org> Mon, 24 Nov 2014 13:46:01 +0000
+
+dbus (1.8.10-1) unstable; urgency=medium
+
+ * New upstream release 1.8.10
+ - raise dbus-daemon's file descriptor limit to 65536 to avoid an
+ opportunity for denial of service
+ (CVE-2014-7824, an incomplete fix for CVE-2014-3636)
+ * Start 'dbus-daemon --system' as root under sysvinit (it already
+ starts as root under systemd), so it can increase its file
+ descriptor limit
+
+ -- Simon McVittie <smcv@debian.org> Thu, 06 Nov 2014 16:28:22 +0000
+
+dbus (1.8.8-2) unstable; urgency=medium
+
+ [ Michael Biebl ]
+ * Build against libsystemd-dev. In systemd v209 the various libraries were
+ merged into a single libsystemd library.
+
+ [ Simon McVittie ]
+ * debian/dbus.bug-control: when people report bugs against dbus,
+ also report the status of systemd and systemd-sysv (because
+ those alter how system service activation works), and dbus-x11
+ (because that's responsible for normal session bus setup)
+ * Remove Build-Profiles control field until the syntax settles down
+ (Closes: #764222)
+ * Use --with-valgrind=auto (supported since 1.7.6) for the debug build
+
+ -- Simon McVittie <smcv@debian.org> Mon, 06 Oct 2014 19:17:04 +0100
+
+dbus (1.8.8-1) unstable; urgency=medium
+
+ [ Michael Biebl ]
+ * Don't attempt config reload if dbus system bus is not running.
+
+ [ Simon McVittie ]
+ * Bump dbus up to Priority: standard because without it, systemd-logind
+ does not run a getty on tty2..tty6 (matching ftp-master action in
+ #759293)
+ * New upstream release fixes several security issues
+ - CVE-2014-3635: do not accept an extra fd in cmsg padding,
+ avoiding a buffer overrun in dbus-daemon or system services
+ - CVE-2014-3636: reduce maximum number of file descriptors
+ per message from 1024 to 16, to avoid two separate denial-of-service
+ attacks that could cause system services to be dropped from the bus
+ - CVE-2014-3637: time out connections that have a
+ partially-sent message containing a file descriptor, so that
+ malicious processes cannot use self-referential file descriptors
+ to make a connection that will never close
+ - CVE-2014-3638: reduce maximum number of pending replies
+ per connection to avoid algorithmic complexity DoS
+ - CVE-2014-3639: reduce timeout for authentication and
+ do not accept() new connections when all unauthenticated connection
+ slots are in use, so that malicious processes cannot prevent new
+ connections to the system bus
+ * debian/copyright: fix glob syntax, .[ch] is not supported
+
+ -- Simon McVittie <smcv@debian.org> Mon, 15 Sep 2014 12:58:25 +0100
+
+dbus (1.8.6-2) unstable; urgency=medium
+
+ * debian/dbus.posinst: When triggered only poke the dbus-daemon, don't run
+ update-rc.d/invoke-rc.d as added by dh_installinit. This prevent some
+ odd-corner when being triggered during init system upgrade
+ (Closes: #754404)
+
+ -- Sjoerd Simons <sjoerd@debian.org> Wed, 13 Aug 2014 22:30:38 +0200
+
+dbus (1.8.6-1) unstable; urgency=high
+
+ * New upstream release
+ - fix two local DoS vulnerabilities (CVE-2014-3532, CVE-2014-3533)
+
+ -- Simon McVittie <smcv@debian.org> Mon, 30 Jun 2014 15:15:58 +0100
+
+dbus (1.8.4-1) unstable; urgency=high
+
+ * New upstream release, fixing a DoS vulnerability (CVE-2014-3477)
+
+ -- Simon McVittie <smcv@debian.org> Thu, 05 Jun 2014 15:12:02 +0100
+
+dbus (1.8.2-1) unstable; urgency=medium
+
+ * New upstream release
+
+ -- Simon McVittie <smcv@debian.org> Wed, 30 Apr 2014 20:17:46 +0100
+
+dbus (1.8.0-3) unstable; urgency=medium
+
+ * Improve autopkgtest support
+ - use a shell wildcard instead of dpkg-architecture, to avoid stderr spam
+ failing the test if gcc is missing
+ - wrap each test-case in an arbitrary (5 minute) timeout so that one
+ test-case failing won't halt the whole build
+
+ -- Simon McVittie <smcv@debian.org> Wed, 26 Mar 2014 09:17:20 +0000
+
+dbus (1.8.0-2) unstable; urgency=low
+
+ * debian/rules: look for DEB_BUILD_PROFILES, the new name for
+ DEB_BUILD_PROFILE
+ * Don't try to install systemd units in a stage1 build (they are
+ no longer installed unless libsystemd*-dev are found) (Closes: #738317)
+ * Mark dbus-1-doc with Build-Profiles: !stage1
+ * Register a dpkg trigger on /usr/share/dbus-1/system-services and
+ /etc/dbus-1/system.d that calls ReloadConfig on the system dbus-daemon,
+ in case our inotify monitoring isn't completely reliable (see #740139)
+ * Clean debian/tmp-udeb in `debian/rules clean`
+ * Hook up the installed tests to DEP-8 metadata
+ * Add a simple compile/link/run test
+
+ -- Simon McVittie <smcv@debian.org> Wed, 26 Feb 2014 13:15:14 +0000
+
+dbus (1.8.0-1) unstable; urgency=low
+
+ * New upstream stable release
+ - add debian/copyright stanzas for some new BSD-licensed cmake macros
+
+ -- Simon McVittie <smcv@debian.org> Mon, 20 Jan 2014 15:05:53 +0000
+
+dbus (1.7.10-2) unstable; urgency=low
+
+ * Conditionalize libaudit and libcap-ng build-dependencies to [linux-any]
+ * Explicitly enable libaudit, SELinux and systemd on Linux;
+ do not enable them elsewhere
+
+ -- Simon McVittie <smcv@debian.org> Tue, 07 Jan 2014 12:12:15 +0000
+
+dbus (1.7.10-1) unstable; urgency=low
+
+ * Merge from experimental into unstable
+ * New upstream release 1.7.10 (1.8 rc1)
+ * Generate debian/dbus.install from a generic part and a Linux-specific
+ part, since systemd metadata doesn't get installed on non-Linux any more
+
+ -- Simon McVittie <smcv@debian.org> Mon, 06 Jan 2014 19:43:36 +0000
+
+dbus (1.7.8-1) experimental; urgency=low
+
+ [ Laurent Bigonville ]
+ * debian/rules: Re-add udeb_configure_flags that were lost during merge
+ (Closes: #727774)
+
+ [ Simon McVittie ]
+ * Standards-Version: 3.9.5 (no changes needed)
+ * Enable libaudit support so messages that violate SELinux policy go to the
+ audit log (Closes: #727771)
+ * New upstream release
+ - add new dependency on libsystemd-journal-dev for linux-any
+
+ -- Simon McVittie <smcv@debian.org> Tue, 29 Oct 2013 13:07:02 +0000
+
+dbus (1.7.6-2) experimental; urgency=low
+
+ * debian/rules: FTBFS if new symbols or libraries are added
+ without updating the symbols file
+ * debian/copyright: list copyright holders and minor licenses
+ (Closes: #726000)
+ * Merge packaging changes from unstable:
+ - Run `update-rc.d dbus defaults` instead of deprecated
+ `update-rc.d dbus start ...` (Closes: #725923)
+ - Add udeb packages, so the graphical installer can use AT-SPI
+ (Closes: #723952)
+ - Standards-Version: 3.9.4 (no changes needed)
+
+ -- Simon McVittie <smcv@debian.org> Sat, 12 Oct 2013 16:30:55 +0100
+
+dbus (1.7.6-1) experimental; urgency=low
+
+ * Standards-Version: 3.9.4 (no changes needed)
+ * New upstream development release
+ - update symbols
+
+ -- Simon McVittie <smcv@debian.org> Wed, 09 Oct 2013 16:44:43 +0100
+
+dbus (1.7.4-1) experimental; urgency=low
+
+ * New upstream development release
+ - CVE-2013-2168: avoid a user-triggerable crash (denial of services)
+ in system services that use libdbus
+
+ -- Simon McVittie <smcv@debian.org> Wed, 12 Jun 2013 19:53:00 +0100
+
+dbus (1.7.2-1) experimental; urgency=low
+
+ * New upstream development release
+ * Do the debug build --with-valgrind on mipsel, too
+
+ -- Simon McVittie <smcv@debian.org> Thu, 25 Apr 2013 13:46:10 +0100
+
+dbus (1.7.0-1) experimental; urgency=low
+
+ * Branch for experimental
+ * New upstream development release
+ * On architectures where it's currently supported, do the
+ debug build with --with-valgrind for better instrumentation
+ * debian/rules: factor out production and debug configure flags
+ * Add support for DEB_BUILD_OPTIONS=nodocs, which omits most documentation
+ (allowing doxygen and xmlto to be avoided) and the dbus-1-doc package
+ * Add support for DEB_BUILD_PROFILE=stage1, which does the same as nodocs
+ and additionally makes the debug build not insist on building all tests
+ * Make the development and debugging packages Multi-Arch: same,
+ since their arch-dependent files are all arch-segregated
+ (/usr/lib/TUPLE) or named according to a build-ID (/usr/lib/debug)
+ (Closes: #689071). This is not actually useful until pkg-config
+ becomes M-A: foreign (#631275).
+
+ -- Simon McVittie <smcv@debian.org> Fri, 22 Feb 2013 15:20:10 +0000
+
+dbus (1.6.18-2) unstable; urgency=medium
+
+ * Disable valgrind integration in the debug build on armel,
+ since valgrind no longer supports armel (Closes: #729136)
+
+ -- Simon McVittie <smcv@debian.org> Mon, 02 Dec 2013 10:22:39 +0000
+
+dbus (1.6.18-1) unstable; urgency=low
+
+ * Run `update-rc.d dbus defaults` instead of deprecated
+ `update-rc.d dbus start ...` (Closes: #725923)
+ * debian/rules: FTBFS if new symbols or libraries are added
+ without updating the symbols file
+ * debian/copyright: list copyright holders and minor licenses
+ (Closes: #726000)
+ * New upstream release 1.6.18
+ * Standards-Version: 3.9.5 (no changes needed)
+
+ -- Simon McVittie <smcv@debian.org> Fri, 01 Nov 2013 16:30:33 +0000
+
+dbus (1.6.16-1) unstable; urgency=low
+
+ * New upstream stable release 1.6.16
+ * Backport the new dbus-run-session tool from D-Bus 1.7
+ * Add udeb packages, so the graphical installer can use AT-SPI
+ (Closes: #723952)
+ * Standards-Version: 3.9.4 (no changes needed)
+
+ -- Simon McVittie <smcv@debian.org> Tue, 08 Oct 2013 16:44:21 +0100
+
+dbus (1.6.14-1) unstable; urgency=low
+
+ * New upstream stable release 1.6.14
+ - fixes an infinite busy-loop if waitpid() is interrupted by a signal
+ while spawning a subprocess (Closes: #721932)
+
+ -- Simon McVittie <smcv@debian.org> Thu, 05 Sep 2013 16:42:55 +0100
+
+dbus (1.6.12-1) unstable; urgency=high
+
+ * New upstream stable release 1.6.12
+ - CVE-2013-2168: avoid a user-triggerable crash (denial of services)
+ in system services that use libdbus
+
+ -- Simon McVittie <smcv@debian.org> Wed, 12 Jun 2013 14:38:34 +0100
+
dbus (1.6.10-1+dyson2) unstable; urgency=low
* Use dh_smf; fix scripts accordingly
diff --git a/debian/clean b/debian/clean
index 3b6c0641..56a382f7 100644
--- a/debian/clean
+++ b/debian/clean
@@ -1 +1,2 @@
doc/dbus.devhelp
+debian/dbus.install
diff --git a/debian/control b/debian/control
index 47c7a22b..da3457af 100644
--- a/debian/control
+++ b/debian/control
@@ -9,8 +9,9 @@ Uploaders: Sjoerd Simons <sjoerd@debian.org>,
Simon McVittie <smcv@debian.org>
# The following packages can be omitted for bootstrapping, but provide extra
# features:
-# libsystemd-daemon-dev (circular dependency)
-# libsystemd-login-dev (circular dependency)
+# libaudit-dev
+# libcap-ng-dev
+# libsystemd-dev (circular dependency)
# The following packages can be omitted for bootstrapping, but provide extra
# debugging support in /usr/lib/*/dbus-1.0/debug-build:
# valgrind
@@ -28,27 +29,30 @@ Build-Depends: automake (>= 1:1.10),
dh-smf [illumos-any kopensolaris-any],
doxygen,
dpkg-dev (>= 1.16.1),
+ libaudit-dev [linux-any],
+ libcap-ng-dev [linux-any],
libexpat-dev,
libdbus-glib-1-dev,
libglib2.0-dev,
libbsm1-dev [illumos-any kopensolaris-any],
libselinux1-dev [linux-any],
- libsystemd-daemon-dev (>= 32) [linux-any],
- libsystemd-login-dev (>= 32) [linux-any],
+ libsystemd-dev (>= 209) [linux-any],
libx11-dev,
python (>= 2.6),
python-dbus,
python-gobject,
- valgrind [amd64 armel armhf i386 mips mipsel powerpc ppc64 s390x],
+ valgrind [amd64 armhf i386 mips mipsel powerpc ppc64 s390x],
xmlto,
xsltproc
-Standards-Version: 3.9.3
+Standards-Version: 3.9.5
Vcs-Git: git://anonscm.debian.org/pkg-utopia/dbus.git
Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-utopia/dbus.git
Homepage: http://dbus.freedesktop.org/
+XS-Testsuite: autopkgtest
Package: dbus
Architecture: any
+Priority: standard
Depends: ${shlibs:Depends},
${misc:Depends},
adduser,
@@ -73,6 +77,20 @@ Description: simple interprocess messaging system (daemon and utilities)
The client-side library can be found in the libdbus-1-3 package, as it is no
longer contained in this package.
+Package: dbus-udeb
+Section: debian-installer
+Priority: extra
+Package-Type: udeb
+Architecture: any
+Depends: ${shlibs:Depends},
+ ${misc:Depends}
+Description: simple interprocess messaging system (minimal runtime)
+ D-Bus is a message bus, used for sending messages between applications.
+ .
+ This package is a minimal version of the dbus and dbus-x11 packages,
+ for use in the Debian installer. It can run a session bus, but is not
+ suitable for use as a system bus.
+
Package: dbus-x11
Architecture: any
Section: x11
@@ -116,6 +134,19 @@ Description: simple interprocess messaging system (library)
.
The daemon can be found in the dbus package.
+Package: libdbus-1-3-udeb
+Section: debian-installer
+Priority: extra
+Package-Type: udeb
+Architecture: any
+Depends: ${shlibs:Depends},
+ ${misc:Depends}
+Description: simple interprocess messaging system (minimal library)
+ D-Bus is a message bus, used for sending messages between applications.
+ .
+ This package is a minimal version of the libdbus-1-3 package,
+ for use in the Debian installer.
+
Package: dbus-1-doc
Section: doc
Architecture: all
diff --git a/debian/copyright b/debian/copyright
index 6b80b9ab..efe3d7f4 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,214 +1,431 @@
-This package was debianized by Colin Walters <walters@debian.org> on
-Thu, 6 Mar 2003 18:01:37 -0500
-
-It was downloaded from http://www.freedesktop.org/software/dbus
-
-This package is dual-licensed under the Academic Free License version 2.1,
-and the GPL version 2. For a description of the GPL, see
-/usr/share/common-licenses/GPL-2 on your Debian system.
-
-Portions of the package are only licensed under the GPL (notably
-tools/dbus-cleanup-sockets.c and test/decode-gcov.c ).
-
-The Academic Free License follows:
-
-The Academic Free License
-v. 2.1
-
-This Academic Free License (the "License") applies to any original
-work of authorship (the "Original Work") whose owner (the "Licensor")
-has placed the following notice immediately following the copyright
-notice for the Original Work:
-
-Licensed under the Academic Free License version 2.1
-
-1) Grant of Copyright License. Licensor hereby grants You a
-world-wide, royalty-free, non-exclusive, perpetual, sublicenseable
-license to do the following:
-
-a) to reproduce the Original Work in copies;
-
-b) to prepare derivative works ("Derivative Works") based upon the Original Work;
-
-c) to distribute copies of the Original Work and Derivative Works to the public;
-
-d) to perform the Original Work publicly; and
-
-e) to display the Original Work publicly.
-
-2) Grant of Patent License. Licensor hereby grants You a world-wide,
-royalty-free, non-exclusive, perpetual, sublicenseable license, under
-patent claims owned or controlled by the Licensor that are embodied in
-the Original Work as furnished by the Licensor, to make, use, sell and
-offer for sale the Original Work and Derivative Works.
-
-3) Grant of Source Code License. The term "Source Code" means the
-preferred form of the Original Work for making modifications to it and
-all available documentation describing how to modify the Original
-Work. Licensor hereby agrees to provide a machine-readable copy of the
-Source Code of the Original Work along with each copy of the Original
-Work that Licensor distributes. Licensor reserves the right to satisfy
-this obligation by placing a machine-readable copy of the Source Code
-in an information repository reasonably calculated to permit
-inexpensive and convenient access by You for as long as Licensor
-continues to distribute the Original Work, and by publishing the
-address of that information repository in a notice immediately
-following the copyright notice that applies to the Original Work.
-
-4) Exclusions From License Grant. Neither the names of Licensor, nor
-the names of any contributors to the Original Work, nor any of their
-trademarks or service marks, may be used to endorse or promote
-products derived from this Original Work without express prior written
-permission of the Licensor. Nothing in this License shall be deemed to
-grant any rights to trademarks, copyrights, patents, trade secrets or
-any other intellectual property of Licensor except as expressly stated
-herein. No patent license is granted to make, use, sell or offer to
-sell embodiments of any patent claims other than the licensed claims
-defined in Section 2. No right is granted to the trademarks of
-Licensor even if such marks are included in the Original Work. Nothing
-in this License shall be interpreted to prohibit Licensor from
-licensing under different terms from this License any Original Work
-that Licensor otherwise would have a right to license.
-
-5) This section intentionally omitted.
-
-6) Attribution Rights. You must retain, in the Source Code of any
-Derivative Works that You create, all copyright, patent or trademark
-notices from the Source Code of the Original Work, as well as any
-notices of licensing and any descriptive text identified therein as an
-"Attribution Notice." You must cause the Source Code for any
-Derivative Works that You create to carry a prominent Attribution
-Notice reasonably calculated to inform recipients that You have
-modified the Original Work.
-
-7) Warranty of Provenance and Disclaimer of Warranty. Licensor
-warrants that the copyright in and to the Original Work and the patent
-rights granted herein by Licensor are owned by the Licensor or are
-sublicensed to You under the terms of this License with the permission
-of the contributor(s) of those copyrights and patent rights. Except as
-expressly stated in the immediately proceeding sentence, the Original
-Work is provided under this License on an "AS IS" BASIS and WITHOUT
-WARRANTY, either express or implied, including, without limitation,
-the warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A
-PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL
-WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential
-part of this License. No license to Original Work is granted hereunder
-except under this disclaimer.
-
-8) Limitation of Liability. Under no circumstances and under no legal
-theory, whether in tort (including negligence), contract, or
-otherwise, shall the Licensor be liable to any person for any direct,
-indirect, special, incidental, or consequential damages of any
-character arising as a result of this License or the use of the
-Original Work including, without limitation, damages for loss of
-goodwill, work stoppage, computer failure or malfunction, or any and
-all other commercial damages or losses. This limitation of liability
-shall not apply to liability for death or personal injury resulting
-from Licensor's negligence to the extent applicable law prohibits such
-limitation. Some jurisdictions do not allow the exclusion or
-limitation of incidental or consequential damages, so this exclusion
-and limitation may not apply to You.
-
-9) Acceptance and Termination. If You distribute copies of the
-Original Work or a Derivative Work, You must make a reasonable effort
-under the circumstances to obtain the express assent of recipients to
-the terms of this License. Nothing else but this License (or another
-written agreement between Licensor and You) grants You permission to
-create Derivative Works based upon the Original Work or to exercise
-any of the rights granted in Section 1 herein, and any attempt to do
-so except under the terms of this License (or another written
-agreement between Licensor and You) is expressly prohibited by
-U.S. copyright law, the equivalent laws of other countries, and by
-international treaty. Therefore, by exercising any of the rights
-granted to You in Section 1 herein, You indicate Your acceptance of
-this License and all of its terms and conditions.
-
-10) Termination for Patent Action. This License shall terminate
-automatically and You may no longer exercise any of the rights granted
-to You by this License as of the date You commence an action,
-including a cross-claim or counterclaim, against Licensor or any
-licensee alleging that the Original Work infringes a patent. This
-termination provision shall not apply for an action alleging patent
-infringement by combinations of the Original Work with other software
-or hardware.
-
-11) Jurisdiction, Venue and Governing Law. Any action or suit relating
-to this License may be brought only in the courts of a jurisdiction
-wherein the Licensor resides or in which Licensor conducts its primary
-business, and under the laws of that jurisdiction excluding its
-conflict-of-law provisions. The application of the United Nations
-Convention on Contracts for the International Sale of Goods is
-expressly excluded. Any use of the Original Work outside the scope of
-this License or after its termination shall be subject to the
-requirements and penalties of the U.S. Copyright Act, 17 U.S.C. § 101
-et seq., the equivalent laws of other countries, and international
-treaty. This section shall survive the termination of this License.
-
-12) Attorneys Fees. In any action to enforce the terms of this License
-or seeking damages relating thereto, the prevailing party shall be
-entitled to recover its costs and expenses, including, without
-limitation, reasonable attorneys' fees and costs incurred in
-connection with such action, including any appeal of such action. This
-section shall survive the termination of this License.
-
-13) Miscellaneous. This License represents the complete agreement
-concerning the subject matter hereof. If any provision of this License
-is held to be unenforceable, such provision shall be reformed only to
-the extent necessary to make it enforceable.
-
-14) Definition of "You" in This License. "You" throughout this
-License, whether in upper or lower case, means an individual or a
-legal entity exercising rights under, and complying with all of the
-terms of, this License. For legal entities, "You" includes any entity
-that controls, is controlled by, or is under common control with
-you. For purposes of this definition, "control" means (i) the power,
-direct or indirect, to cause the direction or management of such
-entity, whether by contract or otherwise, or (ii) ownership of fifty
-percent (50%) or more of the outstanding shares, or (iii) beneficial
-ownership of such entity.
-
-15) Right to Use. You may use the Original Work in all ways not
-otherwise restricted or conditioned by this License or by law, and
-Licensor promises not to interfere with or be responsible for such
-uses by You.
-
-This license is Copyright (C) 2003-2004 Lawrence E. Rosen. All rights
-reserved. Permission is hereby granted to copy and distribute this
-license without modification. This license may not be modified without
-the express written permission of its copyright owner.
-
-
---
-END OF ACADEMIC FREE LICENSE. The following is intended to describe the essential
-differences between the Academic Free License (AFL) version 1.0 and other
-open source licenses:
-
-The Academic Free License is similar to the BSD, MIT, UoI/NCSA and Apache
-licenses in many respects but it is intended to solve a few problems with
-those licenses.
-
-* The AFL is written so as to make it clear what software is being
-licensed (by the inclusion of a statement following the copyright notice
-in the software). This way, the license functions better than a template
-license. The BSD, MIT and UoI/NCSA licenses apply to unidentified software.
-
-* The AFL contains a complete copyright grant to the software. The BSD
-and Apache licenses are vague and incomplete in that respect.
-
-* The AFL contains a complete patent grant to the software. The BSD, MIT,
-UoI/NCSA and Apache licenses rely on an implied patent license and contain
-no explicit patent grant.
-
-* The AFL makes it clear that no trademark rights are granted to the
-licensor's trademarks. The Apache license contains such a provision, but the
-BSD, MIT and UoI/NCSA licenses do not.
-
-* The AFL includes the warranty by the licensor that it either owns the
-copyright or that it is distributing the software under a license. None of
-the other licenses contain that warranty. All other warranties are disclaimed,
-as is the case for the other licenses.
-
-* The AFL is itself copyrighted (with the right granted to copy and distribute
-without modification). This ensures that the owner of the copyright to the
-license will control changes. The Apache license contains a copyright notice,
-but the BSD, MIT and UoI/NCSA licenses do not.
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: D-Bus
+Source: http://dbus.freedesktop.org/releases/dbus/
+Comment:
+ The effective license of the majority of the package, including the
+ shared library, is "GPL-2+ or AFL-2.1". Certain utilities are
+ "GPL-2+" only.
+
+Files: *
+Copyright:
+ © 1994 A.M. Kuchling
+ © 2002-2008 Red Hat, Inc
+ © 2002-2003 CodeFactory AB
+ © 2002 Michael Meeks
+ © 2004 Imendio HB
+ © 2005 Lennart Poettering
+ © 2005 Novell, Inc
+ © 2005 David A. Wheeler
+ © 2006-2013 Ralf Habacker
+ © 2006 Mandriva
+ © 2006 Peter Kümmel
+ © 2006 Christian Ehrlicher
+ © 2006 Thiago Macieira
+ © 2008 Colin Walters
+ © 2009 Klaralvdalens Datakonsult AB, a KDAB Group company
+ © 2011-2012 Nokia Corporation
+ © 2012-2013 Collabora Ltd.
+ © 2013 Intel Corporation
+ "modified code from libassuan, (C) FSF"
+License: GPL-2+ or AFL-2.1
+
+Files:
+ tools/dbus-cleanup-sockets.c
+ tools/dbus-monitor.c
+ tools/dbus-send.c
+ tools/dbus-print-message.?
+ tools/dbus-uuidgen.c
+Copyright:
+ © 2002 Michael Meeks
+ © 2003-2006 Red Hat, Inc.
+ © 2003 Philip Blundell
+License: GPL-2+
+
+Files:
+ dbus/dbus-server-launchd.?
+ dbus/sd-daemon.?
+ test/corrupt.c
+ test/dbus-daemon-eavesdrop.c
+ test/dbus-daemon.c
+ test/internals/printf.c
+ test/internals/refs.c
+ test/internals/syslog.c
+ test/loopback.c
+ test/manual-authz.c
+ test/marshal.c
+ test/relay.c
+ test/syntax.c
+ tools/lcov.am
+Copyright:
+ © 2007 Tanner Lovelace
+ © 2008-2009 Benjamin Reed
+ © 2008 Colin Walters
+ © 2009 Jonas Bähr
+ © 2010 Lennart Poettering
+ © 2008-2012 Nokia Corporation
+ © 2008-2012 Collabora Ltd
+ © 2013 Intel Corporation
+License: Expat
+
+Files: tools/strto*ll.c
+Copyright: © 1991-1993 The Regents of the University of California
+License: BSD-3-clause
+
+Files:
+ cmake/modules/FindGLib2.cmake
+ cmake/modules/FindGObject.cmake
+Copyright:
+ © 2008 Laurent Montel
+ © 2011 Raphael Kubo da Costa
+ © 2013 Ralf Habacker
+License: BSD-3-clause-generic
+Comment:
+ BSD-3-clause with more generic terms for the authors and copyright holders
+
+Files:
+ dbus/dbus-hash.c
+Copyright:
+ © 1991-1993 The Regents of the University of California
+ © 1994 Sun Microsystems, Inc
+ © 2002 Red Hat, Inc.
+License: GPL-2+ or AFL-2.1, and Tcl-BSDish
+Comment:
+ The Tcl license appears to be compatible with either the GPL-2+
+ or the AFL-2.1, so the effective license is "GPL-2+ or AFL-2.1".
+
+Files: dbus/dbus-sysdeps-util-win.c
+Copyright:
+ © 2000 Werner Almesberger
+ © 2002-2005 Red Hat, Inc
+ © 2003 CodeFactory AB
+License: GPL-2+ or AFL-2.1, and LGPL-2+
+Comment:
+ The presence of LGPL code in this file makes its effective license GPL-2+.
+ It is not used in the shared library, or on Unix platforms.
+
+Files: dbus/versioninfo.rc.in
+Copyright: © 2005 g10 Code GmbH
+License: g10-permissive
+ This file is free software; as a special exception the author gives
+ unlimited permission to copy and/or distribute it, with or without
+ modifications, as long as this notice is preserved.
+ .
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+License: GPL-2+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+ .
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+Comment:
+ On Debian systems, see /usr/share/common-licenses/GPL-2 for the full
+ text of the GPL version 2.
+
+License: Expat
+ 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.
+
+License: Tcl-BSDish
+ This software is copyrighted by the Regents of the University of
+ California, Sun Microsystems, Inc., Scriptics Corporation, and
+ other parties. The following terms apply to all files associated
+ with the software unless explicitly disclaimed in individual files.
+ .
+ The authors hereby grant permission to use, copy, modify,
+ distribute, and license this software and its documentation for any
+ purpose, provided that existing copyright notices are retained in
+ all copies and that this notice is included verbatim in any
+ distributions. No written agreement, license, or royalty fee is
+ required for any of the authorized uses. Modifications to this
+ software may be copyrighted by their authors and need not follow
+ the licensing terms described here, provided that the new terms are
+ clearly indicated on the first page of each file where they apply.
+ .
+ IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY
+ PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
+ DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION,
+ OR ANY DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED
+ OF THE POSSIBILITY OF SUCH DAMAGE.
+ .
+ THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND
+ NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS,
+ AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE
+ MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ .
+ GOVERNMENT USE: If you are acquiring this software on behalf of the
+ U.S. government, the Government shall have only "Restricted Rights"
+ in the software and related documentation as defined in the Federal
+ Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
+ are acquiring the software on behalf of the Department of Defense,
+ the software shall be classified as "Commercial Computer Software"
+ and the Government shall have only "Restricted Rights" as defined
+ in Clause 252.227-7013 (c) (1) of DFARs. Notwithstanding the
+ foregoing, the authors grant the U.S. Government and others acting
+ in its behalf permission to use and distribute the software in
+ accordance with the terms specified in this license.
+
+License: LGPL-2+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+ .
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+ .
+ You should have received a copy of the GNU Library General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+Comment:
+ On Debian systems, see /usr/share/common-licenses/LGPL-2 for the full
+ text of the LGPL version 2.
+
+License: BSD-3-clause
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 4. Neither the name of the University nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+License: BSD-3-clause-generic
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ .
+ 1. Redistributions of source code must retain the copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+License: AFL-2.1
+ The Academic Free License
+ v. 2.1
+ .
+ This Academic Free License (the "License") applies to any original
+ work of authorship (the "Original Work") whose owner (the "Licensor")
+ has placed the following notice immediately following the copyright
+ notice for the Original Work:
+ .
+ Licensed under the Academic Free License version 2.1
+ .
+ 1) Grant of Copyright License. Licensor hereby grants You a
+ world-wide, royalty-free, non-exclusive, perpetual, sublicenseable
+ license to do the following:
+ .
+ a) to reproduce the Original Work in copies;
+ .
+ b) to prepare derivative works ("Derivative Works") based upon the
+ Original Work;
+ .
+ c) to distribute copies of the Original Work and Derivative Works to
+ the public;
+ .
+ d) to perform the Original Work publicly; and
+ .
+ e) to display the Original Work publicly.
+ .
+ 2) Grant of Patent License. Licensor hereby grants You a world-wide,
+ royalty-free, non-exclusive, perpetual, sublicenseable license, under
+ patent claims owned or controlled by the Licensor that are embodied in
+ the Original Work as furnished by the Licensor, to make, use, sell and
+ offer for sale the Original Work and Derivative Works.
+ .
+ 3) Grant of Source Code License. The term "Source Code" means the
+ preferred form of the Original Work for making modifications to it and
+ all available documentation describing how to modify the Original
+ Work. Licensor hereby agrees to provide a machine-readable copy of the
+ Source Code of the Original Work along with each copy of the Original
+ Work that Licensor distributes. Licensor reserves the right to satisfy
+ this obligation by placing a machine-readable copy of the Source Code
+ in an information repository reasonably calculated to permit
+ inexpensive and convenient access by You for as long as Licensor
+ continues to distribute the Original Work, and by publishing the
+ address of that information repository in a notice immediately
+ following the copyright notice that applies to the Original Work.
+ .
+ 4) Exclusions From License Grant. Neither the names of Licensor, nor
+ the names of any contributors to the Original Work, nor any of their
+ trademarks or service marks, may be used to endorse or promote
+ products derived from this Original Work without express prior written
+ permission of the Licensor. Nothing in this License shall be deemed to
+ grant any rights to trademarks, copyrights, patents, trade secrets or
+ any other intellectual property of Licensor except as expressly stated
+ herein. No patent license is granted to make, use, sell or offer to
+ sell embodiments of any patent claims other than the licensed claims
+ defined in Section 2. No right is granted to the trademarks of
+ Licensor even if such marks are included in the Original Work. Nothing
+ in this License shall be interpreted to prohibit Licensor from
+ licensing under different terms from this License any Original Work
+ that Licensor otherwise would have a right to license.
+ .
+ 5) This section intentionally omitted.
+ .
+ 6) Attribution Rights. You must retain, in the Source Code of any
+ Derivative Works that You create, all copyright, patent or trademark
+ notices from the Source Code of the Original Work, as well as any
+ notices of licensing and any descriptive text identified therein as an
+ "Attribution Notice." You must cause the Source Code for any
+ Derivative Works that You create to carry a prominent Attribution
+ Notice reasonably calculated to inform recipients that You have
+ modified the Original Work.
+ .
+ 7) Warranty of Provenance and Disclaimer of Warranty. Licensor
+ warrants that the copyright in and to the Original Work and the patent
+ rights granted herein by Licensor are owned by the Licensor or are
+ sublicensed to You under the terms of this License with the permission
+ of the contributor(s) of those copyrights and patent rights. Except as
+ expressly stated in the immediately proceeding sentence, the Original
+ Work is provided under this License on an "AS IS" BASIS and WITHOUT
+ WARRANTY, either express or implied, including, without limitation,
+ the warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A
+ PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL
+ WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential
+ part of this License. No license to Original Work is granted hereunder
+ except under this disclaimer.
+ .
+ 8) Limitation of Liability. Under no circumstances and under no legal
+ theory, whether in tort (including negligence), contract, or
+ otherwise, shall the Licensor be liable to any person for any direct,
+ indirect, special, incidental, or consequential damages of any
+ character arising as a result of this License or the use of the
+ Original Work including, without limitation, damages for loss of
+ goodwill, work stoppage, computer failure or malfunction, or any and
+ all other commercial damages or losses. This limitation of liability
+ shall not apply to liability for death or personal injury resulting
+ from Licensor's negligence to the extent applicable law prohibits such
+ limitation. Some jurisdictions do not allow the exclusion or
+ limitation of incidental or consequential damages, so this exclusion
+ and limitation may not apply to You.
+ .
+ 9) Acceptance and Termination. If You distribute copies of the
+ Original Work or a Derivative Work, You must make a reasonable effort
+ under the circumstances to obtain the express assent of recipients to
+ the terms of this License. Nothing else but this License (or another
+ written agreement between Licensor and You) grants You permission to
+ create Derivative Works based upon the Original Work or to exercise
+ any of the rights granted in Section 1 herein, and any attempt to do
+ so except under the terms of this License (or another written
+ agreement between Licensor and You) is expressly prohibited by
+ U.S. copyright law, the equivalent laws of other countries, and by
+ international treaty. Therefore, by exercising any of the rights
+ granted to You in Section 1 herein, You indicate Your acceptance of
+ this License and all of its terms and conditions.
+ .
+ 10) Termination for Patent Action. This License shall terminate
+ automatically and You may no longer exercise any of the rights granted
+ to You by this License as of the date You commence an action,
+ including a cross-claim or counterclaim, against Licensor or any
+ licensee alleging that the Original Work infringes a patent. This
+ termination provision shall not apply for an action alleging patent
+ infringement by combinations of the Original Work with other software
+ or hardware.
+ .
+ 11) Jurisdiction, Venue and Governing Law. Any action or suit relating
+ to this License may be brought only in the courts of a jurisdiction
+ wherein the Licensor resides or in which Licensor conducts its primary
+ business, and under the laws of that jurisdiction excluding its
+ conflict-of-law provisions. The application of the United Nations
+ Convention on Contracts for the International Sale of Goods is
+ expressly excluded. Any use of the Original Work outside the scope of
+ this License or after its termination shall be subject to the
+ requirements and penalties of the U.S. Copyright Act, 17 U.S.C. § 101
+ et seq., the equivalent laws of other countries, and international
+ treaty. This section shall survive the termination of this License.
+ .
+ 12) Attorneys Fees. In any action to enforce the terms of this License
+ or seeking damages relating thereto, the prevailing party shall be
+ entitled to recover its costs and expenses, including, without
+ limitation, reasonable attorneys' fees and costs incurred in
+ connection with such action, including any appeal of such action. This
+ section shall survive the termination of this License.
+ .
+ 13) Miscellaneous. This License represents the complete agreement
+ concerning the subject matter hereof. If any provision of this License
+ is held to be unenforceable, such provision shall be reformed only to
+ the extent necessary to make it enforceable.
+ .
+ 14) Definition of "You" in This License. "You" throughout this
+ License, whether in upper or lower case, means an individual or a
+ legal entity exercising rights under, and complying with all of the
+ terms of, this License. For legal entities, "You" includes any entity
+ that controls, is controlled by, or is under common control with
+ you. For purposes of this definition, "control" means (i) the power,
+ direct or indirect, to cause the direction or management of such
+ entity, whether by contract or otherwise, or (ii) ownership of fifty
+ percent (50%) or more of the outstanding shares, or (iii) beneficial
+ ownership of such entity.
+ .
+ 15) Right to Use. You may use the Original Work in all ways not
+ otherwise restricted or conditioned by this License or by law, and
+ Licensor promises not to interfere with or be responsible for such
+ uses by You.
+ .
+ This license is Copyright (C) 2003-2004 Lawrence E. Rosen. All rights
+ reserved. Permission is hereby granted to copy and distribute this
+ license without modification. This license may not be modified without
+ the express written permission of its copyright owner.
diff --git a/debian/dbus-udeb.dirs b/debian/dbus-udeb.dirs
new file mode 100644
index 00000000..51d7f17a
--- /dev/null
+++ b/debian/dbus-udeb.dirs
@@ -0,0 +1 @@
+/var/lib/dbus
diff --git a/debian/dbus-udeb.install b/debian/dbus-udeb.install
new file mode 100644
index 00000000..ff763472
--- /dev/null
+++ b/debian/dbus-udeb.install
@@ -0,0 +1,6 @@
+debian/tmp/etc/dbus-1/session.conf etc/dbus-1
+debian/tmp/etc/dbus-1/session.d etc/dbus-1
+debian/tmp-udeb/usr/bin/dbus-daemon usr/bin
+debian/tmp-udeb/usr/bin/dbus-run-session usr/bin
+debian/tmp-udeb/usr/bin/dbus-uuidgen usr/bin
+debian/tmp-udeb/usr/bin/dbus-launch usr/bin
diff --git a/debian/dbus-udeb.postinst b/debian/dbus-udeb.postinst
new file mode 100644
index 00000000..a16950e6
--- /dev/null
+++ b/debian/dbus-udeb.postinst
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+set -e
+
+dbus-uuidgen --ensure
+
+#DEBHELPER#
diff --git a/debian/dbus.README.Debian b/debian/dbus.README.Debian
new file mode 100644
index 00000000..60b7df4e
--- /dev/null
+++ b/debian/dbus.README.Debian
@@ -0,0 +1,32 @@
+Adjusting limits to mitigate denial of service
+==============================================
+
+'dbus-daemon --system' has several arbitrary limits which are a trade-off
+between working correctly when not under attack, and preventing local
+denial of service attacks. System administrators with particularly hostile
+local users should review these limits and tune them if necessary.
+
+In particular, the fix for CVE-2014-3639 in dbus-1.8.8 makes it difficult
+for local users to prevent connections completely, but they can still
+introduce a delay which increases with larger authentication timeout
+(auth_timeout) values, by opening many parallel connections from
+different processes and never completing the authentication handshake.
+As a result, dbus 1.8.8 also reduced the auth_timeout from 30 seconds
+to 5 seconds to mitigate this delay. However, this change resulted in
+boot failures on some systems because systemd could not authenticate
+sufficiently quickly while the system was busy, and was reverted in 1.8.12.
+
+On fast systems with hostile local users, administrators can reduce this
+delay by returning to the 5 second timeout (or any other value in
+milliseconds), by saving this as /etc/dbus-1/system-local.conf or a file
+matching /etc/dbus-1/system.d/*.conf:
+
+ <busconfig>
+ <limit name="auth_timeout">5000</limit>
+ </busconfig>
+
+If applying this change, please reboot several times and check the
+syslog or Journal for messages containing "Connection has not authenticated
+soon enough, closing it". Seeing that message while not subject to a
+denial-of-service attack indicates that the auth_timeout has been set
+too short.
diff --git a/debian/dbus.bug-control b/debian/dbus.bug-control
new file mode 100644
index 00000000..370fc195
--- /dev/null
+++ b/debian/dbus.bug-control
@@ -0,0 +1 @@
+package-status: systemd systemd-sysv dbus-x11
diff --git a/debian/dbus.init b/debian/dbus.init
index 9f9453a8..4f41293f 100644
--- a/debian/dbus.init
+++ b/debian/dbus.init
@@ -69,7 +69,7 @@ start_it_up()
log_daemon_msg "Starting $DESC" "$NAME"
start-stop-daemon --start --quiet --pidfile $PIDFILE \
- --user $DAEMONUSER --exec $DAEMON -- --system $PARAMS
+ --exec $DAEMON -- --system $PARAMS
log_end_msg $?
}
diff --git a/debian/dbus.install b/debian/dbus.install-generic
index 6c027798..327ef706 100644
--- a/debian/dbus.install
+++ b/debian/dbus.install-generic
@@ -1,6 +1,7 @@
debian/tmp/etc/dbus-1/
debian/tmp/usr/bin/dbus-daemon
debian/tmp/usr/bin/dbus-cleanup-sockets
+debian/tmp/usr/bin/dbus-run-session
debian/tmp/usr/bin/dbus-send
debian/tmp/usr/bin/dbus-uuidgen
debian/tmp/usr/bin/dbus-monitor
@@ -9,11 +10,7 @@ debian/tmp/usr/share/man/man1/dbus-daemon.1
debian/tmp/usr/share/man/man1/dbus-cleanup-sockets.1
debian/tmp/usr/share/dbus-1/services
debian/tmp/usr/share/dbus-1/system-services
+debian/tmp/usr/share/man/man1/dbus-run-session.1
debian/tmp/usr/share/man/man1/dbus-send.1
debian/tmp/usr/share/man/man1/dbus-uuidgen.1
debian/tmp/usr/share/man/man1/dbus-monitor.1
-debian/tmp/lib/systemd/system/dbus.service
-debian/tmp/lib/systemd/system/dbus.socket
-debian/tmp/lib/systemd/system/dbus.target.wants/dbus.socket
-debian/tmp/lib/systemd/system/multi-user.target.wants/dbus.service
-debian/tmp/lib/systemd/system/sockets.target.wants/dbus.socket
diff --git a/debian/dbus.install-systemd b/debian/dbus.install-systemd
new file mode 100644
index 00000000..5581de45
--- /dev/null
+++ b/debian/dbus.install-systemd
@@ -0,0 +1,5 @@
+debian/tmp/lib/systemd/system/dbus.service
+debian/tmp/lib/systemd/system/dbus.socket
+debian/tmp/lib/systemd/system/dbus.target.wants/dbus.socket
+debian/tmp/lib/systemd/system/multi-user.target.wants/dbus.service
+debian/tmp/lib/systemd/system/sockets.target.wants/dbus.socket
diff --git a/debian/dbus.postinst b/debian/dbus.postinst
index 7d16d571..64259aec 100644
--- a/debian/dbus.postinst
+++ b/debian/dbus.postinst
@@ -7,9 +7,23 @@ set -e
MESSAGEUSER=messagebus
MESSAGEHOME=/var/run/dbus
LAUNCHER=/usr/lib/dbus-1.0/dbus-daemon-launch-helper
-
SMF_FMRI=svc:/system/dbus:default
+# This is what the init script would do, but it's simpler (and less
+# dependent on sysvinit vs. Upstart vs. etc.) if we do it directly.
+reload_dbus_config() {
+ [ -S /var/run/dbus/system_bus_socket ] || return 0
+ dbus-send --print-reply --system --type=method_call \
+ --dest=org.freedesktop.DBus \
+ / org.freedesktop.DBus.ReloadConfig > /dev/null || true
+}
+
+
+if [ "$1" = triggered ]; then
+ reload_dbus_config
+ exit 0
+fi
+
if [ "$1" = configure ]; then
adduser --system \
--quiet \
@@ -18,9 +32,8 @@ if [ "$1" = configure ]; then
--disabled-password \
--group "$MESSAGEUSER"
- if ! dpkg-statoverride --list "$LAUNCHER" >/dev/null 2>&1; then
- chown root:"$MESSAGEUSER" "$LAUNCHER"
- chmod 4754 "$LAUNCHER"
+ if ! dpkg-statoverride --list "$LAUNCHER" >/dev/null; then
+ dpkg-statoverride --update --add root "$MESSAGEUSER" 4754 "$LAUNCHER"
fi
# This is idempotent, so it's OK to do every time. The system bus' init
@@ -53,14 +66,8 @@ if [ "$1" = configure ] && [ -n "$2" ]; then
[ -x /usr/share/update-notifier/notify-reboot-required ] && \
/usr/share/update-notifier/notify-reboot-required || true
fi
-
- # This is what the init script would do, but it's simpler (and less
- # dependent on sysvinit vs. Upstart) if we do it directly.
- # If it's not running (perhaps we're in a chroot) this will just fail
- # harmlessly, so there's no need to condition on status.
- dbus-send --print-reply --system --type=method_call \
- --dest=org.freedesktop.DBus \
- / org.freedesktop.DBus.ReloadConfig > /dev/null || true
fi
+reload_dbus_config
+
#DEBHELPER#
diff --git a/debian/dbus.postrm b/debian/dbus.postrm
index 7fa3f5af..2081898b 100644
--- a/debian/dbus.postrm
+++ b/debian/dbus.postrm
@@ -7,6 +7,12 @@ if [ "$1" = "purge" ] ; then
rm -f /var/lib/dbus/machine-id
rmdir /var/lib/dbus || true
+
+ LAUNCHER=/usr/lib/dbus-1.0/dbus-daemon-launch-helper
+
+ if dpkg-statoverride --list "$LAUNCHER" >/dev/null 2>&1 ; then
+ dpkg-statoverride --remove "$LAUNCHER"
+ fi
fi
#DEBHELPER#
diff --git a/debian/dbus.triggers b/debian/dbus.triggers
new file mode 100644
index 00000000..d94c5cf4
--- /dev/null
+++ b/debian/dbus.triggers
@@ -0,0 +1,2 @@
+interest-noawait /etc/dbus-1/system.d
+interest-noawait /usr/share/dbus-1/system-services
diff --git a/debian/libdbus-1-3.symbols b/debian/libdbus-1-3.symbols
index c628d874..28050aa5 100644
--- a/debian/libdbus-1-3.symbols
+++ b/debian/libdbus-1-3.symbols
@@ -198,6 +198,7 @@ libdbus-1.so.3 libdbus-1-3 #MINVER#
dbus_set_error@Base 1.0.2
dbus_set_error_const@Base 1.0.2
dbus_set_error_from_message@Base 1.0.2
+ dbus_setenv@Base 1.7.6
dbus_shutdown@Base 1.0.2
dbus_signature_iter_get_current_type@Base 1.0.2
dbus_signature_iter_get_element_type@Base 1.0.2
diff --git a/debian/rules b/debian/rules
index fbd6b0e2..70bbd117 100755
--- a/debian/rules
+++ b/debian/rules
@@ -22,11 +22,22 @@ dh_options = \
common_configure_flags := \
--disable-silent-rules \
- --disable-libaudit \
--enable-installed-tests \
--libexecdir=\$${prefix}/lib/dbus-1.0 \
+ $(NULL)
+
+ifeq ($(filter stage1,$(DEB_BUILD_PROFILES)),)
+ifeq ($(DEB_HOST_ARCH_OS),linux)
+# Non-bootstrap build on Linux: add Linux-specifics
+with_systemd = yes
+common_configure_flags += \
+ --enable-libaudit \
+ --enable-selinux \
+ --enable-systemd \
--with-systemdsystemunitdir=/lib/systemd/system \
$(NULL)
+endif
+endif
normal_configure_flags := \
--libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \
@@ -38,11 +49,26 @@ debug_configure_flags := \
--enable-asserts \
--enable-checks \
--enable-verbose-mode \
+ --with-valgrind=auto \
--prefix=/usr/lib/$(DEB_HOST_MULTIARCH)/dbus-1.0/debug-build \
--libdir='$${prefix}/lib' \
$(NULL)
-ifeq ($(filter nodocs,$(DEB_BUILD_OPTIONS))$(filter stage1,$(DEB_BUILD_PROFILE)),)
+udeb_configure_flags := \
+ $(normal_configure_flags) \
+ --disable-asserts \
+ --disable-checks \
+ --disable-doxygen-docs \
+ --disable-libaudit \
+ --disable-selinux \
+ --disable-systemd \
+ --disable-tests \
+ --disable-verbose-mode \
+ --disable-xml-docs \
+ CFLAGS='$(CFLAGS) -Os' \
+ $(NULL)
+
+ifeq ($(filter nodocs,$(DEB_BUILD_OPTIONS))$(filter stage1,$(DEB_BUILD_PROFILES)),)
# documentation enabled
normal_configure_flags += \
--enable-xml-docs \
@@ -58,24 +84,19 @@ normal_configure_flags += \
$(NULL)
endif
-ifeq ($(filter stage1,$(DEB_BUILD_PROFILE)),)
+ifeq ($(filter stage1,$(DEB_BUILD_PROFILES)),)
# not a stage1 build - build all the tests
debug_configure_flags += \
--enable-tests \
$(NULL)
endif
-# libdbus doesn't have --with-valgrind=auto yet. We want to enable it
-# on those architectures where it exists, while only having to modify
-# debian/control when it works on more architectures.
-#
-# We could use --with-valgrind=auto if someone reviewed the patch on
-# <https://bugs.freedesktop.org/show_bug.cgi?id=56925>.
-ifeq (yes,$(shell if pkg-config --exists valgrind; then echo yes; fi))
-debug_configure_flags += --with-valgrind
-endif
-
override_dh_auto_configure:
+ cp debian/dbus.install-generic debian/dbus.install
+ if [ -n "$(with_systemd)" ]; then \
+ cat debian/dbus.install-systemd >> \
+ debian/dbus.install; \
+ fi
dh_auto_configure \
-- \
$(common_configure_flags) \
@@ -87,18 +108,29 @@ override_dh_auto_configure:
$(common_configure_flags) \
$(debug_configure_flags) \
$(NULL)
+ dh_auto_configure \
+ --builddirectory=build-udeb \
+ -- \
+ $(common_configure_flags) \
+ $(udeb_configure_flags) \
+ $(NULL)
override_dh_auto_build:
dh_auto_build
dh_auto_build --builddirectory=build-debug
+ dh_auto_build --builddirectory=build-udeb
-# tests need more environmental setup at the moment
+# The tests need more environmental setup at the moment: they need our
+# home directory, and we can't just set HOME because the nonce-tcp
+# transport uses our "official" HOME according to getpwent(), since its
+# purpose is to prevent one user from impersonating another. (#630152)
override_dh_auto_test:
:
override_dh_auto_install:
dh_auto_install
make -C build-debug install-exec DESTDIR=$(CURDIR)/debian/tmp
+ make -C build-udeb install-exec DESTDIR=$(CURDIR)/debian/tmp-udeb
override_dh_link:
dh_link -plibdbus-1-dev lib/$(DEB_HOST_MULTIARCH)/$$(basename $$(readlink debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libdbus-1.so)) usr/lib/$(DEB_HOST_MULTIARCH)/libdbus-1.so
@@ -114,6 +146,11 @@ override_dh_install:
dh_install -p$(libdbusN) \
"usr/lib/$(DEB_HOST_MULTIARCH)/$(libdbus_soname)*" \
lib/$(DEB_HOST_MULTIARCH)
+ dh_install -pdbus-udeb
+ dh_install -p$(libdbusN)-udeb \
+ --sourcedir=debian/tmp-udeb \
+ "usr/lib/$(DEB_HOST_MULTIARCH)/$(libdbus_soname)*" \
+ lib/$(DEB_HOST_MULTIARCH)
dh_install --remaining-packages --list-missing $(dh_install_options)
install -m 644 -D debian/dbus-Xsession debian/dbus-x11/etc/X11/Xsession.d/75dbus_dbus-launch
ifeq (illumos,$(DEB_HOST_ARCH_OS))
@@ -121,18 +158,19 @@ ifeq (illumos,$(DEB_HOST_ARCH_OS))
endif
override_dh_installinit:
- dh_installinit -pdbus -r -- start 12 2 3 4 5 .
+ dh_installinit -pdbus -r
# we don't want docs for the debug symbols, just symlink to the library docs
override_dh_installdocs:
dh_installdocs -pdbus-1-dbg --link-doc=$(libdbusN)
+ dh_installdocs -pdbus-udeb -p$(libdbusN)-udeb --no-act
dh_installdocs --remaining-packages --all AUTHORS NEWS README
override_dh_strip:
dh_strip --dbg-package=dbus-1-dbg
override_dh_makeshlibs:
- dh_makeshlibs -V -Ndbus-1-dbg
+ dh_makeshlibs -V -Ndbus-1-dbg --add-udeb=$(libdbusN)-udeb -- -c4
override_dh_autoreconf:
cp INSTALL INSTALL.orig
@@ -147,8 +185,13 @@ override_dh_autoreconf_clean:
override_dh_auto_clean:
dh_auto_clean
dh_auto_clean --builddirectory=build-debug
+ dh_auto_clean --builddirectory=build-udeb
rm -f build/test/data/valid-config-files/session.conf
rm -f build/test/data/valid-config-files/system.conf
rm -f build-debug/test/data/valid-config-files/session.conf
rm -f build-debug/test/data/valid-config-files/system.conf
rm -f dbus.devhelp
+
+clean:
+ rm -rf debian/tmp-udeb
+ dh $@ $(dh_options)
diff --git a/debian/tests/build b/debian/tests/build
new file mode 100755
index 00000000..1e27f1a1
--- /dev/null
+++ b/debian/tests/build
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+set -e
+exec 2>&1
+set -x
+
+cd "$ADTTMP"
+
+cat > connect.c <<EOF
+#include <stdio.h>
+
+#include <dbus/dbus.h>
+
+int main (void)
+{
+ DBusError error;
+ DBusConnection *connection;
+
+ dbus_error_init(&error);
+ connection = dbus_bus_get(DBUS_BUS_SESSION, &error);
+
+ if (connection == NULL) {
+ fprintf(stderr, "%s: %s", error.name, error.message);
+ dbus_error_free(&error);
+ return 1;
+ }
+
+ dbus_connection_unref(connection);
+ return 0;
+}
+EOF
+
+gcc -o connect connect.c $(pkg-config --cflags --libs dbus-1)
+test -x connect
+dbus-run-session -- ./connect
+echo "everything seems OK"
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 00000000..0515c14b
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,5 @@
+Tests: installed-tests
+Depends: dbus, libdbus-1-3, dbus-1-dbg
+
+Tests: build
+Depends: libdbus-1-dev, dbus, build-essential
diff --git a/debian/tests/installed-tests b/debian/tests/installed-tests
new file mode 100755
index 00000000..9f1be3ec
--- /dev/null
+++ b/debian/tests/installed-tests
@@ -0,0 +1,33 @@
+#!/bin/sh
+# installed-tests wrapper for dbus. Outputs TAP format because why not
+
+set -e
+
+timeout="timeout 300s"
+ret=0
+i=0
+
+for dir in /usr/lib/*/dbus-1.0/test /usr/lib/*/dbus-1.0/debug-build/lib/dbus-1.0/test; do
+ for t in "$dir"/test-*; do
+ i=$(( $i + 1 ))
+ echo "# $i - $t ..."
+ echo "x" > "$ADTTMP/result"
+ ( set +e; $timeout $t; echo "$?" > "$ADTTMP/result" ) 2>&1 | sed 's/^/# /'
+ e="$(cat "$ADTTMP/result")"
+ case "$e" in
+ (0)
+ echo "ok $i - $t"
+ ;;
+ (77)
+ echo "ok $i # SKIP $t"
+ ;;
+ (*)
+ echo "not ok $i - $t ($e)"
+ ret=1
+ ;;
+ esac
+ done
+done
+
+echo "1..$i"
+exit $ret
diff --git a/depcomp b/depcomp
index 25a39e6c..4ebd5b3a 100755
--- a/depcomp
+++ b/depcomp
@@ -1,10 +1,9 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
-scriptversion=2012-03-27.16; # UTC
+scriptversion=2013-05-30.07; # UTC
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010,
-# 2011, 2012 Free Software Foundation, Inc.
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -28,9 +27,9 @@ scriptversion=2012-03-27.16; # UTC
case $1 in
'')
- echo "$0: No command. Try '$0 --help' for more information." 1>&2
- exit 1;
- ;;
+ echo "$0: No command. Try '$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
@@ -57,11 +56,65 @@ EOF
;;
esac
+# Get the directory component of the given path, and save it in the
+# global variables '$dir'. Note that this directory component will
+# be either empty or ending with a '/' character. This is deliberate.
+set_dir_from ()
+{
+ case $1 in
+ */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
+ *) dir=;;
+ esac
+}
+
+# Get the suffix-stripped basename of the given path, and save it the
+# global variable '$base'.
+set_base_from ()
+{
+ base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
+}
+
+# If no dependency file was actually created by the compiler invocation,
+# we still have to create a dummy depfile, to avoid errors with the
+# Makefile "include basename.Plo" scheme.
+make_dummy_depfile ()
+{
+ echo "#dummy" > "$depfile"
+}
+
+# Factor out some common post-processing of the generated depfile.
+# Requires the auxiliary global variable '$tmpdepfile' to be set.
+aix_post_process_depfile ()
+{
+ # If the compiler actually managed to produce a dependency file,
+ # post-process it.
+ if test -f "$tmpdepfile"; then
+ # Each line is of the form 'foo.o: dependency.h'.
+ # Do two passes, one to just change these to
+ # $object: dependency.h
+ # and one to simply output
+ # dependency.h:
+ # which is needed to avoid the deleted-header problem.
+ { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
+ sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
+ } > "$depfile"
+ rm -f "$tmpdepfile"
+ else
+ make_dummy_depfile
+ fi
+}
+
# A tabulation character.
tab=' '
# A newline character.
nl='
'
+# Character ranges might be problematic outside the C locale.
+# These definitions help.
+upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
+lower=abcdefghijklmnopqrstuvwxyz
+digits=0123456789
+alpha=${upper}${lower}
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
@@ -75,6 +128,9 @@ tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
+# Avoid interferences from the environment.
+gccflag= dashmflag=
+
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
@@ -86,32 +142,32 @@ if test "$depmode" = hp; then
fi
if test "$depmode" = dashXmstdout; then
- # This is just like dashmstdout with a different argument.
- dashmflag=-xM
- depmode=dashmstdout
+ # This is just like dashmstdout with a different argument.
+ dashmflag=-xM
+ depmode=dashmstdout
fi
cygpath_u="cygpath -u -f -"
if test "$depmode" = msvcmsys; then
- # This is just like msvisualcpp but w/o cygpath translation.
- # Just convert the backslash-escaped backslashes to single forward
- # slashes to satisfy depend.m4
- cygpath_u='sed s,\\\\,/,g'
- depmode=msvisualcpp
+ # This is just like msvisualcpp but w/o cygpath translation.
+ # Just convert the backslash-escaped backslashes to single forward
+ # slashes to satisfy depend.m4
+ cygpath_u='sed s,\\\\,/,g'
+ depmode=msvisualcpp
fi
if test "$depmode" = msvc7msys; then
- # This is just like msvc7 but w/o cygpath translation.
- # Just convert the backslash-escaped backslashes to single forward
- # slashes to satisfy depend.m4
- cygpath_u='sed s,\\\\,/,g'
- depmode=msvc7
+ # This is just like msvc7 but w/o cygpath translation.
+ # Just convert the backslash-escaped backslashes to single forward
+ # slashes to satisfy depend.m4
+ cygpath_u='sed s,\\\\,/,g'
+ depmode=msvc7
fi
if test "$depmode" = xlc; then
- # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations.
- gccflag=-qmakedep=gcc,-MF
- depmode=gcc
+ # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
+ gccflag=-qmakedep=gcc,-MF
+ depmode=gcc
fi
case "$depmode" in
@@ -134,8 +190,7 @@ gcc3)
done
"$@"
stat=$?
- if test $stat -eq 0; then :
- else
+ if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
@@ -143,13 +198,17 @@ gcc3)
;;
gcc)
+## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
+## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
+## (see the conditional assignment to $gccflag above).
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
-## -MM, not -M (despite what the docs say).
+## -MM, not -M (despite what the docs say). Also, it might not be
+## supported by the other compilers which use the 'gcc' depmode.
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
@@ -157,15 +216,14 @@ gcc)
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
- if test $stat -eq 0; then :
- else
+ if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
- alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
-## The second -e expression handles DOS-style file names with drive letters.
+ # The second -e expression handles DOS-style file names with drive
+ # letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the "deleted header file" problem.
@@ -174,15 +232,15 @@ gcc)
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
- tr ' ' "$nl" < "$tmpdepfile" |
## Some versions of gcc put a space before the ':'. On the theory
## that the space means something, we add a space to the output as
## well. hp depmode also adds that space, but also prefixes the VPATH
## to the object. Take care to not repeat it in the output.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
- sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
- | sed -e 's/$/ :/' >> "$depfile"
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+ | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
@@ -200,8 +258,7 @@ sgi)
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
- if test $stat -eq 0; then :
- else
+ if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
@@ -209,7 +266,6 @@ sgi)
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
-
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
@@ -217,19 +273,15 @@ sgi)
# the IRIX cc adds comments like '#:fec' to the end of the
# dependency line.
tr ' ' "$nl" < "$tmpdepfile" \
- | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
- tr "$nl" ' ' >> "$depfile"
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
+ | tr "$nl" ' ' >> "$depfile"
echo >> "$depfile"
-
# The second pass generates a dummy entry for each header file.
tr ' ' "$nl" < "$tmpdepfile" \
- | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
- >> "$depfile"
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+ >> "$depfile"
else
- # The sourcefile does not contain any dependencies, so just
- # store a dummy comment line, to avoid errors with the Makefile
- # "include basename.Plo" scheme.
- echo "#dummy" > "$depfile"
+ make_dummy_depfile
fi
rm -f "$tmpdepfile"
;;
@@ -247,9 +299,8 @@ aix)
# current directory. Also, the AIX compiler puts '$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
- dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
- test "x$dir" = "x$object" && dir=
- base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+ set_dir_from "$object"
+ set_base_from "$object"
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u
@@ -262,9 +313,7 @@ aix)
"$@" -M
fi
stat=$?
-
- if test $stat -eq 0; then :
- else
+ if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
@@ -273,65 +322,113 @@ aix)
do
test -f "$tmpdepfile" && break
done
- if test -f "$tmpdepfile"; then
- # Each line is of the form 'foo.o: dependent.h'.
- # Do two passes, one to just change these to
- # '$object: dependent.h' and one to simply 'dependent.h:'.
- sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
- sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
- else
- # The sourcefile does not contain any dependencies, so just
- # store a dummy comment line, to avoid errors with the Makefile
- # "include basename.Plo" scheme.
- echo "#dummy" > "$depfile"
+ aix_post_process_depfile
+ ;;
+
+tcc)
+ # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
+ # FIXME: That version still under development at the moment of writing.
+ # Make that this statement remains true also for stable, released
+ # versions.
+ # It will wrap lines (doesn't matter whether long or short) with a
+ # trailing '\', as in:
+ #
+ # foo.o : \
+ # foo.c \
+ # foo.h \
+ #
+ # It will put a trailing '\' even on the last line, and will use leading
+ # spaces rather than leading tabs (at least since its commit 0394caf7
+ # "Emit spaces for -MD").
+ "$@" -MD -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
fi
+ rm -f "$depfile"
+ # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
+ # We have to change lines of the first kind to '$object: \'.
+ sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
+ # And for each line of the second kind, we have to emit a 'dep.h:'
+ # dummy dependency, to avoid the deleted-header problem.
+ sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
rm -f "$tmpdepfile"
;;
-icc)
- # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'.
- # However on
- # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c
- # ICC 7.0 will fill foo.d with something like
- # foo.o: sub/foo.c
- # foo.o: sub/foo.h
- # which is wrong. We want
- # sub/foo.o: sub/foo.c
- # sub/foo.o: sub/foo.h
- # sub/foo.c:
- # sub/foo.h:
- # ICC 7.1 will output
+## The order of this option in the case statement is important, since the
+## shell code in configure will try each of these formats in the order
+## listed in this file. A plain '-MD' option would be understood by many
+## compilers, so we must ensure this comes after the gcc and icc options.
+pgcc)
+ # Portland's C compiler understands '-MD'.
+ # Will always output deps to 'file.d' where file is the root name of the
+ # source file under compilation, even if file resides in a subdirectory.
+ # The object file name does not affect the name of the '.d' file.
+ # pgcc 10.2 will output
# foo.o: sub/foo.c sub/foo.h
- # and will wrap long lines using '\':
+ # and will wrap long lines using '\' :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
- # tcc 0.9.26 (FIXME still under development at the moment of writing)
- # will emit a similar output, but also prepend the continuation lines
- # with horizontal tabulation characters.
- "$@" -MD -MF "$tmpdepfile"
- stat=$?
- if test $stat -eq 0; then :
- else
+ set_dir_from "$object"
+ # Use the source, not the object, to determine the base name, since
+ # that's sadly what pgcc will do too.
+ set_base_from "$source"
+ tmpdepfile=$base.d
+
+ # For projects that build the same source file twice into different object
+ # files, the pgcc approach of using the *source* file root name can cause
+ # problems in parallel builds. Use a locking strategy to avoid stomping on
+ # the same $tmpdepfile.
+ lockdir=$base.d-lock
+ trap "
+ echo '$0: caught signal, cleaning up...' >&2
+ rmdir '$lockdir'
+ exit 1
+ " 1 2 13 15
+ numtries=100
+ i=$numtries
+ while test $i -gt 0; do
+ # mkdir is a portable test-and-set.
+ if mkdir "$lockdir" 2>/dev/null; then
+ # This process acquired the lock.
+ "$@" -MD
+ stat=$?
+ # Release the lock.
+ rmdir "$lockdir"
+ break
+ else
+ # If the lock is being held by a different process, wait
+ # until the winning process is done or we timeout.
+ while test -d "$lockdir" && test $i -gt 0; do
+ sleep 1
+ i=`expr $i - 1`
+ done
+ fi
+ i=`expr $i - 1`
+ done
+ trap - 1 2 13 15
+ if test $i -le 0; then
+ echo "$0: failed to acquire lock after $numtries attempts" >&2
+ echo "$0: check lockdir '$lockdir'" >&2
+ exit 1
+ fi
+
+ if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
- # Each line is of the form 'foo.o: dependent.h',
- # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'.
+ # Each line is of the form `foo.o: dependent.h',
+ # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
- # '$object: dependent.h' and one to simply 'dependent.h:'.
- sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \
- < "$tmpdepfile" > "$depfile"
- sed '
- s/[ '"$tab"'][ '"$tab"']*/ /g
- s/^ *//
- s/ *\\*$//
- s/^[^:]*: *//
- /^$/d
- /:$/d
- s/$/ :/
- ' < "$tmpdepfile" >> "$depfile"
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
+ | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
@@ -342,9 +439,8 @@ hp2)
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
- dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
- test "x$dir" = "x$object" && dir=
- base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+ set_dir_from "$object"
+ set_base_from "$object"
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
@@ -355,8 +451,7 @@ hp2)
"$@" +Maked
fi
stat=$?
- if test $stat -eq 0; then :
- else
+ if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
@@ -366,76 +461,61 @@ hp2)
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
- sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+ sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
# Add 'dependent.h:' lines.
sed -ne '2,${
- s/^ *//
- s/ \\*$//
- s/$/:/
- p
- }' "$tmpdepfile" >> "$depfile"
+ s/^ *//
+ s/ \\*$//
+ s/$/:/
+ p
+ }' "$tmpdepfile" >> "$depfile"
else
- echo "#dummy" > "$depfile"
+ make_dummy_depfile
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
- # The Tru64 compiler uses -MD to generate dependencies as a side
- # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
- # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
- # dependencies in 'foo.d' instead, so we check for that too.
- # Subdirectories are respected.
- dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
- test "x$dir" = "x$object" && dir=
- base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
-
- if test "$libtool" = yes; then
- # With Tru64 cc, shared objects can also be used to make a
- # static library. This mechanism is used in libtool 1.4 series to
- # handle both shared and static libraries in a single compilation.
- # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
- #
- # With libtool 1.5 this exception was removed, and libtool now
- # generates 2 separate objects for the 2 libraries. These two
- # compilations output dependencies in $dir.libs/$base.o.d and
- # in $dir$base.o.d. We have to check for both files, because
- # one of the two compilations can be disabled. We should prefer
- # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
- # automatically cleaned when .libs/ is deleted, while ignoring
- # the former would cause a distcleancheck panic.
- tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
- tmpdepfile2=$dir$base.o.d # libtool 1.5
- tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
- tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
- "$@" -Wc,-MD
- else
- tmpdepfile1=$dir$base.o.d
- tmpdepfile2=$dir$base.d
- tmpdepfile3=$dir$base.d
- tmpdepfile4=$dir$base.d
- "$@" -MD
- fi
-
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
- exit $stat
- fi
-
- for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
- do
- test -f "$tmpdepfile" && break
- done
- if test -f "$tmpdepfile"; then
- sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
- sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
- else
- echo "#dummy" > "$depfile"
- fi
- rm -f "$tmpdepfile"
- ;;
+ # The Tru64 compiler uses -MD to generate dependencies as a side
+ # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+ # dependencies in 'foo.d' instead, so we check for that too.
+ # Subdirectories are respected.
+ set_dir_from "$object"
+ set_base_from "$object"
+
+ if test "$libtool" = yes; then
+ # Libtool generates 2 separate objects for the 2 libraries. These
+ # two compilations output dependencies in $dir.libs/$base.o.d and
+ # in $dir$base.o.d. We have to check for both files, because
+ # one of the two compilations can be disabled. We should prefer
+ # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+ # automatically cleaned when .libs/ is deleted, while ignoring
+ # the former would cause a distcleancheck panic.
+ tmpdepfile1=$dir$base.o.d # libtool 1.5
+ tmpdepfile2=$dir.libs/$base.o.d # Likewise.
+ tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
+ "$@" -Wc,-MD
+ else
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir$base.d
+ tmpdepfile3=$dir$base.d
+ "$@" -MD
+ fi
+
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ # Same post-processing that is required for AIX mode.
+ aix_post_process_depfile
+ ;;
msvc7)
if test "$libtool" = yes; then
@@ -446,8 +526,7 @@ msvc7)
"$@" $showIncludes > "$tmpdepfile"
stat=$?
grep -v '^Note: including file: ' "$tmpdepfile"
- if test "$stat" = 0; then :
- else
+ if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
@@ -473,6 +552,7 @@ $ {
G
p
}' >> "$depfile"
+ echo >> "$depfile" # make sure the fragment doesn't end with a backslash
rm -f "$tmpdepfile"
;;
@@ -524,13 +604,14 @@ dashmstdout)
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
"$@" $dashmflag |
- sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile"
+ sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
- tr ' ' "$nl" < "$tmpdepfile" | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly. Breaking it into two sed invocations is a workaround.
- sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this sed invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+ | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
@@ -583,10 +664,12 @@ makedepend)
# makedepend may prepend the VPATH from the source file name to the object.
# No need to regex-escape $object, excess matching of '.' is harmless.
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
- sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly. Breaking it into two sed invocations is a workaround.
- sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process the last invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed '1,2d' "$tmpdepfile" \
+ | tr ' ' "$nl" \
+ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+ | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
@@ -622,10 +705,10 @@ cpp)
esac
done
- "$@" -E |
- sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
- -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
- sed '$ s: \\$::' > "$tmpdepfile"
+ "$@" -E \
+ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ | sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
@@ -657,15 +740,15 @@ msvisualcpp)
shift
;;
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
- set fnord "$@"
- shift
- shift
- ;;
+ set fnord "$@"
+ shift
+ shift
+ ;;
*)
- set fnord "$@" "$arg"
- shift
- shift
- ;;
+ set fnord "$@" "$arg"
+ shift
+ shift
+ ;;
esac
done
"$@" -E 2>/dev/null |
diff --git a/doc/Makefile.am b/doc/Makefile.am
index b2659871..b9a4c106 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,28 +1,22 @@
apidir = @htmldir@/api
-# automake normally assumes that man pages are generated files;
-# these ones aren't, so we need the dist_ prefix to say that they're
-# their own source code
-dist_man1_MANS = \
+man_pages = \
dbus-cleanup-sockets.1 \
+ dbus-daemon.1 \
dbus-launch.1 \
dbus-monitor.1 \
+ dbus-run-session.1 \
dbus-send.1 \
- dbus-uuidgen.1
+ dbus-uuidgen.1 \
+ $(NULL)
-# on the other hand, this one is generated
-man1_MANS = \
- dbus-daemon.1
+MAN_XML_FILES = $(patsubst %.1,%.1.xml,$(man_pages))
-MAN_IN_FILES = dbus-daemon.1.in
+if DBUS_XML_DOCS_ENABLED
+man1_MANS = $(man_pages)
+endif
-MAN_HTML_FILES = \
- dbus-cleanup-sockets.1.html \
- dbus-daemon.1.html \
- dbus-launch.1.html \
- dbus-monitor.1.html \
- dbus-send.1.html \
- dbus-uuidgen.1.html
+MAN_HTML_FILES = $(patsubst %.1,%.1.html,$(man_pages))
DTDS = \
busconfig.dtd \
@@ -43,8 +37,7 @@ STATIC_DOCS = \
EXTRA_DIST = \
file-boilerplate.c \
doxygen_to_devhelp.xsl \
- $(STATIC_DOCS) \
- $(MAN_IN_FILES)
+ $(STATIC_DOCS)
html_DATA =
@@ -59,27 +52,22 @@ STATIC_HTML = \
dist_html_DATA += $(STATIC_HTML)
-# we distribute these in the tarball so users don't necessarily need xmlto
-dist_html_DATA += $(XMLTO_OUTPUT)
-
-XMLTO_OUTPUT= \
+XMLTO_HTML = \
dbus-faq.html \
dbus-specification.html \
dbus-test-plan.html \
- dbus-tutorial.html
+ dbus-tutorial.html \
+ $(MAN_HTML_FILES) \
+ $(NULL)
if DBUS_XML_DOCS_ENABLED
-dbus-specification.html: dbus-specification.xml
- $(XMLTO) html-nochunks $<
-
-dbus-test-plan.html: dbus-test-plan.xml
- $(XMLTO) html-nochunks $<
+html_DATA += $(XMLTO_HTML)
-dbus-tutorial.html: dbus-tutorial.xml
+%.html: %.xml
$(XMLTO) html-nochunks $<
-dbus-faq.html: dbus-faq.xml
- $(XMLTO) html-nochunks $<
+%.1: %.1.xml
+ $(XMLTO) man $<
endif
if DBUS_DOXYGEN_DOCS_ENABLED
@@ -115,13 +103,6 @@ uninstall-local::
rmdir $(DESTDIR)$(apidir)
endif
-if DBUS_HAVE_MAN2HTML
-html_DATA += $(MAN_HTML_FILES)
-
-%.1.html: %.1
- $(AM_V_GEN)( $(MAN2HTML) < $< > $@.tmp && mv $@.tmp $@ )
-endif
-
if DBUS_CAN_UPLOAD_DOCS
BONUS_FILES = \
$(top_srcdir)/README \
@@ -131,14 +112,15 @@ BONUS_FILES = \
$(top_srcdir)/COPYING \
$(top_srcdir)/ChangeLog
-dbus-docs: $(STATIC_DOCS) $(dist_doc_DATA) $(dist_html_DATA) $(MAN_HTML_FILES) $(BONUS_FILES) doxygen.stamp
+dbus-docs: $(STATIC_DOCS) $(MAN_XML_FILES) $(dist_doc_DATA) $(dist_html_DATA) $(MAN_HTML_FILES) $(BONUS_FILES) doxygen.stamp $(XMLTO_HTML)
$(AM_V_at)rm -rf $@ $@.tmp
$(AM_V_GEN)$(MKDIR_P) $@.tmp/api
$(AM_V_at)cd $(srcdir) && cp $(STATIC_DOCS) @abs_builddir@/$@.tmp
$(AM_V_at)cd $(srcdir) && cp $(dist_doc_DATA) @abs_builddir@/$@.tmp
$(AM_V_at)cd $(srcdir) && cp $(STATIC_HTML) @abs_builddir@/$@.tmp
- $(AM_V_at)cp $(XMLTO_OUTPUT) @abs_builddir@/$@.tmp
+ $(AM_V_at)cp $(XMLTO_HTML) @abs_builddir@/$@.tmp
$(AM_V_at)cp $(MAN_HTML_FILES) @abs_builddir@/$@.tmp
+ $(AM_V_at)cp $(MAN_XML_FILES) @abs_builddir@/$@.tmp
$(AM_V_at)cp $(BONUS_FILES) @abs_builddir@/$@.tmp
$(AM_V_at)cp -r api/html @abs_builddir@/$@.tmp/api
$(AM_V_at)mv $@.tmp $@
@@ -165,12 +147,15 @@ maintainer-upload-docs:
@false
endif
+CLEANFILES = \
+ $(man1_MANS) \
+ $(MAN_XML_FILES) \
+ $(XMLTO_HTML) \
+ $(NULL)
+
clean-local:
rm -f $(html_DATA)
rm -rf api
rm -rf dbus-docs dbus-docs.tmp
rm -f *.1.html
rm -f doxygen.stamp
-
-maintainer-clean-local:
- rm -f $(XMLTO_OUTPUT)
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 4ab0f9e6..a48c7e5a 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.6 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -16,23 +15,51 @@
@SET_MAKE@
VPATH = @srcdir@
-am__make_dryrun = \
- { \
- am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
- *) \
- for am__flg in $$MAKEFLAGS; do \
- case $$am__flg in \
- *=*|--*) ;; \
- *n*) am__dry=yes; break;; \
- esac; \
- done;; \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
- test $$am__dry = yes; \
- }
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -51,12 +78,16 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-@DBUS_DOXYGEN_DOCS_ENABLED_TRUE@@DBUS_HAVE_XSLTPROC_TRUE@am__append_1 = dbus.devhelp
-@DBUS_HAVE_MAN2HTML_TRUE@am__append_2 = $(MAN_HTML_FILES)
+@DBUS_XML_DOCS_ENABLED_TRUE@am__append_1 = $(XMLTO_HTML)
+@DBUS_DOXYGEN_DOCS_ENABLED_TRUE@@DBUS_HAVE_XSLTPROC_TRUE@am__append_2 = dbus.devhelp
subdir = doc
-DIST_COMMON = $(dist_doc_DATA) $(dist_html_DATA) $(dist_man1_MANS) \
- $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- $(srcdir)/dbus-daemon.1.in TODO
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+ $(srcdir)/dbus-cleanup-sockets.1.xml.in \
+ $(srcdir)/dbus-daemon.1.xml.in $(srcdir)/dbus-launch.1.xml.in \
+ $(srcdir)/dbus-monitor.1.xml.in \
+ $(srcdir)/dbus-run-session.1.xml.in \
+ $(srcdir)/dbus-send.1.xml.in $(srcdir)/dbus-uuidgen.1.xml.in \
+ $(dist_doc_DATA) $(dist_html_DATA) TODO
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/libtool.m4 \
@@ -69,14 +100,22 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES = dbus-daemon.1
+CONFIG_CLEAN_FILES = dbus-cleanup-sockets.1.xml dbus-daemon.1.xml \
+ dbus-launch.1.xml dbus-monitor.1.xml dbus-run-session.1.xml \
+ dbus-send.1.xml dbus-uuidgen.1.xml
CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
+am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
@@ -115,8 +154,9 @@ man1dir = $(mandir)/man1
am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(docdir)" \
"$(DESTDIR)$(htmldir)" "$(DESTDIR)$(htmldir)"
NROFF = nroff
-MANS = $(dist_man1_MANS) $(man1_MANS)
+MANS = $(man1_MANS)
DATA = $(dist_doc_DATA) $(dist_html_DATA) $(html_DATA)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ADT_LIBS = @ADT_LIBS@
@@ -146,7 +186,6 @@ 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@
DBUS_INT64_CONSTANT = @DBUS_INT64_CONSTANT@
@@ -157,7 +196,8 @@ DBUS_MICRO_VERSION = @DBUS_MICRO_VERSION@
DBUS_MINOR_VERSION = @DBUS_MINOR_VERSION@
DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@
DBUS_PREFIX = @DBUS_PREFIX@
-DBUS_SESSION_BUS_DEFAULT_ADDRESS = @DBUS_SESSION_BUS_DEFAULT_ADDRESS@
+DBUS_SESSION_BUS_CONNECT_ADDRESS = @DBUS_SESSION_BUS_CONNECT_ADDRESS@
+DBUS_SESSION_BUS_LISTEN_ADDRESS = @DBUS_SESSION_BUS_LISTEN_ADDRESS@
DBUS_SESSION_SOCKET_DIR = @DBUS_SESSION_SOCKET_DIR@
DBUS_STATIC_BUILD_CPPFLAGS = @DBUS_STATIC_BUILD_CPPFLAGS@
DBUS_SYSTEM_BUS_DEFAULT_ADDRESS = @DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@
@@ -206,8 +246,6 @@ LIBDBUS_LIBS = @LIBDBUS_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
-LIBXML_CFLAGS = @LIBXML_CFLAGS@
-LIBXML_LIBS = @LIBXML_LIBS@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
@@ -216,7 +254,6 @@ LT_CURRENT = @LT_CURRENT@
LT_REVISION = @LT_REVISION@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
-MAN2HTML = @MAN2HTML@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NETWORK_libs = @NETWORK_libs@
@@ -250,7 +287,6 @@ SHELL = @SHELL@
STRIP = @STRIP@
SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
SYSTEMD_LIBS = @SYSTEMD_LIBS@
-TEST_BUS_BINARY = @TEST_BUS_BINARY@
TEST_LAUNCH_HELPER_BINARY = @TEST_LAUNCH_HELPER_BINARY@
TEST_LISTEN = @TEST_LISTEN@
TEST_SOCKET_DIR = @TEST_SOCKET_DIR@
@@ -327,31 +363,19 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
apidir = @htmldir@/api
-
-# automake normally assumes that man pages are generated files;
-# these ones aren't, so we need the dist_ prefix to say that they're
-# their own source code
-dist_man1_MANS = \
+man_pages = \
dbus-cleanup-sockets.1 \
+ dbus-daemon.1 \
dbus-launch.1 \
dbus-monitor.1 \
+ dbus-run-session.1 \
dbus-send.1 \
- dbus-uuidgen.1
-
-
-# on the other hand, this one is generated
-man1_MANS = \
- dbus-daemon.1
-
-MAN_IN_FILES = dbus-daemon.1.in
-MAN_HTML_FILES = \
- dbus-cleanup-sockets.1.html \
- dbus-daemon.1.html \
- dbus-launch.1.html \
- dbus-monitor.1.html \
- dbus-send.1.html \
- dbus-uuidgen.1.html
+ dbus-uuidgen.1 \
+ $(NULL)
+MAN_XML_FILES = $(patsubst %.1,%.1.xml,$(man_pages))
+@DBUS_XML_DOCS_ENABLED_TRUE@man1_MANS = $(man_pages)
+MAN_HTML_FILES = $(patsubst %.1,%.1.html,$(man_pages))
DTDS = \
busconfig.dtd \
introspect.dtd
@@ -371,13 +395,10 @@ STATIC_DOCS = \
EXTRA_DIST = \
file-boilerplate.c \
doxygen_to_devhelp.xsl \
- $(STATIC_DOCS) \
- $(MAN_IN_FILES)
+ $(STATIC_DOCS)
html_DATA = $(am__append_1) $(am__append_2)
-
-# we distribute these in the tarball so users don't necessarily need xmlto
-dist_html_DATA = $(STATIC_HTML) $(XMLTO_OUTPUT)
+dist_html_DATA = $(STATIC_HTML)
# diagram.png/diagram.svg aren't really HTML, but must go in the same
# directory as the HTML to avoid broken links
@@ -386,11 +407,13 @@ STATIC_HTML = \
diagram.svg \
$(NULL)
-XMLTO_OUTPUT = \
+XMLTO_HTML = \
dbus-faq.html \
dbus-specification.html \
dbus-test-plan.html \
- dbus-tutorial.html
+ dbus-tutorial.html \
+ $(MAN_HTML_FILES) \
+ $(NULL)
@DBUS_CAN_UPLOAD_DOCS_TRUE@BONUS_FILES = \
@DBUS_CAN_UPLOAD_DOCS_TRUE@ $(top_srcdir)/README \
@@ -404,6 +427,12 @@ XMLTO_OUTPUT = \
@DBUS_CAN_UPLOAD_DOCS_TRUE@DOC_WWW_DIR = /srv/dbus.freedesktop.org/www
@DBUS_CAN_UPLOAD_DOCS_TRUE@SPECIFICATION_SERVER = specifications.freedesktop.org
@DBUS_CAN_UPLOAD_DOCS_TRUE@SPECIFICATION_PATH = /srv/specifications.freedesktop.org/www/dbus/1.0
+CLEANFILES = \
+ $(man1_MANS) \
+ $(MAN_XML_FILES) \
+ $(XMLTO_HTML) \
+ $(NULL)
+
all: all-am
.SUFFIXES:
@@ -437,7 +466,19 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
-dbus-daemon.1: $(top_builddir)/config.status $(srcdir)/dbus-daemon.1.in
+dbus-cleanup-sockets.1.xml: $(top_builddir)/config.status $(srcdir)/dbus-cleanup-sockets.1.xml.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+dbus-daemon.1.xml: $(top_builddir)/config.status $(srcdir)/dbus-daemon.1.xml.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+dbus-launch.1.xml: $(top_builddir)/config.status $(srcdir)/dbus-launch.1.xml.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+dbus-monitor.1.xml: $(top_builddir)/config.status $(srcdir)/dbus-monitor.1.xml.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+dbus-run-session.1.xml: $(top_builddir)/config.status $(srcdir)/dbus-run-session.1.xml.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+dbus-send.1.xml: $(top_builddir)/config.status $(srcdir)/dbus-send.1.xml.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+dbus-uuidgen.1.xml: $(top_builddir)/config.status $(srcdir)/dbus-uuidgen.1.xml.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
mostlyclean-libtool:
@@ -445,9 +486,9 @@ mostlyclean-libtool:
clean-libtool:
-rm -rf .libs _libs
-install-man1: $(dist_man1_MANS) $(man1_MANS)
+install-man1: $(man1_MANS)
@$(NORMAL_INSTALL)
- @list1='$(dist_man1_MANS) $(man1_MANS)'; \
+ @list1='$(man1_MANS)'; \
list2=''; \
test -n "$(man1dir)" \
&& test -n "`echo $$list1$$list2`" \
@@ -481,7 +522,7 @@ install-man1: $(dist_man1_MANS) $(man1_MANS)
uninstall-man1:
@$(NORMAL_UNINSTALL)
- @list='$(dist_man1_MANS) $(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
files=`{ for i in $$list; do echo "$$i"; done; \
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
@@ -549,27 +590,14 @@ uninstall-htmlDATA:
@list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(htmldir)'; $(am__uninstall_files_from_dir)
-tags: TAGS
-TAGS:
+tags TAGS:
+
+ctags CTAGS:
-ctags: CTAGS
-CTAGS:
+cscope cscopelist:
distdir: $(DISTFILES)
- @list='$(MANS)'; if test -n "$$list"; then \
- list=`for p in $$list; do \
- if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
- if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
- if test -n "$$list" && \
- grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
- echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
- grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
- echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
- echo " typically \`make maintainer-clean' will remove them" >&2; \
- exit 1; \
- else :; fi; \
- else :; fi
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@@ -629,6 +657,7 @@ install-strip:
mostlyclean-generic:
clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
@@ -637,8 +666,8 @@ distclean-generic:
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-@DBUS_DOXYGEN_DOCS_ENABLED_FALSE@uninstall-local:
@DBUS_DOXYGEN_DOCS_ENABLED_FALSE@install-data-local:
+@DBUS_DOXYGEN_DOCS_ENABLED_FALSE@uninstall-local:
clean: clean-am
clean-am: clean-generic clean-libtool clean-local mostlyclean-am
@@ -690,8 +719,7 @@ installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic \
- maintainer-clean-local
+maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
@@ -713,33 +741,27 @@ uninstall-man: uninstall-man1
.MAKE: install-am install-strip
.PHONY: all all-am all-local check check-am clean clean-generic \
- clean-libtool clean-local distclean distclean-generic \
- distclean-libtool distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am \
- install-data-local install-dist_docDATA install-dist_htmlDATA \
- install-dvi install-dvi-am install-exec install-exec-am \
- install-html install-html-am install-htmlDATA install-info \
- install-info-am install-man install-man1 install-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
- installcheck installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic maintainer-clean-local mostlyclean \
+ clean-libtool clean-local cscopelist-am ctags-am distclean \
+ distclean-generic distclean-libtool distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-data-local install-dist_docDATA \
+ install-dist_htmlDATA install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-htmlDATA \
+ install-info install-info-am install-man install-man1 \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- uninstall uninstall-am uninstall-dist_docDATA \
+ tags-am uninstall uninstall-am uninstall-dist_docDATA \
uninstall-dist_htmlDATA uninstall-htmlDATA uninstall-local \
uninstall-man uninstall-man1
-@DBUS_XML_DOCS_ENABLED_TRUE@dbus-specification.html: dbus-specification.xml
+@DBUS_XML_DOCS_ENABLED_TRUE@%.html: %.xml
@DBUS_XML_DOCS_ENABLED_TRUE@ $(XMLTO) html-nochunks $<
-@DBUS_XML_DOCS_ENABLED_TRUE@dbus-test-plan.html: dbus-test-plan.xml
-@DBUS_XML_DOCS_ENABLED_TRUE@ $(XMLTO) html-nochunks $<
-
-@DBUS_XML_DOCS_ENABLED_TRUE@dbus-tutorial.html: dbus-tutorial.xml
-@DBUS_XML_DOCS_ENABLED_TRUE@ $(XMLTO) html-nochunks $<
-
-@DBUS_XML_DOCS_ENABLED_TRUE@dbus-faq.html: dbus-faq.xml
-@DBUS_XML_DOCS_ENABLED_TRUE@ $(XMLTO) html-nochunks $<
+@DBUS_XML_DOCS_ENABLED_TRUE@%.1: %.1.xml
+@DBUS_XML_DOCS_ENABLED_TRUE@ $(XMLTO) man $<
@DBUS_DOXYGEN_DOCS_ENABLED_TRUE@all-local:: doxygen.stamp
@@ -768,17 +790,15 @@ uninstall-man: uninstall-man1
@DBUS_DOXYGEN_DOCS_ENABLED_TRUE@ rmdir --ignore-fail-on-non-empty $(DESTDIR)$(apidir) || \
@DBUS_DOXYGEN_DOCS_ENABLED_TRUE@ rmdir $(DESTDIR)$(apidir)
-@DBUS_HAVE_MAN2HTML_TRUE@%.1.html: %.1
-@DBUS_HAVE_MAN2HTML_TRUE@ $(AM_V_GEN)( $(MAN2HTML) < $< > $@.tmp && mv $@.tmp $@ )
-
-@DBUS_CAN_UPLOAD_DOCS_TRUE@dbus-docs: $(STATIC_DOCS) $(dist_doc_DATA) $(dist_html_DATA) $(MAN_HTML_FILES) $(BONUS_FILES) doxygen.stamp
+@DBUS_CAN_UPLOAD_DOCS_TRUE@dbus-docs: $(STATIC_DOCS) $(MAN_XML_FILES) $(dist_doc_DATA) $(dist_html_DATA) $(MAN_HTML_FILES) $(BONUS_FILES) doxygen.stamp $(XMLTO_HTML)
@DBUS_CAN_UPLOAD_DOCS_TRUE@ $(AM_V_at)rm -rf $@ $@.tmp
@DBUS_CAN_UPLOAD_DOCS_TRUE@ $(AM_V_GEN)$(MKDIR_P) $@.tmp/api
@DBUS_CAN_UPLOAD_DOCS_TRUE@ $(AM_V_at)cd $(srcdir) && cp $(STATIC_DOCS) @abs_builddir@/$@.tmp
@DBUS_CAN_UPLOAD_DOCS_TRUE@ $(AM_V_at)cd $(srcdir) && cp $(dist_doc_DATA) @abs_builddir@/$@.tmp
@DBUS_CAN_UPLOAD_DOCS_TRUE@ $(AM_V_at)cd $(srcdir) && cp $(STATIC_HTML) @abs_builddir@/$@.tmp
-@DBUS_CAN_UPLOAD_DOCS_TRUE@ $(AM_V_at)cp $(XMLTO_OUTPUT) @abs_builddir@/$@.tmp
+@DBUS_CAN_UPLOAD_DOCS_TRUE@ $(AM_V_at)cp $(XMLTO_HTML) @abs_builddir@/$@.tmp
@DBUS_CAN_UPLOAD_DOCS_TRUE@ $(AM_V_at)cp $(MAN_HTML_FILES) @abs_builddir@/$@.tmp
+@DBUS_CAN_UPLOAD_DOCS_TRUE@ $(AM_V_at)cp $(MAN_XML_FILES) @abs_builddir@/$@.tmp
@DBUS_CAN_UPLOAD_DOCS_TRUE@ $(AM_V_at)cp $(BONUS_FILES) @abs_builddir@/$@.tmp
@DBUS_CAN_UPLOAD_DOCS_TRUE@ $(AM_V_at)cp -r api/html @abs_builddir@/$@.tmp/api
@DBUS_CAN_UPLOAD_DOCS_TRUE@ $(AM_V_at)mv $@.tmp $@
@@ -804,9 +824,6 @@ clean-local:
rm -f *.1.html
rm -f doxygen.stamp
-maintainer-clean-local:
- rm -f $(XMLTO_OUTPUT)
-
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/doc/dbus-cleanup-sockets.1 b/doc/dbus-cleanup-sockets.1
deleted file mode 100644
index a062d498..00000000
--- a/doc/dbus-cleanup-sockets.1
+++ /dev/null
@@ -1,43 +0,0 @@
-.\"
-.\" dbus\-cleanup\-sockets manual page.
-.\" Copyright (C) 2003 Red Hat, Inc.
-.\"
-.TH dbus\-cleanup\-sockets 1
-.SH NAME
-dbus\-cleanup\-sockets \- clean up leftover sockets in a directory
-.SH SYNOPSIS
-.PP
-.B dbus\-cleanup\-sockets [DIRECTORY]
-
-.SH DESCRIPTION
-
-The \fIdbus\-cleanup\-sockets\fP command cleans up unused D\-Bus
-connection sockets. See http://www.freedesktop.org/software/dbus/ for
-more information about the big picture.
-
-.PP
-If given no arguments, \fIdbus\-cleanup\-sockets\fP cleans up sockets
-in the standard default socket directory for the
-per\-user\-login\-session message bus; this is usually /tmp.
-Optionally, you can pass a different directory on the command line.
-
-.PP
-On Linux, this program is essentially useless, because D\-Bus defaults
-to using "abstract sockets" that exist only in memory and don't have a
-corresponding file in /tmp.
-
-.PP
-On most other flavors of UNIX, it's possible for the socket files to
-leak when programs using D\-Bus exit abnormally or without closing
-their D\-Bus connections. Thus, it might be interesting to run
-dbus\-cleanup\-sockets in a cron job to mop up any leaked sockets.
-Or you can just ignore the leaked sockets, they aren't really hurting
-anything, other than cluttering the output of "ls /tmp"
-
-.SH AUTHOR
-dbus\-cleanup\-sockets was adapted by Havoc Pennington from
-linc\-cleanup\-sockets written by Michael Meeks.
-
-.SH BUGS
-Please send bug reports to the D\-Bus mailing list or bug tracker,
-see http://www.freedesktop.org/software/dbus/
diff --git a/doc/dbus-cleanup-sockets.1.xml.in b/doc/dbus-cleanup-sockets.1.xml.in
new file mode 100644
index 00000000..6d98083d
--- /dev/null
+++ b/doc/dbus-cleanup-sockets.1.xml.in
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+ "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<refentry id='dbuscleanupsockets1'>
+
+<!-- dbus&bsol;-cleanup&bsol;-sockets manual page.
+ Copyright (C) 2003 Red Hat, Inc. -->
+
+<refmeta>
+<refentrytitle>dbus-cleanup-sockets</refentrytitle>
+<manvolnum>1</manvolnum>
+<refmiscinfo class="manual">User Commands</refmiscinfo>
+<refmiscinfo class="source">D-Bus</refmiscinfo>
+<refmiscinfo class="version">@DBUS_VERSION@</refmiscinfo>
+</refmeta>
+<refnamediv>
+<refname>dbus-cleanup-sockets</refname>
+<refpurpose>clean up leftover sockets in a directory</refpurpose>
+</refnamediv>
+<!-- body begins here -->
+<refsynopsisdiv id='synopsis'>
+<cmdsynopsis>
+ <command>dbus-cleanup-sockets</command> <arg choice='opt'><replaceable>DIRECTORY</replaceable></arg>
+ <sbr/>
+</cmdsynopsis>
+</refsynopsisdiv>
+
+
+<refsect1 id='description'><title>DESCRIPTION</title>
+<para>The <command>dbus-cleanup-sockets</command> command cleans up unused D-Bus
+connection sockets. See <ulink url='http://www.freedesktop.org/software/dbus/'>http://www.freedesktop.org/software/dbus/</ulink> for
+more information about the big picture.</para>
+
+
+<para>If given no arguments, <command>dbus-cleanup-sockets</command> cleans up sockets
+in the standard default socket directory for the
+per-user-login-session message bus; this is usually /tmp.
+Optionally, you can pass a different directory on the command line.</para>
+
+
+<para>On Linux, this program is essentially useless, because D-Bus defaults
+to using "abstract sockets" that exist only in memory and don't have a
+corresponding file in /tmp.</para>
+
+
+<para>On most other flavors of UNIX, it's possible for the socket files to
+leak when programs using D-Bus exit abnormally or without closing
+their D-Bus connections. Thus, it might be interesting to run
+dbus-cleanup-sockets in a cron job to mop up any leaked sockets.
+Or you can just ignore the leaked sockets, they aren't really hurting
+anything, other than cluttering the output of "ls /tmp"</para>
+
+</refsect1>
+
+<refsect1 id='author'><title>AUTHOR</title>
+<para>dbus-cleanup-sockets was adapted by Havoc Pennington from
+linc-cleanup-sockets written by Michael Meeks.</para>
+
+</refsect1>
+
+<refsect1 id='bugs'><title>BUGS</title>
+<para>Please send bug reports to the D-Bus mailing list or bug tracker,
+see <ulink url='http://www.freedesktop.org/software/dbus/'>http://www.freedesktop.org/software/dbus/</ulink></para>
+</refsect1>
+</refentry>
diff --git a/doc/dbus-daemon.1.in b/doc/dbus-daemon.1.in
deleted file mode 100644
index 53856e91..00000000
--- a/doc/dbus-daemon.1.in
+++ /dev/null
@@ -1,766 +0,0 @@
-.\"
-.\" dbus\-daemon manual page.
-.\" Copyright (C) 2003,2008 Red Hat, Inc.
-.\"
-.TH dbus\-daemon 1
-.SH NAME
-dbus\-daemon \- Message bus daemon
-.SH SYNOPSIS
-.PP
-.B dbus\-daemon
-dbus\-daemon [\-\-version] [\-\-session] [\-\-system] [\-\-config\-file=FILE]
-[\-\-print\-address[=DESCRIPTOR]] [\-\-print\-pid[=DESCRIPTOR]] [\-\-fork]
-
-.SH DESCRIPTION
-\fIdbus\-daemon\fP is the D\-Bus message bus daemon. See
-http://www.freedesktop.org/software/dbus/ for more information about
-the big picture. D\-Bus is first a library that provides one\-to\-one
-communication between any two applications; \fIdbus\-daemon\fP is an
-application that uses this library to implement a message bus
-daemon. Multiple programs connect to the message bus daemon and can
-exchange messages with one another.
-.PP
-There are two standard message bus instances: the systemwide message bus
-(installed on many systems as the "messagebus" init service) and the
-per\-user\-login\-session message bus (started each time a user logs in).
-\fIdbus\-daemon\fP is used for both of these instances, but with
-a different configuration file.
-.PP
-The \-\-session option is equivalent to
-"\-\-config\-file=@EXPANDED_SYSCONFDIR@/dbus\-1/session.conf" and the \-\-system
-option is equivalent to
-"\-\-config\-file=@EXPANDED_SYSCONFDIR@/dbus\-1/system.conf". By creating
-additional configuration files and using the \-\-config\-file option,
-additional special\-purpose message bus daemons could be created.
-.PP
-The systemwide daemon is normally launched by an init script,
-standardly called simply "messagebus".
-.PP
-The systemwide daemon is largely used for broadcasting system events,
-such as changes to the printer queue, or adding/removing devices.
-.PP
-The per\-session daemon is used for various interprocess communication
-among desktop applications (however, it is not tied to X or the GUI
-in any way).
-.PP
-SIGHUP will cause the D\-Bus daemon to PARTIALLY reload its
-configuration file and to flush its user/group information caches. Some
-configuration changes would require kicking all apps off the bus; so they will
-only take effect if you restart the daemon. Policy changes should take effect
-with SIGHUP.
-
-.SH OPTIONS
-The following options are supported:
-.TP
-.I "\-\-config\-file=FILE"
-Use the given configuration file.
-.TP
-.I "\-\-fork"
-Force the message bus to fork and become a daemon, even if
-the configuration file does not specify that it should.
-In most contexts the configuration file already gets this
-right, though.
-.I "\-\-nofork"
-Force the message bus not to fork and become a daemon, even if
-the configuration file specifies that it should.
-.TP
-.I "\-\-print\-address[=DESCRIPTOR]"
-Print the address of the message bus to standard output, or
-to the given file descriptor. This is used by programs that
-launch the message bus.
-.TP
-.I "\-\-print\-pid[=DESCRIPTOR]"
-Print the process ID of the message bus to standard output, or
-to the given file descriptor. This is used by programs that
-launch the message bus.
-.TP
-.I "\-\-session"
-Use the standard configuration file for the per\-login\-session message
-bus.
-.TP
-.I "\-\-system"
-Use the standard configuration file for the systemwide message bus.
-.TP
-.I "\-\-version"
-Print the version of the daemon.
-.TP
-.I "\-\-introspect"
-Print the introspection information for all D\-Bus internal interfaces.
-.TP
-.I "\-\-address[=ADDRESS]"
-Set the address to listen on. This option overrides the address
-configured in the configuration file.
-.TP
-.I "\-\-systemd\-activation"
-Enable systemd\-style service activation. Only useful in conjunction
-with the systemd system and session manager on Linux.
-.TP
-.I "\-\-nopidfile"
-Don't write a PID file even if one is configured in the configuration
-files.
-
-.SH CONFIGURATION FILE
-
-A message bus daemon has a configuration file that specializes it
-for a particular application. For example, one configuration
-file might set up the message bus to be a systemwide message bus,
-while another might set it up to be a per\-user\-login\-session bus.
-.PP
-The configuration file also establishes resource limits, security
-parameters, and so forth.
-.PP
-The configuration file is not part of any interoperability
-specification and its backward compatibility is not guaranteed; this
-document is documentation, not specification.
-.PP
-The standard systemwide and per\-session message bus setups are
-configured in the files "@EXPANDED_SYSCONFDIR@/dbus\-1/system.conf" and
-"@EXPANDED_SYSCONFDIR@/dbus\-1/session.conf". These files normally
-<include> a system\-local.conf or session\-local.conf; you can put local
-overrides in those files to avoid modifying the primary configuration
-files.
-
-.PP
-The configuration file is an XML document. It must have the following
-doctype declaration:
-.nf
-
- <!DOCTYPE busconfig PUBLIC "\-//freedesktop//DTD D\-Bus Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-
-.fi
-
-.PP
-The following elements may be present in the configuration file.
-
-.TP
-.I "<busconfig>"
-
-.PP
-Root element.
-
-.TP
-.I "<type>"
-
-.PP
-The well\-known type of the message bus. Currently known values are
-"system" and "session"; if other values are set, they should be
-either added to the D\-Bus specification, or namespaced. The last
-<type> element "wins" (previous values are ignored). This element
-only controls which message bus specific environment variables are
-set in activated clients. Most of the policy that distinguishes a
-session bus from the system bus is controlled from the other elements
-in the configuration file.
-
-.PP
-If the well\-known type of the message bus is "session", then the
-DBUS_STARTER_BUS_TYPE environment variable will be set to "session"
-and the DBUS_SESSION_BUS_ADDRESS environment variable will be set
-to the address of the session bus. Likewise, if the type of the
-message bus is "system", then the DBUS_STARTER_BUS_TYPE environment
-variable will be set to "system" and the DBUS_SESSION_BUS_ADDRESS
-environment variable will be set to the address of the system bus
-(which is normally well known anyway).
-
-.PP
-Example: <type>session</type>
-
-.TP
-.I "<include>"
-
-.PP
-Include a file <include>filename.conf</include> at this point. If the
-filename is relative, it is located relative to the configuration file
-doing the including.
-
-.PP
-<include> has an optional attribute "ignore_missing=(yes|no)"
-which defaults to "no" if not provided. This attribute
-controls whether it's a fatal error for the included file
-to be absent.
-
-.TP
-.I "<includedir>"
-
-.PP
-Include all files in <includedir>foo.d</includedir> at this
-point. Files in the directory are included in undefined order.
-Only files ending in ".conf" are included.
-
-.PP
-This is intended to allow extension of the system bus by particular
-packages. For example, if CUPS wants to be able to send out
-notification of printer queue changes, it could install a file to
-@EXPANDED_SYSCONFDIR@/dbus\-1/system.d that allowed all apps to receive
-this message and allowed the printer daemon user to send it.
-
-.TP
-.I "<user>"
-
-.PP
-The user account the daemon should run as, as either a username or a
-UID. If the daemon cannot change to this UID on startup, it will exit.
-If this element is not present, the daemon will not change or care
-about its UID.
-
-.PP
-The last <user> entry in the file "wins", the others are ignored.
-
-.PP
-The user is changed after the bus has completed initialization. So
-sockets etc. will be created before changing user, but no data will be
-read from clients before changing user. This means that sockets
-and PID files can be created in a location that requires root
-privileges for writing.
-
-.TP
-.I "<fork>"
-
-.PP
-If present, the bus daemon becomes a real daemon (forks
-into the background, etc.). This is generally used
-rather than the \-\-fork command line option.
-
-.TP
-.I "<keep_umask>"
-
-.PP
-If present, the bus daemon keeps its original umask when forking.
-This may be useful to avoid affecting the behavior of child processes.
-
-.TP
-.I "<listen>"
-
-.PP
-Add an address that the bus should listen on. The
-address is in the standard D\-Bus format that contains
-a transport name plus possible parameters/options.
-
-.PP
-Example: <listen>unix:path=/tmp/foo</listen>
-
-.PP
-Example: <listen>tcp:host=localhost,port=1234</listen>
-
-.PP
-If there are multiple <listen> elements, then the bus listens
-on multiple addresses. The bus will pass its address to
-started services or other interested parties with
-the last address given in <listen> first. That is,
-apps will try to connect to the last <listen> address first.
-
-.PP
-tcp sockets can accept IPv4 addresses, IPv6 addresses or hostnames.
-If a hostname resolves to multiple addresses, the server will bind
-to all of them. The family=ipv4 or family=ipv6 options can be used
-to force it to bind to a subset of addresses
-
-.PP
-Example: <listen>tcp:host=localhost,port=0,family=ipv4</listen>
-
-.PP
-A special case is using a port number of zero (or omitting the port),
-which means to choose an available port selected by the operating
-system. The port number chosen can be obtained with the
-\-\-print\-address command line parameter and will be present in other
-cases where the server reports its own address, such as when
-DBUS_SESSION_BUS_ADDRESS is set.
-
-.PP
-Example: <listen>tcp:host=localhost,port=0</listen>
-
-.PP
-tcp addresses also allow a bind=hostname option, which will override
-the host option specifying what address to bind to, without changing
-the address reported by the bus. The bind option can also take a
-special name '*' to cause the bus to listen on all local address
-(INADDR_ANY). The specified host should be a valid name of the local
-machine or weird stuff will happen.
-
-.PP
-Example: <listen>tcp:host=localhost,bind=*,port=0</listen>
-
-.TP
-.I "<auth>"
-
-.PP
-Lists permitted authorization mechanisms. If this element doesn't
-exist, then all known mechanisms are allowed. If there are multiple
-<auth> elements, all the listed mechanisms are allowed. The order in
-which mechanisms are listed is not meaningful.
-
-.PP
-Example: <auth>EXTERNAL</auth>
-
-.PP
-Example: <auth>DBUS_COOKIE_SHA1</auth>
-
-.TP
-.I "<servicedir>"
-
-.PP
-Adds a directory to scan for .service files. Directories are
-scanned starting with the last to appear in the config file
-(the first .service file found that provides a particular
-service will be used).
-
-.PP
-Service files tell the bus how to automatically start a program.
-They are primarily used with the per\-user\-session bus,
-not the systemwide bus.
-
-.TP
-.I "<standard_session_servicedirs/>"
-
-.PP
-<standard_session_servicedirs/> is equivalent to specifying a series
-of <servicedir/> elements for each of the data directories in the "XDG
-Base Directory Specification" with the subdirectory "dbus\-1/services",
-so for example "/usr/share/dbus\-1/services" would be among the
-directories searched.
-
-.PP
-The "XDG Base Directory Specification" can be found at
-http://freedesktop.org/wiki/Standards/basedir\-spec if it hasn't moved,
-otherwise try your favorite search engine.
-
-.PP
-The <standard_session_servicedirs/> option is only relevant to the
-per\-user\-session bus daemon defined in
-@EXPANDED_SYSCONFDIR@/dbus\-1/session.conf. Putting it in any other
-configuration file would probably be nonsense.
-
-.TP
-.I "<standard_system_servicedirs/>"
-
-.PP
-<standard_system_servicedirs/> specifies the standard system\-wide
-activation directories that should be searched for service files.
-This option defaults to @EXPANDED_DATADIR@/dbus\-1/system\-services.
-
-.PP
-The <standard_system_servicedirs/> option is only relevant to the
-per\-system bus daemon defined in
-@EXPANDED_SYSCONFDIR@/dbus\-1/system.conf. Putting it in any other
-configuration file would probably be nonsense.
-
-.TP
-.I "<servicehelper/>"
-
-.PP
-<servicehelper/> specifies the setuid helper that is used to launch
-system daemons with an alternate user. Typically this should be
-the dbus\-daemon\-launch\-helper executable in located in libexec.
-
-.PP
-The <servicehelper/> option is only relevant to the per\-system bus daemon
-defined in @EXPANDED_SYSCONFDIR@/dbus\-1/system.conf. Putting it in any other
-configuration file would probably be nonsense.
-
-.TP
-.I "<limit>"
-
-.PP
-<limit> establishes a resource limit. For example:
-.nf
- <limit name="max_message_size">64</limit>
- <limit name="max_completed_connections">512</limit>
-.fi
-
-.PP
-The name attribute is mandatory.
-Available limit names are:
-.nf
- "max_incoming_bytes" : total size in bytes of messages
- incoming from a single connection
- "max_incoming_unix_fds" : total number of unix fds of messages
- incoming from a single connection
- "max_outgoing_bytes" : total size in bytes of messages
- queued up for a single connection
- "max_outgoing_unix_fds" : total number of unix fds of messages
- queued up for a single connection
- "max_message_size" : max size of a single message in
- bytes
- "max_message_unix_fds" : max unix fds of a single message
- "service_start_timeout" : milliseconds (thousandths) until
- a started service has to connect
- "auth_timeout" : milliseconds (thousandths) a
- connection is given to
- authenticate
- "max_completed_connections" : max number of authenticated connections
- "max_incomplete_connections" : max number of unauthenticated
- connections
- "max_connections_per_user" : max number of completed connections from
- the same user
- "max_pending_service_starts" : max number of service launches in
- progress at the same time
- "max_names_per_connection" : max number of names a single
- connection can own
- "max_match_rules_per_connection": max number of match rules for a single
- connection
- "max_replies_per_connection" : max number of pending method
- replies per connection
- (number of calls\-in\-progress)
- "reply_timeout" : milliseconds (thousandths)
- until a method call times out
-.fi
-
-.PP
-The max incoming/outgoing queue sizes allow a new message to be queued
-if one byte remains below the max. So you can in fact exceed the max
-by max_message_size.
-
-.PP
-max_completed_connections divided by max_connections_per_user is the
-number of users that can work together to denial\-of\-service all other users by using
-up all connections on the systemwide bus.
-
-.PP
-Limits are normally only of interest on the systemwide bus, not the user session
-buses.
-
-.TP
-.I "<policy>"
-
-.PP
-The <policy> element defines a security policy to be applied to a particular
-set of connections to the bus. A policy is made up of
-<allow> and <deny> elements. Policies are normally used with the systemwide bus;
-they are analogous to a firewall in that they allow expected traffic
-and prevent unexpected traffic.
-
-.PP
-Currently, the system bus has a default\-deny policy for sending method calls
-and owning bus names. Everything else, in particular reply messages, receive
-checks, and signals has a default allow policy.
-
-.PP
-In general, it is best to keep system services as small, targeted programs which
-run in their own process and provide a single bus name. Then, all that is needed
-is an <allow> rule for the "own" permission to let the process claim the bus
-name, and a "send_destination" rule to allow traffic from some or all uids to
-your service.
-
-.PP
-The <policy> element has one of four attributes:
-.nf
- context="(default|mandatory)"
- at_console="(true|false)"
- user="username or userid"
- group="group name or gid"
-.fi
-
-.PP
-Policies are applied to a connection as follows:
-.nf
- \- all context="default" policies are applied
- \- all group="connection's user's group" policies are applied
- in undefined order
- \- all user="connection's auth user" policies are applied
- in undefined order
- \- all at_console="true" policies are applied
- \- all at_console="false" policies are applied
- \- all context="mandatory" policies are applied
-.fi
-
-.PP
-Policies applied later will override those applied earlier,
-when the policies overlap. Multiple policies with the same
-user/group/context are applied in the order they appear
-in the config file.
-
-.TP
-.I "<deny>"
-.I "<allow>"
-
-.PP
-A <deny> element appears below a <policy> element and prohibits some
-action. The <allow> element makes an exception to previous <deny>
-statements, and works just like <deny> but with the inverse meaning.
-
-.PP
-The possible attributes of these elements are:
-.nf
- send_interface="interface_name"
- send_member="method_or_signal_name"
- send_error="error_name"
- send_destination="name"
- send_type="method_call" | "method_return" | "signal" | "error"
- send_path="/path/name"
-
- receive_interface="interface_name"
- receive_member="method_or_signal_name"
- receive_error="error_name"
- receive_sender="name"
- receive_type="method_call" | "method_return" | "signal" | "error"
- receive_path="/path/name"
-
- send_requested_reply="true" | "false"
- receive_requested_reply="true" | "false"
-
- eavesdrop="true" | "false"
-
- own="name"
- own_prefix="name"
- user="username"
- group="groupname"
-.fi
-
-.PP
-Examples:
-.nf
- <deny send_destination="org.freedesktop.Service" send_interface="org.freedesktop.System" send_member="Reboot"/>
- <deny send_destination="org.freedesktop.System"/>
- <deny receive_sender="org.freedesktop.System"/>
- <deny user="john"/>
- <deny group="enemies"/>
-.fi
-
-.PP
-The <deny> element's attributes determine whether the deny "matches" a
-particular action. If it matches, the action is denied (unless later
-rules in the config file allow it).
-.PP
-send_destination and receive_sender rules mean that messages may not be
-sent to or received from the *owner* of the given name, not that
-they may not be sent *to that name*. That is, if a connection
-owns services A, B, C, and sending to A is denied, sending to B or C
-will not work either.
-.PP
-The other send_* and receive_* attributes are purely textual/by\-value
-matches against the given field in the message header.
-.PP
-"Eavesdropping" occurs when an application receives a message that
-was explicitly addressed to a name the application does not own, or
-is a reply to such a message. Eavesdropping thus only applies to
-messages that are addressed to services and replies to such messages
-(i.e. it does not apply to signals).
-.PP
-For <allow>, eavesdrop="true" indicates that the rule matches even
-when eavesdropping. eavesdrop="false" is the default and means that
-the rule only allows messages to go to their specified recipient.
-For <deny>, eavesdrop="true" indicates that the rule matches
-only when eavesdropping. eavesdrop="false" is the default for <deny>
-also, but here it means that the rule applies always, even when
-not eavesdropping. The eavesdrop attribute can only be combined with
-send and receive rules (with send_* and receive_* attributes).
-.PP
-The [send|receive]_requested_reply attribute works similarly to the eavesdrop
-attribute. It controls whether the <deny> or <allow> matches a reply
-that is expected (corresponds to a previous method call message).
-This attribute only makes sense for reply messages (errors and method
-returns), and is ignored for other message types.
-
-.PP
-For <allow>, [send|receive]_requested_reply="true" is the default and indicates that
-only requested replies are allowed by the
-rule. [send|receive]_requested_reply="false" means that the rule allows any reply
-even if unexpected.
-
-.PP
-For <deny>, [send|receive]_requested_reply="false" is the default but indicates that
-the rule matches only when the reply was not
-requested. [send|receive]_requested_reply="true" indicates that the rule applies
-always, regardless of pending reply state.
-
-.PP
-user and group denials mean that the given user or group may
-not connect to the message bus.
-
-.PP
-For "name", "username", "groupname", etc.
-the character "*" can be substituted, meaning "any." Complex globs
-like "foo.bar.*" aren't allowed for now because they'd be work to
-implement and maybe encourage sloppy security anyway.
-
-.PP
-<allow own_prefix="a.b"/> allows you to own the name "a.b" or any
-name whose first dot-separated elements are "a.b": in particular,
-you can own "a.b.c" or "a.b.c.d", but not "a.bc" or "a.c".
-This is useful when services like Telepathy and ReserveDevice
-define a meaning for subtrees of well-known names, such as
-org.freedesktop.Telepathy.ConnectionManager.(anything)
-and org.freedesktop.ReserveDevice1.(anything).
-
-.PP
-It does not make sense to deny a user or group inside a <policy>
-for a user or group; user/group denials can only be inside
-context="default" or context="mandatory" policies.
-
-.PP
-A single <deny> rule may specify combinations of attributes such as
-send_destination and send_interface and send_type. In this case, the
-denial applies only if both attributes match the message being denied.
-e.g. <deny send_interface="foo.bar" send_destination="foo.blah"/> would
-deny messages with the given interface AND the given bus name.
-To get an OR effect you specify multiple <deny> rules.
-
-.PP
-You can't include both send_ and receive_ attributes on the same
-rule, since "whether the message can be sent" and "whether it can be
-received" are evaluated separately.
-
-.PP
-Be careful with send_interface/receive_interface, because the
-interface field in messages is optional. In particular, do NOT
-specify <deny send_interface="org.foo.Bar"/>! This will cause
-no\-interface messages to be blocked for all services, which is
-almost certainly not what you intended. Always use rules of
-the form: <deny send_interface="org.foo.Bar" send_destination="org.foo.Service"/>
-
-.TP
-.I "<selinux>"
-
-.PP
-The <selinux> element contains settings related to Security Enhanced Linux.
-More details below.
-
-.TP
-.I "<associate>"
-
-.PP
-An <associate> element appears below an <selinux> element and
-creates a mapping. Right now only one kind of association is possible:
-.nf
- <associate own="org.freedesktop.Foobar" context="foo_t"/>
-.fi
-
-.PP
-This means that if a connection asks to own the name
-"org.freedesktop.Foobar" then the source context will be the context
-of the connection and the target context will be "foo_t" \- see the
-short discussion of SELinux below.
-
-.PP
-Note, the context here is the target context when requesting a name,
-NOT the context of the connection owning the name.
-
-.PP
-There's currently no way to set a default for owning any name, if
-we add this syntax it will look like:
-.nf
- <associate own="*" context="foo_t"/>
-.fi
-If you find a reason this is useful, let the developers know.
-Right now the default will be the security context of the bus itself.
-
-.PP
-If two <associate> elements specify the same name, the element
-appearing later in the configuration file will be used.
-
-.SH SELinux
-
-.PP
-See http://www.nsa.gov/selinux/ for full details on SELinux. Some useful excerpts:
-
-.IP "" 8
-Every subject (process) and object (e.g. file, socket, IPC object,
-etc) in the system is assigned a collection of security attributes,
-known as a security context. A security context contains all of the
-security attributes associated with a particular subject or object
-that are relevant to the security policy.
-
-.IP "" 8
-In order to better encapsulate security contexts and to provide
-greater efficiency, the policy enforcement code of SELinux typically
-handles security identifiers (SIDs) rather than security contexts. A
-SID is an integer that is mapped by the security server to a security
-context at runtime.
-
-.IP "" 8
-When a security decision is required, the policy enforcement code
-passes a pair of SIDs (typically the SID of a subject and the SID of
-an object, but sometimes a pair of subject SIDs or a pair of object
-SIDs), and an object security class to the security server. The object
-security class indicates the kind of object, e.g. a process, a regular
-file, a directory, a TCP socket, etc.
-
-.IP "" 8
-Access decisions specify whether or not a permission is granted for a
-given pair of SIDs and class. Each object class has a set of
-associated permissions defined to control operations on objects with
-that class.
-
-.PP
-D\-Bus performs SELinux security checks in two places.
-
-.PP
-First, any time a message is routed from one connection to another
-connection, the bus daemon will check permissions with the security context of
-the first connection as source, security context of the second connection
-as target, object class "dbus" and requested permission "send_msg".
-
-.PP
-If a security context is not available for a connection
-(impossible when using UNIX domain sockets), then the target
-context used is the context of the bus daemon itself.
-There is currently no way to change this default, because we're
-assuming that only UNIX domain sockets will be used to
-connect to the systemwide bus. If this changes, we'll
-probably add a way to set the default connection context.
-
-.PP
-Second, any time a connection asks to own a name,
-the bus daemon will check permissions with the security
-context of the connection as source, the security context specified
-for the name in the config file as target, object
-class "dbus" and requested permission "acquire_svc".
-
-.PP
-The security context for a bus name is specified with the
-<associate> element described earlier in this document.
-If a name has no security context associated in the
-configuration file, the security context of the bus daemon
-itself will be used.
-
-.SH DEBUGGING
-
-.PP
-If you're trying to figure out where your messages are going or why
-you aren't getting messages, there are several things you can try.
-.PP
-Remember that the system bus is heavily locked down and if you
-haven't installed a security policy file to allow your message
-through, it won't work. For the session bus, this is not a concern.
-.PP
-The simplest way to figure out what's happening on the bus is to run
-the \fIdbus\-monitor\fP program, which comes with the D\-Bus
-package. You can also send test messages with \fIdbus\-send\fP. These
-programs have their own man pages.
-.PP
-If you want to know what the daemon itself is doing, you might consider
-running a separate copy of the daemon to test against. This will allow you
-to put the daemon under a debugger, or run it with verbose output, without
-messing up your real session and system daemons.
-.PP
-To run a separate test copy of the daemon, for example you might open a terminal
-and type:
-.nf
- DBUS_VERBOSE=1 dbus\-daemon \-\-session \-\-print\-address
-.fi
-.PP
-The test daemon address will be printed when the daemon starts. You will need
-to copy\-and\-paste this address and use it as the value of the
-DBUS_SESSION_BUS_ADDRESS environment variable when you launch the applications
-you want to test. This will cause those applications to connect to your
-test bus instead of the DBUS_SESSION_BUS_ADDRESS of your real session bus.
-.PP
-DBUS_VERBOSE=1 will have NO EFFECT unless your copy of D\-Bus
-was compiled with verbose mode enabled. This is not recommended in
-production builds due to performance impact. You may need to rebuild
-D\-Bus if your copy was not built with debugging in mind. (DBUS_VERBOSE
-also affects the D\-Bus library and thus applications using D\-Bus; it may
-be useful to see verbose output on both the client side and from the daemon.)
-.PP
-If you want to get fancy, you can create a custom bus
-configuration for your test bus (see the session.conf and system.conf
-files that define the two default configurations for example). This
-would allow you to specify a different directory for .service files,
-for example.
-
-.SH AUTHOR
-See http://www.freedesktop.org/software/dbus/doc/AUTHORS
-
-.SH BUGS
-Please send bug reports to the D\-Bus mailing list or bug tracker,
-see http://www.freedesktop.org/software/dbus/
diff --git a/cmake/bus/dbus-daemon.xml b/doc/dbus-daemon.1.xml.in
index f331699c..cd7942c3 100644
--- a/cmake/bus/dbus-daemon.xml
+++ b/doc/dbus-daemon.1.xml.in
@@ -1,17 +1,19 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
- "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
-<!-- lifted from troff+man by doclifter -->
-<refentry id='dbus-daemon'>
-<!-- -->
-<!-- dbus\-daemon manual page. -->
-<!-- Copyright (C) 2003 Red Hat, Inc. -->
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+ "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<refentry id='dbusdaemon1'>
+
+<!-- dbus&bsol;-daemon manual page.
+ Copyright (C) 2003,2008 Red Hat, Inc. -->
<refmeta>
<refentrytitle>dbus-daemon</refentrytitle>
<manvolnum>1</manvolnum>
+<refmiscinfo class="manual">User Commands</refmiscinfo>
+<refmiscinfo class="source">D-Bus</refmiscinfo>
+<refmiscinfo class="version">@DBUS_VERSION@</refmiscinfo>
</refmeta>
-<refnamediv id='name'>
+<refnamediv>
<refname>dbus-daemon</refname>
<refpurpose>Message bus daemon</refpurpose>
</refnamediv>
@@ -41,35 +43,29 @@ application that uses this library to implement a message bus
daemon. Multiple programs connect to the message bus daemon and can
exchange messages with one another.</para>
-
-<para>There are two standard message bus instances: the systemwide message bus
-(installed on many systems as the "messagebus" init service) and the
+<para>There are two standard message bus instances: the systemwide message bus
+(installed on many systems as the "messagebus" init service) and the
per-user-login-session message bus (started each time a user logs in).
-<command>dbus-daemon</command> is used for both of these instances, but with
+<command>dbus-daemon</command> is used for both of these instances, but with
a different configuration file.</para>
-
<para>The --session option is equivalent to
-"--config-file=/etc/dbus-1/session.conf" and the --system
+"--config-file=@EXPANDED_SYSCONFDIR@/dbus-1/session.conf" and the --system
option is equivalent to
-"--config-file=/etc/dbus-1/system.conf". By creating
+"--config-file=@EXPANDED_SYSCONFDIR@/dbus-1/system.conf". By creating
additional configuration files and using the --config-file option,
additional special-purpose message bus daemons could be created.</para>
+<para>The systemwide daemon is normally launched by an init script,
+standardly called simply "messagebus".</para>
-<para>The systemwide daemon is normally launched by an init script,
-standardly called simply "messagebus".</para>
-
-
-<para>The systemwide daemon is largely used for broadcasting system events,
+<para>The systemwide daemon is largely used for broadcasting system events,
such as changes to the printer queue, or adding/removing devices.</para>
-
-<para>The per-session daemon is used for various interprocess communication
-among desktop applications (however, it is not tied to X or the GUI
+<para>The per-session daemon is used for various interprocess communication
+among desktop applications (however, it is not tied to X or the GUI
in any way).</para>
-
<para>SIGHUP will cause the D-Bus daemon to PARTIALLY reload its
configuration file and to flush its user/group information caches. Some
configuration changes would require kicking all apps off the bus; so they will
@@ -90,25 +86,34 @@ with SIGHUP.</para>
<varlistentry>
<term><option>--fork</option></term>
<listitem>
-<para>Force the message bus to fork and become a daemon, even if
+<para>Force the message bus to fork and become a daemon, even if
the configuration file does not specify that it should.
In most contexts the configuration file already gets this
-right, though.</para>
+right, though. This option is not supported on Windows.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--nofork</option></term>
+ <listitem>
+ <para>Force the message bus not to fork and become a daemon, even if
+ the configuration file specifies that it should. On Windows,
+ the dbus-daemon never forks, so this option is allowed but does
+ nothing.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--print-address[=DESCRIPTOR]</option></term>
<listitem>
-<para>Print the address of the message bus to standard output, or
-to the given file descriptor. This is used by programs that
+<para>Print the address of the message bus to standard output, or
+to the given file descriptor. This is used by programs that
launch the message bus.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--print-pid[=DESCRIPTOR]</option></term>
<listitem>
-<para>Print the process ID of the message bus to standard output, or
-to the given file descriptor. This is used by programs that
+<para>Print the process ID of the message bus to standard output, or
+to the given file descriptor. This is used by programs that
launch the message bus.</para>
</listitem>
</varlistentry>
@@ -129,6 +134,33 @@ bus.</para>
<term><option>--version</option></term>
<listitem>
<para>Print the version of the daemon.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--introspect</option></term>
+ <listitem>
+<para>Print the introspection information for all D-Bus internal interfaces.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--address[=ADDRESS]</option></term>
+ <listitem>
+<para>Set the address to listen on. This option overrides the address
+configured in the configuration file.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--systemd-activation</option></term>
+ <listitem>
+<para>Enable systemd-style service activation. Only useful in conjunction
+with the systemd system and session manager on Linux.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--nopidfile</option></term>
+ <listitem>
+<para>Don't write a PID file even if one is configured in the configuration
+files.</para>
</listitem>
</varlistentry>
@@ -137,23 +169,20 @@ bus.</para>
<refsect1 id='configuration_file'><title>CONFIGURATION FILE</title>
<para>A message bus daemon has a configuration file that specializes it
-for a particular application. For example, one configuration
-file might set up the message bus to be a systemwide message bus,
+for a particular application. For example, one configuration
+file might set up the message bus to be a systemwide message bus,
while another might set it up to be a per-user-login-session bus.</para>
-
<para>The configuration file also establishes resource limits, security
parameters, and so forth.</para>
-
<para>The configuration file is not part of any interoperability
specification and its backward compatibility is not guaranteed; this
document is documentation, not specification.</para>
-
<para>The standard systemwide and per-session message bus setups are
-configured in the files "/etc/dbus-1/system.conf" and
-"/etc/dbus-1/session.conf". These files normally
+configured in the files "@EXPANDED_SYSCONFDIR@/dbus-1/system.conf" and
+"@EXPANDED_SYSCONFDIR@/dbus-1/session.conf". These files normally
&lt;include&gt; a system-local.conf or session-local.conf; you can put local
overrides in those files to avoid modifying the primary configuration
files.</para>
@@ -171,43 +200,50 @@ doctype declaration:</para>
<para>The following elements may be present in the configuration file.</para>
-<variablelist remap='TP'>
- <varlistentry>
- <term><emphasis remap='I'>&lt;busconfig&gt;</emphasis></term>
- <listitem>
-<para></para>
- </listitem>
- </varlistentry>
-</variablelist>
+<itemizedlist remap='TP'>
+
+ <listitem><para><emphasis remap='I'>&lt;busconfig&gt;</emphasis></para></listitem>
+
+
+</itemizedlist>
<para>Root element.</para>
-<variablelist remap='TP'>
- <varlistentry>
- <term><emphasis remap='I'>&lt;type&gt;</emphasis></term>
- <listitem>
+<itemizedlist remap='TP'>
-<para></para> <!-- FIXME: blank list item -->
- </listitem>
- </varlistentry>
-</variablelist>
+ <listitem><para><emphasis remap='I'>&lt;type&gt;</emphasis></para></listitem>
+
+
+</itemizedlist>
<para>The well-known type of the message bus. Currently known values are
"system" and "session"; if other values are set, they should be
either added to the D-Bus specification, or namespaced. The last
-&lt;type&gt; element "wins" (previous values are ignored).</para>
+&lt;type&gt; element "wins" (previous values are ignored). This element
+only controls which message bus specific environment variables are
+set in activated clients. Most of the policy that distinguishes a
+session bus from the system bus is controlled from the other elements
+in the configuration file.</para>
+
+
+<para>If the well-known type of the message bus is "session", then the
+DBUS_STARTER_BUS_TYPE environment variable will be set to "session"
+and the DBUS_SESSION_BUS_ADDRESS environment variable will be set
+to the address of the session bus. Likewise, if the type of the
+message bus is "system", then the DBUS_STARTER_BUS_TYPE environment
+variable will be set to "system" and the DBUS_SESSION_BUS_ADDRESS
+environment variable will be set to the address of the system bus
+(which is normally well known anyway).</para>
<para>Example: &lt;type&gt;session&lt;/type&gt;</para>
-<variablelist remap='TP'>
- <varlistentry>
- <term><emphasis remap='I'>&lt;include&gt;</emphasis></term>
- <listitem>
-<para></para>
- </listitem>
- </varlistentry>
-</variablelist>
+<itemizedlist remap='TP'>
+
+ <listitem><para><emphasis remap='I'>&lt;include&gt;</emphasis></para></listitem>
+
+
+</itemizedlist>
<para>Include a file &lt;include&gt;filename.conf&lt;/include&gt; at this point. If the
filename is relative, it is located relative to the configuration file
@@ -215,19 +251,16 @@ doing the including.</para>
<para>&lt;include&gt; has an optional attribute "ignore_missing=(yes|no)"
-which defaults to "no" if not provided. This attribute
-controls whether it's a fatal error for the included file
+which defaults to "no" if not provided. This attribute
+controls whether it's a fatal error for the included file
to be absent.</para>
-<variablelist remap='TP'>
- <varlistentry>
- <term><emphasis remap='I'>&lt;includedir&gt;</emphasis></term>
- <listitem>
+<itemizedlist remap='TP'>
-<para></para> <!-- FIXME: blank list item -->
- </listitem>
- </varlistentry>
-</variablelist>
+ <listitem><para><emphasis remap='I'>&lt;includedir&gt;</emphasis></para></listitem>
+
+
+</itemizedlist>
<para>Include all files in &lt;includedir&gt;foo.d&lt;/includedir&gt; at this
point. Files in the directory are included in undefined order.
@@ -237,18 +270,15 @@ Only files ending in ".conf" are included.</para>
<para>This is intended to allow extension of the system bus by particular
packages. For example, if CUPS wants to be able to send out
notification of printer queue changes, it could install a file to
-/etc/dbus-1/system.d that allowed all apps to receive
+@EXPANDED_SYSCONFDIR@/dbus-1/system.d that allowed all apps to receive
this message and allowed the printer daemon user to send it.</para>
-<variablelist remap='TP'>
- <varlistentry>
- <term><emphasis remap='I'>&lt;user&gt;</emphasis></term>
- <listitem>
+<itemizedlist remap='TP'>
+
+ <listitem><para><emphasis remap='I'>&lt;user&gt;</emphasis></para></listitem>
-<para></para> <!-- FIXME: blank list item -->
- </listitem>
- </varlistentry>
-</variablelist>
+
+</itemizedlist>
<para>The user account the daemon should run as, as either a username or a
UID. If the daemon cannot change to this UID on startup, it will exit.
@@ -261,97 +291,159 @@ about its UID.</para>
<para>The user is changed after the bus has completed initialization. So
sockets etc. will be created before changing user, but no data will be
-read from clients before changing user. This means that sockets
-and PID files can be created in a location that requires root
+read from clients before changing user. This means that sockets
+and PID files can be created in a location that requires root
privileges for writing.</para>
-<variablelist remap='TP'>
- <varlistentry>
- <term><emphasis remap='I'>&lt;fork&gt;</emphasis></term>
- <listitem>
-<para></para>
- </listitem>
- </varlistentry>
-</variablelist>
+<itemizedlist remap='TP'>
+
+ <listitem><para><emphasis remap='I'>&lt;fork&gt;</emphasis></para></listitem>
+
+
+</itemizedlist>
-<para>If present, the bus daemon becomes a real daemon (forks
-into the background, etc.). This is generally used
+<para>If present, the bus daemon becomes a real daemon (forks
+into the background, etc.). This is generally used
rather than the --fork command line option.</para>
-<variablelist remap='TP'>
- <varlistentry>
- <term><emphasis remap='I'>&lt;listen&gt;</emphasis></term>
- <listitem>
+<itemizedlist remap='TP'>
-<para></para> <!-- FIXME: blank list item -->
- </listitem>
- </varlistentry>
-</variablelist>
+ <listitem><para><emphasis remap='I'>&lt;keep_umask&gt;</emphasis></para></listitem>
+
+
+</itemizedlist>
+
+<para>If present, the bus daemon keeps its original umask when forking.
+This may be useful to avoid affecting the behavior of child processes.</para>
+
+<itemizedlist remap='TP'>
+
+ <listitem><para><emphasis remap='I'>&lt;syslog&gt;</emphasis></para></listitem>
+
+
+</itemizedlist>
+
+<para>If present, the bus daemon will log to syslog.</para>
+
+<itemizedlist remap='TP'>
+
+ <listitem><para><emphasis remap='I'>&lt;pidfile&gt;</emphasis></para></listitem>
+
+
+</itemizedlist>
+
+<para>If present, the bus daemon will write its pid to the specified file.
+The --nopidfile command-line option takes precedence over this setting.</para>
+
+<itemizedlist remap='TP'>
+
+ <listitem><para><emphasis remap='I'>&lt;allow_anonymous&gt;</emphasis></para></listitem>
+
+
+</itemizedlist>
+
+<para>If present, connections that authenticated using the ANONYMOUS
+mechanism will be authorized to connect. This option has no practical
+effect unless the ANONYMOUS mechanism has also been enabled using the
+<emphasis remap='I'>&lt;auth&gt;</emphasis> element, described below.</para>
+
+<itemizedlist remap='TP'>
+
+ <listitem><para><emphasis remap='I'>&lt;listen&gt;</emphasis></para></listitem>
+
+
+</itemizedlist>
-<para>Add an address that the bus should listen on. The
-address is in the standard D-Bus format that contains
+<para>Add an address that the bus should listen on. The
+address is in the standard D-Bus format that contains
a transport name plus possible parameters/options.</para>
<para>Example: &lt;listen&gt;unix:path=/tmp/foo&lt;/listen&gt;</para>
-<para>If there are multiple &lt;listen&gt; elements, then the bus listens
-on multiple addresses. The bus will pass its address to
-started services or other interested parties with
-the last address given in &lt;listen&gt; first. That is,
+<para>Example: &lt;listen&gt;tcp:host=localhost,port=1234&lt;/listen&gt;</para>
+
+
+<para>If there are multiple &lt;listen&gt; elements, then the bus listens
+on multiple addresses. The bus will pass its address to
+started services or other interested parties with
+the last address given in &lt;listen&gt; first. That is,
apps will try to connect to the last &lt;listen&gt; address first.</para>
-<variablelist remap='TP'>
- <varlistentry>
- <term><emphasis remap='I'>&lt;auth&gt;</emphasis></term>
- <listitem>
-<para></para> <!-- FIXME: blank list item -->
- </listitem>
- </varlistentry>
-</variablelist>
+<para>tcp sockets can accept IPv4 addresses, IPv6 addresses or hostnames.
+If a hostname resolves to multiple addresses, the server will bind
+to all of them. The family=ipv4 or family=ipv6 options can be used
+to force it to bind to a subset of addresses</para>
+
+
+<para>Example: &lt;listen&gt;tcp:host=localhost,port=0,family=ipv4&lt;/listen&gt;</para>
+
+
+<para>A special case is using a port number of zero (or omitting the port),
+which means to choose an available port selected by the operating
+system. The port number chosen can be obtained with the
+--print-address command line parameter and will be present in other
+cases where the server reports its own address, such as when
+DBUS_SESSION_BUS_ADDRESS is set.</para>
+
+
+<para>Example: &lt;listen&gt;tcp:host=localhost,port=0&lt;/listen&gt;</para>
+
+
+<para>tcp/nonce-tcp addresses also allow a bind=hostname option,
+used in a listenable address to configure the interface on which
+the server will listen: either the hostname is the IP address of
+one of the local machine's interfaces (most commonly 127.0.0.1),
+or a DNS name that resolves to one of those IP addresses, or '*'
+to listen on all interfaces simultaneously. If not specified,
+the default is the same value as "host".</para>
+
+
+<para>Example: &lt;listen&gt;tcp:host=localhost,bind=*,port=0&lt;/listen&gt;</para>
+
+<itemizedlist remap='TP'>
+
+ <listitem><para><emphasis remap='I'>&lt;auth&gt;</emphasis></para></listitem>
+
+
+</itemizedlist>
<para>Lists permitted authorization mechanisms. If this element doesn't
exist, then all known mechanisms are allowed. If there are multiple
&lt;auth&gt; elements, all the listed mechanisms are allowed. The order in
which mechanisms are listed is not meaningful.</para>
-
+
<para>Example: &lt;auth&gt;EXTERNAL&lt;/auth&gt;</para>
<para>Example: &lt;auth&gt;DBUS_COOKIE_SHA1&lt;/auth&gt;</para>
-<variablelist remap='TP'>
- <varlistentry>
- <term><emphasis remap='I'>&lt;servicedir&gt;</emphasis></term>
- <listitem>
+<itemizedlist remap='TP'>
+
+ <listitem><para><emphasis remap='I'>&lt;servicedir&gt;</emphasis></para></listitem>
-<para></para> <!-- FIXME: blank list item -->
- </listitem>
- </varlistentry>
-</variablelist>
+
+</itemizedlist>
<para>Adds a directory to scan for .service files. Directories are
-scanned starting with the last to appear in the config file
-(the first .service file found that provides a particular
+scanned starting with the first to appear in the config file
+(the first .service file found that provides a particular
service will be used).</para>
<para>Service files tell the bus how to automatically start a program.
-They are primarily used with the per-user-session bus,
+They are primarily used with the per-user-session bus,
not the systemwide bus.</para>
-<variablelist remap='TP'>
- <varlistentry>
- <term><emphasis remap='I'>&lt;standard_session_servicedirs/&gt;</emphasis></term>
- <listitem>
+<itemizedlist remap='TP'>
-<para></para> <!-- FIXME: blank list item -->
- </listitem>
- </varlistentry>
-</variablelist>
+ <listitem><para><emphasis remap='I'>&lt;standard_session_servicedirs/&gt;</emphasis></para></listitem>
+
+
+</itemizedlist>
<para>&lt;standard_session_servicedirs/&gt; is equivalent to specifying a series
of &lt;servicedir/&gt; elements for each of the data directories in the "XDG
@@ -367,18 +459,48 @@ otherwise try your favorite search engine.</para>
<para>The &lt;standard_session_servicedirs/&gt; option is only relevant to the
per-user-session bus daemon defined in
-/etc/dbus-1/session.conf. Putting it in any other
+@EXPANDED_SYSCONFDIR@/dbus-1/session.conf. Putting it in any other
configuration file would probably be nonsense.</para>
-<variablelist remap='TP'>
- <varlistentry>
- <term><emphasis remap='I'>&lt;limit&gt;</emphasis></term>
- <listitem>
+<itemizedlist remap='TP'>
-<para></para> <!-- FIXME: blank list item -->
- </listitem>
- </varlistentry>
-</variablelist>
+ <listitem><para><emphasis remap='I'>&lt;standard_system_servicedirs/&gt;</emphasis></para></listitem>
+
+
+</itemizedlist>
+
+<para>&lt;standard_system_servicedirs/&gt; specifies the standard system-wide
+activation directories that should be searched for service files.
+This option defaults to @EXPANDED_DATADIR@/dbus-1/system-services.</para>
+
+
+<para>The &lt;standard_system_servicedirs/&gt; option is only relevant to the
+per-system bus daemon defined in
+@EXPANDED_SYSCONFDIR@/dbus-1/system.conf. Putting it in any other
+configuration file would probably be nonsense.</para>
+
+<itemizedlist remap='TP'>
+
+ <listitem><para><emphasis remap='I'>&lt;servicehelper/&gt;</emphasis></para></listitem>
+
+
+</itemizedlist>
+
+<para>&lt;servicehelper/&gt; specifies the setuid helper that is used to launch
+system daemons with an alternate user. Typically this should be
+the dbus-daemon-launch-helper executable in located in libexec.</para>
+
+
+<para>The &lt;servicehelper/&gt; option is only relevant to the per-system bus daemon
+defined in @EXPANDED_SYSCONFDIR@/dbus-1/system.conf. Putting it in any other
+configuration file would probably be nonsense.</para>
+
+<itemizedlist remap='TP'>
+
+ <listitem><para><emphasis remap='I'>&lt;limit&gt;</emphasis></para></listitem>
+
+
+</itemizedlist>
<para>&lt;limit&gt; establishes a resource limit. For example:</para>
<literallayout remap='.nf'>
@@ -392,31 +514,40 @@ Available limit names are:</para>
<literallayout remap='.nf'>
"max_incoming_bytes" : total size in bytes of messages
incoming from a single connection
+ "max_incoming_unix_fds" : total number of unix fds of messages
+ incoming from a single connection
"max_outgoing_bytes" : total size in bytes of messages
queued up for a single connection
+ "max_outgoing_unix_fds" : total number of unix fds of messages
+ queued up for a single connection
"max_message_size" : max size of a single message in
bytes
- "service_start_timeout" : milliseconds (thousandths) until
+ "max_message_unix_fds" : max unix fds of a single message
+ "service_start_timeout" : milliseconds (thousandths) until
a started service has to connect
"auth_timeout" : milliseconds (thousandths) a
connection is given to
authenticate
- "max_completed_connections" : max number of authenticated connections
+ "pending_fd_timeout" : milliseconds (thousandths) a
+ fd is given to be transmitted to
+ dbus-daemon before disconnecting the
+ connection
+ "max_completed_connections" : max number of authenticated connections
"max_incomplete_connections" : max number of unauthenticated
connections
"max_connections_per_user" : max number of completed connections from
the same user
"max_pending_service_starts" : max number of service launches in
progress at the same time
- "max_names_per_connection" : max number of names a single
+ "max_names_per_connection" : max number of names a single
connection can own
- "max_match_rules_per_connection": max number of match rules for a single
+ "max_match_rules_per_connection": max number of match rules for a single
connection
- "max_replies_per_connection" : max number of pending method
+ "max_replies_per_connection" : max number of pending method
replies per connection
(number of calls-in-progress)
- "reply_timeout" : milliseconds (thousandths)
- until a method call times out
+ "reply_timeout" : milliseconds (thousandths)
+ until a method call times out
</literallayout> <!-- .fi -->
@@ -430,49 +561,60 @@ number of users that can work together to denial-of-service all other users by u
up all connections on the systemwide bus.</para>
-<para>Limits are normally only of interest on the systemwide bus, not the user session
+<para>Limits are normally only of interest on the systemwide bus, not the user session
buses.</para>
-<variablelist remap='TP'>
- <varlistentry>
- <term><emphasis remap='I'>&lt;policy&gt;</emphasis></term>
- <listitem>
+<itemizedlist remap='TP'>
+
+ <listitem><para><emphasis remap='I'>&lt;policy&gt;</emphasis></para></listitem>
-<para></para> <!-- FIXME: blank list item -->
- </listitem>
- </varlistentry>
-</variablelist>
+
+</itemizedlist>
<para>The &lt;policy&gt; element defines a security policy to be applied to a particular
set of connections to the bus. A policy is made up of
&lt;allow&gt; and &lt;deny&gt; elements. Policies are normally used with the systemwide bus;
-they are analogous to a firewall in that they allow expected traffic
+they are analogous to a firewall in that they allow expected traffic
and prevent unexpected traffic.</para>
-<para>The &lt;policy&gt; element has one of three attributes:</para>
+<para>Currently, the system bus has a default-deny policy for sending method calls
+and owning bus names. Everything else, in particular reply messages, receive
+checks, and signals has a default allow policy.</para>
+
+
+<para>In general, it is best to keep system services as small, targeted programs which
+run in their own process and provide a single bus name. Then, all that is needed
+is an &lt;allow&gt; rule for the "own" permission to let the process claim the bus
+name, and a "send_destination" rule to allow traffic from some or all uids to
+your service.</para>
+
+
+<para>The &lt;policy&gt; element has one of four attributes:</para>
<literallayout remap='.nf'>
context="(default|mandatory)"
+ at_console="(true|false)"
user="username or userid"
group="group name or gid"
</literallayout> <!-- .fi -->
-<para>
-Policies are applied to a connection as follows:</para>
+<para>Policies are applied to a connection as follows:</para>
<literallayout remap='.nf'>
- all context="default" policies are applied
- all group="connection's user's group" policies are applied
in undefined order
- all user="connection's auth user" policies are applied
in undefined order
+ - all at_console="true" policies are applied
+ - all at_console="false" policies are applied
- all context="mandatory" policies are applied
</literallayout> <!-- .fi -->
-<para>Policies applied later will override those applied earlier,
-when the policies overlap. Multiple policies with the same
-user/group/context are applied in the order they appear
+<para>Policies applied later will override those applied earlier,
+when the policies overlap. Multiple policies with the same
+user/group/context are applied in the order they appear
in the config file.</para>
<variablelist remap='TP'>
@@ -493,16 +635,16 @@ statements, and works just like &lt;deny&gt; but with the inverse meaning.</para
<para>The possible attributes of these elements are:</para>
<literallayout remap='.nf'>
send_interface="interface_name"
- send_member="method_or_signal_name"
- send_error="error_name"
- send_destination="name"
- send_type="method_call" | "method_return" | "signal" | "error"
+ send_member="method_or_signal_name"
+ send_error="error_name"
+ send_destination="name"
+ send_type="method_call" | "method_return" | "signal" | "error"
send_path="/path/name"
receive_interface="interface_name"
- receive_member="method_or_signal_name"
- receive_error="error_name"
- receive_sender="name"
+ receive_member="method_or_signal_name"
+ receive_error="error_name"
+ receive_sender="name"
receive_type="method_call" | "method_return" | "signal" | "error"
receive_path="/path/name"
@@ -520,9 +662,7 @@ statements, and works just like &lt;deny&gt; but with the inverse meaning.</para
<para>Examples:</para>
<literallayout remap='.nf'>
- &lt;deny send_interface="org.freedesktop.System" send_member="Reboot"/&gt;
- &lt;deny receive_interface="org.freedesktop.System" receive_member="Reboot"/&gt;
- &lt;deny own="org.freedesktop.System"/&gt;
+ &lt;deny send_destination="org.freedesktop.Service" send_interface="org.freedesktop.System" send_member="Reboot"/&gt;
&lt;deny send_destination="org.freedesktop.System"/&gt;
&lt;deny receive_sender="org.freedesktop.System"/&gt;
&lt;deny user="john"/&gt;
@@ -534,34 +674,29 @@ statements, and works just like &lt;deny&gt; but with the inverse meaning.</para
particular action. If it matches, the action is denied (unless later
rules in the config file allow it).</para>
-
<para>send_destination and receive_sender rules mean that messages may not be
sent to or received from the *owner* of the given name, not that
they may not be sent *to that name*. That is, if a connection
owns services A, B, C, and sending to A is denied, sending to B or C
will not work either.</para>
-
<para>The other send_* and receive_* attributes are purely textual/by-value
matches against the given field in the message header.</para>
-
<para>"Eavesdropping" occurs when an application receives a message that
-was explicitly addressed to a name the application does not own.
-Eavesdropping thus only applies to messages that are addressed to
-services (i.e. it does not apply to signals).</para>
-
+was explicitly addressed to a name the application does not own, or
+is a reply to such a message. Eavesdropping thus only applies to
+messages that are addressed to services and replies to such messages
+(i.e. it does not apply to signals).</para>
-<para>For &lt;allow&gt;, eavesdrop="true" indicates that the rule matches even
-when eavesdropping. eavesdrop="false" is the default and means that
+<para>For &lt;allow&gt;, eavesdrop="true" indicates that the rule matches even
+when eavesdropping. eavesdrop="false" is the default and means that
the rule only allows messages to go to their specified recipient.
-For &lt;deny&gt;, eavesdrop="true" indicates that the rule matches
+For &lt;deny&gt;, eavesdrop="true" indicates that the rule matches
only when eavesdropping. eavesdrop="false" is the default for &lt;deny&gt;
-also, but here it means that the rule applies always, even when
+also, but here it means that the rule applies always, even when
not eavesdropping. The eavesdrop attribute can only be combined with
-receive rules (with receive_* attributes).</para>
-
-
+send and receive rules (with send_* and receive_* attributes).</para>
<para>The [send|receive]_requested_reply attribute works similarly to the eavesdrop
attribute. It controls whether the &lt;deny&gt; or &lt;allow&gt; matches a reply
@@ -582,7 +717,7 @@ requested. [send|receive]_requested_reply="true" indicates that the rule applies
always, regardless of pending reply state.</para>
-<para>user and group denials mean that the given user or group may
+<para>user and group denials mean that the given user or group may
not connect to the message bus.</para>
@@ -591,6 +726,7 @@ the character "*" can be substituted, meaning "any." Complex globs
like "foo.bar.*" aren't allowed for now because they'd be work to
implement and maybe encourage sloppy security anyway.</para>
+
<para>&lt;allow own_prefix="a.b"/&gt; allows you to own the name "a.b" or any
name whose first dot-separated elements are "a.b": in particular,
you can own "a.b.c" or "a.b.c.d", but not "a.bc" or "a.c".
@@ -599,6 +735,7 @@ define a meaning for subtrees of well-known names, such as
org.freedesktop.Telepathy.ConnectionManager.(anything)
and org.freedesktop.ReserveDevice1.(anything).</para>
+
<para>It does not make sense to deny a user or group inside a &lt;policy&gt;
for a user or group; user/group denials can only be inside
context="default" or context="mandatory" policies.</para>
@@ -617,42 +754,40 @@ rule, since "whether the message can be sent" and "whether it can be
received" are evaluated separately.</para>
-<para>Be careful with send_interface/receive_interface, because the
-interface field in messages is optional.</para>
+<para>Be careful with send_interface/receive_interface, because the
+interface field in messages is optional. In particular, do NOT
+specify &lt;deny send_interface="org.foo.Bar"/&gt;! This will cause
+no-interface messages to be blocked for all services, which is
+almost certainly not what you intended. Always use rules of
+the form: &lt;deny send_interface="org.foo.Bar" send_destination="org.foo.Service"/&gt;</para>
-<variablelist remap='TP'>
- <varlistentry>
- <term><emphasis remap='I'>&lt;selinux&gt;</emphasis></term>
- <listitem>
+<itemizedlist remap='TP'>
-<para></para> <!-- FIXME: blank list item -->
- </listitem>
- </varlistentry>
-</variablelist>
+ <listitem><para><emphasis remap='I'>&lt;selinux&gt;</emphasis></para></listitem>
+
+
+</itemizedlist>
<para>The &lt;selinux&gt; element contains settings related to Security Enhanced Linux.
More details below.</para>
-<variablelist remap='TP'>
- <varlistentry>
- <term><emphasis remap='I'>&lt;associate&gt;</emphasis></term>
- <listitem>
+<itemizedlist remap='TP'>
+
+ <listitem><para><emphasis remap='I'>&lt;associate&gt;</emphasis></para></listitem>
-<para></para> <!-- FIXME: blank list item -->
- </listitem>
- </varlistentry>
-</variablelist>
+
+</itemizedlist>
<para>An &lt;associate&gt; element appears below an &lt;selinux&gt; element and
creates a mapping. Right now only one kind of association is possible:</para>
<literallayout remap='.nf'>
- &lt;associate own="org.freedesktop.Foobar" context="foo_t"/&gt;
+ &lt;associate own="org.freedesktop.Foobar" context="foo_t"/&gt;
</literallayout> <!-- .fi -->
<para>This means that if a connection asks to own the name
"org.freedesktop.Foobar" then the source context will be the context
-of the connection and the target context will be "foo_t" - see the
+of the connection and the target context will be "foo_t" - see the
short discussion of SELinux below.</para>
@@ -663,7 +798,7 @@ NOT the context of the connection owning the name.</para>
<para>There's currently no way to set a default for owning any name, if
we add this syntax it will look like:</para>
<literallayout remap='.nf'>
- &lt;associate own="*" context="foo_t"/&gt;
+ &lt;associate own="*" context="foo_t"/&gt;
</literallayout> <!-- .fi -->
<para>If you find a reason this is useful, let the developers know.
Right now the default will be the security context of the bus itself.</para>
@@ -715,30 +850,75 @@ the first connection as source, security context of the second connection
as target, object class "dbus" and requested permission "send_msg".</para>
-<para>If a security context is not available for a connection
-(impossible when using UNIX domain sockets), then the target
+<para>If a security context is not available for a connection
+(impossible when using UNIX domain sockets), then the target
context used is the context of the bus daemon itself.
-There is currently no way to change this default, because we're
-assuming that only UNIX domain sockets will be used to
-connect to the systemwide bus. If this changes, we'll
+There is currently no way to change this default, because we're
+assuming that only UNIX domain sockets will be used to
+connect to the systemwide bus. If this changes, we'll
probably add a way to set the default connection context.</para>
-<para>Second, any time a connection asks to own a name,
-the bus daemon will check permissions with the security
+<para>Second, any time a connection asks to own a name,
+the bus daemon will check permissions with the security
context of the connection as source, the security context specified
-for the name in the config file as target, object
+for the name in the config file as target, object
class "dbus" and requested permission "acquire_svc".</para>
-<para>The security context for a bus name is specified with the
+<para>The security context for a bus name is specified with the
&lt;associate&gt; element described earlier in this document.
-If a name has no security context associated in the
-configuration file, the security context of the bus daemon
+If a name has no security context associated in the
+configuration file, the security context of the bus daemon
itself will be used.</para>
</refsect1>
+<refsect1 id='debugging'><title>DEBUGGING</title>
+<para>If you're trying to figure out where your messages are going or why
+you aren't getting messages, there are several things you can try.</para>
+
+<para>Remember that the system bus is heavily locked down and if you
+haven't installed a security policy file to allow your message
+through, it won't work. For the session bus, this is not a concern.</para>
+
+<para>The simplest way to figure out what's happening on the bus is to run
+the <emphasis remap='I'>dbus-monitor</emphasis> program, which comes with the D-Bus
+package. You can also send test messages with <emphasis remap='I'>dbus-send</emphasis>. These
+programs have their own man pages.</para>
+
+<para>If you want to know what the daemon itself is doing, you might consider
+running a separate copy of the daemon to test against. This will allow you
+to put the daemon under a debugger, or run it with verbose output, without
+messing up your real session and system daemons.</para>
+
+<para>To run a separate test copy of the daemon, for example you might open a terminal
+and type:</para>
+<literallayout remap='.nf'>
+ DBUS_VERBOSE=1 dbus-daemon --session --print-address
+</literallayout> <!-- .fi -->
+
+<para>The test daemon address will be printed when the daemon starts. You will need
+to copy-and-paste this address and use it as the value of the
+DBUS_SESSION_BUS_ADDRESS environment variable when you launch the applications
+you want to test. This will cause those applications to connect to your
+test bus instead of the DBUS_SESSION_BUS_ADDRESS of your real session bus.</para>
+
+<para>DBUS_VERBOSE=1 will have NO EFFECT unless your copy of D-Bus
+was compiled with verbose mode enabled. This is not recommended in
+production builds due to performance impact. You may need to rebuild
+D-Bus if your copy was not built with debugging in mind. (DBUS_VERBOSE
+also affects the D-Bus library and thus applications using D-Bus; it may
+be useful to see verbose output on both the client side and from the daemon.)</para>
+
+<para>If you want to get fancy, you can create a custom bus
+configuration for your test bus (see the session.conf and system.conf
+files that define the two default configurations for example). This
+would allow you to specify a different directory for .service files,
+for example.</para>
+
+</refsect1>
+
<refsect1 id='author'><title>AUTHOR</title>
<para>See <ulink url='http://www.freedesktop.org/software/dbus/doc/AUTHORS'>http://www.freedesktop.org/software/dbus/doc/AUTHORS</ulink></para>
@@ -749,4 +929,3 @@ itself will be used.</para>
see <ulink url='http://www.freedesktop.org/software/dbus/'>http://www.freedesktop.org/software/dbus/</ulink></para>
</refsect1>
</refentry>
-
diff --git a/doc/dbus-faq.html b/doc/dbus-faq.html
deleted file mode 100644
index cf3f4ff0..00000000
--- a/doc/dbus-faq.html
+++ /dev/null
@@ -1,437 +0,0 @@
-<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.76.1"></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="#idp887904">
- What is D-Bus?
- </a></dt><dt>2. <a href="#idp4134224">
- Is D-Bus stable/finished?
- </a></dt><dt>3. <a href="#idp4137392">
- How is the reference implementation licensed? Can I use it in
- proprietary applications?
- </a></dt><dt>4. <a href="#idp4141344">
- What is the difference between a bus name, and object path,
- and an interface?
- </a></dt><dt>5. <a href="#service">
- What is a "service"?
- </a></dt><dt>6. <a href="#components">
- Is D-Bus a "component system"?
- </a></dt><dt>7. <a href="#speed">
- How fast is the D-Bus reference implementation?
- </a></dt><dt>8. <a href="#size">
- How large is the D-Bus reference implementation?
- </a></dt><dt>9. <a href="#other-ipc">
- How does D-Bus differ from other interprocess communication
- or networking protocols?
- </a></dt><dt>10. <a href="#corba">
- How does D-Bus differ from CORBA?
- </a></dt><dt>11. <a href="#xmlrpcsoap">
- How does D-Bus differ from XML-RPC and SOAP?
- </a></dt><dt>12. <a href="#dce">
- How does D-Bus differ from DCE?
- </a></dt><dt>13. <a href="#dcom">
- How does D-Bus differ from DCOM and COM?
- </a></dt><dt>14. <a href="#internet-communications-engine">
- How does D-Bus differ from ZeroC's Internet Communications Engine (Ice)
- </a></dt><dt>15. <a href="#inter-client-exchange">
- How does D-Bus differ from Inter-Client Exchange (ICE)?
- </a></dt><dt>16. <a href="#dcop">
- How does D-Bus differ from DCOP?
- </a></dt><dt>17. <a href="#yet-more-ipc">
- 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="#idp5222288">
- 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="idp887904"></a><a name="idp4130688"></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
- the introduction to the <a class="ulink" href="dbus-specification.html" target="_top">specification</a>. In
- short, it is a system consisting of 1) a wire protocol for exposing a
- typical object-oriented language/framework to other applications; and
- 2) a bus daemon that allows applications to find and monitor one another.
- 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="idp4134224"></a><a name="idp4134480"></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
- ABI stable. The <a class="ulink" href="README" target="_top">README</a>
- file has a discussion of the API/ABI stability guarantees.
- Higher-level bindings (such as those for Qt, GLib, Python, Java, C#) each
- 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="idp4137392"></a><a name="idp4137648"></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>
- The short answer is yes, you can use it in proprietary applications.
- You should read the <a class="ulink" href="COPYING" target="_top">COPYING</a> file, which
- offers you the choice of two licenses. These are the GPL and the
- AFL. The GPL requires that your application be licensed under the GPL
- as well. The AFL is an "X-style" or "BSD-style" license compatible
- with proprietary licensing, but it does have some requirements; in
- particular it prohibits you from filing a lawsuit alleging that the
- D-Bus software infringes your patents <span class="emphasis"><em>while you continue to
- 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="idp4141344"></a><a name="idp4141600"></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>
- If you imagine a C++ program that implements a network service, then
- the bus name is the hostname of the computer running this C++ program,
- the object path is a C++ object instance pointer, and an interface is
- a C++ class (a pure virtual or abstract class, to be exact).
- </p><p>
- In Java terms, the object path is an object reference,
- and an interface is a Java interface.
- </p><p>
- People get confused because if they write an application
- with a single object instance and a single interface,
- then the bus name, object path, and interface look
- redundant. For example, you might have a text editor
- that uses the bus name <code class="literal">org.freedesktop.TextEditor</code>,
- has a global singleton object called
- <code class="literal">/org/freedesktop/TextEditor</code>, and
- that singleton object could implement the interface
- <code class="literal">org.freedesktop.TextEditor</code>.
- </p><p>
- However, a text editor application could as easily own multiple bus
- names (for example, <code class="literal">org.kde.KWrite</code> in addition to
- generic <code class="literal">TextEditor</code>), have multiple objects (maybe
- <code class="literal">/org/kde/documents/4352</code> where the number changes
- according to the document), and each object could implement multiple
- 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="idp31824"></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
- to provide some functionality to other programs. Services
- are normally launched according to the bus name they will
- have.
- </p><p>
- People often misuse the word "service" for any
- bus name, but this tends to be ambiguous and confusing so is discouraged.
- 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="idp35040"></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:
- </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
- Object/component system
- </p></li><li class="listitem"><p>
- GUI control/widget embedding interfaces
- </p></li><li class="listitem"><p>
- Interprocess communication system or wire protocol
- </p></li></ol></div><p>
- </p><p>
- D-Bus is not a component system. "Component system" was originally
- defined by COM, and was essentially a workaround for the limitations
- of the C++ object system (adding introspection, runtime location of
- objects, ABI guarantees, and so forth). With the C# language and CLR,
- Microsoft added these features to the primary object system, leaving
- COM obsolete. Similarly, Java has much less need for something like
- COM than C++ did. Even QObject (from Qt) and GObject (from GLib) offer
- some of the same features found in COM.
- </p><p>
- Component systems are not about GUI control embedding. Embedding
- a spreadsheet in a word processor document is a matter of defining
- some specific <span class="emphasis"><em>interfaces</em></span> that objects
- can implement. These interfaces provide methods related to
- GUI controls. So an object implementing those interfaces
- can be embedded.
- </p><p>
- The word "component" just means "object with some fancy features" and
- in modern languages all objects are effectively "components."
- </p><p>
- So components are fancy objects, and some objects are GUI controls.
- </p><p>
- A third, unrelated feature is interprocess communication or IPC.
- D-Bus is an IPC system. Given an object (or "component" if you must),
- you can expose the functionality of that object over an IPC system.
- Examples of IPC systems are DCOM, CORBA, SOAP, XML-RPC, and D-Bus.
- You can use any of these IPC systems with any object/component system,
- though some of them are "tuned" for specific object systems.
- You can think of an IPC system primarily as a wire protocol.
- </p><p>
- If you combine an IPC system with a set of GUI control interfaces,
- then you can have an out-of-process or dynamically-loaded GUI control.
- </p><p>
- Another related concept is the <em class="firstterm">plugin</em> or
- <em class="firstterm">extension</em>. Generic plugin systems such as the
- <a class="ulink" href="http://eclipse.org" target="_top">Eclipse</a> system are not so different
- 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="idp52544"></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.
- <a class="ulink" href="http://lists.freedesktop.org/pipermail/dbus/2004-November/001779.html" target="_top">
- This mail</a> contains some benchmarking. At the time of that
- benchmark, D-Bus one-to-one communication was about 2.5x slower than
- simply pushing the data raw over a socket. After the recent rewrite of
- the marshaling code, D-Bus is slower than that because a lot of
- optimization work was lost. But it can probably be sped up again.
- </p><p>
- D-Bus communication with the intermediate bus daemon should be
- (and as last profiled, was) about twice as slow as one-to-one
- mode, because a round trip involves four socket reads/writes rather
- than two socket reads/writes.
- </p><p>
- The overhead comes from a couple of places; part of it is simply
- "abstraction penalty" (there are layers of code to support
- multiple main loops, multiple transport types, security, etc.).
- Probably the largest part comes from data validation
- (because the reference implementation does not trust incoming data).
- It would be simple to add a "no validation" mode, but probably
- not a good idea all things considered.
- </p><p>
- Raw bandwidth isn't the only concern; D-Bus is designed to
- 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="idp58144"></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
- disabled) is on the order of a 150K shared library.
- </p><p>
- 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="idp61344"></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>
- Keep in mind, it is not only an IPC system; it also includes
- lifecycle tracking, service activation, security policy, and other
- higher-level structure and assumptions.
- </p><p>
- The best place to start is to read the D-Bus <a class="ulink" href="dbus-tutorial.html" target="_top">tutorial</a>, so
- you have a concrete idea what D-Bus actually is. If you
- understand other protocols on a wire format level, you
- may also want to read the D-Bus <a class="ulink" href="dbus-specification.html" target="_top">specification</a> to see what
- D-Bus looks like on a low level.
- </p><p>
- As the <a class="ulink" href="dbus-tutorial.html" target="_top">tutorial</a> and <a class="ulink" href="dbus-specification.html" target="_top">specification</a> both explain, D-Bus is tuned
- for some specific use cases. Thus, it probably isn't tuned
- for what you want to do, unless you are doing the things
- D-Bus was designed for. Don't make the mistake of thinking
- that any system involving "IPC" is the same thing.
- </p><p>
- The D-Bus authors would not recommend using D-Bus
- for applications where it doesn't make sense.
- The following questions compare D-Bus to some other
- protocols primarily to help you understand D-Bus
- and decide whether it's appropriate; D-Bus is neither intended
- nor claimed to be the right choice for every application.
- </p><p>
- It should be possible to bridge D-Bus to other IPC systems,
- just as D-Bus can be bridged to object systems.
- </p><p>
- 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="idp70592"></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>.
- </p><p>
- <a class="ulink" href="http://www.omg.org" target="_top">CORBA</a> is designed to support
- object-oriented IPC between objects, automatically marshalling
- parameters as necessary. CORBA is strongly supported by the <a class="ulink" href="http://www.omg.org" target="_top">Open Management Group (OMG)</a>, which
- produces various standards and supporting documents for CORBA and has
- the backing of many large organizations. There are many CORBA ORBs
- available, both proprietary ORBs and free / open source software ORBs
- (the latter include <a class="ulink" href="http://orbit-resource.sourceforge.net/" target="_top">ORBit</a>, <a class="ulink" href="http://www.mico.org/" target="_top">MICO</a>, and <a class="ulink" href="http://www.theaceorb.com/" target="_top">The ACE Orb (TAO)</a>). Many
- organizations continue to use CORBA ORBs for various kinds of IPC.
- </p><p>
- Both GNOME and KDE have used CORBA and then moved away from it. KDE
- had more success with a system called DCOP, and GNOME layered a system
- called Bonobo on top of CORBA. Without custom extensions, CORBA does
- not support many of the things one wants to do in a desktop
- environment with the GNOME/KDE architecture.
- </p><p>
- CORBA on the other hand has a number of features of interest for
- enterprise and web application development, though XML systems such as
- SOAP are the latest fad.
- </p><p>
- Like D-Bus, CORBA uses a fast binary protocol (IIOP). Both systems
- work in terms of objects and methods, and have concepts such as
- "oneway" calls. Only D-Bus has direct support for "signals" as in
- GLib/Qt (or Java listeners, or C# delegates).
- </p><p>
- D-Bus hardcodes and specifies a lot of things that CORBA leaves open-ended,
- because CORBA is more generic and D-Bus has two specific use-cases in mind.
- This makes D-Bus a bit simpler.
- </p><p>
- However, unlike CORBA D-Bus does <span class="emphasis"><em>not</em></span> specify the
- API for the language bindings. Instead, "native" bindings adapted
- specifically to the conventions of a framework such as QObject,
- GObject, C#, Java, Python, etc. are encouraged. The libdbus reference
- implementation is designed to be a backend for bindings of this
- nature, rather than to be used directly. The rationale is that an IPC
- system API should not "leak" all over a program; it should come into
- play only just before data goes over the wire. As an aside, OMG is
- apparently working on a simpler C++ binding for CORBA.
- </p><p>
- Many CORBA implementations such as ORBit are faster than the libdbus
- reference implementation. One reason is that D-Bus considers data
- from the other end of the connection to be untrusted and extensively
- validates it. But generally speaking other priorities were placed
- ahead of raw speed in the libdbus implementation. A fast D-Bus
- implementation along the lines of ORBit should be possible, of course.
- </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="idm35328"></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>.
- </p><p>
- In <a class="ulink" href="http://www.w3.org/TR/SOAP/" target="_top">SOAP</a> and <a class="ulink" href="http://www.xmlrpc.com" target="_top">XML-RPC</a>, RPC calls are transformed
- into an XML-based format, then sent over the wire (typically using the
- HTTP protocol), where they are processed and returned. XML-RPC is the
- simple protocol (its spec is only a page or two), and SOAP is the
- full-featured protocol.
- </p><p>
- XML-RPC and SOAP impose XML parsing overhead that is normally
- irrelevant in the context of the Internet, but significant for
- constant fine-grained IPC among applications in a desktop session.
- </p><p>
- D-Bus offers persistent connections and with the bus daemon
- 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="idp5170528"></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>.
- </p><p>
- <a class="ulink" href="http://www.opengroup.org/dce/" target="_top">Distributed Computing
- Environment (DCE)</a> is an industry-standard vendor-neutral
- standard that includes an IPC mechanism. <a class="ulink" href="http://www.opengroup.org/comm/press/05-01-12.htm" target="_top">The Open Group
- has released an implementation as open source software</a>. DCE
- is quite capable, and includes a vast amount of functionality such as
- 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="idp5175616"></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>.
- </p><p>
- Comparing D-Bus to COM is apples and oranges;
- see <a class="xref" href="#components" title="6.">Q:6</a>.
- </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="idp5196720"></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>.
- </p><p>
- The <a class="ulink" href="http://www.zeroc.com/ice.html" target="_top"> Internet
- Communications Engine (Ice)</a> is a powerful IPC mechanism more
- 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="idp5200736"></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>
- was developed for the X Session Management protocol (XSMP), as part of
- the X Window System (X11R6.1). The idea was to allow desktop sessions
- to contain nongraphical clients in addition to X clients.
- </p><p>
- ICE is a binary protocol designed for desktop use, and KDE's DCOP
- builds on ICE. ICE is substantially simpler than D-Bus (in contrast
- to most of the other IPC systems mentioned here, which are more
- complex). ICE doesn't really define a mapping to objects and methods
- (DCOP adds that layer). The reference implementation of ICE (libICE)
- is often considered to be horrible (and horribly insecure).
- </p><p>
- 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="idp5205360"></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>.
- </p><p>
- D-Bus is intentionally pretty similar to <a class="ulink" href="http://developer.kde.org/documentation/library/kdeqt/dcop.html" target="_top">DCOP</a>,
- and can be thought of as a "DCOP the next generation" suitable for
- sharing between the various open source desktop projects.
- </p><p>
- D-Bus is a bit more complex than DCOP, though the Qt binding for D-Bus
- should not be more complex for programmers. The additional complexity
- of D-Bus arises from its separation of object references vs. bus names
- vs. interfaces as distinct concepts, and its support for one-to-one
- connections in addition to connections over the bus. The libdbus
- reference implementation has a lot of API to support multiple bindings
- and main loops, and performs data validation and out-of-memory handling
- in order to support secure applications such as the systemwide bus.
- </p><p>
- D-Bus is probably somewhat slower than DCOP due to data validation
- and more "layers" in the reference implementation. A comparison
- hasn't been posted to the list though.
- </p><p>
- At this time, KDE has not committed to using D-Bus, but there have
- been discussions of KDE bridging D-Bus and DCOP, or even changing
- 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="idp5212352"></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="idp5216288"></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>.
- </p><p>
- If you're writing an Internet or Intranet application, XML-RPC or SOAP
- work for many people. These are standard, available for most
- languages, simple to debug and easy to use.
- </p><p>
- If you're writing a desktop application for UNIX,
- then D-Bus is of course our recommendation for
- talking to other parts of the desktop session.
- </p><p>
- D-Bus is also designed for communications between system daemons and
- communications between the desktop and system daemons.
- </p><p>
- If you're doing something complicated such as clustering,
- distributed swarms, peer-to-peer, or whatever then
- the authors of this FAQ don't have expertise in these
- areas and you should ask someone else or try a search engine.
- D-Bus is most likely a poor choice but could be appropriate
- for some things.
- </p><p>
- Note: the D-Bus mailing list is probably not the place to
- discuss which system is appropriate for your application,
- though you are welcome to ask specific questions about
- D-Bus <span class="emphasis"><em>after reading this FAQ, the tutorial, and
- searching the list archives</em></span>. The best way
- 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="idp5222288"></a><a name="idp5222544"></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>
- has a link to the bug tracker, which is the best place to store
- patches. You can also post them to the list, especially if you want
- to discuss the patch or get feedback.
- </p></td></tr></tbody></table></div></div></body></html>
diff --git a/doc/dbus-faq.xml b/doc/dbus-faq.xml
index 69ac3f15..0d296d92 100644
--- a/doc/dbus-faq.xml
+++ b/doc/dbus-faq.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" standalone="no"?>
-<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
-"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
[
]>
diff --git a/doc/dbus-launch.1 b/doc/dbus-launch.1
deleted file mode 100644
index e22a3be0..00000000
--- a/doc/dbus-launch.1
+++ /dev/null
@@ -1,211 +0,0 @@
-.\"
-.\" dbus\-launch manual page.
-.\" Copyright (C) 2003 Red Hat, Inc.
-.\"
-.TH dbus\-launch 1
-.SH NAME
-dbus\-launch \- Utility to start a message bus from a shell script
-.SH SYNOPSIS
-.PP
-.B dbus\-launch [\-\-version] [\-\-sh\-syntax] [\-\-csh\-syntax] [\-\-auto\-syntax] [\-\-exit\-with\-session] [\-\-autolaunch=MACHINEID] [\-\-config\-file=FILENAME] [PROGRAM] [ARGS...]
-
-.SH DESCRIPTION
-
-The \fIdbus\-launch\fP command is used to start a session bus
-instance of \fIdbus\-daemon\fP from a shell script.
-It would normally be called from a user's login
-scripts. Unlike the daemon itself, \fIdbus\-launch\fP exits, so
-backticks or the $() construct can be used to read information from
-\fIdbus\-launch\fP.
-
-With no arguments, \fIdbus\-launch\fP will launch a session bus
-instance and print the address and PID of that instance to standard
-output.
-
-You may specify a program to be run; in this case, \fIdbus\-launch\fP
-will launch a session bus instance, set the appropriate environment
-variables so the specified program can find the bus, and then execute the
-specified program, with the specified arguments. See below for
-examples.
-
-If you launch a program, \fIdbus\-launch\fP will not print the
-information about the new bus to standard output.
-
-When \fIdbus\-launch\fP prints bus information to standard output, by
-default it is in a simple key\-value pairs format. However, you may
-request several alternate syntaxes using the \-\-sh\-syntax, \-\-csh\-syntax,
-\-\-binary\-syntax, or
-\-\-auto\-syntax options. Several of these cause \fIdbus\-launch\fP to emit shell code
-to set up the environment.
-
-With the \-\-auto\-syntax option, \fIdbus\-launch\fP looks at the value
-of the SHELL environment variable to determine which shell syntax
-should be used. If SHELL ends in "csh", then csh\-compatible code is
-emitted; otherwise Bourne shell code is emitted. Instead of passing
-\-\-auto\-syntax, you may explicitly specify a particular one by using
-\-\-sh\-syntax for Bourne syntax, or \-\-csh\-syntax for csh syntax.
-In scripts, it's more robust to avoid \-\-auto\-syntax and you hopefully
-know which shell your script is written in.
-
-.PP
-See http://www.freedesktop.org/software/dbus/ for more information
-about D\-Bus. See also the man page for \fIdbus\-daemon\fP.
-
-.SH EXAMPLES
-
-Distributions running
-.B dbus\-launch
-as part of a standard X session should run
-.B "dbus\-launch \-\-exit\-with\-session"
-after the X server has started and become available, as a wrapper around
-the "main" X client (typically a session manager or window manager), as in
-these examples:
-
-.RS
-.B "dbus\-launch \-\-exit\-with\-session gnome\-session"
-
-.B "dbus\-launch \-\-exit\-with\-session openbox"
-
-.B "dbus\-launch \-\-exit\-with\-session ~/.xsession"
-.RE
-
-If your distribution does not do this, you can achieve similar results
-by running your session or window manager in the same way in a script
-run by your X session, such as
-.BR ~/.xsession ,
-.B ~/.xinitrc
-or
-.BR ~/.Xclients .
-
-To start a D-Bus session within a text-mode session, you can run
-dbus-launch in the background. For instance, in a sh-compatible shell:
-
-.nf
- ## test for an existing bus daemon, just to be safe
- if test \-z "$DBUS_SESSION_BUS_ADDRESS" ; then
- ## if not found, launch a new one
- eval `dbus\-launch \-\-sh\-syntax`
- echo "D\-Bus per\-session daemon address is: $DBUS_SESSION_BUS_ADDRESS"
- fi
-.fi
-Note that in this case, dbus-launch will exit, and dbus-daemon will not be
-terminated automatically on logout.
-
-.SH AUTOMATIC LAUNCHING
-
-.PP
-If DBUS_SESSION_BUS_ADDRESS is not set for a process that tries to use
-D\-Bus, by default the process will attempt to invoke dbus\-launch with
-the \-\-autolaunch option to start up a new session bus or find the
-existing bus address on the X display or in a file in
-~/.dbus/session\-bus/
-
-.PP
-Whenever an autolaunch occurs, the application that had to
-start a new bus will be in its own little world; it can effectively
-end up starting a whole new session if it tries to use a lot of
-bus services. This can be suboptimal or even totally broken, depending
-on the app and what it tries to do.
-
-.PP
-There are two common reasons for autolaunch. One is ssh to a remote
-machine. The ideal fix for that would be forwarding of
-DBUS_SESSION_BUS_ADDRESS in the same way that DISPLAY is forwarded.
-In the meantime, you can edit the session.conf config file to
-have your session bus listen on TCP, and manually set
-DBUS_SESSION_BUS_ADDRESS, if you like.
-
-.PP
-The second common reason for autolaunch is an su to another user, and
-display of X applications running as the second user on the display
-belonging to the first user. Perhaps the ideal fix in this case
-would be to allow the second user to connect to the session bus of the
-first user, just as they can connect to the first user's display.
-However, a mechanism for that has not been coded.
-
-.PP
-You can always avoid autolaunch by manually setting
-DBUS_SESSION_BUS_ADDRESS. Autolaunch happens because the default
-address if none is set is "autolaunch:", so if any other address is
-set there will be no autolaunch. You can however include autolaunch in
-an explicit session bus address as a fallback, for example
-DBUS_SESSION_BUS_ADDRESS="something:,autolaunch:" \- in that case if
-the first address doesn't work, processes will autolaunch. (The bus
-address variable contains a comma\-separated list of addresses to try.)
-
-.PP
-The \-\-autolaunch option is considered an internal implementation
-detail of libdbus, and in fact there are plans to change it. There's
-no real reason to use it outside of the libdbus implementation anyhow.
-
-.SH OPTIONS
-The following options are supported:
-.TP
-.I "\-\-auto\-syntax"
-Choose \-\-csh\-syntax or \-\-sh\-syntax based on the SHELL environment variable.
-
-.I "\-\-binary\-syntax"
-Write to stdout a nul\-terminated bus address, then the bus PID as a
-binary integer of size sizeof(pid_t), then the bus X window ID as a
-binary integer of size sizeof(long). Integers are in the machine's
-byte order, not network byte order or any other canonical byte order.
-
-.TP
-.I "\-\-close\-stderr"
-Close the standard error output stream before starting the D\-Bus
-daemon. This is useful if you want to capture dbus\-launch error
-messages but you don't want dbus\-daemon to keep the stream open to
-your application.
-
-.TP
-.I "\-\-config\-file=FILENAME"
-Pass \-\-config\-file=FILENAME to the bus daemon, instead of passing it
-the \-\-session argument. See the man page for dbus\-daemon
-
-.TP
-.I "\-\-csh\-syntax"
-Emit csh compatible code to set up environment variables.
-
-.TP
-.I "\-\-exit\-with\-session"
-If this option is provided, a persistent "babysitter" process will be
-created that watches stdin for HUP and tries to connect to the X
-server. If this process gets a HUP on stdin or loses its X connection,
-it kills the message bus daemon.
-
-.TP
-.I "\-\-autolaunch=MACHINEID"
-This option implies that \fIdbus\-launch\fP should scan for a
-previously\-started session and reuse the values found there. If no
-session is found, it will start a new session. The
-\-\-exit\-with\-session option is implied if \-\-autolaunch is given.
-This option is for the exclusive use of libdbus, you do not want to
-use it manually. It may change in the future.
-
-.TP
-.I "\-\-sh\-syntax"
-Emit Bourne\-shell compatible code to set up environment variables.
-
-.TP
-.I "\-\-version"
-Print the version of dbus\-launch
-
-.SH NOTES
-
-If you run
-.B "dbus\-launch myapp"
-(with any other options), dbus\-daemon will
-.I not
-exit when
-.B myapp
-terminates: this is because
-.B myapp
-is assumed to be part of a larger session, rather than a session in its
-own right.
-
-.SH AUTHOR
-See http://www.freedesktop.org/software/dbus/doc/AUTHORS
-
-.SH BUGS
-Please send bug reports to the D\-Bus mailing list or bug tracker,
-see http://www.freedesktop.org/software/dbus/
diff --git a/cmake/tools/dbus-launch.xml b/doc/dbus-launch.1.xml.in
index dc34898f..31dd6eac 100644
--- a/cmake/tools/dbus-launch.xml
+++ b/doc/dbus-launch.1.xml.in
@@ -1,27 +1,33 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
- "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
-<!-- lifted from troff+man by doclifter -->
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+ "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
<refentry id='dbuslaunch1'>
-<!-- -->
-<!-- dbus\-launch manual page. -->
-<!-- Copyright (C) 2003 Red Hat, Inc. -->
+
+<!-- dbus&bsol;-launch manual page.
+ Copyright (C) 2003 Red Hat, Inc. -->
<refmeta>
<refentrytitle>dbus-launch</refentrytitle>
<manvolnum>1</manvolnum>
+<refmiscinfo class="manual">User Commands</refmiscinfo>
+<refmiscinfo class="source">D-Bus</refmiscinfo>
+<refmiscinfo class="version">@DBUS_VERSION@</refmiscinfo>
</refmeta>
-<refnamediv id='name'>
+<refnamediv>
<refname>dbus-launch</refname>
<refpurpose>Utility to start a message bus from a shell script</refpurpose>
</refnamediv>
<!-- body begins here -->
<refsynopsisdiv id='synopsis'>
<cmdsynopsis>
- <command>dbus-launch</command> <arg choice='opt'>--version </arg>
+ <command>dbus-launch</command>
+ <arg choice='opt'>--version </arg>
+ <arg choice='opt'>--help </arg>
<arg choice='opt'>--sh-syntax </arg>
<arg choice='opt'>--csh-syntax </arg>
<arg choice='opt'>--auto-syntax </arg>
+ <arg choice='opt'>--binary-syntax </arg>
+ <arg choice='opt'>--close-stderr </arg>
<arg choice='opt'>--exit-with-session </arg>
<arg choice='opt'>--autolaunch=<replaceable>MACHINEID</replaceable></arg>
<arg choice='opt'>--config-file=<replaceable>FILENAME</replaceable></arg>
@@ -33,7 +39,7 @@
<refsect1 id='description'><title>DESCRIPTION</title>
-<para>The <command>dbus-launch</command> command is used to start a session bus
+<para>The <command>dbus-launch</command> command is used to start a session bus
instance of <emphasis remap='I'>dbus-daemon</emphasis> from a shell script.
It would normally be called from a user's login
scripts. Unlike the daemon itself, <command>dbus-launch</command> exits, so
@@ -41,7 +47,7 @@ backticks or the $() construct can be used to read information from
<command>dbus-launch</command>.</para>
<para>With no arguments, <command>dbus-launch</command> will launch a session bus
-instance and print the address and pid of that instance to standard
+instance and print the address and PID of that instance to standard
output.</para>
<para>You may specify a program to be run; in this case, <command>dbus-launch</command>
@@ -54,7 +60,7 @@ examples.</para>
information about the new bus to standard output.</para>
<para>When <command>dbus-launch</command> prints bus information to standard output, by
-default it is in a simple key-value pairs format. However, you may
+default it is in a simple key-value pairs format. However, you may
request several alternate syntaxes using the --sh-syntax, --csh-syntax,
--binary-syntax, or
--auto-syntax options. Several of these cause <command>dbus-launch</command> to emit shell code
@@ -64,7 +70,7 @@ to set up the environment.</para>
of the SHELL environment variable to determine which shell syntax
should be used. If SHELL ends in "csh", then csh-compatible code is
emitted; otherwise Bourne shell code is emitted. Instead of passing
---auto-syntax, you may explicity specify a particular one by using
+--auto-syntax, you may explicitly specify a particular one by using
--sh-syntax for Bourne syntax, or --csh-syntax for csh syntax.
In scripts, it's more robust to avoid --auto-syntax and you hopefully
know which shell your script is written in.</para>
@@ -73,44 +79,62 @@ know which shell your script is written in.</para>
<para>See <ulink url='http://www.freedesktop.org/software/dbus/'>http://www.freedesktop.org/software/dbus/</ulink> for more information
about D-Bus. See also the man page for <emphasis remap='I'>dbus-daemon</emphasis>.</para>
+</refsect1>
-<para>Here is an example of how to use <command>dbus-launch</command> with an
-sh-compatible shell to start the per-session bus daemon:</para>
-<literallayout remap='.nf'>
+<refsect1 id='examples'><title>EXAMPLES</title>
+<para>Distributions running
+<command>dbus-launch</command>
+as part of a standard X session should run
+<emphasis remap='B'>dbus-launch --exit-with-session</emphasis>
+after the X server has started and become available, as a wrapper around
+the "main" X client (typically a session manager or window manager), as in
+these examples:</para>
- ## test for an existing bus daemon, just to be safe
- if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
- ## if not found, launch a new one
- eval `dbus-launch --sh-syntax --exit-with-session`
- echo "D-Bus per-session daemon address is: $DBUS_SESSION_BUS_ADDRESS"
- fi
+ <blockquote remap='RS'>
+<para><emphasis remap='B'>dbus-launch --exit-with-session gnome-session</emphasis></para>
-</literallayout> <!-- .fi -->
-<para>You might run something like that in your login scripts.</para>
+<para><emphasis remap='B'>dbus-launch --exit-with-session openbox</emphasis></para>
+<para><emphasis remap='B'>dbus-launch --exit-with-session ~/.xsession</emphasis>
+ </para></blockquote> <!-- remap='RE' -->
-<para>Another way to use <command>dbus-launch</command> is to run your main session
-program, like so:</para>
-<literallayout remap='.nf'>
+<para>If your distribution does not do this, you can achieve similar results
+by running your session or window manager in the same way in a script
+run by your X session, such as
+<filename>~/.xsession</filename>,
+<filename>~/.xinitrc</filename>
+or
+<filename>~/.Xclients</filename>.</para>
-dbus-launch gnome-session
+<para>To start a D-Bus session within a text\(hymode session,
+ do not use <emphasis remap='B'>dbus-launch</emphasis>.
+ Instead, see <citerefentry><refentrytitle>dbus-run-session</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
+</para>
+<literallayout remap='.nf'>
+ ## test for an existing bus daemon, just to be safe
+ if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
+ ## if not found, launch a new one
+ eval `dbus-launch --sh-syntax`
+ echo "D-Bus per-session daemon address is: $DBUS_SESSION_BUS_ADDRESS"
+ fi
</literallayout> <!-- .fi -->
-<para>The above would likely be appropriate for ~/.xsession or ~/.Xclients.</para>
+<para>Note that in this case, dbus-launch will exit, and dbus-daemon will not be
+terminated automatically on logout.</para>
</refsect1>
<refsect1 id='automatic_launching'><title>AUTOMATIC LAUNCHING</title>
<para>If DBUS_SESSION_BUS_ADDRESS is not set for a process that tries to use
D-Bus, by default the process will attempt to invoke dbus-launch with
-the --autolaunch option to start up a new session bus or find the
+the --autolaunch option to start up a new session bus or find the
existing bus address on the X display or in a file in
~/.dbus/session-bus/</para>
<para>Whenever an autolaunch occurs, the application that had to
start a new bus will be in its own little world; it can effectively
-end up starting a whole new session if it tries to use a lot of
+end up starting a whole new session if it tries to use a lot of
bus services. This can be suboptimal or even totally broken, depending
on the app and what it tries to do.</para>
@@ -118,7 +142,7 @@ on the app and what it tries to do.</para>
<para>There are two common reasons for autolaunch. One is ssh to a remote
machine. The ideal fix for that would be forwarding of
DBUS_SESSION_BUS_ADDRESS in the same way that DISPLAY is forwarded.
-In the meantime, you can edit the session.conf config file to
+In the meantime, you can edit the session.conf config file to
have your session bus listen on TCP, and manually set
DBUS_SESSION_BUS_ADDRESS, if you like.</para>
@@ -155,8 +179,12 @@ no real reason to use it outside of the libdbus implementation anyhow.</para>
<listitem>
<para>Choose --csh-syntax or --sh-syntax based on the SHELL environment variable.</para>
-<para><option>--binary-syntax</option>
-Write to stdout a nul-terminated bus address, then the bus PID as a
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--binary-syntax</option></term>
+ <listitem>
+<para>Write to stdout a nul-terminated bus address, then the bus PID as a
binary integer of size sizeof(pid_t), then the bus X window ID as a
binary integer of size sizeof(long). Integers are in the machine's
byte order, not network byte order or any other canonical byte order.</para>
@@ -176,7 +204,7 @@ your application.</para>
<varlistentry>
<term><option>--config-file=FILENAME</option></term>
<listitem>
-<para>Pass --config-file=FILENAME to the bus daemon, instead of passing it
+<para>Pass --config-file=FILENAME to the bus daemon, instead of passing it
the --session argument. See the man page for dbus-daemon</para>
</listitem>
@@ -191,7 +219,7 @@ the --session argument. See the man page for dbus-daemon</para>
<varlistentry>
<term><option>--exit-with-session</option></term>
<listitem>
-<para>If this option is provided, a persistent "babysitter" process will be
+<para>If this option is provided, a persistent "babysitter" process will be
created that watches stdin for HUP and tries to connect to the X
server. If this process gets a HUP on stdin or loses its X connection,
it kills the message bus daemon.</para>
@@ -224,9 +252,30 @@ use it manually. It may change in the future.</para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><option>--help</option></term>
+ <listitem>
+<para>Print the help info of dbus-launch</para>
+
+ </listitem>
+ </varlistentry>
</variablelist>
</refsect1>
+<refsect1 id='notes'><title>NOTES</title>
+<para>If you run
+<emphasis remap='B'>dbus-launch myapp</emphasis>
+(with any other options), dbus-daemon will
+<emphasis remap='I'>not</emphasis>
+exit when
+<emphasis remap='B'>myapp</emphasis>
+terminates: this is because
+<emphasis remap='B'>myapp</emphasis>
+is assumed to be part of a larger session, rather than a session in its
+own right.</para>
+
+</refsect1>
+
<refsect1 id='author'><title>AUTHOR</title>
<para>See <ulink url='http://www.freedesktop.org/software/dbus/doc/AUTHORS'>http://www.freedesktop.org/software/dbus/doc/AUTHORS</ulink></para>
@@ -237,4 +286,3 @@ use it manually. It may change in the future.</para>
see <ulink url='http://www.freedesktop.org/software/dbus/'>http://www.freedesktop.org/software/dbus/</ulink></para>
</refsect1>
</refentry>
-
diff --git a/doc/dbus-monitor.1 b/doc/dbus-monitor.1
deleted file mode 100644
index 6282b9eb..00000000
--- a/doc/dbus-monitor.1
+++ /dev/null
@@ -1,78 +0,0 @@
-.\"
-.\" dbus\-monitor manual page.
-.\" Copyright (C) 2003 Red Hat, Inc.
-.\"
-.TH dbus\-monitor 1
-.SH NAME
-dbus\-monitor \- debug probe to print message bus messages
-.SH SYNOPSIS
-.PP
-.B dbus\-monitor
-[\-\-system | \-\-session | \-\-address ADDRESS] [\-\-profile | \-\-monitor]
-[watch expressions]
-
-.SH DESCRIPTION
-
-The \fIdbus\-monitor\fP command is used to monitor messages going
-through a D\-Bus message bus. See
-http://www.freedesktop.org/software/dbus/ for more information about
-the big picture.
-
-.PP
-There are two well\-known message buses: the systemwide message bus
-(installed on many systems as the "messagebus" service) and the
-per\-user\-login\-session message bus (started each time a user logs in).
-The \-\-system and \-\-session options direct \fIdbus\-monitor\fP to
-monitor the system or session buses respectively. If neither is
-specified, \fIdbus\-monitor\fP monitors the session bus.
-
-.PP
-\fIdbus\-monitor\fP has two different output modes, the 'classic'\-style
-monitoring mode and profiling mode. The profiling format is a compact
-format with a single line per message and microsecond\-resolution timing
-information. The \-\-profile and \-\-monitor options select the profiling
-and monitoring output format respectively. If neither is specified,
-\fIdbus\-monitor\fP uses the monitoring output format.
-
-.PP
-In order to get \fIdbus\-monitor\fP to see the messages you are interested
-in, you should specify a set of watch expressions as you would expect to
-be passed to the \fIdbus_bus_add_match\fP function.
-
-.PP
-The message bus configuration may keep \fIdbus\-monitor\fP from seeing
-all messages, especially if you run the monitor as a non\-root user.
-
-.SH OPTIONS
-.TP
-.I "\-\-system"
-Monitor the system message bus.
-.TP
-.I "\-\-session"
-Monitor the session message bus. (This is the default.)
-.TP
-.I "\-\-address ADDRESS"
-Monitor an arbitrary message bus given at ADDRESS.
-.TP
-.I "\-\-profile"
-Use the profiling output format.
-.TP
-.I "\-\-monitor"
-Use the monitoring output format. (This is the default.)
-
-.SH EXAMPLE
-Here is an example of using dbus\-monitor to watch for the gnome typing
-monitor to say things
-.nf
-
- dbus\-monitor "type='signal',sender='org.gnome.TypingMonitor',interface='org.gnome.TypingMonitor'"
-
-.fi
-
-.SH AUTHOR
-dbus\-monitor was written by Philip Blundell.
-The profiling output mode was added by Olli Salli.
-
-.SH BUGS
-Please send bug reports to the D\-Bus mailing list or bug tracker,
-see http://www.freedesktop.org/software/dbus/
diff --git a/cmake/tools/dbus-monitor.xml b/doc/dbus-monitor.1.xml.in
index b41cace2..af05e3aa 100644
--- a/cmake/tools/dbus-monitor.xml
+++ b/doc/dbus-monitor.1.xml.in
@@ -1,24 +1,26 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
- "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
-<!-- lifted from troff+man by doclifter -->
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+ "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
<refentry id='dbusmonitor1'>
-<!-- -->
-<!-- dbus\-monitor manual page. -->
-<!-- Copyright (C) 2003 Red Hat, Inc. -->
+
+<!-- dbus&bsol;-monitor manual page.
+ Copyright (C) 2003 Red Hat, Inc. -->
<refmeta>
<refentrytitle>dbus-monitor</refentrytitle>
<manvolnum>1</manvolnum>
+<refmiscinfo class="manual">User Commands</refmiscinfo>
+<refmiscinfo class="source">D-Bus</refmiscinfo>
+<refmiscinfo class="version">@DBUS_VERSION@</refmiscinfo>
</refmeta>
-<refnamediv id='name'>
+<refnamediv>
<refname>dbus-monitor</refname>
<refpurpose>debug probe to print message bus messages</refpurpose>
</refnamediv>
<!-- body begins here -->
<refsynopsisdiv id='synopsis'>
<cmdsynopsis>
- <command>dbus-monitor</command>
+ <command>dbus-monitor</command>
<group choice='opt'><arg choice='plain'>--system </arg><arg choice='plain'>--session </arg><arg choice='plain'>--address <replaceable>ADDRESS</replaceable></arg></group>
<group choice='opt'><arg choice='plain'>--profile </arg><arg choice='plain'>--monitor </arg></group>
<arg choice='opt'><arg choice='plain'><replaceable>watch</replaceable></arg><arg choice='plain'><replaceable>expressions</replaceable></arg></arg>
@@ -118,4 +120,3 @@ The profiling output mode was added by Olli Salli.</para>
see <ulink url='http://www.freedesktop.org/software/dbus/'>http://www.freedesktop.org/software/dbus/</ulink></para>
</refsect1>
</refentry>
-
diff --git a/doc/dbus-run-session.1.xml.in b/doc/dbus-run-session.1.xml.in
new file mode 100644
index 00000000..5181a8b1
--- /dev/null
+++ b/doc/dbus-run-session.1.xml.in
@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+ "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<refentry id='dbusrunsession1'>
+<refmeta>
+<refentrytitle>dbus-run-session</refentrytitle>
+<manvolnum>1</manvolnum>
+<refmiscinfo class="manual">User Commands</refmiscinfo>
+<refmiscinfo class="source">D-Bus</refmiscinfo>
+<refmiscinfo class="version">@DBUS_VERSION@</refmiscinfo>
+</refmeta>
+<refnamediv>
+<refname>dbus-run-session</refname>
+<refpurpose>start a process as a new D-Bus session</refpurpose>
+</refnamediv>
+<!-- body begins here -->
+<refsynopsisdiv id='synopsis'>
+<cmdsynopsis>
+ <command>dbus-run-session</command>
+ <arg choice='opt'><arg choice='plain'>--config-file </arg><arg choice='plain'><replaceable>FILENAME</replaceable></arg></arg>
+ <arg choice='opt'><arg choice='plain'>--dbus-daemon </arg><arg choice='plain'><replaceable>BINARY</replaceable></arg></arg>
+ <arg choice='opt'>-- </arg>
+ <arg choice='plain'><replaceable>PROGRAM</replaceable></arg>
+ <arg choice='opt' rep='repeat'><replaceable>ARGUMENTS</replaceable></arg>
+</cmdsynopsis>
+<cmdsynopsis>
+ <command>dbus-run-session</command> <arg choice='plain'>--help </arg>
+</cmdsynopsis>
+<cmdsynopsis>
+ <command>dbus-run-session</command> <arg choice='plain'>--version </arg>
+</cmdsynopsis>
+</refsynopsisdiv>
+
+
+<refsect1 id='description'><title>DESCRIPTION</title>
+<para><command>dbus-run-session</command>
+is used to start a session bus instance of
+<emphasis remap='B'>dbus-daemon</emphasis>
+from a shell script, and start a specified program in that session. The
+<emphasis remap='B'>dbus-daemon</emphasis>
+will run for as long as the program does, after which it will terminate.</para>
+
+<para>One use is to run a shell with its own
+<emphasis remap='B'>dbus-daemon</emphasis>
+in a text&hyphen;mode or SSH session, and have the
+<emphasis remap='B'>dbus-daemon</emphasis>
+terminate automatically on leaving the sub&hyphen;shell, like this:</para>
+
+<para> dbus-run-session -- bash</para>
+
+<para>or to replace the login shell altogether, by combining <command>dbus-run-session</command>
+with the <emphasis remap='B'>exec</emphasis> builtin:</para>
+
+<para> exec dbus-run-session -- bash</para>
+
+<para>Another use is to run regression tests and similar things in an isolated
+D-Bus session, to avoid either interfering with the "real" D-Bus session
+or relying on there already being a D-Bus session active, for instance:</para>
+
+<para> dbus-run-session -- make check</para>
+
+<para>or (in
+<citerefentry><refentrytitle>automake</refentrytitle><manvolnum>1</manvolnum></citerefentry>):</para>
+
+<literallayout remap='.nf'>
+ TESTS_ENVIRONMENT = MY_DEBUG=all dbus-run-session --
+
+</literallayout></refsect1>
+
+<refsect1 id='options'><title>OPTIONS</title>
+<variablelist remap='TP'>
+ <varlistentry>
+ <term><option>--config-file=</option><replaceable>FILENAME</replaceable>, <option>--config-file</option> <replaceable>FILENAME</replaceable></term>
+ <listitem>
+<para>Pass
+<option>--config-file=</option><replaceable>FILENAME</replaceable>
+to the bus daemon, instead of passing it the
+<option>--session</option>
+argument. See
+<citerefentry><refentrytitle>dbus-daemon</refentrytitle><manvolnum>1</manvolnum></citerefentry>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--dbus-daemon=</option><replaceable>BINARY</replaceable>, <option>--dbus-daemon</option> <replaceable>BINARY</replaceable></term>
+ <listitem>
+<para>Run <emphasis remap='I'>BINARY</emphasis> as <citerefentry><refentrytitle>dbus-daemon</refentrytitle><manvolnum>1</manvolnum></citerefentry>, instead of searching the <envar>PATH</envar>
+in the usual way for an executable called <emphasis remap='B'>dbus-daemon</emphasis>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--help</option></term>
+ <listitem>
+<para>Print usage information and exit.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--version</option></term>
+ <listitem>
+<para>Print the version of dbus-run-session and exit.</para>
+ </listitem>
+ </varlistentry>
+</variablelist>
+</refsect1>
+
+<refsect1 id='exit_status'><title>EXIT STATUS</title>
+<para><command>dbus-run-session</command>
+exits with the exit status of
+<emphasis remap='I'>PROGRAM</emphasis>,
+0 if the
+<option>--help</option> or <option>--version</option>
+options were used, 127 on an error within
+<command>dbus-run-session</command>
+itself, or
+128+<emphasis remap='I'>n</emphasis>
+if the
+<emphasis remap='I'>PROGRAM</emphasis>
+was killed by signal
+<emphasis remap='I'>n</emphasis>.</para>
+</refsect1>
+
+<refsect1 id='environment'><title>ENVIRONMENT</title>
+<para><envar>PATH</envar>
+is searched to find
+<emphasis remap='I'>PROGRAM</emphasis>,
+and (if the --dbus-daemon option is not used or its argument does not
+contain a
+<emphasis remap='B'>/</emphasis> character) to find <emphasis remap='B'>dbus-daemon</emphasis>.</para>
+
+<para>The session bus' address is made available to
+<emphasis remap='I'>PROGRAM</emphasis>
+in the environment variable
+<emphasis remap='B'>DBUS_SESSION_BUS_ADDRESS</emphasis>.</para>
+
+<para>The variables
+ <emphasis remap='B'>DBUS_SESSION_BUS_PID</emphasis>,
+ <emphasis remap='B'>DBUS_SESSION_BUS_WINDOWID</emphasis>,
+ <emphasis remap='B'>DBUS_STARTER_BUS_TYPE</emphasis> and
+ <emphasis remap='B'>DBUS_STARTER_ADDRESS</emphasis>
+ are removed from the environment, if present.</para>
+</refsect1>
+
+<refsect1 id='bugs'><title>BUGS</title>
+<para>Please send bug reports to the D-Bus mailing list or bug tracker,
+see <ulink url='http://www.freedesktop.org/software/dbus/'>http://www.freedesktop.org/software/dbus/</ulink></para>
+</refsect1>
+
+<refsect1 id='see_also'><title>SEE ALSO</title>
+<para><citerefentry><refentrytitle>dbus-daemon</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>dbus-launch</refentrytitle><manvolnum>1</manvolnum></citerefentry></para>
+</refsect1>
+</refentry>
diff --git a/doc/dbus-send.1 b/doc/dbus-send.1
deleted file mode 100644
index 131a60df..00000000
--- a/doc/dbus-send.1
+++ /dev/null
@@ -1,109 +0,0 @@
-.\"
-.\" dbus\-send manual page.
-.\" Copyright (C) 2003 Red Hat, Inc.
-.\"
-.TH dbus\-send 1
-.SH NAME
-dbus\-send \- Send a message to a message bus
-.SH SYNOPSIS
-.PP
-.B dbus\-send
-[\fB\-\-system\fP | \fB\-\-session\fP]
-[\fB\-\-dest=\fINAME\fP]
-[\fB\-\-print\-reply\fP[\fB=literal\fP]]
-[\fB\-\-reply\-timeout=\fIMSEC\fP]
-[\fB\-\-type=\fITYPE\fP]
-\fIOBJECT_PATH\fP \fIINTERFACE\fB.\fIMEMBER\fP [\fICONTENTS\fP ...]
-
-.SH DESCRIPTION
-
-The \fIdbus\-send\fP command is used to send a message to a D\-Bus message
-bus. See http://www.freedesktop.org/software/dbus/ for more
-information about the big picture.
-
-.PP
-There are two well\-known message buses: the systemwide message bus
-(installed on many systems as the "messagebus" service) and the
-per\-user\-login\-session message bus (started each time a user logs in).
-The \fB\-\-system\fP and \fB\-\-session\fP options direct
-\fBdbus\-send\fP to send messages to the system or session buses respectively.
-If neither is specified, \fBdbus\-send\fP sends to the session bus.
-
-.PP
-Nearly all uses of \fBdbus\-send\fP must provide the \fB\-\-dest\fP argument
-which is the name of a connection on the bus to send the message to. If
-\fB\-\-dest\fP is omitted, no destination is set.
-
-.PP
-The object path and the name of the message to send must always be
-specified. Following arguments, if any, are the message contents
-(message arguments). These are given as type\-specified values and
-may include containers (arrays, dicts, and variants) as described below.
-
-.nf
-<contents> ::= <item> | <container> [ <item> | <container>...]
-<item> ::= <type>:<value>
-<container> ::= <array> | <dict> | <variant>
-<array> ::= array:<type>:<value>[,<value>...]
-<dict> ::= dict:<type>:<type>:<key>,<value>[,<key>,<value>...]
-<variant> ::= variant:<type>:<value>
-<type> ::= string | int16 | uint 16 | int32 | uint32 | int64 | uint64 | double | byte | boolean | objpath
-.fi
-
-D\-Bus supports more types than these, but \fBdbus\-send\fP currently
-does not. Also, \fBdbus\-send\fP does not permit empty containers
-or nested containers (e.g. arrays of variants).
-
-.PP
-Here is an example invocation:
-.nf
-
- dbus\-send \-\-dest=org.freedesktop.ExampleName \\
- /org/freedesktop/sample/object/name \\
- org.freedesktop.ExampleInterface.ExampleMethod \\
- int32:47 string:'hello world' double:65.32 \\
- array:string:"1st item","next item","last item" \\
- dict:string:int32:"one",1,"two",2,"three",3 \\
- variant:int32:\-8 \\
- objpath:/org/freedesktop/sample/object/name
-
-.fi
-
-Note that the interface is separated from a method or signal
-name by a dot, though in the actual protocol the interface
-and the interface member are separate fields.
-
-.SH OPTIONS
-The following options are supported:
-.TP
-.BI \-\-dest= NAME
-Specify the name of the connection to receive the message.
-.TP
-.B "\-\-print\-reply"
-Block for a reply to the message sent, and print any reply received
-in a human-readable form.
-.TP
-.B "\-\-print\-reply=literal"
-Block for a reply to the message sent, and print the body of the
-reply. If the reply is an object path or a string, it is printed
-literally, with no punctuation, escape characters etc.
-.TP
-.BI \-\-reply\-timeout= MSEC
-Wait for a reply for up to \fIMSEC\fP milliseconds.
-The default is implementation\(hydefined, typically 25 seconds.
-.TP
-.B "\-\-system"
-Send to the system message bus.
-.TP
-.B "\-\-session"
-Send to the session message bus. (This is the default.)
-.TP
-.BI \-\-type= TYPE
-Specify \fBmethod_call\fP or \fBsignal\fP (defaults to "\fBsignal\fP").
-
-.SH AUTHOR
-dbus\-send was written by Philip Blundell.
-
-.SH BUGS
-Please send bug reports to the D\-Bus mailing list or bug tracker,
-see http://www.freedesktop.org/software/dbus/
diff --git a/cmake/tools/dbus-send.xml b/doc/dbus-send.1.xml.in
index 7fefc03e..67b6dfd2 100644
--- a/cmake/tools/dbus-send.xml
+++ b/doc/dbus-send.1.xml.in
@@ -1,34 +1,34 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
- "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
-<!-- lifted from troff+man by doclifter -->
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+ "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
<refentry id='dbussend1'>
-<!-- -->
-<!-- dbus\-send manual page. -->
-<!-- Copyright (C) 2003 Red Hat, Inc. -->
+
+<!-- dbus&bsol;-send manual page.
+ Copyright (C) 2003 Red Hat, Inc. -->
<refmeta>
<refentrytitle>dbus-send</refentrytitle>
<manvolnum>1</manvolnum>
+<refmiscinfo class="manual">User Commands</refmiscinfo>
+<refmiscinfo class="source">D-Bus</refmiscinfo>
+<refmiscinfo class="version">@DBUS_VERSION@</refmiscinfo>
</refmeta>
-<refnamediv id='name'>
+<refnamediv>
<refname>dbus-send</refname>
<refpurpose>Send a message to a message bus</refpurpose>
</refnamediv>
<!-- body begins here -->
<refsynopsisdiv id='synopsis'>
<cmdsynopsis>
- <command>dbus-send</command>
- <group choice='opt'><arg choice='plain'>--system </arg><arg choice='plain'>--session </arg></group>
+ <command>dbus-send</command>
+ <group choice='opt'><arg choice='plain'>--system </arg><arg choice='plain'>--session </arg><arg choice='plain'>--address=<replaceable>ADDRESS</replaceable></arg></group>
<arg choice='opt'>--dest=<replaceable>NAME</replaceable></arg>
- <arg choice='opt'>--print-reply </arg>
+ <arg choice='opt'><arg choice='plain'>--print-reply </arg><arg choice='opt'><replaceable>=literal</replaceable></arg></arg>
+ <arg choice='opt'>--reply-timeout=<replaceable>MSEC</replaceable></arg>
<arg choice='opt'>--type=<replaceable>TYPE</replaceable></arg>
- <arg choice='plain'><replaceable>&lt;destination</replaceable></arg>
- <arg choice='plain'><replaceable>object</replaceable></arg>
- <arg choice='plain'><replaceable>path&gt;</replaceable></arg>
- <arg choice='plain'><replaceable>&lt;message</replaceable></arg>
- <arg choice='plain'><replaceable>name&gt;</replaceable></arg>
- <arg choice='opt' rep='repeat'><replaceable>contents</replaceable></arg>
+ <arg choice='plain'><replaceable>OBJECT_PATH</replaceable></arg>
+ <arg choice='plain'><replaceable>INTERFACE.MEMBER</replaceable></arg>
+ <arg choice='opt' rep='repeat'><replaceable>CONTENTS</replaceable></arg>
<sbr/>
</cmdsynopsis>
</refsynopsisdiv>
@@ -36,33 +36,33 @@
<refsect1 id='description'><title>DESCRIPTION</title>
<para>The <command>dbus-send</command> command is used to send a message to a D-Bus message
-bus. See <ulink url='http://www.freedesktop.org/software/dbus/'>http://www.freedesktop.org/software/dbus/</ulink> for more
+bus. See <ulink url='http://www.freedesktop.org/software/dbus/'>http://www.freedesktop.org/software/dbus/</ulink> for more
information about the big picture.</para>
-<para>There are two well-known message buses: the systemwide message bus
-(installed on many systems as the "messagebus" service) and the
+<para>There are two well-known message buses: the systemwide message bus
+(installed on many systems as the "messagebus" service) and the
per-user-login-session message bus (started each time a user logs in).
-The --system and --session options direct <command>dbus-send</command> to send
-messages to the system or session buses respectively. If neither is
-specified, <command>dbus-send</command> sends to the session bus.</para>
+The <option>--system</option> and <option>--session</option> options direct
+<command>dbus-send</command> to send messages to the system or session buses respectively.
+If neither is specified, <command>dbus-send</command> sends to the session bus.</para>
-<para>Nearly all uses of <command>dbus-send</command> must provide the --dest argument
+<para>Nearly all uses of <command>dbus-send</command> must provide the <option>--dest</option> argument
which is the name of a connection on the bus to send the message to. If
---dest is omitted, no destination is set.</para>
+<option>--dest</option> is omitted, no destination is set.</para>
<para>The object path and the name of the message to send must always be
specified. Following arguments, if any, are the message contents
-(message arguments). These are given as type-specified values and
+(message arguments). These are given as type-specified values and
may include containers (arrays, dicts, and variants) as described below.</para>
<literallayout remap='.nf'>
&lt;contents&gt; ::= &lt;item&gt; | &lt;container&gt; [ &lt;item&gt; | &lt;container&gt;...]
&lt;item&gt; ::= &lt;type&gt;:&lt;value&gt;
&lt;container&gt; ::= &lt;array&gt; | &lt;dict&gt; | &lt;variant&gt;
-&lt;array&gt; ::= array:&lt;type&gt;:&lt;value&gt;[,&lt;value&gt;...]
+&lt;array&gt; ::= array:&lt;type&gt;:&lt;value&gt;[,&lt;value&gt;...]
&lt;dict&gt; ::= dict:&lt;type&gt;:&lt;type&gt;:&lt;key&gt;,&lt;value&gt;[,&lt;key&gt;,&lt;value&gt;...]
&lt;variant&gt; ::= variant:&lt;type&gt;:&lt;value&gt;
&lt;type&gt; ::= string | int16 | uint 16 | int32 | uint32 | int64 | uint64 | double | byte | boolean | objpath
@@ -76,18 +76,18 @@ or nested containers (e.g. arrays of variants).</para>
<para>Here is an example invocation:</para>
<literallayout remap='.nf'>
- dbus-send --dest=org.freedesktop.ExampleName \
- /org/freedesktop/sample/object/name \
- org.freedesktop.ExampleInterface.ExampleMethod \
- int32:47 string:'hello world' double:65.32 \
- array:string:"1st item","next item","last item" \
- dict:string:int32:"one",1,"two",2,"three",3 \
- variant:int32:-8 \
- objpath:/org/freedesktop/sample/object/name
+ dbus-send --dest=org.freedesktop.ExampleName &bsol;
+ /org/freedesktop/sample/object/name &bsol;
+ org.freedesktop.ExampleInterface.ExampleMethod &bsol;
+ int32:47 string:'hello world' double:65.32 &bsol;
+ array:string:"1st item","next item","last item" &bsol;
+ dict:string:int32:"one",1,"two",2,"three",3 &bsol;
+ variant:int32:-8 &bsol;
+ objpath:/org/freedesktop/sample/object/name
</literallayout> <!-- .fi -->
-<para>Note that the interface is separated from a method or signal
+<para>Note that the interface is separated from a method or signal
name by a dot, though in the actual protocol the interface
and the interface member are separate fields.</para>
@@ -97,7 +97,7 @@ and the interface member are separate fields.</para>
<para>The following options are supported:</para>
<variablelist remap='TP'>
<varlistentry>
- <term><option>--dest=NAME</option></term>
+ <term><option>--dest=</option><replaceable>NAME</replaceable></term>
<listitem>
<para>Specify the name of the connection to receive the message.</para>
</listitem>
@@ -105,7 +105,23 @@ and the interface member are separate fields.</para>
<varlistentry>
<term><option>--print-reply</option></term>
<listitem>
-<para>Block for a reply to the message sent, and print any reply received.</para>
+<para>Block for a reply to the message sent, and print any reply received
+in a human-readable form. It also means the message type (<option>--type=</option>) is <emphasis remap='B'>method_call</emphasis>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--print-reply=literal</option></term>
+ <listitem>
+<para>Block for a reply to the message sent, and print the body of the
+reply. If the reply is an object path or a string, it is printed
+literally, with no punctuation, escape characters etc.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--reply-timeout=</option><replaceable>MSEC</replaceable></term>
+ <listitem>
+<para>Wait for a reply for up to <emphasis remap='I'>MSEC</emphasis> milliseconds.
+The default is implementation&hyphen;defined, typically 25 seconds.</para>
</listitem>
</varlistentry>
<varlistentry>
@@ -121,9 +137,15 @@ and the interface member are separate fields.</para>
</listitem>
</varlistentry>
<varlistentry>
- <term><option>--type=TYPE</option></term>
+ <term><option>--address=</option><replaceable>ADDRESS</replaceable></term>
<listitem>
-<para>Specify "method_call" or "signal" (defaults to "signal").</para>
+<para>Send to <replaceable>ADDRESS</replaceable>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--type=</option><replaceable>TYPE</replaceable></term>
+ <listitem>
+<para>Specify <emphasis remap='B'>method_call</emphasis> or <emphasis remap='B'>signal</emphasis> (defaults to "<emphasis remap='B'>signal</emphasis>").</para>
</listitem>
</varlistentry>
@@ -140,4 +162,3 @@ and the interface member are separate fields.</para>
see <ulink url='http://www.freedesktop.org/software/dbus/'>http://www.freedesktop.org/software/dbus/</ulink></para>
</refsect1>
</refentry>
-
diff --git a/doc/dbus-specification.html b/doc/dbus-specification.html
deleted file mode 100644
index 60e05aba..00000000
--- a/doc/dbus-specification.html
+++ /dev/null
@@ -1,2898 +0,0 @@
-<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>D-Bus Specification</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="article" title="D-Bus Specification"><div class="titlepage"><div><div><h2 class="title"><a name="index"></a>D-Bus Specification</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">Anders</span> <span class="surname">Carlsson</span></h3><div class="affiliation"><span class="orgname">CodeFactory AB<br></span><div class="address"><p><br>
-<code class="email">&lt;<a class="email" href="mailto:andersca@codefactory.se">andersca@codefactory.se</a>&gt;</code><br>
-</p></div></div></div><div class="author"><h3 class="author"><span class="firstname">Alexander</span> <span class="surname">Larsson</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: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 class="author"><h3 class="author"><span class="firstname">Simon</span> <span class="surname">McVittie</span></h3><div class="affiliation"><span class="orgname">Collabora Ltd.<br></span><div class="address"><p><br>
-<code class="email">&lt;<a class="email" href="mailto:simon.mcvittie@collabora.co.uk">simon.mcvittie@collabora.co.uk</a>&gt;</code><br>
-</p></div></div></div><div class="author"><h3 class="author"><span class="firstname">David</span> <span class="surname">Zeuthen</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:davidz@redhat.com">davidz@redhat.com</a>&gt;</code><br>
-</p></div></div></div></div></div><div><p class="releaseinfo">Version 0.19</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.19</td><td align="left">20 February 2012</td><td align="left">smcv/lp</td></tr><tr><td align="left" colspan="3">formally define unique connection names and well-known
- bus names; document best practices for interface, bus, member and
- error names, and object paths; document the search path for session
- and system services on Unix; document the systemd transport</td></tr><tr><td align="left">Revision 0.18</td><td align="left">29 July 2011</td><td align="left">smcv</td></tr><tr><td align="left" colspan="3">define eavesdropping, unicast, broadcast; add eavesdrop
- match keyword; promote type system to a top-level section</td></tr><tr><td align="left">Revision 0.17</td><td align="left">1 June 2011</td><td align="left">smcv/davidz</td></tr><tr><td align="left" colspan="3">define ObjectManager; reserve extra pseudo-type-codes used
- by GVariant</td></tr><tr><td align="left">Revision 0.16</td><td align="left">11 April 2011</td><td align="left"></td></tr><tr><td align="left" colspan="3">add path_namespace, arg0namespace; argNpath matches object
- paths</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="#type-system">Type System</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></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-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-systemd">systemd</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><dt><span class="sect2"><a href="#transports-exec">Executed Subprocesses on Unix</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="#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><dt><span class="sect2"><a href="#standard-interfaces-objectmanager"><code class="literal">org.freedesktop.DBus.ObjectManager</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="#idp6346832">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>
- D-Bus is <span class="emphasis"><em>low-latency</em></span> because it is designed
- to avoid round trips and allow asynchronous operation, much like
- the X protocol.
- </p></li><li class="listitem"><p>
- D-Bus is <span class="emphasis"><em>low-overhead</em></span> because it uses a
- binary protocol, and does not have to convert to and from a text
- format such as XML. Because D-Bus is intended for potentially
- high-resolution same-machine IPC, not primarily for Internet IPC,
- this is an interesting optimization.
- </p></li><li class="listitem"><p>
- D-Bus is <span class="emphasis"><em>easy to use</em></span> because it works in terms
- of <em class="firstterm">messages</em> rather than byte streams, and
- automatically handles a lot of the hard IPC issues. Also, the D-Bus
- library is designed to be wrapped in a way that lets developers use
- their framework's existing object/type system, rather than learning
- a new one specifically for IPC.
- </p></li></ul></div><p>
- </p><p>
- The base D-Bus protocol is a one-to-one (peer-to-peer or client-server)
- protocol, specified in <a class="xref" href="#message-protocol" title="Message Protocol">the section called &#8220;Message Protocol&#8221;</a>. That is, it is
- a system for one application to talk to a single other
- application. However, the primary intended application of the protocol is the
- D-Bus <em class="firstterm">message bus</em>, specified in <a class="xref" href="#message-bus" title="Message Bus Specification">the section called &#8220;Message Bus Specification&#8221;</a>. The message bus is a special application that
- accepts connections from multiple other applications, and forwards
- messages among them.
- </p><p>
- Uses of D-Bus include notification of system changes (notification of when
- a camera is plugged in to a computer, or a new version of some software
- has been installed), or desktop interoperability, for example a file
- monitoring service or a configuration service.
- </p><p>
- D-Bus is designed for two specific use cases:
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
- A "system bus" for notifications from the system to user sessions,
- and to allow the system to request input from user sessions.
- </p></li><li class="listitem"><p>
- A "session bus" used to implement desktop environments such as
- GNOME and KDE.
- </p></li></ul></div><p>
- D-Bus is not intended to be a generic IPC system for any possible
- application, and intentionally omits many features found in other
- IPC systems for this reason.
- </p><p>
- At the same time, the bus daemons offer a number of features not found in
- other IPC systems, such as single-owner "bus names" (similar to X
- selections), on-demand startup of services, and security policies.
- In many ways, these features are the primary motivation for developing
- D-Bus; other systems would have sufficed if IPC were the only goal.
- </p><p>
- D-Bus may turn out to be useful in unanticipated applications, but future
- versions of this spec and the reference implementation probably will not
- incorporate features that interfere with the core use cases.
- </p><p>
- The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
- "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
- document are to be interpreted as described in RFC 2119. However, the
- document could use a serious audit to be sure it makes sense to do
- so. Also, they are not capitalized.
- </p><div class="sect2" title="Protocol and Specification Stability"><div class="titlepage"><div><div><h3 class="title"><a name="stability"></a>Protocol and Specification Stability</h3></div></div></div><p>
- The D-Bus protocol is frozen (only compatible extensions are allowed) as
- of November 8, 2006. However, this specification could still use a fair
- bit of work to make interoperable reimplementation possible without
- reference to the D-Bus reference implementation. Thus, this
- specification is not marked 1.0. To mark it 1.0, we'd like to see
- someone invest significant effort in clarifying the specification
- language, and growing the specification to cover more aspects of the
- reference implementation's behavior.
- </p><p>
- Until this work is complete, any attempt to reimplement D-Bus will
- probably require looking at the reference implementation and/or asking
- questions on the D-Bus mailing list about intended behavior.
- Questions on the list are very welcome.
- </p><p>
- Nonetheless, this document should be a useful starting point and is
- to our knowledge accurate, though incomplete.
- </p></div></div><div class="sect1" title="Type System"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="type-system"></a>Type System</h2></div></div></div><p>
- D-Bus has a type system, in which values of various types can be
- serialized into a sequence of bytes referred to as the
- <em class="firstterm">wire format</em> in a standard way.
- Converting a value from some other representation into the wire
- format is called <em class="firstterm">marshaling</em> and converting
- it back from the wire format is <em class="firstterm">unmarshaling</em>.
- </p><div class="sect2" title="Type Signatures"><div class="titlepage"><div><div><h3 class="title"><a name="message-protocol-signatures"></a>Type Signatures</h3></div></div></div><p>
- The D-Bus protocol does not include type tags in the marshaled data; a
- block of marshaled values must have a known <em class="firstterm">type
- signature</em>. The type signature is made up of <em class="firstterm">type
- codes</em>. A type code is an ASCII character representing the
- type of a value. Because ASCII characters are used, the type signature
- will always form a valid ASCII string. A simple string compare
- determines whether two type signatures are equivalent.
- </p><p>
- As a simple example, the type code for 32-bit integer (<code class="literal">INT32</code>) is
- the ASCII character 'i'. So the signature for a block of values
- containing a single <code class="literal">INT32</code> would be:
- </p><pre class="programlisting">
- "i"
- </pre><p>
- A block of values containing two <code class="literal">INT32</code> would have this signature:
- </p><pre class="programlisting">
- "ii"
- </pre><p>
- </p><p>
- All <em class="firstterm">basic</em> types work like
- <code class="literal">INT32</code> in this example. To marshal and unmarshal
- basic types, you simply read one value from the data
- block corresponding to each type code in the signature.
- In addition to basic types, there are four <em class="firstterm">container</em>
- types: <code class="literal">STRUCT</code>, <code class="literal">ARRAY</code>, <code class="literal">VARIANT</code>,
- and <code class="literal">DICT_ENTRY</code>.
- </p><p>
- <code class="literal">STRUCT</code> has a type code, ASCII character 'r', but this type
- code does not appear in signatures. Instead, ASCII characters
- '(' and ')' are used to mark the beginning and end of the struct.
- So for example, a struct containing two integers would have this
- signature:
- </p><pre class="programlisting">
- "(ii)"
- </pre><p>
- Structs can be nested, so for example a struct containing
- an integer and another struct:
- </p><pre class="programlisting">
- "(i(ii))"
- </pre><p>
- The value block storing that struct would contain three integers; the
- type signature allows you to distinguish "(i(ii))" from "((ii)i)" or
- "(iii)" or "iii".
- </p><p>
- The <code class="literal">STRUCT</code> type code 'r' is not currently used in the D-Bus protocol,
- but is useful in code that implements the protocol. This type code
- is specified to allow such code to interoperate in non-protocol contexts.
- </p><p>
- Empty structures are not allowed; there must be at least one
- type code between the parentheses.
- </p><p>
- <code class="literal">ARRAY</code> has ASCII character 'a' as type code. The array type code must be
- followed by a <em class="firstterm">single complete type</em>. The single
- complete type following the array is the type of each array element. So
- the simple example is:
- </p><pre class="programlisting">
- "ai"
- </pre><p>
- which is an array of 32-bit integers. But an array can be of any type,
- such as this array-of-struct-with-two-int32-fields:
- </p><pre class="programlisting">
- "a(ii)"
- </pre><p>
- Or this array of array of integer:
- </p><pre class="programlisting">
- "aai"
- </pre><p>
- </p><p>
- The phrase <em class="firstterm">single complete type</em> deserves some
- definition. A single complete type is a basic type code, a variant type code,
- an array with its element type, or a struct with its fields.
- So the following signatures are not single complete types:
- </p><pre class="programlisting">
- "aa"
- </pre><p>
- </p><pre class="programlisting">
- "(ii"
- </pre><p>
- </p><pre class="programlisting">
- "ii)"
- </pre><p>
- And the following signatures contain multiple complete types:
- </p><pre class="programlisting">
- "ii"
- </pre><p>
- </p><pre class="programlisting">
- "aiai"
- </pre><p>
- </p><pre class="programlisting">
- "(ii)(ii)"
- </pre><p>
- Note however that a single complete type may <span class="emphasis"><em>contain</em></span>
- multiple other single complete types.
- </p><p>
- <code class="literal">VARIANT</code> has ASCII character 'v' as its type code. A marshaled value of
- type <code class="literal">VARIANT</code> will have the signature of a single complete type as part
- of the <span class="emphasis"><em>value</em></span>. This signature will be followed by a
- marshaled value of that type.
- </p><p>
- A <code class="literal">DICT_ENTRY</code> works exactly like a struct, but rather
- than parentheses it uses curly braces, and it has more restrictions.
- The restrictions are: it occurs only as an array element type; it has
- exactly two single complete types inside the curly braces; the first
- single complete type (the "key") must be a basic type rather than a
- container type. Implementations must not accept dict entries outside of
- arrays, must not accept dict entries with zero, one, or more than two
- fields, and must not accept dict entries with non-basic-typed keys. A
- dict entry is always a key-value pair.
- </p><p>
- The first field in the <code class="literal">DICT_ENTRY</code> is always the key.
- A message is considered corrupt if the same key occurs twice in the same
- array of <code class="literal">DICT_ENTRY</code>. However, for performance reasons
- implementations are not required to reject dicts with duplicate keys.
- </p><p>
- In most languages, an array of dict entry would be represented as a
- map, hash table, or dict object.
- </p><p>
- The following table summarizes the D-Bus types.
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Conventional Name</th><th>Code</th><th>Description</th></tr></thead><tbody><tr><td><code class="literal">INVALID</code></td><td>0 (ASCII NUL)</td><td>Not a valid type code, used to terminate signatures</td></tr><tr><td><code class="literal">BYTE</code></td><td>121 (ASCII 'y')</td><td>8-bit unsigned integer</td></tr><tr><td><code class="literal">BOOLEAN</code></td><td>98 (ASCII 'b')</td><td>Boolean value, 0 is <code class="literal">FALSE</code> and 1 is <code class="literal">TRUE</code>. Everything else is invalid.</td></tr><tr><td><code class="literal">INT16</code></td><td>110 (ASCII 'n')</td><td>16-bit signed integer</td></tr><tr><td><code class="literal">UINT16</code></td><td>113 (ASCII 'q')</td><td>16-bit unsigned integer</td></tr><tr><td><code class="literal">INT32</code></td><td>105 (ASCII 'i')</td><td>32-bit signed integer</td></tr><tr><td><code class="literal">UINT32</code></td><td>117 (ASCII 'u')</td><td>32-bit unsigned integer</td></tr><tr><td><code class="literal">INT64</code></td><td>120 (ASCII 'x')</td><td>64-bit signed integer</td></tr><tr><td><code class="literal">UINT64</code></td><td>116 (ASCII 't')</td><td>64-bit unsigned integer</td></tr><tr><td><code class="literal">DOUBLE</code></td><td>100 (ASCII 'd')</td><td>IEEE 754 double</td></tr><tr><td><code class="literal">STRING</code></td><td>115 (ASCII 's')</td><td>UTF-8 string (<span class="emphasis"><em>must</em></span> be valid UTF-8). Must be nul terminated and contain no other nul bytes.</td></tr><tr><td><code class="literal">OBJECT_PATH</code></td><td>111 (ASCII 'o')</td><td>Name of an object instance</td></tr><tr><td><code class="literal">SIGNATURE</code></td><td>103 (ASCII 'g')</td><td>A type signature</td></tr><tr><td><code class="literal">ARRAY</code></td><td>97 (ASCII 'a')</td><td>Array</td></tr><tr><td><code class="literal">STRUCT</code></td><td>114 (ASCII 'r'), 40 (ASCII '('), 41 (ASCII ')')</td><td>Struct; type code 114 'r' is reserved for use in
- bindings and implementations to represent the general
- concept of a struct, and must not appear in signatures
- used on D-Bus.</td></tr><tr><td><code class="literal">VARIANT</code></td><td>118 (ASCII 'v') </td><td>Variant type (the type of the value is part of the value itself)</td></tr><tr><td><code class="literal">DICT_ENTRY</code></td><td>101 (ASCII 'e'), 123 (ASCII '{'), 125 (ASCII '}') </td><td>Entry in a dict or map (array of key-value pairs).
- Type code 101 'e' is reserved for use in bindings and
- implementations to represent the general concept of a
- dict or dict-entry, and must not appear in signatures
- used on D-Bus.</td></tr><tr><td><code class="literal">UNIX_FD</code></td><td>104 (ASCII 'h')</td><td>Unix file descriptor</td></tr><tr><td>(reserved)</td><td>109 (ASCII 'm')</td><td>Reserved for <a class="ulink" href="https://bugs.freedesktop.org/show_bug.cgi?id=27857" target="_top">a
- 'maybe' type compatible with the one in GVariant</a>,
- and must not appear in signatures used on D-Bus until
- specified here</td></tr><tr><td>(reserved)</td><td>42 (ASCII '*')</td><td>Reserved for use in bindings/implementations to
- represent any <em class="firstterm">single complete type</em>,
- and must not appear in signatures used on D-Bus.</td></tr><tr><td>(reserved)</td><td>63 (ASCII '?')</td><td>Reserved for use in bindings/implementations to
- represent any <em class="firstterm">basic type</em>, and must
- not appear in signatures used on D-Bus.</td></tr><tr><td>(reserved)</td><td>64 (ASCII '@'), 38 (ASCII '&amp;'),
- 94 (ASCII '^')</td><td>Reserved for internal use by bindings/implementations,
- and must not appear in signatures used on D-Bus.
- GVariant uses these type-codes to encode calling
- conventions.</td></tr></tbody></table></div><p>
- </p></div><div class="sect2" title="Marshaling (Wire Format)"><div class="titlepage"><div><div><h3 class="title"><a name="message-protocol-marshaling"></a>Marshaling (Wire Format)</h3></div></div></div><p>
- Given a type signature, a block of bytes can be converted into typed
- values. This section describes the format of the block of bytes. Byte
- order and alignment issues are handled uniformly for all D-Bus types.
- </p><p>
- A block of bytes has an associated byte order. The byte order
- has to be discovered in some way; for D-Bus messages, the
- byte order is part of the message header as described in
- <a class="xref" href="#message-protocol-messages" title="Message Format">the section called &#8220;Message Format&#8221;</a>. For now, assume
- that the byte order is known to be either little endian or big
- endian.
- </p><p>
- Each value in a block of bytes is aligned "naturally," for example
- 4-byte values are aligned to a 4-byte boundary, and 8-byte values to an
- 8-byte boundary. To properly align a value, <em class="firstterm">alignment
- padding</em> may be necessary. The alignment padding must always
- be the minimum required padding to properly align the following value;
- and it must always be made up of nul bytes. The alignment padding must
- not be left uninitialized (it can't contain garbage), and more padding
- than required must not be used.
- </p><p>
- Given all this, the types are marshaled on the wire as follows:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Conventional Name</th><th>Encoding</th><th>Alignment</th></tr></thead><tbody><tr><td><code class="literal">INVALID</code></td><td>Not applicable; cannot be marshaled.</td><td>N/A</td></tr><tr><td><code class="literal">BYTE</code></td><td>A single 8-bit byte.</td><td>1</td></tr><tr><td><code class="literal">BOOLEAN</code></td><td>As for <code class="literal">UINT32</code>, but only 0 and 1 are valid values.</td><td>4</td></tr><tr><td><code class="literal">INT16</code></td><td>16-bit signed integer in the message's byte order.</td><td>2</td></tr><tr><td><code class="literal">UINT16</code></td><td>16-bit unsigned integer in the message's byte order.</td><td>2</td></tr><tr><td><code class="literal">INT32</code></td><td>32-bit signed integer in the message's byte order.</td><td>4</td></tr><tr><td><code class="literal">UINT32</code></td><td>32-bit unsigned integer in the message's byte order.</td><td>4</td></tr><tr><td><code class="literal">INT64</code></td><td>64-bit signed integer in the message's byte order.</td><td>8</td></tr><tr><td><code class="literal">UINT64</code></td><td>64-bit unsigned integer in the message's byte order.</td><td>8</td></tr><tr><td><code class="literal">DOUBLE</code></td><td>64-bit IEEE 754 double in the message's byte order.</td><td>8</td></tr><tr><td><code class="literal">STRING</code></td><td>A <code class="literal">UINT32</code> indicating the string's
- length in bytes excluding its terminating nul, followed by
- non-nul string data of the given length, followed by a terminating nul
- byte.
- </td><td>
- 4 (for the length)
- </td></tr><tr><td><code class="literal">OBJECT_PATH</code></td><td>Exactly the same as <code class="literal">STRING</code> except the
- content must be a valid object path (see below).
- </td><td>
- 4 (for the length)
- </td></tr><tr><td><code class="literal">SIGNATURE</code></td><td>The same as <code class="literal">STRING</code> except the length is a single
- byte (thus signatures have a maximum length of 255)
- and the content must be a valid signature (see below).
- </td><td>
- 1
- </td></tr><tr><td><code class="literal">ARRAY</code></td><td>
- A <code class="literal">UINT32</code> giving the length of the array data in bytes, followed by
- alignment padding to the alignment boundary of the array element type,
- followed by each array element. The array length is from the
- end of the alignment padding to the end of the last element,
- i.e. it does not include the padding after the length,
- or any padding after the last element.
- Arrays have a maximum length defined to be 2 to the 26th power or
- 67108864. Implementations must not send or accept arrays exceeding this
- length.
- </td><td>
- 4 (for the length)
- </td></tr><tr><td><code class="literal">STRUCT</code></td><td>
- A struct must start on an 8-byte boundary regardless of the
- type of the struct fields. The struct value consists of each
- field marshaled in sequence starting from that 8-byte
- alignment boundary.
- </td><td>
- 8
- </td></tr><tr><td><code class="literal">VARIANT</code></td><td>
- A variant type has a marshaled
- <code class="literal">SIGNATURE</code> followed by a marshaled
- value with the type given in the signature. Unlike
- a message signature, the variant signature can
- contain only a single complete type. So "i", "ai"
- or "(ii)" is OK, but "ii" is not. Use of variants may not
- cause a total message depth to be larger than 64, including
- other container types such as structures.
- </td><td>
- 1 (alignment of the signature)
- </td></tr><tr><td><code class="literal">DICT_ENTRY</code></td><td>
- Identical to STRUCT.
- </td><td>
- 8
- </td></tr><tr><td><code class="literal">UNIX_FD</code></td><td>32-bit unsigned integer in the message's byte
- order. The actual file descriptors need to be
- transferred out-of-band via some platform specific
- mechanism. On the wire, values of this type store the index to the
- file descriptor in the array of file descriptors that
- accompany the message.</td><td>4</td></tr></tbody></table></div><p>
- </p><div class="sect3" title="Valid Object Paths"><div class="titlepage"><div><div><h4 class="title"><a name="message-protocol-marshaling-object-path"></a>Valid Object Paths</h4></div></div></div><p>
- An object path is a name used to refer to an object instance.
- Conceptually, each participant in a D-Bus message exchange may have
- any number of object instances (think of C++ or Java objects) and each
- such instance will have a path. Like a filesystem, the object
- instances in an application form a hierarchical tree.
- </p><p>
- The following rules define a valid object path. Implementations must
- not send or accept messages with invalid object paths.
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
- The path may be of any length.
- </p></li><li class="listitem"><p>
- The path must begin with an ASCII '/' (integer 47) character,
- and must consist of elements separated by slash characters.
- </p></li><li class="listitem"><p>
- Each element must only contain the ASCII characters
- "[A-Z][a-z][0-9]_"
- </p></li><li class="listitem"><p>
- No element may be the empty string.
- </p></li><li class="listitem"><p>
- Multiple '/' characters cannot occur in sequence.
- </p></li><li class="listitem"><p>
- A trailing '/' character is not allowed unless the
- path is the root path (a single '/' character).
- </p></li></ul></div><p>
- </p><p>
- Object paths are often namespaced by starting with a reversed
- domain name and containing an interface version number, in the
- same way as
- <a class="link" href="#message-protocol-names-interface" title="Interface names">interface
- names</a> and
- <a class="link" href="#message-protocol-names-bus" title="Bus names">well-known
- bus names</a>.
- This makes it possible to implement more than one service, or
- more than one version of a service, in the same process,
- even if the services share a connection but cannot otherwise
- co-operate (for instance, if they are implemented by different
- plugins).
- </p><p>
- For instance, if the owner of <code class="literal">example.com</code> is
- developing a D-Bus API for a music player, they might use the
- hierarchy of object paths that start with
- <code class="literal">/com/example/MusicPlayer1</code> for its objects.
- </p></div><div class="sect3" title="Valid Signatures"><div class="titlepage"><div><div><h4 class="title"><a name="message-protocol-marshaling-signature"></a>Valid Signatures</h4></div></div></div><p>
- An implementation must not send or accept invalid signatures.
- Valid signatures will conform to the following rules:
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
- The signature ends with a nul byte.
- </p></li><li class="listitem"><p>
- The signature is a list of single complete types.
- Arrays must have element types, and structs must
- have both open and close parentheses.
- </p></li><li class="listitem"><p>
- Only type codes and open and close parentheses are
- allowed in the signature. The <code class="literal">STRUCT</code> type code
- is not allowed in signatures, because parentheses
- are used instead.
- </p></li><li class="listitem"><p>
- The maximum depth of container type nesting is 32 array type
- codes and 32 open parentheses. This implies that the maximum
- total depth of recursion is 64, for an "array of array of array
- of ... struct of struct of struct of ..." where there are 32
- array and 32 struct.
- </p></li><li class="listitem"><p>
- The maximum length of a signature is 255.
- </p></li><li class="listitem"><p>
- Signatures must be nul-terminated.
- </p></li></ul></div><p>
- </p></div></div></div><div class="sect1" title="Message Protocol"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="message-protocol"></a>Message Protocol</h2></div></div></div><p>
- A <em class="firstterm">message</em> consists of a
- <em class="firstterm">header</em> and a <em class="firstterm">body</em>. If you
- think of a message as a package, the header is the address, and the body
- contains the package contents. The message delivery system uses the header
- information to figure out where to send the message and how to interpret
- it; the recipient interprets the body of the message.
- </p><p>
- The body of the message is made up of zero or more
- <em class="firstterm">arguments</em>, which are typed values, such as an
- integer or a byte array.
- </p><p>
- Both header and body use the D-Bus <a class="link" href="#type-system" title="Type System">type
- system</a> and format for serializing data.
- </p><div class="sect2" title="Message Format"><div class="titlepage"><div><div><h3 class="title"><a name="message-protocol-messages"></a>Message Format</h3></div></div></div><p>
- A message consists of a header and a body. The header is a block of
- values with a fixed signature and meaning. The body is a separate block
- of values, with a signature specified in the header.
- </p><p>
- The length of the header must be a multiple of 8, allowing the body to
- begin on an 8-byte boundary when storing the entire message in a single
- buffer. If the header does not naturally end on an 8-byte boundary
- up to 7 bytes of nul-initialized alignment padding must be added.
- </p><p>
- The message body need not end on an 8-byte boundary.
- </p><p>
- The maximum length of a message, including header, header alignment padding,
- and body is 2 to the 27th power or 134217728. Implementations must not
- send or accept messages exceeding this size.
- </p><p>
- The signature of the header is:
- </p><pre class="programlisting">
- "yyyyuua(yv)"
- </pre><p>
- Written out more readably, this is:
- </p><pre class="programlisting">
- BYTE, BYTE, BYTE, BYTE, UINT32, UINT32, ARRAY of STRUCT of (BYTE,VARIANT)
- </pre><p>
- </p><p>
- These values have the following meanings:
- </p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Value</th><th>Description</th></tr></thead><tbody><tr><td>1st <code class="literal">BYTE</code></td><td>Endianness flag; ASCII 'l' for little-endian
- or ASCII 'B' for big-endian. Both header and body are
- in this endianness.</td></tr><tr><td>2nd <code class="literal">BYTE</code></td><td><em class="firstterm">Message type</em>. Unknown types must be ignored.
- Currently-defined types are described below.
- </td></tr><tr><td>3rd <code class="literal">BYTE</code></td><td>Bitwise OR of flags. Unknown flags
- must be ignored. Currently-defined flags are described below.
- </td></tr><tr><td>4th <code class="literal">BYTE</code></td><td>Major protocol version of the sending application. If
- the major protocol version of the receiving application does not
- match, the applications will not be able to communicate and the
- D-Bus connection must be disconnected. The major protocol
- version for this version of the specification is 1.
- </td></tr><tr><td>1st <code class="literal">UINT32</code></td><td>Length in bytes of the message body, starting
- from the end of the header. The header ends after
- its alignment padding to an 8-boundary.
- </td></tr><tr><td>2nd <code class="literal">UINT32</code></td><td>The serial of this message, used as a cookie
- by the sender to identify the reply corresponding
- to this request. This must not be zero.
- </td></tr><tr><td><code class="literal">ARRAY</code> of <code class="literal">STRUCT</code> of (<code class="literal">BYTE</code>,<code class="literal">VARIANT</code>)</td><td>An array of zero or more <em class="firstterm">header
- fields</em> where the byte is the field code, and the
- variant is the field value. The message type determines
- which fields are required.
- </td></tr></tbody></table></div><p>
- </p><p>
- <em class="firstterm">Message types</em> that can appear in the second byte
- of the header are:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Conventional name</th><th>Decimal value</th><th>Description</th></tr></thead><tbody><tr><td><code class="literal">INVALID</code></td><td>0</td><td>This is an invalid type.</td></tr><tr><td><code class="literal">METHOD_CALL</code></td><td>1</td><td>Method call.</td></tr><tr><td><code class="literal">METHOD_RETURN</code></td><td>2</td><td>Method reply with returned data.</td></tr><tr><td><code class="literal">ERROR</code></td><td>3</td><td>Error reply. If the first argument exists and is a
- string, it is an error message.</td></tr><tr><td><code class="literal">SIGNAL</code></td><td>4</td><td>Signal emission.</td></tr></tbody></table></div><p>
- </p><p>
- Flags that can appear in the third byte of the header:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Conventional name</th><th>Hex value</th><th>Description</th></tr></thead><tbody><tr><td><code class="literal">NO_REPLY_EXPECTED</code></td><td>0x1</td><td>This message does not expect method return replies or
- error replies; the reply can be omitted as an
- optimization. However, it is compliant with this specification
- to return the reply despite this flag and the only harm
- from doing so is extra network traffic.
- </td></tr><tr><td><code class="literal">NO_AUTO_START</code></td><td>0x2</td><td>The bus must not launch an owner
- for the destination name in response to this message.
- </td></tr></tbody></table></div><p>
- </p><div class="sect3" title="Header Fields"><div class="titlepage"><div><div><h4 class="title"><a name="message-protocol-header-fields"></a>Header Fields</h4></div></div></div><p>
- The array at the end of the header contains <em class="firstterm">header
- fields</em>, where each field is a 1-byte field code followed
- by a field value. A header must contain the required header fields for
- its message type, and zero or more of any optional header
- fields. Future versions of this protocol specification may add new
- fields. Implementations must ignore fields they do not
- understand. Implementations must not invent their own header fields;
- only changes to this specification may introduce new header fields.
- </p><p>
- Again, if an implementation sees a header field code that it does not
- expect, it must ignore that field, as it will be part of a new
- (but compatible) version of this specification. This also applies
- to known header fields appearing in unexpected messages, for
- example: if a signal has a reply serial it must be ignored
- even though it has no meaning as of this version of the spec.
- </p><p>
- However, implementations must not send or accept known header fields
- with the wrong type stored in the field value. So for example a
- message with an <code class="literal">INTERFACE</code> field of type
- <code class="literal">UINT32</code> would be considered corrupt.
- </p><p>
- Here are the currently-defined header fields:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col><col><col></colgroup><thead><tr><th>Conventional Name</th><th>Decimal Code</th><th>Type</th><th>Required In</th><th>Description</th></tr></thead><tbody><tr><td><code class="literal">INVALID</code></td><td>0</td><td>N/A</td><td>not allowed</td><td>Not a valid field name (error if it appears in a message)</td></tr><tr><td><code class="literal">PATH</code></td><td>1</td><td><code class="literal">OBJECT_PATH</code></td><td><code class="literal">METHOD_CALL</code>, <code class="literal">SIGNAL</code></td><td>The object to send a call to,
- or the object a signal is emitted from.
- The special path
- <code class="literal">/org/freedesktop/DBus/Local</code> is reserved;
- implementations should not send messages with this path,
- and the reference implementation of the bus daemon will
- disconnect any application that attempts to do so.
- </td></tr><tr><td><code class="literal">INTERFACE</code></td><td>2</td><td><code class="literal">STRING</code></td><td><code class="literal">SIGNAL</code></td><td>
- The interface to invoke a method call on, or
- that a signal is emitted from. Optional for
- method calls, required for signals.
- The special interface
- <code class="literal">org.freedesktop.DBus.Local</code> is reserved;
- implementations should not send messages with this
- interface, and the reference implementation of the bus
- daemon will disconnect any application that attempts to
- do so.
- </td></tr><tr><td><code class="literal">MEMBER</code></td><td>3</td><td><code class="literal">STRING</code></td><td><code class="literal">METHOD_CALL</code>, <code class="literal">SIGNAL</code></td><td>The member, either the method name or signal name.</td></tr><tr><td><code class="literal">ERROR_NAME</code></td><td>4</td><td><code class="literal">STRING</code></td><td><code class="literal">ERROR</code></td><td>The name of the error that occurred, for errors</td></tr><tr><td><code class="literal">REPLY_SERIAL</code></td><td>5</td><td><code class="literal">UINT32</code></td><td><code class="literal">ERROR</code>, <code class="literal">METHOD_RETURN</code></td><td>The serial number of the message this message is a reply
- to. (The serial number is the second <code class="literal">UINT32</code> in the header.)</td></tr><tr><td><code class="literal">DESTINATION</code></td><td>6</td><td><code class="literal">STRING</code></td><td>optional</td><td>The name of the connection this message is intended for.
- Only used in combination with the message bus, see
- <a class="xref" href="#message-bus" title="Message Bus Specification">the section called &#8220;Message Bus Specification&#8221;</a>.</td></tr><tr><td><code class="literal">SENDER</code></td><td>7</td><td><code class="literal">STRING</code></td><td>optional</td><td>Unique name of the sending connection.
- The message bus fills in this field so it is reliable; the field is
- only meaningful in combination with the message bus.</td></tr><tr><td><code class="literal">SIGNATURE</code></td><td>8</td><td><code class="literal">SIGNATURE</code></td><td>optional</td><td>The signature of the message body.
- If omitted, it is assumed to be the
- empty signature "" (i.e. the body must be 0-length).</td></tr><tr><td><code class="literal">UNIX_FDS</code></td><td>9</td><td><code class="literal">UINT32</code></td><td>optional</td><td>The number of Unix file descriptors that
- accompany the message. If omitted, it is assumed
- that no Unix file descriptors accompany the
- message. The actual file descriptors need to be
- transferred via platform specific mechanism
- out-of-band. They must be sent at the same time as
- part of the message itself. They may not be sent
- before the first byte of the message itself is
- transferred or after the last byte of the message
- itself.</td></tr></tbody></table></div><p>
- </p></div></div><div class="sect2" title="Valid Names"><div class="titlepage"><div><div><h3 class="title"><a name="message-protocol-names"></a>Valid Names</h3></div></div></div><p>
- The various names in D-Bus messages have some restrictions.
- </p><p>
- There is a <em class="firstterm">maximum name length</em>
- of 255 which applies to bus names, interfaces, and members.
- </p><div class="sect3" title="Interface names"><div class="titlepage"><div><div><h4 class="title"><a name="message-protocol-names-interface"></a>Interface names</h4></div></div></div><p>
- Interfaces have names with type <code class="literal">STRING</code>, meaning that
- they must be valid UTF-8. However, there are also some
- additional restrictions that apply to interface names
- specifically:
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Interface names are composed of 1 or more elements separated by
- a period ('.') character. All elements must contain at least
- one character.
- </p></li><li class="listitem"><p>Each element must only contain the ASCII characters
- "[A-Z][a-z][0-9]_" and must not begin with a digit.
- </p></li><li class="listitem"><p>Interface names must contain at least one '.' (period)
- character (and thus at least two elements).
- </p></li><li class="listitem"><p>Interface names must not begin with a '.' (period) character.</p></li><li class="listitem"><p>Interface names must not exceed the maximum name length.</p></li></ul></div><p>
- </p><p>
- Interface names should start with the reversed DNS domain name of
- the author of the interface (in lower-case), like interface names
- in Java. It is conventional for the rest of the interface name
- to consist of words run together, with initial capital letters
- on all words ("CamelCase"). Several levels of hierarchy can be used.
- It is also a good idea to include the major version of the interface
- in the name, and increment it if incompatible changes are made;
- this way, a single object can implement several versions of an
- interface in parallel, if necessary.
- </p><p>
- For instance, if the owner of <code class="literal">example.com</code> is
- developing a D-Bus API for a music player, they might define
- interfaces called <code class="literal">com.example.MusicPlayer1</code>,
- <code class="literal">com.example.MusicPlayer1.Track</code> and
- <code class="literal">com.example.MusicPlayer1.Seekable</code>.
- </p><p>
- D-Bus does not distinguish between the concepts that would be
- called classes and interfaces in Java: either can be identified on
- D-Bus by an interface name.
- </p></div><div class="sect3" title="Bus names"><div class="titlepage"><div><div><h4 class="title"><a name="message-protocol-names-bus"></a>Bus names</h4></div></div></div><p>
- Connections have one or more bus names associated with them.
- A connection has exactly one bus name that is a <em class="firstterm">unique
- connection name</em>. The unique connection name remains
- with the connection for its entire lifetime.
- A bus name is of type <code class="literal">STRING</code>,
- meaning that it must be valid UTF-8. However, there are also
- some additional restrictions that apply to bus names
- specifically:
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Bus names that start with a colon (':')
- character are unique connection names. Other bus names
- are called <em class="firstterm">well-known bus names</em>.
- </p></li><li class="listitem"><p>Bus names are composed of 1 or more elements separated by
- a period ('.') character. All elements must contain at least
- one character.
- </p></li><li class="listitem"><p>Each element must only contain the ASCII characters
- "[A-Z][a-z][0-9]_-". Only elements that are part of a unique
- connection name may begin with a digit, elements in
- other bus names must not begin with a digit.
- </p></li><li class="listitem"><p>Bus names must contain at least one '.' (period)
- character (and thus at least two elements).
- </p></li><li class="listitem"><p>Bus names must not begin with a '.' (period) character.</p></li><li class="listitem"><p>Bus names must not exceed the maximum name length.</p></li></ul></div><p>
- </p><p>
- Note that the hyphen ('-') character is allowed in bus names but
- not in interface names.
- </p><p>
- Like <a class="link" href="#message-protocol-names-interface" title="Interface names">interface
- names</a>, well-known bus names should start with the
- reversed DNS domain name of the author of the interface (in
- lower-case), and it is conventional for the rest of the well-known
- bus name to consist of words run together, with initial
- capital letters. As with interface names, including a version
- number in well-known bus names is a good idea; it's possible to
- have the well-known bus name for more than one version
- simultaneously if backwards compatibility is required.
- </p><p>
- If a well-known bus name implies the presence of a "main" interface,
- that "main" interface is often given the same name as
- the well-known bus name, and situated at the corresponding object
- path. For instance, if the owner of <code class="literal">example.com</code>
- is developing a D-Bus API for a music player, they might define
- that any application that takes the well-known name
- <code class="literal">com.example.MusicPlayer1</code> should have an object
- at the object path <code class="literal">/com/example/MusicPlayer1</code>
- which implements the interface
- <code class="literal">com.example.MusicPlayer1</code>.
- </p></div><div class="sect3" title="Member names"><div class="titlepage"><div><div><h4 class="title"><a name="message-protocol-names-member"></a>Member names</h4></div></div></div><p>
- Member (i.e. method or signal) names:
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Must only contain the ASCII characters
- "[A-Z][a-z][0-9]_" and may not begin with a
- digit.</p></li><li class="listitem"><p>Must not contain the '.' (period) character.</p></li><li class="listitem"><p>Must not exceed the maximum name length.</p></li><li class="listitem"><p>Must be at least 1 byte in length.</p></li></ul></div><p>
- </p><p>
- It is conventional for member names on D-Bus to consist of
- capitalized words with no punctuation ("camel-case").
- Method names should usually be verbs, such as
- <code class="literal">GetItems</code>, and signal names should usually be
- a description of an event, such as <code class="literal">ItemsChanged</code>.
- </p></div><div class="sect3" title="Error names"><div class="titlepage"><div><div><h4 class="title"><a name="message-protocol-names-error"></a>Error names</h4></div></div></div><p>
- Error names have the same restrictions as interface names.
- </p><p>
- Error names have the same naming conventions as interface
- names, and often contain <code class="literal">.Error.</code>; for instance,
- the owner of <code class="literal">example.com</code> might define the
- errors <code class="literal">com.example.MusicPlayer.Error.FileNotFound</code>
- and <code class="literal">com.example.MusicPlayer.Error.OutOfMemory</code>.
- The errors defined by D-Bus itself, such as
- <code class="literal">org.freedesktop.DBus.Error.Failed</code>, follow a
- similar pattern.
- </p></div></div><div class="sect2" title="Message Types"><div class="titlepage"><div><div><h3 class="title"><a name="message-protocol-types"></a>Message Types</h3></div></div></div><p>
- Each of the message types (<code class="literal">METHOD_CALL</code>, <code class="literal">METHOD_RETURN</code>, <code class="literal">ERROR</code>, and
- <code class="literal">SIGNAL</code>) has its own expected usage conventions and header fields.
- This section describes these conventions.
- </p><div class="sect3" title="Method Calls"><div class="titlepage"><div><div><h4 class="title"><a name="message-protocol-types-method"></a>Method Calls</h4></div></div></div><p>
- Some messages invoke an operation on a remote object. These are
- called method call messages and have the type tag <code class="literal">METHOD_CALL</code>. Such
- messages map naturally to methods on objects in a typical program.
- </p><p>
- A method call message is required to have a <code class="literal">MEMBER</code> header field
- indicating the name of the method. Optionally, the message has an
- <code class="literal">INTERFACE</code> field giving the interface the method is a part of. In the
- absence of an <code class="literal">INTERFACE</code> field, if two interfaces on the same object have
- a method with the same name, it is undefined which of the two methods
- will be invoked. Implementations may also choose to return an error in
- this ambiguous case. However, if a method name is unique
- implementations must not require an interface field.
- </p><p>
- Method call messages also include a <code class="literal">PATH</code> field
- indicating the object to invoke the method on. If the call is passing
- through a message bus, the message will also have a
- <code class="literal">DESTINATION</code> field giving the name of the connection
- to receive the message.
- </p><p>
- When an application handles a method call message, it is required to
- return a reply. The reply is identified by a <code class="literal">REPLY_SERIAL</code> header field
- indicating the serial number of the <code class="literal">METHOD_CALL</code> being replied to. The
- reply can have one of two types; either <code class="literal">METHOD_RETURN</code> or <code class="literal">ERROR</code>.
- </p><p>
- If the reply has type <code class="literal">METHOD_RETURN</code>, the arguments to the reply message
- are the return value(s) or "out parameters" of the method call.
- If the reply has type <code class="literal">ERROR</code>, then an "exception" has been thrown,
- and the call fails; no return value will be provided. It makes
- no sense to send multiple replies to the same method call.
- </p><p>
- Even if a method call has no return values, a <code class="literal">METHOD_RETURN</code>
- reply is required, so the caller will know the method
- was successfully processed.
- </p><p>
- The <code class="literal">METHOD_RETURN</code> or <code class="literal">ERROR</code> reply message must have the <code class="literal">REPLY_SERIAL</code>
- header field.
- </p><p>
- If a <code class="literal">METHOD_CALL</code> message has the flag <code class="literal">NO_REPLY_EXPECTED</code>,
- then as an optimization the application receiving the method
- call may choose to omit the reply message (regardless of
- whether the reply would have been <code class="literal">METHOD_RETURN</code> or <code class="literal">ERROR</code>).
- However, it is also acceptable to ignore the <code class="literal">NO_REPLY_EXPECTED</code>
- flag and reply anyway.
- </p><p>
- Unless a message has the flag <code class="literal">NO_AUTO_START</code>, if the
- destination name does not exist then a program to own the destination
- name will be started before the message is delivered. The message
- will be held until the new program is successfully started or has
- failed to start; in case of failure, an error will be returned. This
- flag is only relevant in the context of a message bus, it is ignored
- during one-to-one communication with no intermediate bus.
- </p><div class="sect4" title="Mapping method calls to native APIs"><div class="titlepage"><div><div><h5 class="title"><a name="message-protocol-types-method-apis"></a>Mapping method calls to native APIs</h5></div></div></div><p>
- APIs for D-Bus may map method calls to a method call in a specific
- programming language, such as C++, or may map a method call written
- in an IDL to a D-Bus message.
- </p><p>
- In APIs of this nature, arguments to a method are often termed "in"
- (which implies sent in the <code class="literal">METHOD_CALL</code>), or "out" (which implies
- returned in the <code class="literal">METHOD_RETURN</code>). Some APIs such as CORBA also have
- "inout" arguments, which are both sent and received, i.e. the caller
- passes in a value which is modified. Mapped to D-Bus, an "inout"
- argument is equivalent to an "in" argument, followed by an "out"
- argument. You can't pass things "by reference" over the wire, so
- "inout" is purely an illusion of the in-process API.
- </p><p>
- Given a method with zero or one return values, followed by zero or more
- arguments, where each argument may be "in", "out", or "inout", the
- caller constructs a message by appending each "in" or "inout" argument,
- in order. "out" arguments are not represented in the caller's message.
- </p><p>
- The recipient constructs a reply by appending first the return value
- if any, then each "out" or "inout" argument, in order.
- "in" arguments are not represented in the reply message.
- </p><p>
- Error replies are normally mapped to exceptions in languages that have
- exceptions.
- </p><p>
- In converting from native APIs to D-Bus, it is perhaps nice to
- map D-Bus naming conventions ("FooBar") to native conventions
- such as "fooBar" or "foo_bar" automatically. This is OK
- as long as you can say that the native API is one that
- was specifically written for D-Bus. It makes the most sense
- when writing object implementations that will be exported
- over the bus. Object proxies used to invoke remote D-Bus
- objects probably need the ability to call any D-Bus method,
- and thus a magic name mapping like this could be a problem.
- </p><p>
- This specification doesn't require anything of native API bindings;
- the preceding is only a suggested convention for consistency
- among bindings.
- </p></div></div><div class="sect3" title="Signal Emission"><div class="titlepage"><div><div><h4 class="title"><a name="message-protocol-types-signal"></a>Signal Emission</h4></div></div></div><p>
- Unlike method calls, signal emissions have no replies.
- A signal emission is simply a single message of type <code class="literal">SIGNAL</code>.
- It must have three header fields: <code class="literal">PATH</code> giving the object
- the signal was emitted from, plus <code class="literal">INTERFACE</code> and <code class="literal">MEMBER</code> giving
- the fully-qualified name of the signal. The <code class="literal">INTERFACE</code> header is required
- for signals, though it is optional for method calls.
- </p></div><div class="sect3" title="Errors"><div class="titlepage"><div><div><h4 class="title"><a name="message-protocol-types-errors"></a>Errors</h4></div></div></div><p>
- Messages of type <code class="literal">ERROR</code> are most commonly replies
- to a <code class="literal">METHOD_CALL</code>, but may be returned in reply
- to any kind of message. The message bus for example
- will return an <code class="literal">ERROR</code> in reply to a signal emission if
- the bus does not have enough memory to send the signal.
- </p><p>
- An <code class="literal">ERROR</code> may have any arguments, but if the first
- argument is a <code class="literal">STRING</code>, it must be an error message.
- The error message may be logged or shown to the user
- in some way.
- </p></div><div class="sect3" title="Notation in this document"><div class="titlepage"><div><div><h4 class="title"><a name="message-protocol-types-notation"></a>Notation in this document</h4></div></div></div><p>
- This document uses a simple pseudo-IDL to describe particular method
- calls and signals. Here is an example of a method call:
- </p><pre class="programlisting">
- org.freedesktop.DBus.StartServiceByName (in STRING name, in UINT32 flags,
- out UINT32 resultcode)
- </pre><p>
- This means <code class="literal">INTERFACE</code> = org.freedesktop.DBus, <code class="literal">MEMBER</code> = StartServiceByName,
- <code class="literal">METHOD_CALL</code> arguments are <code class="literal">STRING</code> and <code class="literal">UINT32</code>, <code class="literal">METHOD_RETURN</code> argument
- is <code class="literal">UINT32</code>. Remember that the <code class="literal">MEMBER</code> field can't contain any '.' (period)
- characters so it's known that the last part of the name in
- the "IDL" is the member name.
- </p><p>
- In C++ that might end up looking like this:
- </p><pre class="programlisting">
- unsigned int org::freedesktop::DBus::StartServiceByName (const char *name,
- unsigned int flags);
- </pre><p>
- or equally valid, the return value could be done as an argument:
- </p><pre class="programlisting">
- void org::freedesktop::DBus::StartServiceByName (const char *name,
- unsigned int flags,
- unsigned int *resultcode);
- </pre><p>
- It's really up to the API designer how they want to make
- this look. You could design an API where the namespace wasn't used
- in C++, using STL or Qt, using varargs, or whatever you wanted.
- </p><p>
- Signals are written as follows:
- </p><pre class="programlisting">
- org.freedesktop.DBus.NameLost (STRING name)
- </pre><p>
- Signals don't specify "in" vs. "out" because only
- a single direction is possible.
- </p><p>
- It isn't especially encouraged to use this lame pseudo-IDL in actual
- API implementations; you might use the native notation for the
- language you're using, or you might use COM or CORBA IDL, for example.
- </p></div></div><div class="sect2" title="Invalid Protocol and Spec Extensions"><div class="titlepage"><div><div><h3 class="title"><a name="message-protocol-handling-invalid"></a>Invalid Protocol and Spec Extensions</h3></div></div></div><p>
- For security reasons, the D-Bus protocol should be strictly parsed and
- validated, with the exception of defined extension points. Any invalid
- protocol or spec violations should result in immediately dropping the
- connection without notice to the other end. Exceptions should be
- carefully considered, e.g. an exception may be warranted for a
- well-understood idiosyncrasy of a widely-deployed implementation. In
- cases where the other end of a connection is 100% trusted and known to
- be friendly, skipping validation for performance reasons could also make
- sense in certain cases.
- </p><p>
- Generally speaking violations of the "must" requirements in this spec
- should be considered possible attempts to exploit security, and violations
- of the "should" suggestions should be considered legitimate (though perhaps
- they should generate an error in some cases).
- </p><p>
- The following extension points are built in to D-Bus on purpose and must
- not be treated as invalid protocol. The extension points are intended
- for use by future versions of this spec, they are not intended for third
- parties. At the moment, the only way a third party could extend D-Bus
- without breaking interoperability would be to introduce a way to negotiate new
- feature support as part of the auth protocol, using EXTENSION_-prefixed
- commands. There is not yet a standard way to negotiate features.
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
- In the authentication protocol (see <a class="xref" href="#auth-protocol" title="Authentication Protocol">the section called &#8220;Authentication Protocol&#8221;</a>) unknown
- commands result in an ERROR rather than a disconnect. This enables
- future extensions to the protocol. Commands starting with EXTENSION_ are
- reserved for third parties.
- </p></li><li class="listitem"><p>
- The authentication protocol supports pluggable auth mechanisms.
- </p></li><li class="listitem"><p>
- The address format (see <a class="xref" href="#addresses" title="Server Addresses">the section called &#8220;Server Addresses&#8221;</a>) supports new
- kinds of transport.
- </p></li><li class="listitem"><p>
- Messages with an unknown type (something other than
- <code class="literal">METHOD_CALL</code>, <code class="literal">METHOD_RETURN</code>,
- <code class="literal">ERROR</code>, <code class="literal">SIGNAL</code>) are ignored.
- Unknown-type messages must still be well-formed in the same way
- as the known messages, however. They still have the normal
- header and body.
- </p></li><li class="listitem"><p>
- Header fields with an unknown or unexpected field code must be ignored,
- though again they must still be well-formed.
- </p></li><li class="listitem"><p>
- New standard interfaces (with new methods and signals) can of course be added.
- </p></li></ul></div><p>
- </p></div></div><div class="sect1" title="Authentication Protocol"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="auth-protocol"></a>Authentication Protocol</h2></div></div></div><p>
- Before the flow of messages begins, two applications must
- authenticate. A simple plain-text protocol is used for
- authentication; this protocol is a SASL profile, and maps fairly
- directly from the SASL specification. The message encoding is
- NOT used here, only plain text messages.
- </p><p>
- In examples, "C:" and "S:" indicate lines sent by the client and
- server respectively.
- </p><div class="sect2" title="Protocol Overview"><div class="titlepage"><div><div><h3 class="title"><a name="auth-protocol-overview"></a>Protocol Overview</h3></div></div></div><p>
- The protocol is a line-based protocol, where each line ends with
- \r\n. Each line begins with an all-caps ASCII command name containing
- only the character range [A-Z_], a space, then any arguments for the
- command, then the \r\n ending the line. The protocol is
- case-sensitive. All bytes must be in the ASCII character set.
-
- Commands from the client to the server are as follows:
-
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>AUTH [mechanism] [initial-response]</p></li><li class="listitem"><p>CANCEL</p></li><li class="listitem"><p>BEGIN</p></li><li class="listitem"><p>DATA &lt;data in hex encoding&gt;</p></li><li class="listitem"><p>ERROR [human-readable error explanation]</p></li><li class="listitem"><p>NEGOTIATE_UNIX_FD</p></li></ul></div><p>
-
- From server to client are as follows:
-
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>REJECTED &lt;space-separated list of mechanism names&gt;</p></li><li class="listitem"><p>OK &lt;GUID in hex&gt;</p></li><li class="listitem"><p>DATA &lt;data in hex encoding&gt;</p></li><li class="listitem"><p>ERROR</p></li><li class="listitem"><p>AGREE_UNIX_FD</p></li></ul></div><p>
- </p><p>
- Unofficial extensions to the command set must begin with the letters
- "EXTENSION_", to avoid conflicts with future official commands.
- For example, "EXTENSION_COM_MYDOMAIN_DO_STUFF".
- </p></div><div class="sect2" title="Special credentials-passing nul byte"><div class="titlepage"><div><div><h3 class="title"><a name="auth-nul-byte"></a>Special credentials-passing nul byte</h3></div></div></div><p>
- Immediately after connecting to the server, the client must send a
- single nul byte. This byte may be accompanied by credentials
- information on some operating systems that use sendmsg() with
- SCM_CREDS or SCM_CREDENTIALS to pass credentials over UNIX domain
- sockets. However, the nul byte must be sent even on other kinds of
- socket, and even on operating systems that do not require a byte to be
- sent in order to transmit credentials. The text protocol described in
- this document begins after the single nul byte. If the first byte
- received from the client is not a nul byte, the server may disconnect
- that client.
- </p><p>
- A nul byte in any context other than the initial byte is an error;
- the protocol is ASCII-only.
- </p><p>
- The credentials sent along with the nul byte may be used with the
- SASL mechanism EXTERNAL.
- </p></div><div class="sect2" title="AUTH command"><div class="titlepage"><div><div><h3 class="title"><a name="auth-command-auth"></a>AUTH command</h3></div></div></div><p>
- If an AUTH command has no arguments, it is a request to list
- available mechanisms. The server must respond with a REJECTED
- command listing the mechanisms it understands, or with an error.
- </p><p>
- If an AUTH command specifies a mechanism, and the server supports
- said mechanism, the server should begin exchanging SASL
- challenge-response data with the client using DATA commands.
- </p><p>
- If the server does not support the mechanism given in the AUTH
- command, it must send either a REJECTED command listing the mechanisms
- it does support, or an error.
- </p><p>
- If the [initial-response] argument is provided, it is intended for use
- with mechanisms that have no initial challenge (or an empty initial
- challenge), as if it were the argument to an initial DATA command. If
- the selected mechanism has an initial challenge and [initial-response]
- was provided, the server should reject authentication by sending
- REJECTED.
- </p><p>
- If authentication succeeds after exchanging DATA commands,
- an OK command must be sent to the client.
- </p><p>
- The first octet received by the server after the \r\n of the BEGIN
- command from the client must be the first octet of the
- authenticated/encrypted stream of D-Bus messages.
- </p><p>
- If BEGIN is received by the server, the first octet received
- by the client after the \r\n of the OK command must be the
- first octet of the authenticated/encrypted stream of D-Bus
- messages.
- </p></div><div class="sect2" title="CANCEL Command"><div class="titlepage"><div><div><h3 class="title"><a name="auth-command-cancel"></a>CANCEL Command</h3></div></div></div><p>
- At any time up to sending the BEGIN command, the client may send a
- CANCEL command. On receiving the CANCEL command, the server must
- send a REJECTED command and abort the current authentication
- exchange.
- </p></div><div class="sect2" title="DATA Command"><div class="titlepage"><div><div><h3 class="title"><a name="auth-command-data"></a>DATA Command</h3></div></div></div><p>
- The DATA command may come from either client or server, and simply
- contains a hex-encoded block of data to be interpreted
- according to the SASL mechanism in use.
- </p><p>
- Some SASL mechanisms support sending an "empty string";
- FIXME we need some way to do this.
- </p></div><div class="sect2" title="BEGIN Command"><div class="titlepage"><div><div><h3 class="title"><a name="auth-command-begin"></a>BEGIN Command</h3></div></div></div><p>
- The BEGIN command acknowledges that the client has received an
- OK command from the server, and that the stream of messages
- is about to begin.
- </p><p>
- The first octet received by the server after the \r\n of the BEGIN
- command from the client must be the first octet of the
- authenticated/encrypted stream of D-Bus messages.
- </p></div><div class="sect2" title="REJECTED Command"><div class="titlepage"><div><div><h3 class="title"><a name="auth-command-rejected"></a>REJECTED Command</h3></div></div></div><p>
- The REJECTED command indicates that the current authentication
- exchange has failed, and further exchange of DATA is inappropriate.
- The client would normally try another mechanism, or try providing
- different responses to challenges.
- </p><p>
- Optionally, the REJECTED command has a space-separated list of
- available auth mechanisms as arguments. If a server ever provides
- a list of supported mechanisms, it must provide the same list
- each time it sends a REJECTED message. Clients are free to
- ignore all lists received after the first.
- </p></div><div class="sect2" title="OK Command"><div class="titlepage"><div><div><h3 class="title"><a name="auth-command-ok"></a>OK Command</h3></div></div></div><p>
- The OK command indicates that the client has been
- authenticated. The client may now proceed with negotiating
- Unix file descriptor passing. To do that it shall send
- NEGOTIATE_UNIX_FD to the server.
- </p><p>
- Otherwise, the client must respond to the OK command by
- sending a BEGIN command, followed by its stream of messages,
- or by disconnecting. The server must not accept additional
- commands using this protocol after the BEGIN command has been
- received. Further communication will be a stream of D-Bus
- messages (optionally encrypted, as negotiated) rather than
- this protocol.
- </p><p>
- If a client sends BEGIN the first octet received by the client
- after the \r\n of the OK command must be the first octet of
- the authenticated/encrypted stream of D-Bus messages.
- </p><p>
- The OK command has one argument, which is the GUID of the server.
- See <a class="xref" href="#addresses" title="Server Addresses">the section called &#8220;Server Addresses&#8221;</a> for more on server GUIDs.
- </p></div><div class="sect2" title="ERROR Command"><div class="titlepage"><div><div><h3 class="title"><a name="auth-command-error"></a>ERROR Command</h3></div></div></div><p>
- The ERROR command indicates that either server or client did not
- know a command, does not accept the given command in the current
- context, or did not understand the arguments to the command. This
- allows the protocol to be extended; a client or server can send a
- command present or permitted only in new protocol versions, and if
- an ERROR is received instead of an appropriate response, fall back
- to using some other technique.
- </p><p>
- If an ERROR is sent, the server or client that sent the
- error must continue as if the command causing the ERROR had never been
- received. However, the the server or client receiving the error
- should try something other than whatever caused the error;
- if only canceling/rejecting the authentication.
- </p><p>
- If the D-Bus protocol changes incompatibly at some future time,
- applications implementing the new protocol would probably be able to
- check for support of the new protocol by sending a new command and
- receiving an ERROR from applications that don't understand it. Thus the
- ERROR feature of the auth protocol is an escape hatch that lets us
- negotiate extensions or changes to the D-Bus protocol in the future.
- </p></div><div class="sect2" title="NEGOTIATE_UNIX_FD Command"><div class="titlepage"><div><div><h3 class="title"><a name="auth-command-negotiate-unix-fd"></a>NEGOTIATE_UNIX_FD Command</h3></div></div></div><p>
- The NEGOTIATE_UNIX_FD command indicates that the client
- supports Unix file descriptor passing. This command may only
- be sent after the connection is authenticated, i.e. after OK
- was received by the client. This command may only be sent on
- transports that support Unix file descriptor passing.
- </p><p>
- On receiving NEGOTIATE_UNIX_FD the server must respond with
- either AGREE_UNIX_FD or ERROR. It shall respond the former if
- the transport chosen supports Unix file descriptor passing and
- the server supports this feature. It shall respond the latter
- if the transport does not support Unix file descriptor
- passing, the server does not support this feature, or the
- server decides not to enable file descriptor passing due to
- security or other reasons.
- </p></div><div class="sect2" title="AGREE_UNIX_FD Command"><div class="titlepage"><div><div><h3 class="title"><a name="auth-command-agree-unix-fd"></a>AGREE_UNIX_FD Command</h3></div></div></div><p>
- The AGREE_UNIX_FD command indicates that the server supports
- Unix file descriptor passing. This command may only be sent
- after the connection is authenticated, and the client sent
- NEGOTIATE_UNIX_FD to enable Unix file descriptor passing. This
- command may only be sent on transports that support Unix file
- descriptor passing.
- </p><p>
- On receiving AGREE_UNIX_FD the client must respond with BEGIN,
- followed by its stream of messages, or by disconnecting. The
- server must not accept additional commands using this protocol
- after the BEGIN command has been received. Further
- communication will be a stream of D-Bus messages (optionally
- encrypted, as negotiated) rather than this protocol.
- </p></div><div class="sect2" title="Future Extensions"><div class="titlepage"><div><div><h3 class="title"><a name="auth-command-future"></a>Future Extensions</h3></div></div></div><p>
- Future extensions to the authentication and negotiation
- protocol are possible. For that new commands may be
- introduced. If a client or server receives an unknown command
- it shall respond with ERROR and not consider this fatal. New
- 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="idp5623040"></a><p class="title"><b>Figure1.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="idp5624864"></a><p class="title"><b>Figure2.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
- S: DATA 8799cabb2ea93e
- C: DATA 8ac876e8f68ee9809bfa876e6f9876g8fa8e76e98f
- S: OK 1234deadbeef
- C: BEGIN
- </pre></div></div><p><br class="figure-break">
- </p><div class="figure"><a name="idp5626768"></a><p class="title"><b>Figure3.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="idp5628656"></a><p class="title"><b>Figure4.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
- S: DATA 8799cabb2ea93e
- C: DATA 8ac876e8f68ee9809bfa876e6f9876g8fa8e76e98f
- S: OK 1234deadbeef
- C: BEGIN
- </pre></div></div><p><br class="figure-break">
- </p><div class="figure"><a name="idp5630672"></a><p class="title"><b>Figure5.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
- S: DATA 8799cabb2ea93e
- C: DATA 8ac876e8f68ee9809bfa876e6f9876g8fa8e76e98f
- S: REJECTED
- C: AUTH SKEY 7ab83f32ee
- S: DATA 8799cabb2ea93e
- C: DATA 8ac876e8f68ee9809bfa876e6f9876g8fa8e76e98f
- S: OK 1234deadbeef
- C: BEGIN
- </pre></div></div><p><br class="figure-break">
- </p><div class="figure"><a name="idp5632848"></a><p class="title"><b>Figure6.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
- S: DATA 8799cabb2ea93e
- C: CANCEL
- S: REJECTED
- C: AUTH SKEY 7ab83f32ee
- S: DATA 8799cabb2ea93e
- C: DATA 8ac876e8f68ee9809bfa876e6f9876g8fa8e76e98f
- S: OK 1234deadbeef
- C: BEGIN
- </pre></div></div><p><br class="figure-break">
- </p><div class="figure"><a name="idp5634912"></a><p class="title"><b>Figure7.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
- S: OK 1234deadbeef
- C: NEGOTIATE_UNIX_FD
- S: AGREE_UNIX_FD
- C: BEGIN
- </pre></div></div><p><br class="figure-break">
- </p><div class="figure"><a name="idp5636912"></a><p class="title"><b>Figure8.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
- S: OK 1234deadbeef
- C: NEGOTIATE_UNIX_FD
- S: ERROR
- C: BEGIN
- </pre></div></div><p><br class="figure-break">
- </p></div><div class="sect2" title="Authentication state diagrams"><div class="titlepage"><div><div><h3 class="title"><a name="auth-states"></a>Authentication state diagrams</h3></div></div></div><p>
- This section documents the auth protocol in terms of
- a state machine for the client and the server. This is
- probably the most robust way to implement the protocol.
- </p><div class="sect3" title="Client states"><div class="titlepage"><div><div><h4 class="title"><a name="auth-states-client"></a>Client states</h4></div></div></div><p>
- To more precisely describe the interaction between the
- protocol state machine and the authentication mechanisms the
- following notation is used: MECH(CHALL) means that the
- server challenge CHALL was fed to the mechanism MECH, which
- returns one of
-
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
- CONTINUE(RESP) means continue the auth conversation
- and send RESP as the response to the server;
- </p></li><li class="listitem"><p>
- OK(RESP) means that after sending RESP to the server
- the client side of the auth conversation is finished
- and the server should return "OK";
- </p></li><li class="listitem"><p>
- ERROR means that CHALL was invalid and could not be
- processed.
- </p></li></ul></div><p>
-
- Both RESP and CHALL may be empty.
- </p><p>
- The Client starts by getting an initial response from the
- default mechanism and sends AUTH MECH RESP, or AUTH MECH if
- the mechanism did not provide an initial response. If the
- mechanism returns CONTINUE, the client starts in state
- <span class="emphasis"><em>WaitingForData</em></span>, if the mechanism
- returns OK the client starts in state
- <span class="emphasis"><em>WaitingForOK</em></span>.
- </p><p>
- The client should keep track of available mechanisms and
- which it mechanisms it has already attempted. This list is
- used to decide which AUTH command to send. When the list is
- exhausted, the client should give up and close the
- connection.
- </p><p title="WaitingForData"><b><span class="emphasis"><em>WaitingForData</em></span>.</b>
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
- Receive DATA CHALL
- </p><table border="0" summary="Simple list" class="simplelist"><tr><td>
- MECH(CHALL) returns CONTINUE(RESP) &#8594; send
- DATA RESP, goto
- <span class="emphasis"><em>WaitingForData</em></span>
- </td></tr><tr><td>
- MECH(CHALL) returns OK(RESP) &#8594; send DATA
- RESP, goto <span class="emphasis"><em>WaitingForOK</em></span>
- </td></tr><tr><td>
- MECH(CHALL) returns ERROR &#8594; send ERROR
- [msg], goto <span class="emphasis"><em>WaitingForData</em></span>
- </td></tr></table><p>
- </p></li><li class="listitem"><p>
- Receive REJECTED [mechs] &#8594;
- send AUTH [next mech], goto
- WaitingForData or <span class="emphasis"><em>WaitingForOK</em></span>
- </p></li><li class="listitem"><p>
- Receive ERROR &#8594; send
- CANCEL, goto
- <span class="emphasis"><em>WaitingForReject</em></span>
- </p></li><li class="listitem"><p>
- Receive OK &#8594; send
- BEGIN, terminate auth
- conversation, authenticated
- </p></li><li class="listitem"><p>
- Receive anything else &#8594; send
- ERROR, goto
- <span class="emphasis"><em>WaitingForData</em></span>
- </p></li></ul></div><p title="WaitingForData">
- </p><p title="WaitingForOK"><b><span class="emphasis"><em>WaitingForOK</em></span>.</b>
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
- Receive OK &#8594; send BEGIN, terminate auth
- conversation, <span class="emphasis"><em>authenticated</em></span>
- </p></li><li class="listitem"><p>
- Receive REJECT [mechs] &#8594; send AUTH [next mech],
- goto <span class="emphasis"><em>WaitingForData</em></span> or
- <span class="emphasis"><em>WaitingForOK</em></span>
- </p></li><li class="listitem"><p>
- Receive DATA &#8594; send CANCEL, goto
- <span class="emphasis"><em>WaitingForReject</em></span>
- </p></li><li class="listitem"><p>
- Receive ERROR &#8594; send CANCEL, goto
- <span class="emphasis"><em>WaitingForReject</em></span>
- </p></li><li class="listitem"><p>
- Receive anything else &#8594; send ERROR, goto
- <span class="emphasis"><em>WaitingForOK</em></span>
- </p></li></ul></div><p title="WaitingForOK">
- </p><p title="WaitingForReject"><b><span class="emphasis"><em>WaitingForReject</em></span>.</b>
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
- Receive REJECT [mechs] &#8594; send AUTH [next mech],
- goto <span class="emphasis"><em>WaitingForData</em></span> or
- <span class="emphasis"><em>WaitingForOK</em></span>
- </p></li><li class="listitem"><p>
- Receive anything else &#8594; terminate auth
- conversation, disconnect
- </p></li></ul></div><p title="WaitingForReject">
- </p></div><div class="sect3" title="Server states"><div class="titlepage"><div><div><h4 class="title"><a name="auth-states-server"></a>Server states</h4></div></div></div><p>
- For the server MECH(RESP) means that the client response
- RESP was fed to the the mechanism MECH, which returns one of
-
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
- CONTINUE(CHALL) means continue the auth conversation and
- send CHALL as the challenge to the client;
- </p></li><li class="listitem"><p>
- OK means that the client has been successfully
- authenticated;
- </p></li><li class="listitem"><p>
- REJECT means that the client failed to authenticate or
- there was an error in RESP.
- </p></li></ul></div><p>
-
- The server starts out in state
- <span class="emphasis"><em>WaitingForAuth</em></span>. If the client is
- rejected too many times the server must disconnect the
- client.
- </p><p title="WaitingForAuth"><b><span class="emphasis"><em>WaitingForAuth</em></span>.</b>
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
- Receive AUTH &#8594; send REJECTED [mechs], goto
- <span class="emphasis"><em>WaitingForAuth</em></span>
- </p></li><li class="listitem"><p>
- Receive AUTH MECH RESP
-
- </p><table border="0" summary="Simple list" class="simplelist"><tr><td>
- MECH not valid mechanism &#8594; send REJECTED
- [mechs], goto
- <span class="emphasis"><em>WaitingForAuth</em></span>
- </td></tr><tr><td>
- MECH(RESP) returns CONTINUE(CHALL) &#8594; send
- DATA CHALL, goto
- <span class="emphasis"><em>WaitingForData</em></span>
- </td></tr><tr><td>
- MECH(RESP) returns OK &#8594; send OK, goto
- <span class="emphasis"><em>WaitingForBegin</em></span>
- </td></tr><tr><td>
- MECH(RESP) returns REJECT &#8594; send REJECTED
- [mechs], goto
- <span class="emphasis"><em>WaitingForAuth</em></span>
- </td></tr></table><p>
- </p></li><li class="listitem"><p>
- Receive BEGIN &#8594; terminate
- auth conversation, disconnect
- </p></li><li class="listitem"><p>
- Receive ERROR &#8594; send REJECTED [mechs], goto
- <span class="emphasis"><em>WaitingForAuth</em></span>
- </p></li><li class="listitem"><p>
- Receive anything else &#8594; send
- ERROR, goto
- <span class="emphasis"><em>WaitingForAuth</em></span>
- </p></li></ul></div><p title="WaitingForAuth">
- </p><p title="WaitingForData"><b><span class="emphasis"><em>WaitingForData</em></span>.</b>
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
- Receive DATA RESP
- </p><table border="0" summary="Simple list" class="simplelist"><tr><td>
- MECH(RESP) returns CONTINUE(CHALL) &#8594; send
- DATA CHALL, goto
- <span class="emphasis"><em>WaitingForData</em></span>
- </td></tr><tr><td>
- MECH(RESP) returns OK &#8594; send OK, goto
- <span class="emphasis"><em>WaitingForBegin</em></span>
- </td></tr><tr><td>
- MECH(RESP) returns REJECT &#8594; send REJECTED
- [mechs], goto
- <span class="emphasis"><em>WaitingForAuth</em></span>
- </td></tr></table><p>
- </p></li><li class="listitem"><p>
- Receive BEGIN &#8594; terminate auth conversation,
- disconnect
- </p></li><li class="listitem"><p>
- Receive CANCEL &#8594; send REJECTED [mechs], goto
- <span class="emphasis"><em>WaitingForAuth</em></span>
- </p></li><li class="listitem"><p>
- Receive ERROR &#8594; send REJECTED [mechs], goto
- <span class="emphasis"><em>WaitingForAuth</em></span>
- </p></li><li class="listitem"><p>
- Receive anything else &#8594; send ERROR, goto
- <span class="emphasis"><em>WaitingForData</em></span>
- </p></li></ul></div><p title="WaitingForData">
- </p><p title="WaitingForBegin"><b><span class="emphasis"><em>WaitingForBegin</em></span>.</b>
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
- Receive BEGIN &#8594; terminate auth conversation,
- client authenticated
- </p></li><li class="listitem"><p>
- Receive CANCEL &#8594; send REJECTED [mechs], goto
- <span class="emphasis"><em>WaitingForAuth</em></span>
- </p></li><li class="listitem"><p>
- Receive ERROR &#8594; send REJECTED [mechs], goto
- <span class="emphasis"><em>WaitingForAuth</em></span>
- </p></li><li class="listitem"><p>
- Receive anything else &#8594; send ERROR, goto
- <span class="emphasis"><em>WaitingForBegin</em></span>
- </p></li></ul></div><p title="WaitingForBegin">
- </p></div></div><div class="sect2" title="Authentication mechanisms"><div class="titlepage"><div><div><h3 class="title"><a name="auth-mechanisms"></a>Authentication mechanisms</h3></div></div></div><p>
- This section describes some new authentication mechanisms.
- D-Bus also allows any standard SASL mechanism of course.
- </p><div class="sect3" title="DBUS_COOKIE_SHA1"><div class="titlepage"><div><div><h4 class="title"><a name="auth-mechanisms-sha"></a>DBUS_COOKIE_SHA1</h4></div></div></div><p>
- The DBUS_COOKIE_SHA1 mechanism is designed to establish that a client
- has the ability to read a private file owned by the user being
- authenticated. If the client can prove that it has access to a secret
- cookie stored in this file, then the client is authenticated.
- Thus the security of DBUS_COOKIE_SHA1 depends on a secure home
- directory.
- </p><p>
- Throughout this description, "hex encoding" must output the digits
- from a to f in lower-case; the digits A to F must not be used
- in the DBUS_COOKIE_SHA1 mechanism.
- </p><p>
- Authentication proceeds as follows:
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
- The client sends the username it would like to authenticate
- as, hex-encoded.
- </p></li><li class="listitem"><p>
- The server sends the name of its "cookie context" (see below); a
- space character; the integer ID of the secret cookie the client
- must demonstrate knowledge of; a space character; then a
- randomly-generated challenge string, all of this hex-encoded into
- one, single string.
- </p></li><li class="listitem"><p>
- The client locates the cookie and generates its own
- randomly-generated challenge string. The client then concatenates
- the server's decoded challenge, a ":" character, its own challenge,
- another ":" character, and the cookie. It computes the SHA-1 hash
- of this composite string as a hex digest. It concatenates the
- client's challenge string, a space character, and the SHA-1 hex
- digest, hex-encodes the result and sends it back to the server.
- </p></li><li class="listitem"><p>
- The server generates the same concatenated string used by the
- client and computes its SHA-1 hash. It compares the hash with
- the hash received from the client; if the two hashes match, the
- client is authenticated.
- </p></li></ul></div><p>
- </p><p>
- Each server has a "cookie context," which is a name that identifies a
- set of cookies that apply to that server. A sample context might be
- "org_freedesktop_session_bus". Context names must be valid ASCII,
- nonzero length, and may not contain the characters slash ("/"),
- backslash ("\"), space (" "), newline ("\n"), carriage return ("\r"),
- tab ("\t"), or period ("."). There is a default context,
- "org_freedesktop_general" that's used by servers that do not specify
- otherwise.
- </p><p>
- Cookies are stored in a user's home directory, in the directory
- <code class="filename">~/.dbus-keyrings/</code>. This directory must
- not be readable or writable by other users. If it is,
- clients and servers must ignore it. The directory
- contains cookie files named after the cookie context.
- </p><p>
- A cookie file contains one cookie per line. Each line
- has three space-separated fields:
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
- The cookie ID number, which must be a non-negative integer and
- may not be used twice in the same file.
- </p></li><li class="listitem"><p>
- The cookie's creation time, in UNIX seconds-since-the-epoch
- format.
- </p></li><li class="listitem"><p>
- The cookie itself, a hex-encoded random block of bytes. The cookie
- may be of any length, though obviously security increases
- as the length increases.
- </p></li></ul></div><p>
- </p><p>
- Only server processes modify the cookie file.
- They must do so with this procedure:
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
- Create a lockfile name by appending ".lock" to the name of the
- cookie file. The server should attempt to create this file
- using <code class="literal">O_CREAT | O_EXCL</code>. If file creation
- 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="idp5723008" href="#ftn.idp5723008" 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
- timeout can be fairly short), or more than a reasonable
- time in the future (so that cookies never accidentally
- become permanent, if the clock was set far into the future
- at some point). If no recent keys remain, the
- server may generate a new key.
- </p></li><li class="listitem"><p>
- The pruned and possibly added-to cookie file
- must be resaved atomically (using a temporary
- file which is rename()'d).
- </p></li><li class="listitem"><p>
- The lock must be dropped by deleting the lockfile.
- </p></li></ul></div><p>
- </p><p>
- Clients need not lock the file in order to load it,
- because servers are required to save the file atomically.
- </p></div></div></div><div class="sect1" title="Server Addresses"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="addresses"></a>Server Addresses</h2></div></div></div><p>
- Server addresses consist of a transport name followed by a colon, and
- then an optional, comma-separated list of keys and values in the form key=value.
- Each value is escaped.
- </p><p>
- For example:
- </p><pre class="programlisting">unix:path=/tmp/dbus-test</pre><p>
- Which is the address to a unix socket with the path /tmp/dbus-test.
- </p><p>
- Value escaping is similar to URI escaping but simpler.
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
- The set of optionally-escaped bytes is:
- <code class="literal">[0-9A-Za-z_-/.\]</code>. To escape, each
- <span class="emphasis"><em>byte</em></span> (note, not character) which is not in the
- set of optionally-escaped bytes must be replaced with an ASCII
- percent (<code class="literal">%</code>) and the value of the byte in hex.
- The hex value must always be two digits, even if the first digit is
- zero. The optionally-escaped bytes may be escaped if desired.
- </p></li><li class="listitem"><p>
- To unescape, append each byte in the value; if a byte is an ASCII
- percent (<code class="literal">%</code>) character then append the following
- hex value instead. It is an error if a <code class="literal">%</code> byte
- does not have two hex digits following. It is an error if a
- non-optionally-escaped byte is seen unescaped.
- </p></li></ul></div><p>
- The set of optionally-escaped bytes is intended to preserve address
- readability and convenience.
- </p><p>
- A server may specify a key-value pair with the key <code class="literal">guid</code>
- and the value a hex-encoded 16-byte sequence. <a class="xref" href="#uuids" title="UUIDs">the section called &#8220;UUIDs&#8221;</a>
- describes the format of the <code class="literal">guid</code> field. If present,
- this UUID may be used to distinguish one server address from another. A
- server should use a different UUID for each address it listens on. For
- example, if a message bus daemon offers both UNIX domain socket and TCP
- connections, but treats clients the same regardless of how they connect,
- those two connections are equivalent post-connection but should have
- distinct UUIDs to distinguish the kinds of connection.
- </p><p>
- The intent of the address UUID feature is to allow a client to avoid
- opening multiple identical connections to the same server, by allowing the
- client to check whether an address corresponds to an already-existing
- connection. Comparing two addresses is insufficient, because addresses
- can be recycled by distinct servers, and equivalent addresses may look
- different if simply compared as strings (for example, the host in a TCP
- address can be given as an IP address or as a hostname).
- </p><p>
- Note that the address key is <code class="literal">guid</code> even though the
- rest of the API and documentation says "UUID," for historical reasons.
- </p><p>
- [FIXME clarify if attempting to connect to each is a requirement
- or just a suggestion]
- When connecting to a server, multiple server addresses can be
- separated by a semi-colon. The library will then try to connect
- to the first address and if that fails, it'll try to connect to
- the next one specified, and so forth. For example
- </p><pre class="programlisting">unix:path=/tmp/dbus-test;unix:path=/tmp/dbus-test2</pre><p>
- </p></div><div class="sect1" title="Transports"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="transports"></a>Transports</h2></div></div></div><p>
- [FIXME we need to specify in detail each transport and its possible arguments]
-
- Current transports include: unix domain sockets (including
- abstract namespace on linux), launchd, systemd, TCP/IP, an executed subprocess and a debug/testing transport
- using in-process pipes. Future possible transports include one that
- tunnels over X11 protocol.
- </p><div class="sect2" title="Unix Domain Sockets"><div class="titlepage"><div><div><h3 class="title"><a name="transports-unix-domain-sockets"></a>Unix Domain Sockets</h3></div></div></div><p>
- Unix domain sockets can be either paths in the file system or on Linux
- kernels, they can be abstract which are similar to paths but
- do not show up in the file system.
- </p><p>
- When a socket is opened by the D-Bus library it truncates the path
- name right before the first trailing Nul byte. This is true for both
- normal paths and abstract paths. Note that this is a departure from
- previous versions of D-Bus that would create sockets with a fixed
- length path name. Names which were shorter than the fixed length
- would be padded by Nul bytes.
- </p><p>
- Unix domain sockets are not available on Windows.
- </p><div class="sect3" title="Server Address Format"><div class="titlepage"><div><div><h4 class="title"><a name="transports-unix-domain-sockets-addresses"></a>Server Address Format</h4></div></div></div><p>
- Unix domain socket addresses are identified by the "unix:" prefix
- and support the following key/value pairs:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Name</th><th>Values</th><th>Description</th></tr></thead><tbody><tr><td>path</td><td>(path)</td><td>path of the unix domain socket. If set, the "tmpdir" and "abstract" key must not be set.</td></tr><tr><td>tmpdir</td><td>(path)</td><td>temporary directory in which a socket file with a random file name starting with 'dbus-' will be created by the server. This key can only be used in server addresses, not in client addresses. If set, the "path" and "abstract" key must not be set.</td></tr><tr><td>abstract</td><td>(string)</td><td>unique string (path) in the abstract namespace. If set, the "path" or "tempdir" key must not be set.</td></tr></tbody></table></div></div></div><div class="sect2" title="launchd"><div class="titlepage"><div><div><h3 class="title"><a name="transports-launchd"></a>launchd</h3></div></div></div><p>
- launchd is an open-source server management system that replaces init, inetd
- and cron on Apple Mac OS X versions 10.4 and above. It provides a common session
- bus address for each user and deprecates the X11-enabled D-Bus launcher on OSX.
- </p><p>
- launchd allocates a socket and provides it with the unix path through the
- DBUS_LAUNCHD_SESSION_BUS_SOCKET variable in launchd's environment. Every process
- spawned by launchd (or dbus-daemon, if it was started by launchd) can access
- it through its environment.
- Other processes can query for the launchd socket by executing:
- $ launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET
- This is normally done by the D-Bus client library so doesn't have to be done
- manually.
- </p><p>
- launchd is not available on Microsoft Windows.
- </p><div class="sect3" title="Server Address Format"><div class="titlepage"><div><div><h4 class="title"><a name="transports-launchd-addresses"></a>Server Address Format</h4></div></div></div><p>
- launchd addresses are identified by the "launchd:" prefix
- and support the following key/value pairs:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Name</th><th>Values</th><th>Description</th></tr></thead><tbody><tr><td>env</td><td>(environment variable)</td><td>path of the unix domain socket for the launchd created dbus-daemon.</td></tr></tbody></table></div></div></div><div class="sect2" title="systemd"><div class="titlepage"><div><div><h3 class="title"><a name="transports-systemd"></a>systemd</h3></div></div></div><p>
- systemd is an open-source server management system that
- replaces init and inetd on newer Linux systems. It supports
- socket activation. The D-Bus systemd transport is used to acquire
- socket activation file descriptors from systemd and use them
- as D-Bus transport when the current process is spawned by
- socket activation from it.
- </p><p>
- The systemd transport accepts only one or more Unix domain or
- TCP streams sockets passed in via socket activation.
- </p><p>
- The systemd transport is not available on non-Linux operating systems.
- </p><p>
- The systemd transport defines no parameter keys.
- </p></div><div class="sect2" title="TCP Sockets"><div class="titlepage"><div><div><h3 class="title"><a name="transports-tcp-sockets"></a>TCP Sockets</h3></div></div></div><p>
- The tcp transport provides TCP/IP based connections between clients
- located on the same or different hosts.
- </p><p>
- Using tcp transport without any additional secure authentification mechanismus
- over a network is unsecure.
- </p><p>
- Windows notes: Because of the tcp stack on Windows does not provide sending
- credentials over a tcp connection, the EXTERNAL authentification
- mechanismus does not work.
- </p><div class="sect3" title="Server Address Format"><div class="titlepage"><div><div><h4 class="title"><a name="transports-tcp-sockets-addresses"></a>Server Address Format</h4></div></div></div><p>
- TCP/IP socket addresses are identified by the "tcp:" prefix
- and support the following key/value pairs:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Name</th><th>Values</th><th>Description</th></tr></thead><tbody><tr><td>host</td><td>(string)</td><td>dns name or ip address</td></tr><tr><td>port</td><td>(number)</td><td>The tcp port the server will open. A zero value let the server
- choose a free port provided from the underlaying operating system.
- libdbus is able to retrieve the real used port from the server.
- </td></tr><tr><td>family</td><td>(string)</td><td>If set, provide the type of socket family either "ipv4" or "ipv6". If unset, the family is unspecified.</td></tr></tbody></table></div></div></div><div class="sect2" title="Nonce-secured TCP Sockets"><div class="titlepage"><div><div><h3 class="title"><a name="transports-nonce-tcp-sockets"></a>Nonce-secured TCP Sockets</h3></div></div></div><p>
- The nonce-tcp transport provides a secured TCP transport, using a
- simple authentication mechanism to ensure that only clients with read
- access to a certain location in the filesystem can connect to the server.
- The server writes a secret, the nonce, to a file and an incoming client
- connection is only accepted if the client sends the nonce right after
- the connect. The nonce mechanism requires no setup and is orthogonal to
- the higher-level authentication mechanisms described in the
- Authentication section.
- </p><p>
- On start, the server generates a random 16 byte nonce and writes it
- to a file in the user's temporary directory. The nonce file location
- is published as part of the server's D-Bus address using the
- "noncefile" key-value pair.
-
- After an accept, the server reads 16 bytes from the socket. If the
- read bytes do not match the nonce stored in the nonce file, the
- server MUST immediately drop the connection.
- If the nonce match the received byte sequence, the client is accepted
- and the transport behaves like an unsecured tcp transport.
- </p><p>
- After a successful connect to the server socket, the client MUST read
- the nonce from the file published by the server via the noncefile=
- key-value pair and send it over the socket. After that, the
- transport behaves like an unsecured tcp transport.
- </p><div class="sect3" title="Server Address Format"><div class="titlepage"><div><div><h4 class="title"><a name="transports-nonce-tcp-sockets-addresses"></a>Server Address Format</h4></div></div></div><p>
- Nonce TCP/IP socket addresses uses the "nonce-tcp:" prefix
- and support the following key/value pairs:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Name</th><th>Values</th><th>Description</th></tr></thead><tbody><tr><td>host</td><td>(string)</td><td>dns name or ip address</td></tr><tr><td>port</td><td>(number)</td><td>The tcp port the server will open. A zero value let the server
- choose a free port provided from the underlaying operating system.
- libdbus is able to retrieve the real used port from the server.
- </td></tr><tr><td>family</td><td>(string)</td><td>If set, provide the type of socket family either "ipv4" or "ipv6". If unset, the family is unspecified.</td></tr><tr><td>noncefile</td><td>(path)</td><td>file location containing the secret</td></tr></tbody></table></div></div></div><div class="sect2" title="Executed Subprocesses on Unix"><div class="titlepage"><div><div><h3 class="title"><a name="transports-exec"></a>Executed Subprocesses on Unix</h3></div></div></div><p>
- This transport forks off a process and connects its standard
- input and standard output with an anonymous Unix domain
- socket. This socket is then used for communication by the
- transport. This transport may be used to use out-of-process
- forwarder programs as basis for the D-Bus protocol.
- </p><p>
- The forked process will inherit the standard error output and
- process group from the parent process.
- </p><p>
- Executed subprocesses are not available on Windows.
- </p><div class="sect3" title="Server Address Format"><div class="titlepage"><div><div><h4 class="title"><a name="transports-exec-addresses"></a>Server Address Format</h4></div></div></div><p>
- Executed subprocess addresses are identified by the "unixexec:" prefix
- and support the following key/value pairs:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Name</th><th>Values</th><th>Description</th></tr></thead><tbody><tr><td>path</td><td>(path)</td><td>Path of the binary to execute, either an absolute
- path or a binary name that is searched for in the default
- search path of the OS. This corresponds to the first
- argument of execlp(). This key is mandatory.</td></tr><tr><td>argv0</td><td>(string)</td><td>The program name to use when executing the
- binary. If omitted the same value as specified for path=
- will be used. This corresponds to the second argument of
- execlp().</td></tr><tr><td>argv1, argv2, ...</td><td>(string)</td><td>Arguments to pass to the binary. This corresponds
- to the third and later arguments of execlp(). If a
- specific argvX is not specified no further argvY for Y &gt; X
- are taken into account.</td></tr></tbody></table></div></div></div></div><div class="sect1" title="Meta Transports"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="meta-transports"></a>Meta Transports</h2></div></div></div><p>
- Meta transports are a kind of transport with special enhancements or
- behavior. Currently available meta transports include: autolaunch
- </p><div class="sect2" title="Autolaunch"><div class="titlepage"><div><div><h3 class="title"><a name="meta-transports-autolaunch"></a>Autolaunch</h3></div></div></div><p>The autolaunch transport provides a way for dbus clients to autodetect
- a running dbus session bus and to autolaunch a session bus if not present.
- </p><div class="sect3" title="Server Address Format"><div class="titlepage"><div><div><h4 class="title"><a name="meta-transports-autolaunch-addresses"></a>Server Address Format</h4></div></div></div><p>
- Autolaunch addresses uses the "autolaunch:" prefix and support the
- following key/value pairs:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Name</th><th>Values</th><th>Description</th></tr></thead><tbody><tr><td>scope</td><td>(string)</td><td>scope of autolaunch (Windows only)
- <div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
- "*install-path" - limit session bus to dbus installation path.
- The dbus installation path is determined from the location of
- the shared dbus library. If the library is located in a 'bin'
- subdirectory the installation root is the directory above,
- otherwise the directory where the library lives is taken as
- installation root.
- </p><pre class="programlisting">
- &lt;install-root&gt;/bin/[lib]dbus-1.dll
- &lt;install-root&gt;/[lib]dbus-1.dll
- </pre><p>
- </p></li><li class="listitem"><p>
- "*user" - limit session bus to the recent user.
- </p></li><li class="listitem"><p>
- other values - specify dedicated session bus like "release",
- "debug" or other
- </p></li></ul></div>
- </td></tr></tbody></table></div></div><div class="sect3" title="Windows implementation"><div class="titlepage"><div><div><h4 class="title"><a name="meta-transports-autolaunch-windows-implementation"></a>Windows implementation</h4></div></div></div><p>
- On start, the server opens a platform specific transport, creates a mutex
- and a shared memory section containing the related session bus address.
- This mutex will be inspected by the dbus client library to detect a
- running dbus session bus. The access to the mutex and the shared memory
- section are protected by global locks.
- </p><p>
- In the recent implementation the autolaunch transport uses a tcp transport
- on localhost with a port choosen from the operating system. This detail may
- change in the future.
- </p><p>
- Disclaimer: The recent implementation is in an early state and may not
- work in all cirumstances and/or may have security issues. Because of this
- the implementation is not documentated yet.
- </p></div></div></div><div class="sect1" title="UUIDs"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="uuids"></a>UUIDs</h2></div></div></div><p>
- A working D-Bus implementation uses universally-unique IDs in two places.
- First, each server address has a UUID identifying the address,
- as described in <a class="xref" href="#addresses" title="Server Addresses">the section called &#8220;Server Addresses&#8221;</a>. Second, each operating
- system kernel instance running a D-Bus client or server has a UUID
- identifying that kernel, retrieved by invoking the method
- org.freedesktop.DBus.Peer.GetMachineId() (see <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>).
- </p><p>
- The term "UUID" in this document is intended literally, i.e. an
- identifier that is universally unique. It is not intended to refer to
- RFC4122, and in fact the D-Bus UUID is not compatible with that RFC.
- </p><p>
- The UUID must contain 128 bits of data and be hex-encoded. The
- hex-encoded string may not contain hyphens or other non-hex-digit
- characters, and it must be exactly 32 characters long. To generate a
- UUID, the current reference implementation concatenates 96 bits of random
- data followed by the 32-bit time in seconds since the UNIX epoch (in big
- endian byte order).
- </p><p>
- It would also be acceptable and probably better to simply generate 128
- bits of random data, as long as the random number generator is of high
- quality. The timestamp could conceivably help if the random bits are not
- very random. With a quality random number generator, collisions are
- extremely unlikely even with only 96 bits, so it's somewhat academic.
- </p><p>
- Implementations should, however, stick to random data for the first 96 bits
- of the UUID.
- </p></div><div class="sect1" title="Standard Interfaces"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="standard-interfaces"></a>Standard Interfaces</h2></div></div></div><p>
- See <a class="xref" href="#message-protocol-types-notation" title="Notation in this document">the section called &#8220;Notation in this document&#8221;</a> for details on
- the notation used in this section. There are some standard interfaces
- that may be useful across various D-Bus applications.
- </p><div class="sect2" title="org.freedesktop.DBus.Peer"><div class="titlepage"><div><div><h3 class="title"><a name="standard-interfaces-peer"></a><code class="literal">org.freedesktop.DBus.Peer</code></h3></div></div></div><p>
- The <code class="literal">org.freedesktop.DBus.Peer</code> interface
- has two methods:
- </p><pre class="programlisting">
- org.freedesktop.DBus.Peer.Ping ()
- org.freedesktop.DBus.Peer.GetMachineId (out STRING machine_uuid)
- </pre><p>
- </p><p>
- On receipt of the <code class="literal">METHOD_CALL</code> message
- <code class="literal">org.freedesktop.DBus.Peer.Ping</code>, an application should do
- nothing other than reply with a <code class="literal">METHOD_RETURN</code> as
- usual. It does not matter which object path a ping is sent to. The
- reference implementation handles this method automatically.
- </p><p>
- On receipt of the <code class="literal">METHOD_CALL</code> message
- <code class="literal">org.freedesktop.DBus.Peer.GetMachineId</code>, an application should
- reply with a <code class="literal">METHOD_RETURN</code> containing a hex-encoded
- UUID representing the identity of the machine the process is running on.
- This UUID must be the same for all processes on a single system at least
- until that system next reboots. It should be the same across reboots
- if possible, but this is not always possible to implement and is not
- guaranteed.
- It does not matter which object path a GetMachineId is sent to. The
- reference implementation handles this method automatically.
- </p><p>
- The UUID is intended to be per-instance-of-the-operating-system, so may represent
- a virtual machine running on a hypervisor, rather than a physical machine.
- Basically if two processes see the same UUID, they should also see the same
- shared memory, UNIX domain sockets, process IDs, and other features that require
- a running OS kernel in common between the processes.
- </p><p>
- The UUID is often used where other programs might use a hostname. Hostnames
- can change without rebooting, however, or just be "localhost" - so the UUID
- is more robust.
- </p><p>
- <a class="xref" href="#uuids" title="UUIDs">the section called &#8220;UUIDs&#8221;</a> explains the format of the UUID.
- </p></div><div class="sect2" title="org.freedesktop.DBus.Introspectable"><div class="titlepage"><div><div><h3 class="title"><a name="standard-interfaces-introspectable"></a><code class="literal">org.freedesktop.DBus.Introspectable</code></h3></div></div></div><p>
- This interface has one method:
- </p><pre class="programlisting">
- org.freedesktop.DBus.Introspectable.Introspect (out STRING xml_data)
- </pre><p>
- </p><p>
- Objects instances may implement
- <code class="literal">Introspect</code> which returns an XML description of
- the object, including its interfaces (with signals and methods), objects
- below it in the object path tree, and its properties.
- </p><p>
- <a class="xref" href="#introspection-format" title="Introspection Data Format">the section called &#8220;Introspection Data Format&#8221;</a> describes the format of this XML string.
- </p></div><div class="sect2" title="org.freedesktop.DBus.Properties"><div class="titlepage"><div><div><h3 class="title"><a name="standard-interfaces-properties"></a><code class="literal">org.freedesktop.DBus.Properties</code></h3></div></div></div><p>
- Many native APIs will have a concept of object <em class="firstterm">properties</em>
- or <em class="firstterm">attributes</em>. These can be exposed via the
- <code class="literal">org.freedesktop.DBus.Properties</code> interface.
- </p><p>
- </p><pre class="programlisting">
- org.freedesktop.DBus.Properties.Get (in STRING interface_name,
- in STRING property_name,
- out VARIANT value);
- org.freedesktop.DBus.Properties.Set (in STRING interface_name,
- in STRING property_name,
- in VARIANT value);
- org.freedesktop.DBus.Properties.GetAll (in STRING interface_name,
- out DICT&lt;STRING,VARIANT&gt; props);
- </pre><p>
- </p><p>
- It is conventional to give D-Bus properties names consisting of
- capitalized words without punctuation ("CamelCase"), like
- <a class="link" href="#message-protocol-names-member" title="Member names">member names</a>.
- For instance, the GObject property
- <code class="literal">connection-status</code> or the Qt property
- <code class="literal">connectionStatus</code> could be represented on D-Bus
- as <code class="literal">ConnectionStatus</code>.
- </p><p>
- Strictly speaking, D-Bus property names are not required to follow
- the same naming restrictions as member names, but D-Bus property
- names that would not be valid member names (in particular,
- GObject-style dash-separated property names) can cause interoperability
- problems and should be avoided.
- </p><p>
- The available properties and whether they are writable can be determined
- by calling <code class="literal">org.freedesktop.DBus.Introspectable.Introspect</code>,
- see <a class="xref" href="#standard-interfaces-introspectable" title="org.freedesktop.DBus.Introspectable">the section called &#8220;<code class="literal">org.freedesktop.DBus.Introspectable</code>&#8221;</a>.
- </p><p>
- An empty string may be provided for the interface name; in this case,
- if there are multiple properties on an object with the same name,
- the results are undefined (picking one by according to an arbitrary
- deterministic rule, or returning an error, are the reasonable
- possibilities).
- </p><p>
- If one or more properties change on an object, the
- <code class="literal">org.freedesktop.DBus.Properties.PropertiesChanged</code>
- signal may be emitted (this signal was added in 0.14):
- </p><p>
- </p><pre class="programlisting">
- org.freedesktop.DBus.Properties.PropertiesChanged (STRING interface_name,
- DICT&lt;STRING,VARIANT&gt; changed_properties,
- ARRAY&lt;STRING&gt; invalidated_properties);
- </pre><p>
- </p><p>
- where <code class="literal">changed_properties</code> is a dictionary
- containing the changed properties with the new values and
- <code class="literal">invalidated_properties</code> is an array of
- properties that changed but the value is not conveyed.
- </p><p>
- Whether the <code class="literal">PropertiesChanged</code> signal is
- supported can be determined by calling
- <code class="literal">org.freedesktop.DBus.Introspectable.Introspect</code>. Note
- that the signal may be supported for an object but it may
- differ how whether and how it is used on a per-property basis
- (for e.g. performance or security reasons). Each property (or
- the parent interface) must be annotated with the
- <code class="literal">org.freedesktop.DBus.Property.EmitsChangedSignal</code>
- annotation to convey this (usually the default value
- <code class="literal">true</code> is sufficient meaning that the
- annotation does not need to be used). See <a class="xref" href="#introspection-format" title="Introspection Data Format">the section called &#8220;Introspection Data Format&#8221;</a> for details on this
- annotation.
- </p></div><div class="sect2" title="org.freedesktop.DBus.ObjectManager"><div class="titlepage"><div><div><h3 class="title"><a name="standard-interfaces-objectmanager"></a><code class="literal">org.freedesktop.DBus.ObjectManager</code></h3></div></div></div><p>
- An API can optionally make use of this interface for one or
- more sub-trees of objects. The root of each sub-tree implements
- this interface so other applications can get all objects,
- interfaces and properties in a single method call. It is
- appropriate to use this interface if users of the tree of
- objects are expected to be interested in all interfaces of all
- objects in the tree; a more granular API should be used if
- users of the objects are expected to be interested in a small
- subset of the objects, a small subset of their interfaces, or
- both.
- </p><p>
- The method that applications can use to get all objects and
- properties is <code class="literal">GetManagedObjects</code>:
- </p><p>
- </p><pre class="programlisting">
- org.freedesktop.DBus.ObjectManager.GetManagedObjects (out DICT&lt;OBJPATH,DICT&lt;STRING,DICT&lt;STRING,VARIANT&gt;&gt;&gt; objpath_interfaces_and_properties);
- </pre><p>
- </p><p>
- The return value of this method is a dict whose keys are
- object paths. All returned object paths are children of the
- object path implementing this interface, i.e. their object
- paths start with the ObjectManager's object path plus '/'.
- </p><p>
- Each value is a dict whose keys are interfaces names. Each
- value in this inner dict is the same dict that would be
- returned by the <a class="link" href="#standard-interfaces-properties" title="org.freedesktop.DBus.Properties">org.freedesktop.DBus.Properties.GetAll()</a>
- method for that combination of object path and interface. If
- an interface has no properties, the empty dict is returned.
- </p><p>
- Changes are emitted using the following two signals:
- </p><p>
- </p><pre class="programlisting">
- org.freedesktop.DBus.ObjectManager.InterfacesAdded (OBJPATH object_path,
- DICT&lt;STRING,DICT&lt;STRING,VARIANT&gt;&gt; interfaces_and_properties);
- org.freedesktop.DBus.ObjectManager.InterfacesRemoved (OBJPATH object_path,
- ARRAY&lt;STRING&gt; interfaces);
- </pre><p>
- </p><p>
- The <code class="literal">InterfacesAdded</code> signal is emitted when
- either a new object is added or when an existing object gains
- one or more interfaces. The
- <code class="literal">InterfacesRemoved</code> signal is emitted
- whenever an object is removed or it loses one or more
- interfaces. The second parameter of the
- <code class="literal">InterfacesAdded</code> signal contains a dict with
- the interfaces and properties (if any) that have been added to
- the given object path. Similarly, the second parameter of the
- <code class="literal">InterfacesRemoved</code> signal contains an array
- of the interfaces that were removed. Note that changes on
- properties on existing interfaces are not reported using this
- interface - an application should also monitor the existing <a class="link" href="#standard-interfaces-properties" title="org.freedesktop.DBus.Properties">PropertiesChanged</a>
- signal on each object.
- </p><p>
- Applications SHOULD NOT export objects that are children of an
- object (directly or otherwise) implementing this interface but
- which are not returned in the reply from the
- <code class="literal">GetManagedObjects()</code> method of this
- interface on the given object.
- </p><p>
- The intent of the <code class="literal">ObjectManager</code> interface
- is to make it easy to write a robust client
- implementation. The trivial client implementation only needs
- to make two method calls:
- </p><p>
- </p><pre class="programlisting">
- org.freedesktop.DBus.AddMatch (bus_proxy,
- "type='signal',name='org.example.App',path_namespace='/org/example/App'");
- objects = org.freedesktop.DBus.ObjectManager.GetManagedObjects (app_proxy);
- </pre><p>
- </p><p>
- on the message bus and the remote application's
- <code class="literal">ObjectManager</code>, respectively. Whenever a new
- remote object is created (or an existing object gains a new
- interface), the <code class="literal">InterfacesAdded</code> signal is
- emitted, and since this signal contains all properties for the
- interfaces, no calls to the
- <code class="literal">org.freedesktop.Properties</code> interface on the
- remote object are needed. Additionally, since the initial
- <code class="literal">AddMatch()</code> rule already includes signal
- messages from the newly created child object, no new
- <code class="literal">AddMatch()</code> call is needed.
- </p><p>
- <span class="emphasis"><em>
- The <code class="literal">org.freedesktop.DBus.ObjectManager</code>
- interface was added in version 0.17 of the D-Bus
- specification.
- </em></span>
- </p></div></div><div class="sect1" title="Introspection Data Format"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="introspection-format"></a>Introspection Data Format</h2></div></div></div><p>
- As described in <a class="xref" href="#standard-interfaces-introspectable" title="org.freedesktop.DBus.Introspectable">the section called &#8220;<code class="literal">org.freedesktop.DBus.Introspectable</code>&#8221;</a>,
- objects may be introspected at runtime, returning an XML string
- that describes the object. The same XML format may be used in
- other contexts as well, for example as an "IDL" for generating
- static language bindings.
- </p><p>
- Here is an example of introspection data:
- </p><pre class="programlisting">
- &lt;!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"&gt;
- &lt;node name="/org/freedesktop/sample_object"&gt;
- &lt;interface name="org.freedesktop.SampleInterface"&gt;
- &lt;method name="Frobate"&gt;
- &lt;arg name="foo" type="i" direction="in"/&gt;
- &lt;arg name="bar" type="s" direction="out"/&gt;
- &lt;arg name="baz" type="a{us}" direction="out"/&gt;
- &lt;annotation name="org.freedesktop.DBus.Deprecated" value="true"/&gt;
- &lt;/method&gt;
- &lt;method name="Bazify"&gt;
- &lt;arg name="bar" type="(iiu)" direction="in"/&gt;
- &lt;arg name="bar" type="v" direction="out"/&gt;
- &lt;/method&gt;
- &lt;method name="Mogrify"&gt;
- &lt;arg name="bar" type="(iiav)" direction="in"/&gt;
- &lt;/method&gt;
- &lt;signal name="Changed"&gt;
- &lt;arg name="new_value" type="b"/&gt;
- &lt;/signal&gt;
- &lt;property name="Bar" type="y" access="readwrite"/&gt;
- &lt;/interface&gt;
- &lt;node name="child_of_sample_object"/&gt;
- &lt;node name="another_child_of_sample_object"/&gt;
- &lt;/node&gt;
- </pre><p>
- </p><p>
- A more formal DTD and spec needs writing, but here are some quick notes.
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
- Only the root &lt;node&gt; element can omit the node name, as it's
- known to be the object that was introspected. If the root
- &lt;node&gt; does have a name attribute, it must be an absolute
- object path. If child &lt;node&gt; have object paths, they must be
- relative.
- </p></li><li class="listitem"><p>
- If a child &lt;node&gt; has any sub-elements, then they
- must represent a complete introspection of the child.
- If a child &lt;node&gt; is empty, then it may or may
- not have sub-elements; the child must be introspected
- in order to find out. The intent is that if an object
- knows that its children are "fast" to introspect
- it can go ahead and return their information, but
- otherwise it can omit it.
- </p></li><li class="listitem"><p>
- The direction element on &lt;arg&gt; may be omitted,
- in which case it defaults to "in" for method calls
- and "out" for signals. Signals only allow "out"
- so while direction may be specified, it's pointless.
- </p></li><li class="listitem"><p>
- The possible directions are "in" and "out",
- unlike CORBA there is no "inout"
- </p></li><li class="listitem"><p>
- The possible property access flags are
- "readwrite", "read", and "write"
- </p></li><li class="listitem"><p>
- Multiple interfaces can of course be listed for
- one &lt;node&gt;.
- </p></li><li class="listitem"><p>
- The "name" attribute on arguments is optional.
- </p></li></ul></div><p>
- </p><p>
- Method, interface, property, and signal elements may have
- "annotations", which are generic key/value pairs of metadata.
- They are similar conceptually to Java's annotations and C# attributes.
- Well-known annotations:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Name</th><th>Values (separated by ,)</th><th>Description</th></tr></thead><tbody><tr><td>org.freedesktop.DBus.Deprecated</td><td>true,false</td><td>Whether or not the entity is deprecated; defaults to false</td></tr><tr><td>org.freedesktop.DBus.GLib.CSymbol</td><td>(string)</td><td>The C symbol; may be used for methods and interfaces</td></tr><tr><td>org.freedesktop.DBus.Method.NoReply</td><td>true,false</td><td>If set, don't expect a reply to the method call; defaults to false.</td></tr><tr><td>org.freedesktop.DBus.Property.EmitsChangedSignal</td><td>true,invalidates,false</td><td>
- <p>
- If set to <code class="literal">false</code>, the
- <code class="literal">org.freedesktop.DBus.Properties.PropertiesChanged</code>
- signal, see <a class="xref" href="#standard-interfaces-properties" title="org.freedesktop.DBus.Properties">the section called &#8220;<code class="literal">org.freedesktop.DBus.Properties</code>&#8221;</a> is not
- guaranteed to be emitted if the property changes.
- </p>
- <p>
- If set to <code class="literal">invalidates</code> the signal
- is emitted but the value is not included in the
- signal.
- </p>
- <p>
- If set to <code class="literal">true</code> the signal is
- emitted with the value included.
- </p>
- <p>
- The value for the annotation defaults to
- <code class="literal">true</code> if the enclosing interface
- element does not specify the annotation. Otherwise it
- defaults to the value specified in the enclosing
- interface element.
- </p>
- </td></tr></tbody></table></div></div><div class="sect1" title="Message Bus Specification"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="message-bus"></a>Message Bus Specification</h2></div></div></div><div class="sect2" title="Message Bus Overview"><div class="titlepage"><div><div><h3 class="title"><a name="message-bus-overview"></a>Message Bus Overview</h3></div></div></div><p>
- The message bus accepts connections from one or more applications.
- Once connected, applications can exchange messages with other
- applications that are also connected to the bus.
- </p><p>
- In order to route messages among connections, the message bus keeps a
- mapping from names to connections. Each connection has one
- unique-for-the-lifetime-of-the-bus name automatically assigned.
- Applications may request additional names for a connection. Additional
- names are usually "well-known names" such as
- "org.freedesktop.TextEditor". When a name is bound to a connection,
- that connection is said to <em class="firstterm">own</em> the name.
- </p><p>
- The bus itself owns a special name, <code class="literal">org.freedesktop.DBus</code>.
- This name routes messages to the bus, allowing applications to make
- administrative requests. For example, applications can ask the bus
- to assign a name to a connection.
- </p><p>
- Each name may have <em class="firstterm">queued owners</em>. When an
- application requests a name for a connection and the name is already in
- use, the bus will optionally add the connection to a queue waiting for
- the name. If the current owner of the name disconnects or releases
- the name, the next connection in the queue will become the new owner.
- </p><p>
- This feature causes the right thing to happen if you start two text
- editors for example; the first one may request "org.freedesktop.TextEditor",
- and the second will be queued as a possible owner of that name. When
- the first exits, the second will take over.
- </p><p>
- Applications may send <em class="firstterm">unicast messages</em> to
- a specific recipient or to the message bus itself, or
- <em class="firstterm">broadcast messages</em> to all interested recipients.
- See <a class="xref" href="#message-bus-routing" title="Message Bus Message Routing">the section called &#8220;Message Bus Message Routing&#8221;</a> for details.
- </p></div><div class="sect2" title="Message Bus Names"><div class="titlepage"><div><div><h3 class="title"><a name="message-bus-names"></a>Message Bus Names</h3></div></div></div><p>
- Each connection has at least one name, assigned at connection time and
- returned in response to the
- <code class="literal">org.freedesktop.DBus.Hello</code> method call. This
- automatically-assigned name is called the connection's <em class="firstterm">unique
- name</em>. Unique names are never reused for two different
- connections to the same bus.
- </p><p>
- Ownership of a unique name is a prerequisite for interaction with
- the message bus. It logically follows that the unique name is always
- the first name that an application comes to own, and the last
- one that it loses ownership of.
- </p><p>
- Unique connection names must begin with the character ':' (ASCII colon
- character); bus names that are not unique names must not begin
- with this character. (The bus must reject any attempt by an application
- to manually request a name beginning with ':'.) This restriction
- categorically prevents "spoofing"; messages sent to a unique name
- will always go to the expected connection.
- </p><p>
- When a connection is closed, all the names that it owns are deleted (or
- transferred to the next connection in the queue if any).
- </p><p>
- A connection can request additional names to be associated with it using
- the <code class="literal">org.freedesktop.DBus.RequestName</code> message. <a class="xref" href="#message-protocol-names-bus" title="Bus names">the section called &#8220;Bus names&#8221;</a> describes the format of a valid
- name. These names can be released again using the
- <code class="literal">org.freedesktop.DBus.ReleaseName</code> message.
- </p><div class="sect3" title="org.freedesktop.DBus.RequestName"><div class="titlepage"><div><div><h4 class="title"><a name="bus-messages-request-name"></a><code class="literal">org.freedesktop.DBus.RequestName</code></h4></div></div></div><p>
- As a method:
- </p><pre class="programlisting">
- UINT32 RequestName (in STRING name, in UINT32 flags)
- </pre><p>
- Message arguments:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Argument</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>STRING</td><td>Name to request</td></tr><tr><td>1</td><td>UINT32</td><td>Flags</td></tr></tbody></table></div><p>
- Reply arguments:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Argument</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>UINT32</td><td>Return value</td></tr></tbody></table></div><p>
- </p><p>
- This method call should be sent to
- <code class="literal">org.freedesktop.DBus</code> and asks the message bus to
- assign the given name to the method caller. Each name maintains a
- queue of possible owners, where the head of the queue is the primary
- or current owner of the name. Each potential owner in the queue
- maintains the DBUS_NAME_FLAG_ALLOW_REPLACEMENT and
- DBUS_NAME_FLAG_DO_NOT_QUEUE settings from its latest RequestName
- call. When RequestName is invoked the following occurs:
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
- If the method caller is currently the primary owner of the name,
- the DBUS_NAME_FLAG_ALLOW_REPLACEMENT and DBUS_NAME_FLAG_DO_NOT_QUEUE
- values are updated with the values from the new RequestName call,
- and nothing further happens.
- </p></li><li class="listitem"><p>
- If the current primary owner (head of the queue) has
- DBUS_NAME_FLAG_ALLOW_REPLACEMENT set, and the RequestName
- invocation has the DBUS_NAME_FLAG_REPLACE_EXISTING flag, then
- the caller of RequestName replaces the current primary owner at
- the head of the queue and the current primary owner moves to the
- second position in the queue. If the caller of RequestName was
- in the queue previously its flags are updated with the values from
- the new RequestName in addition to moving it to the head of the queue.
- </p></li><li class="listitem"><p>
- If replacement is not possible, and the method caller is
- currently in the queue but not the primary owner, its flags are
- updated with the values from the new RequestName call.
- </p></li><li class="listitem"><p>
- If replacement is not possible, and the method caller is
- currently not in the queue, the method caller is appended to the
- queue.
- </p></li><li class="listitem"><p>
- If any connection in the queue has DBUS_NAME_FLAG_DO_NOT_QUEUE
- set and is not the primary owner, it is removed from the
- queue. This can apply to the previous primary owner (if it
- was replaced) or the method caller (if it updated the
- DBUS_NAME_FLAG_DO_NOT_QUEUE flag while still stuck in the
- queue, or if it was just added to the queue with that flag set).
- </p></li></ul></div><p>
- </p><p>
- Note that DBUS_NAME_FLAG_REPLACE_EXISTING results in "jumping the
- queue," even if another application already in the queue had specified
- DBUS_NAME_FLAG_REPLACE_EXISTING. This comes up if a primary owner
- that does not allow replacement goes away, and the next primary owner
- does allow replacement. In this case, queued items that specified
- DBUS_NAME_FLAG_REPLACE_EXISTING <span class="emphasis"><em>do not</em></span>
- automatically replace the new primary owner. In other words,
- DBUS_NAME_FLAG_REPLACE_EXISTING is not saved, it is only used at the
- time RequestName is called. This is deliberate to avoid an infinite loop
- anytime two applications are both DBUS_NAME_FLAG_ALLOW_REPLACEMENT
- and DBUS_NAME_FLAG_REPLACE_EXISTING.
- </p><p>
- The flags argument contains any of the following values logically ORed
- together:
-
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Conventional Name</th><th>Value</th><th>Description</th></tr></thead><tbody><tr><td>DBUS_NAME_FLAG_ALLOW_REPLACEMENT</td><td>0x1</td><td>
-
- If an application A specifies this flag and succeeds in
- becoming the owner of the name, and another application B
- later calls RequestName with the
- DBUS_NAME_FLAG_REPLACE_EXISTING flag, then application A
- will lose ownership and receive a
- <code class="literal">org.freedesktop.DBus.NameLost</code> signal, and
- application B will become the new owner. If DBUS_NAME_FLAG_ALLOW_REPLACEMENT
- is not specified by application A, or DBUS_NAME_FLAG_REPLACE_EXISTING
- is not specified by application B, then application B will not replace
- application A as the owner.
-
- </td></tr><tr><td>DBUS_NAME_FLAG_REPLACE_EXISTING</td><td>0x2</td><td>
-
- Try to replace the current owner if there is one. If this
- flag is not set the application will only become the owner of
- the name if there is no current owner. If this flag is set,
- the application will replace the current owner if
- the current owner specified DBUS_NAME_FLAG_ALLOW_REPLACEMENT.
-
- </td></tr><tr><td>DBUS_NAME_FLAG_DO_NOT_QUEUE</td><td>0x4</td><td>
-
- Without this flag, if an application requests a name that is
- already owned, the application will be placed in a queue to
- own the name when the current owner gives it up. If this
- flag is given, the application will not be placed in the
- queue, the request for the name will simply fail. This flag
- also affects behavior when an application is replaced as
- name owner; by default the application moves back into the
- waiting queue, unless this flag was provided when the application
- became the name owner.
-
- </td></tr></tbody></table></div><p>
-
- The return code can be one of the following values:
-
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Conventional Name</th><th>Value</th><th>Description</th></tr></thead><tbody><tr><td>DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER</td><td>1</td><td>The caller is now the primary owner of
- the name, replacing any previous owner. Either the name had no
- owner before, or the caller specified
- DBUS_NAME_FLAG_REPLACE_EXISTING and the current owner specified
- DBUS_NAME_FLAG_ALLOW_REPLACEMENT.</td></tr><tr><td>DBUS_REQUEST_NAME_REPLY_IN_QUEUE</td><td>2</td><td>The name already had an owner,
- DBUS_NAME_FLAG_DO_NOT_QUEUE was not specified, and either
- the current owner did not specify
- DBUS_NAME_FLAG_ALLOW_REPLACEMENT or the requesting
- application did not specify DBUS_NAME_FLAG_REPLACE_EXISTING.
- </td></tr><tr><td>DBUS_REQUEST_NAME_REPLY_EXISTS</td><td>3</td><td>The name already has an owner,
- DBUS_NAME_FLAG_DO_NOT_QUEUE was specified, and either
- DBUS_NAME_FLAG_ALLOW_REPLACEMENT was not specified by the
- current owner, or DBUS_NAME_FLAG_REPLACE_EXISTING was not
- specified by the requesting application.</td></tr><tr><td>DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER</td><td>4</td><td>The application trying to request ownership of a name is already the owner of it.</td></tr></tbody></table></div><p>
- </p></div><div class="sect3" title="org.freedesktop.DBus.ReleaseName"><div class="titlepage"><div><div><h4 class="title"><a name="bus-messages-release-name"></a><code class="literal">org.freedesktop.DBus.ReleaseName</code></h4></div></div></div><p>
- As a method:
- </p><pre class="programlisting">
- UINT32 ReleaseName (in STRING name)
- </pre><p>
- Message arguments:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Argument</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>STRING</td><td>Name to release</td></tr></tbody></table></div><p>
- Reply arguments:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Argument</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>UINT32</td><td>Return value</td></tr></tbody></table></div><p>
- </p><p>
- This method call should be sent to
- <code class="literal">org.freedesktop.DBus</code> and asks the message bus to
- release the method caller's claim to the given name. If the caller is
- the primary owner, a new primary owner will be selected from the
- queue if any other owners are waiting. If the caller is waiting in
- the queue for the name, the caller will removed from the queue and
- will not be made an owner of the name if it later becomes available.
- If there are no other owners in the queue for the name, it will be
- removed from the bus entirely.
-
- The return code can be one of the following values:
-
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Conventional Name</th><th>Value</th><th>Description</th></tr></thead><tbody><tr><td>DBUS_RELEASE_NAME_REPLY_RELEASED</td><td>1</td><td>The caller has released his claim on
- the given name. Either the caller was the primary owner of
- the name, and the name is now unused or taken by somebody
- waiting in the queue for the name, or the caller was waiting
- in the queue for the name and has now been removed from the
- queue.</td></tr><tr><td>DBUS_RELEASE_NAME_REPLY_NON_EXISTENT</td><td>2</td><td>The given name does not exist on this bus.</td></tr><tr><td>DBUS_RELEASE_NAME_REPLY_NOT_OWNER</td><td>3</td><td>The caller was not the primary owner of this name,
- and was also not waiting in the queue to own this name.</td></tr></tbody></table></div><p>
- </p></div><div class="sect3" title="org.freedesktop.DBus.ListQueuedOwners"><div class="titlepage"><div><div><h4 class="title"><a name="bus-messages-list-queued-owners"></a><code class="literal">org.freedesktop.DBus.ListQueuedOwners</code></h4></div></div></div><p>
- As a method:
- </p><pre class="programlisting">
- ARRAY of STRING ListQueuedOwners (in STRING name)
- </pre><p>
- Message arguments:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Argument</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>STRING</td><td>The well-known bus name to query, such as
- <code class="literal">com.example.cappuccino</code></td></tr></tbody></table></div><p>
- Reply arguments:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Argument</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>ARRAY of STRING</td><td>The unique bus names of connections currently queued
- for the name</td></tr></tbody></table></div><p>
- </p><p>
- This method call should be sent to
- <code class="literal">org.freedesktop.DBus</code> and lists the connections
- currently queued for a bus name (see
- <a class="xref" href="#term-queued-owner" title="Queued Name Owner">Queued Name Owner</a>).
- </p></div></div><div class="sect2" title="Message Bus Message Routing"><div class="titlepage"><div><div><h3 class="title"><a name="message-bus-routing"></a>Message Bus Message Routing</h3></div></div></div><p>
- Messages may have a <code class="literal">DESTINATION</code> field (see <a class="xref" href="#message-protocol-header-fields" title="Header Fields">the section called &#8220;Header Fields&#8221;</a>), resulting in a
- <em class="firstterm">unicast message</em>. If the
- <code class="literal">DESTINATION</code> field is present, it specifies a message
- recipient by name. Method calls and replies normally specify this field.
- The message bus must send messages (of any type) with the
- <code class="literal">DESTINATION</code> field set to the specified recipient,
- regardless of whether the recipient has set up a match rule matching
- the message.
- </p><p>
- When the message bus receives a signal, if the
- <code class="literal">DESTINATION</code> field is absent, it is considered to
- be a <em class="firstterm">broadcast signal</em>, and is sent to all
- applications with <em class="firstterm">message matching rules</em> that
- match the message. Most signal messages are broadcasts.
- </p><p>
- Unicast signal messages (those with a <code class="literal">DESTINATION</code>
- field) are not commonly used, but they are treated like any unicast
- message: they are delivered to the specified receipient,
- regardless of its match rules. One use for unicast signals is to
- avoid a race condition in which a signal is emitted before the intended
- recipient can call <a class="xref" href="#bus-messages-add-match" title="org.freedesktop.DBus.AddMatch">the section called &#8220;<code class="literal">org.freedesktop.DBus.AddMatch</code>&#8221;</a> to
- receive that signal: if the signal is sent directly to that recipient
- using a unicast message, it does not need to add a match rule at all,
- and there is no race condition. Another use for unicast signals,
- on message buses whose security policy prevents eavesdropping, is to
- send sensitive information which should only be visible to one
- recipient.
- </p><p>
- When the message bus receives a method call, if the
- <code class="literal">DESTINATION</code> field is absent, the call is taken to be
- a standard one-to-one message and interpreted by the message bus
- itself. For example, sending an
- <code class="literal">org.freedesktop.DBus.Peer.Ping</code> message with no
- <code class="literal">DESTINATION</code> will cause the message bus itself to
- reply to the ping immediately; the message bus will not make this
- message visible to other applications.
- </p><p>
- Continuing the <code class="literal">org.freedesktop.DBus.Peer.Ping</code> example, if
- the ping message were sent with a <code class="literal">DESTINATION</code> name of
- <code class="literal">com.yoyodyne.Screensaver</code>, then the ping would be
- forwarded, and the Yoyodyne Corporation screensaver application would be
- expected to reply to the ping.
- </p><p>
- Message bus implementations may impose a security policy which
- prevents certain messages from being sent or received.
- When a message cannot be sent or received due to a security
- policy, the message bus should send an error reply, unless the
- original message had the <code class="literal">NO_REPLY</code> flag.
- </p><div class="sect3" title="Eavesdropping"><div class="titlepage"><div><div><h4 class="title"><a name="message-bus-routing-eavesdropping"></a>Eavesdropping</h4></div></div></div><p>
- Receiving a unicast message whose <code class="literal">DESTINATION</code>
- indicates a different recipient is called
- <em class="firstterm">eavesdropping</em>. On a message bus which acts as
- a security boundary (like the standard system bus), the security
- policy should usually prevent eavesdropping, since unicast messages
- are normally kept private and may contain security-sensitive
- information.
- </p><p>
- Eavesdropping is mainly useful for debugging tools, such as
- the <code class="literal">dbus-monitor</code> tool in the reference
- implementation of D-Bus. Tools which eavesdrop on the message bus
- should be careful to avoid sending a reply or error in response to
- messages intended for a different client.
- </p><p>
- Clients may attempt to eavesdrop by adding match rules
- (see <a class="xref" href="#message-bus-routing-match-rules" title="Match Rules">the section called &#8220;Match Rules&#8221;</a>) containing
- the <code class="literal">eavesdrop='true'</code> match. If the message bus'
- security policy does not allow eavesdropping, the match rule can
- still be added, but will not have any practical effect. For
- compatibility with older message bus implementations, if adding such
- a match rule results in an error reply, the client may fall back to
- adding the same rule with the <code class="literal">eavesdrop</code> match
- omitted.
- </p></div><div class="sect3" title="Match Rules"><div class="titlepage"><div><div><h4 class="title"><a name="message-bus-routing-match-rules"></a>Match Rules</h4></div></div></div><p>
- An important part of the message bus routing protocol is match
- rules. Match rules describe the messages that should be sent to a
- client, based on the contents of the message. Broadcast signals
- are only sent to clients which have a suitable match rule: this
- avoids waking up client processes to deal with signals that are
- not relevant to that client.
- </p><p>
- Messages that list a client as their <code class="literal">DESTINATION</code>
- do not need to match the client's match rules, and are sent to that
- client regardless. As a result, match rules are mainly used to
- receive a subset of broadcast signals.
- </p><p>
- Match rules can also be used for eavesdropping
- (see <a class="xref" href="#message-bus-routing-eavesdropping" title="Eavesdropping">the section called &#8220;Eavesdropping&#8221;</a>),
- if the security policy of the message bus allows it.
- </p><p>
- Match rules are added using the AddMatch bus method
- (see <a class="xref" href="#bus-messages-add-match" title="org.freedesktop.DBus.AddMatch">the section called &#8220;<code class="literal">org.freedesktop.DBus.AddMatch</code>&#8221;</a>). Rules are
- specified as a string of comma separated key/value pairs.
- Excluding a key from the rule indicates a wildcard match.
- For instance excluding the the member from a match rule but
- adding a sender would let all messages from that sender through.
- An example of a complete rule would be
- "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='Foo',path='/bar/foo',destination=':452345.34',arg2='bar'"
- </p><p>
- The following table describes the keys that can be used to create
- a match rule:
- The following table summarizes the D-Bus types.
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Key</th><th>Possible Values</th><th>Description</th></tr></thead><tbody><tr><td><code class="literal">type</code></td><td>'signal', 'method_call', 'method_return', 'error'</td><td>Match on the message type. An example of a type match is type='signal'</td></tr><tr><td><code class="literal">sender</code></td><td>A bus or unique name (see <a class="xref" href="#term-bus-name" title="Bus Name">Bus Name</a>
- and <a class="xref" href="#term-unique-name" title="Unique Connection Name">Unique Connection Name</a> respectively)
- </td><td>Match messages sent by a particular sender. An example of a sender match
- is sender='org.freedesktop.Hal'</td></tr><tr><td><code class="literal">interface</code></td><td>An interface name (see <a class="xref" href="#message-protocol-names-interface" title="Interface names">the section called &#8220;Interface names&#8221;</a>)</td><td>Match messages sent over or to a particular interface. An example of an
- interface match is interface='org.freedesktop.Hal.Manager'.
- If a message omits the interface header, it must not match any rule
- that specifies this key.</td></tr><tr><td><code class="literal">member</code></td><td>Any valid method or signal name</td><td>Matches messages which have the give method or signal name. An example of
- a member match is member='NameOwnerChanged'</td></tr><tr><td><code class="literal">path</code></td><td>An object path (see <a class="xref" href="#message-protocol-marshaling-object-path" title="Valid Object Paths">the section called &#8220;Valid Object Paths&#8221;</a>)</td><td>Matches messages which are sent from or to the given object. An example of a
- path match is path='/org/freedesktop/Hal/Manager'</td></tr><tr><td><code class="literal">path_namespace</code></td><td>An object path</td><td>
- <p>
- Matches messages which are sent from or to an
- object for which the object path is either the
- given value, or that value followed by one or
- more path components.
- </p>
-
- <p>
- For example,
- <code class="literal">path_namespace='/com/example/foo'</code>
- would match signals sent by
- <code class="literal">/com/example/foo</code>
- or by
- <code class="literal">/com/example/foo/bar</code>,
- but not by
- <code class="literal">/com/example/foobar</code>.
- </p>
-
- <p>
- Using both <code class="literal">path</code> and
- <code class="literal">path_namespace</code> in the same match
- rule is not allowed.
- </p>
-
- <p>
- <span class="emphasis"><em>
- This match key was added in version 0.16 of the
- D-Bus specification and implemented by the bus
- daemon in dbus 1.5.0 and later.
- </em></span>
- </p>
- </td></tr><tr><td><code class="literal">destination</code></td><td>A unique name (see <a class="xref" href="#term-unique-name" title="Unique Connection Name">Unique Connection Name</a>)</td><td>Matches messages which are being sent to the given unique name. An
- example of a destination match is destination=':1.0'</td></tr><tr><td><code class="literal">arg[0, 1, 2, 3, ...]</code></td><td>Any string</td><td>Arg matches are special and are used for further restricting the
- match based on the arguments in the body of a message. Only arguments of type
- STRING can be matched in this way. An example of an argument match
- would be arg3='Foo'. Only argument indexes from 0 to 63 should be
- accepted.</td></tr><tr><td><code class="literal">arg[0, 1, 2, 3, ...]path</code></td><td>Any string</td><td>
- <p>Argument path matches provide a specialised form of wildcard matching for
- path-like namespaces. They can match arguments whose type is either STRING or
- OBJECT_PATH. As with normal argument matches,
- if the argument is exactly equal to the string given in the match
- rule then the rule is satisfied. Additionally, there is also a
- match when either the string given in the match rule or the
- appropriate message argument ends with '/' and is a prefix of the
- other. An example argument path match is arg0path='/aa/bb/'. This
- would match messages with first arguments of '/', '/aa/',
- '/aa/bb/', '/aa/bb/cc/' and '/aa/bb/cc'. It would not match
- messages with first arguments of '/aa/b', '/aa' or even '/aa/bb'.</p>
-
- <p>This is intended for monitoring &#8220;directories&#8221; in file system-like
- hierarchies, as used in the <em class="citetitle">dconf</em> configuration
- system. An application interested in all nodes in a particular hierarchy would
- monitor <code class="literal">arg0path='/ca/example/foo/'</code>. Then the service could
- emit a signal with zeroth argument <code class="literal">"/ca/example/foo/bar"</code> to
- represent a modification to the &#8220;bar&#8221; property, or a signal with zeroth
- argument <code class="literal">"/ca/example/"</code> to represent atomic modification of
- many properties within that directory, and the interested application would be
- notified in both cases.</p>
- <p>
- <span class="emphasis"><em>
- This match key was added in version 0.12 of the
- D-Bus specification, implemented for STRING
- arguments by the bus daemon in dbus 1.2.0 and later,
- and implemented for OBJECT_PATH arguments in dbus 1.5.0
- and later.
- </em></span>
- </p>
- </td></tr><tr><td><code class="literal">arg0namespace</code></td><td>Like a bus name, except that the string is not
- required to contain a '.' (period)</td><td>
- <p>Match messages whose first argument is of type STRING, and is a bus name
- or interface name within the specified namespace. This is primarily intended
- for watching name owner changes for a group of related bus names, rather than
- for a single name or all name changes.</p>
-
- <p>Because every valid interface name is also a valid
- bus name, this can also be used for messages whose
- first argument is an interface name.</p>
-
- <p>For example, the match rule
- <code class="literal">member='NameOwnerChanged',arg0namespace='com.example.backend'</code>
- matches name owner changes for bus names such as
- <code class="literal">com.example.backend.foo</code>,
- <code class="literal">com.example.backend.foo.bar</code>, and
- <code class="literal">com.example.backend</code> itself.</p>
-
- <p>See also <a class="xref" href="#bus-messages-name-owner-changed" title="org.freedesktop.DBus.NameOwnerChanged">the section called &#8220;<code class="literal">org.freedesktop.DBus.NameOwnerChanged</code>&#8221;</a>.</p>
- <p>
- <span class="emphasis"><em>
- This match key was added in version 0.16 of the
- D-Bus specification and implemented by the bus
- daemon in dbus 1.5.0 and later.
- </em></span>
- </p>
- </td></tr><tr><td><code class="literal">eavesdrop</code></td><td><code class="literal">'true'</code>, <code class="literal">'false'</code></td><td>Since D-Bus 1.5.6, match rules do not
- match messages which have a <code class="literal">DESTINATION</code>
- field unless the match rule specifically
- requests this
- (see <a class="xref" href="#message-bus-routing-eavesdropping" title="Eavesdropping">the section called &#8220;Eavesdropping&#8221;</a>)
- by specifying <code class="literal">eavesdrop='true'</code>
- in the match rule. <code class="literal">eavesdrop='false'</code>
- restores the default behaviour. Messages are
- delivered to their <code class="literal">DESTINATION</code>
- regardless of match rules, so this match does not
- affect normal delivery of unicast messages.
- If the message bus has a security policy which forbids
- eavesdropping, this match may still be used without error,
- but will not have any practical effect.
- In older versions of D-Bus, this match was not allowed
- in match rules, and all match rules behaved as if
- <code class="literal">eavesdrop='true'</code> had been used.
- </td></tr></tbody></table></div><p>
- </p></div></div><div class="sect2" title="Message Bus Starting Services"><div class="titlepage"><div><div><h3 class="title"><a name="message-bus-starting-services"></a>Message Bus Starting Services</h3></div></div></div><p>
- The message bus can start applications on behalf of other applications.
- In CORBA terms, this would be called <em class="firstterm">activation</em>.
- An application that can be started in this way is called a
- <em class="firstterm">service</em>.
- </p><p>
- With D-Bus, starting a service is normally done by name. That is,
- applications ask the message bus to start some program that will own a
- well-known name, such as <code class="literal">org.freedesktop.TextEditor</code>.
- This implies a contract documented along with the name
- <code class="literal">org.freedesktop.TextEditor</code> for which objects
- the owner of that name will provide, and what interfaces those
- objects will have.
- </p><p>
- To find an executable corresponding to a particular name, the bus daemon
- looks for <em class="firstterm">service description files</em>. Service
- description files define a mapping from names to executables. Different
- kinds of message bus will look for these files in different places, see
- <a class="xref" href="#message-bus-types" title="Well-known Message Bus Instances">the section called &#8220;Well-known Message Bus Instances&#8221;</a>.
- </p><p>
- Service description files have the ".service" file
- extension. The message bus will only load service description files
- ending with .service; all other files will be ignored. The file format
- is similar to that of <a class="ulink" href="http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html" target="_top">desktop
- entries</a>. All service description files must be in UTF-8
- encoding. To ensure that there will be no name collisions, service files
- must be namespaced using the same mechanism as messages and service
- names.
- </p><p>
- [FIXME the file format should be much better specified than "similar to
- .desktop entries" esp. since desktop entries are already
- badly-specified. ;-)]
- These sections from the specification apply to service files as well:
-
- </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="idp6113920"></a><p class="title"><b>Figure9.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;
- Exec=/usr/libexec/gconfd-2
- </pre></div></div><p><br class="figure-break">
- </p><p>
- When an application asks to start a service by name, the bus daemon tries to
- find a service that will own that name. It then tries to spawn the
- executable associated with it. If this fails, it will report an
- error. [FIXME what happens if two .service files offer the same service;
- what kind of error is reported, should we have a way for the client to
- choose one?]
- </p><p>
- The executable launched will have the environment variable
- <code class="literal">DBUS_STARTER_ADDRESS</code> set to the address of the
- message bus so it can connect and request the appropriate names.
- </p><p>
- The executable being launched may want to know whether the message bus
- starting it is one of the well-known message buses (see <a class="xref" href="#message-bus-types" title="Well-known Message Bus Instances">the section called &#8220;Well-known Message Bus Instances&#8221;</a>). To facilitate this, the bus must also set
- the <code class="literal">DBUS_STARTER_BUS_TYPE</code> environment variable if it is one
- of the well-known buses. The currently-defined values for this variable
- are <code class="literal">system</code> for the systemwide message bus,
- and <code class="literal">session</code> for the per-login-session message
- bus. The new executable must still connect to the address given
- in <code class="literal">DBUS_STARTER_ADDRESS</code>, but may assume that the
- resulting connection is to the well-known bus.
- </p><p>
- [FIXME there should be a timeout somewhere, either specified
- in the .service file, by the client, or just a global value
- and if the client being activated fails to connect within that
- timeout, an error should be sent back.]
- </p><div class="sect3" title="Message Bus Service Scope"><div class="titlepage"><div><div><h4 class="title"><a name="message-bus-starting-services-scope"></a>Message Bus Service Scope</h4></div></div></div><p>
- The "scope" of a service is its "per-", such as per-session,
- per-machine, per-home-directory, or per-display. The reference
- implementation doesn't yet support starting services in a different
- scope from the message bus itself. So e.g. if you start a service
- on the session bus its scope is per-session.
- </p><p>
- We could add an optional scope to a bus name. For example, for
- per-(display,session pair), we could have a unique ID for each display
- generated automatically at login and set on screen 0 by executing a
- special "set display ID" binary. The ID would be stored in a
- <code class="literal">_DBUS_DISPLAY_ID</code> property and would be a string of
- random bytes. This ID would then be used to scope names.
- Starting/locating a service could be done by ID-name pair rather than
- only by name.
- </p><p>
- Contrast this with a per-display scope. To achieve that, we would
- want a single bus spanning all sessions using a given display.
- So we might set a <code class="literal">_DBUS_DISPLAY_BUS_ADDRESS</code>
- property on screen 0 of the display, pointing to this bus.
- </p></div></div><div class="sect2" title="Well-known Message Bus Instances"><div class="titlepage"><div><div><h3 class="title"><a name="message-bus-types"></a>Well-known Message Bus Instances</h3></div></div></div><p>
- Two standard message bus instances are defined here, along with how
- to locate them and where their service files live.
- </p><div class="sect3" title="Login session message bus"><div class="titlepage"><div><div><h4 class="title"><a name="message-bus-types-login"></a>Login session message bus</h4></div></div></div><p>
- Each time a user logs in, a <em class="firstterm">login session message
- bus</em> may be started. All applications in the user's login
- session may interact with one another using this message bus.
- </p><p>
- The address of the login session message bus is given
- in the <code class="literal">DBUS_SESSION_BUS_ADDRESS</code> environment
- variable. If that variable is not set, applications may
- also try to read the address from the X Window System root
- window property <code class="literal">_DBUS_SESSION_BUS_ADDRESS</code>.
- The root window property must have type <code class="literal">STRING</code>.
- The environment variable should have precedence over the
- root window property.
- </p><p>The address of the login session message bus is given in the
- <code class="literal">DBUS_SESSION_BUS_ADDRESS</code> environment variable. If
- DBUS_SESSION_BUS_ADDRESS is not set, or if it's set to the string
- "autolaunch:", the system should use platform-specific methods of
- locating a running D-Bus session server, or starting one if a running
- instance cannot be found. Note that this mechanism is not recommended
- for attempting to determine if a daemon is running. It is inherently
- racy to attempt to make this determination, since the bus daemon may
- be started just before or just after the determination is made.
- Therefore, it is recommended that applications do not try to make this
- determination for their functionality purposes, and instead they
- should attempt to start the server.</p><div class="sect4" title="X Windowing System"><div class="titlepage"><div><div><h5 class="title"><a name="message-bus-types-login-x-windows"></a>X Windowing System</h5></div></div></div><p>
- For the X Windowing System, the application must locate the
- window owner of the selection represented by the atom formed by
- concatenating:
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>the literal string "_DBUS_SESSION_BUS_SELECTION_"</p></li><li class="listitem"><p>the current user's username</p></li><li class="listitem"><p>the literal character '_' (underscore)</p></li><li class="listitem"><p>the machine's ID</p></li></ul></div><p>
- </p><p>
- The following properties are defined for the window that owns
- this X selection:
- </p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td>
- <p>Atom</p>
- </td><td>
- <p>meaning</p>
- </td></tr><tr><td>
- <p>_DBUS_SESSION_BUS_ADDRESS</p>
- </td><td>
- <p>the actual address of the server socket</p>
- </td></tr><tr><td>
- <p>_DBUS_SESSION_BUS_PID</p>
- </td><td>
- <p>the PID of the server process</p>
- </td></tr></tbody></table></div><p>
- </p><p>
- At least the _DBUS_SESSION_BUS_ADDRESS property MUST be
- present in this window.
- </p><p>
- If the X selection cannot be located or if reading the
- properties from the window fails, the implementation MUST conclude
- that there is no D-Bus server running and proceed to start a new
- server. (See below on concurrency issues)
- </p><p>
- Failure to connect to the D-Bus server address thus obtained
- MUST be treated as a fatal connection error and should be reported
- to the application.
- </p><p>
- As an alternative, an implementation MAY find the information
- in the following file located in the current user's home directory,
- in subdirectory .dbus/session-bus/:
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>the machine's ID</p></li><li class="listitem"><p>the literal character '-' (dash)</p></li><li class="listitem"><p>the X display without the screen number, with the
- following prefixes removed, if present: ":", "localhost:"
- ."localhost.localdomain:". That is, a display of
- "localhost:10.0" produces just the number "10"</p></li></ul></div><p>
- </p><p>
- The contents of this file NAME=value assignment pairs and
- lines starting with # are comments (no comments are allowed
- otherwise). The following variable names are defined:
- </p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td>
- <p>Variable</p>
- </td><td>
- <p>meaning</p>
- </td></tr><tr><td>
- <p>DBUS_SESSION_BUS_ADDRESS</p>
- </td><td>
- <p>the actual address of the server socket</p>
- </td></tr><tr><td>
- <p>DBUS_SESSION_BUS_PID</p>
- </td><td>
- <p>the PID of the server process</p>
- </td></tr><tr><td>
- <p>DBUS_SESSION_BUS_WINDOWID</p>
- </td><td>
- <p>the window ID</p>
- </td></tr></tbody></table></div><p>
- </p><p>
- At least the DBUS_SESSION_BUS_ADDRESS variable MUST be present
- in this file.
- </p><p>
- Failure to open this file MUST be interpreted as absence of a
- running server. Therefore, the implementation MUST proceed to
- attempting to launch a new bus server if the file cannot be
- opened.
- </p><p>
- However, success in opening this file MUST NOT lead to the
- conclusion that the server is running. Thus, a failure to connect to
- the bus address obtained by the alternative method MUST NOT be
- considered a fatal error. If the connection cannot be established,
- the implementation MUST proceed to check the X selection settings or
- to start the server on its own.
- </p><p>
- If the implementation concludes that the D-Bus server is not
- running it MUST attempt to start a new server and it MUST also
- ensure that the daemon started as an effect of the "autolaunch"
- mechanism provides the lookup mechanisms described above, so
- subsequent calls can locate the newly started server. The
- implementation MUST also ensure that if two or more concurrent
- initiations happen, only one server remains running and all other
- initiations are able to obtain the address of this server and
- connect to it. In other words, the implementation MUST ensure that
- the X selection is not present when it attempts to set it, without
- 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="idp6166688"></a></h5></div></div></div><p>
- On Unix systems, the session bus should search for .service files
- in <code class="literal">$XDG_DATA_DIRS/dbus-1/services</code> as defined
- by the
- <a class="ulink" href="http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html" target="_top">XDG Base Directory Specification</a>.
- Implementations may also search additional locations, which
- should be searched with lower priority than anything in
- XDG_DATA_HOME, XDG_DATA_DIRS or their respective defaults;
- for example, the reference implementation also
- looks in <code class="literal">${datadir}/dbus-1/services</code> as
- set at compile time.
- </p><p>
- As described in the XDG Base Directory Specification, software
- packages should install their session .service files to their
- configured <code class="literal">${datadir}/dbus-1/services</code>,
- where <code class="literal">${datadir}</code> is as defined by the GNU
- coding standards. System administrators or users can arrange
- for these service files to be read by setting XDG_DATA_DIRS or by
- symlinking them into the default locations.
- </p></div></div><div class="sect3" title="System message bus"><div class="titlepage"><div><div><h4 class="title"><a name="message-bus-types-system"></a>System message bus</h4></div></div></div><p>
- A computer may have a <em class="firstterm">system message bus</em>,
- accessible to all applications on the system. This message bus may be
- used to broadcast system events, such as adding new hardware devices,
- changes in the printer queue, and so forth.
- </p><p>
- The address of the system message bus is given
- in the <code class="literal">DBUS_SYSTEM_BUS_ADDRESS</code> environment
- 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="idp6175936" href="#ftn.idp6175936" class="footnote">2</a>]</sup>
- </p><p>
- On Unix systems, the system bus should default to searching
- for .service files in
- <code class="literal">/usr/local/share/dbus-1/system-services</code>,
- <code class="literal">/usr/share/dbus-1/system-services</code> and
- <code class="literal">/lib/dbus-1/system-services</code>, with that order
- of precedence. It may also search other implementation-specific
- locations, but should not vary these locations based on environment
- variables.
- <sup>[<a name="idp6180144" href="#ftn.idp6180144" class="footnote">3</a>]</sup>
- </p><p>
- Software packages should install their system .service
- files to their configured
- <code class="literal">${datadir}/dbus-1/system-services</code>,
- where <code class="literal">${datadir}</code> is as defined by the GNU
- coding standards. System administrators can arrange
- for these service files to be read by editing the system bus'
- configuration file or by symlinking them into the default
- locations.
- </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>
- The special message bus name <code class="literal">org.freedesktop.DBus</code>
- responds to a number of additional messages.
- </p><div class="sect3" title="org.freedesktop.DBus.Hello"><div class="titlepage"><div><div><h4 class="title"><a name="bus-messages-hello"></a><code class="literal">org.freedesktop.DBus.Hello</code></h4></div></div></div><p>
- As a method:
- </p><pre class="programlisting">
- STRING Hello ()
- </pre><p>
- Reply arguments:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Argument</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>STRING</td><td>Unique name assigned to the connection</td></tr></tbody></table></div><p>
- </p><p>
- Before an application is able to send messages to other applications
- it must send the <code class="literal">org.freedesktop.DBus.Hello</code> message
- to the message bus to obtain a unique name. If an application without
- a unique name tries to send a message to another application, or a
- message to the message bus itself that isn't the
- <code class="literal">org.freedesktop.DBus.Hello</code> message, it will be
- disconnected from the bus.
- </p><p>
- There is no corresponding "disconnect" request; if a client wishes to
- disconnect from the bus, it simply closes the socket (or other
- communication channel).
- </p></div><div class="sect3" title="org.freedesktop.DBus.ListNames"><div class="titlepage"><div><div><h4 class="title"><a name="bus-messages-list-names"></a><code class="literal">org.freedesktop.DBus.ListNames</code></h4></div></div></div><p>
- As a method:
- </p><pre class="programlisting">
- ARRAY of STRING ListNames ()
- </pre><p>
- Reply arguments:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Argument</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>ARRAY of STRING</td><td>Array of strings where each string is a bus name</td></tr></tbody></table></div><p>
- </p><p>
- Returns a list of all currently-owned names on the bus.
- </p></div><div class="sect3" title="org.freedesktop.DBus.ListActivatableNames"><div class="titlepage"><div><div><h4 class="title"><a name="bus-messages-list-activatable-names"></a><code class="literal">org.freedesktop.DBus.ListActivatableNames</code></h4></div></div></div><p>
- As a method:
- </p><pre class="programlisting">
- ARRAY of STRING ListActivatableNames ()
- </pre><p>
- Reply arguments:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Argument</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>ARRAY of STRING</td><td>Array of strings where each string is a bus name</td></tr></tbody></table></div><p>
- </p><p>
- Returns a list of all names that can be activated on the bus.
- </p></div><div class="sect3" title="org.freedesktop.DBus.NameHasOwner"><div class="titlepage"><div><div><h4 class="title"><a name="bus-messages-name-exists"></a><code class="literal">org.freedesktop.DBus.NameHasOwner</code></h4></div></div></div><p>
- As a method:
- </p><pre class="programlisting">
- BOOLEAN NameHasOwner (in STRING name)
- </pre><p>
- Message arguments:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Argument</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>STRING</td><td>Name to check</td></tr></tbody></table></div><p>
- Reply arguments:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Argument</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>BOOLEAN</td><td>Return value, true if the name exists</td></tr></tbody></table></div><p>
- </p><p>
- Checks if the specified name exists (currently has an owner).
- </p></div><div class="sect3" title="org.freedesktop.DBus.NameOwnerChanged"><div class="titlepage"><div><div><h4 class="title"><a name="bus-messages-name-owner-changed"></a><code class="literal">org.freedesktop.DBus.NameOwnerChanged</code></h4></div></div></div><p>
- This is a signal:
- </p><pre class="programlisting">
- NameOwnerChanged (STRING name, STRING old_owner, STRING new_owner)
- </pre><p>
- Message arguments:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Argument</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>STRING</td><td>Name with a new owner</td></tr><tr><td>1</td><td>STRING</td><td>Old owner or empty string if none</td></tr><tr><td>2</td><td>STRING</td><td>New owner or empty string if none</td></tr></tbody></table></div><p>
- </p><p>
- This signal indicates that the owner of a name has changed.
- It's also the signal to use to detect the appearance of
- new names on the bus.
- </p></div><div class="sect3" title="org.freedesktop.DBus.NameLost"><div class="titlepage"><div><div><h4 class="title"><a name="bus-messages-name-lost"></a><code class="literal">org.freedesktop.DBus.NameLost</code></h4></div></div></div><p>
- This is a signal:
- </p><pre class="programlisting">
- NameLost (STRING name)
- </pre><p>
- Message arguments:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Argument</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>STRING</td><td>Name which was lost</td></tr></tbody></table></div><p>
- </p><p>
- This signal is sent to a specific application when it loses
- ownership of a name.
- </p></div><div class="sect3" title="org.freedesktop.DBus.NameAcquired"><div class="titlepage"><div><div><h4 class="title"><a name="bus-messages-name-acquired"></a><code class="literal">org.freedesktop.DBus.NameAcquired</code></h4></div></div></div><p>
- This is a signal:
- </p><pre class="programlisting">
- NameAcquired (STRING name)
- </pre><p>
- Message arguments:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Argument</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>STRING</td><td>Name which was acquired</td></tr></tbody></table></div><p>
- </p><p>
- This signal is sent to a specific application when it gains
- ownership of a name.
- </p></div><div class="sect3" title="org.freedesktop.DBus.StartServiceByName"><div class="titlepage"><div><div><h4 class="title"><a name="bus-messages-start-service-by-name"></a><code class="literal">org.freedesktop.DBus.StartServiceByName</code></h4></div></div></div><p>
- As a method:
- </p><pre class="programlisting">
- UINT32 StartServiceByName (in STRING name, in UINT32 flags)
- </pre><p>
- Message arguments:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Argument</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>STRING</td><td>Name of the service to start</td></tr><tr><td>1</td><td>UINT32</td><td>Flags (currently not used)</td></tr></tbody></table></div><p>
- Reply arguments:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Argument</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>UINT32</td><td>Return value</td></tr></tbody></table></div><p>
- Tries to launch the executable associated with a name. For more information, see <a class="xref" href="#message-bus-starting-services" title="Message Bus Starting Services">the section called &#8220;Message Bus Starting Services&#8221;</a>.
-
- </p><p>
- The return value can be one of the following values:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Identifier</th><th>Value</th><th>Description</th></tr></thead><tbody><tr><td>DBUS_START_REPLY_SUCCESS</td><td>1</td><td>The service was successfully started.</td></tr><tr><td>DBUS_START_REPLY_ALREADY_RUNNING</td><td>2</td><td>A connection already owns the given name.</td></tr></tbody></table></div><p>
- </p></div><div class="sect3" title="org.freedesktop.DBus.UpdateActivationEnvironment"><div class="titlepage"><div><div><h4 class="title"><a name="bus-messages-update-activation-environment"></a><code class="literal">org.freedesktop.DBus.UpdateActivationEnvironment</code></h4></div></div></div><p>
- As a method:
- </p><pre class="programlisting">
- UpdateActivationEnvironment (in ARRAY of DICT&lt;STRING,STRING&gt; environment)
- </pre><p>
- Message arguments:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Argument</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>ARRAY of DICT&lt;STRING,STRING&gt;</td><td>Environment to add or update</td></tr></tbody></table></div><p>
- Normally, session bus activated services inherit the environment of the bus daemon. This method adds to or modifies that environment when activating services.
- </p><p>
- Some bus instances, such as the standard system bus, may disable access to this method for some or all callers.
- </p><p>
- Note, both the environment variable names and values must be valid UTF-8. There's no way to update the activation environment with data that is invalid UTF-8.
- </p></div><div class="sect3" title="org.freedesktop.DBus.GetNameOwner"><div class="titlepage"><div><div><h4 class="title"><a name="bus-messages-get-name-owner"></a><code class="literal">org.freedesktop.DBus.GetNameOwner</code></h4></div></div></div><p>
- As a method:
- </p><pre class="programlisting">
- STRING GetNameOwner (in STRING name)
- </pre><p>
- Message arguments:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Argument</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>STRING</td><td>Name to get the owner of</td></tr></tbody></table></div><p>
- Reply arguments:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Argument</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>STRING</td><td>Return value, a unique connection name</td></tr></tbody></table></div><p>
- Returns the unique connection name of the primary owner of the name
- given. If the requested name doesn't have an owner, returns a
- <code class="literal">org.freedesktop.DBus.Error.NameHasNoOwner</code> error.
- </p></div><div class="sect3" title="org.freedesktop.DBus.GetConnectionUnixUser"><div class="titlepage"><div><div><h4 class="title"><a name="bus-messages-get-connection-unix-user"></a><code class="literal">org.freedesktop.DBus.GetConnectionUnixUser</code></h4></div></div></div><p>
- As a method:
- </p><pre class="programlisting">
- UINT32 GetConnectionUnixUser (in STRING bus_name)
- </pre><p>
- Message arguments:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Argument</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>STRING</td><td>Unique or well-known bus name of the connection to
- query, such as <code class="literal">:12.34</code> or
- <code class="literal">com.example.tea</code></td></tr></tbody></table></div><p>
- Reply arguments:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Argument</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>UINT32</td><td>Unix user ID</td></tr></tbody></table></div><p>
- Returns the Unix user ID of the process connected to the server. If
- unable to determine it (for instance, because the process is not on the
- same machine as the bus daemon), an error is returned.
- </p></div><div class="sect3" title="org.freedesktop.DBus.GetConnectionUnixProcessID"><div class="titlepage"><div><div><h4 class="title"><a name="bus-messages-get-connection-unix-process-id"></a><code class="literal">org.freedesktop.DBus.GetConnectionUnixProcessID</code></h4></div></div></div><p>
- As a method:
- </p><pre class="programlisting">
- UINT32 GetConnectionUnixProcessID (in STRING bus_name)
- </pre><p>
- Message arguments:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Argument</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>STRING</td><td>Unique or well-known bus name of the connection to
- query, such as <code class="literal">:12.34</code> or
- <code class="literal">com.example.tea</code></td></tr></tbody></table></div><p>
- Reply arguments:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Argument</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>UINT32</td><td>Unix process id</td></tr></tbody></table></div><p>
- Returns the Unix process ID of the process connected to the server. If
- unable to determine it (for instance, because the process is not on the
- same machine as the bus daemon), an error is returned.
- </p></div><div class="sect3" title="org.freedesktop.DBus.AddMatch"><div class="titlepage"><div><div><h4 class="title"><a name="bus-messages-add-match"></a><code class="literal">org.freedesktop.DBus.AddMatch</code></h4></div></div></div><p>
- As a method:
- </p><pre class="programlisting">
- AddMatch (in STRING rule)
- </pre><p>
- Message arguments:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Argument</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>STRING</td><td>Match rule to add to the connection</td></tr></tbody></table></div><p>
- Adds a match rule to match messages going through the message bus (see <a class="xref" href="#message-bus-routing-match-rules" title="Match Rules">the section called &#8220;Match Rules&#8221;</a>).
- If the bus does not have enough resources the <code class="literal">org.freedesktop.DBus.Error.OOM</code>
- error is returned.
- </p></div><div class="sect3" title="org.freedesktop.DBus.RemoveMatch"><div class="titlepage"><div><div><h4 class="title"><a name="bus-messages-remove-match"></a><code class="literal">org.freedesktop.DBus.RemoveMatch</code></h4></div></div></div><p>
- As a method:
- </p><pre class="programlisting">
- RemoveMatch (in STRING rule)
- </pre><p>
- Message arguments:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Argument</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>STRING</td><td>Match rule to remove from the connection</td></tr></tbody></table></div><p>
- Removes the first rule that matches (see <a class="xref" href="#message-bus-routing-match-rules" title="Match Rules">the section called &#8220;Match Rules&#8221;</a>).
- If the rule is not found the <code class="literal">org.freedesktop.DBus.Error.MatchRuleNotFound</code>
- error is returned.
- </p></div><div class="sect3" title="org.freedesktop.DBus.GetId"><div class="titlepage"><div><div><h4 class="title"><a name="bus-messages-get-id"></a><code class="literal">org.freedesktop.DBus.GetId</code></h4></div></div></div><p>
- As a method:
- </p><pre class="programlisting">
- GetId (out STRING id)
- </pre><p>
- Reply arguments:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Argument</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>STRING</td><td>Unique ID identifying the bus daemon</td></tr></tbody></table></div><p>
- Gets the unique ID of the bus. The unique ID here is shared among all addresses the
- bus daemon is listening on (TCP, UNIX domain socket, etc.) and its format is described in
- <a class="xref" href="#uuids" title="UUIDs">the section called &#8220;UUIDs&#8221;</a>. Each address the bus is listening on also has its own unique
- ID, as described in <a class="xref" href="#addresses" title="Server Addresses">the section called &#8220;Server Addresses&#8221;</a>. The per-bus and per-address IDs are not related.
- 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="idp6346832"></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
- connections. (Normally, there's one connection per application.) A
- bus name is simply an identifier used to locate connections. For
- example, the hypothetical <code class="literal">com.yoyodyne.Screensaver</code>
- name might be used to send a message to a screensaver from Yoyodyne
- Corporation. An application is said to <em class="firstterm">own</em> a
- name if the message bus has associated the application's connection
- with the name. Names may also have <em class="firstterm">queued
- owners</em> (see <a class="xref" href="#term-queued-owner" title="Queued Name Owner">Queued Name Owner</a>).
- The bus assigns a unique name to each connection,
- see <a class="xref" href="#term-unique-name" title="Unique Connection Name">Unique Connection Name</a>. Other names
- can be thought of as "well-known names" and are
- used to find applications that offer specific functionality.
- </p><p>
- See <a class="xref" href="#message-protocol-names-bus" title="Bus names">the section called &#8220;Bus names&#8221;</a> for details of
- the syntax and naming conventions for bus names.
- </p></dd><dt><a name="term-message"></a>Message</dt><dd><p>
- A message is the atomic unit of communication via the D-Bus
- protocol. It consists of a <em class="firstterm">header</em> and a
- <em class="firstterm">body</em>; the body is made up of
- <em class="firstterm">arguments</em>.
- </p></dd><dt><a name="term-message-bus"></a>Message Bus</dt><dd><p>
- The message bus is a special application that forwards
- or routes messages between a group of applications
- connected to the message bus. It also manages
- <em class="firstterm">names</em> used for routing
- messages.
- </p></dd><dt><a name="term-name"></a>Name</dt><dd><p>
- See <a class="xref" href="#term-bus-name" title="Bus Name">Bus Name</a>. "Name" may
- also be used to refer to some of the other names
- in D-Bus, such as interface names.
- </p></dd><dt><a name="namespace"></a>Namespace</dt><dd><p>
- Used to prevent collisions when defining new interfaces, bus names
- etc. The convention used is the same one Java uses for defining
- classes: a reversed domain name.
- See <a class="xref" href="#message-protocol-names-bus" title="Bus names">the section called &#8220;Bus names&#8221;</a>,
- <a class="xref" href="#message-protocol-names-interface" title="Interface names">the section called &#8220;Interface names&#8221;</a>,
- <a class="xref" href="#message-protocol-names-error" title="Error names">the section called &#8220;Error names&#8221;</a>,
- <a class="xref" href="#message-protocol-marshaling-object-path" title="Valid Object Paths">the section called &#8220;Valid Object Paths&#8221;</a>.
- </p></dd><dt><a name="term-object"></a>Object</dt><dd><p>
- Each application contains <em class="firstterm">objects</em>, which have
- <em class="firstterm">interfaces</em> and
- <em class="firstterm">methods</em>. Objects are referred to by a name,
- called a <em class="firstterm">path</em>.
- </p></dd><dt><a name="one-to-one"></a>One-to-One</dt><dd><p>
- An application talking directly to another application, without going
- through a message bus. One-to-one connections may be "peer to peer" or
- "client to server." The D-Bus protocol has no concept of client
- vs. server after a connection has authenticated; the flow of messages
- is symmetrical (full duplex).
- </p></dd><dt><a name="term-path"></a>Path</dt><dd><p>
- Object references (object names) in D-Bus are organized into a
- filesystem-style hierarchy, so each object is named by a path. As in
- LDAP, there's no difference between "files" and "directories"; a path
- can refer to an object, while still having child objects below it.
- </p></dd><dt><a name="term-queued-owner"></a>Queued Name Owner</dt><dd><p>
- Each bus name has a primary owner; messages sent to the name go to the
- primary owner. However, certain names also maintain a queue of
- secondary owners "waiting in the wings." If the primary owner releases
- the name, then the first secondary owner in the queue automatically
- becomes the new owner of the name.
- </p></dd><dt><a name="term-service"></a>Service</dt><dd><p>
- A service is an executable that can be launched by the bus daemon.
- Services normally guarantee some particular features, for example they
- may guarantee that they will request a specific name such as
- "org.freedesktop.Screensaver", have a singleton object
- "/org/freedesktop/Application", and that object will implement the
- interface "org.freedesktop.ScreensaverControl".
- </p></dd><dt><a name="term-service-description-files"></a>Service Description Files</dt><dd><p>
- ".service files" tell the bus about service applications that can be
- launched (see <a class="xref" href="#term-service" title="Service">Service</a>). Most importantly they
- provide a mapping from bus names to services that will request those
- names when they start up.
- </p></dd><dt><a name="term-unique-name"></a>Unique Connection Name</dt><dd><p>
- The special name automatically assigned to each connection by the
- 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 id="ftn.idp5723008" href="#idp5723008" 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 id="ftn.idp6175936" href="#idp6175936" 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.
- </p></div><div class="footnote"><p><sup>[<a id="ftn.idp6180144" href="#idp6180144" class="para">3</a>] </sup>
- The system bus is security-sensitive and is typically executed
- by an init system with a clean environment. Its launch helper
- process is particularly security-sensitive, and specifically
- clears its own environment.
- </p></div></div></div></body></html>
diff --git a/doc/dbus-specification.xml b/doc/dbus-specification.xml
index d806b8ea..f6b02152 100644
--- a/doc/dbus-specification.xml
+++ b/doc/dbus-specification.xml
@@ -1,53 +1,53 @@
<?xml version="1.0" standalone="no" ?>
-<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
-"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
[
]>
<article id="index">
<articleinfo>
<title>D-Bus Specification</title>
- <releaseinfo>Version 0.19</releaseinfo>
- <date>2012-02-21</date>
+ <releaseinfo>Version 0.23</releaseinfo>
+ <date>2014-01-06</date>
<authorgroup>
<author>
- <firstname>Havoc</firstname>
- <surname>Pennington</surname>
- <affiliation>
- <orgname>Red Hat, Inc.</orgname>
- <address>
- <email>hp@pobox.com</email>
- </address>
- </affiliation>
+ <firstname>Havoc</firstname>
+ <surname>Pennington</surname>
+ <affiliation>
+ <orgname>Red Hat, Inc.</orgname>
+ <address>
+ <email>hp@pobox.com</email>
+ </address>
+ </affiliation>
</author>
<author>
- <firstname>Anders</firstname>
- <surname>Carlsson</surname>
- <affiliation>
- <orgname>CodeFactory AB</orgname>
- <address>
+ <firstname>Anders</firstname>
+ <surname>Carlsson</surname>
+ <affiliation>
+ <orgname>CodeFactory AB</orgname>
+ <address>
<email>andersca@codefactory.se</email>
</address>
- </affiliation>
+ </affiliation>
</author>
<author>
- <firstname>Alexander</firstname>
- <surname>Larsson</surname>
- <affiliation>
- <orgname>Red Hat, Inc.</orgname>
- <address>
+ <firstname>Alexander</firstname>
+ <surname>Larsson</surname>
+ <affiliation>
+ <orgname>Red Hat, Inc.</orgname>
+ <address>
<email>alexl@redhat.com</email>
</address>
- </affiliation>
+ </affiliation>
</author>
<author>
- <firstname>Sven</firstname>
- <surname>Herzberg</surname>
- <affiliation>
- <orgname>Imendio AB</orgname>
- <address>
+ <firstname>Sven</firstname>
+ <surname>Herzberg</surname>
+ <affiliation>
+ <orgname>Imendio AB</orgname>
+ <address>
<email>sven@imendio.com</email>
</address>
- </affiliation>
+ </affiliation>
</author>
<author>
<firstname>Simon</firstname>
@@ -63,19 +63,45 @@
<firstname>David</firstname>
<surname>Zeuthen</surname>
<affiliation>
- <orgname>Red Hat, Inc.</orgname>
<address>
- <email>davidz@redhat.com</email>
+ <email>zeuthen@gmail.com</email>
</address>
</affiliation>
</author>
</authorgroup>
<revhistory>
<revision>
- <revnumber>current</revnumber>
- <date><ulink url='http://cgit.freedesktop.org/dbus/dbus/log/doc/dbus-specification.xml'>commit log</ulink></date>
+ <revnumber>0.23</revnumber>
+ <date>2014-01-06</date>
+ <authorinitials>SMcV, CY</authorinitials>
+ <revremark>
+ method call messages with no INTERFACE may be considered an error;
+ document tcp:bind=... and nonce-tcp:bind=...; define listenable
+ and connectable addresses
+ </revremark>
+ </revision>
+ <revision>
+ <revnumber>0.22</revnumber>
+ <date>2013-10-09</date>
<authorinitials></authorinitials>
- <revremark></revremark>
+ <revremark>add GetConnectionCredentials, document
+ GetAtdAuditSessionData, document GetConnectionSELinuxSecurityContext,
+ document and correct .service file syntax and naming
+ </revremark>
+ </revision>
+ <revision>
+ <revnumber>0.21</revnumber>
+ <date>2013-04-25</date>
+ <authorinitials>smcv</authorinitials>
+ <revremark>allow Unicode noncharacters in UTF-8 (Unicode
+ Corrigendum #9)</revremark>
+ </revision>
+ <revision>
+ <revnumber>0.20</revnumber>
+ <date>22 February 2013</date>
+ <authorinitials>smcv, walters</authorinitials>
+ <revremark>reorganise for clarity, remove false claims about
+ basic types, mention /o/fd/DBus</revremark>
</revision>
<revision>
<revnumber>0.19</revnumber>
@@ -161,23 +187,18 @@
<sect1 id="introduction">
<title>Introduction</title>
<para>
- D-Bus is a system for low-latency, low-overhead, easy to use
+ D-Bus is a system for low-overhead, easy to use
interprocess communication (IPC). In more detail:
<itemizedlist>
<listitem>
<para>
- D-Bus is <emphasis>low-latency</emphasis> because it is designed
- to avoid round trips and allow asynchronous operation, much like
- the X protocol.
- </para>
- </listitem>
- <listitem>
- <para>
D-Bus is <emphasis>low-overhead</emphasis> because it uses a
binary protocol, and does not have to convert to and from a text
format such as XML. Because D-Bus is intended for potentially
high-resolution same-machine IPC, not primarily for Internet IPC,
- this is an interesting optimization.
+ this is an interesting optimization. D-Bus is also designed to
+ avoid round trips and allow asynchronous operation, much like
+ the X protocol.
</para>
</listitem>
<listitem>
@@ -292,17 +313,68 @@
it back from the wire format is <firstterm>unmarshaling</firstterm>.
</para>
- <sect2 id="message-protocol-signatures">
- <title>Type Signatures</title>
+ <para>
+ The D-Bus protocol does not include type tags in the marshaled data; a
+ block of marshaled values must have a known <firstterm>type
+ signature</firstterm>. The type signature is made up of zero or more
+ <firstterm id="term-single-complete-type">single complete
+ types</firstterm>, each made up of one or more
+ <firstterm>type codes</firstterm>.
+ </para>
+
+ <para>
+ A type code is an ASCII character representing the
+ type of a value. Because ASCII characters are used, the type signature
+ will always form a valid ASCII string. A simple string compare
+ determines whether two type signatures are equivalent.
+ </para>
+
+ <para>
+ A single complete type is a sequence of type codes that fully describes
+ one type: either a basic type, or a single fully-described container type.
+ A single complete type is a basic type code, a variant type code,
+ an array with its element type, or a struct with its fields (all of which
+ are defined below). So the following signatures are not single complete
+ types:
+ <programlisting>
+ "aa"
+ </programlisting>
+ <programlisting>
+ "(ii"
+ </programlisting>
+ <programlisting>
+ "ii)"
+ </programlisting>
+ And the following signatures contain multiple complete types:
+ <programlisting>
+ "ii"
+ </programlisting>
+ <programlisting>
+ "aiai"
+ </programlisting>
+ <programlisting>
+ "(ii)(ii)"
+ </programlisting>
+ Note however that a single complete type may <emphasis>contain</emphasis>
+ multiple other single complete types, by containing a struct or dict
+ entry.
+ </para>
+
+ <sect2 id="basic-types">
+ <title>Basic types</title>
+
+ <para>
+ The simplest type codes are the <firstterm id="term-basic-type">basic
+ types</firstterm>, which are the types whose structure is entirely
+ defined by their 1-character type code. Basic types consist of
+ fixed types and string-like types.
+ </para>
<para>
- The D-Bus protocol does not include type tags in the marshaled data; a
- block of marshaled values must have a known <firstterm>type
- signature</firstterm>. The type signature is made up of <firstterm>type
- codes</firstterm>. A type code is an ASCII character representing the
- type of a value. Because ASCII characters are used, the type signature
- will always form a valid ASCII string. A simple string compare
- determines whether two type signatures are equivalent.
+ The <firstterm id="term-fixed-type">fixed types</firstterm>
+ are basic types whose values have a fixed length, namely BYTE,
+ BOOLEAN, DOUBLE, UNIX_FD, and signed or unsigned integers of length
+ 16, 32 or 64 bits.
</para>
<para>
@@ -319,10 +391,267 @@
</para>
<para>
- All <firstterm>basic</firstterm> types work like
- <literal>INT32</literal> in this example. To marshal and unmarshal
- basic types, you simply read one value from the data
- block corresponding to each type code in the signature.
+ The characteristics of the fixed types are listed in this table.
+
+ <informaltable>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Conventional name</entry>
+ <entry>ASCII type-code</entry>
+ <entry>Encoding</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>BYTE</literal></entry>
+ <entry><literal>y</literal> (121)</entry>
+ <entry>Unsigned 8-bit integer</entry>
+ </row>
+ <row>
+ <entry><literal>BOOLEAN</literal></entry>
+ <entry><literal>b</literal> (98)</entry>
+ <entry>Boolean value: 0 is false, 1 is true, any other value
+ allowed by the marshalling format is invalid</entry>
+ </row>
+ <row>
+ <entry><literal>INT16</literal></entry>
+ <entry><literal>n</literal> (110)</entry>
+ <entry>Signed (two's complement) 16-bit integer</entry>
+ </row>
+ <row>
+ <entry><literal>UINT16</literal></entry>
+ <entry><literal>q</literal> (113)</entry>
+ <entry>Unsigned 16-bit integer</entry>
+ </row>
+ <row>
+ <entry><literal>INT32</literal></entry>
+ <entry><literal>i</literal> (105)</entry>
+ <entry>Signed (two's complement) 32-bit integer</entry>
+ </row>
+ <row>
+ <entry><literal>UINT32</literal></entry>
+ <entry><literal>u</literal> (117)</entry>
+ <entry>Unsigned 32-bit integer</entry>
+ </row>
+ <row>
+ <entry><literal>INT64</literal></entry>
+ <entry><literal>x</literal> (120)</entry>
+ <entry>Signed (two's complement) 64-bit integer
+ (mnemonic: x and t are the first characters in "sixty" not
+ already used for something more common)</entry>
+ </row>
+ <row>
+ <entry><literal>UINT64</literal></entry>
+ <entry><literal>t</literal> (116)</entry>
+ <entry>Unsigned 64-bit integer</entry>
+ </row>
+ <row>
+ <entry><literal>DOUBLE</literal></entry>
+ <entry><literal>d</literal> (100)</entry>
+ <entry>IEEE 754 double-precision floating point</entry>
+ </row>
+ <row>
+ <entry><literal>UNIX_FD</literal></entry>
+ <entry><literal>h</literal> (104)</entry>
+ <entry>Unsigned 32-bit integer representing an index into an
+ out-of-band array of file descriptors, transferred via some
+ platform-specific mechanism (mnemonic: h for handle)</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+
+ <para>
+ The <firstterm id="term-string-like-type">string-like types</firstterm>
+ are basic types with a variable length. The value of any string-like
+ type is conceptually 0 or more Unicode codepoints encoded in UTF-8,
+ none of which may be U+0000. The UTF-8 text must be validated
+ strictly: in particular, it must not contain overlong sequences
+ or codepoints above U+10FFFF.
+ </para>
+
+ <para>
+ Since D-Bus Specification version 0.21, in accordance with Unicode
+ Corrigendum #9, the "noncharacters" U+FDD0..U+FDEF, U+nFFFE and
+ U+nFFFF are allowed in UTF-8 strings (but note that older versions of
+ D-Bus rejected these noncharacters).
+ </para>
+
+ <para>
+ The marshalling formats for the string-like types all end with a
+ single zero (NUL) byte, but that byte is not considered to be part of
+ the text.
+ </para>
+
+ <para>
+ The characteristics of the string-like types are listed in this table.
+
+ <informaltable>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Conventional name</entry>
+ <entry>ASCII type-code</entry>
+ <entry>Validity constraints</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>STRING</literal></entry>
+ <entry><literal>s</literal> (115)</entry>
+ <entry>No extra constraints</entry>
+ </row>
+ <row>
+ <entry><literal>OBJECT_PATH</literal></entry>
+ <entry><literal>o</literal> (111)</entry>
+ <entry>Must be
+ <link linkend="message-protocol-marshaling-object-path">a
+ syntactically valid object path</link></entry>
+ </row>
+ <row>
+ <entry><literal>SIGNATURE</literal></entry>
+ <entry><literal>g</literal> (103)</entry>
+ <entry>Zero or more
+ <firstterm linkend="term-single-complete-type">single
+ complete types</firstterm></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+
+ <sect3 id="message-protocol-marshaling-object-path">
+ <title>Valid Object Paths</title>
+
+ <para>
+ An object path is a name used to refer to an object instance.
+ Conceptually, each participant in a D-Bus message exchange may have
+ any number of object instances (think of C++ or Java objects) and each
+ such instance will have a path. Like a filesystem, the object
+ instances in an application form a hierarchical tree.
+ </para>
+
+ <para>
+ Object paths are often namespaced by starting with a reversed
+ domain name and containing an interface version number, in the
+ same way as
+ <link linkend="message-protocol-names-interface">interface
+ names</link> and
+ <link linkend="message-protocol-names-bus">well-known
+ bus names</link>.
+ This makes it possible to implement more than one service, or
+ more than one version of a service, in the same process,
+ even if the services share a connection but cannot otherwise
+ co-operate (for instance, if they are implemented by different
+ plugins).
+ </para>
+
+ <para>
+ For instance, if the owner of <literal>example.com</literal> is
+ developing a D-Bus API for a music player, they might use the
+ hierarchy of object paths that start with
+ <literal>/com/example/MusicPlayer1</literal> for its objects.
+ </para>
+
+ <para>
+ The following rules define a valid object path. Implementations must
+ not send or accept messages with invalid object paths.
+ <itemizedlist>
+ <listitem>
+ <para>
+ The path may be of any length.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The path must begin with an ASCII '/' (integer 47) character,
+ and must consist of elements separated by slash characters.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Each element must only contain the ASCII characters
+ "[A-Z][a-z][0-9]_"
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ No element may be the empty string.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Multiple '/' characters cannot occur in sequence.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ A trailing '/' character is not allowed unless the
+ path is the root path (a single '/' character).
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ </sect3>
+
+ <sect3 id="message-protocol-marshaling-signature">
+ <title>Valid Signatures</title>
+ <para>
+ An implementation must not send or accept invalid signatures.
+ Valid signatures will conform to the following rules:
+ <itemizedlist>
+ <listitem>
+ <para>
+ The signature is a list of single complete types.
+ Arrays must have element types, and structs must
+ have both open and close parentheses.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Only type codes, open and close parentheses, and open and
+ close curly brackets are allowed in the signature. The
+ <literal>STRUCT</literal> type code
+ is not allowed in signatures, because parentheses
+ are used instead. Similarly, the
+ <literal>DICT_ENTRY</literal> type code is not allowed in
+ signatures, because curly brackets are used instead.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The maximum depth of container type nesting is 32 array type
+ codes and 32 open parentheses. This implies that the maximum
+ total depth of recursion is 64, for an "array of array of array
+ of ... struct of struct of struct of ..." where there are 32
+ array and 32 struct.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The maximum length of a signature is 255.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ When signatures appear in messages, the marshalling format
+ guarantees that they will be followed by a nul byte (which can
+ be interpreted as either C-style string termination or the INVALID
+ type-code), but this is not conceptually part of the signature.
+ </para>
+ </sect3>
+
+ </sect2>
+
+ <sect2 id="container-types">
+ <title>Container types</title>
+
+ <para>
In addition to basic types, there are four <firstterm>container</firstterm>
types: <literal>STRUCT</literal>, <literal>ARRAY</literal>, <literal>VARIANT</literal>,
and <literal>DICT_ENTRY</literal>.
@@ -378,34 +707,6 @@
</para>
<para>
- The phrase <firstterm>single complete type</firstterm> deserves some
- definition. A single complete type is a basic type code, a variant type code,
- an array with its element type, or a struct with its fields.
- So the following signatures are not single complete types:
- <programlisting>
- "aa"
- </programlisting>
- <programlisting>
- "(ii"
- </programlisting>
- <programlisting>
- "ii)"
- </programlisting>
- And the following signatures contain multiple complete types:
- <programlisting>
- "ii"
- </programlisting>
- <programlisting>
- "aiai"
- </programlisting>
- <programlisting>
- "(ii)(ii)"
- </programlisting>
- Note however that a single complete type may <emphasis>contain</emphasis>
- multiple other single complete types.
- </para>
-
- <para>
<literal>VARIANT</literal> has ASCII character 'v' as its type code. A marshaled value of
type <literal>VARIANT</literal> will have the signature of a single complete type as part
of the <emphasis>value</emphasis>. This signature will be followed by a
@@ -413,6 +714,14 @@
</para>
<para>
+ Unlike a message signature, the variant signature can
+ contain only a single complete type. So "i", "ai"
+ or "(ii)" is OK, but "ii" is not. Use of variants may not
+ cause a total message depth to be larger than 64, including
+ other container types such as structures.
+ </para>
+
+ <para>
A <literal>DICT_ENTRY</literal> works exactly like a struct, but rather
than parentheses it uses curly braces, and it has more restrictions.
The restrictions are: it occurs only as an array element type; it has
@@ -435,6 +744,10 @@
In most languages, an array of dict entry would be represented as a
map, hash table, or dict object.
</para>
+ </sect2>
+
+ <sect2>
+ <title>Summary of types</title>
<para>
The following table summarizes the D-Bus types.
@@ -453,14 +766,14 @@
<entry>0 (ASCII NUL)</entry>
<entry>Not a valid type code, used to terminate signatures</entry>
</row><row>
- <entry><literal>BYTE</literal></entry>
- <entry>121 (ASCII 'y')</entry>
- <entry>8-bit unsigned integer</entry>
+ <entry><literal>BYTE</literal></entry>
+ <entry>121 (ASCII 'y')</entry>
+ <entry>8-bit unsigned integer</entry>
+ </row><row>
+ <entry><literal>BOOLEAN</literal></entry>
+ <entry>98 (ASCII 'b')</entry>
+ <entry>Boolean value, 0 is <literal>FALSE</literal> and 1 is <literal>TRUE</literal>. Everything else is invalid.</entry>
</row><row>
- <entry><literal>BOOLEAN</literal></entry>
- <entry>98 (ASCII 'b')</entry>
- <entry>Boolean value, 0 is <literal>FALSE</literal> and 1 is <literal>TRUE</literal>. Everything else is invalid.</entry>
- </row><row>
<entry><literal>INT16</literal></entry>
<entry>110 (ASCII 'n')</entry>
<entry>16-bit signed integer</entry>
@@ -468,7 +781,7 @@
<entry><literal>UINT16</literal></entry>
<entry>113 (ASCII 'q')</entry>
<entry>16-bit unsigned integer</entry>
- </row><row>
+ </row><row>
<entry><literal>INT32</literal></entry>
<entry>105 (ASCII 'i')</entry>
<entry>32-bit signed integer</entry>
@@ -476,7 +789,7 @@
<entry><literal>UINT32</literal></entry>
<entry>117 (ASCII 'u')</entry>
<entry>32-bit unsigned integer</entry>
- </row><row>
+ </row><row>
<entry><literal>INT64</literal></entry>
<entry>120 (ASCII 'x')</entry>
<entry>64-bit signed integer</entry>
@@ -566,9 +879,21 @@
</para>
</sect2>
+ </sect1>
- <sect2 id="message-protocol-marshaling">
- <title>Marshaling (Wire Format)</title>
+ <sect1 id="message-protocol-marshaling">
+ <title>Marshaling (Wire Format)</title>
+
+ <para>
+ D-Bus defines a marshalling format for its type system, which is
+ used in D-Bus messages. This is not the only possible marshalling
+ format for the type system: for instance, GVariant (part of GLib)
+ re-uses the D-Bus type system but implements an alternative marshalling
+ format.
+ </para>
+
+ <sect2>
+ <title>Byte order and alignment</title>
<para>
Given a type signature, a block of bytes can be converted into typed
@@ -577,11 +902,11 @@
</para>
<para>
- A block of bytes has an associated byte order. The byte order
- has to be discovered in some way; for D-Bus messages, the
- byte order is part of the message header as described in
- <xref linkend="message-protocol-messages"/>. For now, assume
- that the byte order is known to be either little endian or big
+ A block of bytes has an associated byte order. The byte order
+ has to be discovered in some way; for D-Bus messages, the
+ byte order is part of the message header as described in
+ <xref linkend="message-protocol-messages"/>. For now, assume
+ that the byte order is known to be either little endian or big
endian.
</para>
@@ -597,6 +922,95 @@
</para>
<para>
+ As an exception to natural alignment, <literal>STRUCT</literal> and
+ <literal>DICT_ENTRY</literal> values are always aligned to an 8-byte
+ boundary, regardless of the alignments of their contents.
+ </para>
+ </sect2>
+
+ <sect2>
+ <title>Marshalling basic types</title>
+
+ <para>
+ To marshal and unmarshal fixed types, you simply read one value
+ from the data block corresponding to each type code in the signature.
+ All signed integer values are encoded in two's complement, DOUBLE
+ values are IEEE 754 double-precision floating-point, and BOOLEAN
+ values are encoded in 32 bits (of which only the least significant
+ bit is used).
+ </para>
+
+ <para>
+ The string-like types are all marshalled as a
+ fixed-length unsigned integer <varname>n</varname> giving the
+ length of the variable part, followed by <varname>n</varname>
+ nonzero bytes of UTF-8 text, followed by a single zero (nul) byte
+ which is not considered to be part of the text. The alignment
+ of the string-like type is the same as the alignment of
+ <varname>n</varname>.
+ </para>
+
+ <para>
+ For the STRING and OBJECT_PATH types, <varname>n</varname> is
+ encoded in 4 bytes, leading to 4-byte alignment.
+ For the SIGNATURE type, <varname>n</varname> is encoded as a single
+ byte. As a result, alignment padding is never required before a
+ SIGNATURE.
+ </para>
+ </sect2>
+
+ <sect2>
+ <title>Marshalling containers</title>
+
+ <para>
+ Arrays are marshalled as a <literal>UINT32</literal>
+ <varname>n</varname> giving the length of the array data in bytes,
+ followed by alignment padding to the alignment boundary of the array
+ element type, followed by the <varname>n</varname> bytes of the
+ array elements marshalled in sequence. <varname>n</varname> does not
+ include the padding after the length, or any padding after the
+ last element.
+ </para>
+
+ <para>
+ For instance, if the current position in the message is a multiple
+ of 8 bytes and the byte-order is big-endian, an array containing only
+ the 64-bit integer 5 would be marshalled as:
+
+ <screen>
+00 00 00 08 <lineannotation>8 bytes of data</lineannotation>
+00 00 00 00 <lineannotation>padding to 8-byte boundary</lineannotation>
+00 00 00 00 00 00 00 05 <lineannotation>first element = 5</lineannotation>
+ </screen>
+ </para>
+
+ <para>
+ Arrays have a maximum length defined to be 2 to the 26th power or
+ 67108864. Implementations must not send or accept arrays exceeding this
+ length.
+ </para>
+
+ <para>
+ Structs and dict entries are marshalled in the same way as their
+ contents, but their alignment is always to an 8-byte boundary,
+ even if their contents would normally be less strictly aligned.
+ </para>
+
+ <para>
+ Variants are marshalled as the <literal>SIGNATURE</literal> of
+ the contents (which must be a single complete type), followed by a
+ marshalled value with the type given by that signature. The
+ variant has the same 1-byte alignment as the signature, which means
+ that alignment padding before a variant is never needed.
+ Use of variants may not cause a total message depth to be larger
+ than 64, including other container types such as structures.
+ </para>
+ </sect2>
+
+ <sect2>
+ <title>Summary of D-Bus marshalling</title>
+
+ <para>
Given all this, the types are marshaled on the wire as follows:
<informaltable>
<tgroup cols="3">
@@ -661,7 +1075,7 @@
</row><row>
<entry><literal>OBJECT_PATH</literal></entry>
<entry>Exactly the same as <literal>STRING</literal> except the
- content must be a valid object path (see below).
+ content must be a valid object path (see above).
</entry>
<entry>
4 (for the length)
@@ -670,7 +1084,7 @@
<entry><literal>SIGNATURE</literal></entry>
<entry>The same as <literal>STRING</literal> except the length is a single
byte (thus signatures have a maximum length of 255)
- and the content must be a valid signature (see below).
+ and the content must be a valid signature (see above).
</entry>
<entry>
1
@@ -679,14 +1093,8 @@
<entry><literal>ARRAY</literal></entry>
<entry>
A <literal>UINT32</literal> giving the length of the array data in bytes, followed by
- alignment padding to the alignment boundary of the array element type,
- followed by each array element. The array length is from the
- end of the alignment padding to the end of the last element,
- i.e. it does not include the padding after the length,
- or any padding after the last element.
- Arrays have a maximum length defined to be 2 to the 26th power or
- 67108864. Implementations must not send or accept arrays exceeding this
- length.
+ alignment padding to the alignment boundary of the array element type,
+ followed by each array element.
</entry>
<entry>
4 (for the length)
@@ -702,22 +1110,17 @@
<entry>
8
</entry>
- </row><row>
+ </row><row>
<entry><literal>VARIANT</literal></entry>
<entry>
- A variant type has a marshaled
- <literal>SIGNATURE</literal> followed by a marshaled
- value with the type given in the signature. Unlike
- a message signature, the variant signature can
- contain only a single complete type. So "i", "ai"
- or "(ii)" is OK, but "ii" is not. Use of variants may not
- cause a total message depth to be larger than 64, including
- other container types such as structures.
+ The marshaled <literal>SIGNATURE</literal> of a single
+ complete type, followed by a marshaled value with the type
+ given in the signature.
</entry>
<entry>
1 (alignment of the signature)
</entry>
- </row><row>
+ </row><row>
<entry><literal>DICT_ENTRY</literal></entry>
<entry>
Identical to STRUCT.
@@ -734,135 +1137,12 @@
file descriptor in the array of file descriptors that
accompany the message.</entry>
<entry>4</entry>
- </row>
+ </row>
</tbody>
</tgroup>
</informaltable>
</para>
-
- <sect3 id="message-protocol-marshaling-object-path">
- <title>Valid Object Paths</title>
-
- <para>
- An object path is a name used to refer to an object instance.
- Conceptually, each participant in a D-Bus message exchange may have
- any number of object instances (think of C++ or Java objects) and each
- such instance will have a path. Like a filesystem, the object
- instances in an application form a hierarchical tree.
- </para>
-
- <para>
- The following rules define a valid object path. Implementations must
- not send or accept messages with invalid object paths.
- <itemizedlist>
- <listitem>
- <para>
- The path may be of any length.
- </para>
- </listitem>
- <listitem>
- <para>
- The path must begin with an ASCII '/' (integer 47) character,
- and must consist of elements separated by slash characters.
- </para>
- </listitem>
- <listitem>
- <para>
- Each element must only contain the ASCII characters
- "[A-Z][a-z][0-9]_"
- </para>
- </listitem>
- <listitem>
- <para>
- No element may be the empty string.
- </para>
- </listitem>
- <listitem>
- <para>
- Multiple '/' characters cannot occur in sequence.
- </para>
- </listitem>
- <listitem>
- <para>
- A trailing '/' character is not allowed unless the
- path is the root path (a single '/' character).
- </para>
- </listitem>
- </itemizedlist>
- </para>
-
- <para>
- Object paths are often namespaced by starting with a reversed
- domain name and containing an interface version number, in the
- same way as
- <link linkend="message-protocol-names-interface">interface
- names</link> and
- <link linkend="message-protocol-names-bus">well-known
- bus names</link>.
- This makes it possible to implement more than one service, or
- more than one version of a service, in the same process,
- even if the services share a connection but cannot otherwise
- co-operate (for instance, if they are implemented by different
- plugins).
- </para>
- <para>
- For instance, if the owner of <literal>example.com</literal> is
- developing a D-Bus API for a music player, they might use the
- hierarchy of object paths that start with
- <literal>/com/example/MusicPlayer1</literal> for its objects.
- </para>
- </sect3>
-
- <sect3 id="message-protocol-marshaling-signature">
- <title>Valid Signatures</title>
- <para>
- An implementation must not send or accept invalid signatures.
- Valid signatures will conform to the following rules:
- <itemizedlist>
- <listitem>
- <para>
- The signature ends with a nul byte.
- </para>
- </listitem>
- <listitem>
- <para>
- The signature is a list of single complete types.
- Arrays must have element types, and structs must
- have both open and close parentheses.
- </para>
- </listitem>
- <listitem>
- <para>
- Only type codes and open and close parentheses are
- allowed in the signature. The <literal>STRUCT</literal> type code
- is not allowed in signatures, because parentheses
- are used instead.
- </para>
- </listitem>
- <listitem>
- <para>
- The maximum depth of container type nesting is 32 array type
- codes and 32 open parentheses. This implies that the maximum
- total depth of recursion is 64, for an "array of array of array
- of ... struct of struct of struct of ..." where there are 32
- array and 32 struct.
- </para>
- </listitem>
- <listitem>
- <para>
- The maximum length of a signature is 255.
- </para>
- </listitem>
- <listitem>
- <para>
- Signatures must be nul-terminated.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </sect3>
-
</sect2>
</sect1>
@@ -1249,12 +1529,12 @@
</para>
</listitem>
- <listitem><para>Interface names must contain at least one '.' (period)
+ <listitem><para>Interface names must contain at least one '.' (period)
character (and thus at least two elements).
</para></listitem>
- <listitem><para>Interface names must not begin with a '.' (period) character.</para></listitem>
- <listitem><para>Interface names must not exceed the maximum name length.</para></listitem>
+ <listitem><para>Interface names must not begin with a '.' (period) character.</para></listitem>
+ <listitem><para>Interface names must not exceed the maximum name length.</para></listitem>
</itemizedlist>
</para>
@@ -1313,12 +1593,12 @@
</para>
</listitem>
- <listitem><para>Bus names must contain at least one '.' (period)
+ <listitem><para>Bus names must contain at least one '.' (period)
character (and thus at least two elements).
</para></listitem>
- <listitem><para>Bus names must not begin with a '.' (period) character.</para></listitem>
- <listitem><para>Bus names must not exceed the maximum name length.</para></listitem>
+ <listitem><para>Bus names must not begin with a '.' (period) character.</para></listitem>
+ <listitem><para>Bus names must not exceed the maximum name length.</para></listitem>
</itemizedlist>
</para>
<para>
@@ -1356,12 +1636,12 @@
<para>
Member (i.e. method or signal) names:
<itemizedlist>
- <listitem><para>Must only contain the ASCII characters
+ <listitem><para>Must only contain the ASCII characters
"[A-Z][a-z][0-9]_" and may not begin with a
digit.</para></listitem>
- <listitem><para>Must not contain the '.' (period) character.</para></listitem>
- <listitem><para>Must not exceed the maximum name length.</para></listitem>
- <listitem><para>Must be at least 1 byte in length.</para></listitem>
+ <listitem><para>Must not contain the '.' (period) character.</para></listitem>
+ <listitem><para>Must not exceed the maximum name length.</para></listitem>
+ <listitem><para>Must be at least 1 byte in length.</para></listitem>
</itemizedlist>
</para>
@@ -1409,12 +1689,25 @@
<para>
A method call message is required to have a <literal>MEMBER</literal> header field
indicating the name of the method. Optionally, the message has an
- <literal>INTERFACE</literal> field giving the interface the method is a part of. In the
- absence of an <literal>INTERFACE</literal> field, if two interfaces on the same object have
- a method with the same name, it is undefined which of the two methods
- will be invoked. Implementations may also choose to return an error in
- this ambiguous case. However, if a method name is unique
- implementations must not require an interface field.
+ <literal>INTERFACE</literal> field giving the interface the method is a part of.
+ Including the <literal>INTERFACE</literal> in all method call
+ messages is strongly recommended.
+ </para>
+ <para>
+ In the absence of an <literal>INTERFACE</literal> field, if two
+ or more interfaces on the same object have a method with the same
+ name, it is undefined which of those methods will be invoked.
+ Implementations may choose to either return an error, or deliver the
+ message as though it had an arbitrary one of those interfaces.
+ </para>
+ <para>
+ In some situations (such as the well-known system bus), messages
+ are filtered through an access-control list external to the
+ remote object implementation. If that filter rejects certain
+ messages by matching their interface, or accepts only messages
+ to specific interfaces, it must also reject messages that have no
+ <literal>INTERFACE</literal>: otherwise, malicious
+ applications could use this to bypass the filter.
</para>
<para>
Method call messages also include a <literal>PATH</literal> field
@@ -1692,23 +1985,23 @@
Commands from the client to the server are as follows:
<itemizedlist>
- <listitem><para>AUTH [mechanism] [initial-response]</para></listitem>
- <listitem><para>CANCEL</para></listitem>
- <listitem><para>BEGIN</para></listitem>
- <listitem><para>DATA &lt;data in hex encoding&gt;</para></listitem>
- <listitem><para>ERROR [human-readable error explanation]</para></listitem>
- <listitem><para>NEGOTIATE_UNIX_FD</para></listitem>
- </itemizedlist>
+ <listitem><para>AUTH [mechanism] [initial-response]</para></listitem>
+ <listitem><para>CANCEL</para></listitem>
+ <listitem><para>BEGIN</para></listitem>
+ <listitem><para>DATA &lt;data in hex encoding&gt;</para></listitem>
+ <listitem><para>ERROR [human-readable error explanation]</para></listitem>
+ <listitem><para>NEGOTIATE_UNIX_FD</para></listitem>
+ </itemizedlist>
From server to client are as follows:
<itemizedlist>
- <listitem><para>REJECTED &lt;space-separated list of mechanism names&gt;</para></listitem>
- <listitem><para>OK &lt;GUID in hex&gt;</para></listitem>
- <listitem><para>DATA &lt;data in hex encoding&gt;</para></listitem>
- <listitem><para>ERROR</para></listitem>
- <listitem><para>AGREE_UNIX_FD</para></listitem>
- </itemizedlist>
+ <listitem><para>REJECTED &lt;space-separated list of mechanism names&gt;</para></listitem>
+ <listitem><para>OK &lt;GUID in hex&gt;</para></listitem>
+ <listitem><para>DATA &lt;data in hex encoding&gt;</para></listitem>
+ <listitem><para>ERROR</para></listitem>
+ <listitem><para>AGREE_UNIX_FD</para></listitem>
+ </itemizedlist>
</para>
<para>
Unofficial extensions to the command set must begin with the letters
@@ -1938,18 +2231,18 @@
<para>
<figure>
- <title>Example of successful magic cookie authentication</title>
- <programlisting>
+ <title>Example of successful magic cookie authentication</title>
+ <programlisting>
(MAGIC_COOKIE is a made up mechanism)
C: AUTH MAGIC_COOKIE 3138363935333137393635383634
S: OK 1234deadbeef
C: BEGIN
</programlisting>
- </figure>
+ </figure>
<figure>
- <title>Example of finding out mechanisms then picking one</title>
- <programlisting>
+ <title>Example of finding out mechanisms then picking one</title>
+ <programlisting>
C: AUTH
S: REJECTED KERBEROS_V4 SKEY
C: AUTH SKEY 7ab83f32ee
@@ -1958,20 +2251,20 @@
S: OK 1234deadbeef
C: BEGIN
</programlisting>
- </figure>
+ </figure>
<figure>
- <title>Example of client sends unknown command then falls back to regular auth</title>
- <programlisting>
+ <title>Example of client sends unknown command then falls back to regular auth</title>
+ <programlisting>
C: FOOBAR
S: ERROR
C: AUTH MAGIC_COOKIE 3736343435313230333039
S: OK 1234deadbeef
C: BEGIN
</programlisting>
- </figure>
+ </figure>
<figure>
- <title>Example of server doesn't support initial auth mechanism</title>
- <programlisting>
+ <title>Example of server doesn't support initial auth mechanism</title>
+ <programlisting>
C: AUTH MAGIC_COOKIE 3736343435313230333039
S: REJECTED KERBEROS_V4 SKEY
C: AUTH SKEY 7ab83f32ee
@@ -1980,10 +2273,10 @@
S: OK 1234deadbeef
C: BEGIN
</programlisting>
- </figure>
+ </figure>
<figure>
- <title>Example of wrong password or the like followed by successful retry</title>
- <programlisting>
+ <title>Example of wrong password or the like followed by successful retry</title>
+ <programlisting>
C: AUTH MAGIC_COOKIE 3736343435313230333039
S: REJECTED KERBEROS_V4 SKEY
C: AUTH SKEY 7ab83f32ee
@@ -1996,10 +2289,10 @@
S: OK 1234deadbeef
C: BEGIN
</programlisting>
- </figure>
+ </figure>
<figure>
- <title>Example of skey cancelled and restarted</title>
- <programlisting>
+ <title>Example of skey cancelled and restarted</title>
+ <programlisting>
C: AUTH MAGIC_COOKIE 3736343435313230333039
S: REJECTED KERBEROS_V4 SKEY
C: AUTH SKEY 7ab83f32ee
@@ -2012,10 +2305,10 @@
S: OK 1234deadbeef
C: BEGIN
</programlisting>
- </figure>
+ </figure>
<figure>
- <title>Example of successful magic cookie authentication with successful negotiation of Unix FD passing</title>
- <programlisting>
+ <title>Example of successful magic cookie authentication with successful negotiation of Unix FD passing</title>
+ <programlisting>
(MAGIC_COOKIE is a made up mechanism)
C: AUTH MAGIC_COOKIE 3138363935333137393635383634
@@ -2024,10 +2317,10 @@
S: AGREE_UNIX_FD
C: BEGIN
</programlisting>
- </figure>
+ </figure>
<figure>
- <title>Example of successful magic cookie authentication with unsuccessful negotiation of Unix FD passing</title>
- <programlisting>
+ <title>Example of successful magic cookie authentication with unsuccessful negotiation of Unix FD passing</title>
+ <programlisting>
(MAGIC_COOKIE is a made up mechanism)
C: AUTH MAGIC_COOKIE 3138363935333137393635383634
@@ -2036,7 +2329,7 @@
S: ERROR
C: BEGIN
</programlisting>
- </figure>
+ </figure>
</para>
</sect2>
<sect2 id="auth-states">
@@ -2174,7 +2467,7 @@
</listitem>
<listitem>
<para>
- Receive REJECT [mechs] &rarr; send AUTH [next mech],
+ Receive REJECTED [mechs] &rarr; send AUTH [next mech],
goto <emphasis>WaitingForData</emphasis> or
<emphasis>WaitingForOK</emphasis>
</para>
@@ -2210,7 +2503,7 @@
<itemizedlist>
<listitem>
<para>
- Receive REJECT [mechs] &rarr; send AUTH [next mech],
+ Receive REJECTED [mechs] &rarr; send AUTH [next mech],
goto <emphasis>WaitingForData</emphasis> or
<emphasis>WaitingForOK</emphasis>
</para>
@@ -2252,7 +2545,7 @@
<listitem>
<para>
- REJECT means that the client failed to authenticate or
+ REJECTED means that the client failed to authenticate or
there was an error in RESP.
</para>
</listitem>
@@ -2299,7 +2592,7 @@
</member>
<member>
- MECH(RESP) returns REJECT &rarr; send REJECTED
+ MECH(RESP) returns REJECTED &rarr; send REJECTED
[mechs], goto
<emphasis>WaitingForAuth</emphasis>
</member>
@@ -2353,7 +2646,7 @@
</member>
<member>
- MECH(RESP) returns REJECT &rarr; send REJECTED
+ MECH(RESP) returns REJECTED &rarr; send REJECTED
[mechs], goto
<emphasis>WaitingForAuth</emphasis>
</member>
@@ -2659,6 +2952,35 @@
<programlisting>unix:path=/tmp/dbus-test;unix:path=/tmp/dbus-test2</programlisting>
</para>
+ <para>
+ Some addresses are <firstterm>connectable</firstterm>. A connectable
+ address is one containing enough information for a client to connect
+ to it. For instance, <literal>tcp:host=127.0.0.1,port=4242</literal>
+ is a connectable address. It is not necessarily possible to listen
+ on every connectable address: for instance, it is not possible to
+ listen on a <literal>unixexec:</literal> address.
+ </para>
+
+ <para>
+ Some addresses are <firstterm>listenable</firstterm>. A listenable
+ address is one containing enough information for a server to listen on
+ it, producing a connectable address (which may differ from the
+ original address). Many listenable addresses are not connectable:
+ for instance, <literal>tcp:host=127.0.0.1</literal>
+ is listenable, but not connectable (because it does not specify
+ a port number).
+ </para>
+
+ <para>
+ Listening on an address that is not connectable will result in a
+ connectable address that is not the same as the listenable address.
+ For instance, listening on <literal>tcp:host=127.0.0.1</literal>
+ might result in the connectable address
+ <literal>tcp:host=127.0.0.1,port=30958</literal>,
+ or listening on <literal>unix:tmpdir=/tmp</literal>
+ might result in the connectable address
+ <literal>unix:abstract=/tmp/dbus-U8OSdmf7</literal>.
+ </para>
</sect1>
<sect1 id="transports">
@@ -2676,21 +2998,28 @@
<title>Unix Domain Sockets</title>
<para>
Unix domain sockets can be either paths in the file system or on Linux
- kernels, they can be abstract which are similar to paths but
- do not show up in the file system.
+ kernels, they can be abstract which are similar to paths but
+ do not show up in the file system.
</para>
<para>
When a socket is opened by the D-Bus library it truncates the path
- name right before the first trailing Nul byte. This is true for both
- normal paths and abstract paths. Note that this is a departure from
- previous versions of D-Bus that would create sockets with a fixed
- length path name. Names which were shorter than the fixed length
- would be padded by Nul bytes.
+ name right before the first trailing Nul byte. This is true for both
+ normal paths and abstract paths. Note that this is a departure from
+ previous versions of D-Bus that would create sockets with a fixed
+ length path name. Names which were shorter than the fixed length
+ would be padded by Nul bytes.
</para>
<para>
Unix domain sockets are not available on Windows.
</para>
+ <para>
+ Unix addresses that specify <literal>path</literal> or
+ <literal>abstract</literal> are both listenable and connectable.
+ Unix addresses that specify <literal>tmpdir</literal> are only
+ listenable: the corresponding connectable address will specify
+ either <literal>path</literal> or <literal>abstract</literal>.
+ </para>
<sect3 id="transports-unix-domain-sockets-addresses">
<title>Server Address Format</title>
<para>
@@ -2720,11 +3049,16 @@
<row>
<entry>abstract</entry>
<entry>(string)</entry>
- <entry>unique string (path) in the abstract namespace. If set, the "path" or "tempdir" key must not be set.</entry>
+ <entry>unique string (path) in the abstract namespace. If set, the "path" or "tmpdir" key must not be set. This key is only supported on platforms with "abstract Unix sockets", of which Linux is the only known example.</entry>
</row>
</tbody>
</tgroup>
</informaltable>
+ <para>
+ Exactly one of the keys <literal>path</literal>,
+ <literal>abstract</literal> or
+ <literal>tmpdir</literal> must be provided.
+ </para>
</sect3>
</sect2>
<sect2 id="transports-launchd">
@@ -2748,6 +3082,9 @@
<para>
launchd is not available on Microsoft Windows.
</para>
+ <para>
+ launchd addresses are listenable and connectable.
+ </para>
<sect3 id="transports-launchd-addresses">
<title>Server Address Format</title>
<para>
@@ -2772,6 +3109,9 @@
</tbody>
</tgroup>
</informaltable>
+ <para>
+ The <literal>env</literal> key is required.
+ </para>
</sect3>
</sect2>
<sect2 id="transports-systemd">
@@ -2794,6 +3134,11 @@
<para>
The systemd transport defines no parameter keys.
</para>
+ <para>
+ systemd addresses are listenable, but not connectable. The
+ corresponding connectable address is the <literal>unix</literal>
+ or <literal>tcp</literal> address of the socket.
+ </para>
</sect2>
<sect2 id="transports-tcp-sockets">
<title>TCP Sockets</title>
@@ -2806,9 +3151,16 @@
over a network is unsecure.
</para>
<para>
- Windows notes: Because of the tcp stack on Windows does not provide sending
- credentials over a tcp connection, the EXTERNAL authentification
- mechanismus does not work.
+ On Windows and most Unix platforms, the TCP stack is unable to transfer
+ credentials over a TCP connection, so the EXTERNAL authentication
+ mechanism does not work for this transport.
+ </para>
+ <para>
+ All <literal>tcp</literal> addresses are listenable.
+ <literal>tcp</literal> addresses in which both
+ <literal>host</literal> and <literal>port</literal> are
+ specified, and <literal>port</literal> is non-zero,
+ are also connectable.
</para>
<sect3 id="transports-tcp-sockets-addresses">
<title>Server Address Format</title>
@@ -2829,7 +3181,18 @@
<row>
<entry>host</entry>
<entry>(string)</entry>
- <entry>dns name or ip address</entry>
+ <entry>DNS name or IP address</entry>
+ </row>
+ <row>
+ <entry>bind</entry>
+ <entry>(string)</entry>
+ <entry>Used in a listenable address to configure the interface
+ on which the server will listen: either the IP address of one of
+ the local machine's interfaces (most commonly <literal>127.0.0.1
+ </literal>), or a DNS name that resolves to one of those IP
+ addresses, or '*' to listen on all interfaces simultaneously.
+ If not specified, the default is the same value as "host".
+ </entry>
</row>
<row>
<entry>port</entry>
@@ -2880,6 +3243,12 @@
key-value pair and send it over the socket. After that, the
transport behaves like an unsecured tcp transport.
</para>
+ <para>
+ All nonce-tcp addresses are listenable. nonce-tcp addresses in which
+ <literal>host</literal>, <literal>port</literal> and
+ <literal>noncefile</literal> are all specified,
+ and <literal>port</literal> is nonzero, are also connectable.
+ </para>
<sect3 id="transports-nonce-tcp-sockets-addresses">
<title>Server Address Format</title>
<para>
@@ -2899,7 +3268,13 @@
<row>
<entry>host</entry>
<entry>(string)</entry>
- <entry>dns name or ip address</entry>
+ <entry>DNS name or IP address</entry>
+ </row>
+ <row>
+ <entry>bind</entry>
+ <entry>(string)</entry>
+ <entry>The same as for tcp: addresses
+ </entry>
</row>
<row>
<entry>port</entry>
@@ -2917,7 +3292,10 @@
<row>
<entry>noncefile</entry>
<entry>(path)</entry>
- <entry>file location containing the secret</entry>
+ <entry>File location containing the secret.
+ This is only meaningful in connectable addresses:
+ a listening D-Bus server that offers this transport
+ will always create a new nonce file.</entry>
</row>
</tbody>
</tgroup>
@@ -2940,6 +3318,10 @@
<para>
Executed subprocesses are not available on Windows.
</para>
+ <para>
+ <literal>unixexec</literal> addresses are connectable, but are not
+ listenable.
+ </para>
<sect3 id="transports-exec-addresses">
<title>Server Address Format</title>
<para>
@@ -2998,6 +3380,15 @@
<para>The autolaunch transport provides a way for dbus clients to autodetect
a running dbus session bus and to autolaunch a session bus if not present.
</para>
+ <para>
+ On Unix, <literal>autolaunch</literal> addresses are connectable,
+ but not listenable.
+ </para>
+ <para>
+ On Windows, <literal>autolaunch</literal> addresses are both
+ connectable and listenable.
+ </para>
+
<sect3 id="meta-transports-autolaunch-addresses">
<title>Server Address Format</title>
<para>
@@ -3388,8 +3779,8 @@
<programlisting>
&lt;!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"&gt;
- &lt;node name="/org/freedesktop/sample_object"&gt;
- &lt;interface name="org.freedesktop.SampleInterface"&gt;
+ &lt;node name="/com/example/sample_object"&gt;
+ &lt;interface name="com.example.SampleInterface"&gt;
&lt;method name="Frobate"&gt;
&lt;arg name="foo" type="i" direction="in"/&gt;
&lt;arg name="bar" type="s" direction="out"/&gt;
@@ -3473,38 +3864,38 @@
<para>
Method, interface, property, and signal elements may have
"annotations", which are generic key/value pairs of metadata.
- They are similar conceptually to Java's annotations and C# attributes.
+ They are similar conceptually to Java's annotations and C# attributes.
Well-known annotations:
</para>
<informaltable>
<tgroup cols="3">
- <thead>
- <row>
- <entry>Name</entry>
- <entry>Values (separated by ,)</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>org.freedesktop.DBus.Deprecated</entry>
- <entry>true,false</entry>
- <entry>Whether or not the entity is deprecated; defaults to false</entry>
- </row>
- <row>
- <entry>org.freedesktop.DBus.GLib.CSymbol</entry>
- <entry>(string)</entry>
- <entry>The C symbol; may be used for methods and interfaces</entry>
- </row>
- <row>
- <entry>org.freedesktop.DBus.Method.NoReply</entry>
- <entry>true,false</entry>
- <entry>If set, don't expect a reply to the method call; defaults to false.</entry>
- </row>
- <row>
- <entry>org.freedesktop.DBus.Property.EmitsChangedSignal</entry>
- <entry>true,invalidates,false</entry>
- <entry>
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Values (separated by ,)</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>org.freedesktop.DBus.Deprecated</entry>
+ <entry>true,false</entry>
+ <entry>Whether or not the entity is deprecated; defaults to false</entry>
+ </row>
+ <row>
+ <entry>org.freedesktop.DBus.GLib.CSymbol</entry>
+ <entry>(string)</entry>
+ <entry>The C symbol; may be used for methods and interfaces</entry>
+ </row>
+ <row>
+ <entry>org.freedesktop.DBus.Method.NoReply</entry>
+ <entry>true,false</entry>
+ <entry>If set, don't expect a reply to the method call; defaults to false.</entry>
+ </row>
+ <row>
+ <entry>org.freedesktop.DBus.Property.EmitsChangedSignal</entry>
+ <entry>true,invalidates,false</entry>
+ <entry>
<para>
If set to <literal>false</literal>, the
<literal>org.freedesktop.DBus.Properties.PropertiesChanged</literal>
@@ -3529,8 +3920,8 @@
interface element.
</para>
</entry>
- </row>
- </tbody>
+ </row>
+ </tbody>
</tgroup>
</informaltable>
</sect1>
@@ -3549,14 +3940,17 @@
unique-for-the-lifetime-of-the-bus name automatically assigned.
Applications may request additional names for a connection. Additional
names are usually "well-known names" such as
- "org.freedesktop.TextEditor". When a name is bound to a connection,
+ "com.example.TextEditor". When a name is bound to a connection,
that connection is said to <firstterm>own</firstterm> the name.
</para>
<para>
- The bus itself owns a special name, <literal>org.freedesktop.DBus</literal>.
- This name routes messages to the bus, allowing applications to make
- administrative requests. For example, applications can ask the bus
- to assign a name to a connection.
+ The bus itself owns a special name,
+ <literal>org.freedesktop.DBus</literal>, with an object
+ located at <literal>/org/freedesktop/DBus</literal> that
+ implements the <literal>org.freedesktop.DBus</literal>
+ interface. This service allows applications to make
+ administrative requests of the bus itself. For example,
+ applications can ask the bus to assign a name to a connection.
</para>
<para>
Each name may have <firstterm>queued owners</firstterm>. When an
@@ -3568,7 +3962,7 @@
<para>
This feature causes the right thing to happen if you start two text
- editors for example; the first one may request "org.freedesktop.TextEditor",
+ editors for example; the first one may request "com.example.TextEditor",
and the second will be queued as a possible owner of that name. When
the first exits, the second will take over.
</para>
@@ -3640,11 +4034,11 @@
<entry>STRING</entry>
<entry>Name to request</entry>
</row>
- <row>
- <entry>1</entry>
- <entry>UINT32</entry>
- <entry>Flags</entry>
- </row>
+ <row>
+ <entry>1</entry>
+ <entry>UINT32</entry>
+ <entry>Flags</entry>
+ </row>
</tbody>
</tgroup>
</informaltable>
@@ -3755,10 +4149,10 @@
</row>
</thead>
<tbody>
- <row>
- <entry>DBUS_NAME_FLAG_ALLOW_REPLACEMENT</entry>
- <entry>0x1</entry>
- <entry>
+ <row>
+ <entry>DBUS_NAME_FLAG_ALLOW_REPLACEMENT</entry>
+ <entry>0x1</entry>
+ <entry>
If an application A specifies this flag and succeeds in
becoming the owner of the name, and another application B
@@ -3772,11 +4166,11 @@
application A as the owner.
</entry>
- </row>
- <row>
- <entry>DBUS_NAME_FLAG_REPLACE_EXISTING</entry>
- <entry>0x2</entry>
- <entry>
+ </row>
+ <row>
+ <entry>DBUS_NAME_FLAG_REPLACE_EXISTING</entry>
+ <entry>0x2</entry>
+ <entry>
Try to replace the current owner if there is one. If this
flag is not set the application will only become the owner of
@@ -3785,11 +4179,11 @@
the current owner specified DBUS_NAME_FLAG_ALLOW_REPLACEMENT.
</entry>
- </row>
- <row>
- <entry>DBUS_NAME_FLAG_DO_NOT_QUEUE</entry>
- <entry>0x4</entry>
- <entry>
+ </row>
+ <row>
+ <entry>DBUS_NAME_FLAG_DO_NOT_QUEUE</entry>
+ <entry>0x4</entry>
+ <entry>
Without this flag, if an application requests a name that is
already owned, the application will be placed in a queue to
@@ -3802,10 +4196,10 @@
became the name owner.
</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
The return code can be one of the following values:
@@ -3819,41 +4213,41 @@
</row>
</thead>
<tbody>
- <row>
+ <row>
<entry>DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER</entry>
- <entry>1</entry> <entry>The caller is now the primary owner of
- the name, replacing any previous owner. Either the name had no
- owner before, or the caller specified
- DBUS_NAME_FLAG_REPLACE_EXISTING and the current owner specified
+ <entry>1</entry> <entry>The caller is now the primary owner of
+ the name, replacing any previous owner. Either the name had no
+ owner before, or the caller specified
+ DBUS_NAME_FLAG_REPLACE_EXISTING and the current owner specified
DBUS_NAME_FLAG_ALLOW_REPLACEMENT.</entry>
- </row>
- <row>
- <entry>DBUS_REQUEST_NAME_REPLY_IN_QUEUE</entry>
- <entry>2</entry>
+ </row>
+ <row>
+ <entry>DBUS_REQUEST_NAME_REPLY_IN_QUEUE</entry>
+ <entry>2</entry>
- <entry>The name already had an owner,
+ <entry>The name already had an owner,
DBUS_NAME_FLAG_DO_NOT_QUEUE was not specified, and either
the current owner did not specify
DBUS_NAME_FLAG_ALLOW_REPLACEMENT or the requesting
application did not specify DBUS_NAME_FLAG_REPLACE_EXISTING.
</entry>
- </row>
- <row>
- <entry>DBUS_REQUEST_NAME_REPLY_EXISTS</entry> <entry>3</entry>
- <entry>The name already has an owner,
- DBUS_NAME_FLAG_DO_NOT_QUEUE was specified, and either
- DBUS_NAME_FLAG_ALLOW_REPLACEMENT was not specified by the
- current owner, or DBUS_NAME_FLAG_REPLACE_EXISTING was not
- specified by the requesting application.</entry>
- </row>
- <row>
- <entry>DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER</entry>
- <entry>4</entry>
- <entry>The application trying to request ownership of a name is already the owner of it.</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
+ </row>
+ <row>
+ <entry>DBUS_REQUEST_NAME_REPLY_EXISTS</entry> <entry>3</entry>
+ <entry>The name already has an owner,
+ DBUS_NAME_FLAG_DO_NOT_QUEUE was specified, and either
+ DBUS_NAME_FLAG_ALLOW_REPLACEMENT was not specified by the
+ current owner, or DBUS_NAME_FLAG_REPLACE_EXISTING was not
+ specified by the requesting application.</entry>
+ </row>
+ <row>
+ <entry>DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER</entry>
+ <entry>4</entry>
+ <entry>The application trying to request ownership of a name is already the owner of it.</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
</para>
</sect3>
@@ -3926,7 +4320,7 @@
</row>
</thead>
<tbody>
- <row>
+ <row>
<entry>DBUS_RELEASE_NAME_REPLY_RELEASED</entry>
<entry>1</entry> <entry>The caller has released his claim on
the given name. Either the caller was the primary owner of
@@ -3934,21 +4328,21 @@
waiting in the queue for the name, or the caller was waiting
in the queue for the name and has now been removed from the
queue.</entry>
- </row>
- <row>
- <entry>DBUS_RELEASE_NAME_REPLY_NON_EXISTENT</entry>
- <entry>2</entry>
- <entry>The given name does not exist on this bus.</entry>
- </row>
- <row>
- <entry>DBUS_RELEASE_NAME_REPLY_NOT_OWNER</entry>
- <entry>3</entry>
- <entry>The caller was not the primary owner of this name,
+ </row>
+ <row>
+ <entry>DBUS_RELEASE_NAME_REPLY_NON_EXISTENT</entry>
+ <entry>2</entry>
+ <entry>The given name does not exist on this bus.</entry>
+ </row>
+ <row>
+ <entry>DBUS_RELEASE_NAME_REPLY_NOT_OWNER</entry>
+ <entry>3</entry>
+ <entry>The caller was not the primary owner of this name,
and was also not waiting in the queue to own this name.</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
</para>
</sect3>
@@ -4110,7 +4504,7 @@
<sect3 id="message-bus-routing-match-rules">
<title>Match Rules</title>
<para>
- An important part of the message bus routing protocol is match
+ An important part of the message bus routing protocol is match
rules. Match rules describe the messages that should be sent to a
client, based on the contents of the message. Broadcast signals
are only sent to clients which have a suitable match rule: this
@@ -4140,8 +4534,7 @@
</para>
<para>
The following table describes the keys that can be used to create
- a match rule:
- The following table summarizes the D-Bus types.
+ a match rule.
<informaltable>
<tgroup cols="3">
<thead>
@@ -4343,9 +4736,9 @@
<para>
With D-Bus, starting a service is normally done by name. That is,
applications ask the message bus to start some program that will own a
- well-known name, such as <literal>org.freedesktop.TextEditor</literal>.
- This implies a contract documented along with the name
- <literal>org.freedesktop.TextEditor</literal> for which objects
+ well-known name, such as <literal>com.example.TextEditor</literal>.
+ This implies a contract documented along with the name
+ <literal>com.example.TextEditor</literal> for which object
the owner of that name will provide, and what interfaces those
objects will have.
</para>
@@ -4369,6 +4762,19 @@
</para>
<para>
+ On the well-known system bus, the name of a service description file
+ must be its well-known name plus <literal>.service</literal>,
+ for instance
+ <literal>com.example.ConfigurationDatabase.service</literal>.
+ </para>
+
+ <para>
+ On the well-known session bus, services should follow the same
+ service description file naming convention as on the system bus,
+ but for backwards compatibility they are not required to do so.
+ </para>
+
+ <para>
[FIXME the file format should be much better specified than "similar to
.desktop entries" esp. since desktop entries are already
badly-specified. ;-)]
@@ -4379,23 +4785,55 @@
<listitem><para>Comment format</para></listitem>
</itemizedlist>
+ Service description files must contain a
+ <literal>D-BUS Service</literal> group with at least the keys
+ <literal>Name</literal> (the well-known name of the service)
+ and <literal>Exec</literal> (the command to be executed).
+
<figure>
- <title>Example service description file</title>
- <programlisting>
+ <title>Example service description file</title>
+ <programlisting>
# Sample service description file
[D-BUS Service]
- Names=org.freedesktop.ConfigurationDatabase;org.gnome.GConf;
- Exec=/usr/libexec/gconfd-2
+ Name=com.example.ConfigurationDatabase
+ Exec=/usr/bin/sample-configd
</programlisting>
- </figure>
+ </figure>
</para>
+
+ <para>
+ Additionally, service description files for the well-known system
+ bus on Unix must contain a <literal>User</literal> key, whose value
+ is the name of a user account (e.g. <literal>root</literal>).
+ The system service will be run as that user.
+ </para>
+
<para>
When an application asks to start a service by name, the bus daemon tries to
find a service that will own that name. It then tries to spawn the
executable associated with it. If this fails, it will report an
- error. [FIXME what happens if two .service files offer the same service;
- what kind of error is reported, should we have a way for the client to
- choose one?]
+ error.
+ </para>
+
+ <para>
+ On the well-known system bus, it is not possible for two .service files
+ in the same directory to offer the same service, because they are
+ constrained to have names that match the service name.
+ </para>
+
+ <para>
+ On the well-known session bus, if two .service files in the same
+ directory offer the same service name, the result is undefined.
+ Distributors should avoid this situation, for instance by naming
+ session services' .service files according to their service name.
+ </para>
+
+ <para>
+ If two .service files in different directories offer the same
+ service name, the one in the higher-priority directory is used:
+ for instance, on the system bus, .service files in
+ /usr/local/share/dbus-1/system-services take precedence over those
+ in /usr/share/dbus-1/system-services.
</para>
<para>
The executable launched will have the environment variable
@@ -4942,16 +5380,16 @@
<entry>STRING</entry>
<entry>Name with a new owner</entry>
</row>
- <row>
- <entry>1</entry>
- <entry>STRING</entry>
- <entry>Old owner or empty string if none</entry>
- </row>
- <row>
- <entry>2</entry>
- <entry>STRING</entry>
- <entry>New owner or empty string if none</entry>
- </row>
+ <row>
+ <entry>1</entry>
+ <entry>STRING</entry>
+ <entry>Old owner or empty string if none</entry>
+ </row>
+ <row>
+ <entry>2</entry>
+ <entry>STRING</entry>
+ <entry>New owner or empty string if none</entry>
+ </row>
</tbody>
</tgroup>
</informaltable>
@@ -5051,11 +5489,11 @@
<entry>STRING</entry>
<entry>Name of the service to start</entry>
</row>
- <row>
- <entry>1</entry>
- <entry>UINT32</entry>
- <entry>Flags (currently not used)</entry>
- </row>
+ <row>
+ <entry>1</entry>
+ <entry>UINT32</entry>
+ <entry>Flags (currently not used)</entry>
+ </row>
</tbody>
</tgroup>
</informaltable>
@@ -5093,7 +5531,7 @@
</row>
</thead>
<tbody>
- <row>
+ <row>
<entry>DBUS_START_REPLY_SUCCESS</entry>
<entry>1</entry>
<entry>The service was successfully started.</entry>
@@ -5304,6 +5742,225 @@
</para>
</sect3>
+ <sect3 id="bus-messages-get-connection-credentials">
+ <title><literal>org.freedesktop.DBus.GetConnectionCredentials</literal></title>
+ <para>
+ As a method:
+ <programlisting>
+ DICT&lt;STRING,VARIANT&gt; GetConnectionCredentials (in STRING bus_name)
+ </programlisting>
+ Message arguments:
+ <informaltable>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Argument</entry>
+ <entry>Type</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>0</entry>
+ <entry>STRING</entry>
+ <entry>Unique or well-known bus name of the connection to
+ query, such as <literal>:12.34</literal> or
+ <literal>com.example.tea</literal></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ Reply arguments:
+ <informaltable>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Argument</entry>
+ <entry>Type</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>0</entry>
+ <entry>DICT&lt;STRING,VARIANT&gt;</entry>
+ <entry>Credentials</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+
+ <para>
+ Returns as many credentials as possible for the process connected to
+ the server. If unable to determine certain credentials (for instance,
+ because the process is not on the same machine as the bus daemon,
+ or because this version of the bus daemon does not support a
+ particular security framework), or if the values of those credentials
+ cannot be represented as documented here, then those credentials
+ are omitted.
+ </para>
+
+ <para>
+ Keys in the returned dictionary not containing "." are defined
+ by this specification. Bus daemon implementors supporting
+ credentials frameworks not mentioned in this document should either
+ contribute patches to this specification, or use keys containing
+ "." and starting with a reversed domain name.
+ <informaltable>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Key</entry>
+ <entry>Value type</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>UnixUserID</entry>
+ <entry>UINT32</entry>
+ <entry>The numeric Unix user ID, as defined by POSIX</entry>
+ </row>
+ <row>
+ <entry>ProcessID</entry>
+ <entry>UINT32</entry>
+ <entry>The numeric process ID, on platforms that have
+ this concept. On Unix, this is the process ID defined by
+ POSIX.</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+
+ <para>
+ This method was added in D-Bus 1.7 to reduce the round-trips
+ required to list a process's credentials. In older versions, calling
+ this method will fail: applications should recover by using the
+ separate methods such as
+ <xref linkend="bus-messages-get-connection-unix-user"/>
+ instead.
+ </para>
+ </sect3>
+
+ <sect3 id="bus-messages-get-adt-audit-session-data">
+ <title><literal>org.freedesktop.DBus.GetAdtAuditSessionData</literal></title>
+ <para>
+ As a method:
+ <programlisting>
+ ARRAY of BYTE GetAdtAuditSessionData (in STRING bus_name)
+ </programlisting>
+ Message arguments:
+ <informaltable>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Argument</entry>
+ <entry>Type</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>0</entry>
+ <entry>STRING</entry>
+ <entry>Unique or well-known bus name of the connection to
+ query, such as <literal>:12.34</literal> or
+ <literal>com.example.tea</literal></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ Reply arguments:
+ <informaltable>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Argument</entry>
+ <entry>Type</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>0</entry>
+ <entry>ARRAY of BYTE</entry>
+ <entry>auditing data as returned by
+ adt_export_session_data()</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ Returns auditing data used by Solaris ADT, in an unspecified
+ binary format. If you know what this means, please contribute
+ documentation via the D-Bus bug tracking system.
+ This method is on the core DBus interface for historical reasons;
+ the same information should be made available via
+ <xref linkend="bus-messages-get-connection-credentials"/>
+ in future.
+ </para>
+ </sect3>
+
+ <sect3 id="bus-messages-get-connection-selinux-security-context">
+ <title><literal>org.freedesktop.DBus.GetConnectionSELinuxSecurityContext</literal></title>
+ <para>
+ As a method:
+ <programlisting>
+ ARRAY of BYTE GetConnectionSELinuxSecurityContext (in STRING bus_name)
+ </programlisting>
+ Message arguments:
+ <informaltable>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Argument</entry>
+ <entry>Type</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>0</entry>
+ <entry>STRING</entry>
+ <entry>Unique or well-known bus name of the connection to
+ query, such as <literal>:12.34</literal> or
+ <literal>com.example.tea</literal></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ Reply arguments:
+ <informaltable>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Argument</entry>
+ <entry>Type</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>0</entry>
+ <entry>ARRAY of BYTE</entry>
+ <entry>some sort of string of bytes, not necessarily UTF-8,
+ not including '\0'</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ Returns the security context used by SELinux, in an unspecified
+ format. If you know what this means, please contribute
+ documentation via the D-Bus bug tracking system.
+ This method is on the core DBus interface for historical reasons;
+ the same information should be made available via
+ <xref linkend="bus-messages-get-connection-credentials"/>
+ in future.
+ </para>
+ </sect3>
+
+
<sect3 id="bus-messages-add-match">
<title><literal>org.freedesktop.DBus.AddMatch</literal></title>
<para>
@@ -5331,8 +5988,8 @@
</tgroup>
</informaltable>
Adds a match rule to match messages going through the message bus (see <xref linkend='message-bus-routing-match-rules'/>).
- If the bus does not have enough resources the <literal>org.freedesktop.DBus.Error.OOM</literal>
- error is returned.
+ If the bus does not have enough resources the <literal>org.freedesktop.DBus.Error.OOM</literal>
+ error is returned.
</para>
</sect3>
<sect3 id="bus-messages-remove-match">
@@ -5362,8 +6019,8 @@
</tgroup>
</informaltable>
Removes the first rule that matches (see <xref linkend='message-bus-routing-match-rules'/>).
- If the rule is not found the <literal>org.freedesktop.DBus.Error.MatchRuleNotFound</literal>
- error is returned.
+ If the rule is not found the <literal>org.freedesktop.DBus.Error.MatchRuleNotFound</literal>
+ error is returned.
</para>
</sect3>
@@ -5507,7 +6164,7 @@
<glossentry id="one-to-one"><glossterm>One-to-One</glossterm>
<glossdef>
- <para>
+ <para>
An application talking directly to another application, without going
through a message bus. One-to-one connections may be "peer to peer" or
"client to server." The D-Bus protocol has no concept of client
@@ -5546,9 +6203,9 @@
A service is an executable that can be launched by the bus daemon.
Services normally guarantee some particular features, for example they
may guarantee that they will request a specific name such as
- "org.freedesktop.Screensaver", have a singleton object
- "/org/freedesktop/Application", and that object will implement the
- interface "org.freedesktop.ScreensaverControl".
+ "com.example.Screensaver", have a singleton object
+ "/com/example/Application", and that object will implement the
+ interface "com.example.Screensaver.Control".
</para>
</glossdef>
</glossentry>
diff --git a/doc/dbus-test-plan.html b/doc/dbus-test-plan.html
deleted file mode 100644
index 98072aee..00000000
--- a/doc/dbus-test-plan.html
+++ /dev/null
@@ -1,141 +0,0 @@
-<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>D-Bus Test Plan</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="article" title="D-Bus Test Plan"><div class="titlepage"><div><div><h2 class="title"><a name="index"></a>D-Bus Test Plan</h2></div><div><div class="authorgroup"><div class="author"><h3 class="author"><span class="firstname">Anders</span> <span class="surname">Carlsson</span></h3><div class="affiliation"><span class="orgname">CodeFactory AB<br></span><div class="address"><p><code class="email">&lt;<a class="email" href="mailto:andersca@codefactory.se">andersca@codefactory.se</a>&gt;</code></p></div></div></div></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="#importance-of-testing">The importance of testing</a></span></dt></dl></dd><dt><span class="sect1"><a href="#client-library">Testing the D-Bus client library</a></span></dt><dd><dl><dt><span class="sect2"><a href="#data-structures">Data Structures</a></span></dt><dt><span class="sect2"><a href="#message-loader">Message loader</a></span></dt><dt><span class="sect2"><a href="#authentication">Authentication</a></span></dt></dl></dd><dt><span class="sect1"><a href="#daemon">Testing the D-Bus bus daemon</a></span></dt><dd><dl><dt><span class="sect2"><a href="#debug-transport">The debug transport</a></span></dt><dt><span class="sect2"><a href="#bus-test">The bus-test program</a></span></dt></dl></dd><dt><span class="sect1"><a href="#other-tests">Other tests</a></span></dt><dd><dl><dt><span class="sect2"><a href="#oom-robustness">Out-Of-Memory robustness</a></span></dt><dt><span class="sect2"><a href="#leaks-and-other-stuff">Memory leaks and code robustness</a></span></dt></dl></dd></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>
- This document tries to explain the details of the test plan for D-Bus
- </p><div class="sect2" title="The importance of testing"><div class="titlepage"><div><div><h3 class="title"><a name="importance-of-testing"></a>The importance of testing</h3></div></div></div><p>
- As with any big library or program, testing is important. It
- can help find bugs and regressions and make the code better
- overall.
- </p><p>
- D-Bus is a large and complex piece of software (about 25,000
- lines of code for the client library, and 2,500 lines of code
- for the bus daemon) and it's therefore important to try to make sure
- that all parts of the software is functioning correctly.
- </p><p>
- D-Bus can be built with support for testing by passing
- <code class="literal">--enable-tests</code>. to the configure script. It
- is recommended that production systems build without testing
- since that reduces the D-Bus client library size.
- </p></div></div><div class="sect1" title="Testing the D-Bus client library"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="client-library"></a>Testing the D-Bus client library</h2></div></div></div><p>
- The tests for the client library consist of the dbus-test
- program which is a unit test for all aspects of the client
- library. Whenever a bug in the client library is found and
- fixed, a test is added to make sure that the bug won't occur again.
- </p><div class="sect2" title="Data Structures"><div class="titlepage"><div><div><h3 class="title"><a name="data-structures"></a>Data Structures</h3></div></div></div><p>
- The D-Bus client library consists of some data structures that
- are used internally; a linked list class, a hashtable class and
- a string class. All aspects of those are tested by dbus-test.
- </p></div><div class="sect2" title="Message loader"><div class="titlepage"><div><div><h3 class="title"><a name="message-loader"></a>Message loader</h3></div></div></div><p>
- The message loader is the part of D-Bus that takes messages in
- raw character form and parses them, turning them into DBusMessages.
- </p><p>
- This is one of the parts of D-Bus that
- <span class="emphasis"><em>must</em></span> be absolutely bug-free and
- robust. The message loader should be able to handle invalid
- and incomplete messages without crashing. Not doing so is a
- serious issue and can easily result in D-Bus being exploitable
- to DoS attacks.
- </p><p>
- To solve these problems, there is a testing feature called the
- 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="idp4137856"></a><p class="title"><b>Figure1.Example of a message in string form</b></p><div class="figure-contents"><pre class="programlisting">
- # Standard org.freedesktop.DBus.Hello message
-
- VALID_HEADER
- FIELD_NAME name
- TYPE STRING
- STRING 'org.freedesktop.DBus.Hello'
- FIELD_NAME srvc
- TYPE STRING
- STRING 'org.freedesktop.DBus'
- ALIGN 8
- END_LENGTH Header
- START_LENGTH Body
- END_LENGTH Body
- </pre></div></div><br class="figure-break"><p>
- The file format of messages in string form is documented in
- the D-Bus Reference Manual.
- </p><p>
- The message test part of dbus-test is using the message
- builder to build different kinds of messages, both valid,
- invalid, and invalid ones, to make sure that the loader won't
- crash or leak memory of any of those, and that the loader
- knows if a message is valid or not.
- </p><p>
- There is also a test program called
- <code class="literal">break-loader</code> that loads a message in
- string-form into raw character form using the message
- builder. It then randomly changes the message, it can for
- example replace single bytes of data or modify the length of
- the message. This is to simulate network errors. The
- break-loader program saves all the messages leading to errors
- so it can easily be run for a long period of time.
- </p></div><div class="sect2" title="Authentication"><div class="titlepage"><div><div><h3 class="title"><a name="authentication"></a>Authentication</h3></div></div></div><p>
- For testing authentication, there is a testing feature that
- 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="idp4144544"></a><p class="title"><b>Figure2.Example of an authentication script</b></p><div class="figure-contents"><pre class="programlisting">
- ## this tests a successful auth of type EXTERNAL
-
- SERVER
- SEND 'AUTH EXTERNAL USERNAME_HEX'
- EXPECT_COMMAND OK
- EXPECT_STATE WAITING_FOR_INPUT
- SEND 'BEGIN'
- EXPECT_STATE AUTHENTICATED
- </pre></div></div><br class="figure-break"></div></div><div class="sect1" title="Testing the D-Bus bus daemon"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="daemon"></a>Testing the D-Bus bus daemon</h2></div></div></div><p>
- Since the D-Bus bus daemon is using the D-Bus client library it
- will benefit from all tests done on the client library, but
- there is still the issue of testing client-server communication.
- This is more complicated since it it may require another process
- running.
- </p><div class="sect2" title="The debug transport"><div class="titlepage"><div><div><h3 class="title"><a name="debug-transport"></a>The debug transport</h3></div></div></div><p>
- In D-Bus, a <span class="emphasis"><em>transport</em></span> is a class that
- handles sending and receiving raw data over a certain
- medium. The transport that is used most in D-Bus is the UNIX
- transport with sends and recevies data over a UNIX socket. A
- transport that tunnels data through X11 client messages is
- also under development.
- </p><p>
- The D-Bus debug transport is a specialized transport that
- works in-process. This means that a client and server that
- exists in the same process can talk to eachother without using
- a socket.
- </p></div><div class="sect2" title="The bus-test program"><div class="titlepage"><div><div><h3 class="title"><a name="bus-test"></a>The bus-test program</h3></div></div></div><p>
- The bus-test program is a program that is used to test various
- parts of the D-Bus bus daemon; robustness and that it conforms
- to the specifications.
- </p><p>
- The test program has the necessary code from the bus daemon
- linked in, and it uses the debug transport for
- communication. This means that the bus daemon code can be
- tested without the real bus actually running, which makes
- testing easier.
- </p><p>
- The bus-test program should test all major features of the
- bus, such as service registration, notification when things
- occurs and message matching.
- </p></div></div><div class="sect1" title="Other tests"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="other-tests"></a>Other tests</h2></div></div></div><div class="sect2" title="Out-Of-Memory robustness"><div class="titlepage"><div><div><h3 class="title"><a name="oom-robustness"></a>Out-Of-Memory robustness</h3></div></div></div><p>
- Since D-Bus should be able to be used in embedded devices, and
- also as a system service, it should be able to cope with
- low-memory situations without exiting or crashing.
- </p><p>
- In practice, this means that both the client and server code
- must be able to handle dbus_malloc returning NULL.
- </p><p>
- To test this, two environment variables
- exist. <code class="literal">DBUS_MALLOC_FAIL_NTH</code> will make every
- nth call to dbus_malloc return NULL, and
- <code class="literal">DBUS_MALLOC_FAIL_GREATER_THAN</code> will make any
- dbus_malloc call with a request for more than the specified
- number of bytes fail.
- </p></div><div class="sect2" title="Memory leaks and code robustness"><div class="titlepage"><div><div><h3 class="title"><a name="leaks-and-other-stuff"></a>Memory leaks and code robustness</h3></div></div></div><p>
- Naturally there are some things that tests can't be written
- for, for example things like memory leaks and out-of-bounds
- memory reading or writing.
- </p><p>
- Luckily there exists good tools for catching such errors. One
- free good tool is <a class="ulink" href="http://devel-home.kde.org/~sewardj/" target="_top">Valgrind</a>, which runs the program in a
- virtual CPU which makes catching errors easy. All test programs can be run under Valgrind,
- </p></div></div></div></body></html>
diff --git a/doc/dbus-test-plan.xml b/doc/dbus-test-plan.xml
index e6aafb9a..e3efd2cd 100644
--- a/doc/dbus-test-plan.xml
+++ b/doc/dbus-test-plan.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" standalone="no"?>
-<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
-"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
[
]>
@@ -48,7 +48,7 @@
<sect1 id="client-library">
<title>Testing the D-Bus client library</title>
<para>
- The tests for the client library consist of the dbus-test
+ The tests for the client library consist of the test-dbus
program which is a unit test for all aspects of the client
library. Whenever a bug in the client library is found and
fixed, a test is added to make sure that the bug won't occur again.
@@ -58,7 +58,7 @@
<para>
The D-Bus client library consists of some data structures that
are used internally; a linked list class, a hashtable class and
- a string class. All aspects of those are tested by dbus-test.
+ a string class. All aspects of those are tested by test-dbus.
</para>
</sect2>
<sect2 id="message-loader">
@@ -104,7 +104,7 @@
the D-Bus Reference Manual.
</para>
<para>
- The message test part of dbus-test is using the message
+ The message test part of test-dbus is using the message
builder to build different kinds of messages, both valid,
invalid, and invalid ones, to make sure that the loader won't
crash or leak memory of any of those, and that the loader
@@ -170,10 +170,10 @@
a socket.
</para>
</sect2>
- <sect2 id="bus-test">
- <title>The bus-test program</title>
+ <sect2 id="test-bus">
+ <title>The test-bus program</title>
<para>
- The bus-test program is a program that is used to test various
+ The test-bus program is a program that is used to test various
parts of the D-Bus bus daemon; robustness and that it conforms
to the specifications.
</para>
@@ -185,7 +185,7 @@
testing easier.
</para>
<para>
- The bus-test program should test all major features of the
+ The test-bus program should test all major features of the
bus, such as service registration, notification when things
occurs and message matching.
</para>
diff --git a/doc/dbus-tutorial.html b/doc/dbus-tutorial.html
deleted file mode 100644
index 37ab2eac..00000000
--- a/doc/dbus-tutorial.html
+++ /dev/null
@@ -1,991 +0,0 @@
-<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>D-Bus Tutorial</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="article" title="D-Bus Tutorial"><div class="titlepage"><div><div><h2 class="title"><a name="index"></a>D-Bus Tutorial</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><code class="email">&lt;<a class="email" href="mailto:hp@pobox.com">hp@pobox.com</a>&gt;</code></p></div></div></div><div class="author"><h3 class="author"><span class="firstname">David</span> <span class="surname">Wheeler</span></h3></div><div class="author"><h3 class="author"><span class="firstname">John</span> <span class="surname">Palmieri</span></h3><div class="affiliation"><span class="orgname">Red Hat, Inc.<br></span><div class="address"><p><code class="email">&lt;<a class="email" href="mailto:johnp@redhat.com">johnp@redhat.com</a>&gt;</code></p></div></div></div><div class="author"><h3 class="author"><span class="firstname">Colin</span> <span class="surname">Walters</span></h3><div class="affiliation"><span class="orgname">Red Hat, Inc.<br></span><div class="address"><p><code class="email">&lt;<a class="email" href="mailto:walters@redhat.com">walters@redhat.com</a>&gt;</code></p></div></div></div></div></div><div><p class="releaseinfo">Version 0.5.0</p></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="#meta">Tutorial Work In Progress</a></span></dt><dt><span class="sect1"><a href="#whatis">What is D-Bus?</a></span></dt><dd><dl><dt><span class="sect2"><a href="#uses">D-Bus applications</a></span></dt></dl></dd><dt><span class="sect1"><a href="#concepts">Concepts</a></span></dt><dd><dl><dt><span class="sect2"><a href="#objects">Native Objects and Object Paths</a></span></dt><dt><span class="sect2"><a href="#members">Methods and Signals</a></span></dt><dt><span class="sect2"><a href="#interfaces">Interfaces</a></span></dt><dt><span class="sect2"><a href="#proxies">Proxies</a></span></dt><dt><span class="sect2"><a href="#bus-names">Bus Names</a></span></dt><dt><span class="sect2"><a href="#addresses">Addresses</a></span></dt><dt><span class="sect2"><a href="#bigpicture">Big Conceptual Picture</a></span></dt><dt><span class="sect2"><a href="#messages">Messages - Behind the Scenes</a></span></dt><dt><span class="sect2"><a href="#callprocedure">Calling a Method - Behind the Scenes</a></span></dt><dt><span class="sect2"><a href="#signalprocedure">Emitting a Signal - Behind the Scenes</a></span></dt><dt><span class="sect2"><a href="#introspection">Introspection</a></span></dt></dl></dd><dt><span class="sect1"><a href="#glib-client">GLib API: Using Remote Objects</a></span></dt><dd><dl><dt><span class="sect2"><a href="#glib-typemappings">D-Bus - GLib type mappings</a></span></dt><dt><span class="sect2"><a href="#sample-program-1">A sample program</a></span></dt><dt><span class="sect2"><a href="#glib-program-setup">Program initalization</a></span></dt><dt><span class="sect2"><a href="#glib-method-invocation">Understanding method invocation</a></span></dt><dt><span class="sect2"><a href="#glib-signal-connection">Connecting to object signals</a></span></dt><dt><span class="sect2"><a href="#glib-error-handling">Error handling and remote exceptions</a></span></dt><dt><span class="sect2"><a href="#glib-more-examples">More examples of method invocation</a></span></dt><dt><span class="sect2"><a href="#glib-generated-bindings">Generated Bindings</a></span></dt></dl></dd><dt><span class="sect1"><a href="#glib-server">GLib API: Implementing Objects</a></span></dt><dd><dl><dt><span class="sect2"><a href="#glib-annotations">Server-side Annotations</a></span></dt></dl></dd><dt><span class="sect1"><a href="#python-client">Python API</a></span></dt><dt><span class="sect1"><a href="#qt-client">Qt API: Using Remote Objects</a></span></dt><dt><span class="sect1"><a href="#qt-server">Qt API: Implementing Objects</a></span></dt></dl></div><div class="sect1" title="Tutorial Work In Progress"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="meta"></a>Tutorial Work In Progress</h2></div></div></div><p>
- This tutorial is not complete; it probably contains some useful information, but
- also has plenty of gaps. Right now, you'll also need to refer to the D-Bus specification,
- Doxygen reference documentation, and look at some examples of how other apps use D-Bus.
- </p><p>
- Enhancing the tutorial is definitely encouraged - send your patches or suggestions to the
- mailing list. If you create a D-Bus binding, please add a section to the tutorial for your
- binding, if only a short section with a couple of examples.
- </p></div><div class="sect1" title="What is D-Bus?"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="whatis"></a>What is D-Bus?</h2></div></div></div><p>
- D-Bus is a system for <em class="firstterm">interprocess communication</em>
- (IPC). Architecturally, it has several layers:
-
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
- A library, <em class="firstterm">libdbus</em>, that allows two
- applications to connect to each other and exchange messages.
- </p></li><li class="listitem"><p>
- A <em class="firstterm">message bus daemon</em> executable, built on
- libdbus, that multiple applications can connect to. The daemon can
- route messages from one application to zero or more other
- applications.
- </p></li><li class="listitem"><p>
- <em class="firstterm">Wrapper libraries</em> or <em class="firstterm">bindings</em>
- based on particular application frameworks. For example, libdbus-glib and
- libdbus-qt. There are also bindings to languages such as
- Python. These wrapper libraries are the API most people should use,
- as they simplify the details of D-Bus programming. libdbus is
- intended to be a low-level backend for the higher level bindings.
- Much of the libdbus API is only useful for binding implementation.
- </p></li></ul></div><p>
- </p><p>
- libdbus only supports one-to-one connections, just like a raw network
- socket. However, rather than sending byte streams over the connection, you
- send <em class="firstterm">messages</em>. Messages have a header identifying
- the kind of message, and a body containing a data payload. libdbus also
- abstracts the exact transport used (sockets vs. whatever else), and
- handles details such as authentication.
- </p><p>
- The message bus daemon forms the hub of a wheel. Each spoke of the wheel
- is a one-to-one connection to an application using libdbus. An
- application sends a message to the bus daemon over its spoke, and the bus
- daemon forwards the message to other connected applications as
- appropriate. Think of the daemon as a router.
- </p><p>
- The bus daemon has multiple instances on a typical computer. The
- first instance is a machine-global singleton, that is, a system daemon
- similar to sendmail or Apache. This instance has heavy security
- restrictions on what messages it will accept, and is used for systemwide
- communication. The other instances are created one per user login session.
- These instances allow applications in the user's session to communicate
- with one another.
- </p><p>
- The systemwide and per-user daemons are separate. Normal within-session
- IPC does not involve the systemwide message bus process and vice versa.
- </p><div class="sect2" title="D-Bus applications"><div class="titlepage"><div><div><h3 class="title"><a name="uses"></a>D-Bus applications</h3></div></div></div><p>
- There are many, many technologies in the world that have "Inter-process
- communication" or "networking" in their stated purpose: <a class="ulink" href="http://www.omg.org" target="_top">CORBA</a>, <a class="ulink" href="http://www.opengroup.org/dce/" target="_top">DCE</a>, <a class="ulink" href="http://www.microsoft.com/com/" target="_top">DCOM</a>, <a class="ulink" href="http://developer.kde.org/documentation/library/kdeqt/dcop.html" target="_top">DCOP</a>, <a class="ulink" href="http://www.xmlrpc.com" target="_top">XML-RPC</a>, <a class="ulink" href="http://www.w3.org/TR/SOAP/" target="_top">SOAP</a>, <a class="ulink" href="http://www.mbus.org/" target="_top">MBUS</a>, <a class="ulink" href="http://www.zeroc.com/ice.html" target="_top">Internet Communications Engine (ICE)</a>,
- and probably hundreds more.
- Each of these is tailored for particular kinds of application.
- D-Bus is designed for two specific cases:
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
- Communication between desktop applications in the same desktop
- session; to allow integration of the desktop session as a whole,
- and address issues of process lifecycle (when do desktop components
- start and stop running).
- </p></li><li class="listitem"><p>
- Communication between the desktop session and the operating system,
- where the operating system would typically include the kernel
- and any system daemons or processes.
- </p></li></ul></div><p>
- </p><p>
- For the within-desktop-session use case, the GNOME and KDE desktops
- have significant previous experience with different IPC solutions
- such as CORBA and DCOP. D-Bus is built on that experience and
- carefully tailored to meet the needs of these desktop projects
- in particular. D-Bus may or may not be appropriate for other
- applications; the FAQ has some comparisons to other IPC systems.
- </p><p>
- The problem solved by the systemwide or communication-with-the-OS case
- is explained well by the following text from the Linux Hotplug project:
- </p><div class="blockquote"><blockquote class="blockquote"><p>
- A gap in current Linux support is that policies with any sort of
- dynamic "interact with user" component aren't currently
- supported. For example, that's often needed the first time a network
- adapter or printer is connected, and to determine appropriate places
- to mount disk drives. It would seem that such actions could be
- supported for any case where a responsible human can be identified:
- single user workstations, or any system which is remotely
- administered.
- </p><p>
- This is a classic "remote sysadmin" problem, where in this case
- hotplugging needs to deliver an event from one security domain
- (operating system kernel, in this case) to another (desktop for
- logged-in user, or remote sysadmin). Any effective response must go
- the other way: the remote domain taking some action that lets the
- kernel expose the desired device capabilities. (The action can often
- be taken asynchronously, for example letting new hardware be idle
- until a meeting finishes.) At this writing, Linux doesn't have
- widely adopted solutions to such problems. However, the new D-Bus
- work may begin to solve that problem.
- </p></blockquote></div><p>
- </p><p>
- D-Bus may happen to be useful for purposes other than the one it was
- designed for. Its general properties that distinguish it from
- other forms of IPC are:
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
- Binary protocol designed to be used asynchronously
- (similar in spirit to the X Window System protocol).
- </p></li><li class="listitem"><p>
- Stateful, reliable connections held open over time.
- </p></li><li class="listitem"><p>
- The message bus is a daemon, not a "swarm" or
- distributed architecture.
- </p></li><li class="listitem"><p>
- Many implementation and deployment issues are specified rather
- than left ambiguous/configurable/pluggable.
- </p></li><li class="listitem"><p>
- Semantics are similar to the existing DCOP system, allowing
- KDE to adopt it more easily.
- </p></li><li class="listitem"><p>
- Security features to support the systemwide mode of the
- message bus.
- </p></li></ul></div><p>
- </p></div></div><div class="sect1" title="Concepts"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="concepts"></a>Concepts</h2></div></div></div><p>
- Some basic concepts apply no matter what application framework you're
- using to write a D-Bus application. The exact code you write will be
- different for GLib vs. Qt vs. Python applications, however.
- </p><p>
- Here is a diagram (<a class="ulink" href="diagram.png" target="_top">png</a> <a class="ulink" href="diagram.svg" target="_top">svg</a>) that may help you visualize the concepts
- that follow.
- </p><div class="sect2" title="Native Objects and Object Paths"><div class="titlepage"><div><div><h3 class="title"><a name="objects"></a>Native Objects and Object Paths</h3></div></div></div><p>
- Your programming framework probably defines what an "object" is like;
- usually with a base class. For example: java.lang.Object, GObject, QObject,
- python's base Object, or whatever. Let's call this a <em class="firstterm">native object</em>.
- </p><p>
- The low-level D-Bus protocol, and corresponding libdbus API, does not care about native objects.
- However, it provides a concept called an
- <em class="firstterm">object path</em>. The idea of an object path is that
- higher-level bindings can name native object instances, and allow remote applications
- to refer to them.
- </p><p>
- The object path
- looks like a filesystem path, for example an object could be
- named <code class="literal">/org/kde/kspread/sheets/3/cells/4/5</code>.
- Human-readable paths are nice, but you are free to create an
- object named <code class="literal">/com/mycompany/c5yo817y0c1y1c5b</code>
- if it makes sense for your application.
- </p><p>
- Namespacing object paths is smart, by starting them with the components
- of a domain name you own (e.g. <code class="literal">/org/kde</code>). This
- keeps different code modules in the same process from stepping
- on one another's toes.
- </p></div><div class="sect2" title="Methods and Signals"><div class="titlepage"><div><div><h3 class="title"><a name="members"></a>Methods and Signals</h3></div></div></div><p>
- Each object has <em class="firstterm">members</em>; the two kinds of member
- are <em class="firstterm">methods</em> and
- <em class="firstterm">signals</em>. Methods are operations that can be
- invoked on an object, with optional input (aka arguments or "in
- parameters") and output (aka return values or "out parameters").
- Signals are broadcasts from the object to any interested observers
- of the object; signals may contain a data payload.
- </p><p>
- Both methods and signals are referred to by name, such as
- "Frobate" or "OnClicked".
- </p></div><div class="sect2" title="Interfaces"><div class="titlepage"><div><div><h3 class="title"><a name="interfaces"></a>Interfaces</h3></div></div></div><p>
- Each object supports one or more <em class="firstterm">interfaces</em>.
- Think of an interface as a named group of methods and signals,
- just as it is in GLib or Qt or Java. Interfaces define the
- <span class="emphasis"><em>type</em></span> of an object instance.
- </p><p>
- DBus identifies interfaces with a simple namespaced string,
- something like <code class="literal">org.freedesktop.Introspectable</code>.
- Most bindings will map these interface names directly to
- the appropriate programming language construct, for example
- to Java interfaces or C++ pure virtual classes.
- </p></div><div class="sect2" title="Proxies"><div class="titlepage"><div><div><h3 class="title"><a name="proxies"></a>Proxies</h3></div></div></div><p>
- A <em class="firstterm">proxy object</em> is a convenient native object created to
- represent a remote object in another process. The low-level DBus API involves manually creating
- a method call message, sending it, then manually receiving and processing
- the method reply message. Higher-level bindings provide proxies as an alternative.
- Proxies look like a normal native object; but when you invoke a method on the proxy
- object, the binding converts it into a DBus method call message, waits for the reply
- message, unpacks the return value, and returns it from the native method..
- </p><p>
- In pseudocode, programming without proxies might look like this:
- </p><pre class="programlisting">
- Message message = new Message("/remote/object/path", "MethodName", arg1, arg2);
- Connection connection = getBusConnection();
- connection.send(message);
- Message reply = connection.waitForReply(message);
- if (reply.isError()) {
-
- } else {
- Object returnValue = reply.getReturnValue();
- }
- </pre><p>
- </p><p>
- Programming with proxies might look like this:
- </p><pre class="programlisting">
- Proxy proxy = new Proxy(getBusConnection(), "/remote/object/path");
- Object returnValue = proxy.MethodName(arg1, arg2);
- </pre><p>
- </p></div><div class="sect2" title="Bus Names"><div class="titlepage"><div><div><h3 class="title"><a name="bus-names"></a>Bus Names</h3></div></div></div><p>
- When each application connects to the bus daemon, the daemon immediately
- assigns it a name, called the <em class="firstterm">unique connection name</em>.
- A unique name begins with a ':' (colon) character. These names are never
- reused during the lifetime of the bus daemon - that is, you know
- a given name will always refer to the same application.
- An example of a unique name might be
- <code class="literal">:34-907</code>. The numbers after the colon have
- no meaning other than their uniqueness.
- </p><p>
- When a name is mapped
- to a particular application's connection, that application is said to
- <em class="firstterm">own</em> that name.
- </p><p>
- Applications may ask to own additional <em class="firstterm">well-known
- names</em>. For example, you could write a specification to
- define a name called <code class="literal">com.mycompany.TextEditor</code>.
- Your definition could specify that to own this name, an application
- should have an object at the path
- <code class="literal">/com/mycompany/TextFileManager</code> supporting the
- interface <code class="literal">org.freedesktop.FileHandler</code>.
- </p><p>
- Applications could then send messages to this bus name,
- object, and interface to execute method calls.
- </p><p>
- You could think of the unique names as IP addresses, and the
- well-known names as domain names. So
- <code class="literal">com.mycompany.TextEditor</code> might map to something like
- <code class="literal">:34-907</code> just as <code class="literal">mycompany.com</code> maps
- to something like <code class="literal">192.168.0.5</code>.
- </p><p>
- Names have a second important use, other than routing messages. They
- are used to track lifecycle. When an application exits (or crashes), its
- connection to the message bus will be closed by the operating system
- kernel. The message bus then sends out notification messages telling
- remaining applications that the application's names have lost their
- owner. By tracking these notifications, your application can reliably
- monitor the lifetime of other applications.
- </p><p>
- Bus names can also be used to coordinate single-instance applications.
- If you want to be sure only one
- <code class="literal">com.mycompany.TextEditor</code> application is running for
- example, have the text editor application exit if the bus name already
- has an owner.
- </p></div><div class="sect2" title="Addresses"><div class="titlepage"><div><div><h3 class="title"><a name="addresses"></a>Addresses</h3></div></div></div><p>
- Applications using D-Bus are either servers or clients. A server
- listens for incoming connections; a client connects to a server. Once
- the connection is established, it is a symmetric flow of messages; the
- client-server distinction only matters when setting up the
- connection.
- </p><p>
- If you're using the bus daemon, as you probably are, your application
- will be a client of the bus daemon. That is, the bus daemon listens
- for connections and your application initiates a connection to the bus
- daemon.
- </p><p>
- A D-Bus <em class="firstterm">address</em> specifies where a server will
- listen, and where a client will connect. For example, the address
- <code class="literal">unix:path=/tmp/abcdef</code> specifies that the server will
- listen on a UNIX domain socket at the path
- <code class="literal">/tmp/abcdef</code> and the client will connect to that
- socket. An address can also specify TCP/IP sockets, or any other
- transport defined in future iterations of the D-Bus specification.
- </p><p>
- When using D-Bus with a message bus daemon,
- libdbus automatically discovers the address of the per-session bus
- daemon by reading an environment variable. It discovers the
- systemwide bus daemon by checking a well-known UNIX domain socket path
- (though you can override this address with an environment variable).
- </p><p>
- If you're using D-Bus without a bus daemon, it's up to you to
- define which application will be the server and which will be
- the client, and specify a mechanism for them to agree on
- the server's address. This is an unusual case.
- </p></div><div class="sect2" title="Big Conceptual Picture"><div class="titlepage"><div><div><h3 class="title"><a name="bigpicture"></a>Big Conceptual Picture</h3></div></div></div><p>
- Pulling all these concepts together, to specify a particular
- method call on a particular object instance, a number of
- nested components have to be named:
- </p><pre class="programlisting">
- Address -&gt; [Bus Name] -&gt; Path -&gt; Interface -&gt; Method
- </pre><p>
- The bus name is in brackets to indicate that it's optional -- you only
- provide a name to route the method call to the right application
- when using the bus daemon. If you have a direct connection to another
- application, bus names aren't used; there's no bus daemon.
- </p><p>
- The interface is also optional, primarily for historical
- reasons; DCOP does not require specifying the interface,
- instead simply forbidding duplicate method names
- on the same object instance. D-Bus will thus let you
- omit the interface, but if your method name is ambiguous
- it is undefined which method will be invoked.
- </p></div><div class="sect2" title="Messages - Behind the Scenes"><div class="titlepage"><div><div><h3 class="title"><a name="messages"></a>Messages - Behind the Scenes</h3></div></div></div><p>
- D-Bus works by sending messages between processes. If you're using
- a sufficiently high-level binding, you may never work with messages directly.
- </p><p>
- There are 4 message types:
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
- Method call messages ask to invoke a method
- on an object.
- </p></li><li class="listitem"><p>
- Method return messages return the results
- of invoking a method.
- </p></li><li class="listitem"><p>
- Error messages return an exception caused by
- invoking a method.
- </p></li><li class="listitem"><p>
- Signal messages are notifications that a given signal
- has been emitted (that an event has occurred).
- You could also think of these as "event" messages.
- </p></li></ul></div><p>
- </p><p>
- A method call maps very simply to messages: you send a method call
- message, and receive either a method return message or an error message
- in reply.
- </p><p>
- Each message has a <em class="firstterm">header</em>, including <em class="firstterm">fields</em>,
- and a <em class="firstterm">body</em>, including <em class="firstterm">arguments</em>. You can think
- of the header as the routing information for the message, and the body as the payload.
- Header fields might include the sender bus name, destination bus name, method or signal name,
- and so forth. One of the header fields is a <em class="firstterm">type signature</em> describing the
- values found in the body. For example, the letter "i" means "32-bit integer" so the signature
- "ii" means the payload has two 32-bit integers.
- </p></div><div class="sect2" title="Calling a Method - Behind the Scenes"><div class="titlepage"><div><div><h3 class="title"><a name="callprocedure"></a>Calling a Method - Behind the Scenes</h3></div></div></div><p>
- A method call in DBus consists of two messages; a method call message sent from process A to process B,
- and a matching method reply message sent from process B to process A. Both the call and the reply messages
- are routed through the bus daemon. The caller includes a different serial number in each call message, and the
- reply message includes this number to allow the caller to match replies to calls.
- </p><p>
- The call message will contain any arguments to the method.
- The reply message may indicate an error, or may contain data returned by the method.
- </p><p>
- A method invocation in DBus happens as follows:
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
- The language binding may provide a proxy, such that invoking a method on
- an in-process object invokes a method on a remote object in another process. If so, the
- application calls a method on the proxy, and the proxy
- constructs a method call message to send to the remote process.
- </p></li><li class="listitem"><p>
- For more low-level APIs, the application may construct a method call message itself, without
- using a proxy.
- </p></li><li class="listitem"><p>
- In either case, the method call message contains: a bus name belonging to the remote process; the name of the method;
- the arguments to the method; an object path inside the remote process; and optionally the name of the
- interface that specifies the method.
- </p></li><li class="listitem"><p>
- The method call message is sent to the bus daemon.
- </p></li><li class="listitem"><p>
- The bus daemon looks at the destination bus name. If a process owns that name,
- the bus daemon forwards the method call to that process. Otherwise, the bus daemon
- creates an error message and sends it back as the reply to the method call message.
- </p></li><li class="listitem"><p>
- The receiving process unpacks the method call message. In a simple low-level API situation, it
- may immediately run the method and send a method reply message to the bus daemon.
- When using a high-level binding API, the binding might examine the object path, interface,
- and method name, and convert the method call message into an invocation of a method on
- a native object (GObject, java.lang.Object, QObject, etc.), then convert the return
- value from the native method into a method reply message.
- </p></li><li class="listitem"><p>
- The bus daemon receives the method reply message and sends it to the process that
- made the method call.
- </p></li><li class="listitem"><p>
- The process that made the method call looks at the method reply and makes use of any
- return values included in the reply. The reply may also indicate that an error occurred.
- When using a binding, the method reply message may be converted into the return value of
- of a proxy method, or into an exception.
- </p></li></ul></div><p>
- </p><p>
- The bus daemon never reorders messages. That is, if you send two method call messages to the same recipient,
- they will be received in the order they were sent. The recipient is not required to reply to the calls
- in order, however; for example, it may process each method call in a separate thread, and return reply messages
- in an undefined order depending on when the threads complete. Method calls have a unique serial
- number used by the method caller to match reply messages to call messages.
- </p></div><div class="sect2" title="Emitting a Signal - Behind the Scenes"><div class="titlepage"><div><div><h3 class="title"><a name="signalprocedure"></a>Emitting a Signal - Behind the Scenes</h3></div></div></div><p>
- A signal in DBus consists of a single message, sent by one process to any number of other processes.
- That is, a signal is a unidirectional broadcast. The signal may contain arguments (a data payload), but
- because it is a broadcast, it never has a "return value." Contrast this with a method call
- (see <a class="xref" href="#callprocedure" title="Calling a Method - Behind the Scenes">the section called &#8220;Calling a Method - Behind the Scenes&#8221;</a>) where the method call message has a matching method reply message.
- </p><p>
- The emitter (aka sender) of a signal has no knowledge of the signal recipients. Recipients register
- with the bus daemon to receive signals based on "match rules" - these rules would typically include the sender and
- the signal name. The bus daemon sends each signal only to recipients who have expressed interest in that
- signal.
- </p><p>
- A signal in DBus happens as follows:
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
- A signal message is created and sent to the bus daemon. When using the low-level API this may be
- done manually, with certain bindings it may be done for you by the binding when a native object
- emits a native signal or event.
- </p></li><li class="listitem"><p>
- The signal message contains the name of the interface that specifies the signal;
- the name of the signal; the bus name of the process sending the signal; and
- any arguments
- </p></li><li class="listitem"><p>
- Any process on the message bus can register "match rules" indicating which signals it
- is interested in. The bus has a list of registered match rules.
- </p></li><li class="listitem"><p>
- The bus daemon examines the signal and determines which processes are interested in it.
- It sends the signal message to these processes.
- </p></li><li class="listitem"><p>
- Each process receiving the signal decides what to do with it; if using a binding,
- the binding may choose to emit a native signal on a proxy object. If using the
- low-level API, the process may just look at the signal sender and name and decide
- what to do based on that.
- </p></li></ul></div><p>
- </p></div><div class="sect2" title="Introspection"><div class="titlepage"><div><div><h3 class="title"><a name="introspection"></a>Introspection</h3></div></div></div><p>
- D-Bus objects may support the interface <code class="literal">org.freedesktop.DBus.Introspectable</code>.
- This interface has one method <code class="literal">Introspect</code> which takes no arguments and returns
- an XML string. The XML string describes the interfaces, methods, and signals of the object.
- See the D-Bus specification for more details on this introspection format.
- </p></div></div><div class="sect1" title="GLib API: Using Remote Objects"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="glib-client"></a>GLib API: Using Remote Objects</h2></div></div></div><p>
- The GLib binding is defined in the header file
- <code class="literal">&lt;dbus/dbus-glib.h&gt;</code>.
- </p><div class="sect2" title="D-Bus - GLib type mappings"><div class="titlepage"><div><div><h3 class="title"><a name="glib-typemappings"></a>D-Bus - GLib type mappings</h3></div></div></div><p>
- The heart of the GLib bindings for D-Bus is the mapping it
- provides between D-Bus "type signatures" and GLib types
- (<code class="literal">GType</code>). The D-Bus type system is composed of
- a number of "basic" types, along with several "container" types.
- </p><div class="sect3" title="Basic type mappings"><div class="titlepage"><div><div><h4 class="title"><a name="glib-basic-typemappings"></a>Basic type mappings</h4></div></div></div><p>
- Below is a list of the basic types, along with their associated
- mapping to a <code class="literal">GType</code>.
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col><col></colgroup><thead><tr><th>D-Bus basic type</th><th>GType</th><th>Free function</th><th>Notes</th></tr></thead><tbody><tr><td><code class="literal">BYTE</code></td><td><code class="literal">G_TYPE_UCHAR</code></td><td></td><td></td></tr><tr><td><code class="literal">BOOLEAN</code></td><td><code class="literal">G_TYPE_BOOLEAN</code></td><td></td><td></td></tr><tr><td><code class="literal">INT16</code></td><td><code class="literal">G_TYPE_INT</code></td><td></td><td>Will be changed to a <code class="literal">G_TYPE_INT16</code> once GLib has it</td></tr><tr><td><code class="literal">UINT16</code></td><td><code class="literal">G_TYPE_UINT</code></td><td></td><td>Will be changed to a <code class="literal">G_TYPE_UINT16</code> once GLib has it</td></tr><tr><td><code class="literal">INT32</code></td><td><code class="literal">G_TYPE_INT</code></td><td></td><td>Will be changed to a <code class="literal">G_TYPE_INT32</code> once GLib has it</td></tr><tr><td><code class="literal">UINT32</code></td><td><code class="literal">G_TYPE_UINT</code></td><td></td><td>Will be changed to a <code class="literal">G_TYPE_UINT32</code> once GLib has it</td></tr><tr><td><code class="literal">INT64</code></td><td><code class="literal">G_TYPE_GINT64</code></td><td></td><td></td></tr><tr><td><code class="literal">UINT64</code></td><td><code class="literal">G_TYPE_GUINT64</code></td><td></td><td></td></tr><tr><td><code class="literal">DOUBLE</code></td><td><code class="literal">G_TYPE_DOUBLE</code></td><td></td><td></td></tr><tr><td><code class="literal">STRING</code></td><td><code class="literal">G_TYPE_STRING</code></td><td><code class="literal">g_free</code></td><td></td></tr><tr><td><code class="literal">OBJECT_PATH</code></td><td><code class="literal">DBUS_TYPE_G_PROXY</code></td><td><code class="literal">g_object_unref</code></td><td>The returned proxy does not have an interface set; use <code class="literal">dbus_g_proxy_set_interface</code> to invoke methods</td></tr></tbody></table></div><p>
- As you can see, the basic mapping is fairly straightforward.
- </p></div><div class="sect3" title="Container type mappings"><div class="titlepage"><div><div><h4 class="title"><a name="glib-container-typemappings"></a>Container type mappings</h4></div></div></div><p>
- The D-Bus type system also has a number of "container"
- types, such as <code class="literal">DBUS_TYPE_ARRAY</code> and
- <code class="literal">DBUS_TYPE_STRUCT</code>. The D-Bus type system
- is fully recursive, so one can for example have an array of
- array of strings (i.e. type signature
- <code class="literal">aas</code>).
- </p><p>
- However, not all of these types are in common use; for
- example, at the time of this writing the author knows of no
- one using <code class="literal">DBUS_TYPE_STRUCT</code>, or a
- <code class="literal">DBUS_TYPE_ARRAY</code> containing any non-basic
- type. The approach the GLib bindings take is pragmatic; try
- to map the most common types in the most obvious way, and
- let using less common and more complex types be less
- "natural".
- </p><p>
- First, D-Bus type signatures which have an "obvious"
- corresponding built-in GLib type are mapped using that type:
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col><col><col><col></colgroup><thead><tr><th>D-Bus type signature</th><th>Description</th><th>GType</th><th>C typedef</th><th>Free function</th><th>Notes</th></tr></thead><tbody><tr><td><code class="literal">as</code></td><td>Array of strings</td><td><code class="literal">G_TYPE_STRV</code></td><td><code class="literal">char **</code></td><td><code class="literal">g_strfreev</code></td><td></td></tr><tr><td><code class="literal">v</code></td><td>Generic value container</td><td><code class="literal">G_TYPE_VALUE</code></td><td><code class="literal">GValue *</code></td><td><code class="literal">g_value_unset</code></td><td>The calling conventions for values expect that method callers have allocated return values; see below.</td></tr></tbody></table></div><p>
- </p><p>
- The next most common recursive type signatures are arrays of
- basic values. The most obvious mapping for arrays of basic
- types is a <code class="literal">GArray</code>. Now, GLib does not
- provide a builtin <code class="literal">GType</code> for
- <code class="literal">GArray</code>. However, we actually need more than
- that - we need a "parameterized" type which includes the
- contained type. Why we need this we will see below.
- </p><p>
- The approach taken is to create these types in the D-Bus GLib
- bindings; however, there is nothing D-Bus specific about them.
- In the future, we hope to include such "fundamental" types in GLib
- itself.
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col><col><col><col></colgroup><thead><tr><th>D-Bus type signature</th><th>Description</th><th>GType</th><th>C typedef</th><th>Free function</th><th>Notes</th></tr></thead><tbody><tr><td><code class="literal">ay</code></td><td>Array of bytes</td><td><code class="literal">DBUS_TYPE_G_BYTE_ARRAY</code></td><td><code class="literal">GArray *</code></td><td>g_array_free</td><td></td></tr><tr><td><code class="literal">au</code></td><td>Array of uint</td><td><code class="literal">DBUS_TYPE_G_UINT_ARRAY</code></td><td><code class="literal">GArray *</code></td><td>g_array_free</td><td></td></tr><tr><td><code class="literal">ai</code></td><td>Array of int</td><td><code class="literal">DBUS_TYPE_G_INT_ARRAY</code></td><td><code class="literal">GArray *</code></td><td>g_array_free</td><td></td></tr><tr><td><code class="literal">ax</code></td><td>Array of int64</td><td><code class="literal">DBUS_TYPE_G_INT64_ARRAY</code></td><td><code class="literal">GArray *</code></td><td>g_array_free</td><td></td></tr><tr><td><code class="literal">at</code></td><td>Array of uint64</td><td><code class="literal">DBUS_TYPE_G_UINT64_ARRAY</code></td><td><code class="literal">GArray *</code></td><td>g_array_free</td><td></td></tr><tr><td><code class="literal">ad</code></td><td>Array of double</td><td><code class="literal">DBUS_TYPE_G_DOUBLE_ARRAY</code></td><td><code class="literal">GArray *</code></td><td>g_array_free</td><td></td></tr><tr><td><code class="literal">ab</code></td><td>Array of boolean</td><td><code class="literal">DBUS_TYPE_G_BOOLEAN_ARRAY</code></td><td><code class="literal">GArray *</code></td><td>g_array_free</td><td></td></tr></tbody></table></div><p>
- </p><p>
- D-Bus also includes a special type DBUS_TYPE_DICT_ENTRY which
- is only valid in arrays. It's intended to be mapped to a "dictionary"
- type by bindings. The obvious GLib mapping here is GHashTable. Again,
- however, there is no builtin <code class="literal">GType</code> for a GHashTable.
- Moreover, just like for arrays, we need a parameterized type so that
- the bindings can communiate which types are contained in the hash table.
- </p><p>
- At present, only strings are supported. Work is in progress to
- include more types.
- </p><div class="informaltable"><table border="1"><colgroup><col><col><col><col><col><col></colgroup><thead><tr><th>D-Bus type signature</th><th>Description</th><th>GType</th><th>C typedef</th><th>Free function</th><th>Notes</th></tr></thead><tbody><tr><td><code class="literal">a{ss}</code></td><td>Dictionary mapping strings to strings</td><td><code class="literal">DBUS_TYPE_G_STRING_STRING_HASHTABLE</code></td><td><code class="literal">GHashTable *</code></td><td>g_hash_table_destroy</td><td></td></tr></tbody></table></div><p>
- </p></div><div class="sect3" title="Arbitrarily recursive type mappings"><div class="titlepage"><div><div><h4 class="title"><a name="glib-generic-typemappings"></a>Arbitrarily recursive type mappings</h4></div></div></div><p>
- Finally, it is possible users will want to write or invoke D-Bus
- methods which have arbitrarily complex type signatures not
- directly supported by these bindings. For this case, we have a
- <code class="literal">DBusGValue</code> which acts as a kind of special
- variant value which may be iterated over manually. The
- <code class="literal">GType</code> associated is
- <code class="literal">DBUS_TYPE_G_VALUE</code>.
- </p><p>
- TODO insert usage of <code class="literal">DBUS_TYPE_G_VALUE</code> here.
- </p></div></div><div class="sect2" title="A sample program"><div class="titlepage"><div><div><h3 class="title"><a name="sample-program-1"></a>A sample program</h3></div></div></div><p>Here is a D-Bus program using the GLib bindings.
-</p><pre class="programlisting">
-int
-main (int argc, char **argv)
-{
- DBusGConnection *connection;
- GError *error;
- DBusGProxy *proxy;
- char **name_list;
- char **name_list_ptr;
-
- g_type_init ();
-
- error = NULL;
- connection = dbus_g_bus_get (DBUS_BUS_SESSION,
- &amp;error);
- if (connection == NULL)
- {
- g_printerr ("Failed to open connection to bus: %s\n",
- error-&gt;message);
- g_error_free (error);
- exit (1);
- }
-
- /* Create a proxy object for the "bus driver" (name "org.freedesktop.DBus") */
-
- proxy = dbus_g_proxy_new_for_name (connection,
- DBUS_SERVICE_DBUS,
- DBUS_PATH_DBUS,
- DBUS_INTERFACE_DBUS);
-
- /* Call ListNames method, wait for reply */
- error = NULL;
- if (!dbus_g_proxy_call (proxy, "ListNames", &amp;error, G_TYPE_INVALID,
- G_TYPE_STRV, &amp;name_list, G_TYPE_INVALID))
- {
- /* Just do demonstrate remote exceptions versus regular GError */
- if (error-&gt;domain == DBUS_GERROR &amp;&amp; error-&gt;code == DBUS_GERROR_REMOTE_EXCEPTION)
- g_printerr ("Caught remote method exception %s: %s",
- dbus_g_error_get_name (error),
- error-&gt;message);
- else
- g_printerr ("Error: %s\n", error-&gt;message);
- g_error_free (error);
- exit (1);
- }
-
- /* Print the results */
-
- g_print ("Names on the message bus:\n");
-
- for (name_list_ptr = name_list; *name_list_ptr; name_list_ptr++)
- {
- g_print (" %s\n", *name_list_ptr);
- }
- g_strfreev (name_list);
-
- g_object_unref (proxy);
-
- return 0;
-}
-</pre><p>
- </p></div><div class="sect2" title="Program initalization"><div class="titlepage"><div><div><h3 class="title"><a name="glib-program-setup"></a>Program initalization</h3></div></div></div><p>
- A connection to the bus is acquired using
- <code class="literal">dbus_g_bus_get</code>. Next, a proxy
- is created for the object "/org/freedesktop/DBus" with
- interface <code class="literal">org.freedesktop.DBus</code>
- on the service <code class="literal">org.freedesktop.DBus</code>.
- This is a proxy for the message bus itself.
- </p></div><div class="sect2" title="Understanding method invocation"><div class="titlepage"><div><div><h3 class="title"><a name="glib-method-invocation"></a>Understanding method invocation</h3></div></div></div><p>
- You have a number of choices for method invocation. First, as
- used above, <code class="literal">dbus_g_proxy_call</code> sends a
- method call to the remote object, and blocks until a reply is
- recieved. The outgoing arguments are specified in the varargs
- array, terminated with <code class="literal">G_TYPE_INVALID</code>.
- Next, pointers to return values are specified, followed again
- by <code class="literal">G_TYPE_INVALID</code>.
- </p><p>
- To invoke a method asynchronously, use
- <code class="literal">dbus_g_proxy_begin_call</code>. This returns a
- <code class="literal">DBusGPendingCall</code> object; you may then set a
- notification function using
- <code class="literal">dbus_g_pending_call_set_notify</code>.
- </p></div><div class="sect2" title="Connecting to object signals"><div class="titlepage"><div><div><h3 class="title"><a name="glib-signal-connection"></a>Connecting to object signals</h3></div></div></div><p>
- You may connect to signals using
- <code class="literal">dbus_g_proxy_add_signal</code> and
- <code class="literal">dbus_g_proxy_connect_signal</code>. You must
- invoke <code class="literal">dbus_g_proxy_add_signal</code> to specify
- the signature of your signal handlers; you may then invoke
- <code class="literal">dbus_g_proxy_connect_signal</code> multiple times.
- </p><p>
- Note that it will often be the case that there is no builtin
- marshaller for the type signature of a remote signal. In that
- case, you must generate a marshaller yourself by using
- <span class="application">glib-genmarshal</span>, and then register
- it using <code class="literal">dbus_g_object_register_marshaller</code>.
- </p></div><div class="sect2" title="Error handling and remote exceptions"><div class="titlepage"><div><div><h3 class="title"><a name="glib-error-handling"></a>Error handling and remote exceptions</h3></div></div></div><p>
- All of the GLib binding methods such as
- <code class="literal">dbus_g_proxy_end_call</code> return a
- <code class="literal">GError</code>. This <code class="literal">GError</code> can
- represent two different things:
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
- An internal D-Bus error, such as an out-of-memory
- condition, an I/O error, or a network timeout. Errors
- generated by the D-Bus library itself have the domain
- <code class="literal">DBUS_GERROR</code>, and a corresponding code
- such as <code class="literal">DBUS_GERROR_NO_MEMORY</code>. It will
- not be typical for applications to handle these errors
- specifically.
- </p></li><li class="listitem"><p>
- A remote D-Bus exception, thrown by the peer, bus, or
- service. D-Bus remote exceptions have both a textual
- "name" and a "message". The GLib bindings store this
- information in the <code class="literal">GError</code>, but some
- special rules apply.
- </p><p>
- The set error will have the domain
- <code class="literal">DBUS_GERROR</code> as above, and will also
- have the code
- <code class="literal">DBUS_GERROR_REMOTE_EXCEPTION</code>. In order
- to access the remote exception name, you must use a
- special accessor, such as
- <code class="literal">dbus_g_error_has_name</code> or
- <code class="literal">dbus_g_error_get_name</code>. The remote
- exception detailed message is accessible via the regular
- GError <code class="literal">message</code> member.
- </p></li></ul></div><p>
- </p></div><div class="sect2" title="More examples of method invocation"><div class="titlepage"><div><div><h3 class="title"><a name="glib-more-examples"></a>More examples of method invocation</h3></div></div></div><div class="sect3" title="Sending an integer and string, receiving an array of bytes"><div class="titlepage"><div><div><h4 class="title"><a name="glib-sending-stuff"></a>Sending an integer and string, receiving an array of bytes</h4></div></div></div><p>
-</p><pre class="programlisting">
- GArray *arr;
-
- error = NULL;
- if (!dbus_g_proxy_call (proxy, "Foobar", &amp;error,
- G_TYPE_INT, 42, G_TYPE_STRING, "hello",
- G_TYPE_INVALID,
- DBUS_TYPE_G_UCHAR_ARRAY, &amp;arr, G_TYPE_INVALID))
- {
- /* Handle error */
- }
- g_assert (arr != NULL);
- printf ("got back %u values", arr-&gt;len);
-</pre><p>
- </p></div><div class="sect3" title="Sending a GHashTable"><div class="titlepage"><div><div><h4 class="title"><a name="glib-sending-hash"></a>Sending a GHashTable</h4></div></div></div><p>
-</p><pre class="programlisting">
- GHashTable *hash = g_hash_table_new (g_str_hash, g_str_equal);
- guint32 ret;
-
- g_hash_table_insert (hash, "foo", "bar");
- g_hash_table_insert (hash, "baz", "whee");
-
- error = NULL;
- if (!dbus_g_proxy_call (proxy, "HashSize", &amp;error,
- DBUS_TYPE_G_STRING_STRING_HASH, hash, G_TYPE_INVALID,
- G_TYPE_UINT, &amp;ret, G_TYPE_INVALID))
- {
- /* Handle error */
- }
- g_assert (ret == 2);
- g_hash_table_destroy (hash);
-</pre><p>
- </p></div><div class="sect3" title="Receiving a boolean and a string"><div class="titlepage"><div><div><h4 class="title"><a name="glib-receiving-bool-int"></a>Receiving a boolean and a string</h4></div></div></div><p>
-</p><pre class="programlisting">
- gboolean boolret;
- char *strret;
-
- error = NULL;
- if (!dbus_g_proxy_call (proxy, "GetStuff", &amp;error,
- G_TYPE_INVALID,
- G_TYPE_BOOLEAN, &amp;boolret,
- G_TYPE_STRING, &amp;strret,
- G_TYPE_INVALID))
- {
- /* Handle error */
- }
- printf ("%s %s", boolret ? "TRUE" : "FALSE", strret);
- g_free (strret);
-</pre><p>
- </p></div><div class="sect3" title="Sending two arrays of strings"><div class="titlepage"><div><div><h4 class="title"><a name="glib-sending-str-arrays"></a>Sending two arrays of strings</h4></div></div></div><p>
-</p><pre class="programlisting">
- /* NULL terminate */
- char *strs_static[] = {"foo", "bar", "baz", NULL};
- /* Take pointer to array; cannot pass array directly */
- char **strs_static_p = strs_static;
- char **strs_dynamic;
-
- strs_dynamic = g_new (char *, 4);
- strs_dynamic[0] = g_strdup ("hello");
- strs_dynamic[1] = g_strdup ("world");
- strs_dynamic[2] = g_strdup ("!");
- /* NULL terminate */
- strs_dynamic[3] = NULL;
-
- error = NULL;
- if (!dbus_g_proxy_call (proxy, "TwoStrArrays", &amp;error,
- G_TYPE_STRV, strs_static_p,
- G_TYPE_STRV, strs_dynamic,
- G_TYPE_INVALID,
- G_TYPE_INVALID))
- {
- /* Handle error */
- }
- g_strfreev (strs_dynamic);
-</pre><p>
- </p></div><div class="sect3" title="Sending a boolean, receiving an array of strings"><div class="titlepage"><div><div><h4 class="title"><a name="glib-getting-str-array"></a>Sending a boolean, receiving an array of strings</h4></div></div></div><p>
-</p><pre class="programlisting">
- char **strs;
- char **strs_p;
- gboolean blah;
-
- error = NULL;
- blah = TRUE;
- if (!dbus_g_proxy_call (proxy, "GetStrs", &amp;error,
- G_TYPE_BOOLEAN, blah,
- G_TYPE_INVALID,
- G_TYPE_STRV, &amp;strs,
- G_TYPE_INVALID))
- {
- /* Handle error */
- }
- for (strs_p = strs; *strs_p; strs_p++)
- printf ("got string: \"%s\"", *strs_p);
- g_strfreev (strs);
-</pre><p>
- </p></div><div class="sect3" title="Sending a variant"><div class="titlepage"><div><div><h4 class="title"><a name="glib-sending-variant"></a>Sending a variant</h4></div></div></div><p>
-</p><pre class="programlisting">
- GValue val = {0, };
-
- g_value_init (&amp;val, G_TYPE_STRING);
- g_value_set_string (&amp;val, "hello world");
-
- error = NULL;
- if (!dbus_g_proxy_call (proxy, "SendVariant", &amp;error,
- G_TYPE_VALUE, &amp;val, G_TYPE_INVALID,
- G_TYPE_INVALID))
- {
- /* Handle error */
- }
- g_assert (ret == 2);
- g_value_unset (&amp;val);
-</pre><p>
- </p></div><div class="sect3" title="Receiving a variant"><div class="titlepage"><div><div><h4 class="title"><a name="glib-receiving-variant"></a>Receiving a variant</h4></div></div></div><p>
-</p><pre class="programlisting">
- GValue val = {0, };
-
- error = NULL;
- if (!dbus_g_proxy_call (proxy, "GetVariant", &amp;error, G_TYPE_INVALID,
- G_TYPE_VALUE, &amp;val, G_TYPE_INVALID))
- {
- /* Handle error */
- }
- if (G_VALUE_TYPE (&amp;val) == G_TYPE_STRING)
- printf ("%s\n", g_value_get_string (&amp;val));
- else if (G_VALUE_TYPE (&amp;val) == G_TYPE_INT)
- printf ("%d\n", g_value_get_int (&amp;val));
- else
- ...
- g_value_unset (&amp;val);
-</pre><p>
- </p></div></div><div class="sect2" title="Generated Bindings"><div class="titlepage"><div><div><h3 class="title"><a name="glib-generated-bindings"></a>Generated Bindings</h3></div></div></div><p>
- By using the Introspection XML files, convenient client-side bindings
- can be automatically created to ease the use of a remote DBus object.
- </p><p>
- Here is a sample XML file which describes an object that exposes
- one method, named <code class="literal">ManyArgs</code>.
- </p><pre class="programlisting">
-&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
-&lt;node name="/com/example/MyObject"&gt;
- &lt;interface name="com.example.MyObject"&gt;
- &lt;method name="ManyArgs"&gt;
- &lt;arg type="u" name="x" direction="in" /&gt;
- &lt;arg type="s" name="str" direction="in" /&gt;
- &lt;arg type="d" name="trouble" direction="in" /&gt;
- &lt;arg type="d" name="d_ret" direction="out" /&gt;
- &lt;arg type="s" name="str_ret" direction="out" /&gt;
- &lt;/method&gt;
- &lt;/interface&gt;
-&lt;/node&gt;
-</pre><p>
- </p><p>
- Run <code class="literal">dbus-binding-tool --mode=glib-client
- <em class="replaceable"><code>FILENAME</code></em> &gt;
- <em class="replaceable"><code>HEADER_NAME</code></em></code> to generate the header
- file. For example: <span class="command"><strong>dbus-binding-tool --mode=glib-client
- my-object.xml &gt; my-object-bindings.h</strong></span>. This will generate
- inline functions with the following prototypes:
- </p><pre class="programlisting">
-/* This is a blocking call */
-gboolean
-com_example_MyObject_many_args (DBusGProxy *proxy, const guint IN_x,
- const char * IN_str, const gdouble IN_trouble,
- gdouble* OUT_d_ret, char ** OUT_str_ret,
- GError **error);
-
-/* This is a non-blocking call */
-DBusGProxyCall*
-com_example_MyObject_many_args_async (DBusGProxy *proxy, const guint IN_x,
- const char * IN_str, const gdouble IN_trouble,
- com_example_MyObject_many_args_reply callback,
- gpointer userdata);
-
-/* This is the typedef for the non-blocking callback */
-typedef void
-(*com_example_MyObject_many_args_reply)
-(DBusGProxy *proxy, gdouble OUT_d_ret, char * OUT_str_ret,
- GError *error, gpointer userdata);
-</pre><p>
- The first argument in all functions is a <code class="literal">DBusGProxy
- *</code>, which you should create with the usual
- <code class="literal">dbus_g_proxy_new_*</code> functions. Following that are the
- "in" arguments, and then either the "out" arguments and a
- <code class="literal">GError *</code> for the synchronous (blocking) function, or
- callback and user data arguments for the asynchronous (non-blocking)
- function. The callback in the asynchronous function passes the
- <code class="literal">DBusGProxy *</code>, the returned "out" arguments, an
- <code class="literal">GError *</code> which is set if there was an error otherwise
- <code class="literal">NULL</code>, and the user data.
- </p><p>
- As with the server-side bindings support (see <a class="xref" href="#glib-server" title="GLib API: Implementing Objects">the section called &#8220;GLib API: Implementing Objects&#8221;</a>), the exact behaviour of the client-side
- bindings can be manipulated using "annotations". Currently the only
- annotation used by the client bindings is
- <code class="literal">org.freedesktop.DBus.GLib.NoReply</code>, which sets the
- flag indicating that the client isn't expecting a reply to the method
- call, so a reply shouldn't be sent. This is often used to speed up
- rapid method calls where there are no "out" arguments, and not knowing
- if the method succeeded is an acceptable compromise to half the traffic
- on the bus.
- </p></div></div><div class="sect1" title="GLib API: Implementing Objects"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="glib-server"></a>GLib API: Implementing Objects</h2></div></div></div><p>
- At the moment, to expose a GObject via D-Bus, you must
- write XML by hand which describes the methods exported
- by the object. In the future, this manual step will
- be obviated by the upcoming GLib introspection support.
- </p><p>
- Here is a sample XML file which describes an object that exposes
- one method, named <code class="literal">ManyArgs</code>.
-</p><pre class="programlisting">
-&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
-
-&lt;node name="/com/example/MyObject"&gt;
-
- &lt;interface name="com.example.MyObject"&gt;
- &lt;annotation name="org.freedesktop.DBus.GLib.CSymbol" value="my_object"/&gt;
- &lt;method name="ManyArgs"&gt;
- &lt;!-- This is optional, and in this case is redunundant --&gt;
- &lt;annotation name="org.freedesktop.DBus.GLib.CSymbol" value="my_object_many_args"/&gt;
- &lt;arg type="u" name="x" direction="in" /&gt;
- &lt;arg type="s" name="str" direction="in" /&gt;
- &lt;arg type="d" name="trouble" direction="in" /&gt;
- &lt;arg type="d" name="d_ret" direction="out" /&gt;
- &lt;arg type="s" name="str_ret" direction="out" /&gt;
- &lt;/method&gt;
- &lt;/interface&gt;
-&lt;/node&gt;
-</pre><p>
- </p><p>
- This XML is in the same format as the D-Bus introspection XML
- format. Except we must include an "annotation" which give the C
- symbols corresponding to the object implementation prefix
- (<code class="literal">my_object</code>). In addition, if particular
- methods symbol names deviate from C convention
- (i.e. <code class="literal">ManyArgs</code> -&gt;
- <code class="literal">many_args</code>), you may specify an annotation
- giving the C symbol.
- </p><p>
- Once you have written this XML, run <code class="literal">dbus-binding-tool --mode=glib-server <em class="replaceable"><code>FILENAME</code></em> &gt; <em class="replaceable"><code>HEADER_NAME</code></em>.</code> to
- generate a header file. For example: <span class="command"><strong>dbus-binding-tool --mode=glib-server my-object.xml &gt; my-object-glue.h</strong></span>.
- </p><p>
- Next, include the generated header in your program, and invoke
- <code class="literal">dbus_g_object_class_install_info</code> in the class
- initializer, passing the object class and "object info" included in the
- header. For example:
- </p><pre class="programlisting">
- dbus_g_object_type_install_info (COM_FOO_TYPE_MY_OBJECT, &amp;com_foo_my_object_info);
- </pre><p>
- This should be done exactly once per object class.
- </p><p>
- To actually implement the method, just define a C function named e.g.
- <code class="literal">my_object_many_args</code> in the same file as the info
- header is included. At the moment, it is required that this function
- conform to the following rules:
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
- The function must return a value of type <code class="literal">gboolean</code>;
- <code class="literal">TRUE</code> on success, and <code class="literal">FALSE</code>
- otherwise.
- </p></li><li class="listitem"><p>
- The first parameter is a pointer to an instance of the object.
- </p></li><li class="listitem"><p>
- Following the object instance pointer are the method
- input values.
- </p></li><li class="listitem"><p>
- Following the input values are pointers to return values.
- </p></li><li class="listitem"><p>
- The final parameter must be a <code class="literal">GError **</code>.
- If the function returns <code class="literal">FALSE</code> for an
- error, the error parameter must be initalized with
- <code class="literal">g_set_error</code>.
- </p></li></ul></div><p>
- </p><p>
- Finally, you can export an object using <code class="literal">dbus_g_connection_register_g_object</code>. For example:
- </p><pre class="programlisting">
- dbus_g_connection_register_g_object (connection,
- "/com/foo/MyObject",
- obj);
- </pre><p>
- </p><div class="sect2" title="Server-side Annotations"><div class="titlepage"><div><div><h3 class="title"><a name="glib-annotations"></a>Server-side Annotations</h3></div></div></div><p>
- There are several annotations that are used when generating the
- server-side bindings. The most common annotation is
- <code class="literal">org.freedesktop.DBus.GLib.CSymbol</code> but there are other
- annotations which are often useful.
- </p><div class="variablelist"><dl><dt><span class="term"><code class="literal">org.freedesktop.DBus.GLib.CSymbol</code></span></dt><dd><p>
- This annotation is used to specify the C symbol names for
- the various types (interface, method, etc), if it differs from the
- name DBus generates.
- </p></dd><dt><span class="term"><code class="literal">org.freedesktop.DBus.GLib.Async</code></span></dt><dd><p>
- This annotation marks the method implementation as an
- asynchronous function, which doesn't return a response straight
- away but will send the response at some later point to complete
- the call. This is used to implement non-blocking services where
- method calls can take time.
- </p><p>
- When a method is asynchronous, the function prototype is
- different. It is required that the function conform to the
- following rules:
- </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
- The function must return a value of type <code class="literal">gboolean</code>;
- <code class="literal">TRUE</code> on success, and <code class="literal">FALSE</code>
- otherwise. TODO: the return value is currently ignored.
- </p></li><li class="listitem"><p>
- The first parameter is a pointer to an instance of the object.
- </p></li><li class="listitem"><p>
- Following the object instance pointer are the method
- input values.
- </p></li><li class="listitem"><p>
- The final parameter must be a
- <code class="literal">DBusGMethodInvocation *</code>. This is used
- when sending the response message back to the client, by
- calling <code class="literal">dbus_g_method_return</code> or
- <code class="literal">dbus_g_method_return_error</code>.
- </p></li></ul></div><p>
- </p></dd><dt><span class="term"><code class="literal">org.freedesktop.DBus.GLib.Const</code></span></dt><dd><p>This attribute can only be applied to "out"
- <code class="literal">&lt;arg&gt;</code> nodes, and specifies that the
- parameter isn't being copied when returned. For example, this
- turns a 's' argument from a <code class="literal">char **</code> to a
- <code class="literal">const char **</code>, and results in the argument not
- being freed by DBus after the message is sent.
- </p></dd><dt><span class="term"><code class="literal">org.freedesktop.DBus.GLib.ReturnVal</code></span></dt><dd><p>
- This attribute can only be applied to "out"
- <code class="literal">&lt;arg&gt;</code> nodes, and alters the expected
- function signature. It currently can be set to two values:
- <code class="literal">""</code> or <code class="literal">"error"</code>. The
- argument marked with this attribute is not returned via a
- pointer argument, but by the function's return value. If the
- attribute's value is the empty string, the <code class="literal">GError
- *</code> argument is also omitted so there is no standard way
- to return an error value. This is very useful for interfacing
- with existing code, as it is possible to match existing APIs.
- If the attribute's value is <code class="literal">"error"</code>, then the
- final argument is a <code class="literal">GError *</code> as usual.
- </p><p>
- Some examples to demonstrate the usage. This introspection XML:
- </p><pre class="programlisting">
-&lt;method name="Increment"&gt;
- &lt;arg type="u" name="x" /&gt;
- &lt;arg type="u" direction="out" /&gt;
-&lt;/method&gt;
- </pre><p>
- Expects the following function declaration:
- </p><pre class="programlisting">
-gboolean
-my_object_increment (MyObject *obj, gint32 x, gint32 *ret, GError **error);
- </pre><p>
- </p><p>
- This introspection XML:
- </p><pre class="programlisting">
-&lt;method name="IncrementRetval"&gt;
- &lt;arg type="u" name="x" /&gt;
- &lt;arg type="u" direction="out" &gt;
- &lt;annotation name="org.freedesktop.DBus.GLib.ReturnVal" value=""/&gt;
- &lt;/arg&gt;
-&lt;/method&gt;
- </pre><p>
- Expects the following function declaration:
- </p><pre class="programlisting">
-gint32
-my_object_increment_retval (MyObject *obj, gint32 x)
- </pre><p>
- </p><p>
- This introspection XML:
- </p><pre class="programlisting">
-&lt;method name="IncrementRetvalError"&gt;
- &lt;arg type="u" name="x" /&gt;
- &lt;arg type="u" direction="out" &gt;
- &lt;annotation name="org.freedesktop.DBus.GLib.ReturnVal" value="error"/&gt;
- &lt;/arg&gt;
-&lt;/method&gt;
- </pre><p>
- Expects the following function declaration:
- </p><pre class="programlisting">
-gint32
-my_object_increment_retval_error (MyObject *obj, gint32 x, GError **error)
- </pre><p>
- </p></dd></dl></div><p>
- </p></div></div><div class="sect1" title="Python API"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="python-client"></a>Python API</h2></div></div></div><p>
- The Python API, dbus-python, is now documented separately in
- <a class="ulink" href="http://dbus.freedesktop.org/doc/dbus-python/doc/tutorial.html" target="_top">the dbus-python tutorial</a> (also available in doc/tutorial.txt,
- and doc/tutorial.html if built with python-docutils, in the dbus-python
- source distribution).
- </p></div><div class="sect1" title="Qt API: Using Remote Objects"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="qt-client"></a>Qt API: Using Remote Objects</h2></div></div></div><p>
-
- The Qt bindings are not yet documented.
-
- </p></div><div class="sect1" title="Qt API: Implementing Objects"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="qt-server"></a>Qt API: Implementing Objects</h2></div></div></div><p>
- The Qt bindings are not yet documented.
- </p></div></div></body></html>
diff --git a/doc/dbus-tutorial.xml b/doc/dbus-tutorial.xml
index 5c385f0e..c7580d15 100644
--- a/doc/dbus-tutorial.xml
+++ b/doc/dbus-tutorial.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" standalone="no"?>
-<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
-"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
[
]>
diff --git a/doc/dbus-uuidgen.1 b/doc/dbus-uuidgen.1
deleted file mode 100644
index 8ed8dd20..00000000
--- a/doc/dbus-uuidgen.1
+++ /dev/null
@@ -1,89 +0,0 @@
-.\"
-.\" dbus\-uuidgen manual page.
-.\" Copyright (C) 2006 Red Hat, Inc.
-.\"
-.TH dbus\-uuidgen 1
-.SH NAME
-dbus\-uuidgen \- Utility to generate UUIDs
-.SH SYNOPSIS
-.PP
-.B dbus\-uuidgen [\-\-version] [\-\-ensure[=FILENAME]] [\-\-get[=FILENAME]]
-
-.SH DESCRIPTION
-
-The \fIdbus\-uuidgen\fP command generates or reads a universally unique ID.
-
-.PP
-Note that the D\-Bus UUID has no relationship to RFC 4122 and does not generate
-UUIDs compatible with that spec. Many systems have a separate command
-for that (often called "uuidgen").
-
-.PP
-See http://www.freedesktop.org/software/dbus/ for more information
-about D\-Bus.
-
-.PP
-The primary usage of \fIdbus\-uuidgen\fP is to run in the post\-install
-script of a D\-Bus package like this:
-.nf
- dbus\-uuidgen \-\-ensure
-.fi
-
-.PP
-This will ensure that /var/lib/dbus/machine\-id exists and has the uuid in it.
-It won't overwrite an existing uuid, since this id should remain fixed
-for a single machine until the next reboot at least.
-
-.PP
-The important properties of the machine UUID are that 1) it remains
-unchanged until the next reboot and 2) it is different for any two
-running instances of the OS kernel. That is, if two processes see the
-same UUID, they should also see the same shared memory, UNIX domain
-sockets, local X displays, localhost.localdomain resolution, process
-IDs, and so forth.
-
-.PP
-If you run \fIdbus\-uuidgen\fP with no options it just prints a new uuid made
-up out of thin air.
-
-.PP
-If you run it with \-\-get, it prints the machine UUID by default, or
-the UUID in the specified file if you specify a file.
-
-.PP
-If you try to change an existing machine\-id on a running system, it will
-probably result in bad things happening. Don't try to change this file. Also,
-don't make it the same on two different systems; it needs to be different
-anytime there are two different kernels running.
-
-.PP
-The UUID should be different on two different virtual machines,
-because there are two different kernels.
-
-.SH OPTIONS
-The following options are supported:
-.TP
-.I "\-\-get[=FILENAME]"
-If a filename is not given, defaults to localstatedir/lib/dbus/machine\-id
-(localstatedir is usually /var). If this file exists and is valid, the
-uuid in the file is printed on stdout. Otherwise, the command exits
-with a nonzero status.
-
-.TP
-.I "\-\-ensure[=FILENAME]"
-If a filename is not given, defaults to localstatedir/lib/dbus/machine\-id
-(localstatedir is usually /var). If this file exists then it will be
-validated, and a failure code returned if it contains the wrong thing.
-If the file does not exist, it will be created with a new uuid in it.
-On success, prints no output.
-
-.TP
-.I "\-\-version"
-Print the version of dbus\-uuidgen
-
-.SH AUTHOR
-See http://www.freedesktop.org/software/dbus/doc/AUTHORS
-
-.SH BUGS
-Please send bug reports to the D\-Bus mailing list or bug tracker,
-see http://www.freedesktop.org/software/dbus/
diff --git a/doc/dbus-uuidgen.1.xml.in b/doc/dbus-uuidgen.1.xml.in
new file mode 100644
index 00000000..fbd26812
--- /dev/null
+++ b/doc/dbus-uuidgen.1.xml.in
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+ "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<refentry id='dbusuuidgen1'>
+
+<!-- dbus&bsol;-uuidgen manual page.
+ Copyright (C) 2006 Red Hat, Inc. -->
+
+<refmeta>
+<refentrytitle>dbus-uuidgen</refentrytitle>
+<manvolnum>1</manvolnum>
+<refmiscinfo class="manual">User Commands</refmiscinfo>
+<refmiscinfo class="source">D-Bus</refmiscinfo>
+<refmiscinfo class="version">@DBUS_VERSION@</refmiscinfo>
+</refmeta>
+<refnamediv>
+<refname>dbus-uuidgen</refname>
+<refpurpose>Utility to generate UUIDs</refpurpose>
+</refnamediv>
+<!-- body begins here -->
+<refsynopsisdiv id='synopsis'>
+<cmdsynopsis>
+ <command>dbus-uuidgen</command> <arg choice='opt'>--version </arg>
+ <arg choice='opt'><arg choice='plain'>--ensure </arg><arg choice='opt'><replaceable>=FILENAME</replaceable></arg></arg>
+ <arg choice='opt'><arg choice='plain'>--get </arg><arg choice='opt'><replaceable>=FILENAME</replaceable></arg></arg>
+ <sbr/>
+</cmdsynopsis>
+</refsynopsisdiv>
+
+
+<refsect1 id='description'><title>DESCRIPTION</title>
+<para>The <command>dbus-uuidgen</command> command generates or reads a universally unique ID.</para>
+
+
+<para>Note that the D-Bus UUID has no relationship to RFC 4122 and does not generate
+UUIDs compatible with that spec. Many systems have a separate command
+for that (often called "uuidgen").</para>
+
+
+<para>See <ulink url='http://www.freedesktop.org/software/dbus/'>http://www.freedesktop.org/software/dbus/</ulink> for more information
+about D-Bus.</para>
+
+
+<para>The primary usage of <command>dbus-uuidgen</command> is to run in the post-install
+script of a D-Bus package like this:</para>
+<literallayout remap='.nf'>
+ dbus-uuidgen --ensure
+</literallayout> <!-- .fi -->
+
+
+<para>This will ensure that /var/lib/dbus/machine-id exists and has the uuid in it.
+It won't overwrite an existing uuid, since this id should remain fixed
+for a single machine until the next reboot at least.</para>
+
+
+<para>The important properties of the machine UUID are that 1) it remains
+unchanged until the next reboot and 2) it is different for any two
+running instances of the OS kernel. That is, if two processes see the
+same UUID, they should also see the same shared memory, UNIX domain
+sockets, local X displays, localhost.localdomain resolution, process
+IDs, and so forth.</para>
+
+
+<para>If you run <command>dbus-uuidgen</command> with no options it just prints a new uuid made
+up out of thin air.</para>
+
+
+<para>If you run it with --get, it prints the machine UUID by default, or
+the UUID in the specified file if you specify a file.</para>
+
+
+<para>If you try to change an existing machine-id on a running system, it will
+probably result in bad things happening. Don't try to change this file. Also,
+don't make it the same on two different systems; it needs to be different
+anytime there are two different kernels running.</para>
+
+
+<para>The UUID should be different on two different virtual machines,
+because there are two different kernels.</para>
+
+</refsect1>
+
+<refsect1 id='options'><title>OPTIONS</title>
+<para>The following options are supported:</para>
+<variablelist remap='TP'>
+ <varlistentry>
+ <term><option>--get[=FILENAME]</option></term>
+ <listitem>
+<para>If a filename is not given, defaults to localstatedir/lib/dbus/machine-id
+(localstatedir is usually /var). If this file exists and is valid, the
+uuid in the file is printed on stdout. Otherwise, the command exits
+with a nonzero status.</para>
+
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--ensure[=FILENAME]</option></term>
+ <listitem>
+<para>If a filename is not given, defaults to localstatedir/lib/dbus/machine-id
+(localstatedir is usually /var). If this file exists then it will be
+validated, and a failure code returned if it contains the wrong thing.
+If the file does not exist, it will be created with a new uuid in it.
+On success, prints no output.</para>
+
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--version</option></term>
+ <listitem>
+<para>Print the version of dbus-uuidgen</para>
+
+ </listitem>
+ </varlistentry>
+</variablelist>
+</refsect1>
+
+<refsect1 id='author'><title>AUTHOR</title>
+<para>See <ulink url='http://www.freedesktop.org/software/dbus/doc/AUTHORS'>http://www.freedesktop.org/software/dbus/doc/AUTHORS</ulink></para>
+
+</refsect1>
+
+<refsect1 id='bugs'><title>BUGS</title>
+<para>Please send bug reports to the D-Bus mailing list or bug tracker,
+see <ulink url='http://www.freedesktop.org/software/dbus/'>http://www.freedesktop.org/software/dbus/</ulink></para>
+</refsect1>
+</refentry>
diff --git a/install-sh b/install-sh
index a9244eb0..377bb868 100755
--- a/install-sh
+++ b/install-sh
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2011-01-19.21; # UTC
+scriptversion=2011-11-20.07; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -35,7 +35,7 @@ scriptversion=2011-01-19.21; # UTC
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
+# 'make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
@@ -156,7 +156,7 @@ while test $# -ne 0; do
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
- # Protect names problematic for `test' and other utilities.
+ # Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
@@ -190,7 +190,7 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
fi
shift # arg
dst_arg=$arg
- # Protect names problematic for `test' and other utilities.
+ # Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
@@ -202,7 +202,7 @@ if test $# -eq 0; then
echo "$0: no input file specified." >&2
exit 1
fi
- # It's OK to call `install-sh -d' without argument.
+ # It's OK to call 'install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
@@ -240,7 +240,7 @@ fi
for src
do
- # Protect names problematic for `test' and other utilities.
+ # Protect names problematic for 'test' and other utilities.
case $src in
-* | [=\(\)!]) src=./$src;;
esac
@@ -354,7 +354,7 @@ do
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
- # other-writeable bit of parent directory when it shouldn't.
+ # other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
diff --git a/ltmain.sh b/ltmain.sh
index 499e473f..bffda541 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -70,7 +70,7 @@
# compiler: $LTCC
# compiler flags: $LTCFLAGS
# linker: $LD (gnu? $with_gnu_ld)
-# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.2
+# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.11
# automake: $automake_version
# autoconf: $autoconf_version
#
@@ -80,7 +80,7 @@
PROGRAM=libtool
PACKAGE=libtool
-VERSION="2.4.2 Debian-2.4.2-1.2"
+VERSION="2.4.2 Debian-2.4.2-1.11"
TIMESTAMP=""
package_revision=1.3337
diff --git a/m4/compiler.m4 b/m4/compiler.m4
index 5aff5d81..5a197ada 100644
--- a/m4/compiler.m4
+++ b/m4/compiler.m4
@@ -63,5 +63,5 @@ AC_DEFUN([COMPILER_COVERAGE],
if test "x$GCC" = "xyes"; then
CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
fi
-fi])dnl
+fi],[enable_compiler_coverage=no])dnl
])# COMPILER_COVERAGE
diff --git a/m4/libtool.m4 b/m4/libtool.m4
index 02b4bbec..d7c043f4 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -1312,7 +1312,7 @@ ia64-*-hpux*)
rm -rf conftest*
;;
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
@@ -1333,7 +1333,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
;;
esac
;;
- ppc64-*linux*|powerpc64-*linux*)
+ powerpc64le-*)
+ LD="${LD-ld} -m elf32lppclinux"
+ ;;
+ powerpc64-*)
LD="${LD-ld} -m elf32ppclinux"
;;
s390x-*linux*)
@@ -1352,7 +1355,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
x86_64-*linux*)
LD="${LD-ld} -m elf_x86_64"
;;
- ppc*-*linux*|powerpc*-*linux*)
+ powerpcle-*)
+ LD="${LD-ld} -m elf64lppc"
+ ;;
+ powerpc-*)
LD="${LD-ld} -m elf64ppc"
;;
s390*-*linux*|s390*-*tpf*)
diff --git a/missing b/missing
index 86a8fc31..db98974f 100755
--- a/missing
+++ b/missing
@@ -1,11 +1,10 @@
#! /bin/sh
-# Common stub for a few missing GNU programs while installing.
+# Common wrapper for a few potentially missing GNU programs.
-scriptversion=2012-01-06.13; # UTC
+scriptversion=2013-10-28.13; # UTC
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
-# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
-# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -26,68 +25,40 @@ scriptversion=2012-01-06.13; # UTC
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
- echo 1>&2 "Try \`$0 --help' for more information"
+ echo 1>&2 "Try '$0 --help' for more information"
exit 1
fi
-run=:
-sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
-sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
-
-# In the cases where this matters, `missing' is being run in the
-# srcdir already.
-if test -f configure.ac; then
- configure_ac=configure.ac
-else
- configure_ac=configure.in
-fi
+case $1 in
-msg="missing on your system"
+ --is-lightweight)
+ # Used by our autoconf macros to check whether the available missing
+ # script is modern enough.
+ exit 0
+ ;;
-case $1 in
---run)
- # Try to run requested program, and just exit if it succeeds.
- run=
- shift
- "$@" && exit 0
- # Exit code 63 means version mismatch. This often happens
- # when the user try to use an ancient version of a tool on
- # a file that requires a minimum version. In this case we
- # we should proceed has if the program had been absent, or
- # if --run hadn't been passed.
- if test $? = 63; then
- run=:
- msg="probably too old"
- fi
- ;;
+ --run)
+ # Back-compat with the calling convention used by older automake.
+ shift
+ ;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
-Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
-error status if there is no known handling for PROGRAM.
+Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
+to PROGRAM being missing or too old.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
- --run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
- aclocal touch file \`aclocal.m4'
- autoconf touch file \`configure'
- autoheader touch file \`config.h.in'
- autom4te touch the output file, or create a stub one
- automake touch all \`Makefile.in' files
- bison create \`y.tab.[ch]', if possible, from existing .[ch]
- flex create \`lex.yy.c', if possible, from existing .c
- help2man touch the output file
- lex create \`lex.yy.c', if possible, from existing .c
- makeinfo touch the output file
- yacc create \`y.tab.[ch]', if possible, from existing .[ch]
+ aclocal autoconf autoheader autom4te automake makeinfo
+ bison yacc flex lex help2man
-Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
-\`g' are ignored when checking the name.
+Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
+'g' are ignored when checking the name.
Send bug reports to <bug-automake@gnu.org>."
exit $?
@@ -99,228 +70,141 @@ Send bug reports to <bug-automake@gnu.org>."
;;
-*)
- echo 1>&2 "$0: Unknown \`$1' option"
- echo 1>&2 "Try \`$0 --help' for more information"
+ echo 1>&2 "$0: unknown '$1' option"
+ echo 1>&2 "Try '$0 --help' for more information"
exit 1
;;
esac
-# normalize program name to check for.
-program=`echo "$1" | sed '
- s/^gnu-//; t
- s/^gnu//; t
- s/^g//; t'`
-
-# Now exit if we have it, but it failed. Also exit now if we
-# don't have it and --version was passed (most likely to detect
-# the program). This is about non-GNU programs, so use $1 not
-# $program.
-case $1 in
- lex*|yacc*)
- # Not GNU programs, they don't have --version.
- ;;
-
- *)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
- # Could not run --version or --help. This is probably someone
- # running `$TOOL --version' or `$TOOL --help' to check whether
- # $TOOL exists and not knowing $TOOL uses missing.
- exit 1
- fi
- ;;
-esac
-
-# If it does not exist, or fails to run (possibly an outdated version),
-# try to emulate it.
-case $program in
- aclocal*)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified \`acinclude.m4' or \`${configure_ac}'. You might want
- to install the \`Automake' and \`Perl' packages. Grab them from
- any GNU archive site."
- touch aclocal.m4
- ;;
-
- autoconf*)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified \`${configure_ac}'. You might want to install the
- \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
- archive site."
- touch configure
- ;;
-
- autoheader*)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified \`acconfig.h' or \`${configure_ac}'. You might want
- to install the \`Autoconf' and \`GNU m4' packages. Grab them
- from any GNU archive site."
- files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
- test -z "$files" && files="config.h"
- touch_files=
- for f in $files; do
- case $f in
- *:*) touch_files="$touch_files "`echo "$f" |
- sed -e 's/^[^:]*://' -e 's/:.*//'`;;
- *) touch_files="$touch_files $f.in";;
- esac
- done
- touch $touch_files
- ;;
-
- automake*)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
- You might want to install the \`Automake' and \`Perl' packages.
- Grab them from any GNU archive site."
- find . -type f -name Makefile.am -print |
- sed 's/\.am$/.in/' |
- while read f; do touch "$f"; done
- ;;
-
- autom4te*)
- echo 1>&2 "\
-WARNING: \`$1' is needed, but is $msg.
- You might have modified some files without having the
- proper tools for further handling them.
- You can get \`$1' as part of \`Autoconf' from any GNU
- archive site."
-
- file=`echo "$*" | sed -n "$sed_output"`
- test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
- if test -f "$file"; then
- touch $file
- else
- test -z "$file" || exec >$file
- echo "#! /bin/sh"
- echo "# Created by GNU Automake missing as a replacement of"
- echo "# $ $@"
- echo "exit 0"
- chmod +x $file
- exit 1
- fi
- ;;
-
- bison*|yacc*)
- echo 1>&2 "\
-WARNING: \`$1' $msg. You should only need it if
- you modified a \`.y' file. You may need the \`Bison' package
- in order for those modifications to take effect. You can get
- \`Bison' from any GNU archive site."
- rm -f y.tab.c y.tab.h
- if test $# -ne 1; then
- eval LASTARG=\${$#}
- case $LASTARG in
- *.y)
- SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
- if test -f "$SRCFILE"; then
- cp "$SRCFILE" y.tab.c
- fi
- SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
- if test -f "$SRCFILE"; then
- cp "$SRCFILE" y.tab.h
- fi
- ;;
- esac
- fi
- if test ! -f y.tab.h; then
- echo >y.tab.h
- fi
- if test ! -f y.tab.c; then
- echo 'main() { return 0; }' >y.tab.c
- fi
- ;;
-
- lex*|flex*)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified a \`.l' file. You may need the \`Flex' package
- in order for those modifications to take effect. You can get
- \`Flex' from any GNU archive site."
- rm -f lex.yy.c
- if test $# -ne 1; then
- eval LASTARG=\${$#}
- case $LASTARG in
- *.l)
- SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
- if test -f "$SRCFILE"; then
- cp "$SRCFILE" lex.yy.c
- fi
- ;;
- esac
- fi
- if test ! -f lex.yy.c; then
- echo 'main() { return 0; }' >lex.yy.c
- fi
- ;;
-
- help2man*)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified a dependency of a manual page. You may need the
- \`Help2man' package in order for those modifications to take
- effect. You can get \`Help2man' from any GNU archive site."
-
- file=`echo "$*" | sed -n "$sed_output"`
- test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
- if test -f "$file"; then
- touch $file
- else
- test -z "$file" || exec >$file
- echo ".ab help2man is required to generate this page"
- exit $?
- fi
- ;;
-
- makeinfo*)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified a \`.texi' or \`.texinfo' file, or any other file
- indirectly affecting the aspect of the manual. The spurious
- call might also be the consequence of using a buggy \`make' (AIX,
- DU, IRIX). You might want to install the \`Texinfo' package or
- the \`GNU make' package. Grab either from any GNU archive site."
- # The file to touch is that specified with -o ...
- file=`echo "$*" | sed -n "$sed_output"`
- test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
- if test -z "$file"; then
- # ... or it is the one specified with @setfilename ...
- infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
- file=`sed -n '
- /^@setfilename/{
- s/.* \([^ ]*\) *$/\1/
- p
- q
- }' $infile`
- # ... or it is derived from the source name (dir/f.texi becomes f.info)
- test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
- fi
- # If the file does not exist, the user really needs makeinfo;
- # let's fail without touching anything.
- test -f $file || exit 1
- touch $file
- ;;
+# Run the given program, remember its exit status.
+"$@"; st=$?
+
+# If it succeeded, we are done.
+test $st -eq 0 && exit 0
+
+# Also exit now if we it failed (or wasn't found), and '--version' was
+# passed; such an option is passed most likely to detect whether the
+# program is present and works.
+case $2 in --version|--help) exit $st;; esac
+
+# Exit code 63 means version mismatch. This often happens when the user
+# tries to use an ancient version of a tool on a file that requires a
+# minimum version.
+if test $st -eq 63; then
+ msg="probably too old"
+elif test $st -eq 127; then
+ # Program was missing.
+ msg="missing on your system"
+else
+ # Program was found and executed, but failed. Give up.
+ exit $st
+fi
- *)
- echo 1>&2 "\
-WARNING: \`$1' is needed, and is $msg.
- You might have modified some files without having the
- proper tools for further handling them. Check the \`README' file,
- it often tells you about the needed prerequisites for installing
- this package. You may also peek at any GNU archive site, in case
- some other package would contain this missing \`$1' program."
- exit 1
+perl_URL=http://www.perl.org/
+flex_URL=http://flex.sourceforge.net/
+gnu_software_URL=http://www.gnu.org/software
+
+program_details ()
+{
+ case $1 in
+ aclocal|automake)
+ echo "The '$1' program is part of the GNU Automake package:"
+ echo "<$gnu_software_URL/automake>"
+ echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
+ echo "<$gnu_software_URL/autoconf>"
+ echo "<$gnu_software_URL/m4/>"
+ echo "<$perl_URL>"
+ ;;
+ autoconf|autom4te|autoheader)
+ echo "The '$1' program is part of the GNU Autoconf package:"
+ echo "<$gnu_software_URL/autoconf/>"
+ echo "It also requires GNU m4 and Perl in order to run:"
+ echo "<$gnu_software_URL/m4/>"
+ echo "<$perl_URL>"
+ ;;
+ esac
+}
+
+give_advice ()
+{
+ # Normalize program name to check for.
+ normalized_program=`echo "$1" | sed '
+ s/^gnu-//; t
+ s/^gnu//; t
+ s/^g//; t'`
+
+ printf '%s\n' "'$1' is $msg."
+
+ configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
+ case $normalized_program in
+ autoconf*)
+ echo "You should only need it if you modified 'configure.ac',"
+ echo "or m4 files included by it."
+ program_details 'autoconf'
+ ;;
+ autoheader*)
+ echo "You should only need it if you modified 'acconfig.h' or"
+ echo "$configure_deps."
+ program_details 'autoheader'
+ ;;
+ automake*)
+ echo "You should only need it if you modified 'Makefile.am' or"
+ echo "$configure_deps."
+ program_details 'automake'
+ ;;
+ aclocal*)
+ echo "You should only need it if you modified 'acinclude.m4' or"
+ echo "$configure_deps."
+ program_details 'aclocal'
+ ;;
+ autom4te*)
+ echo "You might have modified some maintainer files that require"
+ echo "the 'autom4te' program to be rebuilt."
+ program_details 'autom4te'
+ ;;
+ bison*|yacc*)
+ echo "You should only need it if you modified a '.y' file."
+ echo "You may want to install the GNU Bison package:"
+ echo "<$gnu_software_URL/bison/>"
+ ;;
+ lex*|flex*)
+ echo "You should only need it if you modified a '.l' file."
+ echo "You may want to install the Fast Lexical Analyzer package:"
+ echo "<$flex_URL>"
+ ;;
+ help2man*)
+ echo "You should only need it if you modified a dependency" \
+ "of a man page."
+ echo "You may want to install the GNU Help2man package:"
+ echo "<$gnu_software_URL/help2man/>"
;;
-esac
-
-exit 0
+ makeinfo*)
+ echo "You should only need it if you modified a '.texi' file, or"
+ echo "any other file indirectly affecting the aspect of the manual."
+ echo "You might want to install the Texinfo package:"
+ echo "<$gnu_software_URL/texinfo/>"
+ echo "The spurious makeinfo call might also be the consequence of"
+ echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
+ echo "want to install GNU make:"
+ echo "<$gnu_software_URL/make/>"
+ ;;
+ *)
+ echo "You might have modified some files without having the proper"
+ echo "tools for further handling them. Check the 'README' file, it"
+ echo "often tells you about the needed prerequisites for installing"
+ echo "this package. You may also peek at any GNU archive site, in"
+ echo "case some other package contains this missing '$1' program."
+ ;;
+ esac
+}
+
+give_advice "$1" | sed -e '1s/^/WARNING: /' \
+ -e '2,$s/^/ /' >&2
+
+# Propagate the correct exit status (expected to be 127 for a program
+# not found, 63 for a program that failed due to version mismatch).
+exit $st
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
diff --git a/test-driver b/test-driver
new file mode 100755
index 00000000..d3060566
--- /dev/null
+++ b/test-driver
@@ -0,0 +1,139 @@
+#! /bin/sh
+# test-driver - basic testsuite driver script.
+
+scriptversion=2013-07-13.22; # UTC
+
+# Copyright (C) 2011-2013 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+# Make unconditional expansion of undefined variables an error. This
+# helps a lot in preventing typo-related bugs.
+set -u
+
+usage_error ()
+{
+ echo "$0: $*" >&2
+ print_usage >&2
+ exit 2
+}
+
+print_usage ()
+{
+ cat <<END
+Usage:
+ test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
+ [--expect-failure={yes|no}] [--color-tests={yes|no}]
+ [--enable-hard-errors={yes|no}] [--]
+ TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
+The '--test-name', '--log-file' and '--trs-file' options are mandatory.
+END
+}
+
+test_name= # Used for reporting.
+log_file= # Where to save the output of the test script.
+trs_file= # Where to save the metadata of the test run.
+expect_failure=no
+color_tests=no
+enable_hard_errors=yes
+while test $# -gt 0; do
+ case $1 in
+ --help) print_usage; exit $?;;
+ --version) echo "test-driver $scriptversion"; exit $?;;
+ --test-name) test_name=$2; shift;;
+ --log-file) log_file=$2; shift;;
+ --trs-file) trs_file=$2; shift;;
+ --color-tests) color_tests=$2; shift;;
+ --expect-failure) expect_failure=$2; shift;;
+ --enable-hard-errors) enable_hard_errors=$2; shift;;
+ --) shift; break;;
+ -*) usage_error "invalid option: '$1'";;
+ *) break;;
+ esac
+ shift
+done
+
+missing_opts=
+test x"$test_name" = x && missing_opts="$missing_opts --test-name"
+test x"$log_file" = x && missing_opts="$missing_opts --log-file"
+test x"$trs_file" = x && missing_opts="$missing_opts --trs-file"
+if test x"$missing_opts" != x; then
+ usage_error "the following mandatory options are missing:$missing_opts"
+fi
+
+if test $# -eq 0; then
+ usage_error "missing argument"
+fi
+
+if test $color_tests = yes; then
+ # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
+ red='' # Red.
+ grn='' # Green.
+ lgn='' # Light green.
+ blu='' # Blue.
+ mgn='' # Magenta.
+ std='' # No color.
+else
+ red= grn= lgn= blu= mgn= std=
+fi
+
+do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
+trap "st=129; $do_exit" 1
+trap "st=130; $do_exit" 2
+trap "st=141; $do_exit" 13
+trap "st=143; $do_exit" 15
+
+# Test script is run here.
+"$@" >$log_file 2>&1
+estatus=$?
+if test $enable_hard_errors = no && test $estatus -eq 99; then
+ estatus=1
+fi
+
+case $estatus:$expect_failure in
+ 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
+ 0:*) col=$grn res=PASS recheck=no gcopy=no;;
+ 77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
+ 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;;
+ *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;;
+ *:*) col=$red res=FAIL recheck=yes gcopy=yes;;
+esac
+
+# Report outcome to console.
+echo "${col}${res}${std}: $test_name"
+
+# Register the test result, and other relevant metadata.
+echo ":test-result: $res" > $trs_file
+echo ":global-test-result: $res" >> $trs_file
+echo ":recheck: $recheck" >> $trs_file
+echo ":copy-in-global-log: $gcopy" >> $trs_file
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/test/Makefile.am b/test/Makefile.am
index e9448998..cec5cdab 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -19,25 +19,49 @@ AM_LDFLAGS = @R_DYNAMIC_LDFLAG@
static_cppflags = \
$(AM_CPPFLAGS) \
-DDBUS_STATIC_BUILD \
+ -DDBUS_COMPILATION \
+ -DDBUS_TEST_USE_INTERNAL \
$(NULL)
-libdbus_testutils_la_CPPFLAGS = \
- $(static_cppflags)
+noinst_LTLIBRARIES = libdbus-testutils-internal.la
+
+# You can link either libdbus-testutils, dbus-glib and libdbus-1,
+# or libdbus-testutils-internal and libdbus-internal - never both in the
+# same binary.
+if DBUS_WITH_DBUS_GLIB
+noinst_LTLIBRARIES += libdbus-testutils.la
libdbus_testutils_la_SOURCES = \
test-utils.c \
test-utils.h \
$(NULL)
libdbus_testutils_la_LIBADD = \
- $(top_builddir)/dbus/libdbus-internal.la \
+ $(top_builddir)/dbus/libdbus-1.la \
+ $(GLIB_LIBS) \
+ $(DBUS_GLIB_LIBS) \
$(NULL)
+testutils_shared_if_possible_cppflags = $(AM_CPPFLAGS)
+testutils_shared_if_possible_libs = libdbus-testutils.la
+else
+testutils_shared_if_possible_cppflags = $(static_cppflags)
+testutils_shared_if_possible_libs = libdbus-testutils-internal.la
+endif
-noinst_LTLIBRARIES = libdbus-testutils.la
+libdbus_testutils_internal_la_CPPFLAGS = \
+ $(static_cppflags) \
+ $(NULL)
+libdbus_testutils_internal_la_SOURCES = \
+ test-utils.c \
+ test-utils.h \
+ $(NULL)
+libdbus_testutils_internal_la_LIBADD = \
+ $(top_builddir)/dbus/libdbus-internal.la \
+ $(NULL)
-if DBUS_BUILD_TESTS
+if DBUS_ENABLE_EMBEDDED_TESTS
## break-loader removed for now
## these binaries are used in tests but are not themselves tests
TEST_BINARIES = \
- spawn-test \
+ test-spawn \
test-exit \
test-names \
test-segfault \
@@ -50,44 +74,50 @@ TEST_BINARIES = \
## order, but we don't want to run them til we arrive in this directory,
## since they depend on stuff from this directory
TESTS = \
- ../bus/bus-test$(EXEEXT) \
- ../bus/bus-test-system$(EXEEXT) \
- ../dbus/dbus-test$(EXEEXT) \
+ ../bus/test-bus$(EXEEXT) \
+ ../bus/test-bus-system$(EXEEXT) \
+ ../dbus/test-dbus$(EXEEXT) \
$(NULL)
if DBUS_UNIX
-TESTS += ../bus/bus-test-launch-helper$(EXEEXT)
+TESTS += ../bus/test-bus-launch-helper$(EXEEXT)
endif
-else !DBUS_BUILD_TESTS
+else !DBUS_ENABLE_EMBEDDED_TESTS
TEST_BINARIES=
TESTS=
-endif !DBUS_BUILD_TESTS
+endif !DBUS_ENABLE_EMBEDDED_TESTS
noinst_PROGRAMS= $(TEST_BINARIES)
test_service_CPPFLAGS = $(static_cppflags)
-test_service_LDADD = libdbus-testutils.la
+test_service_LDADD = libdbus-testutils-internal.la
test_names_CPPFLAGS = $(static_cppflags)
-test_names_LDADD = libdbus-testutils.la
+test_names_LDADD = libdbus-testutils-internal.la
## break_loader_CPPFLAGS = $(static_cppflags)
## break_loader_LDADD = $(top_builddir)/dbus/libdbus-internal.la
test_shell_service_CPPFLAGS = $(static_cppflags)
-test_shell_service_LDADD = libdbus-testutils.la
-shell_test_CPPFLAGS = $(static_cppflags)
-shell_test_LDADD = libdbus-testutils.la
-spawn_test_CPPFLAGS = $(static_cppflags)
-spawn_test_LDADD = $(top_builddir)/dbus/libdbus-internal.la
+test_shell_service_LDADD = libdbus-testutils-internal.la
+test_shell_SOURCES = shell-test.c
+test_shell_CPPFLAGS = $(static_cppflags)
+test_shell_LDADD = libdbus-testutils-internal.la
+test_spawn_SOURCES = spawn-test.c
+test_spawn_CPPFLAGS = $(static_cppflags)
+test_spawn_LDADD = $(top_builddir)/dbus/libdbus-internal.la
+
+test_printf_SOURCES = internals/printf.c
+test_printf_CPPFLAGS = $(static_cppflags)
+test_printf_LDADD = $(top_builddir)/dbus/libdbus-internal.la
test_refs_SOURCES = internals/refs.c
test_refs_CPPFLAGS = $(static_cppflags)
-test_refs_LDADD = libdbus-testutils.la $(GLIB_LIBS)
+test_refs_LDADD = libdbus-testutils-internal.la $(GLIB_LIBS)
test_syslog_SOURCES = internals/syslog.c
test_syslog_CPPFLAGS = $(static_cppflags)
-test_syslog_LDADD = libdbus-testutils.la $(GLIB_LIBS)
+test_syslog_LDADD = libdbus-testutils-internal.la $(GLIB_LIBS)
EXTRA_DIST = dbus-test-runner
@@ -96,7 +126,10 @@ testexecdir = $(libdir)/dbus-1.0/test
testexec_PROGRAMS =
installable_tests = \
- shell-test \
+ test-shell \
+ test-printf \
+ $(NULL)
+installable_manual_tests = \
$(NULL)
if DBUS_WITH_GLIB
@@ -111,66 +144,88 @@ installable_tests += \
test-syntax \
test-syslog \
$(NULL)
+installable_manual_tests += \
+ manual-authz \
+ $(NULL)
endif DBUS_WITH_GLIB
installcheck_tests =
installcheck_environment = \
+ XDG_RUNTIME_DIR=@abs_top_builddir@/test/XDG_RUNTIME_DIR \
DBUS_TEST_DAEMON=$(DESTDIR)$(DBUS_DAEMONDIR)/dbus-daemon$(EXEEXT) \
DBUS_TEST_HOMEDIR=@abs_top_builddir@/dbus \
DBUS_TEST_SYSCONFDIR=$(DESTDIR)$(sysconfdir)
TESTS_ENVIRONMENT = \
- DBUS_BLOCK_ON_ABORT=1 \
+ XDG_RUNTIME_DIR=@abs_top_builddir@/test/XDG_RUNTIME_DIR \
DBUS_FATAL_WARNINGS=1 \
DBUS_TEST_DAEMON=@abs_top_builddir@/bus/dbus-daemon$(EXEEXT) \
DBUS_TEST_DATA=@abs_top_builddir@/test/data \
DBUS_TEST_HOMEDIR=@abs_top_builddir@/dbus \
$(NULL)
+manual_authz_SOURCES = manual-authz.c
+manual_authz_CPPFLAGS = $(testutils_shared_if_possible_cppflags)
+manual_authz_LDADD = \
+ $(testutils_shared_if_possible_libs) \
+ $(GLIB_LIBS) \
+ $(NULL)
+
test_corrupt_SOURCES = corrupt.c
-test_corrupt_LDADD = $(top_builddir)/dbus/libdbus-1.la \
+test_corrupt_CPPFLAGS = $(testutils_shared_if_possible_cppflags)
+test_corrupt_LDADD = \
+ $(testutils_shared_if_possible_libs) \
$(GLIB_LIBS) \
- $(DBUS_GLIB_LIBS)
+ $(NULL)
test_loopback_SOURCES = loopback.c
-test_loopback_LDADD = $(top_builddir)/dbus/libdbus-1.la \
+test_loopback_CPPFLAGS = $(testutils_shared_if_possible_cppflags)
+test_loopback_LDADD = \
+ $(testutils_shared_if_possible_libs) \
$(GLIB_LIBS) \
- $(DBUS_GLIB_LIBS)
+ $(NULL)
test_relay_SOURCES = relay.c
-test_relay_LDADD = $(top_builddir)/dbus/libdbus-1.la \
+test_relay_CPPFLAGS = $(testutils_shared_if_possible_cppflags)
+test_relay_LDADD = \
+ $(testutils_shared_if_possible_libs) \
$(GLIB_LIBS) \
- $(DBUS_GLIB_LIBS)
+ $(NULL)
test_dbus_daemon_SOURCES = dbus-daemon.c
-test_dbus_daemon_LDADD = $(top_builddir)/dbus/libdbus-1.la \
+test_dbus_daemon_CPPFLAGS = $(testutils_shared_if_possible_cppflags)
+test_dbus_daemon_LDADD = \
+ $(testutils_shared_if_possible_libs) \
$(GLIB_LIBS) \
- $(DBUS_GLIB_LIBS)
+ $(NULL)
test_dbus_daemon_eavesdrop_SOURCES = dbus-daemon-eavesdrop.c
-test_dbus_daemon_eavesdrop_CPPFLAGS = $(GLIB_CFLAGS) $(DBUS_GLIB_CFLAGS)
-test_dbus_daemon_eavesdrop_LDFLAGS = @R_DYNAMIC_LDFLAG@
-test_dbus_daemon_eavesdrop_LDADD = $(top_builddir)/dbus/libdbus-1.la \
+test_dbus_daemon_eavesdrop_CPPFLAGS = $(testutils_shared_if_possible_cppflags)
+test_dbus_daemon_eavesdrop_LDADD = \
+ $(testutils_shared_if_possible_libs) \
$(GLIB_LIBS) \
- $(DBUS_GLIB_LIBS)
+ $(NULL)
test_marshal_SOURCES = marshal.c
-test_marshal_LDADD = $(top_builddir)/dbus/libdbus-1.la \
+test_marshal_LDADD = \
+ $(top_builddir)/dbus/libdbus-1.la \
$(GLIB_LIBS) \
- $(DBUS_GLIB_LIBS)
+ $(NULL)
test_syntax_SOURCES = syntax.c
-test_syntax_LDADD = $(top_builddir)/dbus/libdbus-1.la \
- $(GLIB_LIBS)
+test_syntax_LDADD = \
+ $(top_builddir)/dbus/libdbus-1.la \
+ $(GLIB_LIBS) \
+ $(NULL)
if DBUS_ENABLE_MODULAR_TESTS
TESTS += $(installable_tests)
installcheck_tests += $(installable_tests)
if DBUS_ENABLE_INSTALLED_TESTS
- testexec_PROGRAMS += $(installable_tests)
+ testexec_PROGRAMS += $(installable_tests) $(installable_manual_tests)
else !DBUS_ENABLE_INSTALLED_TESTS
- noinst_PROGRAMS += $(installable_tests)
+ noinst_PROGRAMS += $(installable_tests) $(installable_manual_tests)
endif !DBUS_ENABLE_INSTALLED_TESTS
endif DBUS_ENABLE_MODULAR_TESTS
@@ -194,6 +249,7 @@ in_data = \
data/valid-config-files-system/debug-allow-all-pass.conf.in \
data/valid-config-files/debug-allow-all-sha1.conf.in \
data/valid-config-files/debug-allow-all.conf.in \
+ data/valid-config-files/incoming-limit.conf.in \
data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoExec.service.in \
data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoService.service.in \
data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoUser.service.in \
@@ -265,7 +321,6 @@ static_data = \
data/valid-config-files/basic.conf \
data/valid-config-files/basic.d/basic.conf \
data/valid-config-files/entities.conf \
- data/valid-config-files/incoming-limit.conf \
data/valid-config-files/many-rules.conf \
data/valid-config-files/system.d/test.conf \
data/valid-messages/array-of-array-of-uint32.message \
@@ -316,12 +371,8 @@ imported_data = \
$(NULL)
noinst_DATA = $(imported_data)
-CLEANFILES = $(noinst_DATA)
-
-data/valid-config-files/session.conf: $(top_builddir)/bus/session.conf
- $(AM_V_at)$(MKDIR_P) data/valid-config-files
- $(AM_V_GEN)cp $< $@
+CLEANFILES = $(noinst_DATA) XDG_RUNTIME_DIR
-data/valid-config-files/system.conf: $(top_builddir)/bus/system.conf
+$(imported_data): data/valid-config-files/%.conf: $(top_builddir)/bus/%.conf
$(AM_V_at)$(MKDIR_P) data/valid-config-files
$(AM_V_GEN)cp $< $@
diff --git a/test/Makefile.in b/test/Makefile.in
index 95b4cc4e..d8fc34a2 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.6 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -18,23 +17,51 @@
VPATH = @srcdir@
-am__make_dryrun = \
- { \
- am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
- *) \
- for am__flg in $$MAKEFLAGS; do \
- case $$am__flg in \
- *=*|--*) ;; \
- *n*) am__dry=yes; break;; \
- esac; \
- done;; \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
- test $$am__dry = yes; \
- }
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -53,15 +80,21 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-@DBUS_BUILD_TESTS_FALSE@TESTS = $(am__EXEEXT_6)
-@DBUS_BUILD_TESTS_TRUE@TESTS = ../bus/bus-test$(EXEEXT) \
-@DBUS_BUILD_TESTS_TRUE@ ../bus/bus-test-system$(EXEEXT) \
-@DBUS_BUILD_TESTS_TRUE@ ../dbus/dbus-test$(EXEEXT) \
-@DBUS_BUILD_TESTS_TRUE@ $(am__append_1) $(am__EXEEXT_6)
-@DBUS_BUILD_TESTS_TRUE@@DBUS_UNIX_TRUE@am__append_1 = ../bus/bus-test-launch-helper$(EXEEXT)
-noinst_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_4)
-testexec_PROGRAMS = $(am__EXEEXT_5)
-@DBUS_WITH_GLIB_TRUE@am__append_2 = \
+
+# You can link either libdbus-testutils, dbus-glib and libdbus-1,
+# or libdbus-testutils-internal and libdbus-internal - never both in the
+# same binary.
+@DBUS_WITH_DBUS_GLIB_TRUE@am__append_1 = libdbus-testutils.la
+@DBUS_ENABLE_EMBEDDED_TESTS_FALSE@TESTS = $(am__EXEEXT_8)
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@TESTS = ../bus/test-bus$(EXEEXT) \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ ../bus/test-bus-system$(EXEEXT) \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ ../dbus/test-dbus$(EXEEXT) \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ $(am__append_2) \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ $(am__EXEEXT_8)
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@@DBUS_UNIX_TRUE@am__append_2 = ../bus/test-bus-launch-helper$(EXEEXT)
+noinst_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_6)
+testexec_PROGRAMS = $(am__EXEEXT_7)
+@DBUS_WITH_GLIB_TRUE@am__append_3 = \
@DBUS_WITH_GLIB_TRUE@ test-corrupt \
@DBUS_WITH_GLIB_TRUE@ test-dbus-daemon \
@DBUS_WITH_GLIB_TRUE@ test-dbus-daemon-eavesdrop \
@@ -73,12 +106,17 @@ testexec_PROGRAMS = $(am__EXEEXT_5)
@DBUS_WITH_GLIB_TRUE@ test-syslog \
@DBUS_WITH_GLIB_TRUE@ $(NULL)
-@DBUS_ENABLE_MODULAR_TESTS_TRUE@am__append_3 = $(installable_tests)
-@DBUS_ENABLE_MODULAR_TESTS_TRUE@am__append_4 = $(installable_tests)
-@DBUS_ENABLE_INSTALLED_TESTS_TRUE@@DBUS_ENABLE_MODULAR_TESTS_TRUE@am__append_5 = $(installable_tests)
-@DBUS_ENABLE_INSTALLED_TESTS_FALSE@@DBUS_ENABLE_MODULAR_TESTS_TRUE@am__append_6 = $(installable_tests)
+@DBUS_WITH_GLIB_TRUE@am__append_4 = \
+@DBUS_WITH_GLIB_TRUE@ manual-authz \
+@DBUS_WITH_GLIB_TRUE@ $(NULL)
+
+@DBUS_ENABLE_MODULAR_TESTS_TRUE@am__append_5 = $(installable_tests)
+@DBUS_ENABLE_MODULAR_TESTS_TRUE@am__append_6 = $(installable_tests)
+@DBUS_ENABLE_INSTALLED_TESTS_TRUE@@DBUS_ENABLE_MODULAR_TESTS_TRUE@am__append_7 = $(installable_tests) $(installable_manual_tests)
+@DBUS_ENABLE_INSTALLED_TESTS_FALSE@@DBUS_ENABLE_MODULAR_TESTS_TRUE@am__append_8 = $(installable_tests) $(installable_manual_tests)
subdir = test
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+ $(top_srcdir)/depcomp $(top_srcdir)/test-driver
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/libtool.m4 \
@@ -94,19 +132,33 @@ CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
-libdbus_testutils_la_DEPENDENCIES = \
+libdbus_testutils_internal_la_DEPENDENCIES = \
$(top_builddir)/dbus/libdbus-internal.la
-am_libdbus_testutils_la_OBJECTS = libdbus_testutils_la-test-utils.lo
-libdbus_testutils_la_OBJECTS = $(am_libdbus_testutils_la_OBJECTS)
+am_libdbus_testutils_internal_la_OBJECTS = \
+ libdbus_testutils_internal_la-test-utils.lo
+libdbus_testutils_internal_la_OBJECTS = \
+ $(am_libdbus_testutils_internal_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
-@DBUS_BUILD_TESTS_TRUE@am__EXEEXT_1 = spawn-test$(EXEEXT) \
-@DBUS_BUILD_TESTS_TRUE@ test-exit$(EXEEXT) test-names$(EXEEXT) \
-@DBUS_BUILD_TESTS_TRUE@ test-segfault$(EXEEXT) \
-@DBUS_BUILD_TESTS_TRUE@ test-service$(EXEEXT) \
-@DBUS_BUILD_TESTS_TRUE@ test-shell-service$(EXEEXT) \
-@DBUS_BUILD_TESTS_TRUE@ test-sleep-forever$(EXEEXT)
+am__v_lt_1 =
+am__DEPENDENCIES_1 =
+@DBUS_WITH_DBUS_GLIB_TRUE@libdbus_testutils_la_DEPENDENCIES = \
+@DBUS_WITH_DBUS_GLIB_TRUE@ $(top_builddir)/dbus/libdbus-1.la \
+@DBUS_WITH_DBUS_GLIB_TRUE@ $(am__DEPENDENCIES_1) \
+@DBUS_WITH_DBUS_GLIB_TRUE@ $(am__DEPENDENCIES_1)
+am__libdbus_testutils_la_SOURCES_DIST = test-utils.c test-utils.h
+@DBUS_WITH_DBUS_GLIB_TRUE@am_libdbus_testutils_la_OBJECTS = \
+@DBUS_WITH_DBUS_GLIB_TRUE@ test-utils.lo
+libdbus_testutils_la_OBJECTS = $(am_libdbus_testutils_la_OBJECTS)
+@DBUS_WITH_DBUS_GLIB_TRUE@am_libdbus_testutils_la_rpath =
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@am__EXEEXT_1 = test-spawn$(EXEEXT) \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-exit$(EXEEXT) \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-names$(EXEEXT) \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-segfault$(EXEEXT) \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-service$(EXEEXT) \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-shell-service$(EXEEXT) \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-sleep-forever$(EXEEXT)
@DBUS_WITH_GLIB_TRUE@am__EXEEXT_2 = test-corrupt$(EXEEXT) \
@DBUS_WITH_GLIB_TRUE@ test-dbus-daemon$(EXEEXT) \
@DBUS_WITH_GLIB_TRUE@ test-dbus-daemon-eavesdrop$(EXEEXT) \
@@ -114,78 +166,98 @@ am__v_lt_0 = --silent
@DBUS_WITH_GLIB_TRUE@ test-marshal$(EXEEXT) test-refs$(EXEEXT) \
@DBUS_WITH_GLIB_TRUE@ test-relay$(EXEEXT) test-syntax$(EXEEXT) \
@DBUS_WITH_GLIB_TRUE@ test-syslog$(EXEEXT)
-am__EXEEXT_3 = shell-test$(EXEEXT) $(am__EXEEXT_2)
-@DBUS_ENABLE_INSTALLED_TESTS_FALSE@@DBUS_ENABLE_MODULAR_TESTS_TRUE@am__EXEEXT_4 = $(am__EXEEXT_3)
-@DBUS_ENABLE_INSTALLED_TESTS_TRUE@@DBUS_ENABLE_MODULAR_TESTS_TRUE@am__EXEEXT_5 = $(am__EXEEXT_3)
+am__EXEEXT_3 = test-shell$(EXEEXT) test-printf$(EXEEXT) \
+ $(am__EXEEXT_2)
+@DBUS_WITH_GLIB_TRUE@am__EXEEXT_4 = manual-authz$(EXEEXT)
+am__EXEEXT_5 = $(am__EXEEXT_4)
+@DBUS_ENABLE_INSTALLED_TESTS_FALSE@@DBUS_ENABLE_MODULAR_TESTS_TRUE@am__EXEEXT_6 = $(am__EXEEXT_3) \
+@DBUS_ENABLE_INSTALLED_TESTS_FALSE@@DBUS_ENABLE_MODULAR_TESTS_TRUE@ $(am__EXEEXT_5)
+@DBUS_ENABLE_INSTALLED_TESTS_TRUE@@DBUS_ENABLE_MODULAR_TESTS_TRUE@am__EXEEXT_7 = $(am__EXEEXT_3) \
+@DBUS_ENABLE_INSTALLED_TESTS_TRUE@@DBUS_ENABLE_MODULAR_TESTS_TRUE@ $(am__EXEEXT_5)
am__installdirs = "$(DESTDIR)$(testexecdir)"
PROGRAMS = $(noinst_PROGRAMS) $(testexec_PROGRAMS)
-shell_test_SOURCES = shell-test.c
-shell_test_OBJECTS = shell_test-shell-test.$(OBJEXT)
-shell_test_DEPENDENCIES = libdbus-testutils.la
-spawn_test_SOURCES = spawn-test.c
-spawn_test_OBJECTS = spawn_test-spawn-test.$(OBJEXT)
-spawn_test_DEPENDENCIES = $(top_builddir)/dbus/libdbus-internal.la
-am_test_corrupt_OBJECTS = corrupt.$(OBJEXT)
+am_manual_authz_OBJECTS = manual_authz-manual-authz.$(OBJEXT)
+manual_authz_OBJECTS = $(am_manual_authz_OBJECTS)
+manual_authz_DEPENDENCIES = $(testutils_shared_if_possible_libs) \
+ $(am__DEPENDENCIES_1)
+am_test_corrupt_OBJECTS = test_corrupt-corrupt.$(OBJEXT)
test_corrupt_OBJECTS = $(am_test_corrupt_OBJECTS)
-am__DEPENDENCIES_1 =
-test_corrupt_DEPENDENCIES = $(top_builddir)/dbus/libdbus-1.la \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-am_test_dbus_daemon_OBJECTS = dbus-daemon.$(OBJEXT)
+test_corrupt_DEPENDENCIES = $(testutils_shared_if_possible_libs) \
+ $(am__DEPENDENCIES_1)
+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_DEPENDENCIES = $(testutils_shared_if_possible_libs) \
+ $(am__DEPENDENCIES_1)
am_test_dbus_daemon_eavesdrop_OBJECTS = \
test_dbus_daemon_eavesdrop-dbus-daemon-eavesdrop.$(OBJEXT)
test_dbus_daemon_eavesdrop_OBJECTS = \
$(am_test_dbus_daemon_eavesdrop_OBJECTS)
test_dbus_daemon_eavesdrop_DEPENDENCIES = \
- $(top_builddir)/dbus/libdbus-1.la $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
-test_dbus_daemon_eavesdrop_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(AM_CFLAGS) $(CFLAGS) $(test_dbus_daemon_eavesdrop_LDFLAGS) \
- $(LDFLAGS) -o $@
+ $(testutils_shared_if_possible_libs) $(am__DEPENDENCIES_1)
test_exit_SOURCES = test-exit.c
test_exit_OBJECTS = test-exit.$(OBJEXT)
test_exit_LDADD = $(LDADD)
-am_test_loopback_OBJECTS = loopback.$(OBJEXT)
+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_DEPENDENCIES = $(testutils_shared_if_possible_libs) \
+ $(am__DEPENDENCIES_1)
am_test_marshal_OBJECTS = marshal.$(OBJEXT)
test_marshal_OBJECTS = $(am_test_marshal_OBJECTS)
test_marshal_DEPENDENCIES = $(top_builddir)/dbus/libdbus-1.la \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+ $(am__DEPENDENCIES_1)
test_names_SOURCES = test-names.c
test_names_OBJECTS = test_names-test-names.$(OBJEXT)
-test_names_DEPENDENCIES = libdbus-testutils.la
+test_names_DEPENDENCIES = libdbus-testutils-internal.la
+am_test_printf_OBJECTS = test_printf-printf.$(OBJEXT)
+test_printf_OBJECTS = $(am_test_printf_OBJECTS)
+test_printf_DEPENDENCIES = $(top_builddir)/dbus/libdbus-internal.la
am_test_refs_OBJECTS = test_refs-refs.$(OBJEXT)
test_refs_OBJECTS = $(am_test_refs_OBJECTS)
-test_refs_DEPENDENCIES = libdbus-testutils.la $(am__DEPENDENCIES_1)
-am_test_relay_OBJECTS = relay.$(OBJEXT)
+test_refs_DEPENDENCIES = libdbus-testutils-internal.la \
+ $(am__DEPENDENCIES_1)
+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_DEPENDENCIES = $(testutils_shared_if_possible_libs) \
+ $(am__DEPENDENCIES_1)
test_segfault_SOURCES = test-segfault.c
test_segfault_OBJECTS = test-segfault.$(OBJEXT)
test_segfault_LDADD = $(LDADD)
test_service_SOURCES = test-service.c
test_service_OBJECTS = test_service-test-service.$(OBJEXT)
-test_service_DEPENDENCIES = libdbus-testutils.la
+test_service_DEPENDENCIES = libdbus-testutils-internal.la
+am_test_shell_OBJECTS = test_shell-shell-test.$(OBJEXT)
+test_shell_OBJECTS = $(am_test_shell_OBJECTS)
+test_shell_DEPENDENCIES = libdbus-testutils-internal.la
test_shell_service_SOURCES = test-shell-service.c
test_shell_service_OBJECTS = \
test_shell_service-test-shell-service.$(OBJEXT)
-test_shell_service_DEPENDENCIES = libdbus-testutils.la
+test_shell_service_DEPENDENCIES = libdbus-testutils-internal.la
test_sleep_forever_SOURCES = test-sleep-forever.c
test_sleep_forever_OBJECTS = test-sleep-forever.$(OBJEXT)
test_sleep_forever_LDADD = $(LDADD)
+am_test_spawn_OBJECTS = test_spawn-spawn-test.$(OBJEXT)
+test_spawn_OBJECTS = $(am_test_spawn_OBJECTS)
+test_spawn_DEPENDENCIES = $(top_builddir)/dbus/libdbus-internal.la
am_test_syntax_OBJECTS = syntax.$(OBJEXT)
test_syntax_OBJECTS = $(am_test_syntax_OBJECTS)
test_syntax_DEPENDENCIES = $(top_builddir)/dbus/libdbus-1.la \
$(am__DEPENDENCIES_1)
am_test_syslog_OBJECTS = test_syslog-syslog.$(OBJEXT)
test_syslog_OBJECTS = $(am_test_syslog_OBJECTS)
-test_syslog_DEPENDENCIES = libdbus-testutils.la $(am__DEPENDENCIES_1)
+test_syslog_DEPENDENCIES = libdbus-testutils-internal.la \
+ $(am__DEPENDENCIES_1)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@@ -198,42 +270,45 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-SOURCES = $(libdbus_testutils_la_SOURCES) shell-test.c spawn-test.c \
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(libdbus_testutils_internal_la_SOURCES) \
+ $(libdbus_testutils_la_SOURCES) $(manual_authz_SOURCES) \
$(test_corrupt_SOURCES) $(test_dbus_daemon_SOURCES) \
$(test_dbus_daemon_eavesdrop_SOURCES) test-exit.c \
$(test_loopback_SOURCES) $(test_marshal_SOURCES) test-names.c \
- $(test_refs_SOURCES) $(test_relay_SOURCES) test-segfault.c \
- test-service.c test-shell-service.c test-sleep-forever.c \
+ $(test_printf_SOURCES) $(test_refs_SOURCES) \
+ $(test_relay_SOURCES) test-segfault.c test-service.c \
+ $(test_shell_SOURCES) test-shell-service.c \
+ test-sleep-forever.c $(test_spawn_SOURCES) \
$(test_syntax_SOURCES) $(test_syslog_SOURCES)
-DIST_SOURCES = $(libdbus_testutils_la_SOURCES) shell-test.c \
- spawn-test.c $(test_corrupt_SOURCES) \
+DIST_SOURCES = $(libdbus_testutils_internal_la_SOURCES) \
+ $(am__libdbus_testutils_la_SOURCES_DIST) \
+ $(manual_authz_SOURCES) $(test_corrupt_SOURCES) \
$(test_dbus_daemon_SOURCES) \
$(test_dbus_daemon_eavesdrop_SOURCES) test-exit.c \
$(test_loopback_SOURCES) $(test_marshal_SOURCES) test-names.c \
- $(test_refs_SOURCES) $(test_relay_SOURCES) test-segfault.c \
- test-service.c test-shell-service.c test-sleep-forever.c \
+ $(test_printf_SOURCES) $(test_refs_SOURCES) \
+ $(test_relay_SOURCES) test-segfault.c test-service.c \
+ $(test_shell_SOURCES) test-shell-service.c \
+ test-sleep-forever.c $(test_spawn_SOURCES) \
$(test_syntax_SOURCES) $(test_syslog_SOURCES)
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
- html-recursive info-recursive install-data-recursive \
- install-dvi-recursive install-exec-recursive \
- install-html-recursive install-info-recursive \
- install-pdf-recursive install-ps-recursive install-recursive \
- installcheck-recursive installdirs-recursive pdf-recursive \
- ps-recursive uninstall-recursive
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+ ctags-recursive dvi-recursive html-recursive info-recursive \
+ install-data-recursive install-dvi-recursive \
+ install-exec-recursive install-html-recursive \
+ install-info-recursive install-pdf-recursive \
+ install-ps-recursive install-recursive installcheck-recursive \
+ installdirs-recursive pdf-recursive ps-recursive \
+ tags-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -242,14 +317,235 @@ am__can_run_installinfo = \
DATA = $(noinst_DATA)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
- $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
- distdir
+am__recursive_targets = \
+ $(RECURSIVE_TARGETS) \
+ $(RECURSIVE_CLEAN_TARGETS) \
+ $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+ check recheck distdir
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
-am__tty_colors = \
-red=; grn=; lgn=; blu=; std=
-@DBUS_ENABLE_MODULAR_TESTS_TRUE@am__EXEEXT_6 = $(am__EXEEXT_3)
+am__tty_colors_dummy = \
+ mgn= red= grn= lgn= blu= brg= std=; \
+ am__color_tests=no
+am__tty_colors = { \
+ $(am__tty_colors_dummy); \
+ if test "X$(AM_COLOR_TESTS)" = Xno; then \
+ am__color_tests=no; \
+ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+ am__color_tests=yes; \
+ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+ am__color_tests=yes; \
+ fi; \
+ if test $$am__color_tests = yes; then \
+ red=''; \
+ grn=''; \
+ lgn=''; \
+ blu=''; \
+ mgn=''; \
+ brg=''; \
+ std=''; \
+ fi; \
+}
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__recheck_rx = ^[ ]*:recheck:[ ]*
+am__global_test_result_rx = ^[ ]*:global-test-result:[ ]*
+am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]*
+# A command that, given a newline-separated list of test names on the
+# standard input, print the name of the tests that are to be re-run
+# upon "make recheck".
+am__list_recheck_tests = $(AWK) '{ \
+ recheck = 1; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ { \
+ if ((getline line2 < ($$0 ".log")) < 0) \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
+ { \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
+ { \
+ break; \
+ } \
+ }; \
+ if (recheck) \
+ print $$0; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# A command that, given a newline-separated list of test names on the
+# standard input, create the global log from their .trs and .log files.
+am__create_global_log = $(AWK) ' \
+function fatal(msg) \
+{ \
+ print "fatal: making $@: " msg | "cat >&2"; \
+ exit 1; \
+} \
+function rst_section(header) \
+{ \
+ print header; \
+ len = length(header); \
+ for (i = 1; i <= len; i = i + 1) \
+ printf "="; \
+ printf "\n\n"; \
+} \
+{ \
+ copy_in_global_log = 1; \
+ global_test_result = "RUN"; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".trs"); \
+ if (line ~ /$(am__global_test_result_rx)/) \
+ { \
+ sub("$(am__global_test_result_rx)", "", line); \
+ sub("[ ]*$$", "", line); \
+ global_test_result = line; \
+ } \
+ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
+ copy_in_global_log = 0; \
+ }; \
+ if (copy_in_global_log) \
+ { \
+ rst_section(global_test_result ": " $$0); \
+ while ((rc = (getline line < ($$0 ".log"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".log"); \
+ print line; \
+ }; \
+ printf "\n"; \
+ }; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# Restructured Text title.
+am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+# Solaris 10 'make', and several other traditional 'make' implementations,
+# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it
+# by disabling -e (using the XSI extension "set +e") if it's set.
+am__sh_e_setup = case $$- in *e*) set +e;; esac
+# Default flags passed to test drivers.
+am__common_driver_flags = \
+ --color-tests "$$am__color_tests" \
+ --enable-hard-errors "$$am__enable_hard_errors" \
+ --expect-failure "$$am__expect_failure"
+# To be inserted before the command running the test. Creates the
+# directory for the log if needed. Stores in $dir the directory
+# containing $f, in $tst the test, in $log the log. Executes the
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# passes TESTS_ENVIRONMENT. Set up options for the wrapper that
+# will run the test scripts (or their associated LOG_COMPILER, if
+# thy have one).
+am__check_pre = \
+$(am__sh_e_setup); \
+$(am__vpath_adj_setup) $(am__vpath_adj) \
+$(am__tty_colors); \
+srcdir=$(srcdir); export srcdir; \
+case "$@" in \
+ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \
+ *) am__odir=.;; \
+esac; \
+test "x$$am__odir" = x"." || test -d "$$am__odir" \
+ || $(MKDIR_P) "$$am__odir" || exit $$?; \
+if test -f "./$$f"; then dir=./; \
+elif test -f "$$f"; then dir=; \
+else dir="$(srcdir)/"; fi; \
+tst=$$dir$$f; log='$@'; \
+if test -n '$(DISABLE_HARD_ERRORS)'; then \
+ am__enable_hard_errors=no; \
+else \
+ am__enable_hard_errors=yes; \
+fi; \
+case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \
+ am__expect_failure=yes;; \
+ *) \
+ am__expect_failure=no;; \
+esac; \
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
+# A shell command to get the names of the tests scripts with any registered
+# extension removed (i.e., equivalently, the names of the test logs, with
+# the '.log' extension removed). The result is saved in the shell variable
+# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly,
+# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
+# since that might cause problem with VPATH rewrites for suffix-less tests.
+# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
+am__set_TESTS_bases = \
+ bases='$(TEST_LOGS)'; \
+ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+ bases=`echo $$bases`
+RECHECK_LOGS = $(TEST_LOGS)
+@DBUS_ENABLE_MODULAR_TESTS_TRUE@am__EXEEXT_8 = $(am__EXEEXT_3)
+TEST_SUITE_LOG = test-suite.log
+TEST_EXTENSIONS = @EXEEXT@ .test
+LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
+LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS)
+am__set_b = \
+ case '$@' in \
+ */*) \
+ case '$*' in \
+ */*) b='$*';; \
+ *) b=`echo '$@' | sed 's/\.log$$//'`; \
+ esac;; \
+ *) \
+ b='$*';; \
+ esac
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
+TEST_LOGS = $(am__test_logs2:.test.log=.log)
+TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
+TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
+ $(TEST_LOG_FLAGS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
@@ -304,7 +600,6 @@ 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@
DBUS_INT64_CONSTANT = @DBUS_INT64_CONSTANT@
@@ -315,7 +610,8 @@ DBUS_MICRO_VERSION = @DBUS_MICRO_VERSION@
DBUS_MINOR_VERSION = @DBUS_MINOR_VERSION@
DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@
DBUS_PREFIX = @DBUS_PREFIX@
-DBUS_SESSION_BUS_DEFAULT_ADDRESS = @DBUS_SESSION_BUS_DEFAULT_ADDRESS@
+DBUS_SESSION_BUS_CONNECT_ADDRESS = @DBUS_SESSION_BUS_CONNECT_ADDRESS@
+DBUS_SESSION_BUS_LISTEN_ADDRESS = @DBUS_SESSION_BUS_LISTEN_ADDRESS@
DBUS_SESSION_SOCKET_DIR = @DBUS_SESSION_SOCKET_DIR@
DBUS_STATIC_BUILD_CPPFLAGS = @DBUS_STATIC_BUILD_CPPFLAGS@
DBUS_SYSTEM_BUS_DEFAULT_ADDRESS = @DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@
@@ -364,8 +660,6 @@ LIBDBUS_LIBS = @LIBDBUS_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
-LIBXML_CFLAGS = @LIBXML_CFLAGS@
-LIBXML_LIBS = @LIBXML_LIBS@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
@@ -374,7 +668,6 @@ LT_CURRENT = @LT_CURRENT@
LT_REVISION = @LT_REVISION@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
-MAN2HTML = @MAN2HTML@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NETWORK_libs = @NETWORK_libs@
@@ -408,7 +701,6 @@ SHELL = @SHELL@
STRIP = @STRIP@
SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
SYSTEMD_LIBS = @SYSTEMD_LIBS@
-TEST_BUS_BINARY = @TEST_BUS_BINARY@
TEST_LAUNCH_HELPER_BINARY = @TEST_LAUNCH_HELPER_BINARY@
TEST_LISTEN = @TEST_LISTEN@
TEST_SOCKET_DIR = @TEST_SOCKET_DIR@
@@ -503,106 +795,150 @@ AM_LDFLAGS = @R_DYNAMIC_LDFLAG@
static_cppflags = \
$(AM_CPPFLAGS) \
-DDBUS_STATIC_BUILD \
+ -DDBUS_COMPILATION \
+ -DDBUS_TEST_USE_INTERNAL \
$(NULL)
-libdbus_testutils_la_CPPFLAGS = \
- $(static_cppflags)
+noinst_LTLIBRARIES = libdbus-testutils-internal.la $(am__append_1)
+@DBUS_WITH_DBUS_GLIB_TRUE@libdbus_testutils_la_SOURCES = \
+@DBUS_WITH_DBUS_GLIB_TRUE@ test-utils.c \
+@DBUS_WITH_DBUS_GLIB_TRUE@ test-utils.h \
+@DBUS_WITH_DBUS_GLIB_TRUE@ $(NULL)
+
+@DBUS_WITH_DBUS_GLIB_TRUE@libdbus_testutils_la_LIBADD = \
+@DBUS_WITH_DBUS_GLIB_TRUE@ $(top_builddir)/dbus/libdbus-1.la \
+@DBUS_WITH_DBUS_GLIB_TRUE@ $(GLIB_LIBS) \
+@DBUS_WITH_DBUS_GLIB_TRUE@ $(DBUS_GLIB_LIBS) \
+@DBUS_WITH_DBUS_GLIB_TRUE@ $(NULL)
+
+@DBUS_WITH_DBUS_GLIB_FALSE@testutils_shared_if_possible_cppflags = $(static_cppflags)
+@DBUS_WITH_DBUS_GLIB_TRUE@testutils_shared_if_possible_cppflags = $(AM_CPPFLAGS)
+@DBUS_WITH_DBUS_GLIB_FALSE@testutils_shared_if_possible_libs = libdbus-testutils-internal.la
+@DBUS_WITH_DBUS_GLIB_TRUE@testutils_shared_if_possible_libs = libdbus-testutils.la
+libdbus_testutils_internal_la_CPPFLAGS = \
+ $(static_cppflags) \
+ $(NULL)
-libdbus_testutils_la_SOURCES = \
+libdbus_testutils_internal_la_SOURCES = \
test-utils.c \
test-utils.h \
$(NULL)
-libdbus_testutils_la_LIBADD = \
+libdbus_testutils_internal_la_LIBADD = \
$(top_builddir)/dbus/libdbus-internal.la \
$(NULL)
-noinst_LTLIBRARIES = libdbus-testutils.la
-@DBUS_BUILD_TESTS_FALSE@TEST_BINARIES =
-@DBUS_BUILD_TESTS_TRUE@TEST_BINARIES = \
-@DBUS_BUILD_TESTS_TRUE@ spawn-test \
-@DBUS_BUILD_TESTS_TRUE@ test-exit \
-@DBUS_BUILD_TESTS_TRUE@ test-names \
-@DBUS_BUILD_TESTS_TRUE@ test-segfault \
-@DBUS_BUILD_TESTS_TRUE@ test-service \
-@DBUS_BUILD_TESTS_TRUE@ test-shell-service \
-@DBUS_BUILD_TESTS_TRUE@ test-sleep-forever \
-@DBUS_BUILD_TESTS_TRUE@ $(NULL)
+@DBUS_ENABLE_EMBEDDED_TESTS_FALSE@TEST_BINARIES =
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@TEST_BINARIES = \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-spawn \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-exit \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-names \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-segfault \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-service \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-shell-service \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-sleep-forever \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ $(NULL)
test_service_CPPFLAGS = $(static_cppflags)
-test_service_LDADD = libdbus-testutils.la
+test_service_LDADD = libdbus-testutils-internal.la
test_names_CPPFLAGS = $(static_cppflags)
-test_names_LDADD = libdbus-testutils.la
+test_names_LDADD = libdbus-testutils-internal.la
test_shell_service_CPPFLAGS = $(static_cppflags)
-test_shell_service_LDADD = libdbus-testutils.la
-shell_test_CPPFLAGS = $(static_cppflags)
-shell_test_LDADD = libdbus-testutils.la
-spawn_test_CPPFLAGS = $(static_cppflags)
-spawn_test_LDADD = $(top_builddir)/dbus/libdbus-internal.la
+test_shell_service_LDADD = libdbus-testutils-internal.la
+test_shell_SOURCES = shell-test.c
+test_shell_CPPFLAGS = $(static_cppflags)
+test_shell_LDADD = libdbus-testutils-internal.la
+test_spawn_SOURCES = spawn-test.c
+test_spawn_CPPFLAGS = $(static_cppflags)
+test_spawn_LDADD = $(top_builddir)/dbus/libdbus-internal.la
+test_printf_SOURCES = internals/printf.c
+test_printf_CPPFLAGS = $(static_cppflags)
+test_printf_LDADD = $(top_builddir)/dbus/libdbus-internal.la
test_refs_SOURCES = internals/refs.c
test_refs_CPPFLAGS = $(static_cppflags)
-test_refs_LDADD = libdbus-testutils.la $(GLIB_LIBS)
+test_refs_LDADD = libdbus-testutils-internal.la $(GLIB_LIBS)
test_syslog_SOURCES = internals/syslog.c
test_syslog_CPPFLAGS = $(static_cppflags)
-test_syslog_LDADD = libdbus-testutils.la $(GLIB_LIBS)
+test_syslog_LDADD = libdbus-testutils-internal.la $(GLIB_LIBS)
EXTRA_DIST = dbus-test-runner $(in_data) $(static_data)
testexecdir = $(libdir)/dbus-1.0/test
-installable_tests = shell-test $(NULL) $(am__append_2)
-installcheck_tests = $(am__append_4)
+installable_tests = test-shell test-printf $(NULL) $(am__append_3)
+installable_manual_tests = $(NULL) $(am__append_4)
+installcheck_tests = $(am__append_6)
installcheck_environment = \
+ XDG_RUNTIME_DIR=@abs_top_builddir@/test/XDG_RUNTIME_DIR \
DBUS_TEST_DAEMON=$(DESTDIR)$(DBUS_DAEMONDIR)/dbus-daemon$(EXEEXT) \
DBUS_TEST_HOMEDIR=@abs_top_builddir@/dbus \
DBUS_TEST_SYSCONFDIR=$(DESTDIR)$(sysconfdir)
TESTS_ENVIRONMENT = \
- DBUS_BLOCK_ON_ABORT=1 \
+ XDG_RUNTIME_DIR=@abs_top_builddir@/test/XDG_RUNTIME_DIR \
DBUS_FATAL_WARNINGS=1 \
DBUS_TEST_DAEMON=@abs_top_builddir@/bus/dbus-daemon$(EXEEXT) \
DBUS_TEST_DATA=@abs_top_builddir@/test/data \
DBUS_TEST_HOMEDIR=@abs_top_builddir@/dbus \
$(NULL)
+manual_authz_SOURCES = manual-authz.c
+manual_authz_CPPFLAGS = $(testutils_shared_if_possible_cppflags)
+manual_authz_LDADD = \
+ $(testutils_shared_if_possible_libs) \
+ $(GLIB_LIBS) \
+ $(NULL)
+
test_corrupt_SOURCES = corrupt.c
-test_corrupt_LDADD = $(top_builddir)/dbus/libdbus-1.la \
+test_corrupt_CPPFLAGS = $(testutils_shared_if_possible_cppflags)
+test_corrupt_LDADD = \
+ $(testutils_shared_if_possible_libs) \
$(GLIB_LIBS) \
- $(DBUS_GLIB_LIBS)
+ $(NULL)
test_loopback_SOURCES = loopback.c
-test_loopback_LDADD = $(top_builddir)/dbus/libdbus-1.la \
+test_loopback_CPPFLAGS = $(testutils_shared_if_possible_cppflags)
+test_loopback_LDADD = \
+ $(testutils_shared_if_possible_libs) \
$(GLIB_LIBS) \
- $(DBUS_GLIB_LIBS)
+ $(NULL)
test_relay_SOURCES = relay.c
-test_relay_LDADD = $(top_builddir)/dbus/libdbus-1.la \
+test_relay_CPPFLAGS = $(testutils_shared_if_possible_cppflags)
+test_relay_LDADD = \
+ $(testutils_shared_if_possible_libs) \
$(GLIB_LIBS) \
- $(DBUS_GLIB_LIBS)
+ $(NULL)
test_dbus_daemon_SOURCES = dbus-daemon.c
-test_dbus_daemon_LDADD = $(top_builddir)/dbus/libdbus-1.la \
+test_dbus_daemon_CPPFLAGS = $(testutils_shared_if_possible_cppflags)
+test_dbus_daemon_LDADD = \
+ $(testutils_shared_if_possible_libs) \
$(GLIB_LIBS) \
- $(DBUS_GLIB_LIBS)
+ $(NULL)
test_dbus_daemon_eavesdrop_SOURCES = dbus-daemon-eavesdrop.c
-test_dbus_daemon_eavesdrop_CPPFLAGS = $(GLIB_CFLAGS) $(DBUS_GLIB_CFLAGS)
-test_dbus_daemon_eavesdrop_LDFLAGS = @R_DYNAMIC_LDFLAG@
-test_dbus_daemon_eavesdrop_LDADD = $(top_builddir)/dbus/libdbus-1.la \
+test_dbus_daemon_eavesdrop_CPPFLAGS = $(testutils_shared_if_possible_cppflags)
+test_dbus_daemon_eavesdrop_LDADD = \
+ $(testutils_shared_if_possible_libs) \
$(GLIB_LIBS) \
- $(DBUS_GLIB_LIBS)
+ $(NULL)
test_marshal_SOURCES = marshal.c
-test_marshal_LDADD = $(top_builddir)/dbus/libdbus-1.la \
+test_marshal_LDADD = \
+ $(top_builddir)/dbus/libdbus-1.la \
$(GLIB_LIBS) \
- $(DBUS_GLIB_LIBS)
+ $(NULL)
test_syntax_SOURCES = syntax.c
-test_syntax_LDADD = $(top_builddir)/dbus/libdbus-1.la \
- $(GLIB_LIBS)
+test_syntax_LDADD = \
+ $(top_builddir)/dbus/libdbus-1.la \
+ $(GLIB_LIBS) \
+ $(NULL)
in_data = \
data/valid-config-files-system/debug-allow-all-fail.conf.in \
data/valid-config-files-system/debug-allow-all-pass.conf.in \
data/valid-config-files/debug-allow-all-sha1.conf.in \
data/valid-config-files/debug-allow-all.conf.in \
+ data/valid-config-files/incoming-limit.conf.in \
data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoExec.service.in \
data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoService.service.in \
data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoUser.service.in \
@@ -672,7 +1008,6 @@ static_data = \
data/valid-config-files/basic.conf \
data/valid-config-files/basic.d/basic.conf \
data/valid-config-files/entities.conf \
- data/valid-config-files/incoming-limit.conf \
data/valid-config-files/many-rules.conf \
data/valid-config-files/system.d/test.conf \
data/valid-messages/array-of-array-of-uint32.message \
@@ -698,11 +1033,11 @@ imported_data = \
$(NULL)
noinst_DATA = $(imported_data)
-CLEANFILES = $(noinst_DATA)
+CLEANFILES = $(noinst_DATA) XDG_RUNTIME_DIR
all: all-recursive
.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
+.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
@@ -736,14 +1071,20 @@ $(am__aclocal_m4_deps):
clean-noinstLTLIBRARIES:
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
- dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
- test "$$dir" != "$$p" || dir=.; \
- echo "rm -f \"$${dir}/so_locations\""; \
- rm -f "$${dir}/so_locations"; \
- done
+ @list='$(noinst_LTLIBRARIES)'; \
+ locs=`for p in $$list; do echo $$p; done | \
+ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+ sort -u`; \
+ test -z "$$locs" || { \
+ echo rm -f $${locs}; \
+ rm -f $${locs}; \
+ }
+
+libdbus-testutils-internal.la: $(libdbus_testutils_internal_la_OBJECTS) $(libdbus_testutils_internal_la_DEPENDENCIES) $(EXTRA_libdbus_testutils_internal_la_DEPENDENCIES)
+ $(AM_V_CCLD)$(LINK) $(libdbus_testutils_internal_la_OBJECTS) $(libdbus_testutils_internal_la_LIBADD) $(LIBS)
+
libdbus-testutils.la: $(libdbus_testutils_la_OBJECTS) $(libdbus_testutils_la_DEPENDENCIES) $(EXTRA_libdbus_testutils_la_DEPENDENCIES)
- $(AM_V_CCLD)$(LINK) $(libdbus_testutils_la_OBJECTS) $(libdbus_testutils_la_LIBADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(am_libdbus_testutils_la_rpath) $(libdbus_testutils_la_OBJECTS) $(libdbus_testutils_la_LIBADD) $(LIBS)
clean-noinstPROGRAMS:
@list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
@@ -762,10 +1103,12 @@ install-testexecPROGRAMS: $(testexec_PROGRAMS)
fi; \
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; \
+ 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|.*|.|' \
+ 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 } \
@@ -786,7 +1129,8 @@ uninstall-testexecPROGRAMS:
@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)/' `; \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(testexecdir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(testexecdir)" && rm -f $$files
@@ -799,54 +1143,79 @@ clean-testexecPROGRAMS:
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) $(EXTRA_shell_test_DEPENDENCIES)
- @rm -f shell-test$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(shell_test_OBJECTS) $(shell_test_LDADD) $(LIBS)
-spawn-test$(EXEEXT): $(spawn_test_OBJECTS) $(spawn_test_DEPENDENCIES) $(EXTRA_spawn_test_DEPENDENCIES)
- @rm -f spawn-test$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(spawn_test_OBJECTS) $(spawn_test_LDADD) $(LIBS)
+
+manual-authz$(EXEEXT): $(manual_authz_OBJECTS) $(manual_authz_DEPENDENCIES) $(EXTRA_manual_authz_DEPENDENCIES)
+ @rm -f manual-authz$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(manual_authz_OBJECTS) $(manual_authz_LDADD) $(LIBS)
+
test-corrupt$(EXEEXT): $(test_corrupt_OBJECTS) $(test_corrupt_DEPENDENCIES) $(EXTRA_test_corrupt_DEPENDENCIES)
@rm -f test-corrupt$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_corrupt_OBJECTS) $(test_corrupt_LDADD) $(LIBS)
+
test-dbus-daemon$(EXEEXT): $(test_dbus_daemon_OBJECTS) $(test_dbus_daemon_DEPENDENCIES) $(EXTRA_test_dbus_daemon_DEPENDENCIES)
@rm -f test-dbus-daemon$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_dbus_daemon_OBJECTS) $(test_dbus_daemon_LDADD) $(LIBS)
+
test-dbus-daemon-eavesdrop$(EXEEXT): $(test_dbus_daemon_eavesdrop_OBJECTS) $(test_dbus_daemon_eavesdrop_DEPENDENCIES) $(EXTRA_test_dbus_daemon_eavesdrop_DEPENDENCIES)
@rm -f test-dbus-daemon-eavesdrop$(EXEEXT)
- $(AM_V_CCLD)$(test_dbus_daemon_eavesdrop_LINK) $(test_dbus_daemon_eavesdrop_OBJECTS) $(test_dbus_daemon_eavesdrop_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_dbus_daemon_eavesdrop_OBJECTS) $(test_dbus_daemon_eavesdrop_LDADD) $(LIBS)
+
test-exit$(EXEEXT): $(test_exit_OBJECTS) $(test_exit_DEPENDENCIES) $(EXTRA_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) $(EXTRA_test_loopback_DEPENDENCIES)
@rm -f test-loopback$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_loopback_OBJECTS) $(test_loopback_LDADD) $(LIBS)
+
test-marshal$(EXEEXT): $(test_marshal_OBJECTS) $(test_marshal_DEPENDENCIES) $(EXTRA_test_marshal_DEPENDENCIES)
@rm -f test-marshal$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_marshal_OBJECTS) $(test_marshal_LDADD) $(LIBS)
+
test-names$(EXEEXT): $(test_names_OBJECTS) $(test_names_DEPENDENCIES) $(EXTRA_test_names_DEPENDENCIES)
@rm -f test-names$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_names_OBJECTS) $(test_names_LDADD) $(LIBS)
+
+test-printf$(EXEEXT): $(test_printf_OBJECTS) $(test_printf_DEPENDENCIES) $(EXTRA_test_printf_DEPENDENCIES)
+ @rm -f test-printf$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_printf_OBJECTS) $(test_printf_LDADD) $(LIBS)
+
test-refs$(EXEEXT): $(test_refs_OBJECTS) $(test_refs_DEPENDENCIES) $(EXTRA_test_refs_DEPENDENCIES)
@rm -f test-refs$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_refs_OBJECTS) $(test_refs_LDADD) $(LIBS)
+
test-relay$(EXEEXT): $(test_relay_OBJECTS) $(test_relay_DEPENDENCIES) $(EXTRA_test_relay_DEPENDENCIES)
@rm -f test-relay$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_relay_OBJECTS) $(test_relay_LDADD) $(LIBS)
+
test-segfault$(EXEEXT): $(test_segfault_OBJECTS) $(test_segfault_DEPENDENCIES) $(EXTRA_test_segfault_DEPENDENCIES)
@rm -f test-segfault$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_segfault_OBJECTS) $(test_segfault_LDADD) $(LIBS)
+
test-service$(EXEEXT): $(test_service_OBJECTS) $(test_service_DEPENDENCIES) $(EXTRA_test_service_DEPENDENCIES)
@rm -f test-service$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_service_OBJECTS) $(test_service_LDADD) $(LIBS)
+
+test-shell$(EXEEXT): $(test_shell_OBJECTS) $(test_shell_DEPENDENCIES) $(EXTRA_test_shell_DEPENDENCIES)
+ @rm -f test-shell$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_shell_OBJECTS) $(test_shell_LDADD) $(LIBS)
+
test-shell-service$(EXEEXT): $(test_shell_service_OBJECTS) $(test_shell_service_DEPENDENCIES) $(EXTRA_test_shell_service_DEPENDENCIES)
@rm -f test-shell-service$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_shell_service_OBJECTS) $(test_shell_service_LDADD) $(LIBS)
+
test-sleep-forever$(EXEEXT): $(test_sleep_forever_OBJECTS) $(test_sleep_forever_DEPENDENCIES) $(EXTRA_test_sleep_forever_DEPENDENCIES)
@rm -f test-sleep-forever$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_sleep_forever_OBJECTS) $(test_sleep_forever_LDADD) $(LIBS)
+
+test-spawn$(EXEEXT): $(test_spawn_OBJECTS) $(test_spawn_DEPENDENCIES) $(EXTRA_test_spawn_DEPENDENCIES)
+ @rm -f test-spawn$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_spawn_OBJECTS) $(test_spawn_LDADD) $(LIBS)
+
test-syntax$(EXEEXT): $(test_syntax_OBJECTS) $(test_syntax_DEPENDENCIES) $(EXTRA_test_syntax_DEPENDENCIES)
@rm -f test-syntax$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_syntax_OBJECTS) $(test_syntax_LDADD) $(LIBS)
+
test-syslog$(EXEEXT): $(test_syslog_OBJECTS) $(test_syslog_DEPENDENCIES) $(EXTRA_test_syslog_DEPENDENCIES)
@rm -f test-syslog$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_syslog_OBJECTS) $(test_syslog_LDADD) $(LIBS)
@@ -857,23 +1226,26 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/corrupt.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-daemon.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_testutils_la-test-utils.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loopback.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbus_testutils_internal_la-test-utils.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/manual_authz-manual-authz.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/marshal.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/relay.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shell_test-shell-test.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawn_test-spawn-test.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/syntax.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-exit.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-segfault.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_dbus_daemon_eavesdrop-dbus-daemon-eavesdrop.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_loopback-loopback.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_names-test-names.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_printf-printf.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_refs-refs.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_relay-relay.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_service-test-service.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_shell-shell-test.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_shell_service-test-shell-service.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_spawn-spawn-test.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_syslog-syslog.Po@am__quote@
.c.o:
@@ -881,14 +1253,14 @@ distclean-compile:
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -897,40 +1269,54 @@ distclean-compile:
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-libdbus_testutils_la-test-utils.lo: test-utils.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_testutils_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_testutils_la-test-utils.lo -MD -MP -MF $(DEPDIR)/libdbus_testutils_la-test-utils.Tpo -c -o libdbus_testutils_la-test-utils.lo `test -f 'test-utils.c' || echo '$(srcdir)/'`test-utils.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_testutils_la-test-utils.Tpo $(DEPDIR)/libdbus_testutils_la-test-utils.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-utils.c' object='libdbus_testutils_la-test-utils.lo' libtool=yes @AMDEPBACKSLASH@
+libdbus_testutils_internal_la-test-utils.lo: test-utils.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_testutils_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdbus_testutils_internal_la-test-utils.lo -MD -MP -MF $(DEPDIR)/libdbus_testutils_internal_la-test-utils.Tpo -c -o libdbus_testutils_internal_la-test-utils.lo `test -f 'test-utils.c' || echo '$(srcdir)/'`test-utils.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdbus_testutils_internal_la-test-utils.Tpo $(DEPDIR)/libdbus_testutils_internal_la-test-utils.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-utils.c' object='libdbus_testutils_internal_la-test-utils.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_testutils_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_testutils_internal_la-test-utils.lo `test -f 'test-utils.c' || echo '$(srcdir)/'`test-utils.c
+
+manual_authz-manual-authz.o: manual-authz.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(manual_authz_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT manual_authz-manual-authz.o -MD -MP -MF $(DEPDIR)/manual_authz-manual-authz.Tpo -c -o manual_authz-manual-authz.o `test -f 'manual-authz.c' || echo '$(srcdir)/'`manual-authz.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/manual_authz-manual-authz.Tpo $(DEPDIR)/manual_authz-manual-authz.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='manual-authz.c' object='manual_authz-manual-authz.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(manual_authz_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o manual_authz-manual-authz.o `test -f 'manual-authz.c' || echo '$(srcdir)/'`manual-authz.c
+
+manual_authz-manual-authz.obj: manual-authz.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(manual_authz_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT manual_authz-manual-authz.obj -MD -MP -MF $(DEPDIR)/manual_authz-manual-authz.Tpo -c -o manual_authz-manual-authz.obj `if test -f 'manual-authz.c'; then $(CYGPATH_W) 'manual-authz.c'; else $(CYGPATH_W) '$(srcdir)/manual-authz.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/manual_authz-manual-authz.Tpo $(DEPDIR)/manual_authz-manual-authz.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='manual-authz.c' object='manual_authz-manual-authz.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdbus_testutils_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdbus_testutils_la-test-utils.lo `test -f 'test-utils.c' || echo '$(srcdir)/'`test-utils.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(manual_authz_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o manual_authz-manual-authz.obj `if test -f 'manual-authz.c'; then $(CYGPATH_W) 'manual-authz.c'; else $(CYGPATH_W) '$(srcdir)/manual-authz.c'; fi`
-shell_test-shell-test.o: shell-test.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(shell_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT shell_test-shell-test.o -MD -MP -MF $(DEPDIR)/shell_test-shell-test.Tpo -c -o shell_test-shell-test.o `test -f 'shell-test.c' || echo '$(srcdir)/'`shell-test.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/shell_test-shell-test.Tpo $(DEPDIR)/shell_test-shell-test.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shell-test.c' object='shell_test-shell-test.o' libtool=no @AMDEPBACKSLASH@
+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
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='corrupt.c' object='test_corrupt-corrupt.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(shell_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o shell_test-shell-test.o `test -f 'shell-test.c' || echo '$(srcdir)/'`shell-test.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(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
-shell_test-shell-test.obj: shell-test.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(shell_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT shell_test-shell-test.obj -MD -MP -MF $(DEPDIR)/shell_test-shell-test.Tpo -c -o shell_test-shell-test.obj `if test -f 'shell-test.c'; then $(CYGPATH_W) 'shell-test.c'; else $(CYGPATH_W) '$(srcdir)/shell-test.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/shell_test-shell-test.Tpo $(DEPDIR)/shell_test-shell-test.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shell-test.c' object='shell_test-shell-test.obj' libtool=no @AMDEPBACKSLASH@
+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
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='corrupt.c' object='test_corrupt-corrupt.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(shell_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o shell_test-shell-test.obj `if test -f 'shell-test.c'; then $(CYGPATH_W) 'shell-test.c'; else $(CYGPATH_W) '$(srcdir)/shell-test.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(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`
-spawn_test-spawn-test.o: spawn-test.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(spawn_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spawn_test-spawn-test.o -MD -MP -MF $(DEPDIR)/spawn_test-spawn-test.Tpo -c -o spawn_test-spawn-test.o `test -f 'spawn-test.c' || echo '$(srcdir)/'`spawn-test.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/spawn_test-spawn-test.Tpo $(DEPDIR)/spawn_test-spawn-test.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='spawn-test.c' object='spawn_test-spawn-test.o' libtool=no @AMDEPBACKSLASH@
+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
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)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@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(spawn_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spawn_test-spawn-test.o `test -f 'spawn-test.c' || echo '$(srcdir)/'`spawn-test.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(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
-spawn_test-spawn-test.obj: spawn-test.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(spawn_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spawn_test-spawn-test.obj -MD -MP -MF $(DEPDIR)/spawn_test-spawn-test.Tpo -c -o spawn_test-spawn-test.obj `if test -f 'spawn-test.c'; then $(CYGPATH_W) 'spawn-test.c'; else $(CYGPATH_W) '$(srcdir)/spawn-test.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/spawn_test-spawn-test.Tpo $(DEPDIR)/spawn_test-spawn-test.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='spawn-test.c' object='spawn_test-spawn-test.obj' libtool=no @AMDEPBACKSLASH@
+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
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)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@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(spawn_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spawn_test-spawn-test.obj `if test -f 'spawn-test.c'; then $(CYGPATH_W) 'spawn-test.c'; else $(CYGPATH_W) '$(srcdir)/spawn-test.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(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_dbus_daemon_eavesdrop-dbus-daemon-eavesdrop.o: dbus-daemon-eavesdrop.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_dbus_daemon_eavesdrop_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_dbus_daemon_eavesdrop-dbus-daemon-eavesdrop.o -MD -MP -MF $(DEPDIR)/test_dbus_daemon_eavesdrop-dbus-daemon-eavesdrop.Tpo -c -o test_dbus_daemon_eavesdrop-dbus-daemon-eavesdrop.o `test -f 'dbus-daemon-eavesdrop.c' || echo '$(srcdir)/'`dbus-daemon-eavesdrop.c
@@ -946,6 +1332,20 @@ test_dbus_daemon_eavesdrop-dbus-daemon-eavesdrop.obj: dbus-daemon-eavesdrop.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_dbus_daemon_eavesdrop_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_dbus_daemon_eavesdrop-dbus-daemon-eavesdrop.obj `if test -f 'dbus-daemon-eavesdrop.c'; then $(CYGPATH_W) 'dbus-daemon-eavesdrop.c'; else $(CYGPATH_W) '$(srcdir)/dbus-daemon-eavesdrop.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
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='loopback.c' object='test_loopback-loopback.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(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
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='loopback.c' object='test_loopback-loopback.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(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_names-test-names.o: test-names.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_names_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_names-test-names.o -MD -MP -MF $(DEPDIR)/test_names-test-names.Tpo -c -o test_names-test-names.o `test -f 'test-names.c' || echo '$(srcdir)/'`test-names.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_names-test-names.Tpo $(DEPDIR)/test_names-test-names.Po
@@ -960,6 +1360,20 @@ test_names-test-names.obj: test-names.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_names_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_names-test-names.obj `if test -f 'test-names.c'; then $(CYGPATH_W) 'test-names.c'; else $(CYGPATH_W) '$(srcdir)/test-names.c'; fi`
+test_printf-printf.o: internals/printf.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_printf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_printf-printf.o -MD -MP -MF $(DEPDIR)/test_printf-printf.Tpo -c -o test_printf-printf.o `test -f 'internals/printf.c' || echo '$(srcdir)/'`internals/printf.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_printf-printf.Tpo $(DEPDIR)/test_printf-printf.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='internals/printf.c' object='test_printf-printf.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_printf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_printf-printf.o `test -f 'internals/printf.c' || echo '$(srcdir)/'`internals/printf.c
+
+test_printf-printf.obj: internals/printf.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_printf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_printf-printf.obj -MD -MP -MF $(DEPDIR)/test_printf-printf.Tpo -c -o test_printf-printf.obj `if test -f 'internals/printf.c'; then $(CYGPATH_W) 'internals/printf.c'; else $(CYGPATH_W) '$(srcdir)/internals/printf.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_printf-printf.Tpo $(DEPDIR)/test_printf-printf.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='internals/printf.c' object='test_printf-printf.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_printf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_printf-printf.obj `if test -f 'internals/printf.c'; then $(CYGPATH_W) 'internals/printf.c'; else $(CYGPATH_W) '$(srcdir)/internals/printf.c'; fi`
+
test_refs-refs.o: internals/refs.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_refs_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_refs-refs.o -MD -MP -MF $(DEPDIR)/test_refs-refs.Tpo -c -o test_refs-refs.o `test -f 'internals/refs.c' || echo '$(srcdir)/'`internals/refs.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_refs-refs.Tpo $(DEPDIR)/test_refs-refs.Po
@@ -974,6 +1388,20 @@ test_refs-refs.obj: internals/refs.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_refs_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_refs-refs.obj `if test -f 'internals/refs.c'; then $(CYGPATH_W) 'internals/refs.c'; else $(CYGPATH_W) '$(srcdir)/internals/refs.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
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='relay.c' object='test_relay-relay.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(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
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='relay.c' object='test_relay-relay.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(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`
+
test_service-test-service.o: test-service.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_service_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_service-test-service.o -MD -MP -MF $(DEPDIR)/test_service-test-service.Tpo -c -o test_service-test-service.o `test -f 'test-service.c' || echo '$(srcdir)/'`test-service.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_service-test-service.Tpo $(DEPDIR)/test_service-test-service.Po
@@ -988,6 +1416,20 @@ test_service-test-service.obj: test-service.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_service_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_service-test-service.obj `if test -f 'test-service.c'; then $(CYGPATH_W) 'test-service.c'; else $(CYGPATH_W) '$(srcdir)/test-service.c'; fi`
+test_shell-shell-test.o: shell-test.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_shell_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_shell-shell-test.o -MD -MP -MF $(DEPDIR)/test_shell-shell-test.Tpo -c -o test_shell-shell-test.o `test -f 'shell-test.c' || echo '$(srcdir)/'`shell-test.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_shell-shell-test.Tpo $(DEPDIR)/test_shell-shell-test.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shell-test.c' object='test_shell-shell-test.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_shell_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_shell-shell-test.o `test -f 'shell-test.c' || echo '$(srcdir)/'`shell-test.c
+
+test_shell-shell-test.obj: shell-test.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_shell_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_shell-shell-test.obj -MD -MP -MF $(DEPDIR)/test_shell-shell-test.Tpo -c -o test_shell-shell-test.obj `if test -f 'shell-test.c'; then $(CYGPATH_W) 'shell-test.c'; else $(CYGPATH_W) '$(srcdir)/shell-test.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_shell-shell-test.Tpo $(DEPDIR)/test_shell-shell-test.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shell-test.c' object='test_shell-shell-test.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_shell_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_shell-shell-test.obj `if test -f 'shell-test.c'; then $(CYGPATH_W) 'shell-test.c'; else $(CYGPATH_W) '$(srcdir)/shell-test.c'; fi`
+
test_shell_service-test-shell-service.o: test-shell-service.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_shell_service_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_shell_service-test-shell-service.o -MD -MP -MF $(DEPDIR)/test_shell_service-test-shell-service.Tpo -c -o test_shell_service-test-shell-service.o `test -f 'test-shell-service.c' || echo '$(srcdir)/'`test-shell-service.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_shell_service-test-shell-service.Tpo $(DEPDIR)/test_shell_service-test-shell-service.Po
@@ -1002,6 +1444,20 @@ test_shell_service-test-shell-service.obj: test-shell-service.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_shell_service_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_shell_service-test-shell-service.obj `if test -f 'test-shell-service.c'; then $(CYGPATH_W) 'test-shell-service.c'; else $(CYGPATH_W) '$(srcdir)/test-shell-service.c'; fi`
+test_spawn-spawn-test.o: spawn-test.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_spawn_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_spawn-spawn-test.o -MD -MP -MF $(DEPDIR)/test_spawn-spawn-test.Tpo -c -o test_spawn-spawn-test.o `test -f 'spawn-test.c' || echo '$(srcdir)/'`spawn-test.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_spawn-spawn-test.Tpo $(DEPDIR)/test_spawn-spawn-test.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='spawn-test.c' object='test_spawn-spawn-test.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_spawn_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_spawn-spawn-test.o `test -f 'spawn-test.c' || echo '$(srcdir)/'`spawn-test.c
+
+test_spawn-spawn-test.obj: spawn-test.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_spawn_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_spawn-spawn-test.obj -MD -MP -MF $(DEPDIR)/test_spawn-spawn-test.Tpo -c -o test_spawn-spawn-test.obj `if test -f 'spawn-test.c'; then $(CYGPATH_W) 'spawn-test.c'; else $(CYGPATH_W) '$(srcdir)/spawn-test.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_spawn-spawn-test.Tpo $(DEPDIR)/test_spawn-spawn-test.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='spawn-test.c' object='test_spawn-spawn-test.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_spawn_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_spawn-spawn-test.obj `if test -f 'spawn-test.c'; then $(CYGPATH_W) 'spawn-test.c'; else $(CYGPATH_W) '$(srcdir)/spawn-test.c'; fi`
+
test_syslog-syslog.o: internals/syslog.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_syslog_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_syslog-syslog.o -MD -MP -MF $(DEPDIR)/test_syslog-syslog.Tpo -c -o test_syslog-syslog.o `test -f 'internals/syslog.c' || echo '$(srcdir)/'`internals/syslog.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_syslog-syslog.Tpo $(DEPDIR)/test_syslog-syslog.Po
@@ -1023,22 +1479,25 @@ clean-libtool:
-rm -rf .libs _libs
# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-# (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
- @fail= failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+# (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+ @fail=; \
+ if $(am__make_keepgoing); then \
+ failcom='fail=yes'; \
+ else \
+ failcom='exit 1'; \
+ fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
@@ -1053,57 +1512,12 @@ $(RECURSIVE_TARGETS):
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
-$(RECURSIVE_CLEAN_TARGETS):
- @fail= failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- case "$@" in \
- distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
- *) list='$(SUBDIRS)' ;; \
- esac; \
- rev=''; for subdir in $$list; do \
- if test "$$subdir" = "."; then :; else \
- rev="$$subdir $$rev"; \
- fi; \
- done; \
- rev="$$rev ."; \
- target=`echo $@ | sed s/-recursive//`; \
- for subdir in $$rev; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done && test -z "$$fail"
-tags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
- done
-ctags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
- done
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
@@ -1119,12 +1533,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
+ $(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
@@ -1136,15 +1545,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$$unique; \
fi; \
fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
@@ -1153,102 +1558,285 @@ GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-check-TESTS: $(TESTS)
- @failed=0; all=0; xfail=0; xpass=0; skip=0; \
- srcdir=$(srcdir); export srcdir; \
- list=' $(TESTS) '; \
- $(am__tty_colors); \
- if test -n "$$list"; then \
- for tst in $$list; do \
- if test -f ./$$tst; then dir=./; \
- elif test -f $$tst; then dir=; \
- else dir="$(srcdir)/"; fi; \
- if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
- all=`expr $$all + 1`; \
- case " $(XFAIL_TESTS) " in \
- *[\ \ ]$$tst[\ \ ]*) \
- xpass=`expr $$xpass + 1`; \
- failed=`expr $$failed + 1`; \
- col=$$red; res=XPASS; \
- ;; \
- *) \
- col=$$grn; res=PASS; \
- ;; \
- esac; \
- elif test $$? -ne 77; then \
- all=`expr $$all + 1`; \
- case " $(XFAIL_TESTS) " in \
- *[\ \ ]$$tst[\ \ ]*) \
- xfail=`expr $$xfail + 1`; \
- col=$$lgn; res=XFAIL; \
- ;; \
- *) \
- failed=`expr $$failed + 1`; \
- col=$$red; res=FAIL; \
- ;; \
- esac; \
- else \
- skip=`expr $$skip + 1`; \
- col=$$blu; res=SKIP; \
- fi; \
- echo "$${col}$$res$${std}: $$tst"; \
- done; \
- if test "$$all" -eq 1; then \
- tests="test"; \
- All=""; \
- else \
- tests="tests"; \
- All="All "; \
+# Recover from deleted '.trs' file; this should ensure that
+# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
+# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells
+# to avoid problems with "make -n".
+.log.trs:
+ rm -f $< $@
+ $(MAKE) $(AM_MAKEFLAGS) $<
+
+# Leading 'am--fnord' is there to ensure the list of targets does not
+# expand to empty, as could happen e.g. with make check TESTS=''.
+am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
+am--force-recheck:
+ @:
+
+$(TEST_SUITE_LOG): $(TEST_LOGS)
+ @$(am__set_TESTS_bases); \
+ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
+ redo_bases=`for i in $$bases; do \
+ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
+ done`; \
+ if test -n "$$redo_bases"; then \
+ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
+ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
+ if $(am__make_dryrun); then :; else \
+ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
fi; \
- if test "$$failed" -eq 0; then \
- if test "$$xfail" -eq 0; then \
- banner="$$All$$all $$tests passed"; \
- else \
- if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
- banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
- fi; \
- else \
- if test "$$xpass" -eq 0; then \
- banner="$$failed of $$all $$tests failed"; \
+ fi; \
+ if test -n "$$am__remaking_logs"; then \
+ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
+ "recursion detected" >&2; \
+ else \
+ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
+ fi; \
+ if $(am__make_dryrun); then :; else \
+ st=0; \
+ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
+ for i in $$redo_bases; do \
+ test -f $$i.trs && test -r $$i.trs \
+ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
+ test -f $$i.log && test -r $$i.log \
+ || { echo "$$errmsg $$i.log" >&2; st=1; }; \
+ done; \
+ test $$st -eq 0 || exit 1; \
+ fi
+ @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+ ws='[ ]'; \
+ results=`for b in $$bases; do echo $$b.trs; done`; \
+ test -n "$$results" || results=/dev/null; \
+ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
+ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
+ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
+ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
+ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+ if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+ success=true; \
+ else \
+ success=false; \
+ fi; \
+ br='==================='; br=$$br$$br$$br$$br; \
+ result_count () \
+ { \
+ if test x"$$1" = x"--maybe-color"; then \
+ maybe_colorize=yes; \
+ elif test x"$$1" = x"--no-color"; then \
+ maybe_colorize=no; \
else \
- if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
- banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
+ echo "$@: invalid 'result_count' usage" >&2; exit 4; \
fi; \
- fi; \
- dashes="$$banner"; \
- skipped=""; \
- if test "$$skip" -ne 0; then \
- if test "$$skip" -eq 1; then \
- skipped="($$skip test was not run)"; \
+ shift; \
+ desc=$$1 count=$$2; \
+ if test $$maybe_colorize = yes && test $$count -gt 0; then \
+ color_start=$$3 color_end=$$std; \
else \
- skipped="($$skip tests were not run)"; \
+ color_start= color_end=; \
fi; \
- test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
- dashes="$$skipped"; \
- fi; \
- report=""; \
- if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
- report="Please report to $(PACKAGE_BUGREPORT)"; \
- test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
- dashes="$$report"; \
- fi; \
- dashes=`echo "$$dashes" | sed s/./=/g`; \
- if test "$$failed" -eq 0; then \
- col="$$grn"; \
- else \
- col="$$red"; \
- fi; \
- echo "$${col}$$dashes$${std}"; \
- echo "$${col}$$banner$${std}"; \
- test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
- test -z "$$report" || echo "$${col}$$report$${std}"; \
- echo "$${col}$$dashes$${std}"; \
- test "$$failed" -eq 0; \
- else :; fi
+ echo "$${color_start}# $$desc $$count$${color_end}"; \
+ }; \
+ create_testsuite_report () \
+ { \
+ result_count $$1 "TOTAL:" $$all "$$brg"; \
+ result_count $$1 "PASS: " $$pass "$$grn"; \
+ result_count $$1 "SKIP: " $$skip "$$blu"; \
+ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+ result_count $$1 "FAIL: " $$fail "$$red"; \
+ result_count $$1 "XPASS:" $$xpass "$$red"; \
+ result_count $$1 "ERROR:" $$error "$$mgn"; \
+ }; \
+ { \
+ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
+ $(am__rst_title); \
+ create_testsuite_report --no-color; \
+ echo; \
+ echo ".. contents:: :depth: 2"; \
+ echo; \
+ for b in $$bases; do echo $$b; done \
+ | $(am__create_global_log); \
+ } >$(TEST_SUITE_LOG).tmp || exit 1; \
+ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
+ if $$success; then \
+ col="$$grn"; \
+ else \
+ col="$$red"; \
+ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
+ fi; \
+ echo "$${col}$$br$${std}"; \
+ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
+ echo "$${col}$$br$${std}"; \
+ create_testsuite_report --maybe-color; \
+ echo "$$col$$br$$std"; \
+ if $$success; then :; else \
+ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
+ if test -n "$(PACKAGE_BUGREPORT)"; then \
+ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
+ fi; \
+ echo "$$col$$br$$std"; \
+ fi; \
+ $$success || exit 1
+
+check-TESTS:
+ @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
+ @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ trs_list=`for i in $$bases; do echo $$i.trs; done`; \
+ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
+ exit $$?;
+recheck: all
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ bases=`for i in $$bases; do echo $$i; done \
+ | $(am__list_recheck_tests)` || exit 1; \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ log_list=`echo $$log_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
+ am__force_recheck=am--force-recheck \
+ TEST_LOGS="$$log_list"; \
+ exit $$?
+test-shell.log: test-shell$(EXEEXT)
+ @p='test-shell$(EXEEXT)'; \
+ b='test-shell'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-printf.log: test-printf$(EXEEXT)
+ @p='test-printf$(EXEEXT)'; \
+ b='test-printf'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-corrupt.log: test-corrupt$(EXEEXT)
+ @p='test-corrupt$(EXEEXT)'; \
+ b='test-corrupt'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-dbus-daemon.log: test-dbus-daemon$(EXEEXT)
+ @p='test-dbus-daemon$(EXEEXT)'; \
+ b='test-dbus-daemon'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-dbus-daemon-eavesdrop.log: test-dbus-daemon-eavesdrop$(EXEEXT)
+ @p='test-dbus-daemon-eavesdrop$(EXEEXT)'; \
+ b='test-dbus-daemon-eavesdrop'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-loopback.log: test-loopback$(EXEEXT)
+ @p='test-loopback$(EXEEXT)'; \
+ b='test-loopback'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-marshal.log: test-marshal$(EXEEXT)
+ @p='test-marshal$(EXEEXT)'; \
+ b='test-marshal'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-refs.log: test-refs$(EXEEXT)
+ @p='test-refs$(EXEEXT)'; \
+ b='test-refs'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-relay.log: test-relay$(EXEEXT)
+ @p='test-relay$(EXEEXT)'; \
+ b='test-relay'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-syntax.log: test-syntax$(EXEEXT)
+ @p='test-syntax$(EXEEXT)'; \
+ b='test-syntax'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-syslog.log: test-syslog$(EXEEXT)
+ @p='test-syslog$(EXEEXT)'; \
+ b='test-syslog'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+../bus/test-bus.log: ../bus/test-bus$(EXEEXT)
+ @p='../bus/test-bus$(EXEEXT)'; \
+ b='../bus/test-bus'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+../bus/test-bus-system.log: ../bus/test-bus-system$(EXEEXT)
+ @p='../bus/test-bus-system$(EXEEXT)'; \
+ b='../bus/test-bus-system'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+../dbus/test-dbus.log: ../dbus/test-dbus$(EXEEXT)
+ @p='../dbus/test-dbus$(EXEEXT)'; \
+ b='../dbus/test-dbus'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+../bus/test-bus-launch-helper.log: ../bus/test-bus-launch-helper$(EXEEXT)
+ @p='../bus/test-bus-launch-helper$(EXEEXT)'; \
+ b='../bus/test-bus-launch-helper'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+.test.log:
+ @p='$<'; \
+ $(am__set_b); \
+ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+@am__EXEEXT_TRUE@.test$(EXEEXT).log:
+@am__EXEEXT_TRUE@ @p='$<'; \
+@am__EXEEXT_TRUE@ $(am__set_b); \
+@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
+@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -1334,6 +1922,9 @@ install-strip:
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
+ -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
+ -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
+ -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
@@ -1417,14 +2008,12 @@ ps-am:
uninstall-am: uninstall-testexecPROGRAMS
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) check-am \
- ctags-recursive install-am install-strip tags-recursive
+.MAKE: $(am__recursive_targets) check-am install-am install-strip
-.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 \
- clean-testexecPROGRAMS ctags ctags-recursive distclean \
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am all-local \
+ check check-TESTS check-am clean clean-generic clean-libtool \
+ clean-local clean-noinstLTLIBRARIES clean-noinstPROGRAMS \
+ clean-testexecPROGRAMS cscopelist-am ctags ctags-am 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 \
@@ -1435,8 +2024,8 @@ uninstall-am: uninstall-testexecPROGRAMS
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
+ pdf pdf-am ps ps-am recheck tags tags-am uninstall \
+ uninstall-am uninstall-testexecPROGRAMS
# If we're installing the tests into a DESTDIR we can't run them
@@ -1471,11 +2060,7 @@ clean-local:
rm -f $(static_data); \
fi
-data/valid-config-files/session.conf: $(top_builddir)/bus/session.conf
- $(AM_V_at)$(MKDIR_P) data/valid-config-files
- $(AM_V_GEN)cp $< $@
-
-data/valid-config-files/system.conf: $(top_builddir)/bus/system.conf
+$(imported_data): data/valid-config-files/%.conf: $(top_builddir)/bus/%.conf
$(AM_V_at)$(MKDIR_P) data/valid-config-files
$(AM_V_GEN)cp $< $@
diff --git a/test/corrupt.c b/test/corrupt.c
index 02495901..1a7d4460 100644
--- a/test/corrupt.c
+++ b/test/corrupt.c
@@ -30,10 +30,12 @@
#include <gio/gio.h>
#include <dbus/dbus.h>
-#include <dbus/dbus-glib-lowlevel.h>
+
+#include "test-utils.h"
typedef struct {
DBusError e;
+ TestMainContext *ctx;
DBusServer *server;
DBusConnection *server_conn;
@@ -72,13 +74,14 @@ new_conn_cb (DBusServer *server,
g_assert (f->server_conn == NULL);
f->server_conn = dbus_connection_ref (server_conn);
- dbus_connection_setup_with_g_main (server_conn, NULL);
+ test_connection_setup (f->ctx, server_conn);
}
static void
setup (Fixture *f,
gconstpointer addr)
{
+ f->ctx = test_main_context_get ();
dbus_error_init (&f->e);
g_queue_init (&f->client_messages);
@@ -88,7 +91,7 @@ setup (Fixture *f,
dbus_server_set_new_connection_function (f->server,
new_conn_cb, f, NULL);
- dbus_server_setup_with_g_main (f->server, NULL);
+ test_server_setup (f->ctx, f->server);
}
static void
@@ -103,12 +106,12 @@ test_connect (Fixture *f,
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);
+ test_connection_setup (f->ctx, f->client_conn);
while (f->server_conn == NULL)
{
g_print (".");
- g_main_context_iteration (NULL, TRUE);
+ test_main_context_iterate (f->ctx, TRUE);
}
have_mem = dbus_connection_add_filter (f->client_conn,
@@ -137,7 +140,7 @@ test_message (Fixture *f,
while (g_queue_is_empty (&f->client_messages))
{
g_print (".");
- g_main_context_iteration (NULL, TRUE);
+ test_main_context_iterate (f->ctx, TRUE);
}
g_assert_cmpuint (g_queue_get_length (&f->client_messages), ==, 1);
@@ -229,7 +232,7 @@ test_corrupt (Fixture *f,
while (g_queue_is_empty (&f->client_messages))
{
g_print (".");
- g_main_context_iteration (NULL, TRUE);
+ test_main_context_iterate (f->ctx, TRUE);
}
incoming = g_queue_pop_head (&f->client_messages);
@@ -246,6 +249,16 @@ test_corrupt (Fixture *f,
"/org/freedesktop/DBus/Local");
dbus_message_unref (incoming);
+
+ /* Free the DBusConnection before the GSocket, because GSocket is
+ * going to close our fd. GSocket tolerates closing an already-closed
+ * fd, whereas DBusLoop + DBusSocketSetEpoll doesn't. On Unix
+ * we could use dup() but that isn't portable to Windows :-(
+ */
+ dbus_connection_close (f->server_conn);
+ dbus_connection_unref (f->server_conn);
+ f->server_conn = NULL;
+
g_object_unref (socket);
}
@@ -308,7 +321,7 @@ test_byte_order (Fixture *f,
while (g_queue_is_empty (&f->client_messages))
{
g_print (".");
- g_main_context_iteration (NULL, TRUE);
+ test_main_context_iterate (f->ctx, TRUE);
}
message = g_queue_pop_head (&f->client_messages);
@@ -325,6 +338,12 @@ test_byte_order (Fixture *f,
"/org/freedesktop/DBus/Local");
dbus_message_unref (message);
+
+ /* Free the DBusConnection before the GSocket, as above. */
+ dbus_connection_close (f->server_conn);
+ dbus_connection_unref (f->server_conn);
+ f->server_conn = NULL;
+
g_object_unref (socket);
}
@@ -352,6 +371,8 @@ teardown (Fixture *f,
dbus_server_unref (f->server);
f->server = NULL;
}
+
+ test_main_context_unref (f->ctx);
}
int
diff --git a/test/data/valid-config-files/incoming-limit.conf b/test/data/valid-config-files/incoming-limit.conf.in
index abfab3f7..40ff2244 100644
--- a/test/data/valid-config-files/incoming-limit.conf
+++ b/test/data/valid-config-files/incoming-limit.conf.in
@@ -3,7 +3,7 @@
<busconfig>
<!-- Our well-known bus type, don't change this -->
<type>session</type>
- <listen>unix:tmpdir=/tmp</listen>
+ <listen>@TEST_LISTEN@</listen>
<policy context="default">
<!-- Allow everything to be sent -->
diff --git a/test/dbus-daemon-eavesdrop.c b/test/dbus-daemon-eavesdrop.c
index 0bd923d2..a78d8888 100644
--- a/test/dbus-daemon-eavesdrop.c
+++ b/test/dbus-daemon-eavesdrop.c
@@ -30,7 +30,6 @@
#include <glib.h>
#include <dbus/dbus.h>
-#include <dbus/dbus-glib-lowlevel.h>
#include <string.h>
@@ -42,6 +41,8 @@
# include <unistd.h>
#endif
+#include "test-utils.h"
+
#define SENDER_NAME "test.eavesdrop.sender"
#define SENDER_PATH "/test/eavesdrop/sender"
#define SENDER_IFACE SENDER_NAME
@@ -71,6 +72,7 @@ typedef enum {
} SignalDst;
typedef struct {
+ TestMainContext *ctx;
DBusError e;
GError *ge;
@@ -149,6 +151,8 @@ spawn_dbus_daemon (gchar *binary,
if (newline != NULL)
{
+ if ((newline > address->str) && ('\r' == newline[-1]))
+ newline -= 1;
g_string_truncate (address, newline - address->str);
break;
}
@@ -160,7 +164,8 @@ spawn_dbus_daemon (gchar *binary,
}
static DBusConnection *
-connect_to_bus (const gchar *address)
+connect_to_bus (Fixture *f,
+ const gchar *address)
{
DBusConnection *conn;
DBusError error = DBUS_ERROR_INIT;
@@ -175,7 +180,7 @@ connect_to_bus (const gchar *address)
g_assert (ok);
g_assert (dbus_bus_get_unique_name (conn) != NULL);
- dbus_connection_setup_with_g_main (conn, NULL);
+ test_connection_setup (f->ctx, conn);
return conn;
}
@@ -380,6 +385,8 @@ setup (Fixture *f,
gchar *config;
gchar *address;
+ f->ctx = test_main_context_get ();
+
f->ge = NULL;
dbus_error_init (&f->e);
@@ -404,17 +411,24 @@ setup (Fixture *f,
config = g_strdup ("--session");
}
- address = spawn_dbus_daemon (dbus_daemon, config, &f->daemon_pid);
+ if (g_getenv ("DBUS_TEST_DAEMON_ADDRESS") != NULL)
+ {
+ address = g_strdup (g_getenv ("DBUS_TEST_DAEMON_ADDRESS"));
+ }
+ else
+ {
+ address = spawn_dbus_daemon (dbus_daemon, config, &f->daemon_pid);
+ }
g_free (dbus_daemon);
g_free (config);
- f->sender = connect_to_bus (address);
+ f->sender = connect_to_bus (f, address);
dbus_bus_request_name (f->sender, SENDER_NAME, DBUS_NAME_FLAG_DO_NOT_QUEUE,
&(f->e));
- f->receiver = connect_to_bus (address);
- f->eavesdropper = connect_to_bus (address);
- f->politelistener = connect_to_bus (address);
+ f->receiver = connect_to_bus (f, address);
+ f->eavesdropper = connect_to_bus (f, address);
+ f->politelistener = connect_to_bus (f, address);
add_receiver_filter (f);
add_politelistener_filter (f);
add_eavesdropper_filter (f);
@@ -432,7 +446,7 @@ test_eavesdrop_broadcast (Fixture *f,
while (!f->receiver_got_stopper ||
!f->politelistener_got_stopper ||
!f->eavesdropper_got_stopper)
- g_main_context_iteration (NULL, TRUE);
+ test_main_context_iterate (f->ctx, TRUE);
/* all the three connection can receive a broadcast */
g_assert_cmpint (f->receiver_dst, ==, BROADCAST);
@@ -452,7 +466,7 @@ test_eavesdrop_unicast_to_sender (Fixture *f,
while (!f->receiver_got_stopper ||
!f->politelistener_got_stopper ||
!f->eavesdropper_got_stopper)
- g_main_context_iteration (NULL, TRUE);
+ test_main_context_iterate (f->ctx, TRUE);
/* not directed to it and not broadcasted, they cannot receive it */
g_assert_cmpint (f->receiver_dst, ==, NONE_YET);
@@ -472,7 +486,7 @@ test_eavesdrop_unicast_to_receiver (Fixture *f,
while (!f->receiver_got_stopper ||
!f->politelistener_got_stopper ||
!f->eavesdropper_got_stopper)
- g_main_context_iteration (NULL, TRUE);
+ test_main_context_iterate (f->ctx, TRUE);
/* direct to him */
g_assert_cmpint (f->receiver_dst, ==, TO_ME);
@@ -534,6 +548,8 @@ teardown (Fixture *f,
#endif
g_spawn_close_pid (f->daemon_pid);
+
+ test_main_context_unref (f->ctx);
}
int
diff --git a/test/dbus-daemon.c b/test/dbus-daemon.c
index cc871530..dc0f1317 100644
--- a/test/dbus-daemon.c
+++ b/test/dbus-daemon.c
@@ -29,7 +29,6 @@
#include <glib.h>
#include <dbus/dbus.h>
-#include <dbus/dbus-glib-lowlevel.h>
#include <string.h>
@@ -39,11 +38,16 @@
#else
# include <signal.h>
# include <unistd.h>
+# include <sys/types.h>
#endif
+#include "test-utils.h"
+
typedef struct {
gboolean skip;
+ TestMainContext *ctx;
+
DBusError e;
GError *ge;
@@ -115,6 +119,8 @@ spawn_dbus_daemon (gchar *binary,
if (newline != NULL)
{
+ if ((newline > address->str) && ('\r' == newline[-1]))
+ newline -= 1;
g_string_truncate (address, newline - address->str);
break;
}
@@ -126,7 +132,8 @@ spawn_dbus_daemon (gchar *binary,
}
static DBusConnection *
-connect_to_bus (const gchar *address)
+connect_to_bus (Fixture *f,
+ const gchar *address)
{
DBusConnection *conn;
DBusError error = DBUS_ERROR_INIT;
@@ -141,7 +148,7 @@ connect_to_bus (const gchar *address)
g_assert (ok);
g_assert (dbus_bus_get_unique_name (conn) != NULL);
- dbus_connection_setup_with_g_main (conn, NULL);
+ test_connection_setup (f->ctx, conn);
return conn;
}
@@ -183,11 +190,20 @@ setup (Fixture *f,
gchar *arg;
gchar *address;
+ f->ctx = test_main_context_get ();
f->ge = NULL;
dbus_error_init (&f->e);
if (config != NULL && config->config_file != NULL)
{
+ if (g_getenv ("DBUS_TEST_DAEMON_ADDRESS") != NULL)
+ {
+ g_message ("SKIP: cannot use DBUS_TEST_DAEMON_ADDRESS for "
+ "unusally-configured dbus-daemon");
+ f->skip = TRUE;
+ return;
+ }
+
if (g_getenv ("DBUS_TEST_DATA") == NULL)
{
g_message ("SKIP: set DBUS_TEST_DATA to a directory containing %s",
@@ -221,13 +237,20 @@ setup (Fixture *f,
if (dbus_daemon == NULL)
dbus_daemon = g_strdup ("dbus-daemon");
- address = spawn_dbus_daemon (dbus_daemon, arg, &f->daemon_pid);
+ if (g_getenv ("DBUS_TEST_DAEMON_ADDRESS") != NULL)
+ {
+ address = g_strdup (g_getenv ("DBUS_TEST_DAEMON_ADDRESS"));
+ }
+ else
+ {
+ address = spawn_dbus_daemon (dbus_daemon, arg, &f->daemon_pid);
+ }
g_free (dbus_daemon);
g_free (arg);
- f->left_conn = connect_to_bus (address);
- f->right_conn = connect_to_bus (address);
+ f->left_conn = connect_to_bus (f, address);
+ f->right_conn = connect_to_bus (f, address);
g_free (address);
}
@@ -301,7 +324,7 @@ test_echo (Fixture *f,
}
while (received < count)
- g_main_context_iteration (NULL, TRUE);
+ test_main_context_iterate (f->ctx, TRUE);
elapsed = g_test_timer_elapsed ();
@@ -310,6 +333,216 @@ test_echo (Fixture *f,
}
static void
+pending_call_store_reply (DBusPendingCall *pc,
+ void *data)
+{
+ DBusMessage **message_p = data;
+
+ *message_p = dbus_pending_call_steal_reply (pc);
+ g_assert (*message_p != NULL);
+}
+
+static void
+test_creds (Fixture *f,
+ gconstpointer context)
+{
+ const char *unique = dbus_bus_get_unique_name (f->left_conn);
+ DBusMessage *m = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
+ DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS, "GetConnectionCredentials");
+ DBusPendingCall *pc;
+ DBusMessageIter args_iter;
+ DBusMessageIter arr_iter;
+ DBusMessageIter pair_iter;
+ DBusMessageIter var_iter;
+ enum {
+ SEEN_UNIX_USER = 1,
+ SEEN_PID = 2,
+ SEEN_WINDOWS_SID = 4
+ } seen = 0;
+
+ if (m == NULL)
+ g_error ("OOM");
+
+ if (!dbus_message_append_args (m,
+ DBUS_TYPE_STRING, &unique,
+ DBUS_TYPE_INVALID))
+ g_error ("OOM");
+
+ if (!dbus_connection_send_with_reply (f->left_conn, m, &pc,
+ DBUS_TIMEOUT_USE_DEFAULT) ||
+ pc == NULL)
+ g_error ("OOM");
+
+ dbus_message_unref (m);
+ m = NULL;
+
+ if (dbus_pending_call_get_completed (pc))
+ pending_call_store_reply (pc, &m);
+ else if (!dbus_pending_call_set_notify (pc, pending_call_store_reply,
+ &m, NULL))
+ g_error ("OOM");
+
+ while (m == NULL)
+ test_main_context_iterate (f->ctx, TRUE);
+
+ g_assert_cmpstr (dbus_message_get_signature (m), ==, "a{sv}");
+
+ dbus_message_iter_init (m, &args_iter);
+ g_assert_cmpuint (dbus_message_iter_get_arg_type (&args_iter), ==,
+ DBUS_TYPE_ARRAY);
+ g_assert_cmpuint (dbus_message_iter_get_element_type (&args_iter), ==,
+ DBUS_TYPE_DICT_ENTRY);
+ dbus_message_iter_recurse (&args_iter, &arr_iter);
+
+ while (dbus_message_iter_get_arg_type (&arr_iter) != DBUS_TYPE_INVALID)
+ {
+ const char *name;
+
+ dbus_message_iter_recurse (&arr_iter, &pair_iter);
+ g_assert_cmpuint (dbus_message_iter_get_arg_type (&pair_iter), ==,
+ DBUS_TYPE_STRING);
+ dbus_message_iter_get_basic (&pair_iter, &name);
+ dbus_message_iter_next (&pair_iter);
+ g_assert_cmpuint (dbus_message_iter_get_arg_type (&pair_iter), ==,
+ DBUS_TYPE_VARIANT);
+ dbus_message_iter_recurse (&pair_iter, &var_iter);
+
+ if (g_strcmp0 (name, "UnixUserID") == 0)
+ {
+#ifdef G_OS_UNIX
+ guint32 u32;
+
+ g_assert (!(seen & SEEN_UNIX_USER));
+ g_assert_cmpuint (dbus_message_iter_get_arg_type (&var_iter), ==,
+ DBUS_TYPE_UINT32);
+ dbus_message_iter_get_basic (&var_iter, &u32);
+ g_message ("%s of this process is %u", name, u32);
+ g_assert_cmpuint (u32, ==, geteuid ());
+ seen |= SEEN_UNIX_USER;
+#else
+ g_assert_not_reached ();
+#endif
+ }
+ else if (g_strcmp0 (name, "ProcessID") == 0)
+ {
+ guint32 u32;
+
+ g_assert (!(seen & SEEN_PID));
+ g_assert_cmpuint (dbus_message_iter_get_arg_type (&var_iter), ==,
+ DBUS_TYPE_UINT32);
+ dbus_message_iter_get_basic (&var_iter, &u32);
+ g_message ("%s of this process is %u", name, u32);
+#ifdef G_OS_UNIX
+ g_assert_cmpuint (u32, ==, getpid ());
+#elif defined(G_OS_WIN32)
+ g_assert_cmpuint (u32, ==, GetCurrentProcessId ());
+#else
+ g_assert_not_reached ();
+#endif
+ seen |= SEEN_PID;
+ }
+
+ dbus_message_iter_next (&arr_iter);
+ }
+
+#ifdef G_OS_UNIX
+ g_assert (seen & SEEN_UNIX_USER);
+ g_assert (seen & SEEN_PID);
+#endif
+
+#ifdef G_OS_WIN32
+ /* FIXME: when implemented:
+ g_assert (seen & SEEN_WINDOWS_SID);
+ */
+#endif
+}
+
+static void
+test_canonical_path_uae (Fixture *f,
+ gconstpointer context)
+{
+ DBusMessage *m = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
+ DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS, "UpdateActivationEnvironment");
+ DBusPendingCall *pc;
+ DBusMessageIter args_iter;
+ DBusMessageIter arr_iter;
+
+ if (m == NULL)
+ g_error ("OOM");
+
+ dbus_message_iter_init_append (m, &args_iter);
+
+ /* Append an empty a{ss} (string => string dictionary). */
+ if (!dbus_message_iter_open_container (&args_iter, DBUS_TYPE_ARRAY,
+ "{ss}", &arr_iter) ||
+ !dbus_message_iter_close_container (&args_iter, &arr_iter))
+ g_error ("OOM");
+
+ if (!dbus_connection_send_with_reply (f->left_conn, m, &pc,
+ DBUS_TIMEOUT_USE_DEFAULT) ||
+ pc == NULL)
+ g_error ("OOM");
+
+ dbus_message_unref (m);
+ m = NULL;
+
+ if (dbus_pending_call_get_completed (pc))
+ pending_call_store_reply (pc, &m);
+ else if (!dbus_pending_call_set_notify (pc, pending_call_store_reply,
+ &m, NULL))
+ g_error ("OOM");
+
+ while (m == NULL)
+ test_main_context_iterate (f->ctx, TRUE);
+
+ /* it succeeds */
+ g_assert_cmpint (dbus_message_get_type (m), ==,
+ DBUS_MESSAGE_TYPE_METHOD_RETURN);
+
+ dbus_message_unref (m);
+
+ /* Now try with the wrong object path */
+ m = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
+ "/com/example/Wrong", DBUS_INTERFACE_DBUS, "UpdateActivationEnvironment");
+
+ if (m == NULL)
+ g_error ("OOM");
+
+ dbus_message_iter_init_append (m, &args_iter);
+
+ /* Append an empty a{ss} (string => string dictionary). */
+ if (!dbus_message_iter_open_container (&args_iter, DBUS_TYPE_ARRAY,
+ "{ss}", &arr_iter) ||
+ !dbus_message_iter_close_container (&args_iter, &arr_iter))
+ g_error ("OOM");
+
+ if (!dbus_connection_send_with_reply (f->left_conn, m, &pc,
+ DBUS_TIMEOUT_USE_DEFAULT) ||
+ pc == NULL)
+ g_error ("OOM");
+
+ dbus_message_unref (m);
+ m = NULL;
+
+ if (dbus_pending_call_get_completed (pc))
+ pending_call_store_reply (pc, &m);
+ else if (!dbus_pending_call_set_notify (pc, pending_call_store_reply,
+ &m, NULL))
+ g_error ("OOM");
+
+ while (m == NULL)
+ test_main_context_iterate (f->ctx, TRUE);
+
+ /* it fails, yielding an error message with one string argument */
+ g_assert_cmpint (dbus_message_get_type (m), ==, DBUS_MESSAGE_TYPE_ERROR);
+ g_assert_cmpstr (dbus_message_get_error_name (m), ==,
+ DBUS_ERROR_ACCESS_DENIED);
+ g_assert_cmpstr (dbus_message_get_signature (m), ==, "s");
+
+ dbus_message_unref (m);
+}
+
+static void
teardown (Fixture *f,
gconstpointer context G_GNUC_UNUSED)
{
@@ -347,6 +580,8 @@ teardown (Fixture *f,
g_spawn_close_pid (f->daemon_pid);
f->daemon_pid = 0;
}
+
+ test_main_context_unref (f->ctx);
}
static Config limited_config = {
@@ -363,6 +598,9 @@ main (int argc,
g_test_add ("/echo/session", Fixture, NULL, setup, test_echo, teardown);
g_test_add ("/echo/limited", Fixture, &limited_config,
setup, test_echo, teardown);
+ g_test_add ("/creds", Fixture, NULL, setup, test_creds, teardown);
+ g_test_add ("/canonical-path/uae", Fixture, NULL,
+ setup, test_canonical_path_uae, teardown);
return g_test_run ();
}
diff --git a/test/internals/printf.c b/test/internals/printf.c
new file mode 100644
index 00000000..db151518
--- /dev/null
+++ b/test/internals/printf.c
@@ -0,0 +1,88 @@
+/* Regression test for _dbus_printf_string_upper_bound
+ *
+ * Author: Simon McVittie <simon.mcvittie@collabora.co.uk>
+ * Copyright © 2013 Intel 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 <dbus/dbus.h>
+#include <dbus/dbus-internals.h>
+#include <dbus/dbus-string.h>
+#include "test-utils.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+static void
+do_test (int minimum,
+ const char *format,
+ ...)
+{
+ va_list ap;
+ int result;
+
+ va_start (ap, format);
+ result = _dbus_printf_string_upper_bound (format, ap);
+ va_end (ap);
+
+ if (result < minimum)
+ {
+ fprintf (stderr, "expected at least %d, got %d\n", minimum, result);
+ abort ();
+ }
+}
+
+#define X_TIMES_8 "XXXXXXXX"
+#define X_TIMES_16 X_TIMES_8 X_TIMES_8
+#define X_TIMES_32 X_TIMES_16 X_TIMES_16
+#define X_TIMES_64 X_TIMES_32 X_TIMES_32
+#define X_TIMES_128 X_TIMES_64 X_TIMES_64
+#define X_TIMES_256 X_TIMES_128 X_TIMES_128
+#define X_TIMES_512 X_TIMES_256 X_TIMES_256
+#define X_TIMES_1024 X_TIMES_512 X_TIMES_512
+
+int
+main (int argc,
+ char **argv)
+{
+ char buf[] = X_TIMES_1024 X_TIMES_1024 X_TIMES_1024 X_TIMES_1024;
+ int i;
+
+ do_test (1, "%d", 0);
+ do_test (7, "%d", 1234567);
+ do_test (3, "%f", 3.5);
+
+ do_test (0, "%s", "");
+ do_test (1024, "%s", X_TIMES_1024);
+ do_test (1025, "%s", X_TIMES_1024 "Y");
+
+ for (i = 4096; i > 0; i--)
+ {
+ buf[i] = '\0';
+ do_test (i, "%s", buf);
+ do_test (i + 3, "%s:%d", buf, 42);
+ }
+
+ return 0;
+}
diff --git a/test/internals/refs.c b/test/internals/refs.c
index db43a4da..202dc043 100644
--- a/test/internals/refs.c
+++ b/test/internals/refs.c
@@ -29,7 +29,6 @@
#include <glib.h>
#include <glib-object.h>
-#define DBUS_COMPILATION /* this test uses libdbus-internal */
#include <dbus/dbus.h>
#include <dbus/dbus-connection-internal.h>
#include <dbus/dbus-mainloop.h>
diff --git a/test/internals/syslog.c b/test/internals/syslog.c
index 4f6b7c22..7e0eae79 100644
--- a/test/internals/syslog.c
+++ b/test/internals/syslog.c
@@ -30,7 +30,6 @@
#include <glib.h>
-#define DBUS_COMPILATION /* this test uses libdbus-internal */
#include <dbus/dbus.h>
#include <dbus/dbus-sysdeps.h>
@@ -52,9 +51,10 @@ static void
test_syslog (Fixture *f,
gconstpointer data)
{
+#ifndef G_OS_WIN32
if (g_test_trap_fork (0, 0))
{
- _dbus_init_system_log ();
+ _dbus_init_system_log (FALSE);
_dbus_system_log (DBUS_SYSTEM_LOG_FATAL, MESSAGE "%d", 23);
/* should not be reached: exit 0 so the assertion in the main process
* will fail */
@@ -66,7 +66,7 @@ test_syslog (Fixture *f,
if (g_test_trap_fork (0, 0))
{
- _dbus_init_system_log ();
+ _dbus_init_system_log (FALSE);
_dbus_system_log (DBUS_SYSTEM_LOG_INFO, MESSAGE "%d", 42);
_dbus_system_log (DBUS_SYSTEM_LOG_SECURITY, MESSAGE "%d", 666);
exit (0);
@@ -74,9 +74,9 @@ test_syslog (Fixture *f,
g_test_trap_assert_passed ();
g_test_trap_assert_stderr ("*" MESSAGE "42\n*" MESSAGE "666\n*");
-
+#endif
/* manual test (this is the best we can do on Windows) */
- _dbus_init_system_log ();
+ _dbus_init_system_log (FALSE);
_dbus_system_log (DBUS_SYSTEM_LOG_INFO, MESSAGE "%d", 42);
_dbus_system_log (DBUS_SYSTEM_LOG_SECURITY, MESSAGE "%d", 666);
}
diff --git a/test/loopback.c b/test/loopback.c
index d0d69c82..7526d8d2 100644
--- a/test/loopback.c
+++ b/test/loopback.c
@@ -1,7 +1,7 @@
/* Simple sanity-check for loopback through TCP and Unix sockets.
*
* Author: Simon McVittie <simon.mcvittie@collabora.co.uk>
- * Copyright © 2010-2011 Nokia Corporation
+ * Copyright © 2010-2012 Nokia Corporation
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation files
@@ -29,9 +29,13 @@
#include <glib.h>
#include <dbus/dbus.h>
-#include <dbus/dbus-glib-lowlevel.h>
+
+#include <string.h>
+
+#include "test-utils.h"
typedef struct {
+ TestMainContext *ctx;
DBusError e;
DBusServer *server;
@@ -72,7 +76,7 @@ new_conn_cb (DBusServer *server,
g_assert (f->server_conn == NULL);
f->server_conn = dbus_connection_ref (server_conn);
- dbus_connection_setup_with_g_main (server_conn, NULL);
+ test_connection_setup (f->ctx, server_conn);
have_mem = dbus_connection_add_filter (server_conn,
server_message_cb, f, NULL);
@@ -83,6 +87,7 @@ static void
setup (Fixture *f,
gconstpointer addr)
{
+ f->ctx = test_main_context_get ();
dbus_error_init (&f->e);
g_queue_init (&f->server_messages);
@@ -92,7 +97,7 @@ setup (Fixture *f,
dbus_server_set_new_connection_function (f->server,
new_conn_cb, f, NULL);
- dbus_server_setup_with_g_main (f->server, NULL);
+ test_server_setup (f->ctx, f->server);
}
static void
@@ -105,13 +110,73 @@ test_connect (Fixture *f,
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);
+ test_connection_setup (f->ctx, f->client_conn);
while (f->server_conn == NULL)
{
g_print (".");
- g_main_context_iteration (NULL, TRUE);
+ test_main_context_iterate (f->ctx, TRUE);
+ }
+}
+
+static void
+test_bad_guid (Fixture *f,
+ gconstpointer addr G_GNUC_UNUSED)
+{
+ DBusMessage *incoming;
+ gchar *address = g_strdup (dbus_server_get_address (f->server));
+ gchar *guid;
+
+ g_test_bug ("39720");
+
+ g_assert (f->server_conn == NULL);
+
+ g_assert (strstr (address, "guid=") != NULL);
+ guid = strstr (address, "guid=");
+ g_assert_cmpuint (strlen (guid), >=, 5 + 32);
+
+ /* Change the first char of the guid to something different */
+ if (guid[5] == '0')
+ guid[5] = 'f';
+ else
+ guid[5] = '0';
+
+ f->client_conn = dbus_connection_open_private (address, &f->e);
+ assert_no_error (&f->e);
+ g_assert (f->client_conn != NULL);
+ test_connection_setup (f->ctx, f->client_conn);
+
+ while (f->server_conn == NULL)
+ {
+ g_print (".");
+ test_main_context_iterate (f->ctx, TRUE);
+ }
+
+ /* We get disconnected */
+
+ while (g_queue_is_empty (&f->server_messages))
+ {
+ g_print (".");
+ test_main_context_iterate (f->ctx, 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), ==,
+ DBUS_INTERFACE_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), ==, DBUS_PATH_LOCAL);
+
+ dbus_message_unref (incoming);
+
+ g_free (address);
}
static void
@@ -135,7 +200,7 @@ test_message (Fixture *f,
while (g_queue_is_empty (&f->server_messages))
{
g_print (".");
- g_main_context_iteration (NULL, TRUE);
+ test_main_context_iterate (f->ctx, TRUE);
}
g_assert_cmpuint (g_queue_get_length (&f->server_messages), ==, 1);
@@ -182,6 +247,8 @@ teardown (Fixture *f,
dbus_server_unref (f->server);
f->server = NULL;
}
+
+ test_main_context_unref (f->ctx);
}
int
@@ -189,6 +256,7 @@ 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/tcp", Fixture, "tcp:host=127.0.0.1", setup,
test_connect, teardown);
@@ -207,5 +275,8 @@ main (int argc,
test_message, teardown);
#endif
+ g_test_add ("/message/bad-guid", Fixture, "tcp:host=127.0.0.1", setup,
+ test_bad_guid, teardown);
+
return g_test_run ();
}
diff --git a/test/manual-authz.c b/test/manual-authz.c
new file mode 100644
index 00000000..f9e3688e
--- /dev/null
+++ b/test/manual-authz.c
@@ -0,0 +1,409 @@
+/* Simple sanity-check for authentication and authorization.
+ *
+ * Copyright © 2010-2011 Nokia Corporation
+ * Copyright © 2012 Collabora Ltd.
+ *
+ * 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>
+
+#ifdef G_OS_UNIX
+#include <unistd.h>
+#include <sys/types.h>
+#endif
+
+#include "test-utils.h"
+
+typedef struct {
+ DBusError e;
+ TestMainContext *ctx;
+
+ DBusServer *normal_server;
+ DBusServer *anon_allowed_server;
+ DBusServer *anon_only_server;
+ DBusServer *anon_mech_only_server;
+ DBusServer *anon_disallowed_server;
+ DBusServer *permissive_server;
+ DBusServer *unhappy_server;
+ DBusServer *same_uid_server;
+ DBusServer *same_uid_or_anon_server;
+} Fixture;
+
+static void oom (void) G_GNUC_NORETURN;
+static void
+oom (void)
+{
+ g_error ("out of memory");
+}
+
+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 *conn,
+ DBusMessage *message,
+ void *data)
+{
+ if (dbus_message_is_signal (message, DBUS_INTERFACE_LOCAL, "Disconnected"))
+ {
+ dbus_connection_unref (conn);
+
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+ }
+
+ if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_METHOD_CALL)
+ {
+ DBusMessage *reply = dbus_message_new_method_return (message);
+ const char *hello = "Hello, world!";
+ unsigned long uid;
+ char *sid;
+
+ if (dbus_connection_get_unix_user (conn, &uid))
+ {
+ g_message ("message from uid %lu", uid);
+ }
+ else if (dbus_connection_get_windows_user (conn, &sid))
+ {
+ if (sid == NULL)
+ oom ();
+
+ g_message ("message from sid \"%s\"", sid);
+ dbus_free (sid);
+ }
+ else if (dbus_connection_get_is_anonymous (conn))
+ {
+ g_message ("message from Anonymous");
+ }
+ else
+ {
+ g_message ("message from ... someone?");
+ }
+
+ if (reply == NULL)
+ oom ();
+
+ if (!dbus_message_append_args (reply,
+ DBUS_TYPE_STRING, &hello,
+ DBUS_TYPE_INVALID))
+ oom ();
+
+ if (!dbus_connection_send (conn, reply, NULL))
+ oom ();
+
+ dbus_message_unref (reply);
+
+ return DBUS_HANDLER_RESULT_HANDLED;
+ }
+
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+}
+
+static dbus_bool_t
+permissive_unix_func (DBusConnection *conn,
+ unsigned long uid,
+ void *data)
+{
+ g_message ("accepting Unix user %lu", uid);
+ return TRUE;
+}
+
+static dbus_bool_t
+permissive_win_func (DBusConnection *conn,
+ const char *sid,
+ void *data)
+{
+ g_message ("accepting Windows user \"%s\"", sid);
+ return TRUE;
+}
+
+static dbus_bool_t
+broken_unix_func (DBusConnection *conn,
+ unsigned long uid,
+ void *data)
+{
+ g_error ("libdbus called the Unix user function for an ANONYMOUS-only "
+ "connection");
+ return FALSE;
+}
+
+static dbus_bool_t
+broken_win_func (DBusConnection *conn,
+ const char *sid,
+ void *data)
+{
+ g_error ("libdbus called the Windows user function for an ANONYMOUS-only "
+ "connection");
+ return FALSE;
+}
+
+static dbus_bool_t
+unhappy_unix_func (DBusConnection *conn,
+ unsigned long uid,
+ void *data)
+{
+ g_message ("rejecting Unix user %lu", uid);
+ return FALSE;
+}
+
+static dbus_bool_t
+unhappy_win_func (DBusConnection *conn,
+ const char *sid,
+ void *data)
+{
+ g_message ("rejecting Windows user \"%s\"", sid);
+ return FALSE;
+}
+
+static dbus_bool_t
+same_uid_unix_func (DBusConnection *conn,
+ unsigned long uid,
+ void *data)
+{
+ g_message ("checking whether Unix user %lu owns this process", uid);
+ /* I'd use _dbus_unix_user_is_process_owner(), but it's private... */
+#ifdef G_OS_UNIX
+ return (geteuid () == uid);
+#else
+ return FALSE;
+#endif
+}
+
+static dbus_bool_t
+same_uid_win_func (DBusConnection *conn,
+ const char *sid,
+ void *data)
+{
+ g_message ("checking whether Windows user \"%s\" owns this process", sid);
+ g_message ("Stub implementation consistent with dbus-sysdeps-util-win: "
+ "assume they do");
+ return TRUE;
+}
+
+static void
+new_conn_cb (DBusServer *server,
+ DBusConnection *conn,
+ void *data)
+{
+ Fixture *f = data;
+
+ dbus_connection_ref (conn);
+ test_connection_setup (f->ctx, conn);
+
+ if (!dbus_connection_add_filter (conn, server_message_cb, f, NULL))
+ oom ();
+
+ if (server == f->normal_server)
+ {
+ }
+ else if (server == f->anon_allowed_server)
+ {
+ dbus_connection_set_allow_anonymous (conn, TRUE);
+ }
+ else if (server == f->anon_only_server)
+ {
+ dbus_connection_set_allow_anonymous (conn, TRUE);
+
+ dbus_connection_set_unix_user_function (conn, unhappy_unix_func,
+ f, NULL);
+ dbus_connection_set_windows_user_function (conn, unhappy_win_func,
+ f, NULL);
+ }
+ else if (server == f->anon_mech_only_server)
+ {
+ dbus_connection_set_allow_anonymous (conn, TRUE);
+
+ /* should never get called */
+ dbus_connection_set_unix_user_function (conn, broken_unix_func,
+ f, NULL);
+ dbus_connection_set_windows_user_function (conn, broken_win_func,
+ f, NULL);
+ }
+ else if (server == f->anon_disallowed_server)
+ {
+ dbus_connection_set_allow_anonymous (conn, FALSE);
+
+ /* should never get called */
+ dbus_connection_set_unix_user_function (conn, broken_unix_func,
+ f, NULL);
+ dbus_connection_set_windows_user_function (conn, broken_win_func,
+ f, NULL);
+ }
+ else if (server == f->permissive_server)
+ {
+ dbus_connection_set_unix_user_function (conn, permissive_unix_func,
+ f, NULL);
+ dbus_connection_set_windows_user_function (conn, permissive_win_func,
+ f, NULL);
+ }
+ else if (server == f->unhappy_server)
+ {
+ dbus_connection_set_unix_user_function (conn, unhappy_unix_func,
+ f, NULL);
+ dbus_connection_set_windows_user_function (conn, unhappy_win_func,
+ f, NULL);
+ }
+ else if (server == f->same_uid_server)
+ {
+ dbus_connection_set_unix_user_function (conn, same_uid_unix_func,
+ f, NULL);
+ dbus_connection_set_windows_user_function (conn, same_uid_win_func,
+ f, NULL);
+ }
+ else if (server == f->same_uid_or_anon_server)
+ {
+ dbus_connection_set_allow_anonymous (conn, TRUE);
+
+ dbus_connection_set_unix_user_function (conn, same_uid_unix_func,
+ f, NULL);
+ dbus_connection_set_windows_user_function (conn, same_uid_win_func,
+ f, NULL);
+ }
+ else
+ {
+ g_assert_not_reached ();
+ }
+}
+
+static void
+setup (Fixture *f,
+ const gchar *listen_addr)
+{
+ const char *only_anon[] = { "ANONYMOUS", NULL };
+ char *connect_addr;
+
+ f->normal_server = dbus_server_listen (listen_addr, &f->e);
+ assert_no_error (&f->e);
+ g_assert (f->normal_server != NULL);
+ dbus_server_set_new_connection_function (f->normal_server,
+ new_conn_cb, f, NULL);
+ test_server_setup (f->ctx, f->normal_server);
+ connect_addr = dbus_server_get_address (f->normal_server);
+ g_message ("Normal server:\n%s", connect_addr);
+ dbus_free (connect_addr);
+
+ f->anon_allowed_server = dbus_server_listen (listen_addr, &f->e);
+ assert_no_error (&f->e);
+ g_assert (f->anon_allowed_server != NULL);
+ dbus_server_set_new_connection_function (f->anon_allowed_server,
+ new_conn_cb, f, NULL);
+ test_server_setup (f->ctx, f->anon_allowed_server);
+ connect_addr = dbus_server_get_address (f->anon_allowed_server);
+ g_message ("Anonymous-allowed server:\n%s", connect_addr);
+ dbus_free (connect_addr);
+
+ f->anon_only_server = dbus_server_listen (listen_addr, &f->e);
+ assert_no_error (&f->e);
+ g_assert (f->anon_only_server != NULL);
+ dbus_server_set_new_connection_function (f->anon_only_server,
+ new_conn_cb, f, NULL);
+ test_server_setup (f->ctx, f->anon_only_server);
+ connect_addr = dbus_server_get_address (f->anon_only_server);
+ g_message ("Anonymous-only server:\n%s", connect_addr);
+ dbus_free (connect_addr);
+
+ f->anon_mech_only_server = dbus_server_listen (listen_addr, &f->e);
+ assert_no_error (&f->e);
+ g_assert (f->anon_mech_only_server != NULL);
+ dbus_server_set_auth_mechanisms (f->anon_mech_only_server, only_anon);
+ dbus_server_set_new_connection_function (f->anon_mech_only_server,
+ new_conn_cb, f, NULL);
+ test_server_setup (f->ctx, f->anon_mech_only_server);
+ connect_addr = dbus_server_get_address (f->anon_mech_only_server);
+ g_message ("Anon mech only server:\n%s", connect_addr);
+ dbus_free (connect_addr);
+
+ f->anon_disallowed_server = dbus_server_listen (listen_addr, &f->e);
+ assert_no_error (&f->e);
+ g_assert (f->anon_disallowed_server != NULL);
+ dbus_server_set_auth_mechanisms (f->anon_disallowed_server, only_anon);
+ dbus_server_set_new_connection_function (f->anon_disallowed_server,
+ new_conn_cb, f, NULL);
+ test_server_setup (f->ctx, f->anon_disallowed_server);
+ connect_addr = dbus_server_get_address (f->anon_disallowed_server);
+ g_message ("Anonymous-disallowed server:\n%s", connect_addr);
+ dbus_free (connect_addr);
+
+ f->permissive_server = dbus_server_listen (listen_addr, &f->e);
+ assert_no_error (&f->e);
+ g_assert (f->permissive_server != NULL);
+ dbus_server_set_new_connection_function (f->permissive_server,
+ new_conn_cb, f, NULL);
+ test_server_setup (f->ctx, f->permissive_server);
+ connect_addr = dbus_server_get_address (f->permissive_server);
+ g_message ("Permissive server:\n%s", connect_addr);
+ dbus_free (connect_addr);
+
+ f->unhappy_server = dbus_server_listen (listen_addr, &f->e);
+ assert_no_error (&f->e);
+ g_assert (f->unhappy_server != NULL);
+ dbus_server_set_new_connection_function (f->unhappy_server,
+ new_conn_cb, f, NULL);
+ test_server_setup (f->ctx, f->unhappy_server);
+ connect_addr = dbus_server_get_address (f->unhappy_server);
+ g_message ("Unhappy server:\n%s", connect_addr);
+ dbus_free (connect_addr);
+
+ f->same_uid_server = dbus_server_listen (listen_addr, &f->e);
+ assert_no_error (&f->e);
+ g_assert (f->same_uid_server != NULL);
+ dbus_server_set_new_connection_function (f->same_uid_server,
+ new_conn_cb, f, NULL);
+ test_server_setup (f->ctx, f->same_uid_server);
+ connect_addr = dbus_server_get_address (f->same_uid_server);
+ g_message ("Same-UID server:\n%s", connect_addr);
+ dbus_free (connect_addr);
+
+ f->same_uid_or_anon_server = dbus_server_listen (listen_addr, &f->e);
+ assert_no_error (&f->e);
+ g_assert (f->same_uid_or_anon_server != NULL);
+ dbus_server_set_new_connection_function (f->same_uid_or_anon_server,
+ new_conn_cb, f, NULL);
+ test_server_setup (f->ctx, f->same_uid_or_anon_server);
+ connect_addr = dbus_server_get_address (f->same_uid_or_anon_server);
+ g_message ("Same-UID-or-anon server:\n%s", connect_addr);
+ dbus_free (connect_addr);
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ Fixture f = { DBUS_ERROR_INIT, test_main_context_get () };
+
+ if (argc >= 2)
+ setup (&f, argv[1]);
+ else
+ setup (&f, "tcp:host=127.0.0.1");
+
+ for (;;)
+ test_main_context_iterate (f.ctx, TRUE);
+
+ /* never returns */
+}
diff --git a/test/marshal.c b/test/marshal.c
index e9ac7e30..d74e7671 100644
--- a/test/marshal.c
+++ b/test/marshal.c
@@ -27,9 +27,9 @@
#include <config.h>
#include <glib.h>
+#include <string.h>
#include <dbus/dbus.h>
-#include <dbus/dbus-glib-lowlevel.h>
typedef struct {
DBusError e;
@@ -244,14 +244,30 @@ int
main (int argc,
char **argv)
{
+ int ret;
+ char *aligned_le_blob;
+ char *aligned_be_blob;
+
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,
+ /* We have to pass in a buffer that's at least "default aligned",
+ * i.e. on GNU systems to 8 or 16. The linker may have only given
+ * us byte-alignment for the char[] static variables.
+ */
+ aligned_le_blob = g_malloc (sizeof (le_blob));
+ memcpy (aligned_le_blob, le_blob, sizeof (le_blob));
+ aligned_be_blob = g_malloc (sizeof (be_blob));
+ memcpy (aligned_be_blob, be_blob, sizeof (be_blob));
+
+ g_test_add ("/demarshal/le", Fixture, aligned_le_blob, setup, test_endian, teardown);
+ g_test_add ("/demarshal/be", Fixture, aligned_be_blob, setup, test_endian, teardown);
+ g_test_add ("/demarshal/needed/le", Fixture, aligned_le_blob, setup, test_needed,
teardown);
- g_test_add ("/demarshal/needed/be", Fixture, be_blob, setup, test_needed,
+ g_test_add ("/demarshal/needed/be", Fixture, aligned_be_blob, setup, test_needed,
teardown);
- return g_test_run ();
+ ret = g_test_run ();
+ g_free (aligned_le_blob);
+ g_free (aligned_be_blob);
+ return ret;
}
diff --git a/test/name-test/Makefile.am b/test/name-test/Makefile.am
index 6aaf1783..8ed1e160 100644
--- a/test/name-test/Makefile.am
+++ b/test/name-test/Makefile.am
@@ -3,6 +3,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir) \
-DDBUS_COMPILATION \
-DDBUS_STATIC_BUILD \
+ -DDBUS_TEST_USE_INTERNAL \
$(NULL)
# if assertions are enabled, improve backtraces
@@ -11,8 +12,16 @@ AM_LDFLAGS = @R_DYNAMIC_LDFLAG@
## 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
## TESTS
-if DBUS_BUILD_TESTS
-TESTS_ENVIRONMENT=DBUS_TOP_BUILDDIR=@abs_top_builddir@ DBUS_TOP_SRCDIR=@abs_top_srcdir@ PYTHON=@PYTHON@
+if DBUS_ENABLE_EMBEDDED_TESTS
+TESTS_ENVIRONMENT = \
+ DBUS_TOP_BUILDDIR=@abs_top_builddir@ \
+ DBUS_TOP_SRCDIR=@abs_top_srcdir@ \
+ PYTHON=@PYTHON@ \
+ DBUS_TEST_DATA=@abs_top_builddir@/test/data \
+ DBUS_TEST_DAEMON=@abs_top_builddir@/bus/dbus-daemon$(EXEEXT) \
+ XDG_RUNTIME_DIR=@abs_top_builddir@/test/XDG_RUNTIME_DIR \
+ $(NULL)
+
TESTS=run-test.sh run-test-systemserver.sh
else
TESTS=
@@ -20,7 +29,7 @@ endif
EXTRA_DIST=run-test.sh run-test-systemserver.sh test-wait-for-echo.py test-activation-forking.py
-if DBUS_BUILD_TESTS
+if DBUS_ENABLE_EMBEDDED_TESTS
## we use noinst_PROGRAMS not check_PROGRAMS for TESTS so that we
## build even when not doing "make check"
@@ -31,9 +40,9 @@ test_pending_call_timeout_LDADD=$(top_builddir)/dbus/libdbus-internal.la
test_threads_init_LDADD=$(top_builddir)/dbus/libdbus-internal.la
test_ids_LDADD=$(top_builddir)/dbus/libdbus-internal.la
-test_shutdown_LDADD=../libdbus-testutils.la
-test_privserver_LDADD=../libdbus-testutils.la
-test_privserver_client_LDADD=../libdbus-testutils.la
-test_autolaunch_LDADD=../libdbus-testutils.la
+test_shutdown_LDADD=../libdbus-testutils-internal.la
+test_privserver_LDADD=../libdbus-testutils-internal.la
+test_privserver_client_LDADD=../libdbus-testutils-internal.la
+test_autolaunch_LDADD=../libdbus-testutils-internal.la
endif
diff --git a/test/name-test/Makefile.in b/test/name-test/Makefile.in
index 6ea051eb..466bd54d 100644
--- a/test/name-test/Makefile.in
+++ b/test/name-test/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.6 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -16,23 +15,51 @@
@SET_MAKE@
VPATH = @srcdir@
-am__make_dryrun = \
- { \
- am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
- *) \
- for am__flg in $$MAKEFLAGS; do \
- case $$am__flg in \
- *=*|--*) ;; \
- *n*) am__dry=yes; break;; \
- esac; \
- done;; \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
- test $$am__dry = yes; \
- }
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -51,18 +78,19 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-@DBUS_BUILD_TESTS_TRUE@TESTS = run-test.sh run-test-systemserver.sh
-@DBUS_BUILD_TESTS_TRUE@noinst_PROGRAMS = \
-@DBUS_BUILD_TESTS_TRUE@ test-pending-call-dispatch$(EXEEXT) \
-@DBUS_BUILD_TESTS_TRUE@ test-pending-call-timeout$(EXEEXT) \
-@DBUS_BUILD_TESTS_TRUE@ test-threads-init$(EXEEXT) \
-@DBUS_BUILD_TESTS_TRUE@ test-ids$(EXEEXT) \
-@DBUS_BUILD_TESTS_TRUE@ test-shutdown$(EXEEXT) \
-@DBUS_BUILD_TESTS_TRUE@ test-privserver$(EXEEXT) \
-@DBUS_BUILD_TESTS_TRUE@ test-privserver-client$(EXEEXT) \
-@DBUS_BUILD_TESTS_TRUE@ test-autolaunch$(EXEEXT)
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@TESTS = run-test.sh \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ run-test-systemserver.sh
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@noinst_PROGRAMS = test-pending-call-dispatch$(EXEEXT) \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-pending-call-timeout$(EXEEXT) \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-threads-init$(EXEEXT) \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-ids$(EXEEXT) \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-shutdown$(EXEEXT) \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-privserver$(EXEEXT) \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-privserver-client$(EXEEXT) \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ test-autolaunch$(EXEEXT)
subdir = test/name-test
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+ $(top_srcdir)/depcomp $(top_srcdir)/test-driver
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/libtool.m4 \
@@ -80,37 +108,46 @@ CONFIG_CLEAN_VPATH_FILES =
PROGRAMS = $(noinst_PROGRAMS)
test_autolaunch_SOURCES = test-autolaunch.c
test_autolaunch_OBJECTS = test-autolaunch.$(OBJEXT)
-@DBUS_BUILD_TESTS_TRUE@test_autolaunch_DEPENDENCIES = \
-@DBUS_BUILD_TESTS_TRUE@ ../libdbus-testutils.la
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@test_autolaunch_DEPENDENCIES = ../libdbus-testutils-internal.la
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
+am__v_lt_1 =
test_ids_SOURCES = test-ids.c
test_ids_OBJECTS = test-ids.$(OBJEXT)
-@DBUS_BUILD_TESTS_TRUE@test_ids_DEPENDENCIES = $(top_builddir)/dbus/libdbus-internal.la
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@test_ids_DEPENDENCIES = $(top_builddir)/dbus/libdbus-internal.la
test_pending_call_dispatch_SOURCES = test-pending-call-dispatch.c
test_pending_call_dispatch_OBJECTS = \
test-pending-call-dispatch.$(OBJEXT)
-@DBUS_BUILD_TESTS_TRUE@test_pending_call_dispatch_DEPENDENCIES = $(top_builddir)/dbus/libdbus-internal.la
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@test_pending_call_dispatch_DEPENDENCIES = $(top_builddir)/dbus/libdbus-internal.la
test_pending_call_timeout_SOURCES = test-pending-call-timeout.c
test_pending_call_timeout_OBJECTS = \
test-pending-call-timeout.$(OBJEXT)
-@DBUS_BUILD_TESTS_TRUE@test_pending_call_timeout_DEPENDENCIES = $(top_builddir)/dbus/libdbus-internal.la
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@test_pending_call_timeout_DEPENDENCIES = $(top_builddir)/dbus/libdbus-internal.la
test_privserver_SOURCES = test-privserver.c
test_privserver_OBJECTS = test-privserver.$(OBJEXT)
-@DBUS_BUILD_TESTS_TRUE@test_privserver_DEPENDENCIES = \
-@DBUS_BUILD_TESTS_TRUE@ ../libdbus-testutils.la
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@test_privserver_DEPENDENCIES = ../libdbus-testutils-internal.la
test_privserver_client_SOURCES = test-privserver-client.c
test_privserver_client_OBJECTS = test-privserver-client.$(OBJEXT)
-@DBUS_BUILD_TESTS_TRUE@test_privserver_client_DEPENDENCIES = \
-@DBUS_BUILD_TESTS_TRUE@ ../libdbus-testutils.la
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@test_privserver_client_DEPENDENCIES = ../libdbus-testutils-internal.la
test_shutdown_SOURCES = test-shutdown.c
test_shutdown_OBJECTS = test-shutdown.$(OBJEXT)
-@DBUS_BUILD_TESTS_TRUE@test_shutdown_DEPENDENCIES = \
-@DBUS_BUILD_TESTS_TRUE@ ../libdbus-testutils.la
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@test_shutdown_DEPENDENCIES = ../libdbus-testutils-internal.la
test_threads_init_SOURCES = test-threads-init.c
test_threads_init_OBJECTS = test-threads-init.$(OBJEXT)
-@DBUS_BUILD_TESTS_TRUE@test_threads_init_DEPENDENCIES = $(top_builddir)/dbus/libdbus-internal.la
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@test_threads_init_DEPENDENCIES = $(top_builddir)/dbus/libdbus-internal.la
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@@ -123,20 +160,16 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
SOURCES = test-autolaunch.c test-ids.c test-pending-call-dispatch.c \
test-pending-call-timeout.c test-privserver.c \
test-privserver-client.c test-shutdown.c test-threads-init.c
@@ -149,10 +182,229 @@ am__can_run_installinfo = \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
-am__tty_colors = \
-red=; grn=; lgn=; blu=; std=
+am__tty_colors_dummy = \
+ mgn= red= grn= lgn= blu= brg= std=; \
+ am__color_tests=no
+am__tty_colors = { \
+ $(am__tty_colors_dummy); \
+ if test "X$(AM_COLOR_TESTS)" = Xno; then \
+ am__color_tests=no; \
+ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+ am__color_tests=yes; \
+ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+ am__color_tests=yes; \
+ fi; \
+ if test $$am__color_tests = yes; then \
+ red=''; \
+ grn=''; \
+ lgn=''; \
+ blu=''; \
+ mgn=''; \
+ brg=''; \
+ std=''; \
+ fi; \
+}
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__recheck_rx = ^[ ]*:recheck:[ ]*
+am__global_test_result_rx = ^[ ]*:global-test-result:[ ]*
+am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]*
+# A command that, given a newline-separated list of test names on the
+# standard input, print the name of the tests that are to be re-run
+# upon "make recheck".
+am__list_recheck_tests = $(AWK) '{ \
+ recheck = 1; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ { \
+ if ((getline line2 < ($$0 ".log")) < 0) \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
+ { \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
+ { \
+ break; \
+ } \
+ }; \
+ if (recheck) \
+ print $$0; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# A command that, given a newline-separated list of test names on the
+# standard input, create the global log from their .trs and .log files.
+am__create_global_log = $(AWK) ' \
+function fatal(msg) \
+{ \
+ print "fatal: making $@: " msg | "cat >&2"; \
+ exit 1; \
+} \
+function rst_section(header) \
+{ \
+ print header; \
+ len = length(header); \
+ for (i = 1; i <= len; i = i + 1) \
+ printf "="; \
+ printf "\n\n"; \
+} \
+{ \
+ copy_in_global_log = 1; \
+ global_test_result = "RUN"; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".trs"); \
+ if (line ~ /$(am__global_test_result_rx)/) \
+ { \
+ sub("$(am__global_test_result_rx)", "", line); \
+ sub("[ ]*$$", "", line); \
+ global_test_result = line; \
+ } \
+ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
+ copy_in_global_log = 0; \
+ }; \
+ if (copy_in_global_log) \
+ { \
+ rst_section(global_test_result ": " $$0); \
+ while ((rc = (getline line < ($$0 ".log"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".log"); \
+ print line; \
+ }; \
+ printf "\n"; \
+ }; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# Restructured Text title.
+am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+# Solaris 10 'make', and several other traditional 'make' implementations,
+# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it
+# by disabling -e (using the XSI extension "set +e") if it's set.
+am__sh_e_setup = case $$- in *e*) set +e;; esac
+# Default flags passed to test drivers.
+am__common_driver_flags = \
+ --color-tests "$$am__color_tests" \
+ --enable-hard-errors "$$am__enable_hard_errors" \
+ --expect-failure "$$am__expect_failure"
+# To be inserted before the command running the test. Creates the
+# directory for the log if needed. Stores in $dir the directory
+# containing $f, in $tst the test, in $log the log. Executes the
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# passes TESTS_ENVIRONMENT. Set up options for the wrapper that
+# will run the test scripts (or their associated LOG_COMPILER, if
+# thy have one).
+am__check_pre = \
+$(am__sh_e_setup); \
+$(am__vpath_adj_setup) $(am__vpath_adj) \
+$(am__tty_colors); \
+srcdir=$(srcdir); export srcdir; \
+case "$@" in \
+ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \
+ *) am__odir=.;; \
+esac; \
+test "x$$am__odir" = x"." || test -d "$$am__odir" \
+ || $(MKDIR_P) "$$am__odir" || exit $$?; \
+if test -f "./$$f"; then dir=./; \
+elif test -f "$$f"; then dir=; \
+else dir="$(srcdir)/"; fi; \
+tst=$$dir$$f; log='$@'; \
+if test -n '$(DISABLE_HARD_ERRORS)'; then \
+ am__enable_hard_errors=no; \
+else \
+ am__enable_hard_errors=yes; \
+fi; \
+case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \
+ am__expect_failure=yes;; \
+ *) \
+ am__expect_failure=no;; \
+esac; \
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
+# A shell command to get the names of the tests scripts with any registered
+# extension removed (i.e., equivalently, the names of the test logs, with
+# the '.log' extension removed). The result is saved in the shell variable
+# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly,
+# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
+# since that might cause problem with VPATH rewrites for suffix-less tests.
+# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
+am__set_TESTS_bases = \
+ bases='$(TEST_LOGS)'; \
+ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+ bases=`echo $$bases`
+RECHECK_LOGS = $(TEST_LOGS)
+AM_RECURSIVE_TARGETS = check recheck
+TEST_SUITE_LOG = test-suite.log
+TEST_EXTENSIONS = @EXEEXT@ .test
+LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
+LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS)
+am__set_b = \
+ case '$@' in \
+ */*) \
+ case '$*' in \
+ */*) b='$*';; \
+ *) b=`echo '$@' | sed 's/\.log$$//'`; \
+ esac;; \
+ *) \
+ b='$*';; \
+ esac
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
+TEST_LOGS = $(am__test_logs2:.test.log=.log)
+TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
+TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
+ $(TEST_LOG_FLAGS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ADT_LIBS = @ADT_LIBS@
@@ -182,7 +434,6 @@ 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@
DBUS_INT64_CONSTANT = @DBUS_INT64_CONSTANT@
@@ -193,7 +444,8 @@ DBUS_MICRO_VERSION = @DBUS_MICRO_VERSION@
DBUS_MINOR_VERSION = @DBUS_MINOR_VERSION@
DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@
DBUS_PREFIX = @DBUS_PREFIX@
-DBUS_SESSION_BUS_DEFAULT_ADDRESS = @DBUS_SESSION_BUS_DEFAULT_ADDRESS@
+DBUS_SESSION_BUS_CONNECT_ADDRESS = @DBUS_SESSION_BUS_CONNECT_ADDRESS@
+DBUS_SESSION_BUS_LISTEN_ADDRESS = @DBUS_SESSION_BUS_LISTEN_ADDRESS@
DBUS_SESSION_SOCKET_DIR = @DBUS_SESSION_SOCKET_DIR@
DBUS_STATIC_BUILD_CPPFLAGS = @DBUS_STATIC_BUILD_CPPFLAGS@
DBUS_SYSTEM_BUS_DEFAULT_ADDRESS = @DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@
@@ -242,8 +494,6 @@ LIBDBUS_LIBS = @LIBDBUS_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
-LIBXML_CFLAGS = @LIBXML_CFLAGS@
-LIBXML_LIBS = @LIBXML_LIBS@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
@@ -252,7 +502,6 @@ LT_CURRENT = @LT_CURRENT@
LT_REVISION = @LT_REVISION@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
-MAN2HTML = @MAN2HTML@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NETWORK_libs = @NETWORK_libs@
@@ -286,7 +535,6 @@ SHELL = @SHELL@
STRIP = @STRIP@
SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
SYSTEMD_LIBS = @SYSTEMD_LIBS@
-TEST_BUS_BINARY = @TEST_BUS_BINARY@
TEST_LAUNCH_HELPER_BINARY = @TEST_LAUNCH_HELPER_BINARY@
TEST_LISTEN = @TEST_LISTEN@
TEST_SOCKET_DIR = @TEST_SOCKET_DIR@
@@ -368,25 +616,34 @@ AM_CPPFLAGS = \
-I$(top_srcdir) \
-DDBUS_COMPILATION \
-DDBUS_STATIC_BUILD \
+ -DDBUS_TEST_USE_INTERNAL \
$(NULL)
# if assertions are enabled, improve backtraces
AM_LDFLAGS = @R_DYNAMIC_LDFLAG@
-@DBUS_BUILD_TESTS_TRUE@TESTS_ENVIRONMENT = DBUS_TOP_BUILDDIR=@abs_top_builddir@ DBUS_TOP_SRCDIR=@abs_top_srcdir@ PYTHON=@PYTHON@
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@TESTS_ENVIRONMENT = \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ DBUS_TOP_BUILDDIR=@abs_top_builddir@ \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ DBUS_TOP_SRCDIR=@abs_top_srcdir@ \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ PYTHON=@PYTHON@ \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ DBUS_TEST_DATA=@abs_top_builddir@/test/data \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ DBUS_TEST_DAEMON=@abs_top_builddir@/bus/dbus-daemon$(EXEEXT) \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ XDG_RUNTIME_DIR=@abs_top_builddir@/test/XDG_RUNTIME_DIR \
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@ $(NULL)
+
EXTRA_DIST = run-test.sh run-test-systemserver.sh test-wait-for-echo.py test-activation-forking.py
-@DBUS_BUILD_TESTS_TRUE@test_pending_call_dispatch_LDADD = $(top_builddir)/dbus/libdbus-internal.la
-@DBUS_BUILD_TESTS_TRUE@test_pending_call_timeout_LDADD = $(top_builddir)/dbus/libdbus-internal.la
-@DBUS_BUILD_TESTS_TRUE@test_threads_init_LDADD = $(top_builddir)/dbus/libdbus-internal.la
-@DBUS_BUILD_TESTS_TRUE@test_ids_LDADD = $(top_builddir)/dbus/libdbus-internal.la
-@DBUS_BUILD_TESTS_TRUE@test_shutdown_LDADD = ../libdbus-testutils.la
-@DBUS_BUILD_TESTS_TRUE@test_privserver_LDADD = ../libdbus-testutils.la
-@DBUS_BUILD_TESTS_TRUE@test_privserver_client_LDADD = ../libdbus-testutils.la
-@DBUS_BUILD_TESTS_TRUE@test_autolaunch_LDADD = ../libdbus-testutils.la
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@test_pending_call_dispatch_LDADD = $(top_builddir)/dbus/libdbus-internal.la
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@test_pending_call_timeout_LDADD = $(top_builddir)/dbus/libdbus-internal.la
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@test_threads_init_LDADD = $(top_builddir)/dbus/libdbus-internal.la
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@test_ids_LDADD = $(top_builddir)/dbus/libdbus-internal.la
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@test_shutdown_LDADD = ../libdbus-testutils-internal.la
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@test_privserver_LDADD = ../libdbus-testutils-internal.la
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@test_privserver_client_LDADD = ../libdbus-testutils-internal.la
+@DBUS_ENABLE_EMBEDDED_TESTS_TRUE@test_autolaunch_LDADD = ../libdbus-testutils-internal.la
all: all-am
.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
+.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
@@ -426,27 +683,35 @@ clean-noinstPROGRAMS:
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
+
test-autolaunch$(EXEEXT): $(test_autolaunch_OBJECTS) $(test_autolaunch_DEPENDENCIES) $(EXTRA_test_autolaunch_DEPENDENCIES)
@rm -f test-autolaunch$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_autolaunch_OBJECTS) $(test_autolaunch_LDADD) $(LIBS)
+
test-ids$(EXEEXT): $(test_ids_OBJECTS) $(test_ids_DEPENDENCIES) $(EXTRA_test_ids_DEPENDENCIES)
@rm -f test-ids$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_ids_OBJECTS) $(test_ids_LDADD) $(LIBS)
+
test-pending-call-dispatch$(EXEEXT): $(test_pending_call_dispatch_OBJECTS) $(test_pending_call_dispatch_DEPENDENCIES) $(EXTRA_test_pending_call_dispatch_DEPENDENCIES)
@rm -f test-pending-call-dispatch$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_pending_call_dispatch_OBJECTS) $(test_pending_call_dispatch_LDADD) $(LIBS)
+
test-pending-call-timeout$(EXEEXT): $(test_pending_call_timeout_OBJECTS) $(test_pending_call_timeout_DEPENDENCIES) $(EXTRA_test_pending_call_timeout_DEPENDENCIES)
@rm -f test-pending-call-timeout$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_pending_call_timeout_OBJECTS) $(test_pending_call_timeout_LDADD) $(LIBS)
+
test-privserver$(EXEEXT): $(test_privserver_OBJECTS) $(test_privserver_DEPENDENCIES) $(EXTRA_test_privserver_DEPENDENCIES)
@rm -f test-privserver$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_privserver_OBJECTS) $(test_privserver_LDADD) $(LIBS)
+
test-privserver-client$(EXEEXT): $(test_privserver_client_OBJECTS) $(test_privserver_client_DEPENDENCIES) $(EXTRA_test_privserver_client_DEPENDENCIES)
@rm -f test-privserver-client$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_privserver_client_OBJECTS) $(test_privserver_client_LDADD) $(LIBS)
+
test-shutdown$(EXEEXT): $(test_shutdown_OBJECTS) $(test_shutdown_DEPENDENCIES) $(EXTRA_test_shutdown_DEPENDENCIES)
@rm -f test-shutdown$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_shutdown_OBJECTS) $(test_shutdown_LDADD) $(LIBS)
+
test-threads-init$(EXEEXT): $(test_threads_init_OBJECTS) $(test_threads_init_DEPENDENCIES) $(EXTRA_test_threads_init_DEPENDENCIES)
@rm -f test-threads-init$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_threads_init_OBJECTS) $(test_threads_init_LDADD) $(LIBS)
@@ -471,14 +736,14 @@ distclean-compile:
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -493,26 +758,15 @@ mostlyclean-libtool:
clean-libtool:
-rm -rf .libs _libs
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
+ $(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
@@ -524,15 +778,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$$unique; \
fi; \
fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
@@ -541,102 +791,194 @@ GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-check-TESTS: $(TESTS)
- @failed=0; all=0; xfail=0; xpass=0; skip=0; \
- srcdir=$(srcdir); export srcdir; \
- list=' $(TESTS) '; \
- $(am__tty_colors); \
- if test -n "$$list"; then \
- for tst in $$list; do \
- if test -f ./$$tst; then dir=./; \
- elif test -f $$tst; then dir=; \
- else dir="$(srcdir)/"; fi; \
- if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
- all=`expr $$all + 1`; \
- case " $(XFAIL_TESTS) " in \
- *[\ \ ]$$tst[\ \ ]*) \
- xpass=`expr $$xpass + 1`; \
- failed=`expr $$failed + 1`; \
- col=$$red; res=XPASS; \
- ;; \
- *) \
- col=$$grn; res=PASS; \
- ;; \
- esac; \
- elif test $$? -ne 77; then \
- all=`expr $$all + 1`; \
- case " $(XFAIL_TESTS) " in \
- *[\ \ ]$$tst[\ \ ]*) \
- xfail=`expr $$xfail + 1`; \
- col=$$lgn; res=XFAIL; \
- ;; \
- *) \
- failed=`expr $$failed + 1`; \
- col=$$red; res=FAIL; \
- ;; \
- esac; \
- else \
- skip=`expr $$skip + 1`; \
- col=$$blu; res=SKIP; \
- fi; \
- echo "$${col}$$res$${std}: $$tst"; \
- done; \
- if test "$$all" -eq 1; then \
- tests="test"; \
- All=""; \
- else \
- tests="tests"; \
- All="All "; \
+# Recover from deleted '.trs' file; this should ensure that
+# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
+# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells
+# to avoid problems with "make -n".
+.log.trs:
+ rm -f $< $@
+ $(MAKE) $(AM_MAKEFLAGS) $<
+
+# Leading 'am--fnord' is there to ensure the list of targets does not
+# expand to empty, as could happen e.g. with make check TESTS=''.
+am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
+am--force-recheck:
+ @:
+
+$(TEST_SUITE_LOG): $(TEST_LOGS)
+ @$(am__set_TESTS_bases); \
+ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
+ redo_bases=`for i in $$bases; do \
+ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
+ done`; \
+ if test -n "$$redo_bases"; then \
+ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
+ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
+ if $(am__make_dryrun); then :; else \
+ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
fi; \
- if test "$$failed" -eq 0; then \
- if test "$$xfail" -eq 0; then \
- banner="$$All$$all $$tests passed"; \
- else \
- if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
- banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
- fi; \
- else \
- if test "$$xpass" -eq 0; then \
- banner="$$failed of $$all $$tests failed"; \
+ fi; \
+ if test -n "$$am__remaking_logs"; then \
+ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
+ "recursion detected" >&2; \
+ else \
+ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
+ fi; \
+ if $(am__make_dryrun); then :; else \
+ st=0; \
+ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
+ for i in $$redo_bases; do \
+ test -f $$i.trs && test -r $$i.trs \
+ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
+ test -f $$i.log && test -r $$i.log \
+ || { echo "$$errmsg $$i.log" >&2; st=1; }; \
+ done; \
+ test $$st -eq 0 || exit 1; \
+ fi
+ @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+ ws='[ ]'; \
+ results=`for b in $$bases; do echo $$b.trs; done`; \
+ test -n "$$results" || results=/dev/null; \
+ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
+ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
+ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
+ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
+ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+ if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+ success=true; \
+ else \
+ success=false; \
+ fi; \
+ br='==================='; br=$$br$$br$$br$$br; \
+ result_count () \
+ { \
+ if test x"$$1" = x"--maybe-color"; then \
+ maybe_colorize=yes; \
+ elif test x"$$1" = x"--no-color"; then \
+ maybe_colorize=no; \
else \
- if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
- banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
+ echo "$@: invalid 'result_count' usage" >&2; exit 4; \
fi; \
- fi; \
- dashes="$$banner"; \
- skipped=""; \
- if test "$$skip" -ne 0; then \
- if test "$$skip" -eq 1; then \
- skipped="($$skip test was not run)"; \
+ shift; \
+ desc=$$1 count=$$2; \
+ if test $$maybe_colorize = yes && test $$count -gt 0; then \
+ color_start=$$3 color_end=$$std; \
else \
- skipped="($$skip tests were not run)"; \
+ color_start= color_end=; \
fi; \
- test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
- dashes="$$skipped"; \
- fi; \
- report=""; \
- if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
- report="Please report to $(PACKAGE_BUGREPORT)"; \
- test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
- dashes="$$report"; \
- fi; \
- dashes=`echo "$$dashes" | sed s/./=/g`; \
- if test "$$failed" -eq 0; then \
- col="$$grn"; \
- else \
- col="$$red"; \
- fi; \
- echo "$${col}$$dashes$${std}"; \
- echo "$${col}$$banner$${std}"; \
- test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
- test -z "$$report" || echo "$${col}$$report$${std}"; \
- echo "$${col}$$dashes$${std}"; \
- test "$$failed" -eq 0; \
- else :; fi
+ echo "$${color_start}# $$desc $$count$${color_end}"; \
+ }; \
+ create_testsuite_report () \
+ { \
+ result_count $$1 "TOTAL:" $$all "$$brg"; \
+ result_count $$1 "PASS: " $$pass "$$grn"; \
+ result_count $$1 "SKIP: " $$skip "$$blu"; \
+ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+ result_count $$1 "FAIL: " $$fail "$$red"; \
+ result_count $$1 "XPASS:" $$xpass "$$red"; \
+ result_count $$1 "ERROR:" $$error "$$mgn"; \
+ }; \
+ { \
+ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
+ $(am__rst_title); \
+ create_testsuite_report --no-color; \
+ echo; \
+ echo ".. contents:: :depth: 2"; \
+ echo; \
+ for b in $$bases; do echo $$b; done \
+ | $(am__create_global_log); \
+ } >$(TEST_SUITE_LOG).tmp || exit 1; \
+ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
+ if $$success; then \
+ col="$$grn"; \
+ else \
+ col="$$red"; \
+ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
+ fi; \
+ echo "$${col}$$br$${std}"; \
+ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
+ echo "$${col}$$br$${std}"; \
+ create_testsuite_report --maybe-color; \
+ echo "$$col$$br$$std"; \
+ if $$success; then :; else \
+ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
+ if test -n "$(PACKAGE_BUGREPORT)"; then \
+ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
+ fi; \
+ echo "$$col$$br$$std"; \
+ fi; \
+ $$success || exit 1
+
+check-TESTS:
+ @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
+ @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ trs_list=`for i in $$bases; do echo $$i.trs; done`; \
+ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
+ exit $$?;
+recheck: all
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ bases=`for i in $$bases; do echo $$i; done \
+ | $(am__list_recheck_tests)` || exit 1; \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ log_list=`echo $$log_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
+ am__force_recheck=am--force-recheck \
+ TEST_LOGS="$$log_list"; \
+ exit $$?
+run-test.sh.log: run-test.sh
+ @p='run-test.sh'; \
+ b='run-test.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+run-test-systemserver.sh.log: run-test-systemserver.sh
+ @p='run-test-systemserver.sh'; \
+ b='run-test-systemserver.sh'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+.test.log:
+ @p='$<'; \
+ $(am__set_b); \
+ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+@am__EXEEXT_TRUE@.test$(EXEEXT).log:
+@am__EXEEXT_TRUE@ @p='$<'; \
+@am__EXEEXT_TRUE@ $(am__set_b); \
+@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
+@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -693,6 +1035,9 @@ install-strip:
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
+ -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
+ -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
+ -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
clean-generic:
@@ -776,9 +1121,9 @@ uninstall-am:
.MAKE: check-am install-am install-strip
-.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
- clean-generic clean-libtool clean-noinstPROGRAMS ctags \
- distclean distclean-compile distclean-generic \
+.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \
+ clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \
+ ctags ctags-am 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 \
@@ -788,7 +1133,7 @@ uninstall-am:
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags uninstall uninstall-am
+ recheck tags tags-am uninstall uninstall-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/test/name-test/run-test-systemserver.sh b/test/name-test/run-test-systemserver.sh
index afd1f045..90c03723 100755
--- a/test/name-test/run-test-systemserver.sh
+++ b/test/name-test/run-test-systemserver.sh
@@ -30,6 +30,11 @@ if test -n "$DBUS_TEST_MONITOR"; then
dbus-monitor --session &
fi
+XDG_RUNTIME_DIR="$DBUS_TOP_BUILDDIR"/test/XDG_RUNTIME_DIR
+test -d "$XDG_RUNTIME_DIR" || mkdir "$XDG_RUNTIME_DIR"
+chmod 0700 "$XDG_RUNTIME_DIR"
+export XDG_RUNTIME_DIR
+
echo "running test-expected-echo-fail"
${DBUS_TOP_BUILDDIR}/libtool --mode=execute $DEBUG $DBUS_TOP_BUILDDIR/tools/dbus-send --print-reply --dest=org.freedesktop.DBus.TestSuiteEchoService /org/freedesktop/TestSuite org.freedesktop.TestSuite.Echo string:hi >echo-error-output.tmp 2>&1
if ! grep -q 'DBus.Error' echo-error-output.tmp; then
diff --git a/test/name-test/run-test.sh b/test/name-test/run-test.sh
index cad5937e..84379c4a 100755
--- a/test/name-test/run-test.sh
+++ b/test/name-test/run-test.sh
@@ -30,6 +30,11 @@ if test -n "$DBUS_TEST_MONITOR"; then
dbus-monitor --session &
fi
+XDG_RUNTIME_DIR="$DBUS_TOP_BUILDDIR"/test/XDG_RUNTIME_DIR
+test -d "$XDG_RUNTIME_DIR" || mkdir "$XDG_RUNTIME_DIR"
+chmod 0700 "$XDG_RUNTIME_DIR"
+export XDG_RUNTIME_DIR
+
echo "running test-ids"
${DBUS_TOP_BUILDDIR}/libtool --mode=execute $DEBUG $DBUS_TOP_BUILDDIR/test/name-test/test-ids || die "test-ids failed"
diff --git a/test/name-test/test-autolaunch.c b/test/name-test/test-autolaunch.c
index 5e519895..8b5206a6 100644
--- a/test/name-test/test-autolaunch.c
+++ b/test/name-test/test-autolaunch.c
@@ -1,3 +1,5 @@
+#include "config.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -14,21 +16,23 @@ main (int argc, char *argv[])
DBusConnection *conn = NULL;
DBusError error;
- _dbus_setenv ("DBUS_SESSION_BUS_ADDRESS", NULL);
+ dbus_setenv ("DBUS_SESSION_BUS_ADDRESS", NULL);
dbus_error_init (&error);
conn = dbus_bus_get (DBUS_BUS_SESSION, &error);
#ifdef DBUS_ENABLE_X11_AUTOLAUNCH
- if (dbus_error_is_set (&error))
+ /* If X11 autolaunch was enabled, we expect dbus-launch to have worked. */
+ if (_dbus_getenv ("DISPLAY") != NULL && dbus_error_is_set (&error))
{
fprintf (stderr, "*** Failed to autolaunch session bus: %s\n",
error.message);
dbus_error_free (&error);
return 1;
}
-#else
+#endif
+
/* We don't necessarily expect it to *work* without X (although it might -
* for instance on Mac OS it might have used launchd). Just check that the
* results are consistent. */
@@ -38,7 +42,6 @@ main (int argc, char *argv[])
fprintf (stderr, "*** Autolaunched session bus, but an error was set!\n");
return 1;
}
-#endif
if (!dbus_error_is_set (&error) && conn == NULL)
{
diff --git a/test/name-test/test-threads-init.c b/test/name-test/test-threads-init.c
index 5e22852a..580ffe14 100644
--- a/test/name-test/test-threads-init.c
+++ b/test/name-test/test-threads-init.c
@@ -149,11 +149,15 @@ main (int argc, char *argv[])
&dispatch_cond1,
&io_path_cond1);
- check_mutex_lock (mutex1, mutex2, FALSE);
- check_mutex_lock (dispatch_mutex1, dispatch_mutex2, FALSE);
- check_mutex_lock (io_path_mutex1, io_path_mutex2, FALSE);
- check_condvar_lock (dispatch_cond1, dispatch_cond2, FALSE);
- check_condvar_lock (io_path_cond1, io_path_cond2, FALSE);
+ /* Since 1.7 it is no longer the case that mutex1 != mutex2, because
+ * initializing global locks automatically initializes locks
+ * in general. However, it is true that the mutex is not the dummy
+ * implementation, which is what we really wanted to check here. */
+ _dbus_assert (mutex1 != (DBusMutex *) 0xABCDEF);
+ _dbus_assert (dispatch_mutex1 != (DBusMutex *) 0xABCDEF);
+ _dbus_assert (dispatch_cond1 != (DBusCondVar *) 0xABCDEF2);
+ _dbus_assert (io_path_mutex1 != (DBusMutex *) 0xABCDEF);
+ _dbus_assert (io_path_cond1 != (DBusCondVar *) 0xABCDEF2);
_run_iteration (conn);
_dbus_connection_test_get_locks (conn, &mutex2,
diff --git a/test/relay.c b/test/relay.c
index f4129d0a..ecfe4c82 100644
--- a/test/relay.c
+++ b/test/relay.c
@@ -29,7 +29,8 @@
#include <glib.h>
#include <dbus/dbus.h>
-#include <dbus/dbus-glib-lowlevel.h>
+
+#include "test-utils.h"
/* This is basically a miniature dbus-daemon. We relay messages from the client
* on the left to the client on the right.
@@ -43,6 +44,7 @@
*/
typedef struct {
+ TestMainContext *ctx;
DBusError e;
DBusServer *server;
@@ -113,13 +115,14 @@ new_conn_cb (DBusServer *server,
f->right_server_conn = dbus_connection_ref (server_conn);
}
- dbus_connection_setup_with_g_main (server_conn, NULL);
+ test_connection_setup (f->ctx, server_conn);
}
static void
setup (Fixture *f,
gconstpointer data G_GNUC_UNUSED)
{
+ f->ctx = test_main_context_get ();
dbus_error_init (&f->e);
g_queue_init (&f->messages);
@@ -129,7 +132,7 @@ setup (Fixture *f,
dbus_server_set_new_connection_function (f->server,
new_conn_cb, f, NULL);
- dbus_server_setup_with_g_main (f->server, NULL);
+ test_server_setup (f->ctx, f->server);
}
static void
@@ -148,25 +151,25 @@ test_connect (Fixture *f,
f->left_client_conn = dbus_connection_open_private (address, &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);
+ test_connection_setup (f->ctx, f->left_client_conn);
while (f->left_server_conn == NULL)
{
g_print (".");
- g_main_context_iteration (NULL, TRUE);
+ test_main_context_iterate (f->ctx, TRUE);
}
f->right_client_conn = dbus_connection_open_private (address, &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);
+ test_connection_setup (f->ctx, f->right_client_conn);
dbus_free (address);
while (f->right_server_conn == NULL)
{
g_print (".");
- g_main_context_iteration (NULL, TRUE);
+ test_main_context_iterate (f->ctx, TRUE);
}
have_mem = dbus_connection_add_filter (f->right_client_conn,
@@ -208,7 +211,7 @@ test_relay (Fixture *f,
while (g_queue_get_length (&f->messages) < 2)
{
g_print (".");
- g_main_context_iteration (NULL, TRUE);
+ test_main_context_iterate (f->ctx, TRUE);
}
g_assert_cmpuint (g_queue_get_length (&f->messages), ==, 2);
@@ -237,7 +240,7 @@ test_limit (Fixture *f,
/* 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);
+ test_main_context_iterate (f->ctx, TRUE);
for (i = 0; i < MANY; i++)
{
@@ -253,7 +256,7 @@ test_limit (Fixture *f,
{
while (g_queue_is_empty (&f->messages))
{
- g_main_context_iteration (NULL, TRUE);
+ test_main_context_iterate (f->ctx, TRUE);
}
while ((incoming = g_queue_pop_head (&f->messages)) != NULL)
@@ -302,6 +305,8 @@ teardown (Fixture *f,
dbus_server_unref (f->server);
f->server = NULL;
}
+
+ test_main_context_unref (f->ctx);
}
int
diff --git a/test/shell-test.c b/test/shell-test.c
index b479a9c6..d1dc5b5b 100644
--- a/test/shell-test.c
+++ b/test/shell-test.c
@@ -1,7 +1,7 @@
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
-#define DBUS_COMPILATION
+
#include <dbus/dbus-internals.h>
#include <dbus/dbus-list.h>
#include <dbus/dbus-memory.h>
diff --git a/test/spawn-test.c b/test/spawn-test.c
index f1a55051..723a4889 100644
--- a/test/spawn-test.c
+++ b/test/spawn-test.c
@@ -1,10 +1,8 @@
#include <config.h>
#include <dbus/dbus.h>
-#define DBUS_COMPILATION /* cheat and use dbus-sysdeps */
#include <dbus/dbus-sysdeps.h>
#include <dbus/dbus-spawn.h>
-#undef DBUS_COMPILATION
#include <stdio.h>
static void
@@ -32,7 +30,7 @@ main (int argc, char **argv)
argv_copy [i] = argv[i + 1];
argv_copy[argc - 1] = NULL;
- if (!_dbus_spawn_async_with_babysitter (NULL, argv_copy, NULL, setup_func, NULL, &error))
+ if (!_dbus_spawn_async_with_babysitter (NULL, argv_copy[0], argv_copy, NULL, setup_func, NULL, &error))
{
fprintf (stderr, "Could not launch application: \"%s\"\n",
error.message);
diff --git a/test/test-exit.c b/test/test-exit.c
index f3358185..b4f967ae 100644
--- a/test/test-exit.c
+++ b/test/test-exit.c
@@ -1,3 +1,5 @@
+#include "config.h"
+
/* This is a process that just exits with a failure code */
int
main (int argc, char **argv)
diff --git a/test/test-segfault.c b/test/test-segfault.c
index 329a21fd..c062ce1c 100644
--- a/test/test-segfault.c
+++ b/test/test-segfault.c
@@ -9,18 +9,34 @@
#include <sys/resource.h>
#endif
+#ifdef HAVE_SYS_PRCTL_H
+#include <sys/prctl.h>
+#endif
+
int
main (int argc, char **argv)
{
char *p;
#if HAVE_SETRLIMIT
+ /* No core dumps please, we know we crashed. */
struct rlimit r = { 0, };
getrlimit (RLIMIT_CORE, &r);
r.rlim_cur = 0;
setrlimit (RLIMIT_CORE, &r);
-
+#endif
+
+#if defined(HAVE_PRCTL) && defined(PR_SET_DUMPABLE)
+ /* Really, no core dumps please. On Linux, if core_pattern is
+ * set to a pipe (for abrt/apport/corekeeper/etc.), RLIMIT_CORE of 0
+ * is ignored (deliberately, so people can debug init(8) and other
+ * early stuff); but Linux has PR_SET_DUMPABLE, so we can avoid core
+ * dumps anyway. */
+ prctl (PR_SET_DUMPABLE, 0, 0, 0, 0);
+#endif
+
+#ifdef HAVE_RAISE
raise (SIGSEGV);
#endif
p = NULL;
diff --git a/test/test-utils.c b/test/test-utils.c
index c3c3ed34..9a4f3584 100644
--- a/test/test-utils.c
+++ b/test/test-utils.c
@@ -1,6 +1,13 @@
#include <config.h>
#include "test-utils.h"
+#ifndef DBUS_TEST_USE_INTERNAL
+# include <dbus/dbus.h>
+# include <dbus/dbus-glib-lowlevel.h>
+#endif
+
+#ifdef DBUS_TEST_USE_INTERNAL
+
typedef struct
{
DBusLoop *loop;
@@ -97,10 +104,14 @@ cdata_new (DBusLoop *loop,
return cd;
}
+#endif /* DBUS_TEST_USE_INTERNAL */
+
dbus_bool_t
-test_connection_setup (DBusLoop *loop,
+test_connection_setup (TestMainContext *ctx,
DBusConnection *connection)
{
+#ifdef DBUS_TEST_USE_INTERNAL
+ DBusLoop *loop = ctx;
CData *cd;
cd = NULL;
@@ -148,10 +159,23 @@ test_connection_setup (DBusLoop *loop,
dbus_connection_set_timeout_functions (connection, NULL, NULL, NULL, NULL, NULL);
return FALSE;
+#else /* !DBUS_TEST_USE_INTERNAL */
+
+ dbus_connection_setup_with_g_main (connection, ctx);
+ return TRUE;
+
+#endif /* !DBUS_TEST_USE_INTERNAL */
+}
+
+static void
+die (const char *message)
+{
+ fprintf (stderr, "*** %s", message);
+ exit (1);
}
void
-test_connection_shutdown (DBusLoop *loop,
+test_connection_shutdown (TestMainContext *ctx,
DBusConnection *connection)
{
if (!dbus_connection_set_watch_functions (connection,
@@ -159,18 +183,20 @@ test_connection_shutdown (DBusLoop *loop,
NULL,
NULL,
NULL, NULL))
- _dbus_assert_not_reached ("setting watch functions to NULL failed");
+ die ("setting watch functions to NULL failed");
if (!dbus_connection_set_timeout_functions (connection,
NULL,
NULL,
NULL,
NULL, NULL))
- _dbus_assert_not_reached ("setting timeout functions to NULL failed");
+ die ("setting timeout functions to NULL failed");
dbus_connection_set_dispatch_status_function (connection, NULL, NULL, NULL);
}
+#ifdef DBUS_TEST_USE_INTERNAL
+
typedef struct
{
DBusLoop *loop;
@@ -252,10 +278,14 @@ remove_server_timeout (DBusTimeout *timeout,
_dbus_loop_remove_timeout (context->loop, timeout);
}
+#endif /* DBUS_TEST_USE_INTERNAL */
+
dbus_bool_t
-test_server_setup (DBusLoop *loop,
+test_server_setup (TestMainContext *ctx,
DBusServer *server)
{
+#ifdef DBUS_TEST_USE_INTERNAL
+ DBusLoop *loop = ctx;
ServerData *sd;
sd = serverdata_new (loop, server);
@@ -293,10 +323,17 @@ test_server_setup (DBusLoop *loop,
test_server_shutdown (loop, server);
return FALSE;
+
+#else /* !DBUS_TEST_USE_INTERNAL */
+
+ dbus_server_setup_with_g_main (server, ctx);
+ return TRUE;
+
+#endif /* !DBUS_TEST_USE_INTERNAL */
}
void
-test_server_shutdown (DBusLoop *loop,
+test_server_shutdown (TestMainContext *ctx,
DBusServer *server)
{
dbus_server_disconnect (server);
@@ -305,11 +342,51 @@ test_server_shutdown (DBusLoop *loop,
NULL, NULL, NULL,
NULL,
NULL))
- _dbus_assert_not_reached ("setting watch functions to NULL failed");
+ die ("setting watch functions to NULL failed");
if (!dbus_server_set_timeout_functions (server,
NULL, NULL, NULL,
NULL,
NULL))
- _dbus_assert_not_reached ("setting timeout functions to NULL failed");
+ die ("setting timeout functions to NULL failed");
+}
+
+TestMainContext *
+test_main_context_get (void)
+{
+#ifdef DBUS_TEST_USE_INTERNAL
+ return _dbus_loop_new ();
+#else
+ /* I suspect dbus-glib relies the default main context in some places */
+ return g_main_context_ref (g_main_context_default ());
+#endif
+}
+
+TestMainContext *
+test_main_context_ref (TestMainContext *ctx)
+{
+#ifdef DBUS_TEST_USE_INTERNAL
+ return _dbus_loop_ref (ctx);
+#else
+ return g_main_context_ref (ctx);
+#endif
+}
+
+void test_main_context_unref (TestMainContext *ctx)
+{
+#ifdef DBUS_TEST_USE_INTERNAL
+ _dbus_loop_unref (ctx);
+#else
+ g_main_context_unref (ctx);
+#endif
+}
+
+void test_main_context_iterate (TestMainContext *ctx,
+ dbus_bool_t may_block)
+{
+#ifdef DBUS_TEST_USE_INTERNAL
+ _dbus_loop_iterate (ctx, may_block);
+#else
+ g_main_context_iteration (ctx, may_block);
+#endif
}
diff --git a/test/test-utils.h b/test/test-utils.h
index 3e1e55e6..0d3f3690 100644
--- a/test/test-utils.h
+++ b/test/test-utils.h
@@ -1,25 +1,38 @@
#ifndef TEST_UTILS_H
#define TEST_UTILS_H
-#ifndef DBUS_COMPILATION
-#define DBUS_COMPILATION /* Cheat and use private stuff */
-#endif
-#include <dbus/dbus.h>
+
#include <stdio.h>
#include <stdlib.h>
-#include <dbus/dbus-mainloop.h>
-#include <dbus/dbus-internals.h>
-#undef DBUS_COMPILATION
-dbus_bool_t test_connection_setup (DBusLoop *loop,
+#include <dbus/dbus.h>
+
+#ifdef DBUS_TEST_USE_INTERNAL
+
+# include <dbus/dbus-mainloop.h>
+# include <dbus/dbus-internals.h>
+ typedef DBusLoop TestMainContext;
+
+#else /* !DBUS_TEST_USE_INTERNAL */
+
+# include <glib.h>
+ typedef GMainContext TestMainContext;
+
+#endif /* !DBUS_TEST_USE_INTERNAL */
+
+TestMainContext *test_main_context_get (void);
+TestMainContext *test_main_context_ref (TestMainContext *ctx);
+void test_main_context_unref (TestMainContext *ctx);
+void test_main_context_iterate (TestMainContext *ctx,
+ dbus_bool_t may_block);
+
+dbus_bool_t test_connection_setup (TestMainContext *ctx,
DBusConnection *connection);
-void test_connection_shutdown (DBusLoop *loop,
+void test_connection_shutdown (TestMainContext *ctx,
DBusConnection *connection);
-void test_connection_dispatch_all_messages (DBusConnection *connection);
-dbus_bool_t test_connection_dispatch_one_message (DBusConnection *connection);
-dbus_bool_t test_server_setup (DBusLoop *loop,
+dbus_bool_t test_server_setup (TestMainContext *ctx,
DBusServer *server);
-void test_server_shutdown (DBusLoop *loop,
+void test_server_shutdown (TestMainContext *ctx,
DBusServer *server);
#endif
diff --git a/tools/Makefile.am b/tools/Makefile.am
index cfd54b8b..73d95fcf 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -20,6 +20,7 @@ bin_PROGRAMS = \
if DBUS_UNIX
bin_PROGRAMS += \
dbus-cleanup-sockets \
+ dbus-run-session \
dbus-uuidgen \
$(NULL)
endif
@@ -43,6 +44,13 @@ dbus_launch_SOURCES= \
dbus-launch.c \
dbus-launch-x11.c \
dbus-launch.h
+
+dbus_run_session_SOURCES = \
+ dbus-run-session.c
+
+dbus_run_session_LDADD = \
+ $(top_builddir)/dbus/libdbus-1.la \
+ $(NULL)
endif
dbus_cleanup_sockets_SOURCES= \
diff --git a/tools/Makefile.in b/tools/Makefile.in
index b8e779f6..dd562f10 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.6 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -16,23 +15,51 @@
@SET_MAKE@
VPATH = @srcdir@
-am__make_dryrun = \
- { \
- am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
- *) \
- for am__flg in $$MAKEFLAGS; do \
- case $$am__flg in \
- *=*|--*) ;; \
- *n*) am__dry=yes; break;; \
- esac; \
- done;; \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
esac; \
- test $$am__dry = yes; \
- }
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -55,11 +82,13 @@ bin_PROGRAMS = dbus-launch$(EXEEXT) dbus-monitor$(EXEEXT) \
dbus-send$(EXEEXT) $(am__EXEEXT_1)
@DBUS_UNIX_TRUE@am__append_1 = \
@DBUS_UNIX_TRUE@ dbus-cleanup-sockets \
+@DBUS_UNIX_TRUE@ dbus-run-session \
@DBUS_UNIX_TRUE@ dbus-uuidgen \
@DBUS_UNIX_TRUE@ $(NULL)
subdir = tools
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+ $(top_srcdir)/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/libtool.m4 \
@@ -75,6 +104,7 @@ CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
@DBUS_UNIX_TRUE@am__EXEEXT_1 = dbus-cleanup-sockets$(EXEEXT) \
+@DBUS_UNIX_TRUE@ dbus-run-session$(EXEEXT) \
@DBUS_UNIX_TRUE@ dbus-uuidgen$(EXEEXT)
am__installdirs = "$(DESTDIR)$(bindir)"
PROGRAMS = $(bin_PROGRAMS)
@@ -84,6 +114,7 @@ dbus_cleanup_sockets_LDADD = $(LDADD)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
+am__v_lt_1 =
am__dbus_launch_SOURCES_DIST = dbus-launch.c dbus-launch-x11.c \
dbus-launch.h dbus-launch-win.c
@DBUS_WIN_FALSE@am_dbus_launch_OBJECTS = dbus-launch.$(OBJEXT) \
@@ -97,6 +128,12 @@ am_dbus_monitor_OBJECTS = dbus-monitor.$(OBJEXT) \
dbus_monitor_OBJECTS = $(am_dbus_monitor_OBJECTS)
dbus_monitor_DEPENDENCIES = $(top_builddir)/dbus/libdbus-1.la \
$(am__DEPENDENCIES_1)
+am__dbus_run_session_SOURCES_DIST = dbus-run-session.c
+@DBUS_WIN_FALSE@am_dbus_run_session_OBJECTS = \
+@DBUS_WIN_FALSE@ dbus-run-session.$(OBJEXT)
+dbus_run_session_OBJECTS = $(am_dbus_run_session_OBJECTS)
+@DBUS_WIN_FALSE@dbus_run_session_DEPENDENCIES = \
+@DBUS_WIN_FALSE@ $(top_builddir)/dbus/libdbus-1.la
am_dbus_send_OBJECTS = dbus-print-message.$(OBJEXT) \
dbus-send.$(OBJEXT)
dbus_send_OBJECTS = $(am_dbus_send_OBJECTS)
@@ -104,6 +141,18 @@ dbus_send_DEPENDENCIES = $(top_builddir)/dbus/libdbus-1.la
am_dbus_uuidgen_OBJECTS = dbus-uuidgen.$(OBJEXT)
dbus_uuidgen_OBJECTS = $(am_dbus_uuidgen_OBJECTS)
dbus_uuidgen_DEPENDENCIES = $(top_builddir)/dbus/libdbus-1.la
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@@ -116,31 +165,45 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
SOURCES = $(dbus_cleanup_sockets_SOURCES) $(dbus_launch_SOURCES) \
- $(dbus_monitor_SOURCES) $(dbus_send_SOURCES) \
- $(dbus_uuidgen_SOURCES)
+ $(dbus_monitor_SOURCES) $(dbus_run_session_SOURCES) \
+ $(dbus_send_SOURCES) $(dbus_uuidgen_SOURCES)
DIST_SOURCES = $(dbus_cleanup_sockets_SOURCES) \
$(am__dbus_launch_SOURCES_DIST) $(dbus_monitor_SOURCES) \
- $(dbus_send_SOURCES) $(dbus_uuidgen_SOURCES)
+ $(am__dbus_run_session_SOURCES_DIST) $(dbus_send_SOURCES) \
+ $(dbus_uuidgen_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -172,7 +235,6 @@ 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@
DBUS_INT64_CONSTANT = @DBUS_INT64_CONSTANT@
@@ -183,7 +245,8 @@ DBUS_MICRO_VERSION = @DBUS_MICRO_VERSION@
DBUS_MINOR_VERSION = @DBUS_MINOR_VERSION@
DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@
DBUS_PREFIX = @DBUS_PREFIX@
-DBUS_SESSION_BUS_DEFAULT_ADDRESS = @DBUS_SESSION_BUS_DEFAULT_ADDRESS@
+DBUS_SESSION_BUS_CONNECT_ADDRESS = @DBUS_SESSION_BUS_CONNECT_ADDRESS@
+DBUS_SESSION_BUS_LISTEN_ADDRESS = @DBUS_SESSION_BUS_LISTEN_ADDRESS@
DBUS_SESSION_SOCKET_DIR = @DBUS_SESSION_SOCKET_DIR@
DBUS_STATIC_BUILD_CPPFLAGS = @DBUS_STATIC_BUILD_CPPFLAGS@
DBUS_SYSTEM_BUS_DEFAULT_ADDRESS = @DBUS_SYSTEM_BUS_DEFAULT_ADDRESS@
@@ -232,8 +295,6 @@ LIBDBUS_LIBS = @LIBDBUS_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
-LIBXML_CFLAGS = @LIBXML_CFLAGS@
-LIBXML_LIBS = @LIBXML_LIBS@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
@@ -242,7 +303,6 @@ LT_CURRENT = @LT_CURRENT@
LT_REVISION = @LT_REVISION@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
-MAN2HTML = @MAN2HTML@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NETWORK_libs = @NETWORK_libs@
@@ -276,7 +336,6 @@ SHELL = @SHELL@
STRIP = @STRIP@
SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
SYSTEMD_LIBS = @SYSTEMD_LIBS@
-TEST_BUS_BINARY = @TEST_BUS_BINARY@
TEST_LAUNCH_HELPER_BINARY = @TEST_LAUNCH_HELPER_BINARY@
TEST_LISTEN = @TEST_LISTEN@
TEST_SOCKET_DIR = @TEST_SOCKET_DIR@
@@ -383,6 +442,13 @@ dbus_monitor_SOURCES = \
@DBUS_WIN_TRUE@ dbus-launch-win.c \
@DBUS_WIN_TRUE@ dbus-launch.h
+@DBUS_WIN_FALSE@dbus_run_session_SOURCES = \
+@DBUS_WIN_FALSE@ dbus-run-session.c
+
+@DBUS_WIN_FALSE@dbus_run_session_LDADD = \
+@DBUS_WIN_FALSE@ $(top_builddir)/dbus/libdbus-1.la \
+@DBUS_WIN_FALSE@ $(NULL)
+
dbus_cleanup_sockets_SOURCES = \
dbus-cleanup-sockets.c
@@ -453,10 +519,12 @@ install-binPROGRAMS: $(bin_PROGRAMS)
fi; \
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; \
+ 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|.*|.|' \
+ 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 } \
@@ -477,7 +545,8 @@ uninstall-binPROGRAMS:
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
- -e 's/$$/$(EXEEXT)/' `; \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(bindir)" && rm -f $$files
@@ -490,18 +559,27 @@ clean-binPROGRAMS:
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
+
dbus-cleanup-sockets$(EXEEXT): $(dbus_cleanup_sockets_OBJECTS) $(dbus_cleanup_sockets_DEPENDENCIES) $(EXTRA_dbus_cleanup_sockets_DEPENDENCIES)
@rm -f dbus-cleanup-sockets$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(dbus_cleanup_sockets_OBJECTS) $(dbus_cleanup_sockets_LDADD) $(LIBS)
+
dbus-launch$(EXEEXT): $(dbus_launch_OBJECTS) $(dbus_launch_DEPENDENCIES) $(EXTRA_dbus_launch_DEPENDENCIES)
@rm -f dbus-launch$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(dbus_launch_OBJECTS) $(dbus_launch_LDADD) $(LIBS)
+
dbus-monitor$(EXEEXT): $(dbus_monitor_OBJECTS) $(dbus_monitor_DEPENDENCIES) $(EXTRA_dbus_monitor_DEPENDENCIES)
@rm -f dbus-monitor$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(dbus_monitor_OBJECTS) $(dbus_monitor_LDADD) $(LIBS)
+
+dbus-run-session$(EXEEXT): $(dbus_run_session_OBJECTS) $(dbus_run_session_DEPENDENCIES) $(EXTRA_dbus_run_session_DEPENDENCIES)
+ @rm -f dbus-run-session$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(dbus_run_session_OBJECTS) $(dbus_run_session_LDADD) $(LIBS)
+
dbus-send$(EXEEXT): $(dbus_send_OBJECTS) $(dbus_send_DEPENDENCIES) $(EXTRA_dbus_send_DEPENDENCIES)
@rm -f dbus-send$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(dbus_send_OBJECTS) $(dbus_send_LDADD) $(LIBS)
+
dbus-uuidgen$(EXEEXT): $(dbus_uuidgen_OBJECTS) $(dbus_uuidgen_DEPENDENCIES) $(EXTRA_dbus_uuidgen_DEPENDENCIES)
@rm -f dbus-uuidgen$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(dbus_uuidgen_OBJECTS) $(dbus_uuidgen_LDADD) $(LIBS)
@@ -518,6 +596,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-launch.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-monitor.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-print-message.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-run-session.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-send.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-uuidgen.Po@am__quote@
@@ -526,14 +605,14 @@ distclean-compile:
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -548,26 +627,15 @@ mostlyclean-libtool:
clean-libtool:
-rm -rf .libs _libs
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
+ $(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
@@ -579,15 +647,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$$unique; \
fi; \
fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
@@ -596,6 +660,21 @@ GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -740,20 +819,20 @@ uninstall-am: uninstall-binPROGRAMS
.MAKE: install-am install-strip
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
- clean-generic clean-libtool ctags distclean distclean-compile \
- distclean-generic distclean-libtool distclean-tags distdir dvi \
- dvi-am html html-am info info-am install install-am \
- install-binPROGRAMS install-data install-data-am \
- install-data-local 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 installcheck-local installdirs \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
- pdf pdf-am ps ps-am tags uninstall uninstall-am \
- uninstall-binPROGRAMS
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
+ ctags ctags-am distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-binPROGRAMS \
+ install-data install-data-am install-data-local 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 installcheck-local \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
+ uninstall-am uninstall-binPROGRAMS
# create the /var/lib/dbus directory for dbus-uuidgen
diff --git a/tools/dbus-launch-win.c b/tools/dbus-launch-win.c
index 215fac3f..d899010a 100644
--- a/tools/dbus-launch-win.c
+++ b/tools/dbus-launch-win.c
@@ -159,8 +159,8 @@ main (int argc, char **argv)
if (result == 0)
{
if (verbose)
- fprintf (stderr, "Could not start " DBUS_DAEMON_NAME ". error=%d\n",
- GetLastError ());
+ fprintf (stderr, "Could not start " DBUS_DAEMON_NAME ". error=%u\n",
+ (unsigned)GetLastError ());
return 4;
}
diff --git a/tools/dbus-launch.c b/tools/dbus-launch.c
index 2a9dabfa..41a20e83 100644
--- a/tools/dbus-launch.c
+++ b/tools/dbus-launch.c
@@ -105,6 +105,7 @@ save_machine_uuid (const char *uuid_arg)
machine_uuid = xstrdup (uuid_arg);
}
+#ifdef DBUS_BUILD_X11
#define UUID_MAXLEN 40
/* Read the machine uuid from file if needed. Returns TRUE if machine_uuid is
* set after this function */
@@ -131,7 +132,7 @@ read_machine_uuid_if_needed (void)
goto out;
/* rstrip the read uuid */
- while (len > 31 && isspace(uuid[len - 1]))
+ while (len > 31 && isspace((int) uuid[len - 1]))
len--;
if (len != 32)
@@ -146,12 +147,13 @@ out:
fclose(f);
return ret;
}
-
+#endif /* DBUS_BUILD_X11 */
void
verbose (const char *format,
...)
{
+#ifdef DBUS_ENABLE_VERBOSE_MODE
va_list args;
static int verbose = TRUE;
static int verbose_initted = FALSE;
@@ -176,12 +178,16 @@ verbose (const char *format,
va_start (args, format);
vfprintf (stderr, format, args);
va_end (args);
+#endif /* DBUS_ENABLE_VERBOSE_MODE */
}
static void
usage (int ecode)
{
- fprintf (stderr, "dbus-launch [--version] [--help] [--sh-syntax] [--csh-syntax] [--auto-syntax] [--exit-with-session]\n");
+ fprintf (stderr, "dbus-launch [--version] [--help] [--sh-syntax]"
+ " [--csh-syntax] [--auto-syntax] [--binary-syntax] [--close-stderr]"
+ " [--exit-with-session] [--autolaunch=MACHINEID]"
+ " [--config-file=FILENAME] [PROGRAM] [ARGS...]\n");
exit (ecode);
}
@@ -216,6 +222,26 @@ xstrdup (const char *str)
return copy;
}
+static char *
+concat2 (const char *a,
+ const char *b)
+{
+ size_t la, lb;
+ char *ret;
+
+ la = strlen (a);
+ lb = strlen (b);
+
+ ret = malloc (la + lb + 1);
+
+ if (ret == NULL)
+ return NULL;
+
+ memcpy (ret, a, la);
+ memcpy (ret + la, b, lb + 1);
+ return ret;
+}
+
typedef enum
{
READ_STATUS_OK, /**< Read succeeded */
@@ -380,6 +406,9 @@ static pid_t bus_pid_to_kill = -1;
static void
kill_bus(void)
{
+ if (bus_pid_to_kill <= 0)
+ return;
+
verbose ("Killing message bus and exiting babysitter\n");
kill (bus_pid_to_kill, SIGTERM);
sleep (3);
@@ -445,9 +474,7 @@ signal_handler (int sig)
{
switch (sig)
{
-#ifdef SIGHUP
case SIGHUP:
-#endif
case SIGINT:
case SIGTERM:
got_sighup = TRUE;
@@ -509,7 +536,7 @@ kill_bus_when_session_ends (void)
if (tty_fd < 0 && x_fd < 0)
{
fprintf (stderr, "No terminal on standard input and no X display; cannot attach message bus to session lifetime\n");
- exit (1);
+ kill_bus_and_exit (1);
}
while (TRUE)
@@ -755,31 +782,35 @@ pass_info (const char *runprog, const char *bus_address, pid_t bus_pid,
if (envvar == NULL || args == NULL)
goto oom;
- args[0] = xstrdup (runprog);
+ args[0] = xstrdup (runprog);
if (!args[0])
goto oom;
- for (i = 1; i <= (argc-remaining_args); i++)
- {
- size_t len = strlen (argv[remaining_args+i-1])+1;
- args[i] = malloc (len);
- if (!args[i])
- goto oom;
- strncpy (args[i], argv[remaining_args+i-1], len);
- }
- args[i] = NULL;
+ for (i = 1; i <= (argc-remaining_args); i++)
+ {
+ size_t len = strlen (argv[remaining_args+i-1])+1;
+ args[i] = malloc (len);
+ if (!args[i])
+ {
+ while (i > 1)
+ free (args[--i]);
+ goto oom;
+ }
+ strncpy (args[i], argv[remaining_args+i-1], len);
+ }
+ args[i] = NULL;
- strcpy (envvar, "DBUS_SESSION_BUS_ADDRESS=");
- strcat (envvar, bus_address);
- putenv (envvar);
+ strcpy (envvar, "DBUS_SESSION_BUS_ADDRESS=");
+ strcat (envvar, bus_address);
+ putenv (envvar);
- execvp (runprog, args);
- fprintf (stderr, "Couldn't exec %s: %s\n", runprog, strerror (errno));
- exit (1);
+ execvp (runprog, args);
+ fprintf (stderr, "Couldn't exec %s: %s\n", runprog, strerror (errno));
+ exit (1);
}
else
{
print_variables (bus_address, bus_pid, bus_wid, c_shell_syntax,
- bourne_shell_syntax, binary_syntax);
+ bourne_shell_syntax, binary_syntax);
}
verbose ("dbus-launch exiting\n");
@@ -1100,24 +1131,41 @@ main (int argc, char **argv)
verbose ("Calling exec()\n");
-#ifdef DBUS_BUILD_TESTS
- /* exec from testdir */
- if (getenv("DBUS_USE_TEST_BINARY") != NULL)
- {
- execl (TEST_BUS_BINARY,
- TEST_BUS_BINARY,
- "--fork",
- "--print-pid", write_pid_fd_as_string,
- "--print-address", write_address_fd_as_string,
- config_file ? "--config-file" : "--session",
- config_file, /* has to be last in this varargs list */
- NULL);
-
- fprintf (stderr,
- "Failed to execute test message bus daemon %s: %s. Will try again with the system path.\n",
- TEST_BUS_BINARY, strerror (errno));
- }
- #endif /* DBUS_BUILD_TESTS */
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
+ {
+ const char *test_daemon;
+ /* exec from testdir */
+ if (getenv ("DBUS_USE_TEST_BINARY") != NULL &&
+ (test_daemon = getenv ("DBUS_TEST_DAEMON")) != NULL)
+ {
+ if (config_file == NULL && getenv ("DBUS_TEST_DATA") != NULL)
+ {
+ config_file = concat2 (getenv ("DBUS_TEST_DATA"),
+ "/valid-config-files/session.conf");
+
+ if (config_file == NULL)
+ {
+ fprintf (stderr, "Out of memory\n");
+ exit (1);
+ }
+ }
+
+ execl (test_daemon,
+ test_daemon,
+ "--fork",
+ "--print-pid", write_pid_fd_as_string,
+ "--print-address", write_address_fd_as_string,
+ config_file ? "--config-file" : "--session",
+ config_file, /* has to be last in this varargs list */
+ NULL);
+
+ fprintf (stderr,
+ "Failed to execute test message bus daemon %s: %s.\n",
+ test_daemon, strerror (errno));
+ exit (1);
+ }
+ }
+ #endif /* DBUS_ENABLE_EMBEDDED_TESTS */
execl (DBUS_DAEMONDIR"/dbus-daemon",
DBUS_DAEMONDIR"/dbus-daemon",
@@ -1162,7 +1210,6 @@ main (int argc, char **argv)
char *end;
long wid = 0;
long val;
- int ret2;
verbose ("=== Parent dbus-launch continues\n");
@@ -1231,11 +1278,17 @@ main (int argc, char **argv)
bus_pid = val;
+ /* Have to initialize bus_pid_to_kill ASAP, so that the
+ X error callback can kill it if an error happens. */
+ bus_pid_to_kill = bus_pid;
+
close (bus_pid_to_launcher_pipe[READ_END]);
#ifdef DBUS_ENABLE_X11_AUTOLAUNCH
if (xdisplay != NULL)
{
+ int ret2;
+
verbose("Saving x11 address\n");
ret2 = x11_save_address (bus_address, bus_pid, &wid);
/* Only get an existing dbus session when autolaunching */
@@ -1245,7 +1298,6 @@ main (int argc, char **argv)
{
char *address = NULL;
/* another window got added. Return its address */
- bus_pid_to_kill = bus_pid;
if (x11_get_address (&address, &bus_pid, &wid)
&& address != NULL)
{
diff --git a/tools/dbus-monitor.c b/tools/dbus-monitor.c
index a4b54782..ff8390d7 100644
--- a/tools/dbus-monitor.c
+++ b/tools/dbus-monitor.c
@@ -106,6 +106,9 @@ monitor_filter_func (DBusConnection *connection,
#ifdef __APPLE__
#define PROFILE_TIMED_FORMAT "%s\t%lu\t%d"
+#elif defined(__NetBSD__)
+#include <inttypes.h>
+#define PROFILE_TIMED_FORMAT "%s\t%" PRId64 "\t%d"
#else
#define PROFILE_TIMED_FORMAT "%s\t%lu\t%lu"
#endif
@@ -310,7 +313,7 @@ main (int argc, char *argv[])
filters = (char **) realloc (filters, numFilters * sizeof (char *));
if (filters == NULL)
oom ("adding a new filter slot");
- filters[j] = (char *) malloc (filter_len * sizeof (char *));
+ filters[j] = (char *) malloc (filter_len);
if (filters[j] == NULL)
oom ("adding a new filter");
snprintf (filters[j], filter_len, "%s,%s", EAVESDROPPING_RULE, arg);
@@ -364,41 +367,45 @@ main (int argc, char *argv[])
if (numFilters)
{
+ size_t offset = 0;
for (i = 0; i < j; i++)
{
- dbus_bus_add_match (connection, filters[i], &error);
- if (dbus_error_is_set (&error))
+ dbus_bus_add_match (connection, filters[i] + offset, &error);
+ if (dbus_error_is_set (&error) && i == 0 && offset == 0)
+ {
+ /* We might be talking to a pre-1.5.6 dbus-daemon
+ * which wouldn't understand eavesdrop=true.
+ * If this works, carry on with offset > 0
+ * on the remaining iterations. */
+ offset = strlen (EAVESDROPPING_RULE) + 1;
+ dbus_error_free (&error);
+ dbus_bus_add_match (connection, filters[i] + offset, &error);
+ }
+
+ if (dbus_error_is_set (&error))
{
fprintf (stderr, "Failed to setup match \"%s\": %s\n",
filters[i], error.message);
dbus_error_free (&error);
exit (1);
}
- free(filters[i]);
+ free(filters[i]);
}
}
else
{
dbus_bus_add_match (connection,
- EAVESDROPPING_RULE ",type='signal'",
- &error);
- if (dbus_error_is_set (&error))
- goto lose;
- dbus_bus_add_match (connection,
- EAVESDROPPING_RULE ",type='method_call'",
- &error);
+ EAVESDROPPING_RULE,
+ &error);
if (dbus_error_is_set (&error))
- goto lose;
- dbus_bus_add_match (connection,
- EAVESDROPPING_RULE ",type='method_return'",
- &error);
- if (dbus_error_is_set (&error))
- goto lose;
- dbus_bus_add_match (connection,
- EAVESDROPPING_RULE ",type='error'",
- &error);
- if (dbus_error_is_set (&error))
- goto lose;
+ {
+ dbus_error_free (&error);
+ dbus_bus_add_match (connection,
+ "",
+ &error);
+ if (dbus_error_is_set (&error))
+ goto lose;
+ }
}
if (!dbus_connection_add_filter (connection, filter_func, NULL, NULL)) {
diff --git a/tools/dbus-print-message.c b/tools/dbus-print-message.c
index 75d00aca..e0dd2da6 100644
--- a/tools/dbus-print-message.c
+++ b/tools/dbus-print-message.c
@@ -346,7 +346,15 @@ print_iter (DBusMessageIter *iter, dbus_bool_t literal, int depth)
printf("}\n");
break;
}
-
+
+ case DBUS_TYPE_UNIX_FD:
+ {
+ int fd;
+ dbus_message_iter_get_basic (iter, &fd);
+ printf ("unix fd %d\n", fd);
+ break;
+ }
+
default:
printf (" (dbus-monitor too dumb to decipher arg type '%c')\n", type);
break;
diff --git a/tools/dbus-run-session.c b/tools/dbus-run-session.c
new file mode 100644
index 00000000..105ab3b4
--- /dev/null
+++ b/tools/dbus-run-session.c
@@ -0,0 +1,464 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/* dbus-run-session.c - run a child process in its own session
+ *
+ * Copyright © 2003-2006 Red Hat, Inc.
+ * Copyright © 2006 Thiago Macieira <thiago@kde.org>
+ * Copyright © 2011-2012 Nokia Corporation
+ *
+ * Licensed under the Academic Free License version 2.1
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include <config.h>
+
+#include <assert.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <signal.h>
+
+#include "dbus/dbus.h"
+
+#define MAX_ADDR_LEN 512
+#define PIPE_READ_END 0
+#define PIPE_WRITE_END 1
+
+/* PROCESSES
+ *
+ * If you are in a shell and run "dbus-run-session myapp", here is what
+ * happens (compare and contrast with dbus-launch):
+ *
+ * shell
+ * \- dbus-run-session myapp
+ * \- dbus-daemon --nofork --print-address --session
+ * \- myapp
+ *
+ * All processes are long-running.
+ *
+ * When myapp exits, dbus-run-session kills dbus-daemon and terminates.
+ *
+ * If dbus-daemon exits, dbus-run-session warns and continues to run.
+ *
+ * PIPES
+ *
+ * dbus-daemon --print-address -> bus_address_pipe -> d-r-s
+ */
+
+static const char me[] = "dbus-run-session";
+
+static void
+usage (int ecode)
+{
+ fprintf (stderr,
+ "%s [OPTIONS] [--] PROGRAM [ARGUMENTS]\n"
+ "%s --version\n"
+ "%s --help\n"
+ "\n"
+ "Options:\n"
+ "--dbus-daemon=BINARY run BINARY instead of dbus-daemon\n"
+ "--config-file=FILENAME pass to dbus-daemon instead of --session\n"
+ "\n",
+ me, me, me);
+ exit (ecode);
+}
+
+static void
+version (void)
+{
+ printf ("%s %s\n"
+ "Copyright (C) 2003-2006 Red Hat, Inc.\n"
+ "Copyright (C) 2006 Thiago Macieira\n"
+ "Copyright © 2011-2012 Nokia Corporation\n"
+ "\n"
+ "This is free software; see the source for copying conditions.\n"
+ "There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n",
+ me, VERSION);
+ exit (0);
+}
+
+static void
+oom (void)
+{
+ fprintf (stderr, "%s: out of memory\n", me);
+ exit (1);
+}
+
+typedef enum
+{
+ READ_STATUS_OK, /**< Read succeeded */
+ READ_STATUS_ERROR, /**< Some kind of error */
+ READ_STATUS_EOF /**< EOF returned */
+} ReadStatus;
+
+static ReadStatus
+read_line (int fd,
+ char *buf,
+ size_t maxlen)
+{
+ size_t bytes = 0;
+ ReadStatus retval;
+
+ memset (buf, '\0', maxlen);
+ maxlen -= 1; /* ensure nul term */
+
+ retval = READ_STATUS_OK;
+
+ while (1)
+ {
+ ssize_t chunk;
+ size_t to_read;
+
+ again:
+ to_read = maxlen - bytes;
+
+ if (to_read == 0)
+ break;
+
+ chunk = read (fd,
+ buf + bytes,
+ to_read);
+ if (chunk < 0 && errno == EINTR)
+ goto again;
+
+ if (chunk < 0)
+ {
+ retval = READ_STATUS_ERROR;
+ break;
+ }
+ else if (chunk == 0)
+ {
+ retval = READ_STATUS_EOF;
+ break; /* EOF */
+ }
+ else /* chunk > 0 */
+ bytes += chunk;
+ }
+
+ if (retval == READ_STATUS_EOF &&
+ bytes > 0)
+ retval = READ_STATUS_OK;
+
+ /* whack newline */
+ if (retval != READ_STATUS_ERROR &&
+ bytes > 0 &&
+ buf[bytes-1] == '\n')
+ buf[bytes-1] = '\0';
+
+ return retval;
+}
+
+static void
+exec_dbus_daemon (const char *dbus_daemon,
+ int bus_address_pipe[2],
+ const char *config_file)
+{
+ /* Child process, which execs dbus-daemon or dies trying */
+#define MAX_FD_LEN 64
+ char write_address_fd_as_string[MAX_FD_LEN];
+
+ close (bus_address_pipe[PIPE_READ_END]);
+
+ sprintf (write_address_fd_as_string, "%d", bus_address_pipe[PIPE_WRITE_END]);
+
+ execlp (dbus_daemon,
+ dbus_daemon,
+ "--nofork",
+ "--print-address", write_address_fd_as_string,
+ config_file ? "--config-file" : "--session",
+ config_file, /* has to be last in this varargs list */
+ NULL);
+
+ fprintf (stderr, "%s: failed to execute message bus daemon '%s': %s\n",
+ me, dbus_daemon, strerror (errno));
+}
+
+static void
+exec_app (int prog_arg, char **argv)
+{
+ execvp (argv[prog_arg], argv + prog_arg);
+
+ fprintf (stderr, "%s: failed to exec '%s': %s\n", me, argv[prog_arg],
+ strerror (errno));
+ exit (1);
+}
+
+int
+main (int argc, char **argv)
+{
+ int prog_arg = 0;
+ int bus_address_pipe[2] = { 0, 0 };
+ const char *config_file = NULL;
+ const char *dbus_daemon = NULL;
+ char bus_address[MAX_ADDR_LEN] = { 0 };
+ const char *prev_arg = NULL;
+ int i = 1;
+ int requires_arg = 0;
+ pid_t bus_pid;
+ pid_t app_pid;
+
+ while (i < argc)
+ {
+ const char *arg = argv[i];
+
+ if (requires_arg)
+ {
+ const char **arg_dest;
+
+ assert (prev_arg != NULL);
+
+ if (strcmp (prev_arg, "--config-file") == 0)
+ {
+ arg_dest = &config_file;
+ }
+ else if (strcmp (prev_arg, "--dbus-daemon") == 0)
+ {
+ arg_dest = &dbus_daemon;
+ }
+ else
+ {
+ /* shouldn't happen */
+ fprintf (stderr, "%s: internal error: %s not fully implemented\n",
+ me, prev_arg);
+ return 127;
+ }
+
+ if (*arg_dest != NULL)
+ {
+ fprintf (stderr, "%s: %s given twice\n", me, prev_arg);
+ return 127;
+ }
+
+ *arg_dest = arg;
+ requires_arg = 0;
+ prev_arg = arg;
+ ++i;
+ continue;
+ }
+
+ if (strcmp (arg, "--help") == 0 ||
+ strcmp (arg, "-h") == 0 ||
+ strcmp (arg, "-?") == 0)
+ {
+ usage (0);
+ }
+ else if (strcmp (arg, "--version") == 0)
+ {
+ version ();
+ }
+ else if (strstr (arg, "--config-file=") == arg)
+ {
+ const char *file;
+
+ if (config_file != NULL)
+ {
+ fprintf (stderr, "%s: --config-file given twice\n", me);
+ return 127;
+ }
+
+ file = strchr (arg, '=');
+ ++file;
+
+ config_file = file;
+ }
+ else if (strstr (arg, "--dbus-daemon=") == arg)
+ {
+ const char *file;
+
+ if (dbus_daemon != NULL)
+ {
+ fprintf (stderr, "%s: --dbus-daemon given twice\n", me);
+ return 127;
+ }
+
+ file = strchr (arg, '=');
+ ++file;
+
+ dbus_daemon = file;
+ }
+ else if (strcmp (arg, "--config-file") == 0 ||
+ strcmp (arg, "--dbus-daemon") == 0)
+ {
+ requires_arg = 1;
+ }
+ else if (arg[0] == '-')
+ {
+ if (strcmp (arg, "--") != 0)
+ {
+ fprintf (stderr, "%s: option '%s' is unknown\n", me, arg);
+ return 127;
+ }
+ else
+ {
+ prog_arg = i + 1;
+ break;
+ }
+ }
+ else
+ {
+ prog_arg = i;
+ break;
+ }
+
+ prev_arg = arg;
+ ++i;
+ }
+
+ /* "dbus-run-session" and "dbus-run-session ... --" are not allowed:
+ * there must be something to run */
+ if (prog_arg < 1 || prog_arg >= argc)
+ {
+ fprintf (stderr, "%s: a non-option argument is required\n", me);
+ return 127;
+ }
+
+ if (requires_arg)
+ {
+ fprintf (stderr, "%s: option '%s' requires an argument\n", me, prev_arg);
+ return 127;
+ }
+
+ if (dbus_daemon == NULL)
+ dbus_daemon = "dbus-daemon";
+
+ if (pipe (bus_address_pipe) < 0)
+ {
+ fprintf (stderr, "%s: failed to create pipe: %s\n", me, strerror (errno));
+ return 127;
+ }
+
+ bus_pid = fork ();
+
+ if (bus_pid < 0)
+ {
+ fprintf (stderr, "%s: failed to fork: %s\n", me, strerror (errno));
+ return 127;
+ }
+
+ if (bus_pid == 0)
+ {
+ /* child */
+ exec_dbus_daemon (dbus_daemon, bus_address_pipe, config_file);
+ /* not reached */
+ return 127;
+ }
+
+ close (bus_address_pipe[PIPE_WRITE_END]);
+
+ switch (read_line (bus_address_pipe[PIPE_READ_END], bus_address, MAX_ADDR_LEN))
+ {
+ case READ_STATUS_OK:
+ break;
+
+ case READ_STATUS_EOF:
+ fprintf (stderr, "%s: EOF reading address from bus daemon\n", me);
+ return 127;
+ break;
+
+ case READ_STATUS_ERROR:
+ fprintf (stderr, "%s: error reading address from bus daemon: %s\n",
+ me, strerror (errno));
+ return 127;
+ break;
+ }
+
+ close (bus_address_pipe[PIPE_READ_END]);
+
+ if (!dbus_setenv ("DBUS_SESSION_BUS_ADDRESS", bus_address) ||
+ !dbus_setenv ("DBUS_SESSION_BUS_PID", NULL) ||
+ !dbus_setenv ("DBUS_SESSION_BUS_WINDOWID", NULL) ||
+ !dbus_setenv ("DBUS_STARTER_ADDRESS", NULL) ||
+ !dbus_setenv ("DBUS_STARTER_BUS_TYPE", NULL))
+ oom ();
+
+ app_pid = fork ();
+
+ if (app_pid < 0)
+ {
+ fprintf (stderr, "%s: failed to fork: %s\n", me, strerror (errno));
+ return 127;
+ }
+
+ if (app_pid == 0)
+ {
+ /* child */
+ exec_app (prog_arg, argv);
+ /* not reached */
+ return 127;
+ }
+
+ while (1)
+ {
+ int child_status;
+ pid_t child_pid = waitpid (-1, &child_status, 0);
+
+ if (child_pid == (pid_t) -1)
+ {
+ int errsv = errno;
+
+ if (errsv == EINTR)
+ continue;
+
+ /* shouldn't happen: the only other documented errors are ECHILD,
+ * which shouldn't happen because we terminate when all our children
+ * have died, and EINVAL, which would indicate programming error */
+ fprintf (stderr, "%s: waitpid() failed: %s\n", me, strerror (errsv));
+ return 127;
+ }
+ else if (child_pid == bus_pid)
+ {
+ /* no need to kill it, now */
+ bus_pid = 0;
+
+ if (WIFEXITED (child_status))
+ fprintf (stderr, "%s: dbus-daemon exited with code %d\n",
+ me, WEXITSTATUS (child_status));
+ else if (WIFSIGNALED (child_status))
+ fprintf (stderr, "%s: dbus-daemon terminated by signal %d\n",
+ me, WTERMSIG (child_status));
+ else
+ fprintf (stderr, "%s: dbus-daemon died or something\n", me);
+ }
+ else if (child_pid == app_pid)
+ {
+ if (bus_pid != 0)
+ kill (bus_pid, SIGTERM);
+
+ if (WIFEXITED (child_status))
+ return WEXITSTATUS (child_status);
+
+ /* if it died from a signal, behave like sh(1) */
+ if (WIFSIGNALED (child_status))
+ return 128 + WTERMSIG (child_status);
+
+ /* I give up (this should never be reached) */
+ fprintf (stderr, "%s: child process died or something\n", me);
+ return 127;
+ }
+ else
+ {
+ fprintf (stderr, "%s: ignoring unknown child process %ld\n", me,
+ (long) child_pid);
+ }
+ }
+
+ return 0;
+}
diff --git a/tools/dbus-send.c b/tools/dbus-send.c
index e403a587..d3ff2589 100644
--- a/tools/dbus-send.c
+++ b/tools/dbus-send.c
@@ -51,7 +51,7 @@ static const char *appname;
static void
usage (int ecode)
{
- fprintf (stderr, "Usage: %s [--help] [--system | --session | --address=ADDRESS] [--dest=NAME] [--type=TYPE] [--print-reply[=literal]] [--reply-timeout=MSEC] <destination object path> <message name> [contents ...]\n", appname);
+ fprintf (stderr, "Usage: %s [--help] [--system | --session | --bus=ADDRESS | --peer=ADDRESS] [--dest=NAME] [--type=TYPE] [--print-reply[=literal]] [--reply-timeout=MSEC] <destination object path> <message name> [contents ...]\n", appname);
exit (ecode);
}
@@ -241,6 +241,7 @@ main (int argc, char *argv[])
int message_type = DBUS_MESSAGE_TYPE_SIGNAL;
const char *type_str = NULL;
const char *address = NULL;
+ int is_bus = FALSE;
int session_or_system = FALSE;
appname = argv[0];
@@ -266,34 +267,66 @@ main (int argc, char *argv[])
type = DBUS_BUS_SESSION;
session_or_system = TRUE;
}
- else if (strstr (arg, "--address") == arg)
+ else if ((strstr (arg, "--bus=") == arg) || (strstr (arg, "--peer=") == arg) || (strstr (arg, "--address=") == arg))
{
- address = strchr (arg, '=');
-
- if (address == NULL)
+ if (arg[2] == 'b') /* bus */
{
- fprintf (stderr, "\"--address=\" requires an ADDRESS\n");
- usage (1);
+ is_bus = TRUE;
+ }
+ else if (arg[2] == 'p') /* peer */
+ {
+ is_bus = FALSE;
}
- else
+ else /* address; keeping backwards compatibility */
+ {
+ is_bus = FALSE;
+ }
+
+ address = strchr (arg, '=') + 1;
+
+ if (address[0] == '\0')
{
- address = address + 1;
+ fprintf (stderr, "\"--peer=\" and \"--bus=\" require an ADDRESS\n");
+ usage (1);
}
}
else if (strncmp (arg, "--print-reply", 13) == 0)
{
print_reply = TRUE;
message_type = DBUS_MESSAGE_TYPE_METHOD_CALL;
- if (*(arg + 13) != '\0')
+ if (strcmp (arg + 13, "=literal") == 0)
print_reply_literal = TRUE;
+ else if (*(arg + 13) != '\0')
+ {
+ fprintf (stderr, "invalid value (%s) of \"--print-reply\"\n", arg + 13);
+ usage (1);
+ }
}
else if (strstr (arg, "--reply-timeout=") == arg)
{
+ if (*(strchr (arg, '=') + 1) == '\0')
+ {
+ fprintf (stderr, "\"--reply-timeout=\" requires an MSEC\n");
+ usage (1);
+ }
reply_timeout = strtol (strchr (arg, '=') + 1,
NULL, 10);
+ if (reply_timeout <= 0)
+ {
+ fprintf (stderr, "invalid value (%s) of \"--reply-timeout\"\n",
+ strchr (arg, '=') + 1);
+ usage (1);
+ }
}
else if (strstr (arg, "--dest=") == arg)
- dest = strchr (arg, '=') + 1;
+ {
+ if (*(strchr (arg, '=') + 1) == '\0')
+ {
+ fprintf (stderr, "\"--dest=\" requires an NAME\n");
+ usage (1);
+ }
+ dest = strchr (arg, '=') + 1;
+ }
else if (strstr (arg, "--type=") == arg)
type_str = strchr (arg, '=') + 1;
else if (!strcmp(arg, "--help"))
@@ -312,7 +345,7 @@ main (int argc, char *argv[])
if (session_or_system &&
(address != NULL))
{
- fprintf (stderr, "\"--address\" may not be used with \"--system\" or \"--session\"\n");
+ fprintf (stderr, "\"--peer\" and \"--bus\" may not be used with \"--system\" or \"--session\"\n");
usage (1);
}
@@ -330,6 +363,12 @@ main (int argc, char *argv[])
dbus_error_init (&error);
+ if (dest && !dbus_validate_bus_name (dest, &error))
+ {
+ fprintf (stderr, "invalid value (%s) of \"--dest\"\n", dest);
+ usage (1);
+ }
+
if (address != NULL)
{
connection = dbus_connection_open (address, &error);
@@ -348,6 +387,16 @@ main (int argc, char *argv[])
dbus_error_free (&error);
exit (1);
}
+ else if ((address != NULL) && is_bus)
+ {
+ if (!dbus_bus_register (connection, &error))
+ {
+ fprintf (stderr, "Failed to register on connection to \"%s\" message bus: %s\n",
+ address, error.message);
+ dbus_error_free (&error);
+ exit (1);
+ }
+ }
if (message_type == DBUS_MESSAGE_TYPE_METHOD_CALL)
{
diff --git a/tools/run-with-tmp-session-bus.sh b/tools/run-with-tmp-session-bus.sh
index c39999fb..94ae8fc8 100755
--- a/tools/run-with-tmp-session-bus.sh
+++ b/tools/run-with-tmp-session-bus.sh
@@ -1,16 +1,15 @@
#! /bin/sh
-SCRIPTNAME=$0
-WRAPPED_SCRIPT=$1
+SCRIPTNAME="$0"
+WRAPPED_SCRIPT="$1"
shift
-die()
+CONFIG_FILE=./tmp-session-bus.$$.conf
+
+die ()
{
- if ! test -z "$DBUS_SESSION_BUS_PID" ; then
- echo "killing message bus "$DBUS_SESSION_BUS_PID >&2
- kill -9 $DBUS_SESSION_BUS_PID
- fi
- echo $SCRIPTNAME: $* >&2
+ echo "$SCRIPTNAME: $*" >&2
+ rm -f "$CONFIG_FILE"
exit 1
}
@@ -18,10 +17,6 @@ if test -z "$DBUS_TOP_BUILDDIR" ; then
die "Must set DBUS_TOP_BUILDDIR"
fi
-## convenient to be able to ctrl+C without leaking the message bus process
-trap 'die "Received SIGINT"' INT
-
-CONFIG_FILE=./run-with-tmp-session-bus.conf
SERVICE_DIR="$DBUS_TOP_BUILDDIR/test/data/valid-service-files"
ESCAPED_SERVICE_DIR=`echo $SERVICE_DIR | sed -e 's/\//\\\\\\//g'`
echo "escaped service dir is: $ESCAPED_SERVICE_DIR" >&2
@@ -50,27 +45,18 @@ export LD_LIBRARY_PATH
unset DBUS_SESSION_BUS_ADDRESS
unset DBUS_SESSION_BUS_PID
-echo "Running $DBUS_TOP_BUILDDIR/tools/dbus-launch --sh-syntax --config-file=$CONFIG_FILE" >&2
-
-DBUS_USE_TEST_BINARY=1
+# this does not actually affect dbus-run-session any more, but could be
+# significant for dbus-launch as used by the autolaunch test
+DBUS_USE_TEST_BINARY=1
export DBUS_USE_TEST_BINARY
-eval `$DBUS_TOP_BUILDDIR/tools/dbus-launch --sh-syntax --config-file=$CONFIG_FILE`
-
-if test -z "$DBUS_SESSION_BUS_PID" ; then
- die "Failed to launch message bus for test script to run"
-fi
-
-echo "Started bus pid $DBUS_SESSION_BUS_PID at $DBUS_SESSION_BUS_ADDRESS" >&2
-
-# Execute wrapped script
-echo "Running $WRAPPED_SCRIPT $@" >&2
-$WRAPPED_SCRIPT "$@" || die "script \"$WRAPPED_SCRIPT\" failed"
-
-kill -TERM $DBUS_SESSION_BUS_PID || die "Message bus vanished! should not have happened" && echo "Killed daemon $DBUS_SESSION_BUS_PID" >&2
-
-sleep 2
-## be sure it really died
-kill -9 $DBUS_SESSION_BUS_PID > /dev/null 2>&1 || true
+$DBUS_TOP_BUILDDIR/tools/dbus-run-session \
+ --config-file="$CONFIG_FILE" \
+ --dbus-daemon="$DBUS_TOP_BUILDDIR/bus/dbus-daemon" \
+ -- \
+ "$WRAPPED_SCRIPT" "$@"
+error=$?
-exit 0
+# clean up
+rm -f "$CONFIG_FILE"
+exit $error
diff --git a/tools/strtoll.c b/tools/strtoll.c
index e4f57701..7360c630 100644
--- a/tools/strtoll.c
+++ b/tools/strtoll.c
@@ -27,6 +27,7 @@
* SUCH DAMAGE.
*/
+#include "config.h"
#include <limits.h>
#ifdef HAVE_ERRNO_H
diff --git a/tools/strtoull.c b/tools/strtoull.c
index 459c5091..35595542 100644
--- a/tools/strtoull.c
+++ b/tools/strtoull.c
@@ -27,6 +27,7 @@
* SUCH DAMAGE.
*/
+#include "config.h"
#include <limits.h>
#ifdef HAVE_ERRNO_H