summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS11
-rw-r--r--HACKING42
-rw-r--r--Makefile.am47
-rw-r--r--Makefile.in97
-rw-r--r--NEWS38
-rw-r--r--README2
-rwxr-xr-xREADME.cygwin9
-rw-r--r--README.launchd61
-rw-r--r--README.wince81
-rw-r--r--aclocal.m44
-rw-r--r--bus/Makefile.in7
-rw-r--r--bus/activation.c63
-rw-r--r--bus/bus.c36
-rw-r--r--bus/config-parser.c30
-rw-r--r--bus/dbus.service.in1
-rw-r--r--bus/dir-watch-inotify.c8
-rw-r--r--bus/signals.c34
-rw-r--r--bus/test-main.c124
-rw-r--r--cmake/CMakeLists.txt2
-rw-r--r--cmake/config.h.cmake5
-rwxr-xr-xcmake/cross-compile.sh15
-rw-r--r--cmake/dbus/CMakeLists.txt5
-rw-r--r--cmake/test/CMakeLists.txt7
-rwxr-xr-xcompile21
-rw-r--r--config.h.in6
-rwxr-xr-xconfigure459
-rw-r--r--configure.in102
-rw-r--r--dbus/Makefile.am5
-rw-r--r--dbus/Makefile.in87
-rw-r--r--dbus/dbus-arch-deps.h67
-rw-r--r--dbus/dbus-bus.c14
-rw-r--r--dbus/dbus-connection.c2
-rw-r--r--dbus/dbus-macros.h14
-rw-r--r--dbus/dbus-mainloop.c26
-rw-r--r--dbus/dbus-memory.h8
-rw-r--r--dbus/dbus-message.c2
-rw-r--r--dbus/dbus-nonce.c9
-rw-r--r--dbus/dbus-pipe-unix.c4
-rw-r--r--dbus/dbus-server-socket.c24
-rw-r--r--dbus/dbus-sockets-win.h10
-rw-r--r--dbus/dbus-spawn.c27
-rw-r--r--dbus/dbus-sysdeps-thread-win.c21
-rw-r--r--dbus/dbus-sysdeps-unix.c33
-rw-r--r--dbus/dbus-sysdeps-util-unix.c139
-rw-r--r--dbus/dbus-sysdeps-util-win.c5
-rw-r--r--dbus/dbus-sysdeps-win.c9
-rw-r--r--dbus/dbus-sysdeps-win.h2
-rw-r--r--dbus/dbus-sysdeps.h7
-rw-r--r--dbus/dbus-test.c8
-rw-r--r--dbus/dbus-transport.c14
-rwxr-xr-xdepcomp172
-rw-r--r--doc/Makefile.am12
-rw-r--r--doc/Makefile.in37
-rw-r--r--doc/dbus-daemon.1752
-rw-r--r--doc/dbus-faq.html48
-rw-r--r--doc/dbus-specification.html32
-rw-r--r--doc/dbus-test-plan.html4
-rwxr-xr-xinstall-sh517
-rw-r--r--m4/as-ac-expand.m449
-rw-r--r--m4/compiler.m467
-rw-r--r--m4/pkg.m4 (renamed from acinclude.m4)78
-rwxr-xr-xmissing104
-rw-r--r--test/Makefile.am26
-rw-r--r--test/Makefile.in64
-rw-r--r--test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoExec.service4
-rw-r--r--test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoService.service4
-rw-r--r--test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoUser.service4
-rw-r--r--test/data/valid-config-files-system/debug-allow-all-fail.conf17
-rw-r--r--test/data/valid-config-files-system/debug-allow-all-pass.conf17
-rw-r--r--test/data/valid-config-files/debug-allow-all-sha1.conf16
-rw-r--r--test/data/valid-config-files/debug-allow-all.conf15
-rw-r--r--test/data/valid-config-files/session.conf63
-rw-r--r--test/data/valid-config-files/system.conf83
-rw-r--r--test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteEchoService.service5
-rw-r--r--test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteSegfaultService.service5
-rw-r--r--test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service5
-rw-r--r--test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service5
-rw-r--r--test/data/valid-service-files/org.freedesktop.DBus.TestSuite.PrivServer.service4
-rw-r--r--test/data/valid-service-files/org.freedesktop.DBus.TestSuiteEchoService.service4
-rw-r--r--test/data/valid-service-files/org.freedesktop.DBus.TestSuiteForkingEchoService.service3
-rw-r--r--test/data/valid-service-files/org.freedesktop.DBus.TestSuiteSegfaultService.service4
-rw-r--r--test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service4
-rw-r--r--test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service4
-rw-r--r--test/decode-gcov.c2653
-rw-r--r--test/name-test/Makefile.am6
-rw-r--r--test/name-test/Makefile.in12
-rw-r--r--test/name-test/run-with-tmp-session-bus.conf91
-rw-r--r--test/name-test/test-privserver-client.c80
-rw-r--r--test/test-utils.c10
-rw-r--r--tools/Makefile.in7
-rw-r--r--tools/dbus-cleanup-sockets.c29
-rw-r--r--tools/dbus-launch-x11.c19
-rw-r--r--tools/lcov.am46
93 files changed, 2120 insertions, 4915 deletions
diff --git a/AUTHORS b/AUTHORS
index c8fd0cc5..4a7cbef4 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,5 +1,7 @@
+Alban Crequy <alban.crequy@collabora.co.uk>
Alexander Larsson <alexl@redhat.com>
Anders Carlsson <andersca@codefactory.se>
+Andre Heinecke <aheinecke@intevation.de>
Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Aurelien Jarno <aurel32@debian.org>
Benjamin Reed <ranger@befunk.com>
@@ -7,12 +9,14 @@ Benjamin Reed <rangerrick@befunk.com>
Benjamin Reed <ranger@Sin.local>
Brian Cameron <brian.cameron@sun.com>
Christian Dywan <christian.dywan@lanedo.com>
+Christian Dywan <christian@lanedo.com>
Christian Ehrlicher <Ch.Ehrlicher@gmx.de>
Christian Persch (GNOME) <chpe@gnome.org>
Colin Walters <walters@lightbox.localdomain>
Colin Walters <walters@space-ghost.verbum.private>
Colin Walters <walters@verbum.org>
Colin Watson <cjwatson@ubuntu.com>
+Cristian Rodríguez <cristian.rodriguez@opensuse.org>
Cyril Brulebois <kibi@debian.org>
Daniel P. Berrange <dan@berrange.com>
Daniel Reed <djr@redhat.com>
@@ -44,6 +48,7 @@ Johannes Carlsson <johannes.carlsson.x@sonyericsson.com>
John (J5) Palmieri <johnp@redhat.com>
Jon Gosting <yukarionsen@gmail.com>
Jon Trowbridge <trow@ximian.com>
+Kay Sievers <kay.sievers@vrfy.org>
Kimmo Hämäläinen <kimmo.hamalainen@nokia.com>
Kjartan Maraas <kmaraas@gnome.org>
Kristian Høgsberg <krh@redhat.com>
@@ -64,6 +69,7 @@ Michael Meeks <michael.meeks@novell.com>
Michael Meeks <michael@ximian.com>
Mikael Hallendal <micke@codefactory.se>
Mikael Hallendal <micke@imendio.com>
+Mike McQuaid <mike@mikemcquaid.com>
Miloslav Trmac <mitr@volny.cz>
Murray Cumming <murrayc@murrayc.com>
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
@@ -72,6 +78,7 @@ Olivier Andrieu <oliv__a@users.sourceforge.net>
Oswald Buddenhagen <ossi@kde.org>
Owen Fraser-Green <owen@discobabe.net>
Patrick von Reth <patrick.vonreth@gmail.com>
+Pau Garcia i Quiles <pgquiles@elpauer.org>
Paul Bolle <pebolle@tiscali.nl>
Peter Breitenlohner <peb@mppmu.mpg.de>
Peter Kümmel <syntheticpp@gmx.net>
@@ -82,6 +89,7 @@ Ralf Habacker <ralf.habacker@freenet.de>
Ralf Habacker <Ralf.Habacker@freenet.de>
Ralf Habacker <ralf@s15291359.onlinehome-server.info>
Ray Strode <rstrode@redhat.com>
+Richard A. Hankins <richard.a.hankins@gmail.com>
Richard Hughes <richard@hughsie.com>
Richard Hult <rhult@codefactory.se>
Richard Hult <richard@imendio.com>
@@ -96,6 +104,7 @@ Sebastian Sauer <sebsauer@kdab.net>
Seth Nickell <seth@gnome.org>
Simon McVittie <simon.mcvittie@collabora.co.uk>
Sjoerd Simons <sjoerd@luon.net>
+Sledz <sledz@MOBIL-400-586.intern.dresearch.de>
Thiago Macieira <thiago@kde.org>
Tim Dijkstra <tim@famdijkstra.org>
Tobias Mueller <fdo-bugs@cryptobitch.de>
@@ -108,5 +117,7 @@ unknown <Habacker@.(none)>
Waldo Bastian <bastian@kde.org>
William Lachance <wrlach@gmail.com>
Will Thompson <will.thompson@collabora.co.uk>
+Wulf C. Krueger <philantrop@exherbo.org>
Xan Lopez <xan@gnome.org>
+Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Zack Rusin <zack@kde.org>
diff --git a/HACKING b/HACKING
index 873e0253..4a561f2b 100644
--- a/HACKING
+++ b/HACKING
@@ -152,17 +152,13 @@ To make a release of D-Bus, do the following:
- verify that the libtool versioning/library soname is
changed if it needs to be, or not changed if not
- - update the file NEWS based on the ChangeLog
+ - update the file NEWS based on the git history
- - update the AUTHORS file based on the ChangeLog
+ - update the AUTHORS file with "make update-authors" if necessary
- - add a ChangeLog entry containing the version number
- you're releasing ("Released 0.3" or something)
- so people can see which changes were before and after
- a given release
-
- - the version number should have major.minor.micro even
- if micro is 0, i.e. "1.0.0" and "1.2.0" not "1.0"/"1.2"
+ - the version number should have major.minor.micro, even
+ if micro is 0, i.e. "1.0.0" and "1.2.0" not "1.0"/"1.2"; the micro
+ version should be even for releases, and odd for intermediate snapshots
- "make distcheck" (DO NOT just "make dist" - pass the check!)
@@ -176,8 +172,8 @@ To make a release of D-Bus, do the following:
then simply created an unsigned annotated tag:
"git tag -a -m 'Released X.Y.Z' dbus-X.Y.Z".
- - bump the version number up in configure.in, and commit
- it. Make sure you do this *after* tagging the previous
+ - bump the version number up in configure.in (so the micro version is odd),
+ and commit it. Make sure you do this *after* tagging the previous
release! The idea is that git has a newer version number
than anything released.
@@ -192,6 +188,8 @@ To make a release of D-Bus, do the following:
dbus.freedesktop.org:/srv/dbus.freedesktop.org/www/releases/dbus/dbus-X.Y.Z.tar.gz.
This should be possible if you're in group "dbus"
+ - Update the online documentation with `make -C doc maintainer-upload-docs`.
+
- update the wiki page http://www.freedesktop.org/Software/dbus by
adding the new release under the Download heading. Then, cut the
link and changelog for the previous that was there.
@@ -208,29 +206,21 @@ To make a release of D-Bus, do the following:
After making a ".0" stable release
===
-After releasing, when you increment the version number in git, also
-move the ChangeLog to ChangeLog.pre-X-Y where X-Y is what you just
-released, e.g. ChangeLog.pre-1-0. Then create and cvs add a new empty
-ChangeLog. The last entry in ChangeLog.pre-1-0 should be the one about
-"Released 1.0".
-
-Add ChangeLog.pre-X-Y to EXTRA_DIST in Makefile.am.
-
We create a branch for each stable release; sometimes the branch is
not done immediately, instead it's possible to wait until someone has
a not-suitable-for-stable change they want to make and then branch to
allow committing that change.
-The branch name should be dbus-X.Y-branch which is a branch that has
+The branch name should be dbus-X.Y which is a branch that has
releases versioned X.Y.Z
To branch:
- git branch dbus-X.Y-branch
+ git branch dbus-X.Y
and upload the branch tag to the server:
- git-push origin dbus-X.Y-branch
+ git push origin dbus-X.Y
To develop in this branch:
- git-checkout dbus-X.Y-branch
+ git checkout dbus-X.Y
Environment variables
===
@@ -287,10 +277,8 @@ is to add a test in here.
"make check" runs all the deterministic test programs (i.e. not break-loader).
-"make check-coverage" is available if you configure with --enable-gcov and
-gives a complete report on test suite coverage. You can also run
-"test/decode-gcov foo.c" on any source file to get annotated source,
-after running make check with a gcov-enabled tree.
+"make lcov-check" is available if you configure with --enable-compiler-coverage
+and gives a complete report on test suite coverage.
Patches
===
diff --git a/Makefile.am b/Makefile.am
index 8ce8d5b0..ac7dcb15 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -15,51 +15,14 @@ EXTRA_DIST = \
NEWS.pre-1-0 \
ChangeLog.pre-1-2 \
NEWS.pre-1-2 \
- README.win \
+ README.win \
+ README.wince \
+ README.cygwin \
+ README.launchd \
cmake
all-local: Doxyfile
-if DBUS_GCOV_ENABLED
-clean-gcov:
- find -name "*.da" -o -name "*.gcov" | xargs rm || true
-
-clean-bbg:
- find -name "*.bbg" -o -name "*.bb" | xargs rm || true
-
-GCOV_DIRS=dbus bus
-
-## .PHONY so it always rebuilds it
-.PHONY: coverage-report.txt
-coverage-report.txt:
- BBG_FILES=`find $(GCOV_DIRS) -name "*.bbg" -o -name "*.gcno"` ; \
- C_FILES= ; \
- for F in $$BBG_FILES ; do \
- F_nolibs=`echo $$F | sed -e 's/.libs\///g'` ; \
- C=`echo $$F_nolibs | sed -e 's/.bbg/.c/g' | sed -e 's/.gcno/.c/g'` ; \
- B=`basename $$F .bbg` ; \
- D=`dirname $$F` ; \
- DA=`echo $$F | sed -e 's/.bbg/.da/g'` ; \
- DA_libs=`echo $$D/.libs/$$B/.da` ; \
- if test -e $$DA || test -e $$DA_libs; then \
- C_FILES="$$C_FILES $$C" ; \
- fi ; \
- done ; \
- echo $$C_FILES ; \
- $(top_builddir)/test/decode-gcov --report $$C_FILES > coverage-report.txt
-
-check-coverage: clean-gcov all check coverage-report.txt
- cat coverage-report.txt
-
-else
-coverage-report.txt:
- echo "Need to reconfigure with --enable-gcov"
-
-check-coverage:
- echo "Need to reconfigure with --enable-gcov"
-
-endif
-
update-authors:
git shortlog -s -e | cut -c 8- | sort > AUTHORS
@@ -67,3 +30,5 @@ DISTCHECK_CONFIGURE_FLAGS = \
--with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
ACLOCAL_AMFLAGS = -I m4
+
+include tools/lcov.am
diff --git a/Makefile.in b/Makefile.in
index 0e5ccf2e..24064643 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -15,6 +15,28 @@
@SET_MAKE@
+# Copyright © 2008-2011 Collabora Ltd.
+# Copyright © 2008-2011 Nokia Corporation
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@@ -34,11 +56,10 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-subdir = .
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Doxyfile.in \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/config.h.in $(srcdir)/dbus-1.pc.in \
- $(top_srcdir)/configure \
+ $(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 \
@@ -58,11 +79,13 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Doxyfile.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
+subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
+ $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+ $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
@@ -244,6 +267,8 @@ EXPANDED_PREFIX = @EXPANDED_PREFIX@
EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@
FGREP = @FGREP@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -386,10 +411,12 @@ EXTRA_DIST = \
NEWS.pre-1-0 \
ChangeLog.pre-1-2 \
NEWS.pre-1-2 \
- README.win \
+ README.win \
+ README.wince \
+ README.cygwin \
+ README.launchd \
cmake
-@DBUS_GCOV_ENABLED_TRUE@GCOV_DIRS = dbus bus
DISTCHECK_CONFIGURE_FLAGS = \
--with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
@@ -400,7 +427,7 @@ all: config.h
.SUFFIXES:
am--refresh:
@:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/tools/lcov.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
@@ -954,42 +981,32 @@ uninstall-am: uninstall-pkgconfigDATA
all-local: Doxyfile
-@DBUS_GCOV_ENABLED_TRUE@clean-gcov:
-@DBUS_GCOV_ENABLED_TRUE@ find -name "*.da" -o -name "*.gcov" | xargs rm || true
-
-@DBUS_GCOV_ENABLED_TRUE@clean-bbg:
-@DBUS_GCOV_ENABLED_TRUE@ find -name "*.bbg" -o -name "*.bb" | xargs rm || true
-
-@DBUS_GCOV_ENABLED_TRUE@.PHONY: coverage-report.txt
-@DBUS_GCOV_ENABLED_TRUE@coverage-report.txt:
-@DBUS_GCOV_ENABLED_TRUE@ BBG_FILES=`find $(GCOV_DIRS) -name "*.bbg" -o -name "*.gcno"` ; \
-@DBUS_GCOV_ENABLED_TRUE@ C_FILES= ; \
-@DBUS_GCOV_ENABLED_TRUE@ for F in $$BBG_FILES ; do \
-@DBUS_GCOV_ENABLED_TRUE@ F_nolibs=`echo $$F | sed -e 's/.libs\///g'` ; \
-@DBUS_GCOV_ENABLED_TRUE@ C=`echo $$F_nolibs | sed -e 's/.bbg/.c/g' | sed -e 's/.gcno/.c/g'` ; \
-@DBUS_GCOV_ENABLED_TRUE@ B=`basename $$F .bbg` ; \
-@DBUS_GCOV_ENABLED_TRUE@ D=`dirname $$F` ; \
-@DBUS_GCOV_ENABLED_TRUE@ DA=`echo $$F | sed -e 's/.bbg/.da/g'` ; \
-@DBUS_GCOV_ENABLED_TRUE@ DA_libs=`echo $$D/.libs/$$B/.da` ; \
-@DBUS_GCOV_ENABLED_TRUE@ if test -e $$DA || test -e $$DA_libs; then \
-@DBUS_GCOV_ENABLED_TRUE@ C_FILES="$$C_FILES $$C" ; \
-@DBUS_GCOV_ENABLED_TRUE@ fi ; \
-@DBUS_GCOV_ENABLED_TRUE@ done ; \
-@DBUS_GCOV_ENABLED_TRUE@ echo $$C_FILES ; \
-@DBUS_GCOV_ENABLED_TRUE@ $(top_builddir)/test/decode-gcov --report $$C_FILES > coverage-report.txt
-
-@DBUS_GCOV_ENABLED_TRUE@check-coverage: clean-gcov all check coverage-report.txt
-@DBUS_GCOV_ENABLED_TRUE@ cat coverage-report.txt
-
-@DBUS_GCOV_ENABLED_FALSE@coverage-report.txt:
-@DBUS_GCOV_ENABLED_FALSE@ echo "Need to reconfigure with --enable-gcov"
-
-@DBUS_GCOV_ENABLED_FALSE@check-coverage:
-@DBUS_GCOV_ENABLED_FALSE@ echo "Need to reconfigure with --enable-gcov"
-
update-authors:
git shortlog -s -e | cut -c 8- | sort > AUTHORS
+lcov-reset:
+ lcov --directory @abs_top_srcdir@ --zerocounters
+
+# gcov takes ~forever to process config-parser.c for some reason?
+lcov-report:
+ true > bus/bus_test-config-parser.gcno
+ true > bus/dbus_daemon-config-parser.gcno
+ lcov --directory @abs_top_srcdir@ --capture \
+ --output-file @abs_top_builddir@/lcov.info
+ $(mkdir_p) @abs_top_builddir@/lcov.html
+ git_commit=`GIT_DIR=@abs_top_srcdir@/.git git log -1 --pretty=format:%h 2>/dev/null`;\
+ genhtml --title "@PACKAGE_STRING@ $$git_commit" \
+ --output-directory @abs_top_builddir@/lcov.html lcov.info
+ @echo
+ @echo 'lcov report can be found in:'
+ @echo 'file://@abs_top_builddir@/lcov.html/index.html'
+ @echo
+
+lcov-check:
+ $(MAKE) lcov-reset
+ $(MAKE) check $(LCOV_CHECK_ARGS)
+ $(MAKE) lcov-report
+
# 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/NEWS b/NEWS
index 2a274abb..c71f0dab 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,41 @@
+D-Bus 1.4.4 (UNRELEASED)
+==
+
+ • Switch back to using even micro versions for stable releases; 1.4.1
+ should have been called 1.4.2, so skip that version number
+ • Don't leave bad file descriptors being watched when spawning processes,
+ which could result in a busy-loop (fd.o #32992, NB#200248; possibly
+ also LP#656134, LP#680444, LP#713157)
+ • Check for MSG_NOSIGNAL correctly
+ • Fix failure to detect abstract socket support (fd.o #29895)
+ • Make _dbus_system_logv actually exit with DBUS_SYSTEM_LOG_FATAL
+ (fd.o #32262, NB#180486)
+ • Improve some error code paths (fd.o #29981, fd.o #32264, fd.o #32262,
+ fd.o #33128, fd.o #33277, fd.o #33126, NB#180486)
+ • Avoid possible symlink attacks in /tmp during compilation (fd.o #32854)
+ • Tidy up dead code (fd.o #25306, fd.o #33128, fd.o #34292, NB#180486)
+ • Improve gcc malloc annotations (fd.o #32710)
+ • If the system bus is launched via systemd, protect it from the OOM killer
+ • Documentation improvements (fd.o #11190)
+ • Avoid readdir_r, which is difficult to use correctly (fd.o #8284,
+ fd.o #15922, LP#241619)
+ • Cope with invalid files in session.d, system.d (fd.o #19186,
+ Debian #230231)
+ • Don't distribute generated files that embed our builddir (fd.o #30285,
+ fd.o #34292)
+ • Raise the system bus's fd limit to be sufficient for its configuration
+ (fd.o #33474, LP#381063)
+ • Fix syslog string processing
+ • Ignore -Waddress
+ • Remove broken gcov parsing code and --enable-gcov, and replace them
+ with lcov HTML reports and --enable-compiler-coverage (fd.o #10887)
+ • Windows:
+ · avoid live-lock in Windows CE due to unfair condition variables
+ • OpenBSD:
+ · support credentials-passing (fd.o #32542)
+ • Solaris:
+ · opt-in to thread safety (fd.o #33464)
+
D-Bus 1.4.1 (20 December 2010)
==
diff --git a/README b/README
index 89bfaf70..be4aede2 100644
--- a/README
+++ b/README
@@ -83,7 +83,7 @@ the ./configure program are these
--enable-checks include sanity checks on public API
--enable-xml-docs build XML documentation (requires xmlto)
--enable-doxygen-docs build DOXYGEN documentation (requires Doxygen)
- --enable-gcov compile with coverage profiling instrumentation (gcc only)
+ --enable-compiler-coverage compile with coverage profiling instrumentation (gcc only)
--enable-abstract-sockets use abstract socket namespace (linux only)
--enable-selinux build with SELinux support
--enable-dnotify build with dnotify support (linux only)
diff --git a/README.cygwin b/README.cygwin
new file mode 100755
index 00000000..754b3e08
--- /dev/null
+++ b/README.cygwin
@@ -0,0 +1,9 @@
+The cygwin dbus port is included in master branch of
+dbus git repository since 1.3.1.
+
+See cygwin/README for more informations about
+the cygwin dbus port.
+
+The cygwin port of dbus is maintained by:
+
+http://sourceware.org/cygwinports/
diff --git a/README.launchd b/README.launchd
new file mode 100644
index 00000000..701e57dd
--- /dev/null
+++ b/README.launchd
@@ -0,0 +1,61 @@
+Launchd[1,2] replaces init, inetd and cron on Mac OS X since 10.4 "Tiger".
+dbus uses this service to provide a common session bus address for each user
+and so deprecates the X11 enabled dbus-launcher.
+
+[1] http://developer.apple.com/MacOsX/launchd.html
+[2] http://launchd.macosforge.org/
+
+
+Setup
+===
+
+Configure with --enable-launchd and --without-x (X11 should not harm but it's
+simply not necessary any more)
+After installation, to prevent a reboot, load the dbus session starter into
+launchd by executing:
+$ launchctl load /Library/LaunchAgents/org.freedesktop.dbus-session.plist
+
+You can change the launch agent dir via configure, but it's not recommended.
+Make sure to execute the above line as the actual user for which you want to
+use a session bus since launchd manages its agents on a per user basis.
+
+
+How it works
+===
+
+Launchd allocates a socket and provides the unix path to it via the variable
+DBUS_LAUNCHD_SESSION_BUS_SOCKET in launchd's environment. Every process
+spawned by launchd (or dbus-daemon, if stared by launchd) can access it through
+its own environment. Other processes can query launchd for it by executing:
+$ launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET
+However, this is normally done by the dbus client lib for you.
+
+If launchd start dbus-daemon with a config file containing a "launchd:env=FOO"
+address, as the default session config does with env=DBUS_LAUNCHD_SESSION_BUS_SOCKET,
+the daemon will get the file descriptor from launchd and start listening on it.
+The environment variable is used to get the actual socket path which is passed
+to every service spawned by dbus-daemon as a result from autolaunch messages.
+Please note that it's not possible to start dbus-daemon manually when using a
+"launchd:" address. Only child processes of launchd can access the above
+mentioned file descriptor!
+
+To create custom buses just set up an other launch agent. As a quick start copy
+/Library/LaunchAgents/org.freedesktop.dbus-session.plist, change the label
+to i.e. "org.freedesktop.dbus-foo" and change the SecureSocketWithKey value,
+i.e. to "DBUS_LAUNCHD_FOO_BUS_SOCKET". This environment variable has to be set
+in the config file for your new bus in the <listen> element (see session.config).
+Then edit your /Library/LaunchAgents/org.freedesktop.dbus-foo.plist to start
+dbus-daemon with "--config-file=/opt/local/etc/dbus-1/foo.conf" instead of
+"--session". Now load the new plist onto launchd as described in the setup
+section of this document.
+Executing "launchctl export" should now give you two sockets, one in
+DBUS_LAUNCHD_SESSION_BUS_SOCKET and the new DBUS_LAUNCHD_FOO_BUS_SOCKET.
+To connect to this new bus use "launchd:env=DBUS_LAUNCHD_FOO_BUS_SOCKET".
+
+Since Mac OS X 10.5 "Leopard" you can also configure launchd to start
+dbus-daemon on demand as soon as some process connects to the socket. Since
+it's broken on 10.4 this feature is disabled per default. Look at
+/Library/LaunchAgents/org.freedesktop.dbus-session.plist to change it.
+
+On the client side, the envvar DBUS_SESSION_BUS_ADDRESS can be normally used
+but if it's not set, launchd is queried for the session bus socket.
diff --git a/README.wince b/README.wince
new file mode 100644
index 00000000..5790dcf0
--- /dev/null
+++ b/README.wince
@@ -0,0 +1,81 @@
+DBus Daemon for Windows CE/Windows Mobile 6.5
+=============================================
+
+Bugs in upstream for any window version:
+* MoveFileExA < 0 result check bug
+* double dbus_free somewhere I forgot where (check in -ugly)
+* alignment issue
+* CreateProcess process information handle leak
+* _dbus_getsid NULL vs INVALID_HANDLE_VALUE
+* win_account_to_sid
+
+Customisation
+=============
+
+1) At installation, the following registry value should be set to the
+installation directory of the dbus installation (the directory
+containing the bin, etc, share folders):
+
+HKLM\Software\freedesktop\DBus\Install Directory
+
+2) Instead of environment variable DBUS_VERBOSE, use
+HKLM\Software\freedesktop\DBus\Verbose
+
+2) The keyring directory is MYDOCUMENTS\dbus-keyrings, not
+HOMEPATH\.dbus-keyrings.
+
+
+Compilation
+===========
+
+./configure --host=arm-mingw32ce CPPFLAGS=-I/path/to/expat/include LDFLAGS=-L/path/to/expat/lib
+
+A recent version of libtool is required, with this change:
+
+2010-02-28 Pierre Ossman <ossman@ossman.lkpg.cendio.se> (tiny change)
+ Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ Fix deplibs check fallback for 64-bit Windows and Windows CE.
+ * libltdl/m4/libtool.m4 (_LT_CHECK_MAGIC_METHOD): Accept file formats
+ 'pe-arm-wince' and 'pe-x86-64'. Add note about consistency with ...
+ * libltdl/config/ltmain.m4sh (func_win32_libid): ... the respective
+ pattern here; sync pattern from the former.
+ * tests/deplibs-mingw.at (deplibs without file command): New
+ file, new test.
+ * Makefile.am (TESTSUITE_AT): Update.
+ * NEWS: Update.
+
+
+MB vs WCHAR
+===========
+
+Windows CE only supports the Unicode interface, while DBus Daemon uses
+the Multi-Byte interface on Windows by default. The glue code does
+not support multibyte in all cases. In particular, the _mbsrchr
+function is not correctly implemented. It could be correctly
+implemented, or dbus daemon could use the wchar interface more
+consistently on all Windows targets. For now, the Windows CE port
+will only work for filesystems without some weird characters in file
+names. Is this a serious limitation?
+
+
+Known Issues
+============
+
+Autolaunch is broken so far.
+
+Environment variables are faked. Some are punted to the registry, but
+in any case they can not be used reliably for IPC.
+
+The test suite is not ported yet.
+
+dbus-pipe.c:
+ * Uses libc file descriptors. Needed for --print-address and
+ --print-pid which probably don't work yet.
+
+dbus-sysdeps-win.c:
+ * Backtraces have been disabled.
+ * _dbus_fd_set_close_on_exec Not supported, maybe we should disable
+ the warning.
+ * SearchPathA: Uses HKLM\\Software\\freedesktop\\DBus\\Install Directory
+ to locate binaries.
diff --git a/aclocal.m4 b/aclocal.m4
index 7628df59..fc4a0801 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1080,9 +1080,11 @@ AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
+m4_include([m4/as-ac-expand.m4])
+m4_include([m4/compiler.m4])
m4_include([m4/libtool.m4])
m4_include([m4/ltoptions.m4])
m4_include([m4/ltsugar.m4])
m4_include([m4/ltversion.m4])
m4_include([m4/lt~obsolete.m4])
-m4_include([acinclude.m4])
+m4_include([m4/pkg.m4])
diff --git a/bus/Makefile.in b/bus/Makefile.in
index 7ea6fe64..d79ee5f6 100644
--- a/bus/Makefile.in
+++ b/bus/Makefile.in
@@ -56,10 +56,11 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/rc.messagebus.in $(srcdir)/session.conf.in \
$(srcdir)/system.conf.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
+ $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+ $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -385,6 +386,8 @@ EXPANDED_PREFIX = @EXPANDED_PREFIX@
EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@
FGREP = @FGREP@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
diff --git a/bus/activation.c b/bus/activation.c
index ee5efa8e..7b2a72bc 100644
--- a/bus/activation.c
+++ b/bus/activation.c
@@ -264,6 +264,7 @@ update_desktop_file_entry (BusActivation *activation,
DBusStat stat_buf;
DBusString file_path;
DBusError tmp_error;
+ dbus_bool_t retval;
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
@@ -286,14 +287,14 @@ update_desktop_file_entry (BusActivation *activation,
!_dbus_concat_dir_and_file (&file_path, filename))
{
BUS_SET_OOM (error);
- goto failed;
+ goto out;
}
if (!_dbus_stat (&file_path, &stat_buf, NULL))
{
dbus_set_error (error, DBUS_ERROR_FAILED,
"Can't stat the service file\n");
- goto failed;
+ goto out;
}
if (!bus_desktop_file_get_string (desktop_file,
@@ -301,14 +302,18 @@ update_desktop_file_entry (BusActivation *activation,
DBUS_SERVICE_NAME,
&name,
error))
- goto failed;
+ goto out;
if (!bus_desktop_file_get_string (desktop_file,
DBUS_SERVICE_SECTION,
DBUS_SERVICE_EXEC,
&exec_tmp,
error))
- goto failed;
+ goto out;
+
+ exec = _dbus_strdup (_dbus_replace_install_prefix (exec_tmp));
+ dbus_free (exec_tmp);
+ exec_tmp = NULL;
/* user is not _required_ unless we are using system activation */
if (!bus_desktop_file_get_string (desktop_file,
@@ -321,7 +326,7 @@ update_desktop_file_entry (BusActivation *activation,
if (dbus_error_has_name (&tmp_error, DBUS_ERROR_NO_MEMORY))
{
dbus_move_error (&tmp_error, error);
- goto failed;
+ goto out;
}
else
{
@@ -344,7 +349,7 @@ update_desktop_file_entry (BusActivation *activation,
if (dbus_error_has_name (&tmp_error, DBUS_ERROR_NO_MEMORY))
{
dbus_move_error (&tmp_error, error);
- goto failed;
+ goto out;
}
else
{
@@ -360,8 +365,6 @@ update_desktop_file_entry (BusActivation *activation,
entry = _dbus_hash_table_lookup_string (s_dir->entries,
_dbus_string_get_const_data (filename));
- exec = strdup (_dbus_replace_install_prefix (exec_tmp));
-
if (entry == NULL) /* New file */
{
/* FIXME we need a better-defined algorithm for which service file to
@@ -371,14 +374,14 @@ update_desktop_file_entry (BusActivation *activation,
{
dbus_set_error (error, DBUS_ERROR_FAILED,
"Service %s already exists in activation entry list\n", name);
- goto failed;
+ goto out;
}
entry = dbus_new0 (BusActivationEntry, 1);
if (entry == NULL)
{
BUS_SET_OOM (error);
- goto failed;
+ goto out;
}
entry->name = name;
@@ -387,18 +390,24 @@ update_desktop_file_entry (BusActivation *activation,
entry->systemd_service = systemd_service;
entry->refcount = 1;
+ /* ownership has been transferred to entry, do not free separately */
+ name = NULL;
+ exec = NULL;
+ user = NULL;
+ systemd_service = NULL;
+
entry->s_dir = s_dir;
entry->filename = _dbus_strdup (_dbus_string_get_const_data (filename));
if (!entry->filename)
{
BUS_SET_OOM (error);
- goto failed;
+ goto out;
}
if (!_dbus_hash_table_insert_string (activation->entries, entry->name, bus_activation_entry_ref (entry)))
{
BUS_SET_OOM (error);
- goto failed;
+ goto out;
}
if (!_dbus_hash_table_insert_string (s_dir->entries, entry->filename, bus_activation_entry_ref (entry)))
@@ -406,7 +415,7 @@ update_desktop_file_entry (BusActivation *activation,
/* Revert the insertion in the entries table */
_dbus_hash_table_remove_string (activation->entries, entry->name);
BUS_SET_OOM (error);
- goto failed;
+ goto out;
}
_dbus_verbose ("Added \"%s\" to list of services\n", entry->name);
@@ -420,17 +429,26 @@ update_desktop_file_entry (BusActivation *activation,
{
_dbus_verbose ("The new service name \"%s\" of service file \"%s\" already in cache, ignoring\n",
name, _dbus_string_get_const_data (&file_path));
- goto failed;
+ goto out;
}
+ /* ownership has been transferred to entry, do not free separately */
dbus_free (entry->name);
+ entry->name = name;
+ name = NULL;
+
dbus_free (entry->exec);
+ entry->exec = exec;
+ exec = NULL;
+
dbus_free (entry->user);
+ entry->user = user;
+ user = NULL;
+
dbus_free (entry->systemd_service);
entry->systemd_service = systemd_service;
- entry->name = name;
- entry->exec = exec;
- entry->user = user;
+ systemd_service = NULL;
+
if (!_dbus_hash_table_insert_string (activation->entries,
entry->name, bus_activation_entry_ref(entry)))
{
@@ -445,15 +463,12 @@ update_desktop_file_entry (BusActivation *activation,
}
entry->mtime = stat_buf.mtime;
+ retval = TRUE;
- _dbus_string_free (&file_path);
- bus_activation_entry_unref (entry);
-
- return TRUE;
-
-failed:
+out:
+ /* if these have been transferred into entry, the variables will be NULL */
dbus_free (name);
- dbus_free (exec_tmp);
+ dbus_free (exec);
dbus_free (user);
dbus_free (systemd_service);
_dbus_string_free (&file_path);
diff --git a/bus/bus.c b/bus/bus.c
index e8276af4..66633470 100644
--- a/bus/bus.c
+++ b/bus/bus.c
@@ -372,11 +372,20 @@ process_config_first_time_only (BusContext *context,
if (!credentials)
goto oom;
if (!_dbus_string_append (&log_prefix, "[session "))
- goto oom;
+ {
+ _dbus_credentials_unref (credentials);
+ goto oom;
+ }
if (!_dbus_credentials_to_string_append (credentials, &log_prefix))
- goto oom;
+ {
+ _dbus_credentials_unref (credentials);
+ goto oom;
+ }
if (!_dbus_string_append (&log_prefix, "] "))
- goto oom;
+ {
+ _dbus_credentials_unref (credentials);
+ goto oom;
+ }
_dbus_credentials_unref (credentials);
}
if (!_dbus_string_steal_data (&log_prefix, &context->log_prefix))
@@ -618,7 +627,6 @@ list_concat_new (DBusList **a,
*result = NULL;
- link = _dbus_list_get_first_link (a);
for (link = _dbus_list_get_first_link (a); link; link = _dbus_list_get_next_link (a, link))
{
if (!_dbus_list_append (result, link->data))
@@ -636,6 +644,24 @@ oom:
return FALSE;
}
+static void
+raise_file_descriptor_limit (BusContext *context)
+{
+
+ /* 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;
+
+ limit = context->limits.max_completed_connections +
+ context->limits.max_incomplete_connections
+ + arbitrary_extra_fds;
+
+ _dbus_request_file_descriptor_limit (limit);
+}
+
static dbus_bool_t
process_config_postinit (BusContext *context,
BusConfigParser *parser,
@@ -644,6 +670,8 @@ process_config_postinit (BusContext *context,
DBusHashTable *service_context_table;
DBusList *watched_dirs = NULL;
+ raise_file_descriptor_limit (context);
+
service_context_table = bus_config_parser_steal_service_context_table (parser);
if (!bus_registry_set_service_context_table (context->registry,
service_context_table))
diff --git a/bus/config-parser.c b/bus/config-parser.c
index 2d19f2b9..dd941e35 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-sysdeps.h>
#include <string.h>
typedef enum
@@ -2236,8 +2237,19 @@ include_dir (BusConfigParser *parser,
{
if (!include_file (parser, &full_path, TRUE, error))
{
- _dbus_string_free (&full_path);
- goto failed;
+ if (dbus_error_is_set (error))
+ {
+ /* We log to syslog unconditionally here, because this is
+ * the configuration parser, so we don't yet know whether
+ * this bus is going to want to write to syslog! (There's
+ * also some layer inversion going on, if we want to use
+ * the bus context.) */
+ _dbus_system_log (DBUS_SYSTEM_LOG_INFO,
+ "Encountered error '%s' while parsing '%s'\n",
+ error->message,
+ _dbus_string_get_const_data (&full_path));
+ dbus_error_free (error);
+ }
}
}
@@ -3243,13 +3255,13 @@ static const char *test_session_service_dir_matches[] =
#ifdef DBUS_UNIX
"/testusr/testlocal/testshare/dbus-1/services",
"/testusr/testshare/dbus-1/services",
-#endif
DBUS_DATADIR"/dbus-1/services",
-#ifdef DBUS_UNIX
"/testhome/foo/.testlocal/testshare/dbus-1/services",
#endif
+/* will be filled in test_default_session_servicedirs() */
#ifdef DBUS_WIN
NULL,
+ NULL,
#endif
NULL
};
@@ -3263,6 +3275,16 @@ test_default_session_servicedirs (void)
const char *common_progs;
int i;
+#ifdef DBUS_WIN
+ char buffer[1024];
+ if (_dbus_get_install_root(buffer, sizeof(buffer)))
+ {
+ strcat(buffer,DBUS_DATADIR);
+ strcat(buffer,"/dbus-1/services");
+ test_session_service_dir_matches[0] = buffer;
+ }
+#endif
+
/* On Unix we don't actually use this variable, but it's easier to handle the
* deallocation if we always allocate it, whether needed or not */
if (!_dbus_string_init (&progs))
diff --git a/bus/dbus.service.in b/bus/dbus.service.in
index 399306f6..8b87a58e 100644
--- a/bus/dbus.service.in
+++ b/bus/dbus.service.in
@@ -8,3 +8,4 @@ ExecStartPre=@EXPANDED_BINDIR@/dbus-uuidgen --ensure
ExecStartPre=-/bin/rm -f @DBUS_SYSTEM_PID_FILE@
ExecStart=@EXPANDED_BINDIR@/dbus-daemon --system --address=systemd: --nofork --systemd-activation
ExecReload=@EXPANDED_BINDIR@/dbus-send --print-reply --system --type=method_call --dest=org.freedesktop.DBus / org.freedesktop.DBus.ReloadConfig
+OOMScoreAdjust=-900
diff --git a/bus/dir-watch-inotify.c b/bus/dir-watch-inotify.c
index 39eff974..461b8ee3 100644
--- a/bus/dir-watch-inotify.c
+++ b/bus/dir-watch-inotify.c
@@ -259,7 +259,13 @@ _init_inotify (BusContext *context)
goto out;
}
- _dbus_register_shutdown_func (_shutdown_inotify, NULL);
+ if (!_dbus_register_shutdown_func (_shutdown_inotify, NULL))
+ {
+ _dbus_warn ("Unable to register shutdown func");
+ _dbus_watch_unref (watch);
+ watch = NULL;
+ goto out;
+ }
}
ret = 1;
diff --git a/bus/signals.c b/bus/signals.c
index 6f97b2b3..c85a88df 100644
--- a/bus/signals.c
+++ b/bus/signals.c
@@ -135,9 +135,36 @@ match_rule_to_string (BusMatchRule *rule)
if (rule->flags & BUS_MATCH_MESSAGE_TYPE)
{
- /* FIXME make type readable */
- if (!_dbus_string_append_printf (&str, "type='%d'", rule->message_type))
- goto nomem;
+ if (rule->message_type == DBUS_MESSAGE_TYPE_INVALID)
+ {
+ if (!_dbus_string_append_printf (&str, "type='INVALID'"))
+ goto nomem;
+ }
+ else if (rule->message_type == DBUS_MESSAGE_TYPE_METHOD_CALL)
+ {
+ if (!_dbus_string_append_printf (&str, "type='method_call'"))
+ goto nomem;
+ }
+ else if (rule->message_type == DBUS_MESSAGE_TYPE_METHOD_RETURN)
+ {
+ if (!_dbus_string_append_printf (&str, "type='method_return'"))
+ goto nomem;
+ }
+ else if (rule->message_type == DBUS_MESSAGE_TYPE_ERROR)
+ {
+ if (!_dbus_string_append_printf (&str, "type='error'"))
+ goto nomem;
+ }
+ else if (rule->message_type == DBUS_MESSAGE_TYPE_SIGNAL)
+ {
+ if (!_dbus_string_append_printf (&str, "type='signal'"))
+ goto nomem;
+ }
+ else
+ {
+ if (!_dbus_string_append_printf (&str, "type='%d'", rule->message_type))
+ goto nomem;
+ }
}
if (rule->flags & BUS_MATCH_INTERFACE)
@@ -1102,6 +1129,7 @@ bus_matchmaker_new (void)
else
_dbus_hash_table_unref (p->rules_by_iface);
}
+ dbus_free (matchmaker);
return NULL;
}
diff --git a/bus/test-main.c b/bus/test-main.c
index cb0ed008..cab75306 100644
--- a/bus/test-main.c
+++ b/bus/test-main.c
@@ -79,6 +79,7 @@ main (int argc, char **argv)
{
#ifdef DBUS_BUILD_TESTS
const char *dir;
+ const char *only;
DBusString test_data_dir;
progname = argv[0];
@@ -88,6 +89,11 @@ main (int argc, char **argv)
else
dir = _dbus_getenv ("DBUS_TEST_DATA");
+ if (argc > 2)
+ only = argv[2];
+ else
+ only = NULL;
+
if (dir == NULL)
{
fprintf (stderr, "Must specify test data directory as argv[1] or in DBUS_TEST_DATA env variable\n");
@@ -98,55 +104,79 @@ main (int argc, char **argv)
if (!_dbus_threads_init_debug ())
die ("initializing debug threads");
-
- test_pre_hook ();
- printf ("%s: Running expire list test\n", argv[0]);
- if (!bus_expire_list_test (&test_data_dir))
- die ("expire list");
- test_post_hook ();
-
- test_pre_hook ();
- printf ("%s: Running config file parser test\n", argv[0]);
- if (!bus_config_parser_test (&test_data_dir))
- die ("parser");
- test_post_hook ();
-
- test_pre_hook ();
- printf ("%s: Running policy test\n", argv[0]);
- if (!bus_policy_test (&test_data_dir))
- die ("policy");
- test_post_hook ();
-
- test_pre_hook ();
- printf ("%s: Running signals test\n", argv[0]);
- if (!bus_signals_test (&test_data_dir))
- die ("signals");
- test_post_hook ();
-
- test_pre_hook ();
- printf ("%s: Running SHA1 connection test\n", argv[0]);
- if (!bus_dispatch_sha1_test (&test_data_dir))
- die ("sha1");
- test_post_hook ();
-
- test_pre_hook ();
- printf ("%s: Running message dispatch test\n", argv[0]);
- if (!bus_dispatch_test (&test_data_dir))
- die ("dispatch");
- test_post_hook ();
-
- test_pre_hook ();
- printf ("%s: Running service files reloading test\n", argv[0]);
- if (!bus_activation_service_reload_test (&test_data_dir))
- die ("service reload");
- test_post_hook ();
+
+ if (only == NULL || strcmp (only, "expire-list") == 0)
+ {
+ test_pre_hook ();
+ printf ("%s: Running expire list test\n", argv[0]);
+ if (!bus_expire_list_test (&test_data_dir))
+ die ("expire list");
+ test_post_hook ();
+ }
+
+ if (only == NULL || strcmp (only, "config-parser") == 0)
+ {
+ test_pre_hook ();
+ printf ("%s: Running config file parser test\n", argv[0]);
+ if (!bus_config_parser_test (&test_data_dir))
+ die ("parser");
+ test_post_hook ();
+ }
+
+ if (only == NULL || strcmp (only, "policy") == 0)
+ {
+ test_pre_hook ();
+ printf ("%s: Running policy test\n", argv[0]);
+ if (!bus_policy_test (&test_data_dir))
+ die ("policy");
+ test_post_hook ();
+ }
+
+ if (only == NULL || strcmp (only, "signals") == 0)
+ {
+ test_pre_hook ();
+ printf ("%s: Running signals test\n", argv[0]);
+ if (!bus_signals_test (&test_data_dir))
+ die ("signals");
+ test_post_hook ();
+ }
+
+ if (only == NULL || strcmp (only, "dispatch-sha1") == 0)
+ {
+ test_pre_hook ();
+ printf ("%s: Running SHA1 connection test\n", argv[0]);
+ if (!bus_dispatch_sha1_test (&test_data_dir))
+ die ("sha1");
+ test_post_hook ();
+ }
+
+ if (only == NULL || strcmp (only, "dispatch") == 0)
+ {
+ test_pre_hook ();
+ printf ("%s: Running message dispatch test\n", argv[0]);
+ if (!bus_dispatch_test (&test_data_dir))
+ die ("dispatch");
+ test_post_hook ();
+ }
+
+ if (only == NULL || strcmp (only, "activation-service-reload") == 0)
+ {
+ test_pre_hook ();
+ printf ("%s: Running service files reloading test\n", argv[0]);
+ if (!bus_activation_service_reload_test (&test_data_dir))
+ die ("service reload");
+ test_post_hook ();
+ }
#ifdef HAVE_UNIX_FD_PASSING
- test_pre_hook ();
- printf ("%s: Running unix fd passing test\n", argv[0]);
- if (!bus_unix_fds_passing_test (&test_data_dir))
- die ("unix fd passing");
- test_post_hook ();
+ if (only == NULL || strcmp (only, "unix-fds-passing") == 0)
+ {
+ test_pre_hook ();
+ printf ("%s: Running unix fd passing test\n", argv[0]);
+ if (!bus_unix_fds_passing_test (&test_data_dir))
+ die ("unix fd passing");
+ test_post_hook ();
+ }
#endif
printf ("%s: Success\n", argv[0]);
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index c4e62d54..ae053355 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -2,7 +2,7 @@ project(dbus)
set (DBUS_MAJOR_VERSION "1")
set (DBUS_MINOR_VERSION "4")
-set (DBUS_MICRO_VERSION "1")
+set (DBUS_MICRO_VERSION "3")
# used by file version info
set (DBUS_PATCH_VERSION "0")
set (DBUS_VERSION ${DBUS_MAJOR_VERSION}.${DBUS_MINOR_VERSION}.${DBUS_MICRO_VERSION})
diff --git a/cmake/config.h.cmake b/cmake/config.h.cmake
index c1b8aebf..295e0284 100644
--- a/cmake/config.h.cmake
+++ b/cmake/config.h.cmake
@@ -247,4 +247,9 @@
#define _dbus_verbose_C_S _dbus_verbose
#endif
+#ifdef _MSC_VER
+/* avoid defines of ELEMENT_TYPE */
+#define _WINIOCTL_
+#endif
+
#endif // _DBUS_CONFIG_H
diff --git a/cmake/cross-compile.sh b/cmake/cross-compile.sh
index c1821bdb..49e66e50 100755
--- a/cmake/cross-compile.sh
+++ b/cmake/cross-compile.sh
@@ -28,8 +28,13 @@ else
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=/tmp
+export TEMP
HOST_CC=gcc; export HOST_CC;
@@ -67,10 +72,10 @@ done;
unset x i ;
if ! test -f "$cross_root/lib/libexpat.dll.a"; then
- (cd /tmp; wget http://www.winkde.org/pub/kde/ports/win32/repository/win32libs/expat-2.0.1-bin.zip)
- (cd /tmp; 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)
+ (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
diff --git a/cmake/dbus/CMakeLists.txt b/cmake/dbus/CMakeLists.txt
index afbd544e..4399081e 100644
--- a/cmake/dbus/CMakeLists.txt
+++ b/cmake/dbus/CMakeLists.txt
@@ -57,10 +57,6 @@ set (DBUS_LIB_SOURCES
${DBUS_DIR}/dbus-transport.c
${DBUS_DIR}/dbus-transport-socket.c
${DBUS_DIR}/dbus-watch.c
-#dbus-md5.c
-#
-# find a clean Windows implementation
-# and move code to a *-win.c file
)
@@ -103,7 +99,6 @@ set (DBUS_LIB_HEADERS
${DBUS_DIR}/dbus-transport-protected.h
${DBUS_DIR}/dbus-watch.h
${CMAKE_BINARY_DIR}/config.h
-##dbus-md5.h
)
if(UNIX)
set (DBUS_LIB_HEADERS ${DBUS_LIB_HEADERS}
diff --git a/cmake/test/CMakeLists.txt b/cmake/test/CMakeLists.txt
index 7bb80aba..9a259d22 100644
--- a/cmake/test/CMakeLists.txt
+++ b/cmake/test/CMakeLists.txt
@@ -52,10 +52,6 @@ set (test-sleep-forever_SOURCES
${CMAKE_SOURCE_DIR}/../test/test-sleep-forever.c
)
-set (decode_gcov_SOURCES
- ${CMAKE_SOURCE_DIR}/../test/decode-gcov.c
-)
-
add_executable(test-service ${test-service_SOURCES})
target_link_libraries(test-service ${DBUS_INTERNAL_LIBRARIES})
@@ -81,9 +77,6 @@ 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_executable(decode-gcov ${decode_gcov_SOURCES})
-#target_link_libraries(decode-gcov ${DBUS_INTERNAL_LIBRARIES})
-
### keep these in creation order, i.e. uppermost dirs first
set (TESTDIRS
test/data
diff --git a/compile b/compile
index 1b1d2321..c0096a7b 100755
--- a/compile
+++ b/compile
@@ -1,9 +1,10 @@
#! /bin/sh
# Wrapper for compilers which do not understand `-c -o'.
-scriptversion=2005-05-14.22
+scriptversion=2009-10-06.20; # UTC
-# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software
+# Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
@@ -17,8 +18,7 @@ scriptversion=2005-05-14.22
# 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.
+# 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
@@ -103,13 +103,13 @@ if test -z "$ofile" || test -z "$cfile"; then
fi
# Name of file we expect compiler to create.
-cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
+cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
# Create the lock directory.
-# Note: use `[/.-]' here to ensure that we don't use the same name
+# Note: use `[/\\:.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
-lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
+lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
while true; do
if mkdir "$lockdir" >/dev/null 2>&1; then
break
@@ -124,9 +124,9 @@ trap "rmdir '$lockdir'; exit 1" 1 2 15
ret=$?
if test -f "$cofile"; then
- mv "$cofile" "$ofile"
+ test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
- mv "${cofile}bj" "$ofile"
+ test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
fi
rmdir "$lockdir"
@@ -138,5 +138,6 @@ exit $ret
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
# End:
diff --git a/config.h.in b/config.h.in
index 9621970d..11172e76 100644
--- a/config.h.in
+++ b/config.h.in
@@ -63,9 +63,6 @@
/* Defined if gcov is enabled to force a rebuild due to config.h changing */
#undef DBUS_GCOV_ENABLED
-/* Defined if we have gcc 3.3 and thus the new gcov format */
-#undef DBUS_HAVE_GCC33_GCOV
-
/* Define to printf modifier for 64 bit integer type */
#undef DBUS_INT64_PRINTF_MODIFIER
@@ -274,6 +271,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/resource.h> header file. */
+#undef HAVE_SYS_RESOURCE_H
+
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
diff --git a/configure b/configure
index da7310c9..4d7b6b0f 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.67 for dbus 1.4.1.
+# Generated by GNU Autoconf 2.67 for dbus 1.4.4.
#
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -698,8 +698,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='dbus'
PACKAGE_TARNAME='dbus'
-PACKAGE_VERSION='1.4.1'
-PACKAGE_STRING='dbus 1.4.1'
+PACKAGE_VERSION='1.4.4'
+PACKAGE_STRING='dbus 1.4.4'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -839,7 +839,6 @@ DBUS_USE_EXPAT_FALSE
DBUS_USE_EXPAT_TRUE
LIBXML_LIBS
LIBXML_CFLAGS
-PKG_CONFIG
DBUS_PATH_OR_ABSTRACT
DBUS_INT16_TYPE
DBUS_INT32_TYPE
@@ -847,9 +846,10 @@ DBUS_HAVE_INT64
DBUS_UINT64_CONSTANT
DBUS_INT64_CONSTANT
DBUS_INT64_TYPE
-DBUS_GCOV_ENABLED_FALSE
-DBUS_GCOV_ENABLED_TRUE
R_DYNAMIC_LDFLAG
+GLIB_LIBS
+GLIB_CFLAGS
+PKG_CONFIG
DBUS_BUILD_TESTS_FALSE
DBUS_BUILD_TESTS_TRUE
DBUS_CYGWIN_FALSE
@@ -1002,6 +1002,8 @@ with_pic
enable_fast_install
with_gnu_ld
enable_libtool_lock
+enable_compiler_coverage
+enable_compiler_optimisations
enable_tests
enable_ansi
enable_verbose_mode
@@ -1009,7 +1011,6 @@ enable_asserts
enable_checks
enable_xml_docs
enable_doxygen_docs
-enable_gcov
enable_abstract_sockets
enable_selinux
enable_libaudit
@@ -1030,6 +1031,7 @@ with_console_owner_file
with_launchd_agent_dir
with_dbus_user
with_dbus_daemondir
+enable_standalone_tests
with_x
with_systemdsystemunitdir
with_dbus_test_dir
@@ -1048,6 +1050,8 @@ CCC
CPP
CXXCPP
PKG_CONFIG
+GLIB_CFLAGS
+GLIB_LIBS
LIBXML_CFLAGS
LIBXML_LIBS
XMKMF
@@ -1594,7 +1598,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures dbus 1.4.1 to adapt to many kinds of systems.
+\`configure' configures dbus 1.4.4 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1668,7 +1672,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of dbus 1.4.1:";;
+ short | recursive ) echo "Configuration of dbus 1.4.4:";;
esac
cat <<\_ACEOF
@@ -1687,15 +1691,17 @@ Optional Features:
--enable-fast-install[=PKGS]
optimize for fast installation [default=yes]
--disable-libtool-lock avoid locking (might break parallel builds)
- --enable-tests enable unit test code
+ --enable-compiler-coverage
+ Enable generation of coverage data
+ --disable-compiler-optimisations
+ Disable compiler optimisations
+ --enable-tests enable unit test code in the library and binaries
--enable-ansi enable -ansi -pedantic gcc flags
--enable-verbose-mode support verbose debug mode
--enable-asserts include assertion checks
--enable-checks include sanity checks on public API
--enable-xml-docs build XML documentation (requires xmlto)
--enable-doxygen-docs build DOXYGEN documentation (requires Doxygen)
- --enable-gcov compile with coverage profiling instrumentation (gcc
- only)
--enable-abstract-sockets
use abstract socket namespace (linux only)
--enable-selinux build with SELinux support
@@ -1707,6 +1713,9 @@ Optional Features:
enable console owner file
--enable-userdb-cache build with userdb-cache support
--enable-launchd build with launchd auto-launch support
+ --enable-standalone-tests
+ enable standalone regression tests (GLib 2.16
+ required)
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -1714,7 +1723,8 @@ Optional Packages:
--with-pic try to use only PIC/non-PIC objects [default=use
both]
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
- --with-xml=libxml/expat XML library to use
+ --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
@@ -1755,6 +1765,8 @@ Some influential environment variables:
CPP C preprocessor
CXXCPP C++ preprocessor
PKG_CONFIG path to pkg-config utility
+ GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config
+ GLIB_LIBS linker flags for GLIB, overriding pkg-config
LIBXML_CFLAGS
C compiler flags for LIBXML, overriding pkg-config
LIBXML_LIBS linker flags for LIBXML, overriding pkg-config
@@ -1827,7 +1839,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-dbus configure 1.4.1
+dbus configure 1.4.4
generated by GNU Autoconf 2.67
Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2537,7 +2549,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by dbus $as_me 1.4.1, which was
+It was created by dbus $as_me 1.4.4, which was
generated by GNU Autoconf 2.67. Invocation command line was
$ $0 $@
@@ -3731,7 +3743,7 @@ fi
# Define the identity of the package.
PACKAGE='dbus'
- VERSION='1.4.1'
+ VERSION='1.4.4'
cat >>confdefs.h <<_ACEOF
@@ -3920,7 +3932,7 @@ LT_CURRENT=8
## increment any time the source changes; set to
## 0 if you increment CURRENT
-LT_REVISION=3
+LT_REVISION=4
## increment if any interfaces have been added; set to 0
## if any interfaces have been changed or removed. removal has
@@ -3933,8 +3945,8 @@ LT_AGE=5
DBUS_MAJOR_VERSION=1
DBUS_MINOR_VERSION=4
-DBUS_MICRO_VERSION=1
-DBUS_VERSION=1.4.1
+DBUS_MICRO_VERSION=4
+DBUS_VERSION=1.4.4
@@ -6578,13 +6590,13 @@ if test "${lt_cv_nm_interface+set}" = set; then :
else
lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext
- (eval echo "\"\$as_me:6581: $ac_compile\"" >&5)
+ (eval echo "\"\$as_me:6593: $ac_compile\"" >&5)
(eval "$ac_compile" 2>conftest.err)
cat conftest.err >&5
- (eval echo "\"\$as_me:6584: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval echo "\"\$as_me:6596: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&5
- (eval echo "\"\$as_me:6587: output\"" >&5)
+ (eval echo "\"\$as_me:6599: output\"" >&5)
cat conftest.out >&5
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin"
@@ -7786,7 +7798,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 7789 "configure"' > conftest.$ac_ext
+ echo '#line 7801 "configure"' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -9573,11 +9585,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:9576: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:9588: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:9580: \$? = $ac_status" >&5
+ echo "$as_me:9592: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -9912,11 +9924,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:9915: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:9927: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:9919: \$? = $ac_status" >&5
+ echo "$as_me:9931: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -10017,11 +10029,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:10020: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:10032: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:10024: \$? = $ac_status" >&5
+ echo "$as_me:10036: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -10072,11 +10084,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:10075: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:10087: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:10079: \$? = $ac_status" >&5
+ echo "$as_me:10091: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -12456,7 +12468,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12459 "configure"
+#line 12471 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12552,7 +12564,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12555 "configure"
+#line 12567 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -14508,11 +14520,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14511: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14523: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:14515: \$? = $ac_status" >&5
+ echo "$as_me:14527: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -14607,11 +14619,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14610: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14622: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:14614: \$? = $ac_status" >&5
+ echo "$as_me:14626: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -14659,11 +14671,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14662: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14674: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:14666: \$? = $ac_status" >&5
+ echo "$as_me:14678: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -15627,6 +15639,22 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+# Check whether --enable-compiler-coverage was given.
+if test "${enable_compiler_coverage+set}" = set; then :
+ enableval=$enable_compiler_coverage; if test "x$enable_compiler_coverage" = "xyes"; then
+ if test "x$GCC" = "xyes"; then
+ CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
+ fi
+fi
+fi
+
+# Check whether --enable-compiler-optimisations was given.
+if test "${enable_compiler_optimisations+set}" = set; then :
+ enableval=$enable_compiler_optimisations; if test "x$enable_compiler_optimisations" = "xno"; then
+ CFLAGS=`echo "$CFLAGS" | sed -e "s/ -O[1-9]*\b/ -O0/g"`
+fi
+fi
+
# Set some internal variables depending on the platform for later use.
dbus_win=no
@@ -15855,13 +15883,6 @@ else
enable_doxygen_docs=auto
fi
-# Check whether --enable-gcov was given.
-if test "${enable_gcov+set}" = set; then :
- enableval=$enable_gcov; enable_gcov=$enableval
-else
- enable_gcov=no
-fi
-
# Check whether --enable-abstract-sockets was given.
if test "${enable_abstract_sockets+set}" = set; then :
enableval=$enable_abstract_sockets; enable_abstract_sockets=$enableval
@@ -16007,6 +16028,200 @@ $as_echo "#define DBUS_BUILD_TESTS 1" >>confdefs.h
fi
+# Check whether --enable-standalone-tests was given.
+if test "${enable_standalone_tests+set}" = set; then :
+ enableval=$enable_standalone_tests;
+else
+ enable_standalone_tests=yes
+fi
+
+
+if test x$enable_standalone_tests = xyes; then
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
+ # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $ac_pt_PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_pt_PKG_CONFIG" = x; then
+ PKG_CONFIG=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
+ fi
+else
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+ _pkg_min_version=0.9.0
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ PKG_CONFIG=""
+ fi
+
+fi
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5
+$as_echo_n "checking for GLIB... " >&6; }
+
+if test -n "$GLIB_CFLAGS"; then
+ pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.16\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.16") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.16" 2>/dev/null`
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$GLIB_LIBS"; then
+ pkg_cv_GLIB_LIBS="$GLIB_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.16\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.16") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.16" 2>/dev/null`
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "glib-2.0 >= 2.16" 2>&1`
+ else
+ GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors "glib-2.0 >= 2.16" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$GLIB_PKG_ERRORS" >&5
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ as_fn_error $? "The standalone regression tests require GLib" "$LINENO" 5
+elif test $pkg_failed = untried; then
+ as_fn_error $? "The standalone regression tests require GLib" "$LINENO" 5
+else
+ GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS
+ GLIB_LIBS=$pkg_cv_GLIB_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ :
+fi
+fi
+
if test x$enable_verbose_mode = xyes; then
$as_echo "#define DBUS_ENABLE_VERBOSE_MODE 1" >>confdefs.h
@@ -16051,60 +16266,15 @@ $as_echo "#define DBUS_ENABLE_USERDB_CACHE 1" >>confdefs.h
fi
-if test x$enable_gcov = xyes; then
+if test x$enable_compiler_coverage = xyes; then
## so that config.h changes when you toggle gcov support
cat >>confdefs.h <<_ACEOF
#define DBUS_GCOV_ENABLED 1
_ACEOF
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc 3.3 version of gcov file format" >&5
-$as_echo_n "checking for gcc 3.3 version of gcov file format... " >&6; }
- have_gcc33_gcov=no
- if test "$cross_compiling" = yes; then :
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run test program while cross compiling
-See \`config.log' for more details" "$LINENO" 5 ; }
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
- if (__GNUC__ >=3 && __GNUC_MINOR__ >= 3) exit (0); else exit (1);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- have_gcc33_gcov=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
- if test x$have_gcc33_gcov = xyes ; then
-
-cat >>confdefs.h <<_ACEOF
-#define DBUS_HAVE_GCC33_GCOV 1
-_ACEOF
-
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc33_gcov" >&5
-$as_echo "$have_gcc33_gcov" >&6; }
-fi
- if test x$enable_gcov = xyes; then
- DBUS_GCOV_ENABLED_TRUE=
- DBUS_GCOV_ENABLED_FALSE='#'
-else
- DBUS_GCOV_ENABLED_TRUE='#'
- DBUS_GCOV_ENABLED_FALSE=
fi
-
# glibc21.m4 serial 3
# Test for the GNU C Library, version 2.1 or newer.
@@ -16446,7 +16616,7 @@ $as_echo_n "checking 32-bit integer type... " >&6; }
case 4 in
$ac_cv_sizeof_short)
- dbusint32=int
+ dbusint32=short
;;
$ac_cv_sizeof_int)
dbusint32=int
@@ -17159,6 +17329,19 @@ $as_echo "#define HAVE_DDFD 1" >>confdefs.h
fi
fi
+for ac_header in sys/resource.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "sys/resource.h" "ac_cv_header_sys_resource_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_resource_h" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_RESOURCE_H 1
+_ACEOF
+
+fi
+
+done
+
+
for ac_header in dirent.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "dirent.h" "ac_cv_header_dirent_h" "$ac_includes_default"
@@ -17641,6 +17824,7 @@ int
main ()
{
+ size_t slen;
int listen_fd;
struct sockaddr_un addr;
@@ -17655,9 +17839,13 @@ main ()
memset (&addr, '\0', sizeof (addr));
addr.sun_family = AF_UNIX;
strcpy (addr.sun_path, "X/tmp/dbus-fake-socket-path-used-in-configure-test");
+ /* SUN_LEN uses strlen() so need to calculate it before adding \0 at the
+ * beginning.
+ */
+ slen = SUN_LEN(&addr);
addr.sun_path[0] = '\0'; /* this is what makes it abstract */
- if (bind (listen_fd, (struct sockaddr*) &addr, SUN_LEN (&addr)) < 0)
+ if (bind (listen_fd, (struct sockaddr*) &addr, slen) < 0)
{
fprintf (stderr, "Abstract socket namespace bind() failed: %s\n",
strerror (errno));
@@ -18734,7 +18922,7 @@ DBUS_CLIENT_LIBS="$THREAD_LIBS $NETWORK_libs"
DBUS_BUS_CFLAGS="$XML_CFLAGS"
-DBUS_BUS_LIBS="$XML_LIBS $SELINUX_LIBS $INTLLIBS $THREAD_LIBS $ADT_LIBS $NETWORK_libs"
+DBUS_BUS_LIBS="$XML_LIBS $SELINUX_LIBS $THREAD_LIBS $ADT_LIBS $NETWORK_libs"
@@ -19465,20 +19653,31 @@ fi
#### gcc warning flags
cc_supports_flag() {
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports \"$@\"" >&5
-$as_echo_n "checking whether $CC supports \"$@\"... " >&6; }
- Cfile=/tmp/foo${$}
- touch ${Cfile}.c
- $CC -c "$@" ${Cfile}.c -o ${Cfile}.o >/dev/null 2>&1
- rc=$?
- rm -f ${Cfile}.c ${Cfile}.o
- case $rc in
- 0) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; };;
- *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; };;
- esac
- return $rc
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports \"$*\"" >&5
+$as_echo_n "checking whether $CC supports \"$*\"... " >&6; }
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$*"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ rc=yes
+else
+ rc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CFLAGS="$save_CFLAGS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $rc" >&5
+$as_echo "$rc" >&6; }
+ test "x$rc" = xyes
}
ld_supports_flag() {
@@ -19574,8 +19773,13 @@ if test "x$GCC" = "xyes"; then
esac
case " $CFLAGS " in
+ *[\ \ ]-Wno-address[\ \ ]*) ;;
+ *) CFLAGS="$CFLAGS -Wno-address" ;;
+ esac
+
+ case " $CFLAGS " in
*[\ \ ]-Wfloat-equal[\ \ ]*) ;;
- *) if cc_supports_flag -Wfloat-equals; then
+ *) if cc_supports_flag -Wfloat-equal; then
CFLAGS="$CFLAGS -Wfloat-equal"
fi
;;
@@ -19674,24 +19878,7 @@ if test "x$GCC" = "xyes"; then
*) CFLAGS="$CFLAGS -pedantic" ;;
esac
fi
- if test x$enable_gcov = xyes; then
- case " $CFLAGS " in
- *[\ \ ]-fprofile-arcs[\ \ ]*) ;;
- *) CFLAGS="$CFLAGS -fprofile-arcs" ;;
- esac
- case " $CFLAGS " in
- *[\ \ ]-ftest-coverage[\ \ ]*) ;;
- *) CFLAGS="$CFLAGS -ftest-coverage" ;;
- esac
-
- ## remove optimization
- CFLAGS=`echo "$CFLAGS" | sed -e 's/-O[0-9]*//g'`
fi
- else
- if test x$enable_gcov = xyes; then
- as_fn_error $? "--enable-gcov can only be used with gcc" "$LINENO" 5
- fi
-fi
@@ -19707,11 +19894,10 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_gcsections" >&5
$as_echo "$ac_gcsections" >&6; }
-# Add -D_POSIX_PTHREAD_SEMANTICS if on Solaris
-#
case $host_os in
solaris*)
- CFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS" ;;
+ # Solaris' C library apparently needs these runes to be threadsafe...
+ CFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT"
esac
# compress spaces in flags
@@ -20674,10 +20860,6 @@ if test -z "${DBUS_BUILD_TESTS_TRUE}" && test -z "${DBUS_BUILD_TESTS_FALSE}"; th
as_fn_error $? "conditional \"DBUS_BUILD_TESTS\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
-if test -z "${DBUS_GCOV_ENABLED_TRUE}" && test -z "${DBUS_GCOV_ENABLED_FALSE}"; then
- as_fn_error $? "conditional \"DBUS_GCOV_ENABLED\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
if test -z "${DBUS_USE_EXPAT_TRUE}" && test -z "${DBUS_USE_EXPAT_FALSE}"; then
as_fn_error $? "conditional \"DBUS_USE_EXPAT\" was never defined.
@@ -21155,7 +21337,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by dbus $as_me 1.4.1, which was
+This file was extended by dbus $as_me 1.4.4, which was
generated by GNU Autoconf 2.67. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -21221,7 +21403,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-dbus config.status 1.4.1
+dbus config.status 1.4.4
configured by $0, generated by GNU Autoconf 2.67,
with options \\"\$ac_cs_config\\"
@@ -23302,7 +23484,7 @@ echo "
echo "
Maintainer mode: ${USE_MAINTAINER_MODE}
- gcc coverage profiling: ${enable_gcov}
+ gcc coverage profiling: ${enable_compiler_coverage}
Building unit tests: ${enable_tests}
Building verbose mode: ${enable_verbose_mode}
Building assertions: ${enable_asserts}
@@ -23316,7 +23498,6 @@ echo "
Building XML docs: ${enable_xml_docs}
Building cache support: ${enable_userdb_cache}
Building launchd support: ${have_launchd}
- Gettext libs (empty OK): ${INTLLIBS}
Using XML parser: ${with_xml}
Init scripts style: ${with_init_scripts}
Abstract socket names: ${ac_cv_have_abstract_sockets}
@@ -23342,7 +23523,7 @@ fi
if test x$enable_tests = xyes -a x$enable_asserts = xno; then
echo "NOTE: building with unit tests but without assertions means tests may not properly report failures (this configuration is only useful when doing something like profiling the tests)"
fi
-if test x$enable_gcov = xyes; then
+if test x$enable_compiler_coverage = xyes; then
echo "NOTE: building with coverage profiling is definitely for developers only."
fi
if test x$enable_verbose_mode = xyes; then
diff --git a/configure.in b/configure.in
index b0d76550..bf2c06e0 100644
--- a/configure.in
+++ b/configure.in
@@ -3,7 +3,7 @@ AC_PREREQ(2.52)
m4_define([dbus_major_version], [1])
m4_define([dbus_minor_version], [4])
-m4_define([dbus_micro_version], [1])
+m4_define([dbus_micro_version], [4])
m4_define([dbus_version],
[dbus_major_version.dbus_minor_version.dbus_micro_version])
AC_INIT(dbus, [dbus_version])
@@ -41,7 +41,7 @@ LT_CURRENT=8
## increment any time the source changes; set to
## 0 if you increment CURRENT
-LT_REVISION=3
+LT_REVISION=4
## increment if any interfaces have been added; set to 0
## if any interfaces have been changed or removed. removal has
@@ -71,6 +71,8 @@ AC_HEADER_STDC
AC_C_INLINE
AM_PROG_LIBTOOL
AC_PROG_MKDIR_P
+COMPILER_COVERAGE
+COMPILER_OPTIMISATIONS
# Set some internal variables depending on the platform for later use.
dbus_win=no
@@ -121,14 +123,13 @@ AM_CONDITIONAL(DBUS_WINCE, test "$dbus_wince" = yes)
AM_CONDITIONAL(DBUS_UNIX, test "$dbus_unix" = yes)
AM_CONDITIONAL(DBUS_CYGWIN, test "$dbus_cygwin" = yes)
-AC_ARG_ENABLE(tests, AS_HELP_STRING([--enable-tests],[enable unit test code]),enable_tests=$enableval,enable_tests=$USE_MAINTAINER_MODE)
+AC_ARG_ENABLE(tests, AS_HELP_STRING([--enable-tests],[enable unit test code in the library and binaries]),enable_tests=$enableval,enable_tests=$USE_MAINTAINER_MODE)
AC_ARG_ENABLE(ansi, AS_HELP_STRING([--enable-ansi],[enable -ansi -pedantic gcc flags]),enable_ansi=$enableval,enable_ansi=no)
AC_ARG_ENABLE(verbose-mode, AS_HELP_STRING([--enable-verbose-mode],[support verbose debug mode]),enable_verbose_mode=$enableval,enable_verbose_mode=$USE_MAINTAINER_MODE)
AC_ARG_ENABLE(asserts, AS_HELP_STRING([--enable-asserts],[include assertion checks]),enable_asserts=$enableval,enable_asserts=$USE_MAINTAINER_MODE)
AC_ARG_ENABLE(checks, AS_HELP_STRING([--enable-checks],[include sanity checks on public API]),enable_checks=$enableval,enable_checks=yes)
AC_ARG_ENABLE(xml-docs, AS_HELP_STRING([--enable-xml-docs],[build XML documentation (requires xmlto)]),enable_xml_docs=$enableval,enable_xml_docs=auto)
AC_ARG_ENABLE(doxygen-docs, AS_HELP_STRING([--enable-doxygen-docs],[build DOXYGEN documentation (requires Doxygen)]),enable_doxygen_docs=$enableval,enable_doxygen_docs=auto)
-AC_ARG_ENABLE(gcov, AS_HELP_STRING([--enable-gcov],[compile with coverage profiling instrumentation (gcc only)]),enable_gcov=$enableval,enable_gcov=no)
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)
@@ -139,7 +140,7 @@ AC_ARG_ENABLE(console-owner-file, AS_HELP_STRING([--enable-console-owner-file],[
AC_ARG_ENABLE(userdb-cache, AS_HELP_STRING([--enable-userdb-cache],[build with userdb-cache support]),enable_userdb_cache=$enableval,enable_userdb_cache=yes)
AC_ARG_ENABLE(launchd, AS_HELP_STRING([--enable-launchd],[build with launchd auto-launch support]),enable_launchd=$enableval,enable_launchd=auto)
-AC_ARG_WITH(xml, AS_HELP_STRING([--with-xml=[libxml/expat]],[XML library to use]))
+AC_ARG_WITH(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]))
@@ -153,11 +154,25 @@ AC_ARG_WITH(dbus_daemondir, AS_HELP_STRING([--with-dbus-daemondir=[dirname]],[Di
dnl DBUS_BUILD_TESTS controls unit tests built in to .c files
dnl and also some stuff in the test/ subdir
+dnl
+dnl In principle we could have separate switches for the embedded
+dnl test code in the libraries (which cause bloat and possible security holes)
+dnl and the standalone GLib regression tests, but not right now.
AM_CONDITIONAL(DBUS_BUILD_TESTS, test x$enable_tests = xyes)
if test x$enable_tests = xyes; then
AC_DEFINE(DBUS_BUILD_TESTS,1,[Build test code])
fi
+AC_ARG_ENABLE([standalone-tests],
+ AS_HELP_STRING([--enable-standalone-tests],
+ [enable standalone regression tests (GLib 2.16 required)]),
+ [], [enable_standalone_tests=yes])
+
+if test x$enable_standalone_tests = xyes; then
+ PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.16],
+ [], [AC_MSG_ERROR([The standalone regression tests require GLib])])
+fi
+
if test x$enable_verbose_mode = xyes; then
AC_DEFINE(DBUS_ENABLE_VERBOSE_MODE,1,[Support a verbose mode])
fi
@@ -188,20 +203,10 @@ if test x$enable_userdb_cache = xyes; then
AC_DEFINE(DBUS_ENABLE_USERDB_CACHE,1,[Build with caching of user data])
fi
-if test x$enable_gcov = xyes; then
+if test x$enable_compiler_coverage = xyes; then
## so that config.h changes when you toggle gcov support
AC_DEFINE_UNQUOTED(DBUS_GCOV_ENABLED, 1, [Defined if gcov is enabled to force a rebuild due to config.h changing])
-
- AC_MSG_CHECKING([for gcc 3.3 version of gcov file format])
- have_gcc33_gcov=no
- AC_RUN_IFELSE( [AC_LANG_PROGRAM( , [[ if (__GNUC__ >=3 && __GNUC_MINOR__ >= 3) exit (0); else exit (1); ]])],
- have_gcc33_gcov=yes)
- if test x$have_gcc33_gcov = xyes ; then
- AC_DEFINE_UNQUOTED(DBUS_HAVE_GCC33_GCOV, 1, [Defined if we have gcc 3.3 and thus the new gcov format])
- fi
- AC_MSG_RESULT($have_gcc33_gcov)
fi
-AM_CONDITIONAL(DBUS_GCOV_ENABLED, test x$enable_gcov = xyes)
# glibc21.m4 serial 3
dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc.
@@ -302,7 +307,7 @@ AC_MSG_CHECKING([32-bit integer type])
case 4 in
$ac_cv_sizeof_short)
- dbusint32=int
+ dbusint32=short
;;
$ac_cv_sizeof_int)
dbusint32=int
@@ -532,6 +537,8 @@ closedir(dirp);
fi
fi
+AC_CHECK_HEADERS(sys/resource.h)
+
AC_CHECK_HEADERS(dirent.h)
AC_CHECK_HEADERS(execinfo.h, [AC_CHECK_FUNCS(backtrace)])
@@ -694,6 +701,7 @@ AC_CACHE_CHECK([abstract socket namespace],
#include <errno.h>
]],
[[
+ size_t slen;
int listen_fd;
struct sockaddr_un addr;
@@ -708,9 +716,13 @@ AC_CACHE_CHECK([abstract socket namespace],
memset (&addr, '\0', sizeof (addr));
addr.sun_family = AF_UNIX;
strcpy (addr.sun_path, "X/tmp/dbus-fake-socket-path-used-in-configure-test");
+ /* SUN_LEN uses strlen() so need to calculate it before adding \0 at the
+ * beginning.
+ */
+ slen = SUN_LEN(&addr);
addr.sun_path[0] = '\0'; /* this is what makes it abstract */
- if (bind (listen_fd, (struct sockaddr*) &addr, SUN_LEN (&addr)) < 0)
+ if (bind (listen_fd, (struct sockaddr*) &addr, slen) < 0)
{
fprintf (stderr, "Abstract socket namespace bind() failed: %s\n",
strerror (errno));
@@ -1038,7 +1050,7 @@ AC_SUBST(DBUS_CLIENT_CFLAGS)
AC_SUBST(DBUS_CLIENT_LIBS)
DBUS_BUS_CFLAGS="$XML_CFLAGS"
-DBUS_BUS_LIBS="$XML_LIBS $SELINUX_LIBS $INTLLIBS $THREAD_LIBS $ADT_LIBS $NETWORK_libs"
+DBUS_BUS_LIBS="$XML_LIBS $SELINUX_LIBS $THREAD_LIBS $ADT_LIBS $NETWORK_libs"
AC_SUBST(DBUS_BUS_CFLAGS)
AC_SUBST(DBUS_BUS_LIBS)
@@ -1085,17 +1097,13 @@ fi
#### gcc warning flags
cc_supports_flag() {
- AC_MSG_CHECKING(whether $CC supports "$@")
- Cfile=/tmp/foo${$}
- touch ${Cfile}.c
- $CC -c "$@" ${Cfile}.c -o ${Cfile}.o >/dev/null 2>&1
- rc=$?
- rm -f ${Cfile}.c ${Cfile}.o
- case $rc in
- 0) AC_MSG_RESULT(yes);;
- *) AC_MSG_RESULT(no);;
- esac
- return $rc
+ AC_MSG_CHECKING(whether $CC supports "$*")
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$*"
+ AC_TRY_COMPILE([], [], [rc=yes], [rc=no])
+ CFLAGS="$save_CFLAGS"
+ AC_MSG_RESULT([$rc])
+ test "x$rc" = xyes
}
ld_supports_flag() {
@@ -1173,8 +1181,13 @@ if test "x$GCC" = "xyes"; then
esac
case " $CFLAGS " in
+ *[\ \ ]-Wno-address[\ \ ]*) ;;
+ *) CFLAGS="$CFLAGS -Wno-address" ;;
+ esac
+
+ case " $CFLAGS " in
*[\ \ ]-Wfloat-equal[\ \ ]*) ;;
- *) if cc_supports_flag -Wfloat-equals; then
+ *) if cc_supports_flag -Wfloat-equal; then
CFLAGS="$CFLAGS -Wfloat-equal"
fi
;;
@@ -1273,24 +1286,7 @@ if test "x$GCC" = "xyes"; then
*) CFLAGS="$CFLAGS -pedantic" ;;
esac
fi
- if test x$enable_gcov = xyes; then
- case " $CFLAGS " in
- *[\ \ ]-fprofile-arcs[\ \ ]*) ;;
- *) CFLAGS="$CFLAGS -fprofile-arcs" ;;
- esac
- case " $CFLAGS " in
- *[\ \ ]-ftest-coverage[\ \ ]*) ;;
- *) CFLAGS="$CFLAGS -ftest-coverage" ;;
- esac
-
- ## remove optimization
- CFLAGS=`echo "$CFLAGS" | sed -e 's/-O[0-9]*//g'`
- fi
changequote([,])dnl
-else
- if test x$enable_gcov = xyes; then
- AC_MSG_ERROR([--enable-gcov can only be used with gcc])
- fi
fi
AC_SUBST(PIC_CFLAGS)
@@ -1306,11 +1302,10 @@ AC_SUBST(SECTION_FLAGS)
AC_SUBST(SECTION_LDFLAGS)
AC_MSG_RESULT($ac_gcsections)
-# Add -D_POSIX_PTHREAD_SEMANTICS if on Solaris
-#
case $host_os in
solaris*)
- CFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS" ;;
+ # Solaris' C library apparently needs these runes to be threadsafe...
+ CFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT"
esac
changequote(,)dnl
@@ -1683,7 +1678,7 @@ echo "
echo "
Maintainer mode: ${USE_MAINTAINER_MODE}
- gcc coverage profiling: ${enable_gcov}
+ gcc coverage profiling: ${enable_compiler_coverage}
Building unit tests: ${enable_tests}
Building verbose mode: ${enable_verbose_mode}
Building assertions: ${enable_asserts}
@@ -1697,7 +1692,6 @@ echo "
Building XML docs: ${enable_xml_docs}
Building cache support: ${enable_userdb_cache}
Building launchd support: ${have_launchd}
- Gettext libs (empty OK): ${INTLLIBS}
Using XML parser: ${with_xml}
Init scripts style: ${with_init_scripts}
Abstract socket names: ${ac_cv_have_abstract_sockets}
@@ -1723,7 +1717,7 @@ fi
if test x$enable_tests = xyes -a x$enable_asserts = xno; then
echo "NOTE: building with unit tests but without assertions means tests may not properly report failures (this configuration is only useful when doing something like profiling the tests)"
fi
-if test x$enable_gcov = xyes; then
+if test x$enable_compiler_coverage = xyes; then
echo "NOTE: building with coverage profiling is definitely for developers only."
fi
if test x$enable_verbose_mode = xyes; then
diff --git a/dbus/Makefile.am b/dbus/Makefile.am
index 8d698ca3..740def3e 100644
--- a/dbus/Makefile.am
+++ b/dbus/Makefile.am
@@ -125,7 +125,7 @@ dbusinclude_HEADERS= \
dbus-types.h
-dbusarchinclude_HEADERS= \
+nodist_dbusarchinclude_HEADERS= \
dbus-arch-deps.h
### source code that goes in the installed client library
@@ -252,10 +252,9 @@ libdbus_internal_la_SOURCES= \
$(DBUS_SHARED_SOURCES) \
$(DBUS_UTIL_SOURCES)
-BUILT_SOURCES=$(dbusarchinclude_HEADERS)
+BUILT_SOURCES=$(nodist_dbusarchinclude_HEADERS)
EXTRA_DIST=dbus-arch-deps.h.in
-
## this library is the same as libdbus, but exports all the symbols
## and is only used for static linking within the dbus package.
noinst_LTLIBRARIES=libdbus-internal.la
diff --git a/dbus/Makefile.in b/dbus/Makefile.in
index 236f3670..6e8dc02b 100644
--- a/dbus/Makefile.in
+++ b/dbus/Makefile.in
@@ -40,14 +40,15 @@ host_triplet = @host@
@DBUS_BUILD_TESTS_TRUE@TESTS = dbus-test$(EXEEXT)
noinst_PROGRAMS = $(am__EXEEXT_1)
subdir = dbus
-DIST_COMMON = $(dbusarchinclude_HEADERS) $(dbusinclude_HEADERS) \
- $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- $(srcdir)/dbus-arch-deps.h.in $(srcdir)/versioninfo.rc.in
+DIST_COMMON = $(dbusinclude_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(srcdir)/dbus-arch-deps.h.in \
+ $(srcdir)/versioninfo.rc.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
+ $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+ $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -75,9 +76,8 @@ am__nobase_list = $(am__nobase_strip_setup); \
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(libdir)" \
- "$(DESTDIR)$(dbusarchincludedir)" \
- "$(DESTDIR)$(dbusincludedir)"
+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(dbusincludedir)" \
+ "$(DESTDIR)$(dbusarchincludedir)"
LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES)
am__DEPENDENCIES_1 =
am__libdbus_1_la_SOURCES_DIST = dbus-address.c dbus-auth.c dbus-auth.h \
@@ -337,7 +337,7 @@ SOURCES = $(libdbus_1_la_SOURCES) $(libdbus_internal_la_SOURCES) \
$(dbus_test_SOURCES)
DIST_SOURCES = $(am__libdbus_1_la_SOURCES_DIST) \
$(am__libdbus_internal_la_SOURCES_DIST) $(dbus_test_SOURCES)
-HEADERS = $(dbusarchinclude_HEADERS) $(dbusinclude_HEADERS)
+HEADERS = $(dbusinclude_HEADERS) $(nodist_dbusarchinclude_HEADERS)
ETAGS = etags
CTAGS = ctags
am__tty_colors = \
@@ -418,6 +418,8 @@ EXPANDED_PREFIX = @EXPANDED_PREFIX@
EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@
FGREP = @FGREP@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -642,7 +644,7 @@ dbusinclude_HEADERS = \
dbus-threads.h \
dbus-types.h
-dbusarchinclude_HEADERS = \
+nodist_dbusarchinclude_HEADERS = \
dbus-arch-deps.h
@@ -769,7 +771,7 @@ libdbus_internal_la_SOURCES = \
$(DBUS_SHARED_SOURCES) \
$(DBUS_UTIL_SOURCES)
-BUILT_SOURCES = $(dbusarchinclude_HEADERS)
+BUILT_SOURCES = $(nodist_dbusarchinclude_HEADERS)
EXTRA_DIST = dbus-arch-deps.h.in
noinst_LTLIBRARIES = libdbus-internal.la
libdbus_1_la_CPPFLAGS = -Ddbus_1_EXPORTS
@@ -2078,46 +2080,46 @@ mostlyclean-libtool:
clean-libtool:
-rm -rf .libs _libs
-install-dbusarchincludeHEADERS: $(dbusarchinclude_HEADERS)
+install-dbusincludeHEADERS: $(dbusinclude_HEADERS)
@$(NORMAL_INSTALL)
- test -z "$(dbusarchincludedir)" || $(MKDIR_P) "$(DESTDIR)$(dbusarchincludedir)"
- @list='$(dbusarchinclude_HEADERS)'; test -n "$(dbusarchincludedir)" || list=; \
+ test -z "$(dbusincludedir)" || $(MKDIR_P) "$(DESTDIR)$(dbusincludedir)"
+ @list='$(dbusinclude_HEADERS)'; test -n "$(dbusincludedir)" || list=; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
- echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(dbusarchincludedir)'"; \
- $(INSTALL_HEADER) $$files "$(DESTDIR)$(dbusarchincludedir)" || exit $$?; \
+ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(dbusincludedir)'"; \
+ $(INSTALL_HEADER) $$files "$(DESTDIR)$(dbusincludedir)" || exit $$?; \
done
-uninstall-dbusarchincludeHEADERS:
+uninstall-dbusincludeHEADERS:
@$(NORMAL_UNINSTALL)
- @list='$(dbusarchinclude_HEADERS)'; test -n "$(dbusarchincludedir)" || list=; \
+ @list='$(dbusinclude_HEADERS)'; test -n "$(dbusincludedir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$files" || exit 0; \
- echo " ( cd '$(DESTDIR)$(dbusarchincludedir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(dbusarchincludedir)" && rm -f $$files
-install-dbusincludeHEADERS: $(dbusinclude_HEADERS)
+ echo " ( cd '$(DESTDIR)$(dbusincludedir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(dbusincludedir)" && rm -f $$files
+install-nodist_dbusarchincludeHEADERS: $(nodist_dbusarchinclude_HEADERS)
@$(NORMAL_INSTALL)
- test -z "$(dbusincludedir)" || $(MKDIR_P) "$(DESTDIR)$(dbusincludedir)"
- @list='$(dbusinclude_HEADERS)'; test -n "$(dbusincludedir)" || list=; \
+ test -z "$(dbusarchincludedir)" || $(MKDIR_P) "$(DESTDIR)$(dbusarchincludedir)"
+ @list='$(nodist_dbusarchinclude_HEADERS)'; test -n "$(dbusarchincludedir)" || list=; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
- echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(dbusincludedir)'"; \
- $(INSTALL_HEADER) $$files "$(DESTDIR)$(dbusincludedir)" || exit $$?; \
+ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(dbusarchincludedir)'"; \
+ $(INSTALL_HEADER) $$files "$(DESTDIR)$(dbusarchincludedir)" || exit $$?; \
done
-uninstall-dbusincludeHEADERS:
+uninstall-nodist_dbusarchincludeHEADERS:
@$(NORMAL_UNINSTALL)
- @list='$(dbusinclude_HEADERS)'; test -n "$(dbusincludedir)" || list=; \
+ @list='$(nodist_dbusarchinclude_HEADERS)'; test -n "$(dbusarchincludedir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$files" || exit 0; \
- echo " ( cd '$(DESTDIR)$(dbusincludedir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(dbusincludedir)" && rm -f $$files
+ echo " ( cd '$(DESTDIR)$(dbusarchincludedir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(dbusarchincludedir)" && rm -f $$files
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -2299,7 +2301,7 @@ check: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) check-am
all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS)
installdirs:
- for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(dbusarchincludedir)" "$(DESTDIR)$(dbusincludedir)"; do \
+ for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(dbusincludedir)" "$(DESTDIR)$(dbusarchincludedir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: $(BUILT_SOURCES)
@@ -2352,8 +2354,8 @@ info: info-am
info-am:
-install-data-am: install-dbusarchincludeHEADERS \
- install-dbusincludeHEADERS
+install-data-am: install-dbusincludeHEADERS \
+ install-nodist_dbusarchincludeHEADERS
install-dvi: install-dvi-am
@@ -2399,8 +2401,8 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-dbusarchincludeHEADERS \
- uninstall-dbusincludeHEADERS uninstall-libLTLIBRARIES
+uninstall-am: uninstall-dbusincludeHEADERS uninstall-libLTLIBRARIES \
+ uninstall-nodist_dbusarchincludeHEADERS
.MAKE: all check check-am install install-am install-strip
@@ -2410,16 +2412,17 @@ uninstall-am: uninstall-dbusarchincludeHEADERS \
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-dbusarchincludeHEADERS 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-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
+ 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-dbusarchincludeHEADERS \
- uninstall-dbusincludeHEADERS uninstall-libLTLIBRARIES
+ tags uninstall uninstall-am uninstall-dbusincludeHEADERS \
+ uninstall-libLTLIBRARIES \
+ uninstall-nodist_dbusarchincludeHEADERS
@DBUS_WIN_TRUE@.rc.o:
diff --git a/dbus/dbus-arch-deps.h b/dbus/dbus-arch-deps.h
deleted file mode 100644
index fa8a8278..00000000
--- a/dbus/dbus-arch-deps.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu" -*- */
-/* dbus-arch-deps.h Header with architecture/compiler specific information, installed to libdir
- *
- * Copyright (C) 2003 Red Hat, Inc.
- *
- * Licensed under the Academic Free License version 2.0
- *
- * 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
- *
- */
-#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
-#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
-#endif
-
-#ifndef DBUS_ARCH_DEPS_H
-#define DBUS_ARCH_DEPS_H
-
-#include <dbus/dbus-macros.h>
-
-DBUS_BEGIN_DECLS
-
-#if 1
-#define DBUS_HAVE_INT64 1
-_DBUS_GNUC_EXTENSION typedef long dbus_int64_t;
-_DBUS_GNUC_EXTENSION typedef unsigned long dbus_uint64_t;
-
-#define DBUS_INT64_CONSTANT(val) (_DBUS_GNUC_EXTENSION (val##L))
-#define DBUS_UINT64_CONSTANT(val) (_DBUS_GNUC_EXTENSION (val##UL))
-
-#else
-#undef DBUS_HAVE_INT64
-#undef DBUS_INT64_CONSTANT
-#undef DBUS_UINT64_CONSTANT
-#endif
-
-typedef int dbus_int32_t;
-typedef unsigned int dbus_uint32_t;
-
-typedef short dbus_int16_t;
-typedef unsigned short dbus_uint16_t;
-
-/* This is not really arch-dependent, but it's not worth
- * creating an additional generated header just for this
- */
-#define DBUS_MAJOR_VERSION 1
-#define DBUS_MINOR_VERSION 4
-#define DBUS_MICRO_VERSION 1
-
-#define DBUS_VERSION_STRING "1.4.1"
-
-#define DBUS_VERSION ((1 << 16) | (4 << 8) | (1))
-
-DBUS_END_DECLS
-
-#endif /* DBUS_ARCH_DEPS_H */
diff --git a/dbus/dbus-bus.c b/dbus/dbus-bus.c
index 92ec20ed..8cb82eb8 100644
--- a/dbus/dbus-bus.c
+++ b/dbus/dbus-bus.c
@@ -769,7 +769,7 @@ dbus_bus_set_unique_name (DBusConnection *connection,
const char *unique_name)
{
BusData *bd;
- dbus_bool_t success;
+ dbus_bool_t success = FALSE;
_dbus_return_val_if_fail (connection != NULL, FALSE);
_dbus_return_val_if_fail (unique_name != NULL, FALSE);
@@ -778,13 +778,14 @@ dbus_bus_set_unique_name (DBusConnection *connection,
bd = ensure_bus_data (connection);
if (bd == NULL)
- return FALSE;
+ goto out;
_dbus_assert (bd->unique_name == NULL);
bd->unique_name = _dbus_strdup (unique_name);
success = bd->unique_name != NULL;
-
+
+out:
_DBUS_UNLOCK (bus_datas);
return success;
@@ -812,7 +813,7 @@ const char*
dbus_bus_get_unique_name (DBusConnection *connection)
{
BusData *bd;
- const char *unique_name;
+ const char *unique_name = NULL;
_dbus_return_val_if_fail (connection != NULL, NULL);
@@ -820,12 +821,13 @@ dbus_bus_get_unique_name (DBusConnection *connection)
bd = ensure_bus_data (connection);
if (bd == NULL)
- return NULL;
+ goto out;
unique_name = bd->unique_name;
+out:
_DBUS_UNLOCK (bus_datas);
-
+
return unique_name;
}
diff --git a/dbus/dbus-connection.c b/dbus/dbus-connection.c
index 5a595d8f..6779b6ae 100644
--- a/dbus/dbus-connection.c
+++ b/dbus/dbus-connection.c
@@ -233,7 +233,7 @@ struct DBusPreallocatedSend
DBusList *counter_link; /**< Preallocated link in the resource counter */
};
-#ifdef HAVE_DECL_MSG_NOSIGNAL
+#if HAVE_DECL_MSG_NOSIGNAL
static dbus_bool_t _dbus_modify_sigpipe = FALSE;
#else
static dbus_bool_t _dbus_modify_sigpipe = TRUE;
diff --git a/dbus/dbus-macros.h b/dbus/dbus-macros.h
index d1e40ecb..dcd3eebd 100644
--- a/dbus/dbus-macros.h
+++ b/dbus/dbus-macros.h
@@ -74,6 +74,20 @@
#define _DBUS_GNUC_NORETURN
#endif /* !__GNUC__ */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+#define DBUS_MALLOC __attribute__((__malloc__))
+#else
+#define DBUS_MALLOC
+#endif
+
+#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+#define DBUS_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
+#define DBUS_ALLOC_SIZE2(x,y) __attribute__((__alloc_size__(x,y)))
+#else
+#define DBUS_ALLOC_SIZE(x)
+#define DBUS_ALLOC_SIZE2(x,y)
+#endif
+
/** @def _DBUS_GNUC_PRINTF
* used to tell gcc about printf format strings
*/
diff --git a/dbus/dbus-mainloop.c b/dbus/dbus-mainloop.c
index 96ba599b..43159a70 100644
--- a/dbus/dbus-mainloop.c
+++ b/dbus/dbus-mainloop.c
@@ -28,6 +28,7 @@
#include <dbus/dbus-list.h>
#include <dbus/dbus-sysdeps.h>
+#include <dbus/dbus-watch.h>
#define MAINLOOP_SPEW 0
@@ -584,6 +585,7 @@ _dbus_loop_iterate (DBusLoop *loop,
{
unsigned int flags;
WatchCallback *wcb = WATCH_CALLBACK (cb);
+ int fd = dbus_watch_get_socket (wcb->watch);
if (wcb->last_iteration_oom)
{
@@ -599,9 +601,16 @@ _dbus_loop_iterate (DBusLoop *loop,
#if MAINLOOP_SPEW
_dbus_verbose (" skipping watch on fd %d as it was out of memory last time\n",
- dbus_watch_get_socket (wcb->watch));
+ fd);
#endif
}
+ else if (_DBUS_UNLIKELY (fd == -1))
+ {
+ _dbus_warn ("watch %p was invalidated but not removed; "
+ "removing it now\n", wcb->watch);
+ _dbus_loop_remove_watch (loop, wcb->watch, wcb->function,
+ ((Callback *)wcb)->data);
+ }
else if (dbus_watch_get_enabled (wcb->watch))
{
watches_for_fds[n_fds] = wcb;
@@ -610,7 +619,7 @@ _dbus_loop_iterate (DBusLoop *loop,
flags = dbus_watch_get_flags (wcb->watch);
- fds[n_fds].fd = dbus_watch_get_socket (wcb->watch);
+ fds[n_fds].fd = fd;
fds[n_fds].revents = 0;
fds[n_fds].events = 0;
if (flags & DBUS_WATCH_READABLE)
@@ -620,7 +629,7 @@ _dbus_loop_iterate (DBusLoop *loop,
#if MAINLOOP_SPEW
_dbus_verbose (" polling watch on fd %d %s\n",
- fds[n_fds].fd, watch_flags_to_string (flags));
+ fd, watch_flags_to_string (flags));
#endif
n_fds += 1;
@@ -629,7 +638,7 @@ _dbus_loop_iterate (DBusLoop *loop,
{
#if MAINLOOP_SPEW
_dbus_verbose (" skipping disabled watch on fd %d %s\n",
- dbus_watch_get_socket (wcb->watch),
+ fd,
watch_flags_to_string (dbus_watch_get_flags (wcb->watch)));
#endif
}
@@ -820,6 +829,15 @@ _dbus_loop_iterate (DBusLoop *loop,
retval = TRUE;
}
+
+ if (_DBUS_UNLIKELY (fds[i].revents & _DBUS_POLLNVAL))
+ {
+ _dbus_warn ("invalid request, socket fd %d not open\n",
+ fds[i].fd);
+ _dbus_watch_invalidate (wcb->watch);
+ _dbus_loop_remove_watch (loop, wcb->watch, wcb->function,
+ ((Callback *)wcb)->data);
+ }
}
++i;
diff --git a/dbus/dbus-memory.h b/dbus/dbus-memory.h
index ea28423c..4fd56bd6 100644
--- a/dbus/dbus-memory.h
+++ b/dbus/dbus-memory.h
@@ -38,10 +38,18 @@ DBUS_BEGIN_DECLS
*/
DBUS_EXPORT
+DBUS_MALLOC
+DBUS_ALLOC_SIZE(1)
void* dbus_malloc (size_t bytes);
+
DBUS_EXPORT
+DBUS_MALLOC
+DBUS_ALLOC_SIZE(1)
void* dbus_malloc0 (size_t bytes);
+
DBUS_EXPORT
+DBUS_MALLOC
+DBUS_ALLOC_SIZE(2)
void* dbus_realloc (void *memory,
size_t bytes);
DBUS_EXPORT
diff --git a/dbus/dbus-message.c b/dbus/dbus-message.c
index b19697ee..442ec2ae 100644
--- a/dbus/dbus-message.c
+++ b/dbus/dbus-message.c
@@ -1979,7 +1979,7 @@ dbus_message_iter_next (DBusMessageIter *iter)
* #DBUS_TYPE_INVALID. You can thus write a loop as follows:
*
* @code
- * dbus_message_iter_init (&iter);
+ * dbus_message_iter_init (message, &iter);
* while ((current_type = dbus_message_iter_get_arg_type (&iter)) != DBUS_TYPE_INVALID)
* dbus_message_iter_next (&iter);
* @endcode
diff --git a/dbus/dbus-nonce.c b/dbus/dbus-nonce.c
index a7a82f12..d7cee64d 100644
--- a/dbus/dbus-nonce.c
+++ b/dbus/dbus-nonce.c
@@ -137,7 +137,8 @@ _dbus_accept_with_noncefile (int listen_fd, const DBusNonceFile *noncefile)
DBusString nonce;
_dbus_assert (noncefile != NULL);
- _dbus_string_init (&nonce);
+ if (!_dbus_string_init (&nonce))
+ return -1;
//PENDING(kdab): set better errors
if (_dbus_read_nonce (_dbus_noncefile_get_path(noncefile), &nonce, NULL) != TRUE)
return -1;
@@ -161,7 +162,11 @@ generate_and_write_nonce (const DBusString *filename, DBusError *error)
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
- _dbus_string_init (&nonce);
+ if (!_dbus_string_init (&nonce))
+ {
+ dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
+ return FALSE;
+ }
if (!_dbus_generate_random_bytes (&nonce, 16))
{
diff --git a/dbus/dbus-pipe-unix.c b/dbus/dbus-pipe-unix.c
index f35024b5..1a2806e2 100644
--- a/dbus/dbus-pipe-unix.c
+++ b/dbus/dbus-pipe-unix.c
@@ -65,13 +65,13 @@ _dbus_pipe_write (DBusPipe *pipe,
*
* @param pipe the pipe instance
* @param error return location for an error
- * @returns #FALSE if error is set
+ * @returns -1 if error is set
*/
int
_dbus_pipe_close (DBusPipe *pipe,
DBusError *error)
{
- if (_dbus_close (pipe->fd_or_handle, error) < 0)
+ if (!_dbus_close (pipe->fd_or_handle, error))
{
return -1;
}
diff --git a/dbus/dbus-server-socket.c b/dbus/dbus-server-socket.c
index 758742dd..e8a24e48 100644
--- a/dbus/dbus-server-socket.c
+++ b/dbus/dbus-server-socket.c
@@ -273,7 +273,7 @@ static const DBusServerVTable socket_vtable = {
* @param fds list of file descriptors.
* @param n_fds number of file descriptors
* @param address the server's address
- * @param use_nonce whether to create and use a nonce for authentication
+ * @param noncefile to be used for authentication (NULL if not needed)
* @returns the new server, or #NULL if no memory.
*
*/
@@ -346,12 +346,6 @@ _dbus_server_new_for_socket (int *fds,
return (DBusServer*) socket_server;
- failed_3:
- if (socket_server->noncefile)
- {
- _dbus_noncefile_delete (socket_server->noncefile, NULL);
- dbus_free (socket_server->noncefile );
- }
failed_2:
for (i = 0 ; i < n_fds ; i++)
{
@@ -464,16 +458,18 @@ _dbus_server_new_for_tcp_socket (const char *host,
noncefile = dbus_new0 (DBusNonceFile, 1);
if (noncefile == NULL)
{
+ dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
goto failed_2;
}
- if (!_dbus_noncefile_create (noncefile, NULL))
- goto failed_2;
+ if (!_dbus_noncefile_create (noncefile, error))
+ goto failed_3;
if (!_dbus_string_append (&address, ",noncefile=") ||
!_dbus_address_append_escaped (&address, _dbus_noncefile_get_path (noncefile)))
{
- goto failed_2;
+ dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
+ goto failed_4;
}
}
@@ -482,7 +478,7 @@ _dbus_server_new_for_tcp_socket (const char *host,
if (server == NULL)
{
dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- goto failed_2;
+ goto failed_4;
}
_dbus_string_free (&port_str);
@@ -491,6 +487,12 @@ _dbus_server_new_for_tcp_socket (const char *host,
return server;
+ failed_4:
+ _dbus_noncefile_delete (noncefile, NULL);
+
+ failed_3:
+ dbus_free (noncefile);
+
failed_2:
for (i = 0 ; i < nlisten_fds ; i++)
_dbus_close_socket (listen_fds[i], NULL);
diff --git a/dbus/dbus-sockets-win.h b/dbus/dbus-sockets-win.h
index 5dead058..4e1ab8ca 100644
--- a/dbus/dbus-sockets-win.h
+++ b/dbus/dbus-sockets-win.h
@@ -41,16 +41,6 @@
#include <errno.h>
#endif
-/* Make use of the fact that the WSAE* error codes don't
- * overlap with errno E* codes. Wrapper functions store
- * the return value from WSAGetLastError() in errno.
- */
-#if defined(EPROTONOSUPPORT) || \
- defined(EAFNOSUPPORT) || \
- defined(EWOULDBLOCK)
-#error This does not look like Win32 and the Microsoft C library
-#endif
-
#define DBUS_SOCKET_IS_INVALID(s) ((SOCKET)(s) == INVALID_SOCKET)
#define DBUS_SOCKET_API_RETURNS_ERROR(n) ((n) == SOCKET_ERROR)
#define DBUS_SOCKET_SET_ERRNO() (_dbus_win_set_errno (WSAGetLastError()))
diff --git a/dbus/dbus-spawn.c b/dbus/dbus-spawn.c
index dcd111d9..a1bab3df 100644
--- a/dbus/dbus-spawn.c
+++ b/dbus/dbus-spawn.c
@@ -774,7 +774,32 @@ handle_watch (DBusWatch *watch,
while (LIVE_CHILDREN (sitter) &&
babysitter_iteration (sitter, FALSE))
;
-
+
+ /* Those might have closed the sockets we're watching. Before returning
+ * to the main loop, we must sort that out. */
+
+ if (sitter->error_watch != NULL && sitter->error_pipe_from_child == -1)
+ {
+ _dbus_watch_invalidate (sitter->error_watch);
+
+ if (sitter->watches != NULL)
+ _dbus_watch_list_remove_watch (sitter->watches, sitter->error_watch);
+
+ _dbus_watch_unref (sitter->error_watch);
+ sitter->error_watch = NULL;
+ }
+
+ if (sitter->sitter_watch != NULL && sitter->socket_to_babysitter == -1)
+ {
+ _dbus_watch_invalidate (sitter->sitter_watch);
+
+ if (sitter->watches != NULL)
+ _dbus_watch_list_remove_watch (sitter->watches, sitter->sitter_watch);
+
+ _dbus_watch_unref (sitter->sitter_watch);
+ sitter->sitter_watch = NULL;
+ }
+
return TRUE;
}
diff --git a/dbus/dbus-sysdeps-thread-win.c b/dbus/dbus-sysdeps-thread-win.c
index ab02950e..e2972a31 100644
--- a/dbus/dbus-sysdeps-thread-win.c
+++ b/dbus/dbus-sysdeps-thread-win.c
@@ -219,8 +219,14 @@ _dbus_windows_condvar_wake_one (DBusCondVar *cond)
EnterCriticalSection (&cond->lock);
if (cond->list != NULL)
- SetEvent (_dbus_list_pop_first (&cond->list));
-
+ {
+ SetEvent (_dbus_list_pop_first (&cond->list));
+ /* Avoid live lock by pushing the waiter to the mutex lock
+ instruction, which is fair. If we don't do this, we could
+ acquire the condition variable again before the waiter has a
+ chance itself, leading to starvation. */
+ Sleep (0);
+ }
LeaveCriticalSection (&cond->lock);
}
@@ -231,7 +237,16 @@ _dbus_windows_condvar_wake_all (DBusCondVar *cond)
while (cond->list != NULL)
SetEvent (_dbus_list_pop_first (&cond->list));
-
+
+ if (cond->list != NULL)
+ {
+ /* Avoid live lock by pushing the waiter to the mutex lock
+ instruction, which is fair. If we don't do this, we could
+ acquire the condition variable again before the waiter has a
+ chance itself, leading to starvation. */
+ Sleep (0);
+ }
+
LeaveCriticalSection (&cond->lock);
}
diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c
index 1287f730..fdea6342 100644
--- a/dbus/dbus-sysdeps-unix.c
+++ b/dbus/dbus-sysdeps-unix.c
@@ -204,7 +204,7 @@ _dbus_write_socket (int fd,
int start,
int len)
{
-#ifdef HAVE_DECL_MSG_NOSIGNAL
+#if HAVE_DECL_MSG_NOSIGNAL
const char *data;
int bytes_written;
@@ -442,7 +442,7 @@ _dbus_write_socket_with_unix_fds_two(int fd,
again:
bytes_written = sendmsg (fd, &m, 0
-#ifdef HAVE_DECL_MSG_NOSIGNAL
+#if HAVE_DECL_MSG_NOSIGNAL
|MSG_NOSIGNAL
#endif
);
@@ -481,7 +481,7 @@ _dbus_write_socket_two (int fd,
int start2,
int len2)
{
-#ifdef HAVE_DECL_MSG_NOSIGNAL
+#if HAVE_DECL_MSG_NOSIGNAL
struct iovec vectors[2];
const char *data1;
const char *data2;
@@ -1388,16 +1388,18 @@ _dbus_listen_tcp_socket (const char *host,
to use the same port */
if (!port || !strcmp(port, "0"))
{
+ int result;
struct sockaddr_storage addr;
socklen_t addrlen;
char portbuf[50];
addrlen = sizeof(addr);
- getsockname(fd, (struct sockaddr*) &addr, &addrlen);
+ result = getsockname(fd, (struct sockaddr*) &addr, &addrlen);
- if ((res = getnameinfo((struct sockaddr*)&addr, addrlen, NULL, 0,
- portbuf, sizeof(portbuf),
- NI_NUMERICHOST)) != 0)
+ if (result == -1 ||
+ (res = getnameinfo ((struct sockaddr*)&addr, addrlen, NULL, 0,
+ portbuf, sizeof(portbuf),
+ NI_NUMERICHOST)) != 0)
{
dbus_set_error (error, _dbus_error_from_errno (errno),
"Failed to resolve port \"%s:%s\": %s (%s)",
@@ -1436,7 +1438,7 @@ _dbus_listen_tcp_socket (const char *host,
dbus_set_error (error, _dbus_error_from_errno (errno),
"Failed to bind socket \"%s:%s\": %s",
host ? host : "*", port, _dbus_strerror (errno));
- return -1;
+ goto failed;
}
for (i = 0 ; i < nlisten_fd ; i++)
@@ -1494,13 +1496,13 @@ write_credentials_byte (int server_fd,
#if defined(HAVE_CMSGCRED)
bytes_written = sendmsg (server_fd, &msg, 0
-#ifdef HAVE_DECL_MSG_NOSIGNAL
+#if HAVE_DECL_MSG_NOSIGNAL
|MSG_NOSIGNAL
#endif
);
#else
bytes_written = send (server_fd, buf, 1, 0
-#ifdef HAVE_DECL_MSG_NOSIGNAL
+#if HAVE_DECL_MSG_NOSIGNAL
|MSG_NOSIGNAL
#endif
);
@@ -1658,7 +1660,11 @@ _dbus_read_credentials_socket (int client_fd,
{
#ifdef SO_PEERCRED
+#ifdef __OpenBSD__
+ struct sockpeercred cr;
+#else
struct ucred cr;
+#endif
int cr_len = sizeof (cr);
if (getsockopt (client_fd, SOL_SOCKET, SO_PEERCRED, &cr, &cr_len) == 0 &&
@@ -3188,7 +3194,12 @@ _read_subprocess_line_argv (const char *progpath,
{
/* The process ended with error */
DBusString error_message;
- _dbus_string_init (&error_message);
+ if (!_dbus_string_init (&error_message))
+ {
+ _DBUS_SET_OOM (error);
+ goto out;
+ }
+
ret = 0;
do
{
diff --git a/dbus/dbus-sysdeps-util-unix.c b/dbus/dbus-sysdeps-util-unix.c
index 5904950d..ba8ca7f8 100644
--- a/dbus/dbus-sysdeps-util-unix.c
+++ b/dbus/dbus-sysdeps-util-unix.c
@@ -42,6 +42,9 @@
#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
+#ifdef HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif
#include <grp.h>
#include <sys/socket.h>
#include <dirent.h>
@@ -369,6 +372,56 @@ _dbus_change_to_daemon_user (const char *user,
}
#endif /* !HAVE_LIBAUDIT */
+
+/**
+ * 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
+ */
+void
+_dbus_request_file_descriptor_limit (unsigned int limit)
+{
+#ifdef HAVE_SETRLIMIT
+ struct rlimit lim;
+ struct rlimit target_lim;
+ unsigned int current_limit;
+
+ /* 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.
+ */
+ if (getuid () != 0)
+ return;
+
+ if (getrlimit (RLIMIT_NOFILE, &lim) < 0)
+ return;
+
+ if (lim.rlim_cur >= limit)
+ return;
+
+ /* 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);
+#endif
+}
+
void
_dbus_init_system_log (void)
{
@@ -418,6 +471,7 @@ _dbus_system_logv (DBusSystemLogSeverity severity, const char *msg, va_list args
break;
case DBUS_SYSTEM_LOG_FATAL:
flags = LOG_DAEMON|LOG_CRIT;
+ break;
default:
return;
}
@@ -607,54 +661,14 @@ _dbus_directory_open (const DBusString *filename,
return iter;
}
-/* Calculate the required buffer size (in bytes) for directory
- * entries read from the given directory handle. Return -1 if this
- * this cannot be done.
- *
- * If you use autoconf, include fpathconf and dirfd in your
- * AC_CHECK_FUNCS list. Otherwise use some other method to detect
- * and use them where available.
- */
-static dbus_bool_t
-dirent_buf_size(DIR * dirp, size_t *size)
-{
- long name_max;
-# if defined(HAVE_FPATHCONF) && defined(_PC_NAME_MAX)
-# if defined(HAVE_DIRFD)
- name_max = fpathconf(dirfd(dirp), _PC_NAME_MAX);
-# elif defined(HAVE_DDFD)
- name_max = fpathconf(dirp->dd_fd, _PC_NAME_MAX);
-# else
- name_max = fpathconf(dirp->__dd_fd, _PC_NAME_MAX);
-# endif /* HAVE_DIRFD */
- if (name_max == -1)
-# if defined(NAME_MAX)
- name_max = NAME_MAX;
-# else
- return FALSE;
-# endif
-# elif defined(MAXNAMELEN)
- name_max = MAXNAMELEN;
-# else
-# if defined(NAME_MAX)
- name_max = NAME_MAX;
-# else
-# error "buffer size for readdir_r cannot be determined"
-# endif
-# endif
- if (size)
- *size = (size_t)offsetof(struct dirent, d_name) + name_max + 1;
- else
- return FALSE;
-
- return TRUE;
-}
-
/**
* Get next file in the directory. Will not return "." or ".." on
* UNIX. If an error occurs, the contents of "filename" are
* undefined. The error is never set if the function succeeds.
*
+ * This function is not re-entrant, and not necessarily thread-safe.
+ * Only use it for test code or single-threaded utilities.
+ *
* @param iter the iterator
* @param filename string to be set to the next file in the dir
* @param error return location for error
@@ -665,37 +679,24 @@ _dbus_directory_get_next_file (DBusDirIter *iter,
DBusString *filename,
DBusError *error)
{
- struct dirent *d, *ent;
- size_t buf_size;
+ struct dirent *ent;
int err;
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- if (!dirent_buf_size (iter->d, &buf_size))
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Can't calculate buffer size when reading directory");
- return FALSE;
- }
-
- d = (struct dirent *)dbus_malloc (buf_size);
- if (!d)
- {
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY,
- "No memory to read directory entry");
- return FALSE;
- }
again:
- err = readdir_r (iter->d, d, &ent);
- if (err || !ent)
+ errno = 0;
+ ent = readdir (iter->d);
+
+ if (!ent)
{
+ err = errno;
+
if (err != 0)
dbus_set_error (error,
_dbus_error_from_errno (err),
"%s", _dbus_strerror (err));
- dbus_free (d);
return FALSE;
}
else if (ent->d_name[0] == '.' &&
@@ -709,12 +710,10 @@ _dbus_directory_get_next_file (DBusDirIter *iter,
{
dbus_set_error (error, DBUS_ERROR_NO_MEMORY,
"No memory to read directory entry");
- dbus_free (d);
return FALSE;
}
else
{
- dbus_free (d);
return TRUE;
}
}
@@ -1059,11 +1058,11 @@ string_squash_nonprintable (DBusString *str)
for (i = 0; i < len; i++)
{
- unsigned char c = (unsigned char) buf[i];
+ unsigned char c = (unsigned char) buf[i];
if (c == '\0')
- c = ' ';
+ buf[i] = ' ';
else if (c < 0x20 || c > 127)
- c = '?';
+ buf[i] = '?';
}
}
@@ -1133,10 +1132,10 @@ _dbus_command_for_pid (unsigned long pid,
goto fail;
string_squash_nonprintable (&cmdline);
-
+
if (!_dbus_string_copy (&cmdline, 0, str, _dbus_string_get_length (str)))
goto oom;
-
+
_dbus_string_free (&cmdline);
_dbus_string_free (&path);
return TRUE;
diff --git a/dbus/dbus-sysdeps-util-win.c b/dbus/dbus-sysdeps-util-win.c
index 2f214092..f10100b6 100644
--- a/dbus/dbus-sysdeps-util-win.c
+++ b/dbus/dbus-sysdeps-util-win.c
@@ -257,6 +257,11 @@ _dbus_change_to_daemon_user (const char *user,
}
void
+_dbus_request_file_descriptor_limit (unsigned int limit)
+{
+}
+
+void
_dbus_init_system_log (void)
{
// FIXME!
diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c
index 024a8338..b70ac6ae 100644
--- a/dbus/dbus-sysdeps-win.c
+++ b/dbus/dbus-sysdeps-win.c
@@ -2054,10 +2054,6 @@ _dbus_delete_file (const DBusString *filename,
return TRUE;
}
-/* Forward declaration of prototype used in next function */
-static dbus_bool_t
-_dbus_get_install_root(char *prefix, int len);
-
/*
* replaces the term DBUS_PREFIX in configure_time_path by the
* current dbus installation directory. On unix this function is a noop
@@ -2542,9 +2538,6 @@ static const char *cDBusDaemonMutex = "DBusDaemonMutex";
// named shm for dbus adress info (per user)
static const char *cDBusDaemonAddressInfo = "DBusDaemonAddressInfo";
-dbus_bool_t
-_dbus_get_install_root(char *prefix, int len);
-
static dbus_bool_t
_dbus_get_install_root_as_hash(DBusString *out)
{
@@ -3103,7 +3096,7 @@ _dbus_get_is_errno_eagain_or_ewouldblock (void)
* @param len length of buffer
* @returns #FALSE on failure
*/
-static dbus_bool_t
+dbus_bool_t
_dbus_get_install_root(char *prefix, int len)
{
//To find the prefix, we cut the filename and also \bin\ if present
diff --git a/dbus/dbus-sysdeps-win.h b/dbus/dbus-sysdeps-win.h
index a8ff9433..74624b75 100644
--- a/dbus/dbus-sysdeps-win.h
+++ b/dbus/dbus-sysdeps-win.h
@@ -83,6 +83,8 @@ dbus_bool_t _dbus_file_exists (const char *filename);
dbus_bool_t _dbus_get_config_file_name(DBusString *config_file,
char *s);
+dbus_bool_t _dbus_get_install_root(char *prefix, int len);
+
#endif
/** @} end of sysdeps-win.h */
diff --git a/dbus/dbus-sysdeps.h b/dbus/dbus-sysdeps.h
index eb919576..22d7969e 100644
--- a/dbus/dbus-sysdeps.h
+++ b/dbus/dbus-sysdeps.h
@@ -517,6 +517,8 @@ 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
@@ -531,4 +533,9 @@ _dbus_replace_install_prefix (const char *configure_time_path);
DBUS_END_DECLS
+
+#ifdef DBUS_WIN
+#include "dbus-sysdeps-win.h"
+#endif
+
#endif /* DBUS_SYSDEPS_H */
diff --git a/dbus/dbus-test.c b/dbus/dbus-test.c
index 99becb0e..deb4c932 100644
--- a/dbus/dbus-test.c
+++ b/dbus/dbus-test.c
@@ -167,15 +167,7 @@ dbus_internal_do_not_use_run_tests (const char *test_data_dir, const char *speci
#endif
run_test ("keyring", specific_test, _dbus_keyring_test);
-
-#if 0
- printf ("%s: running md5 tests\n", "dbus-test");
- if (!_dbus_md5_test ())
- die ("md5");
- check_memleaks ();
-#endif
-
run_data_test ("sha", specific_test, _dbus_sha_test, test_data_dir);
run_data_test ("auth", specific_test, _dbus_auth_test, test_data_dir);
diff --git a/dbus/dbus-transport.c b/dbus/dbus-transport.c
index a078f7c6..ba6bd4b4 100644
--- a/dbus/dbus-transport.c
+++ b/dbus/dbus-transport.c
@@ -30,6 +30,7 @@
#include "dbus-auth.h"
#include "dbus-address.h"
#include "dbus-credentials.h"
+#include "dbus-mainloop.h"
#include "dbus-message-private.h"
#include "dbus-marshal-header.h"
#ifdef DBUS_BUILD_TESTS
@@ -741,17 +742,6 @@ _dbus_transport_get_is_authenticated (DBusTransport *transport)
_dbus_connection_unref_unlocked (transport->connection);
return FALSE;
}
-
- if (transport->expected_guid == NULL)
- {
- transport->expected_guid = _dbus_strdup (server_guid);
-
- if (transport->expected_guid == NULL)
- {
- _dbus_verbose ("No memory to complete auth\n");
- return FALSE;
- }
- }
}
/* If we're the server, see if we want to allow this identity to proceed.
@@ -853,6 +843,8 @@ _dbus_transport_get_server_id (DBusTransport *transport)
{
if (transport->is_server)
return NULL;
+ else if (transport->authenticated)
+ return _dbus_auth_get_guid_from_server (transport->auth);
else
return transport->expected_guid;
}
diff --git a/depcomp b/depcomp
index 04701da5..df8eea7e 100755
--- a/depcomp
+++ b/depcomp
@@ -1,9 +1,10 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
-scriptversion=2005-07-09.11
+scriptversion=2009-04-28.21; # UTC
-# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 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
@@ -16,9 +17,7 @@ scriptversion=2005-07-09.11
# 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.
+# 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
@@ -86,12 +85,34 @@ if test "$depmode" = dashXmstdout; then
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
+fi
+
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
- "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am. Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+ for arg
+ do
+ case $arg in
+ -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+ *) set fnord "$@" "$arg" ;;
+ esac
+ shift # fnord
+ shift # $arg
+ done
+ "$@"
stat=$?
if test $stat -eq 0; then :
else
@@ -178,14 +199,14 @@ sgi)
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr '
-' ' ' >> $depfile
- echo >> $depfile
+' ' ' >> "$depfile"
+ echo >> "$depfile"
# The second pass generates a dummy entry for each header file.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
- >> $depfile
+ >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
@@ -201,34 +222,39 @@ 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.
- stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
- tmpdepfile="$stripped.u"
+ 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
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$base.u
+ tmpdepfile3=$dir.libs/$base.u
"$@" -Wc,-M
else
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$dir$base.u
+ tmpdepfile3=$dir$base.u
"$@" -M
fi
stat=$?
- if test -f "$tmpdepfile"; then :
- else
- stripped=`echo "$stripped" | sed 's,^.*/,,'`
- tmpdepfile="$stripped.u"
- fi
-
if test $stat -eq 0; then :
else
- rm -f "$tmpdepfile"
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ do
+ test -f "$tmpdepfile" && break
+ done
if test -f "$tmpdepfile"; then
- outname="$stripped.o"
# 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,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
- sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+ # That's a tab and a space in the [].
+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -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
@@ -276,6 +302,51 @@ icc)
rm -f "$tmpdepfile"
;;
+hp2)
+ # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+ # compilers, which have integrated preprocessors. The correct option
+ # to use with these is +Maked; it writes dependencies to a file named
+ # '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$//'`
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir.libs/$base.d
+ "$@" -Wc,+Maked
+ else
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir$base.d
+ "$@" +Maked
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+ # Add `dependent.h:' lines.
+ sed -ne '2,${
+ s/^ *//
+ s/ \\*$//
+ s/$/:/
+ p
+ }' "$tmpdepfile" >> "$depfile"
+ else
+ echo "#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'.
@@ -288,13 +359,13 @@ tru64)
if test "$libtool" = yes; then
# With Tru64 cc, shared objects can also be used to make a
- # static library. This mecanism is used in libtool 1.4 series to
+ # 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 in $dir.libs/$base.o.d and
+ # 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
@@ -345,7 +416,7 @@ dashmstdout)
# Remove the call to Libtool.
if test "$libtool" = yes; then
- while test $1 != '--mode=compile'; do
+ while test "X$1" != 'X--mode=compile'; do
shift
done
shift
@@ -396,32 +467,39 @@ makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
- while test $1 != '--mode=compile'; do
+ while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
- cleared=no
- for arg in "$@"; do
+ cleared=no eat=no
+ for arg
+ do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
+ if test $eat = yes; then
+ eat=no
+ continue
+ fi
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
+ -arch)
+ eat=yes ;;
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
- obj_suffix="`echo $object | sed 's/^.*\././'`"
+ obj_suffix=`echo "$object" | sed 's/^.*\././'`
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
@@ -441,7 +519,7 @@ cpp)
# Remove the call to Libtool.
if test "$libtool" = yes; then
- while test $1 != '--mode=compile'; do
+ while test "X$1" != 'X--mode=compile'; do
shift
done
shift
@@ -479,13 +557,27 @@ cpp)
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout, regardless of -o,
- # because we must use -o when running libtool.
+ # always write the preprocessed file to stdout.
"$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
IFS=" "
for arg
do
case "$arg" in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
@@ -498,16 +590,23 @@ msvisualcpp)
;;
esac
done
- "$@" -E |
- sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
+ "$@" -E 2>/dev/null |
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
- . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
echo " " >> "$depfile"
- . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
+msvcmsys)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
none)
exec "$@"
;;
@@ -526,5 +625,6 @@ exit 0
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
# End:
diff --git a/doc/Makefile.am b/doc/Makefile.am
index bc349f87..7fe0dc10 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,11 +1,17 @@
-man_MANS = \
+# 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 = \
dbus-cleanup-sockets.1 \
- dbus-daemon.1 \
dbus-launch.1 \
dbus-monitor.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 = \
@@ -35,7 +41,7 @@ STATIC_DOCS = \
EXTRA_DIST = \
file-boilerplate.c \
$(STATIC_DOCS) \
- $(MAN_IN_FILES) $(man_MANS)
+ $(MAN_IN_FILES)
HTML_FILES= \
dbus-faq.html \
diff --git a/doc/Makefile.in b/doc/Makefile.in
index c75d4ee9..260f24f9 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -35,13 +35,14 @@ build_triplet = @build@
host_triplet = @host@
@DBUS_XML_DOCS_ENABLED_TRUE@am__append_1 = $(HTML_FILES)
subdir = doc
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- $(srcdir)/dbus-daemon.1.in TODO
+DIST_COMMON = $(dist_man1_MANS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(srcdir)/dbus-daemon.1.in TODO
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
+ $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+ $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -80,7 +81,7 @@ am__base_list = \
man1dir = $(mandir)/man1
am__installdirs = "$(DESTDIR)$(man1dir)"
NROFF = nroff
-MANS = $(man_MANS)
+MANS = $(dist_man1_MANS) $(man1_MANS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@@ -157,6 +158,8 @@ EXPANDED_PREFIX = @EXPANDED_PREFIX@
EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@
FGREP = @FGREP@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -284,14 +287,22 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-man_MANS = \
+
+# 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 = \
dbus-cleanup-sockets.1 \
- dbus-daemon.1 \
dbus-launch.1 \
dbus-monitor.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 \
@@ -318,7 +329,7 @@ STATIC_DOCS = \
$(DTDS)
EXTRA_DIST = file-boilerplate.c $(STATIC_DOCS) $(MAN_IN_FILES) \
- $(man_MANS) $(am__append_1)
+ $(am__append_1)
HTML_FILES = \
dbus-faq.html \
dbus-specification.html \
@@ -381,13 +392,11 @@ mostlyclean-libtool:
clean-libtool:
-rm -rf .libs _libs
-install-man1: $(man_MANS)
+install-man1: $(dist_man1_MANS) $(man1_MANS)
@$(NORMAL_INSTALL)
test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
- @list=''; test -n "$(man1dir)" || exit 0; \
+ @list='$(dist_man1_MANS) $(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
{ for i in $$list; do echo "$$i"; done; \
- l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
- sed -n '/\.1[a-z]*$$/p'; \
} | while read p; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; echo "$$p"; \
@@ -410,10 +419,8 @@ install-man1: $(man_MANS)
uninstall-man1:
@$(NORMAL_UNINSTALL)
- @list=''; test -n "$(man1dir)" || exit 0; \
+ @list='$(dist_man1_MANS) $(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
files=`{ for i in $$list; do echo "$$i"; done; \
- l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
- sed -n '/\.1[a-z]*$$/p'; \
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
test -z "$$files" || { \
diff --git a/doc/dbus-daemon.1 b/doc/dbus-daemon.1
deleted file mode 100644
index ed92aee7..00000000
--- a/doc/dbus-daemon.1
+++ /dev/null
@@ -1,752 +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=/usr/local/etc/dbus-1/session.conf" and the \-\-system
-option is equivalent to
-"\-\-config-file=/usr/local/etc/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.
-
-.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 "/usr/local/etc/dbus-1/system.conf" and
-"/usr/local/etc/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
-/usr/local/etc/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
-/usr/local/etc/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 /usr/local/share/dbus-1/system-services.
-
-.PP
-The <standard_system_servicedirs/> option is only relevant to the
-per-system bus daemon defined in
-/usr/local/etc/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 /usr/local/etc/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"
- 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
-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/doc/dbus-faq.html b/doc/dbus-faq.html
index 0f3dafae..d527330b 100644
--- a/doc/dbus-faq.html
+++ b/doc/dbus-faq.html
@@ -1,13 +1,13 @@
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>D-Bus FAQ</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="article" title="D-Bus FAQ"><div class="titlepage"><div><div><h2 class="title"><a name="index"></a>D-Bus FAQ</h2></div><div><div class="authorgroup"><div class="author"><h3 class="author"><span class="firstname">Havoc</span> <span class="surname">Pennington</span></h3><div class="affiliation"><span class="orgname">Red Hat, Inc.<br></span><div class="address"><p><br>
<code class="email">&lt;<a class="email" href="mailto:hp@pobox.com">hp@pobox.com</a>&gt;</code><br>
- </p></div></div></div><div class="author"><h3 class="author"><span class="firstname">David</span> <span class="othername">A</span> <span class="surname">Wheeler</span></h3></div></div></div><div><p class="releaseinfo">Version 0.3</p></div></div><hr></div><div class="qandaset" title="Frequently Asked Questions"><a name="faq"></a><dl><dt>1. <a href="#id381073">
+ </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="#id465721">
What is D-Bus?
- </a></dt><dt>2. <a href="#id350904">
+ </a></dt><dt>2. <a href="#id493175">
Is D-Bus stable/finished?
- </a></dt><dt>3. <a href="#id353770">
+ </a></dt><dt>3. <a href="#id493202">
How is the reference implementation licensed? Can I use it in
proprietary applications?
- </a></dt><dt>4. <a href="#id353803">
+ </a></dt><dt>4. <a href="#id462393">
What is the difference between a bus name, and object path,
and an interface?
</a></dt><dt>5. <a href="#service">
@@ -39,9 +39,9 @@
How does D-Bus differ from [yet more IPC mechanisms]?
</a></dt><dt>18. <a href="#which-ipc">
Which IPC mechanism should I use?
- </a></dt><dt>19. <a href="#id390207">
+ </a></dt><dt>19. <a href="#id502405">
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="id381073"></a><a name="id381075"></a><p><b>1.</b></p></td><td align="left" valign="top"><p>
+ </a></dt></dl><table border="0" width="100%" summary="Q and A Set"><col align="left" width="1%"><col><tbody><tr class="question" title="1."><td align="left" valign="top"><a name="id465721"></a><a name="id465723"></a><p><b>1.</b></p></td><td align="left" valign="top"><p>
What is D-Bus?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
This is probably best answered by reading the D-Bus <a class="ulink" href="dbus-tutorial.html" target="_top">tutorial</a> or
@@ -52,7 +52,7 @@
Phrased differently, D-Bus is 1) an interprocess communication (IPC) system and 2) some higher-level
structure (lifecycle tracking, service activation, security policy) provided by two bus daemons,
one systemwide and one per-user-session.
- </p></td></tr><tr class="question" title="2."><td align="left" valign="top"><a name="id350904"></a><a name="id350906"></a><p><b>2.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="2."><td align="left" valign="top"><a name="id493175"></a><a name="id493177"></a><p><b>2.</b></p></td><td align="left" valign="top"><p>
Is D-Bus stable/finished?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
The low-level library "libdbus" and the protocol specification are considered
@@ -62,7 +62,7 @@
have their own release schedules and degree of maturity, not linked to
the low-level library and bus daemon release. Check the project page for
the binding you're considering to understand that project's policies.
- </p></td></tr><tr class="question" title="3."><td align="left" valign="top"><a name="id353770"></a><a name="id353772"></a><p><b>3.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="3."><td align="left" valign="top"><a name="id493202"></a><a name="id493204"></a><p><b>3.</b></p></td><td align="left" valign="top"><p>
How is the reference implementation licensed? Can I use it in
proprietary applications?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
@@ -77,7 +77,7 @@
use D-Bus</em></span>. If you're going to sue, you have to stop using
the software. Read the licenses to determine their meaning, this FAQ
entry is not intended to change the meaning or terms of the licenses.
- </p></td></tr><tr class="question" title="4."><td align="left" valign="top"><a name="id353803"></a><a name="id353805"></a><p><b>4.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="4."><td align="left" valign="top"><a name="id462393"></a><a name="id462395"></a><p><b>4.</b></p></td><td align="left" valign="top"><p>
What is the difference between a bus name, and object path,
and an interface?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
@@ -107,7 +107,7 @@
interfaces, such as <code class="literal">org.freedesktop.DBus.Introspectable</code>,
<code class="literal">org.freedesktop.BasicTextField</code>,
<code class="literal">org.kde.RichTextDocument</code>.
- </p></td></tr><tr class="question" title="5."><td align="left" valign="top"><a name="service"></a><a name="id350253"></a><p><b>5.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="5."><td align="left" valign="top"><a name="service"></a><a name="id462535"></a><p><b>5.</b></p></td><td align="left" valign="top"><p>
What is a "service"?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
A service is a program that can be launched by the bus daemon
@@ -120,7 +120,7 @@
In the D-Bus docs we try to use "service" only when talking about
programs the bus knows how to launch, i.e. a service always has a
.service file.
- </p></td></tr><tr class="question" title="6."><td align="left" valign="top"><a name="components"></a><a name="id350280"></a><p><b>6.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="6."><td align="left" valign="top"><a name="components"></a><a name="id462562"></a><p><b>6.</b></p></td><td align="left" valign="top"><p>
Is D-Bus a "component system"?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
It helps to keep these concepts separate in your mind:
@@ -170,7 +170,7 @@
from component/object systems, though perhaps a "plugin" tends to be a
bundle of objects with a user-visible name and can be
downloaded/packaged as a unit.
- </p></td></tr><tr class="question" title="7."><td align="left" valign="top"><a name="speed"></a><a name="id350384"></a><p><b>7.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="7."><td align="left" valign="top"><a name="speed"></a><a name="id462666"></a><p><b>7.</b></p></td><td align="left" valign="top"><p>
How fast is the D-Bus reference implementation?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
Of course it depends a bit on what you're doing.
@@ -198,7 +198,7 @@
enable asynchronous communication and avoid round trips.
This is frequently a more important performance issue
than throughput.
- </p></td></tr><tr class="question" title="8."><td align="left" valign="top"><a name="size"></a><a name="id350430"></a><p><b>8.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="8."><td align="left" valign="top"><a name="size"></a><a name="id501695"></a><p><b>8.</b></p></td><td align="left" valign="top"><p>
How large is the D-Bus reference implementation?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
A production build (with assertions, unit tests, and verbose logging
@@ -207,7 +207,7 @@
A much, much smaller implementation would be possible by omitting out
of memory handling, hardcoding a main loop (or always using blocking
I/O), skipping validation, and otherwise simplifying things.
- </p></td></tr><tr class="question" title="9."><td align="left" valign="top"><a name="other-ipc"></a><a name="id350456"></a><p><b>9.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="9."><td align="left" valign="top"><a name="other-ipc"></a><a name="id501720"></a><p><b>9.</b></p></td><td align="left" valign="top"><p>
How does D-Bus differ from other interprocess communication
or networking protocols?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
@@ -240,7 +240,7 @@
Note: the D-Bus mailing list subscribers are <span class="emphasis"><em>very much not
interested</em></span> in debating which IPC system is the One True
System. So if you want to discuss that, please use another forum.
- </p></td></tr><tr class="question" title="10."><td align="left" valign="top"><a name="corba"></a><a name="id389592"></a><p><b>10.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="10."><td align="left" valign="top"><a name="corba"></a><a name="id501791"></a><p><b>10.</b></p></td><td align="left" valign="top"><p>
How does D-Bus differ from CORBA?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
Start by reading <a class="xref" href="#other-ipc" title="9.">Q:9</a>.
@@ -292,7 +292,7 @@
</p><p>
On a more trivial note, D-Bus involves substantially fewer acronyms
than CORBA.
- </p></td></tr><tr class="question" title="11."><td align="left" valign="top"><a name="xmlrpcsoap"></a><a name="id349982"></a><p><b>11.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="11."><td align="left" valign="top"><a name="xmlrpcsoap"></a><a name="id462130"></a><p><b>11.</b></p></td><td align="left" valign="top"><p>
How does D-Bus differ from XML-RPC and SOAP?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
Start by reading <a class="xref" href="#other-ipc" title="9.">Q:9</a>.
@@ -311,7 +311,7 @@
supports lifecycle tracking of other applications connected
to the bus. With XML-RPC and SOAP, typically each method call
exists in isolation and has its own HTTP connection.
- </p></td></tr><tr class="question" title="12."><td align="left" valign="top"><a name="dce"></a><a name="id389918"></a><p><b>12.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="12."><td align="left" valign="top"><a name="dce"></a><a name="id502116"></a><p><b>12.</b></p></td><td align="left" valign="top"><p>
How does D-Bus differ from DCE?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
Start by reading <a class="xref" href="#other-ipc" title="9.">Q:9</a>.
@@ -324,7 +324,7 @@
a distributed time service. As the name implies, DCE is intended for
use in a large, multi-computer distributed application. D-Bus would
not be well-suited for this.
- </p></td></tr><tr class="question" title="13."><td align="left" valign="top"><a name="dcom"></a><a name="id389958"></a><p><b>13.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="13."><td align="left" valign="top"><a name="dcom"></a><a name="id502156"></a><p><b>13.</b></p></td><td align="left" valign="top"><p>
How does D-Bus differ from DCOM and COM?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
Start by reading <a class="xref" href="#other-ipc" title="9.">Q:9</a>.
@@ -334,7 +334,7 @@
</p><p>
DCOM (distributed COM) is a Windows IPC system designed for use with
the COM object system. It's similar in some ways to DCE and CORBA.
- </p></td></tr><tr class="question" title="14."><td align="left" valign="top"><a name="internet-communications-engine"></a><a name="id389994"></a><p><b>14.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="14."><td align="left" valign="top"><a name="internet-communications-engine"></a><a name="id502192"></a><p><b>14.</b></p></td><td align="left" valign="top"><p>
How does D-Bus differ from ZeroC's Internet Communications Engine (Ice)
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
Start by reading <a class="xref" href="#other-ipc" title="9.">Q:9</a>.
@@ -344,7 +344,7 @@
on the level of SOAP or CORBA than D-Bus. Ice has a "dual-license"
business around it; i.e. you can use it under the GPL, or pay for a
proprietary license.
- </p></td></tr><tr class="question" title="15."><td align="left" valign="top"><a name="inter-client-exchange"></a><a name="id390027"></a><p><b>15.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="15."><td align="left" valign="top"><a name="inter-client-exchange"></a><a name="id502226"></a><p><b>15.</b></p></td><td align="left" valign="top"><p>
How does D-Bus differ from Inter-Client Exchange (ICE)?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
<a class="ulink" href="http://www.x.org/X11R6.8.1/docs/ICE/ice.pdf" target="_top">ICE</a>
@@ -362,7 +362,7 @@
DCOP and XSMP are the only two widely-used applications of ICE,
and both could in principle be replaced by D-Bus. (Though whether
GNOME and KDE will bother is an open question.)
- </p></td></tr><tr class="question" title="16."><td align="left" valign="top"><a name="dcop"></a><a name="id390066"></a><p><b>16.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="16."><td align="left" valign="top"><a name="dcop"></a><a name="id502264"></a><p><b>16.</b></p></td><td align="left" valign="top"><p>
How does D-Bus differ from DCOP?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
Start by reading <a class="xref" href="#other-ipc" title="9.">Q:9</a>.
@@ -389,14 +389,14 @@
DCOP's implementation to use D-Bus internally (so that GNOME and KDE
would end up using exactly the same bus). See the KDE mailing list
archives for some of these discussions.
- </p></td></tr><tr class="question" title="17."><td align="left" valign="top"><a name="yet-more-ipc"></a><a name="id390124"></a><p><b>17.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="17."><td align="left" valign="top"><a name="yet-more-ipc"></a><a name="id502322"></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="id390157"></a><p><b>18.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="18."><td align="left" valign="top"><a name="which-ipc"></a><a name="id502355"></a><p><b>18.</b></p></td><td align="left" valign="top"><p>
Which IPC mechanism should I use?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
Start by reading <a class="xref" href="#other-ipc" title="9.">Q:9</a>.
@@ -427,7 +427,7 @@
to search the list archives is probably to use
an Internet engine such as Google. On Google,
include "site:freedesktop.org" in your search.
- </p></td></tr><tr class="question" title="19."><td align="left" valign="top"><a name="id390207"></a><a name="id390209"></a><p><b>19.</b></p></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="question" title="19."><td align="left" valign="top"><a name="id502405"></a><a name="id502407"></a><p><b>19.</b></p></td><td align="left" valign="top"><p>
How can I submit a bug or patch?
</p></td></tr><tr class="answer"><td align="left" valign="top"></td><td align="left" valign="top"><p>
The D-Bus <a class="ulink" href="http://dbus.freedesktop.org" target="_top">web site</a>
diff --git a/doc/dbus-specification.html b/doc/dbus-specification.html
index 3be81a12..9e6b1e84 100644
--- a/doc/dbus-specification.html
+++ b/doc/dbus-specification.html
@@ -4,7 +4,7 @@
<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></div><div><p class="releaseinfo">Version 0.15</p></div><div><div class="revhistory"><table border="1" width="100%" summary="Revision history"><tr><th align="left" valign="top" colspan="3"><b>Revision History</b></th></tr><tr><td align="left">Revision current</td><td align="left"><a class="ulink" href="http://cgit.freedesktop.org/dbus/dbus/log/doc/dbus-specification.xml" target="_top">commit log</a></td><td align="left"></td></tr><tr><td align="left" colspan="3"></td></tr><tr><td align="left">Revision 0.15</td><td align="left">3 November 2010</td><td align="left"></td></tr><tr><td align="left" colspan="3"></td></tr><tr><td align="left">Revision 0.14</td><td align="left">12 May 2010</td><td align="left"></td></tr><tr><td align="left" colspan="3"></td></tr><tr><td align="left">Revision 0.13</td><td align="left">23 Dezember 2009</td><td align="left"></td></tr><tr><td align="left" colspan="3"></td></tr><tr><td align="left">Revision 0.12</td><td align="left">7 November, 2006</td><td align="left"></td></tr><tr><td align="left" colspan="3"></td></tr><tr><td align="left">Revision 0.11</td><td align="left">6 February 2005</td><td align="left"></td></tr><tr><td align="left" colspan="3"></td></tr><tr><td align="left">Revision 0.10</td><td align="left">28 January 2005</td><td align="left"></td></tr><tr><td align="left" colspan="3"></td></tr><tr><td align="left">Revision 0.9</td><td align="left">7 Januar 2005</td><td align="left"></td></tr><tr><td align="left" colspan="3"></td></tr><tr><td align="left">Revision 0.8</td><td align="left">06 September 2003</td><td align="left"></td></tr><tr><td align="left" colspan="3">First released document.</td></tr></table></div></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="#introduction">Introduction</a></span></dt><dd><dl><dt><span class="sect2"><a href="#stability">Protocol and Specification Stability</a></span></dt></dl></dd><dt><span class="sect1"><a href="#message-protocol">Message Protocol</a></span></dt><dd><dl><dt><span class="sect2"><a href="#message-protocol-signatures">Type Signatures</a></span></dt><dt><span class="sect2"><a href="#message-protocol-marshaling">Marshaling (Wire Format)</a></span></dt><dt><span class="sect2"><a href="#message-protocol-messages">Message Format</a></span></dt><dt><span class="sect2"><a href="#message-protocol-names">Valid Names</a></span></dt><dt><span class="sect2"><a href="#message-protocol-types">Message Types</a></span></dt><dt><span class="sect2"><a href="#message-protocol-handling-invalid">Invalid Protocol and Spec Extensions</a></span></dt></dl></dd><dt><span class="sect1"><a href="#auth-protocol">Authentication Protocol</a></span></dt><dd><dl><dt><span class="sect2"><a href="#auth-protocol-overview">Protocol Overview</a></span></dt><dt><span class="sect2"><a href="#auth-nul-byte">Special credentials-passing nul byte</a></span></dt><dt><span class="sect2"><a href="#auth-command-auth">AUTH command</a></span></dt><dt><span class="sect2"><a href="#auth-command-cancel">CANCEL Command</a></span></dt><dt><span class="sect2"><a href="#auth-command-data">DATA Command</a></span></dt><dt><span class="sect2"><a href="#auth-command-begin">BEGIN Command</a></span></dt><dt><span class="sect2"><a href="#auth-command-rejected">REJECTED Command</a></span></dt><dt><span class="sect2"><a href="#auth-command-ok">OK Command</a></span></dt><dt><span class="sect2"><a href="#auth-command-error">ERROR Command</a></span></dt><dt><span class="sect2"><a href="#auth-command-negotiate-unix-fd">NEGOTIATE_UNIX_FD Command</a></span></dt><dt><span class="sect2"><a href="#auth-command-agree-unix-fd">AGREE_UNIX_FD Command</a></span></dt><dt><span class="sect2"><a href="#auth-command-future">Future Extensions</a></span></dt><dt><span class="sect2"><a href="#auth-examples">Authentication examples</a></span></dt><dt><span class="sect2"><a href="#auth-states">Authentication state diagrams</a></span></dt><dt><span class="sect2"><a href="#auth-mechanisms">Authentication mechanisms</a></span></dt></dl></dd><dt><span class="sect1"><a href="#addresses">Server Addresses</a></span></dt><dt><span class="sect1"><a href="#transports">Transports</a></span></dt><dd><dl><dt><span class="sect2"><a href="#transports-unix-domain-sockets">Unix Domain Sockets</a></span></dt><dt><span class="sect2"><a href="#transports-launchd">launchd</a></span></dt><dt><span class="sect2"><a href="#transports-tcp-sockets">TCP Sockets</a></span></dt><dt><span class="sect2"><a href="#transports-nonce-tcp-sockets">Nonce-secured TCP Sockets</a></span></dt></dl></dd><dt><span class="sect1"><a href="#meta-transports">Meta Transports</a></span></dt><dd><dl><dt><span class="sect2"><a href="#meta-transports-autolaunch">Autolaunch</a></span></dt></dl></dd><dt><span class="sect1"><a href="#naming-conventions">Naming Conventions</a></span></dt><dt><span class="sect1"><a href="#uuids">UUIDs</a></span></dt><dt><span class="sect1"><a href="#standard-interfaces">Standard Interfaces</a></span></dt><dd><dl><dt><span class="sect2"><a href="#standard-interfaces-peer"><code class="literal">org.freedesktop.DBus.Peer</code></a></span></dt><dt><span class="sect2"><a href="#standard-interfaces-introspectable"><code class="literal">org.freedesktop.DBus.Introspectable</code></a></span></dt><dt><span class="sect2"><a href="#standard-interfaces-properties"><code class="literal">org.freedesktop.DBus.Properties</code></a></span></dt></dl></dd><dt><span class="sect1"><a href="#introspection-format">Introspection Data Format</a></span></dt><dt><span class="sect1"><a href="#message-bus">Message Bus Specification</a></span></dt><dd><dl><dt><span class="sect2"><a href="#message-bus-overview">Message Bus Overview</a></span></dt><dt><span class="sect2"><a href="#message-bus-names">Message Bus Names</a></span></dt><dt><span class="sect2"><a href="#message-bus-routing">Message Bus Message Routing</a></span></dt><dt><span class="sect2"><a href="#message-bus-starting-services">Message Bus Starting Services</a></span></dt><dt><span class="sect2"><a href="#message-bus-types">Well-known Message Bus Instances</a></span></dt><dt><span class="sect2"><a href="#message-bus-messages">Message Bus Messages</a></span></dt></dl></dd><dt><span class="glossary"><a href="#id367478">Glossary</a></span></dt></dl></div><div class="sect1" title="Introduction"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="introduction"></a>Introduction</h2></div></div></div><p>
+</p></div></div></div></div></div><div><p class="releaseinfo">Version 0.15</p></div><div><div class="revhistory"><table border="1" width="100%" summary="Revision history"><tr><th align="left" valign="top" colspan="3"><b>Revision History</b></th></tr><tr><td align="left">Revision current</td><td align="left"><a class="ulink" href="http://cgit.freedesktop.org/dbus/dbus/log/doc/dbus-specification.xml" target="_top">commit log</a></td><td align="left"></td></tr><tr><td align="left" colspan="3"></td></tr><tr><td align="left">Revision 0.15</td><td align="left">3 November 2010</td><td align="left"></td></tr><tr><td align="left" colspan="3"></td></tr><tr><td align="left">Revision 0.14</td><td align="left">12 May 2010</td><td align="left"></td></tr><tr><td align="left" colspan="3"></td></tr><tr><td align="left">Revision 0.13</td><td align="left">23 Dezember 2009</td><td align="left"></td></tr><tr><td align="left" colspan="3"></td></tr><tr><td align="left">Revision 0.12</td><td align="left">7 November, 2006</td><td align="left"></td></tr><tr><td align="left" colspan="3"></td></tr><tr><td align="left">Revision 0.11</td><td align="left">6 February 2005</td><td align="left"></td></tr><tr><td align="left" colspan="3"></td></tr><tr><td align="left">Revision 0.10</td><td align="left">28 January 2005</td><td align="left"></td></tr><tr><td align="left" colspan="3"></td></tr><tr><td align="left">Revision 0.9</td><td align="left">7 Januar 2005</td><td align="left"></td></tr><tr><td align="left" colspan="3"></td></tr><tr><td align="left">Revision 0.8</td><td align="left">06 September 2003</td><td align="left"></td></tr><tr><td align="left" colspan="3">First released document.</td></tr></table></div></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="#introduction">Introduction</a></span></dt><dd><dl><dt><span class="sect2"><a href="#stability">Protocol and Specification Stability</a></span></dt></dl></dd><dt><span class="sect1"><a href="#message-protocol">Message Protocol</a></span></dt><dd><dl><dt><span class="sect2"><a href="#message-protocol-signatures">Type Signatures</a></span></dt><dt><span class="sect2"><a href="#message-protocol-marshaling">Marshaling (Wire Format)</a></span></dt><dt><span class="sect2"><a href="#message-protocol-messages">Message Format</a></span></dt><dt><span class="sect2"><a href="#message-protocol-names">Valid Names</a></span></dt><dt><span class="sect2"><a href="#message-protocol-types">Message Types</a></span></dt><dt><span class="sect2"><a href="#message-protocol-handling-invalid">Invalid Protocol and Spec Extensions</a></span></dt></dl></dd><dt><span class="sect1"><a href="#auth-protocol">Authentication Protocol</a></span></dt><dd><dl><dt><span class="sect2"><a href="#auth-protocol-overview">Protocol Overview</a></span></dt><dt><span class="sect2"><a href="#auth-nul-byte">Special credentials-passing nul byte</a></span></dt><dt><span class="sect2"><a href="#auth-command-auth">AUTH command</a></span></dt><dt><span class="sect2"><a href="#auth-command-cancel">CANCEL Command</a></span></dt><dt><span class="sect2"><a href="#auth-command-data">DATA Command</a></span></dt><dt><span class="sect2"><a href="#auth-command-begin">BEGIN Command</a></span></dt><dt><span class="sect2"><a href="#auth-command-rejected">REJECTED Command</a></span></dt><dt><span class="sect2"><a href="#auth-command-ok">OK Command</a></span></dt><dt><span class="sect2"><a href="#auth-command-error">ERROR Command</a></span></dt><dt><span class="sect2"><a href="#auth-command-negotiate-unix-fd">NEGOTIATE_UNIX_FD Command</a></span></dt><dt><span class="sect2"><a href="#auth-command-agree-unix-fd">AGREE_UNIX_FD Command</a></span></dt><dt><span class="sect2"><a href="#auth-command-future">Future Extensions</a></span></dt><dt><span class="sect2"><a href="#auth-examples">Authentication examples</a></span></dt><dt><span class="sect2"><a href="#auth-states">Authentication state diagrams</a></span></dt><dt><span class="sect2"><a href="#auth-mechanisms">Authentication mechanisms</a></span></dt></dl></dd><dt><span class="sect1"><a href="#addresses">Server Addresses</a></span></dt><dt><span class="sect1"><a href="#transports">Transports</a></span></dt><dd><dl><dt><span class="sect2"><a href="#transports-unix-domain-sockets">Unix Domain Sockets</a></span></dt><dt><span class="sect2"><a href="#transports-launchd">launchd</a></span></dt><dt><span class="sect2"><a href="#transports-tcp-sockets">TCP Sockets</a></span></dt><dt><span class="sect2"><a href="#transports-nonce-tcp-sockets">Nonce-secured TCP Sockets</a></span></dt></dl></dd><dt><span class="sect1"><a href="#meta-transports">Meta Transports</a></span></dt><dd><dl><dt><span class="sect2"><a href="#meta-transports-autolaunch">Autolaunch</a></span></dt></dl></dd><dt><span class="sect1"><a href="#naming-conventions">Naming Conventions</a></span></dt><dt><span class="sect1"><a href="#uuids">UUIDs</a></span></dt><dt><span class="sect1"><a href="#standard-interfaces">Standard Interfaces</a></span></dt><dd><dl><dt><span class="sect2"><a href="#standard-interfaces-peer"><code class="literal">org.freedesktop.DBus.Peer</code></a></span></dt><dt><span class="sect2"><a href="#standard-interfaces-introspectable"><code class="literal">org.freedesktop.DBus.Introspectable</code></a></span></dt><dt><span class="sect2"><a href="#standard-interfaces-properties"><code class="literal">org.freedesktop.DBus.Properties</code></a></span></dt></dl></dd><dt><span class="sect1"><a href="#introspection-format">Introspection Data Format</a></span></dt><dt><span class="sect1"><a href="#message-bus">Message Bus Specification</a></span></dt><dd><dl><dt><span class="sect2"><a href="#message-bus-overview">Message Bus Overview</a></span></dt><dt><span class="sect2"><a href="#message-bus-names">Message Bus Names</a></span></dt><dt><span class="sect2"><a href="#message-bus-routing">Message Bus Message Routing</a></span></dt><dt><span class="sect2"><a href="#message-bus-starting-services">Message Bus Starting Services</a></span></dt><dt><span class="sect2"><a href="#message-bus-types">Well-known Message Bus Instances</a></span></dt><dt><span class="sect2"><a href="#message-bus-messages">Message Bus Messages</a></span></dt></dl></dd><dt><span class="glossary"><a href="#id484449">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>
@@ -897,14 +897,14 @@
commands may be introduced both before, and after
authentication, i.e. both before and after the OK command.
</p></div><div class="sect2" title="Authentication examples"><div class="titlepage"><div><div><h3 class="title"><a name="auth-examples"></a>Authentication examples</h3></div></div></div><p>
- </p><div class="figure"><a name="id362126"></a><p class="title"><b>Figure1.Example of successful magic cookie authentication</b></p><div class="figure-contents"><pre class="programlisting">
+ </p><div class="figure"><a name="id479096"></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="id362141"></a><p class="title"><b>Figure2.Example of finding out mechanisms then picking one</b></p><div class="figure-contents"><pre class="programlisting">
+ </p><div class="figure"><a name="id479111"></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
@@ -913,14 +913,14 @@
S: OK 1234deadbeef
C: BEGIN
</pre></div></div><p><br class="figure-break">
- </p><div class="figure"><a name="id362157"></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">
+ </p><div class="figure"><a name="id479127"></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="id362173"></a><p class="title"><b>Figure4.Example of server doesn't support initial auth mechanism</b></p><div class="figure-contents"><pre class="programlisting">
+ </p><div class="figure"><a name="id479143"></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
@@ -929,7 +929,7 @@
S: OK 1234deadbeef
C: BEGIN
</pre></div></div><p><br class="figure-break">
- </p><div class="figure"><a name="id362190"></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">
+ </p><div class="figure"><a name="id479159"></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
@@ -942,7 +942,7 @@
S: OK 1234deadbeef
C: BEGIN
</pre></div></div><p><br class="figure-break">
- </p><div class="figure"><a name="id362208"></a><p class="title"><b>Figure6.Example of skey cancelled and restarted</b></p><div class="figure-contents"><pre class="programlisting">
+ </p><div class="figure"><a name="id479178"></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
@@ -955,7 +955,7 @@
S: OK 1234deadbeef
C: BEGIN
</pre></div></div><p><br class="figure-break">
- </p><div class="figure"><a name="id362225"></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">
+ </p><div class="figure"><a name="id479195"></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
@@ -964,7 +964,7 @@
S: AGREE_UNIX_FD
C: BEGIN
</pre></div></div><p><br class="figure-break">
- </p><div class="figure"><a name="id362242"></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">
+ </p><div class="figure"><a name="id479211"></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
@@ -1242,7 +1242,7 @@
fails, the lock fails. Servers should retry for a reasonable
period of time, then they may choose to delete an existing lock
to keep users from having to manually delete a stale
- lock. <sup>[<a name="id362953" href="#ftn.id362953" class="footnote">1</a>]</sup>
+ lock. <sup>[<a name="id479924" href="#ftn.id479924" 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
@@ -2003,7 +2003,7 @@
must be namespaced using the same mechanism as messages and service
names.
- </p><div class="figure"><a name="id365470"></a><p class="title"><b>Figure9.Example service description file</b></p><div class="figure-contents"><pre class="programlisting">
+ </p><div class="figure"><a name="id482440"></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;
@@ -2173,7 +2173,7 @@
allowing another process to set the selection between the
verification and the setting (e.g., by using XGrabServer /
XungrabServer).
- </p></div><div class="sect4"><div class="titlepage"><div><div><h5 class="title"><a name="id366057"></a></h5></div></div></div><p>
+ </p></div><div class="sect4"><div class="titlepage"><div><div><h5 class="title"><a name="id483027"></a></h5></div></div></div><p>
[FIXME specify location of .service files, probably using
DESKTOP_DIRS etc. from basedir specification, though login session
bus is not really desktop-specific]
@@ -2188,7 +2188,7 @@
variable. If that variable is not set, applications should try
to connect to the well-known address
<code class="literal">unix:path=/var/run/dbus/system_bus_socket</code>.
- <sup>[<a name="id366098" href="#ftn.id366098" class="footnote">2</a>]</sup>
+ <sup>[<a name="id483069" href="#ftn.id483069" class="footnote">2</a>]</sup>
</p><p>
[FIXME specify location of system bus .service files]
</p></div></div><div class="sect2" title="Message Bus Messages"><div class="titlepage"><div><div><h3 class="title"><a name="message-bus-messages"></a>Message Bus Messages</h3></div></div></div><p>
@@ -2373,7 +2373,7 @@
There is also a per-machine ID, described in <a class="xref" href="#standard-interfaces-peer" title="org.freedesktop.DBus.Peer">the section called &#8220;<code class="literal">org.freedesktop.DBus.Peer</code>&#8221;</a> and returned
by org.freedesktop.DBus.Peer.GetMachineId().
For a desktop session bus, the bus ID can be used as a way to uniquely identify a user's session.
- </p></div></div></div><div class="glossary" title="Glossary"><div class="titlepage"><div><div><h2 class="title"><a name="id367478"></a>Glossary</h2></div></div></div><p>
+ </p></div></div></div><div class="glossary" title="Glossary"><div class="titlepage"><div><div><h2 class="title"><a name="id484449"></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
@@ -2447,10 +2447,10 @@
message bus. This name will never change owner, and will be unique
(never reused during the lifetime of the message bus).
It will begin with a ':' character.
- </p></dd></dl></div><div class="footnotes"><br><hr width="100" align="left"><div class="footnote"><p><sup>[<a name="ftn.id362953" href="#id362953" class="para">1</a>] </sup>Lockfiles are used instead of real file
+ </p></dd></dl></div><div class="footnotes"><br><hr width="100" align="left"><div class="footnote"><p><sup>[<a name="ftn.id479924" href="#id479924" class="para">1</a>] </sup>Lockfiles are used instead of real file
locking <code class="literal">fcntl()</code> because real locking
implementations are still flaky on network
- filesystems.</p></div><div class="footnote"><p><sup>[<a name="ftn.id366098" href="#id366098" class="para">2</a>] </sup>
+ filesystems.</p></div><div class="footnote"><p><sup>[<a name="ftn.id483069" href="#id483069" class="para">2</a>] </sup>
The D-Bus reference implementation actually honors the
<code class="literal">$(localstatedir)</code> configure option
for this address, on both client and server side.
diff --git a/doc/dbus-test-plan.html b/doc/dbus-test-plan.html
index 88b17592..85211662 100644
--- a/doc/dbus-test-plan.html
+++ b/doc/dbus-test-plan.html
@@ -38,7 +38,7 @@
Message Builder. The message builder can take a serialized
message in string-form and convert it into a raw character
string which can then be loaded by the message loader.
- </p><div class="figure"><a name="id368459"></a><p class="title"><b>Figure1.Example of a message in string form</b></p><div class="figure-contents"><pre class="programlisting">
+ </p><div class="figure"><a name="id374339"></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
@@ -75,7 +75,7 @@
can read authentication sequences from a file and play them
back to a dummy server and client to make sure that
authentication is working according to the specification.
- </p><div class="figure"><a name="id365459"></a><p class="title"><b>Figure2.Example of an authentication script</b></p><div class="figure-contents"><pre class="programlisting">
+ </p><div class="figure"><a name="id374394"></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
diff --git a/install-sh b/install-sh
index 4d4a9519..6781b987 100755
--- a/install-sh
+++ b/install-sh
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2005-05-14.22
+scriptversion=2009-04-28.21; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -39,38 +39,68 @@ scriptversion=2005-05-14.22
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
-# from scratch. It can only install one file at a time, a restriction
-# shared with many OS's install programs.
+# from scratch.
+
+nl='
+'
+IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
+doit=${DOITPROG-}
+if test -z "$doit"; then
+ doit_exec=exec
+else
+ doit_exec=$doit
+fi
-# put in absolute paths if you don't have them in your path; or use env. vars.
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+ test "$posix_glob" != "?" || {
+ if (set -f) 2>/dev/null; then
+ posix_glob=
+ else
+ posix_glob=:
+ fi
+ }
+'
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
-chmodcmd="$chmodprog 0755"
-chowncmd=
chgrpcmd=
-stripcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
rmcmd="$rmprog -f"
-mvcmd="$mvprog"
+stripcmd=
+
src=
dst=
dir_arg=
-dstarg=
+dst_arg=
+
+copy_on_change=false
no_target_directory=
-usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
@@ -80,81 +110,86 @@ In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--c (ignored)
--d create directories instead of installing files.
--g GROUP $chgrpprog installed files to GROUP.
--m MODE $chmodprog installed files to MODE.
--o USER $chownprog installed files to USER.
--s $stripprog installed files.
--t DIRECTORY install into DIRECTORY.
--T report an error if DSTFILE is a directory.
---help display this help and exit.
---version display version info and exit.
+ --help display this help and exit.
+ --version display version info and exit.
+
+ -c (ignored)
+ -C install only if different (preserve the last data modification time)
+ -d create directories instead of installing files.
+ -g GROUP $chgrpprog installed files to GROUP.
+ -m MODE $chmodprog installed files to MODE.
+ -o USER $chownprog installed files to USER.
+ -s $stripprog installed files.
+ -t DIRECTORY install into DIRECTORY.
+ -T report an error if DSTFILE is a directory.
Environment variables override the default commands:
- CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+ RMPROG STRIPPROG
"
-while test -n "$1"; do
+while test $# -ne 0; do
case $1 in
- -c) shift
- continue;;
+ -c) ;;
+
+ -C) copy_on_change=true;;
- -d) dir_arg=true
- shift
- continue;;
+ -d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
- shift
- shift
- continue;;
+ shift;;
--help) echo "$usage"; exit $?;;
- -m) chmodcmd="$chmodprog $2"
- shift
- shift
- continue;;
+ -m) mode=$2
+ case $mode in
+ *' '* | *' '* | *'
+'* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
-o) chowncmd="$chownprog $2"
- shift
- shift
- continue;;
+ shift;;
- -s) stripcmd=$stripprog
- shift
- continue;;
+ -s) stripcmd=$stripprog;;
- -t) dstarg=$2
- shift
- shift
- continue;;
+ -t) dst_arg=$2
+ shift;;
- -T) no_target_directory=true
- shift
- continue;;
+ -T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
- *) # When -d is used, all remaining arguments are directories to create.
- # When -t is used, the destination is already specified.
- test -n "$dir_arg$dstarg" && break
- # Otherwise, the last argument is the destination. Remove it from $@.
- for arg
- do
- if test -n "$dstarg"; then
- # $@ is not empty: it contains at least $arg.
- set fnord "$@" "$dstarg"
- shift # fnord
- fi
- shift # arg
- dstarg=$arg
- done
+ --) shift
break;;
+
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
+
+ *) break;;
esac
+ shift
done
-if test -z "$1"; then
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+ # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dst_arg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dst_arg"
+ shift # fnord
+ fi
+ shift # arg
+ dst_arg=$arg
+ done
+fi
+
+if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
@@ -164,24 +199,47 @@ if test -z "$1"; then
exit 0
fi
+if test -z "$dir_arg"; then
+ trap '(exit $?); exit' 1 2 13 15
+
+ # Set umask so as not to create temps with too-generous modes.
+ # However, 'strip' requires both read and write access to temps.
+ case $mode in
+ # Optimize common cases.
+ *644) cp_umask=133;;
+ *755) cp_umask=22;;
+
+ *[0-7])
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw='% 200'
+ fi
+ cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+ *)
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw=,u+rw
+ fi
+ cp_umask=$mode$u_plus_rw;;
+ esac
+fi
+
for src
do
# Protect names starting with `-'.
case $src in
- -*) src=./$src ;;
+ -*) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
- src=
-
- if test -d "$dst"; then
- mkdircmd=:
- chmodcmd=
- else
- mkdircmd=$mkdirprog
- fi
+ dstdir=$dst
+ test -d "$dstdir"
+ dstdir_status=$?
else
+
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
@@ -190,71 +248,199 @@ do
exit 1
fi
- if test -z "$dstarg"; then
+ if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
- dst=$dstarg
+ dst=$dst_arg
# Protect names starting with `-'.
case $dst in
- -*) dst=./$dst ;;
+ -*) dst=./$dst;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
- echo "$0: $dstarg: Is a directory" >&2
+ echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
- dst=$dst/`basename "$src"`
+ dstdir=$dst
+ dst=$dstdir/`basename "$src"`
+ dstdir_status=0
+ else
+ # Prefer dirname, but fall back on a substitute if dirname fails.
+ dstdir=`
+ (dirname "$dst") 2>/dev/null ||
+ expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$dst" : 'X\(//\)[^/]' \| \
+ X"$dst" : 'X\(//\)$' \| \
+ X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+ echo X"$dst" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'
+ `
+
+ test -d "$dstdir"
+ dstdir_status=$?
fi
fi
- # This sed command emulates the dirname command.
- dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
+ obsolete_mkdir_used=false
+
+ if test $dstdir_status != 0; then
+ case $posix_mkdir in
+ '')
+ # Create intermediate dirs using mode 755 as modified by the umask.
+ # This is like FreeBSD 'install' as of 1997-10-28.
+ umask=`umask`
+ case $stripcmd.$umask in
+ # Optimize common cases.
+ *[2367][2367]) mkdir_umask=$umask;;
+ .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+ *[0-7])
+ mkdir_umask=`expr $umask + 22 \
+ - $umask % 100 % 40 + $umask % 20 \
+ - $umask % 10 % 4 + $umask % 2
+ `;;
+ *) mkdir_umask=$umask,go-w;;
+ esac
+
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
+ else
+ mkdir_mode=
+ fi
+
+ posix_mkdir=false
+ case $umask in
+ *[123567][0-7][0-7])
+ # POSIX mkdir -p sets u+wx bits regardless of umask, which
+ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+ ;;
+ *)
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+ if (umask $mkdir_umask &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+ then
+ 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.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ ls_ld_tmpdir=`ls -ld "$tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/d" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+ fi
+ trap '' 0;;
+ esac;;
+ esac
- # Make sure that the destination directory exists.
+ if
+ $posix_mkdir && (
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ )
+ then :
+ else
- # Skip lots of stat calls in the usual case.
- if test ! -d "$dstdir"; then
- defaultIFS='
- '
- IFS="${IFS-$defaultIFS}"
+ # The umask is ridiculous, or mkdir does not conform to POSIX,
+ # or it failed possibly due to a race condition. Create the
+ # directory the slow way, step by step, checking for races as we go.
- oIFS=$IFS
- # Some sh's can't handle IFS=/ for some reason.
- IFS='%'
- set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
- shift
- IFS=$oIFS
+ case $dstdir in
+ /*) prefix='/';;
+ -*) prefix='./';;
+ *) prefix='';;
+ esac
- pathcomp=
+ eval "$initialize_posix_glob"
- while test $# -ne 0 ; do
- pathcomp=$pathcomp$1
+ oIFS=$IFS
+ IFS=/
+ $posix_glob set -f
+ set fnord $dstdir
shift
- if test ! -d "$pathcomp"; then
- $mkdirprog "$pathcomp"
- # mkdir can fail with a `File exist' error in case several
- # install-sh are creating the directory concurrently. This
- # is OK.
- test -d "$pathcomp" || exit
+ $posix_glob set +f
+ IFS=$oIFS
+
+ prefixes=
+
+ for d
+ do
+ test -z "$d" && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask=$mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
+ done
+
+ if test -n "$prefixes"; then
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
fi
- pathcomp=$pathcomp/
- done
+ fi
fi
if test -n "$dir_arg"; then
- $doit $mkdircmd "$dst" \
- && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
- && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
- && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
- && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
-
+ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
- dstfile=`basename "$dst"`
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
@@ -262,10 +448,9 @@ do
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
- trap '(exit $?); exit' 1 2 13 15
# Copy the file name to the temp name.
- $doit $cpprog "$src" "$dsttmp" &&
+ (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
@@ -273,51 +458,63 @@ do
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
- { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
- && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
- && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
- && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
-
- # Now rename the file to the real destination.
- { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
- || {
- # The rename failed, perhaps because mv can't rename something else
- # to itself, or perhaps because mv is so ancient that it does not
- # support -f.
-
- # Now remove or move aside any old file at destination location.
- # We try this two ways since rm can't unlink itself on some
- # systems and the destination file might be busy for other
- # reasons. In this case, the final cleanup might fail but the new
- # file should still install successfully.
- {
- if test -f "$dstdir/$dstfile"; then
- $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
- || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
- || {
- echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
- (exit 1); exit 1
- }
- else
- :
- fi
- } &&
-
- # Now rename the file to the real destination.
- $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
- }
- }
- fi || { (exit 1); exit 1; }
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+ { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+ # If -C, don't bother to copy if it wouldn't change the file.
+ if $copy_on_change &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+ eval "$initialize_posix_glob" &&
+ $posix_glob set -f &&
+ set X $old && old=:$2:$4:$5:$6 &&
+ set X $new && new=:$2:$4:$5:$6 &&
+ $posix_glob set +f &&
+
+ test "$old" = "$new" &&
+ $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+ then
+ rm -f "$dsttmp"
+ else
+ # Rename the file to the real destination.
+ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+ {
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $doit $rmcmd -f "$dst" 2>/dev/null ||
+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+ { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+ } ||
+ { echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
+ }
+ fi || exit 1
+
+ trap '' 0
+ fi
done
-# The final little trick to "correctly" pass the exit status to the exit trap.
-{
- (exit 0); exit 0
-}
-
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
# End:
diff --git a/m4/as-ac-expand.m4 b/m4/as-ac-expand.m4
new file mode 100644
index 00000000..deebd2bf
--- /dev/null
+++ b/m4/as-ac-expand.m4
@@ -0,0 +1,49 @@
+dnl as-ac-expand.m4 0.2.0 -*- autoconf -*-
+dnl autostars m4 macro for expanding directories using configure's prefix
+
+dnl (C) 2003, 2004, 2005 Thomas Vander Stichele <thomas at apestaart dot org>
+
+dnl Copying and distribution of this file, with or without modification,
+dnl are permitted in any medium without royalty provided the copyright
+dnl notice and this notice are preserved.
+
+dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
+
+dnl example:
+dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
+dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
+
+AC_DEFUN([AS_AC_EXPAND],
+[
+ EXP_VAR=[$1]
+ FROM_VAR=[$2]
+
+ dnl first expand prefix and exec_prefix if necessary
+ prefix_save=$prefix
+ exec_prefix_save=$exec_prefix
+
+ dnl if no prefix given, then use /usr/local, the default prefix
+ if test "x$prefix" = "xNONE"; then
+ prefix="$ac_default_prefix"
+ fi
+ dnl if no exec_prefix given, then use prefix
+ if test "x$exec_prefix" = "xNONE"; then
+ exec_prefix=$prefix
+ fi
+
+ full_var="$FROM_VAR"
+ dnl loop until it doesn't change anymore
+ while true; do
+ new_full_var="`eval echo $full_var`"
+ if test "x$new_full_var" = "x$full_var"; then break; fi
+ full_var=$new_full_var
+ done
+
+ dnl clean up
+ full_var=$new_full_var
+ AC_SUBST([$1], "$full_var")
+
+ dnl restore prefix and exec_prefix
+ prefix=$prefix_save
+ exec_prefix=$exec_prefix_save
+])
diff --git a/m4/compiler.m4 b/m4/compiler.m4
new file mode 100644
index 00000000..5aff5d81
--- /dev/null
+++ b/m4/compiler.m4
@@ -0,0 +1,67 @@
+# compiler.m4 - autoconf macros for compiler settings
+#
+# Copyright © 2005 Scott James Remnant <scott@netsplit.com>.
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+# ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+# CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+# COMPILER_WARNINGS
+# ----------------------
+# Add configure option to enable additional compiler warnings and treat
+# them as errors.
+AC_DEFUN([COMPILER_WARNINGS],
+[AC_ARG_ENABLE(compiler-warnings,
+ AS_HELP_STRING([--enable-compiler-warnings],
+ [Enable additional compiler warnings]),
+[if test "x$enable_compiler_warnings" = "xyes"; then
+ if test "x$GCC" = "xyes"; then
+ CFLAGS="-Wall -Werror $CFLAGS"
+ fi
+ if test "x$GXX" = "xyes"; then
+ CXXFLAGS="-Wall -Werror $CXXFLAGS"
+ fi
+fi])dnl
+])# COMPILER_WARNINGS
+
+# COMPILER_OPTIMISATIONS
+# ---------------------------
+# Add configure option to disable optimisations.
+AC_DEFUN([COMPILER_OPTIMISATIONS],
+[AC_ARG_ENABLE(compiler-optimisations,
+ AS_HELP_STRING([--disable-compiler-optimisations],
+ [Disable compiler optimisations]),
+[if test "x$enable_compiler_optimisations" = "xno"; then
+ [CFLAGS=`echo "$CFLAGS" | sed -e "s/ -O[1-9]*\b/ -O0/g"`]
+fi])dnl
+])# COMPILER_OPTIMISATIONS
+
+# COMPILER_COVERAGE
+# ----------------------
+# Add configure option to enable coverage data.
+AC_DEFUN([COMPILER_COVERAGE],
+[AC_ARG_ENABLE(compiler-coverage,
+ AS_HELP_STRING([--enable-compiler-coverage],
+ [Enable generation of coverage data]),
+[if test "x$enable_compiler_coverage" = "xyes"; then
+ if test "x$GCC" = "xyes"; then
+ CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
+ fi
+fi])dnl
+])# COMPILER_COVERAGE
diff --git a/acinclude.m4 b/m4/pkg.m4
index b2889253..64be7479 100644
--- a/acinclude.m4
+++ b/m4/pkg.m4
@@ -153,81 +153,3 @@ else
ifelse([$3], , :, [$3])
fi[]dnl
])# PKG_CHECK_MODULES
-
-
-
-dnl a macro to check for ability to create python extensions
-dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
-dnl function also defines PYTHON_INCLUDES
-AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
-[AC_REQUIRE([AM_PATH_PYTHON])
-AC_MSG_CHECKING(for headers required to compile python extensions)
-dnl deduce PYTHON_INCLUDES
-py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
-py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
-PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
-if test "$py_prefix" != "$py_exec_prefix"; then
- PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
-fi
-AC_SUBST(PYTHON_INCLUDES)
-dnl check if the headers exist:
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
-AC_TRY_CPP([#include <Python.h>],dnl
-[AC_MSG_RESULT(found)
-$1],dnl
-[AC_MSG_RESULT(not found)
-$2])
-CPPFLAGS="$save_CPPFLAGS"
-])
-
-
-dnl as-ac-expand.m4 0.2.0 -*- autoconf -*-
-dnl autostars m4 macro for expanding directories using configure's prefix
-
-dnl (C) 2003, 2004, 2005 Thomas Vander Stichele <thomas at apestaart dot org>
-
-dnl Copying and distribution of this file, with or without modification,
-dnl are permitted in any medium without royalty provided the copyright
-dnl notice and this notice are preserved.
-
-dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
-
-dnl example:
-dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
-dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
-
-AC_DEFUN([AS_AC_EXPAND],
-[
- EXP_VAR=[$1]
- FROM_VAR=[$2]
-
- dnl first expand prefix and exec_prefix if necessary
- prefix_save=$prefix
- exec_prefix_save=$exec_prefix
-
- dnl if no prefix given, then use /usr/local, the default prefix
- if test "x$prefix" = "xNONE"; then
- prefix="$ac_default_prefix"
- fi
- dnl if no exec_prefix given, then use prefix
- if test "x$exec_prefix" = "xNONE"; then
- exec_prefix=$prefix
- fi
-
- full_var="$FROM_VAR"
- dnl loop until it doesn't change anymore
- while true; do
- new_full_var="`eval echo $full_var`"
- if test "x$new_full_var" = "x$full_var"; then break; fi
- full_var=$new_full_var
- done
-
- dnl clean up
- full_var=$new_full_var
- AC_SUBST([$1], "$full_var")
-
- dnl restore prefix and exec_prefix
- prefix=$prefix_save
- exec_prefix=$exec_prefix_save
-])
diff --git a/missing b/missing
index 894e786e..28055d2a 100755
--- a/missing
+++ b/missing
@@ -1,10 +1,10 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
-scriptversion=2005-06-08.21
+scriptversion=2009-04-28.21; # UTC
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
+# 2008, 2009 Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
@@ -18,9 +18,7 @@ scriptversion=2005-06-08.21
# 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.
+# 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
@@ -33,6 +31,8 @@ if test $# -eq 0; then
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.
@@ -44,7 +44,7 @@ fi
msg="missing on your system"
-case "$1" in
+case $1 in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
@@ -77,6 +77,7 @@ 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
@@ -86,6 +87,9 @@ Supported PROGRAM values:
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
+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 $?
;;
@@ -103,15 +107,22 @@ Send bug reports to <bug-automake@gnu.org>."
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).
-case "$1" in
- lex|yacc)
+# 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.
;;
- tar)
+ tar*)
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
@@ -135,7 +146,7 @@ esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
-case "$1" in
+case $program in
aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
@@ -145,7 +156,7 @@ WARNING: \`$1' is $msg. You should only need it if
touch aclocal.m4
;;
- autoconf)
+ autoconf*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`${configure_ac}'. You might want to install the
@@ -154,7 +165,7 @@ WARNING: \`$1' is $msg. You should only need it if
touch configure
;;
- autoheader)
+ autoheader*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
@@ -164,7 +175,7 @@ WARNING: \`$1' is $msg. You should only need it if
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
- case "$f" in
+ case $f in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
@@ -184,7 +195,7 @@ WARNING: \`$1' is $msg. You should only need it if
while read f; do touch "$f"; done
;;
- autom4te)
+ autom4te*)
echo 1>&2 "\
WARNING: \`$1' is needed, but is $msg.
You might have modified some files without having the
@@ -192,8 +203,8 @@ WARNING: \`$1' is needed, but is $msg.
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
- file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
- test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
@@ -207,80 +218,78 @@ WARNING: \`$1' is needed, but is $msg.
fi
;;
- bison|yacc)
+ 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 [ $# -ne 1 ]; then
+ if test $# -ne 1; then
eval LASTARG="\${$#}"
- case "$LASTARG" in
+ case $LASTARG in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
- if [ -f "$SRCFILE" ]; then
+ if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
- if [ -f "$SRCFILE" ]; then
+ if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
- if [ ! -f y.tab.h ]; then
+ if test ! -f y.tab.h; then
echo >y.tab.h
fi
- if [ ! -f y.tab.c ]; then
+ if test ! -f y.tab.c; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
- lex|flex)
+ 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 [ $# -ne 1 ]; then
+ if test $# -ne 1; then
eval LASTARG="\${$#}"
- case "$LASTARG" in
+ case $LASTARG in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
- if [ -f "$SRCFILE" ]; then
+ if test -f "$SRCFILE"; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
- if [ ! -f lex.yy.c ]; then
+ if test ! -f lex.yy.c; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
- help2man)
+ 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 's/.*-o \([^ ]*\).*/\1/p'`
- if test -z "$file"; then
- file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
- fi
- if [ -f "$file" ]; then
+ 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 1
+ exit $?
fi
;;
- makeinfo)
+ 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
@@ -289,11 +298,17 @@ WARNING: \`$1' is $msg. You should only need it if
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 's/.*-o \([^ ]*\).*/\1/p'`
+ 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`
+ 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
@@ -303,7 +318,7 @@ WARNING: \`$1' is $msg. You should only need it if
touch $file
;;
- tar)
+ tar*)
shift
# We have already tried tar in the generic part.
@@ -317,13 +332,13 @@ WARNING: \`$1' is $msg. You should only need it if
fi
firstarg="$1"
if shift; then
- case "$firstarg" in
+ case $firstarg in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
- case "$firstarg" in
+ case $firstarg in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
@@ -356,5 +371,6 @@ exit 0
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
# End:
diff --git a/test/Makefile.am b/test/Makefile.am
index 5fb86357..9d0681b7 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -23,13 +23,7 @@ TEST_BINARIES=
TESTS=
endif
-if DBUS_GCOV_ENABLED
-GCOV_BINARIES=decode-gcov
-else
-GCOV_BINARIES=
-endif
-
-noinst_PROGRAMS= $(TEST_BINARIES) $(GCOV_BINARIES)
+noinst_PROGRAMS= $(TEST_BINARIES)
test_service_SOURCES= \
test-service.c
@@ -58,9 +52,6 @@ test_segfault_SOURCES = \
test_sleep_forever_SOURCES = \
test-sleep-forever.c
-decode_gcov_SOURCES= \
- decode-gcov.c
-
# When any programs are not linked to libdbus-internal, fix this.
AM_CPPFLAGS=-DDBUS_STATIC_BUILD
TEST_LIBS=$(top_builddir)/dbus/libdbus-internal.la $(DBUS_TEST_LIBS)
@@ -77,8 +68,6 @@ shell_test_LDADD=libdbus-testutils.la $(TEST_LIBS)
shell_test_LDFLAGS=@R_DYNAMIC_LDFLAG@
spawn_test_LDADD=$(TEST_LIBS)
spawn_test_LDFLAGS=@R_DYNAMIC_LDFLAG@
-decode_gcov_LDADD=$(TEST_LIBS)
-decode_gcov_LDFLAGS=@R_DYNAMIC_LDFLAG@
EXTRA_DIST=
@@ -115,8 +104,17 @@ dist-hook:
done ; \
FILES=`(cd $(srcdir) && $(FIND_TESTS) -o -name "*.in" -a -not -name Makefile.in | grep -Ev "(.svn|CVS)" )` ; \
for F in $$FILES; do \
- echo '-- Disting file '$$F ; \
- cp -f $(srcdir)/$$F $(distdir)/$$F || exit 1 ; \
+ B=`basename $$F`; \
+ if test -e $$F.in; then \
+ echo "-- Skipping file $$F (.in version exists)"; \
+ elif test "x$$B" = xrun-with-tmp-session-bus.conf; then \
+ echo "-- Skipping file $$F (generated)"; \
+ elif test -e "$(top_srcdir)/bus/$$B"; then \
+ echo "-- Skipping file $$F (from /bus/)"; \
+ else \
+ echo '-- Disting file '$$F ; \
+ cp -f $(srcdir)/$$F $(distdir)/$$F || exit 1; \
+ fi; \
done
## copy tests to builddir so that generated tests and static tests
diff --git a/test/Makefile.in b/test/Makefile.in
index 21d5b61c..4cf7cafb 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -36,14 +36,15 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
@DBUS_BUILD_TESTS_TRUE@TESTS = shell-test$(EXEEXT)
-noinst_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2)
+noinst_PROGRAMS = $(am__EXEEXT_1)
subdir = test
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
+ $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+ $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -64,19 +65,12 @@ am__v_lt_0 = --silent
@DBUS_BUILD_TESTS_TRUE@ test-segfault$(EXEEXT) \
@DBUS_BUILD_TESTS_TRUE@ test-exit$(EXEEXT) \
@DBUS_BUILD_TESTS_TRUE@ test-sleep-forever$(EXEEXT)
-@DBUS_GCOV_ENABLED_TRUE@am__EXEEXT_2 = decode-gcov$(EXEEXT)
PROGRAMS = $(noinst_PROGRAMS)
-am_decode_gcov_OBJECTS = decode-gcov.$(OBJEXT)
-decode_gcov_OBJECTS = $(am_decode_gcov_OBJECTS)
+am_shell_test_OBJECTS = shell-test.$(OBJEXT)
+shell_test_OBJECTS = $(am_shell_test_OBJECTS)
am__DEPENDENCIES_1 =
am__DEPENDENCIES_2 = $(top_builddir)/dbus/libdbus-internal.la \
$(am__DEPENDENCIES_1)
-decode_gcov_DEPENDENCIES = $(am__DEPENDENCIES_2)
-decode_gcov_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(decode_gcov_LDFLAGS) $(LDFLAGS) -o $@
-am_shell_test_OBJECTS = shell-test.$(OBJEXT)
-shell_test_OBJECTS = $(am_shell_test_OBJECTS)
shell_test_DEPENDENCIES = libdbus-testutils.la $(am__DEPENDENCIES_2)
shell_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
@@ -142,16 +136,16 @@ am__v_CCLD_0 = @echo " CCLD " $@;
AM_V_GEN = $(am__v_GEN_$(V))
am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
am__v_GEN_0 = @echo " GEN " $@;
-SOURCES = $(libdbus_testutils_la_SOURCES) $(decode_gcov_SOURCES) \
- $(shell_test_SOURCES) $(spawn_test_SOURCES) \
- $(test_exit_SOURCES) $(test_names_SOURCES) \
- $(test_segfault_SOURCES) $(test_service_SOURCES) \
- $(test_shell_service_SOURCES) $(test_sleep_forever_SOURCES)
-DIST_SOURCES = $(libdbus_testutils_la_SOURCES) $(decode_gcov_SOURCES) \
- $(shell_test_SOURCES) $(spawn_test_SOURCES) \
- $(test_exit_SOURCES) $(test_names_SOURCES) \
- $(test_segfault_SOURCES) $(test_service_SOURCES) \
- $(test_shell_service_SOURCES) $(test_sleep_forever_SOURCES)
+SOURCES = $(libdbus_testutils_la_SOURCES) $(shell_test_SOURCES) \
+ $(spawn_test_SOURCES) $(test_exit_SOURCES) \
+ $(test_names_SOURCES) $(test_segfault_SOURCES) \
+ $(test_service_SOURCES) $(test_shell_service_SOURCES) \
+ $(test_sleep_forever_SOURCES)
+DIST_SOURCES = $(libdbus_testutils_la_SOURCES) $(shell_test_SOURCES) \
+ $(spawn_test_SOURCES) $(test_exit_SOURCES) \
+ $(test_names_SOURCES) $(test_segfault_SOURCES) \
+ $(test_service_SOURCES) $(test_shell_service_SOURCES) \
+ $(test_sleep_forever_SOURCES)
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
@@ -269,6 +263,8 @@ EXPANDED_PREFIX = @EXPANDED_PREFIX@
EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@
FGREP = @FGREP@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -403,8 +399,6 @@ libdbus_testutils_la_SOURCES = test-utils.h test-utils.c
noinst_LTLIBRARIES = libdbus-testutils.la
@DBUS_BUILD_TESTS_FALSE@TEST_BINARIES =
@DBUS_BUILD_TESTS_TRUE@TEST_BINARIES = test-service test-names test-shell-service shell-test spawn-test test-segfault test-exit test-sleep-forever
-@DBUS_GCOV_ENABLED_FALSE@GCOV_BINARIES =
-@DBUS_GCOV_ENABLED_TRUE@GCOV_BINARIES = decode-gcov
test_service_SOURCES = \
test-service.c
@@ -429,9 +423,6 @@ test_segfault_SOURCES = \
test_sleep_forever_SOURCES = \
test-sleep-forever.c
-decode_gcov_SOURCES = \
- decode-gcov.c
-
# When any programs are not linked to libdbus-internal, fix this.
AM_CPPFLAGS = -DDBUS_STATIC_BUILD
@@ -446,8 +437,6 @@ shell_test_LDADD = libdbus-testutils.la $(TEST_LIBS)
shell_test_LDFLAGS = @R_DYNAMIC_LDFLAG@
spawn_test_LDADD = $(TEST_LIBS)
spawn_test_LDFLAGS = @R_DYNAMIC_LDFLAG@
-decode_gcov_LDADD = $(TEST_LIBS)
-decode_gcov_LDFLAGS = @R_DYNAMIC_LDFLAG@
EXTRA_DIST =
TESTDIRS = \
data \
@@ -527,9 +516,6 @@ clean-noinstPROGRAMS:
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
-decode-gcov$(EXEEXT): $(decode_gcov_OBJECTS) $(decode_gcov_DEPENDENCIES)
- @rm -f decode-gcov$(EXEEXT)
- $(AM_V_CCLD)$(decode_gcov_LINK) $(decode_gcov_OBJECTS) $(decode_gcov_LDADD) $(LIBS)
shell-test$(EXEEXT): $(shell_test_OBJECTS) $(shell_test_DEPENDENCIES)
@rm -f shell-test$(EXEEXT)
$(AM_V_CCLD)$(shell_test_LINK) $(shell_test_OBJECTS) $(shell_test_LDADD) $(LIBS)
@@ -561,7 +547,6 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/decode-gcov.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shell-test.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawn-test.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-exit.Po@am__quote@
@@ -1018,8 +1003,17 @@ dist-hook:
done ; \
FILES=`(cd $(srcdir) && $(FIND_TESTS) -o -name "*.in" -a -not -name Makefile.in | grep -Ev "(.svn|CVS)" )` ; \
for F in $$FILES; do \
- echo '-- Disting file '$$F ; \
- cp -f $(srcdir)/$$F $(distdir)/$$F || exit 1 ; \
+ B=`basename $$F`; \
+ if test -e $$F.in; then \
+ echo "-- Skipping file $$F (.in version exists)"; \
+ elif test "x$$B" = xrun-with-tmp-session-bus.conf; then \
+ echo "-- Skipping file $$F (generated)"; \
+ elif test -e "$(top_srcdir)/bus/$$B"; then \
+ echo "-- Skipping file $$F (from /bus/)"; \
+ else \
+ echo '-- Disting file '$$F ; \
+ cp -f $(srcdir)/$$F $(distdir)/$$F || exit 1; \
+ fi; \
done
all-local:
diff --git a/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoExec.service b/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoExec.service
deleted file mode 100644
index 189214e6..00000000
--- a/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoExec.service
+++ /dev/null
@@ -1,4 +0,0 @@
-[D-BUS Service]
-Name=org.freedesktop.DBus.TestSuiteNoExec
-User=anyrandomuser
-
diff --git a/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoService.service b/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoService.service
deleted file mode 100644
index 2d1c9784..00000000
--- a/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoService.service
+++ /dev/null
@@ -1,4 +0,0 @@
-[D-BUS Service]
-Exec=/home/wjt/src/dbus/test/test-service
-User=anyrandomuser
-
diff --git a/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoUser.service b/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoUser.service
deleted file mode 100644
index 56d43abe..00000000
--- a/test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoUser.service
+++ /dev/null
@@ -1,4 +0,0 @@
-[D-BUS Service]
-Name=org.freedesktop.DBus.TestSuiteNoUser
-Exec=/home/wjt/src/dbus/test/test-service
-
diff --git a/test/data/valid-config-files-system/debug-allow-all-fail.conf b/test/data/valid-config-files-system/debug-allow-all-fail.conf
deleted file mode 100644
index d5f695ad..00000000
--- a/test/data/valid-config-files-system/debug-allow-all-fail.conf
+++ /dev/null
@@ -1,17 +0,0 @@
-<!-- Bus that listens on a debug pipe and doesn't create any restrictions -->
-
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
- <listen>debug-pipe:name=test-server</listen>
- <listen>unix:tmpdir=/tmp</listen>
- <type>system</type>
- <servicehelper>/home/wjt/src/dbus/bus/dbus-daemon-launch-helper-test</servicehelper>
- <servicedir>/home/wjt/src/dbus/test/data/invalid-service-files-system</servicedir>
- <policy context="default">
- <allow send_interface="*"/>
- <allow receive_interface="*"/>
- <allow own="*"/>
- <allow user="*"/>
- </policy>
-</busconfig>
diff --git a/test/data/valid-config-files-system/debug-allow-all-pass.conf b/test/data/valid-config-files-system/debug-allow-all-pass.conf
deleted file mode 100644
index dea3bacf..00000000
--- a/test/data/valid-config-files-system/debug-allow-all-pass.conf
+++ /dev/null
@@ -1,17 +0,0 @@
-<!-- Bus that listens on a debug pipe and doesn't create any restrictions -->
-
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
- <listen>debug-pipe:name=test-server</listen>
- <listen>unix:tmpdir=/tmp</listen>
- <type>system</type>
- <servicehelper>/home/wjt/src/dbus/bus/dbus-daemon-launch-helper-test</servicehelper>
- <servicedir>/home/wjt/src/dbus/test/data/valid-service-files-system</servicedir>
- <policy context="default">
- <allow send_interface="*"/>
- <allow receive_interface="*"/>
- <allow own="*"/>
- <allow user="*"/>
- </policy>
-</busconfig>
diff --git a/test/data/valid-config-files/debug-allow-all-sha1.conf b/test/data/valid-config-files/debug-allow-all-sha1.conf
deleted file mode 100644
index b69d7a6a..00000000
--- a/test/data/valid-config-files/debug-allow-all-sha1.conf
+++ /dev/null
@@ -1,16 +0,0 @@
-<!-- Bus that listens on a debug pipe and requires SHA1 auth, used to test SHA1 -->
-
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
- <listen>debug-pipe:name=test-server</listen>
- <listen>unix:tmpdir=/tmp</listen>
- <servicedir>/home/wjt/src/dbus/test/data/valid-service-files</servicedir>
- <auth>DBUS_COOKIE_SHA1</auth>
- <policy context="default">
- <allow send_interface="*"/>
- <allow receive_interface="*"/>
- <allow own="*"/>
- <allow user="*"/>
- </policy>
-</busconfig>
diff --git a/test/data/valid-config-files/debug-allow-all.conf b/test/data/valid-config-files/debug-allow-all.conf
deleted file mode 100644
index 897bbba8..00000000
--- a/test/data/valid-config-files/debug-allow-all.conf
+++ /dev/null
@@ -1,15 +0,0 @@
-<!-- Bus that listens on a debug pipe and doesn't create any restrictions -->
-
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
- <listen>debug-pipe:name=test-server</listen>
- <listen>unix:tmpdir=/tmp</listen>
- <servicedir>/home/wjt/src/dbus/test/data/valid-service-files</servicedir>
- <policy context="default">
- <allow send_interface="*"/>
- <allow receive_interface="*"/>
- <allow own="*"/>
- <allow user="*"/>
- </policy>
-</busconfig>
diff --git a/test/data/valid-config-files/session.conf b/test/data/valid-config-files/session.conf
deleted file mode 100644
index dde5ef6b..00000000
--- a/test/data/valid-config-files/session.conf
+++ /dev/null
@@ -1,63 +0,0 @@
-<!-- This configuration file controls the per-user-login-session message bus.
- Add a session-local.conf and edit that rather than changing this
- file directly. -->
-
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
- <!-- Our well-known bus type, don't change this -->
- <type>session</type>
-
- <!-- If we fork, keep the user's original umask to avoid affecting
- the behavior of child processes. -->
- <keep_umask/>
-
- <listen>unix:tmpdir=/tmp</listen>
-
- <standard_session_servicedirs />
-
- <policy context="default">
- <!-- Allow everything to be sent -->
- <allow send_destination="*" eavesdrop="true"/>
- <!-- Allow everything to be received -->
- <allow eavesdrop="true"/>
- <!-- Allow anyone to own anything -->
- <allow own="*"/>
- </policy>
-
- <!-- Config files are placed here that among other things,
- further restrict the above policy for specific services. -->
- <includedir>session.d</includedir>
-
- <!-- This is included last so local configuration can override what's
- in this standard file -->
- <include ignore_missing="yes">session-local.conf</include>
-
- <include if_selinux_enabled="yes" selinux_root_relative="yes">contexts/dbus_contexts</include>
-
- <!-- For the session bus, override the default relatively-low limits
- with essentially infinite limits, since the bus is just running
- as the user anyway, using up bus resources is not something we need
- to worry about. In some cases, we do set the limits lower than
- "all available memory" if exceeding the limit is almost certainly a bug,
- having the bus enforce a limit is nicer than a huge memory leak. But the
- intent is that these limits should never be hit. -->
-
- <!-- the memory limits are 1G instead of say 4G because they can't exceed 32-bit signed int max -->
- <limit name="max_incoming_bytes">1000000000</limit>
- <limit name="max_incoming_unix_fds">250000000</limit>
- <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>
- <limit name="service_start_timeout">120000</limit>
- <limit name="auth_timeout">240000</limit>
- <limit name="max_completed_connections">100000</limit>
- <limit name="max_incomplete_connections">10000</limit>
- <limit name="max_connections_per_user">100000</limit>
- <limit name="max_pending_service_starts">10000</limit>
- <limit name="max_names_per_connection">50000</limit>
- <limit name="max_match_rules_per_connection">50000</limit>
- <limit name="max_replies_per_connection">50000</limit>
-
-</busconfig>
diff --git a/test/data/valid-config-files/system.conf b/test/data/valid-config-files/system.conf
deleted file mode 100644
index 828fd032..00000000
--- a/test/data/valid-config-files/system.conf
+++ /dev/null
@@ -1,83 +0,0 @@
-<!-- This configuration file controls the systemwide message bus.
- Add a system-local.conf and edit that rather than changing this
- file directly. -->
-
-<!-- Note that there are any number of ways you can hose yourself
- security-wise by screwing up this file; in particular, you
- probably don't want to listen on any more addresses, add any more
- auth mechanisms, run as a different user, etc. -->
-
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
-
- <!-- Our well-known bus type, do not change this -->
- <type>system</type>
-
- <!-- Run as special user -->
- <user>messagebus</user>
-
- <!-- Fork into daemon mode -->
- <fork/>
-
- <!-- We use system service launching using a helper -->
- <standard_system_servicedirs/>
-
- <!-- This is a setuid helper that is used to launch system services -->
- <servicehelper>/usr/local/libexec/dbus-daemon-launch-helper</servicehelper>
-
- <!-- Write a pid file -->
- <pidfile>/usr/local/var/run/dbus/pid</pidfile>
-
- <!-- Enable logging to syslog -->
- <syslog/>
-
- <!-- Only allow socket-credentials-based authentication -->
- <auth>EXTERNAL</auth>
-
- <!-- Only listen on a local socket. (abstract=/path/to/socket
- means use abstract namespace, don't really create filesystem
- file; only Linux supports this. Use path=/whatever on other
- systems.) -->
- <listen>unix:path=/usr/local/var/run/dbus/system_bus_socket</listen>
-
- <policy context="default">
- <!-- All users can connect to system bus -->
- <allow user="*"/>
-
- <!-- Holes must be punched in service configuration files for
- name ownership and sending method calls -->
- <deny own="*"/>
- <deny send_type="method_call"/>
-
- <!-- Signals and reply messages (method returns, errors) are allowed
- by default -->
- <allow send_type="signal"/>
- <allow send_requested_reply="true" send_type="method_return"/>
- <allow send_requested_reply="true" send_type="error"/>
-
- <!-- All messages may be received by default -->
- <allow receive_type="method_call"/>
- <allow receive_type="method_return"/>
- <allow receive_type="error"/>
- <allow receive_type="signal"/>
-
- <!-- Allow anyone to talk to the message bus -->
- <allow send_destination="org.freedesktop.DBus"/>
- <!-- But disallow some specific bus services -->
- <deny send_destination="org.freedesktop.DBus"
- send_interface="org.freedesktop.DBus"
- send_member="UpdateActivationEnvironment"/>
- </policy>
-
- <!-- Config files are placed here that among other things, punch
- holes in the above policy for specific services. -->
- <includedir>system.d</includedir>
-
- <!-- This is included last so local configuration can override what's
- in this standard file -->
- <include ignore_missing="yes">system-local.conf</include>
-
- <include if_selinux_enabled="yes" selinux_root_relative="yes">contexts/dbus_contexts</include>
-
-</busconfig>
diff --git a/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteEchoService.service b/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteEchoService.service
deleted file mode 100644
index 7f7d7fab..00000000
--- a/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteEchoService.service
+++ /dev/null
@@ -1,5 +0,0 @@
-[D-BUS Service]
-Name=org.freedesktop.DBus.TestSuiteEchoService
-Exec=/home/wjt/src/dbus/test/test-service
-User=anyrandomuser
-
diff --git a/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteSegfaultService.service b/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteSegfaultService.service
deleted file mode 100644
index 64796a97..00000000
--- a/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteSegfaultService.service
+++ /dev/null
@@ -1,5 +0,0 @@
-[D-BUS Service]
-Name=org.freedesktop.DBus.TestSuiteSegfaultService
-Exec=/home/wjt/src/dbus/test/test-segfault
-User=anyrandomuser
-
diff --git a/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service b/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service
deleted file mode 100644
index 9d4281e0..00000000
--- a/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service
+++ /dev/null
@@ -1,5 +0,0 @@
-[D-BUS Service]
-Name=org.freedesktop.DBus.TestSuiteShellEchoServiceFail
-Exec=/home/wjt/src/dbus/test/test-shell-service "this should 'fail' because of an unterminated quote
-User=anyrandomuser
-
diff --git a/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service b/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service
deleted file mode 100644
index 355b234a..00000000
--- a/test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service
+++ /dev/null
@@ -1,5 +0,0 @@
-[D-BUS Service]
-Name=org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess
-Exec=/home/wjt/src/dbus/test/test-shell-service -test "that" 'we get' back --what "we put in"
-User=anyrandomuser
-
diff --git a/test/data/valid-service-files/org.freedesktop.DBus.TestSuite.PrivServer.service b/test/data/valid-service-files/org.freedesktop.DBus.TestSuite.PrivServer.service
deleted file mode 100644
index 3a9175bf..00000000
--- a/test/data/valid-service-files/org.freedesktop.DBus.TestSuite.PrivServer.service
+++ /dev/null
@@ -1,4 +0,0 @@
-[D-BUS Service]
-Name=org.freedesktop.DBus.TestSuite.PrivServer
-Exec=/home/wjt/src/dbus/test/name-test/test-privserver
-
diff --git a/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteEchoService.service b/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteEchoService.service
deleted file mode 100644
index 40c6121b..00000000
--- a/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteEchoService.service
+++ /dev/null
@@ -1,4 +0,0 @@
-[D-BUS Service]
-Name=org.freedesktop.DBus.TestSuiteEchoService
-Exec=/home/wjt/src/dbus/test/test-service
-
diff --git a/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteForkingEchoService.service b/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteForkingEchoService.service
deleted file mode 100644
index d8c5f012..00000000
--- a/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteForkingEchoService.service
+++ /dev/null
@@ -1,3 +0,0 @@
-[D-BUS Service]
-Name=org.freedesktop.DBus.TestSuiteForkingEchoService
-Exec=/home/wjt/src/dbus/test/test-service org.freedesktop.DBus.TestSuiteForkingEchoService fork
diff --git a/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteSegfaultService.service b/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteSegfaultService.service
deleted file mode 100644
index 8b6a6736..00000000
--- a/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteSegfaultService.service
+++ /dev/null
@@ -1,4 +0,0 @@
-[D-BUS Service]
-Name=org.freedesktop.DBus.TestSuiteSegfaultService
-Exec=/home/wjt/src/dbus/test/test-segfault
-
diff --git a/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service b/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service
deleted file mode 100644
index 5e76527c..00000000
--- a/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service
+++ /dev/null
@@ -1,4 +0,0 @@
-[D-BUS Service]
-Name=org.freedesktop.DBus.TestSuiteShellEchoServiceFail
-Exec=/home/wjt/src/dbus/test/test-shell-service "this should 'fail' because of an unterminated quote
-
diff --git a/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service b/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service
deleted file mode 100644
index 1b503e8d..00000000
--- a/test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service
+++ /dev/null
@@ -1,4 +0,0 @@
-[D-BUS Service]
-Name=org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess
-Exec=/home/wjt/src/dbus/test/test-shell-service -test "that" 'we get' back --what "we put in"
-
diff --git a/test/decode-gcov.c b/test/decode-gcov.c
deleted file mode 100644
index 3b2a1522..00000000
--- a/test/decode-gcov.c
+++ /dev/null
@@ -1,2653 +0,0 @@
- /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* decode-gcov.c gcov decoder program
- *
- * Copyright (C) 2003 Red Hat Inc.
- *
- * Partially derived from gcov,
- * Copyright (C) 1990, 1991, 1992, 1993, 1994, 1996, 1997, 1998,
- * 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
- *
- * This file is NOT licensed under the Academic Free License
- * as it is largely derived from gcov.c and gcov-io.h in the
- * gcc source code.
- *
- * 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 DBUS_COMPILATION /* cheat */
-#include <dbus/dbus-list.h>
-#include <dbus/dbus-string.h>
-#include <dbus/dbus-sysdeps.h>
-#include <dbus/dbus-marshal.h>
-#include <dbus/dbus-hash.h>
-#undef DBUS_COMPILATION
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifndef DBUS_HAVE_INT64
-#error "gcov support can't be built without 64-bit integer support"
-#endif
-
-static void
-die (const char *message)
-{
- fprintf (stderr, "%s", message);
- exit (1);
-}
-
-/* This bizarro function is from gcov-io.h in gcc source tree */
-static int
-fetch_long (long *dest,
- const char *source,
- size_t bytes)
-{
- long value = 0;
- int i;
-
- for (i = bytes - 1; (size_t) i > (sizeof (*dest) - 1); i--)
- if (source[i] & ((size_t) i == (bytes - 1) ? 127 : 255 ))
- return 1;
-
- for (; i >= 0; i--)
- value = value * 256 + (source[i] & ((size_t)i == (bytes - 1) ? 127 : 255));
-
- if ((source[bytes - 1] & 128) && (value > 0))
- value = - value;
-
- *dest = value;
- return 0;
-}
-
-static int
-fetch_long64 (dbus_int64_t *dest,
- const char *source,
- size_t bytes)
-{
- dbus_int64_t value = 0;
- int i;
-
- for (i = bytes - 1; (size_t) i > (sizeof (*dest) - 1); i--)
- if (source[i] & ((size_t) i == (bytes - 1) ? 127 : 255 ))
- return 1;
-
- for (; i >= 0; i--)
- value = value * 256 + (source[i] & ((size_t)i == (bytes - 1) ? 127 : 255));
-
- if ((source[bytes - 1] & 128) && (value > 0))
- value = - value;
-
- *dest = value;
- return 0;
-}
-
-#define BB_FILENAME (-1)
-#define BB_FUNCTION (-2)
-#define BB_ENDOFLIST 0
-
-static dbus_bool_t
-string_get_int (const DBusString *str,
- int start,
- long *val)
-{
- const char *p;
-
- if ((_dbus_string_get_length (str) - start) < 4)
- return FALSE;
-
- p = _dbus_string_get_const_data (str);
-
- p += start;
-
- fetch_long (val, p, 4);
-
- return TRUE;
-}
-
-static dbus_bool_t
-string_get_int64 (const DBusString *str,
- int start,
- dbus_int64_t *val)
-{
- const char *p;
-
- if ((_dbus_string_get_length (str) - start) < 8)
- return FALSE;
-
- p = _dbus_string_get_const_data (str);
-
- p += start;
-
- fetch_long64 (val, p, 8);
-
- return TRUE;
-}
-
-static dbus_bool_t
-string_get_string (const DBusString *str,
- int start,
- long terminator,
- DBusString *val,
- int *end)
-{
- int i;
- long n;
-
- i = start;
- while (string_get_int (str, i, &n))
- {
- unsigned char b;
-
- i += 4;
-
- if (n == terminator)
- break;
-
- b = n & 0xff;
- if (b)
- {
- _dbus_string_append_byte (val, b);
- b = (n >> 8) & 0xff;
- if (b)
- {
- _dbus_string_append_byte (val, b);
- b = (n >> 16) & 0xff;
- if (b)
- {
- _dbus_string_append_byte (val, b);
- b = (n >> 24) & 0xff;
- if (b)
- _dbus_string_append_byte (val, b);
- }
- }
- }
- }
-
- *end = i;
-
- return TRUE;
-}
-
-#ifdef DBUS_HAVE_GCC33_GCOV
-/* In gcc33 .bbg files, there's a function name of the form:
- * -1, length, name (padded to 4), -1, checksum
- */
-static dbus_bool_t
-string_get_function (const DBusString *str,
- int start,
- DBusString *funcname,
- int *checksum,
- int *next)
-{
- int end;
- long val;
- int i;
-
- i = start;
-
- if (!string_get_int (str, i, &val))
- die ("no room for -1 before function name\n");
-
- i += 4;
-
- if (val != -1)
- die ("value before function name is not -1\n");
-
- if (!string_get_int (str, i, &val))
- die ("no length found for function name\n");
-
- i += 4;
-
- end = i + val;
- if (end > _dbus_string_get_length (str))
- die ("Function name length points past end of file\n");
-
- if (!_dbus_string_append (funcname,
- _dbus_string_get_const_data (str) + i))
- die ("no memory\n");
-
- /* skip alignment padding the length doesn't include the nul so add 1
- */
- i = _DBUS_ALIGN_VALUE (end + 1, 4);
-
- if (!string_get_int (str, i, &val) ||
- val != -1)
- die ("-1 at end of function name not found\n");
-
- i += 4;
-
- if (!string_get_int (str, i, &val))
- die ("no checksum found at end of function name\n");
-
- i += 4;
-
- *checksum = val;
-
- *next = i;
-
- return TRUE;
-}
-#endif /* DBUS_HAVE_GCC33_GCOV */
-
-static void
-dump_bb_file (const DBusString *contents)
-{
- int i;
- long val;
- int n_functions;
-
- n_functions = 0;
- i = 0;
- while (string_get_int (contents, i, &val))
- {
- i += 4;
-
- switch (val)
- {
- case BB_FILENAME:
- {
- DBusString f;
-
- if (!_dbus_string_init (&f))
- die ("no memory\n");
-
- if (string_get_string (contents, i,
- BB_FILENAME,
- &f, &i))
- {
- printf ("File %s\n", _dbus_string_get_const_data (&f));
- }
- _dbus_string_free (&f);
- }
- break;
- case BB_FUNCTION:
- {
- DBusString f;
- if (!_dbus_string_init (&f))
- die ("no memory\n");
-
- if (string_get_string (contents, i,
- BB_FUNCTION,
- &f, &i))
- {
- printf ("Function %s\n", _dbus_string_get_const_data (&f));
- }
- _dbus_string_free (&f);
-
- n_functions += 1;
- }
- break;
- case BB_ENDOFLIST:
- printf ("End of block\n");
- break;
- default:
- printf ("Line %ld\n", val);
- break;
- }
- }
-
- printf ("%d functions in file\n", n_functions);
-}
-
-#define FLAG_ON_TREE 0x1
-#define FLAG_FAKE 0x2
-#define FLAG_FALL_THROUGH 0x4
-
-static void
-dump_bbg_file (const DBusString *contents)
-{
- int i;
- long val;
- int n_functions;
- int n_arcs;
- int n_blocks;
- int n_arcs_off_tree;
-
- n_arcs_off_tree = 0;
- n_blocks = 0;
- n_arcs = 0;
- n_functions = 0;
- i = 0;
- while (i < _dbus_string_get_length (contents))
- {
- long n_blocks_in_func;
- long n_arcs_in_func;
- int j;
-
-#ifdef DBUS_HAVE_GCC33_GCOV
- /* In gcc33 .bbg files, there's a function name of the form:
- * -1, length, name (padded to 4), -1, checksum
- * after that header on each function description, it's
- * the same as in gcc32
- */
-
- {
- DBusString funcname;
- int checksum;
-
- if (!_dbus_string_init (&funcname))
- die ("no memory\n");
-
- if (!string_get_function (contents, i,
- &funcname, &checksum, &i))
- die ("could not read function name\n");
-
- printf ("Function name is \"%s\" checksum %d\n",
- _dbus_string_get_const_data (&funcname),
- checksum);
-
- _dbus_string_free (&funcname);
- }
-#endif /* DBUS_HAVE_GCC33_GCOV */
-
- if (!string_get_int (contents, i, &val))
- die ("no count of blocks in func found\n");
-
- i += 4;
-
- n_blocks_in_func = val;
-
- if (!string_get_int (contents, i, &n_arcs_in_func))
- break;
-
- i += 4;
-
- printf ("Function has %ld blocks and %ld arcs\n",
- n_blocks_in_func, n_arcs_in_func);
-
- n_functions += 1;
- n_blocks += n_blocks_in_func;
- n_arcs += n_arcs_in_func;
-
- j = 0;
- while (j < n_blocks_in_func)
- {
- long n_arcs_in_block;
- int k;
-
- if (!string_get_int (contents, i, &n_arcs_in_block))
- break;
-
- i += 4;
-
- printf (" Block has %ld arcs\n", n_arcs_in_block);
-
- k = 0;
- while (k < n_arcs_in_block)
- {
- long destination_block;
- long flags;
-
- if (!string_get_int (contents, i, &destination_block))
- break;
-
- i += 4;
-
- if (!string_get_int (contents, i, &flags))
- break;
-
- i += 4;
-
- printf (" Arc has destination block %ld flags 0x%lx\n",
- destination_block, flags);
-
- if ((flags & FLAG_ON_TREE) == 0)
- n_arcs_off_tree += 1;
-
- ++k;
- }
-
- if (k < n_arcs_in_block)
- break;
-
- ++j;
- }
-
- if (j < n_blocks_in_func)
- break;
-
- if (!string_get_int (contents, i, &val))
- break;
-
- i += 4;
-
- if (val != -1)
- die ("-1 separator not found\n");
- }
-
- printf ("%d functions %d blocks %d arcs %d off-tree arcs in file\n",
- n_functions, n_blocks, n_arcs, n_arcs_off_tree);
-}
-
-#ifndef DBUS_HAVE_GCC33_GCOV
-
-/* gcc 3.2 version:
- * The da file contains first a count of arcs in the file,
- * then a count of executions for all "off tree" arcs
- * in the file.
- */
-static void
-dump_da_file (const DBusString *contents)
-{
- int i;
- dbus_int64_t val;
- int n_arcs;
- int claimed_n_arcs;
-
- i = 0;
- if (!string_get_int64 (contents, i, &val))
- return;
-
- i += 8;
-
- printf ("%ld arcs in file\n", (long) val);
- claimed_n_arcs = val;
-
- n_arcs = 0;
- while (string_get_int64 (contents, i, &val))
- {
- i += 8;
-
- printf ("%ld executions of arc %d\n",
- (long) val, n_arcs);
-
- ++n_arcs;
- }
-
- if (n_arcs != claimed_n_arcs)
- {
- printf ("File claimed to have %d arcs but only had %d\n",
- claimed_n_arcs, n_arcs);
- }
-}
-
-#else /* DBUS_HAVE_GCC33_GCOV */
-
-/* gcc 3.3 version:
- * The da file is more complex than 3.2.
- *
- * We have a magic value of "-123" only it isn't really
- * -123, it's -123 as encoded by the crackass gcov-io.h
- * routines. Anyway, 4 bytes.
- *
- * We then have:
- *
- * - 4 byte count of how many functions in the following list
- * - 4 byte length of random extra data
- * - the random extra data, just skip it, info pages have some
- * details on what might be in there or see __bb_exit_func in gcc
- * - then for each function (number of functions given above):
- * . -1, length, funcname, alignment padding, -1
- * . checksum
- * . 4 byte number of arcs in function
- * . 8 bytes each, a count of execution for each arc
- *
- * Now, the whole thing *starting with the magic* can repeat.
- * This is caused by multiple runs of the profiled app appending
- * to the file.
- */
-static void
-dump_da_file (const DBusString *contents)
-{
- int i;
- dbus_int64_t v64;
- long val;
- int n_sections;
- int total_functions;
-
- total_functions = 0;
- n_sections = 0;
-
- i = 0;
- while (i < _dbus_string_get_length (contents))
- {
- int claimed_n_functions;
- int n_functions;
- int total_arcs;
-
- printf (".da file section %d\n", n_sections);
-
- if (!string_get_int (contents, i, &val))
- die ("no magic found in .da file\n");
-
- i += 4;
-
- if (val != -123)
- die ("wrong file magic in .da file\n");
-
- if (!string_get_int (contents, i, &val))
- die ("no function count in .da file\n");
- i += 4;
- claimed_n_functions = val;
-
- printf ("%d functions expected in section %d of .da file\n",
- claimed_n_functions, n_sections);
-
- if (!string_get_int (contents, i, &val))
- die ("no extra data length in .da file\n");
-
- i += 4;
-
- i += val;
-
- total_arcs = 0;
- n_functions = 0;
- while (n_functions < claimed_n_functions)
- {
- DBusString funcname;
- int checksum;
- int claimed_n_arcs;
- int n_arcs;
-
- if (!_dbus_string_init (&funcname))
- die ("no memory\n");
-
- if (!string_get_function (contents, i,
- &funcname, &checksum, &i))
- die ("could not read function name\n");
-
- if (!string_get_int (contents, i, &val))
- die ("no arc count for function\n");
-
- i += 4;
- claimed_n_arcs = val;
-
- printf (" %d arcs in function %d %s checksum %d\n",
- claimed_n_arcs, n_functions,
- _dbus_string_get_const_data (&funcname),
- checksum);
-
- n_arcs = 0;
- while (n_arcs < claimed_n_arcs)
- {
- if (!string_get_int64 (contents, i, &v64))
- die ("did not get execution count for arc\n");
-
- i += 8;
-
- printf (" %ld executions of arc %d (total arcs %d)\n",
- (long) v64, n_arcs, total_arcs + n_arcs);
-
- ++n_arcs;
- }
-
- _dbus_string_free (&funcname);
-
- total_arcs += n_arcs;
- ++n_functions;
- }
-
- printf ("total of %d functions and %d arcs in section %d\n",
- n_functions, total_arcs, n_sections);
-
- total_functions += n_functions;
- ++n_sections;
- }
-
- printf ("%d total function sections in %d total .da file sections\n",
- total_functions, n_sections);
-}
-
-#endif /* DBUS_HAVE_GCC33_GCOV */
-
-typedef struct Arc Arc;
-typedef struct Block Block;
-typedef struct Function Function;
-typedef struct File File;
-typedef struct Line Line;
-
-struct Arc
-{
- int source;
- int target;
- dbus_int64_t arc_count;
- unsigned int count_valid : 1;
- unsigned int on_tree : 1;
- unsigned int fake : 1;
- unsigned int fall_through : 1;
- Arc *pred_next;
- Arc *succ_next;
-};
-
-struct Block
-{
- Arc *succ;
- Arc *pred;
- dbus_int64_t succ_count;
- dbus_int64_t pred_count;
- dbus_int64_t exec_count;
- DBusList *lines;
- unsigned int count_valid : 1;
- unsigned int on_tree : 1;
- unsigned int inside_dbus_build_tests : 1;
-};
-
-struct Function
-{
- char *name;
- int checksum;
- Block *block_graph;
- int n_blocks;
- /* number of blocks in DBUS_BUILD_TESTS */
- int n_test_blocks;
- int n_test_blocks_executed;
- /* number of blocks outside DBUS_BUILD_TESTS */
- int n_nontest_blocks;
- int n_nontest_blocks_executed;
- /* Summary result flags */
- unsigned int unused : 1;
- unsigned int inside_dbus_build_tests : 1;
- unsigned int partial : 1; /* only some of the blocks were executed */
-};
-
-struct Line
-{
- int number;
- char *text;
- DBusList *blocks;
- unsigned int inside_dbus_build_tests : 1;
- unsigned int partial : 1; /* only some of the blocks were executed */
-};
-
-struct File
-{
- char *name;
- Line *lines;
- int n_lines;
- DBusList *functions;
-};
-
-static void
-function_add_arc (Function *function,
- long source,
- long target,
- long flags)
-{
- Arc *arc;
-
- arc = dbus_new0 (Arc, 1);
- if (arc == NULL)
- die ("no memory\n");
-
- arc->target = target;
- arc->source = source;
-
- arc->succ_next = function->block_graph[source].succ;
- function->block_graph[source].succ = arc;
- function->block_graph[source].succ_count += 1;
-
- arc->pred_next = function->block_graph[target].pred;
- function->block_graph[target].pred = arc;
- function->block_graph[target].pred_count += 1;
-
- if ((flags & FLAG_ON_TREE) != 0)
- arc->on_tree = TRUE;
-
- if ((flags & FLAG_FAKE) != 0)
- arc->fake = TRUE;
-
- if ((flags & FLAG_FALL_THROUGH) != 0)
- arc->fall_through = TRUE;
-}
-
-
-static Arc*
-reverse_arcs (Arc *arc)
-{
- struct Arc *prev = 0;
- struct Arc *next;
-
- for ( ; arc; arc = next)
- {
- next = arc->succ_next;
- arc->succ_next = prev;
- prev = arc;
- }
-
- return prev;
-}
-
-static void
-function_reverse_succ_arcs (Function *func)
-{
- /* Must reverse the order of all succ arcs, to ensure that they match
- * the order of the data in the .da file.
- */
- int i;
-
- for (i = 0; i < func->n_blocks; i++)
- if (func->block_graph[i].succ)
- func->block_graph[i].succ = reverse_arcs (func->block_graph[i].succ);
-}
-
-static void
-get_functions_from_bbg (const DBusString *contents,
- DBusList **functions)
-{
- int i;
- long val;
- int n_functions;
- int n_arcs;
- int n_blocks;
- int n_arcs_off_tree;
-
-#if 0
- printf ("Loading arcs and blocks from .bbg file\n");
-#endif
-
- n_arcs_off_tree = 0;
- n_blocks = 0;
- n_arcs = 0;
- n_functions = 0;
- i = 0;
- while (i < _dbus_string_get_length (contents))
- {
- Function *func;
- long n_blocks_in_func;
- long n_arcs_in_func;
- int j;
-
-#ifdef DBUS_HAVE_GCC33_GCOV
- DBusString funcname;
- int checksum;
-
- /* In gcc33 .bbg files, there's a function name of the form:
- * -1, length, name (padded to 4), -1, checksum
- * after that header on each function description, it's
- * the same as in gcc32
- */
- if (!_dbus_string_init (&funcname))
- die ("no memory\n");
-
- if (!string_get_function (contents, i,
- &funcname, &checksum, &i))
- die ("could not read function name\n");
-#endif /* DBUS_HAVE_GCC33_GCOV */
-
- if (!string_get_int (contents, i, &val))
- break;
-
- n_blocks_in_func = val;
-
- i += 4;
-
- if (!string_get_int (contents, i, &n_arcs_in_func))
- break;
-
- i += 4;
-
- n_functions += 1;
- n_blocks += n_blocks_in_func;
- n_arcs += n_arcs_in_func;
-
- func = dbus_new0 (Function, 1);
- if (func == NULL)
- die ("no memory\n");
-
-#ifdef DBUS_HAVE_GCC33_GCOV
- func->name = _dbus_strdup (_dbus_string_get_const_data (&funcname));
- func->checksum = checksum;
- _dbus_string_free (&funcname);
-#endif
-
- func->block_graph = dbus_new0 (Block, n_blocks_in_func);
- func->n_blocks = n_blocks_in_func;
-
- j = 0;
- while (j < n_blocks_in_func)
- {
- long n_arcs_in_block;
- int k;
-
- if (!string_get_int (contents, i, &n_arcs_in_block))
- break;
-
- i += 4;
-
- k = 0;
- while (k < n_arcs_in_block)
- {
- long destination_block;
- long flags;
-
- if (!string_get_int (contents, i, &destination_block))
- break;
-
- i += 4;
-
- if (!string_get_int (contents, i, &flags))
- break;
-
- i += 4;
-
- if ((flags & FLAG_ON_TREE) == 0)
- n_arcs_off_tree += 1;
-
- function_add_arc (func, j, destination_block,
- flags);
-
- ++k;
- }
-
- if (k < n_arcs_in_block)
- break;
-
- ++j;
- }
-
- if (j < n_blocks_in_func)
- break;
-
- function_reverse_succ_arcs (func);
-
- if (!_dbus_list_append (functions, func))
- die ("no memory\n");
-
- if (!string_get_int (contents, i, &val))
- break;
-
- i += 4;
-
- if (val != -1)
- die ("-1 separator not found in .bbg file\n");
- }
-
-#if 0
- printf ("%d functions %d blocks %d arcs %d off-tree arcs in file\n",
- n_functions, n_blocks, n_arcs, n_arcs_off_tree);
-#endif
-
- _dbus_assert (n_functions == _dbus_list_get_length (functions));
-}
-
-#ifdef DBUS_HAVE_GCC33_GCOV
-static void
-add_counts_from_da (const DBusString *contents,
- DBusList **functions)
-{
- int i;
- dbus_int64_t v64;
- long val;
- int n_sections;
- DBusList *link;
- Function *current_func;
- int current_block;
- Arc *current_arc;
-
- n_sections = 0;
-
- i = 0;
- while (i < _dbus_string_get_length (contents))
- {
- int claimed_n_functions;
- int n_functions;
-
- if (!string_get_int (contents, i, &val))
- die ("no magic found in .da file\n");
-
- i += 4;
-
- if (val != -123)
- die ("wrong file magic in .da file\n");
-
- if (!string_get_int (contents, i, &val))
- die ("no function count in .da file\n");
- i += 4;
- claimed_n_functions = val;
-
- if (!string_get_int (contents, i, &val))
- die ("no extra data length in .da file\n");
-
- i += 4;
-
- i += val;
-
- link = _dbus_list_get_first_link (functions);
- if (link == NULL)
- goto no_more_functions;
-
- n_functions = 0;
- while (n_functions < claimed_n_functions && link != NULL)
- {
- DBusString funcname;
- int checksum;
- int claimed_n_arcs;
- int n_arcs;
-
- current_func = link->data;
- current_block = 0;
- current_arc = current_func->block_graph[current_block].succ;
-
- if (!_dbus_string_init (&funcname))
- die ("no memory\n");
-
- if (!string_get_function (contents, i,
- &funcname, &checksum, &i))
- die ("could not read function name\n");
-
- if (!_dbus_string_equal_c_str (&funcname, current_func->name))
- {
- fprintf (stderr, "Expecting .da info for %s but got %s\n",
- current_func->name,
- _dbus_string_get_const_data (&funcname));
- exit (1);
- }
-
- if (checksum != current_func->checksum)
- die (".da file checksum doesn't match checksum from .bbg file\n");
-
- if (!string_get_int (contents, i, &val))
- die ("no arc count for function\n");
-
- i += 4;
- claimed_n_arcs = val;
-
- /* For each arc in the profile, find the corresponding
- * arc in the function and increment its count
- */
- n_arcs = 0;
- while (n_arcs < claimed_n_arcs)
- {
- if (!string_get_int64 (contents, i, &v64))
- die ("did not get execution count for arc\n");
-
- i += 8;
-
- /* Find the next arc in the function that isn't on tree */
- while (current_arc == NULL ||
- current_arc->on_tree)
- {
- if (current_arc == NULL)
- {
- ++current_block;
-
- if (current_block >= current_func->n_blocks)
- die ("too many blocks in function\n");
-
- current_arc = current_func->block_graph[current_block].succ;
- }
- else
- {
- current_arc = current_arc->succ_next;
- }
- }
-
- _dbus_assert (current_arc != NULL);
- _dbus_assert (!current_arc->on_tree);
-
- current_arc->arc_count = v64;
- current_arc->count_valid = TRUE;
- current_func->block_graph[current_block].succ_count -= 1;
- current_func->block_graph[current_arc->target].pred_count -= 1;
-
- ++n_arcs;
-
- current_arc = current_arc->succ_next;
- }
-
- _dbus_string_free (&funcname);
-
- link = _dbus_list_get_next_link (functions, link);
- ++n_functions;
-
- if (link == NULL && n_functions < claimed_n_functions)
- {
- fprintf (stderr, "Ran out of functions loading .da file\n");
- goto no_more_functions;
- }
- }
-
- no_more_functions:
-
- ++n_sections;
- }
-}
-#else /* DBUS_HAVE_GCC33_GCOV */
-static void
-add_counts_from_da (const DBusString *contents,
- DBusList **functions)
-{
- int i;
- dbus_int64_t val;
- int n_arcs;
- int claimed_n_arcs;
- DBusList *link;
- Function *current_func;
- int current_block;
- Arc *current_arc;
-
-#if 0
- printf ("Loading execution count for each arc from .da file\n");
-#endif
-
- i = 0;
- if (!string_get_int64 (contents, i, &val))
- return;
-
- i += 8;
-
- claimed_n_arcs = val;
-
- link = _dbus_list_get_first_link (functions);
- if (link == NULL)
- goto done;
-
- current_func = link->data;
- current_block = 0;
- current_arc = current_func->block_graph[current_block].succ;
-
- n_arcs = 0;
- while (string_get_int64 (contents, i, &val))
- {
- i += 8;
-
- while (current_arc == NULL ||
- current_arc->on_tree)
- {
- if (current_arc == NULL)
- {
- ++current_block;
-
- if (current_block == current_func->n_blocks)
- {
- link = _dbus_list_get_next_link (functions, link);
- if (link == NULL)
- {
- fprintf (stderr, "Ran out of functions loading .da file\n");
- goto done;
- }
- current_func = link->data;
- current_block = 0;
- }
-
- current_arc = current_func->block_graph[current_block].succ;
- }
- else
- {
- current_arc = current_arc->succ_next;
- }
- }
-
- _dbus_assert (current_arc != NULL);
- _dbus_assert (!current_arc->on_tree);
-
- current_arc->arc_count = val;
- current_arc->count_valid = TRUE;
- current_func->block_graph[current_block].succ_count -= 1;
- current_func->block_graph[current_arc->target].pred_count -= 1;
-
- ++n_arcs;
-
- current_arc = current_arc->succ_next;
- }
-
- done:
-
- if (n_arcs != claimed_n_arcs)
- {
- fprintf (stderr, "File claimed to have %d arcs but only had %d\n",
- claimed_n_arcs, n_arcs);
- exit (1);
- }
-
-#if 0
- printf ("%d arcs in file\n", n_arcs);
-#endif
-}
-#endif
-
-static void
-function_solve_graph (Function *func)
-{
- int passes, changes;
- dbus_int64_t total;
- int i;
- Arc *arc;
- Block *block_graph;
- int n_blocks;
-
-#if 0
- printf ("Solving function graph\n");
-#endif
-
- n_blocks = func->n_blocks;
- block_graph = func->block_graph;
-
- /* For every block in the file,
- - if every exit/entrance arc has a known count, then set the block count
- - if the block count is known, and every exit/entrance arc but one has
- a known execution count, then set the count of the remaining arc
-
- As arc counts are set, decrement the succ/pred count, but don't delete
- the arc, that way we can easily tell when all arcs are known, or only
- one arc is unknown. */
-
- /* The order that the basic blocks are iterated through is important.
- Since the code that finds spanning trees starts with block 0, low numbered
- arcs are put on the spanning tree in preference to high numbered arcs.
- Hence, most instrumented arcs are at the end. Graph solving works much
- faster if we propagate numbers from the end to the start.
-
- This takes an average of slightly more than 3 passes. */
-
- changes = 1;
- passes = 0;
- while (changes)
- {
- passes++;
- changes = 0;
-
- for (i = n_blocks - 1; i >= 0; i--)
- {
- if (! block_graph[i].count_valid)
- {
- if (block_graph[i].succ_count == 0)
- {
- total = 0;
- for (arc = block_graph[i].succ; arc;
- arc = arc->succ_next)
- total += arc->arc_count;
- block_graph[i].exec_count = total;
- block_graph[i].count_valid = 1;
- changes = 1;
- }
- else if (block_graph[i].pred_count == 0)
- {
- total = 0;
- for (arc = block_graph[i].pred; arc;
- arc = arc->pred_next)
- total += arc->arc_count;
- block_graph[i].exec_count = total;
- block_graph[i].count_valid = 1;
- changes = 1;
- }
- }
- if (block_graph[i].count_valid)
- {
- if (block_graph[i].succ_count == 1)
- {
- total = 0;
- /* One of the counts will be invalid, but it is zero,
- so adding it in also doesn't hurt. */
- for (arc = block_graph[i].succ; arc;
- arc = arc->succ_next)
- total += arc->arc_count;
- /* Calculate count for remaining arc by conservation. */
- total = block_graph[i].exec_count - total;
- /* Search for the invalid arc, and set its count. */
- for (arc = block_graph[i].succ; arc;
- arc = arc->succ_next)
- if (! arc->count_valid)
- break;
- if (! arc)
- die ("arc == NULL\n");
- arc->count_valid = 1;
- arc->arc_count = total;
- block_graph[i].succ_count -= 1;
-
- block_graph[arc->target].pred_count -= 1;
- changes = 1;
- }
- if (block_graph[i].pred_count == 1)
- {
- total = 0;
- /* One of the counts will be invalid, but it is zero,
- so adding it in also doesn't hurt. */
- for (arc = block_graph[i].pred; arc;
- arc = arc->pred_next)
- total += arc->arc_count;
- /* Calculate count for remaining arc by conservation. */
- total = block_graph[i].exec_count - total;
- /* Search for the invalid arc, and set its count. */
- for (arc = block_graph[i].pred; arc;
- arc = arc->pred_next)
- if (! arc->count_valid)
- break;
- if (! arc)
- die ("arc == NULL\n");
- arc->count_valid = 1;
- arc->arc_count = total;
- block_graph[i].pred_count -= 1;
-
- block_graph[arc->source].succ_count -= 1;
- changes = 1;
- }
- }
- }
- }
-
- /* If the graph has been correctly solved, every block will have a
- * succ and pred count of zero.
- */
- {
- dbus_bool_t header = FALSE;
- for (i = 0; i < n_blocks; i++)
- {
- if (block_graph[i].succ_count || block_graph[i].pred_count)
- {
- if (!header)
- {
- fprintf (stderr, "WARNING: Block graph solved incorrectly for function %s\n",
- func->name);
- fprintf (stderr, " this error reflects a bug in decode-gcov.c or perhaps bogus data\n");
- header = TRUE;
- }
- fprintf (stderr, " block %d has succ_count = %d pred_count = %d\n",
- i, (int) block_graph[i].succ_count, (int) block_graph[i].pred_count);
- }
- }
- }
-}
-
-static void
-solve_graphs (DBusList **functions)
-{
- DBusList *link;
-
- link = _dbus_list_get_first_link (functions);
- while (link != NULL)
- {
- Function *func = link->data;
-
- function_solve_graph (func);
-
- link = _dbus_list_get_next_link (functions, link);
- }
-}
-
-static void
-load_functions_for_c_file (const DBusString *filename,
- DBusList **functions)
-{
- DBusString bbg_filename;
- DBusString da_filename;
- DBusString gcno_filename;
- DBusString gcda_filename;
- DBusString contents;
- DBusString *name;
- DBusError error;
-
- /* With latest gcc it's .gcno instead of .bbg and
- * gcda instead of .da
- */
-
- dbus_error_init (&error);
-
- if (!_dbus_string_init (&bbg_filename) ||
- !_dbus_string_init (&da_filename) ||
- !_dbus_string_init (&gcno_filename) ||
- !_dbus_string_init (&gcda_filename) ||
- !_dbus_string_copy (filename, 0, &bbg_filename, 0) ||
- !_dbus_string_copy (filename, 0, &da_filename, 0) ||
- !_dbus_string_copy (filename, 0, &gcno_filename, 0) ||
- !_dbus_string_copy (filename, 0, &gcda_filename, 0) ||
- !_dbus_string_init (&contents))
- die ("no memory\n");
-
- _dbus_string_shorten (&bbg_filename, 2);
- _dbus_string_shorten (&da_filename, 2);
-
- if (!_dbus_string_append (&bbg_filename, ".bbg") ||
- !_dbus_string_append (&da_filename, ".da") ||
- !_dbus_string_append (&bbg_filename, ".gcno") ||
- !_dbus_string_append (&bbg_filename, ".gcda"))
- die ("no memory\n");
-
- if (_dbus_file_exists (_dbus_string_get_const_data (&gcno_filename)))
- name = &gcno_filename;
- else
- name = &bbg_filename;
-
- if (!_dbus_file_get_contents (&contents, name,
- &error))
- {
- fprintf (stderr, "Could not open file: %s\n",
- error.message);
- exit (1);
- }
-
- get_functions_from_bbg (&contents, functions);
-
- _dbus_string_set_length (&contents, 0);
-
- if (_dbus_file_exists (_dbus_string_get_const_data (&gcda_filename)))
- name = &gcda_filename;
- else
- name = &da_filename;
-
- if (!_dbus_file_get_contents (&contents, name,
- &error))
- {
- /* Try .libs/file.da */
- int slash;
-
- if (_dbus_string_find_byte_backward (name,
- _dbus_string_get_length (name),
- '/',
- &slash))
- {
- DBusString libs;
- _dbus_string_init_const (&libs, "/.libs");
-
- if (!_dbus_string_copy (&libs, 0, name, slash))
- die ("no memory");
-
- dbus_error_free (&error);
- if (!_dbus_file_get_contents (&contents, name,
- &error))
- {
- fprintf (stderr, "Could not open file: %s\n",
- error.message);
- exit (1);
- }
- }
- else
- {
- fprintf (stderr, "Could not open file: %s\n",
- error.message);
- exit (1);
- }
- }
-
- add_counts_from_da (&contents, functions);
-
- solve_graphs (functions);
-
- _dbus_string_free (&contents);
- _dbus_string_free (&da_filename);
- _dbus_string_free (&bbg_filename);
-}
-
-static void
-get_lines_from_bb_file (const DBusString *contents,
- File *fl)
-{
- int i;
- long val;
- int n_functions;
- dbus_bool_t in_our_file;
- DBusList *link;
- Function *func;
- int block;
-
-#if 0
- printf ("Getting line numbers for blocks from .bb file\n");
-#endif
-
- /* There's this "filename" field in the .bb file which
- * mysteriously comes *after* the first function in the
- * file in the .bb file; and every .bb file seems to
- * have only one filename. I don't understand
- * what's going on here, so just set in_our_file = TRUE
- * at the start categorically.
- */
-
- block = 0;
- func = NULL;
- in_our_file = TRUE;
- link = _dbus_list_get_first_link (&fl->functions);
- n_functions = 0;
- i = 0;
- while (string_get_int (contents, i, &val))
- {
- i += 4;
-
- switch (val)
- {
- case BB_FILENAME:
- {
- DBusString f;
-
- if (!_dbus_string_init (&f))
- die ("no memory\n");
-
- if (string_get_string (contents, i,
- BB_FILENAME,
- &f, &i))
- {
- /* fl->name is a full path and the filename in .bb is
- * not.
- */
- DBusString tmp_str;
-
- _dbus_string_init_const (&tmp_str, fl->name);
-
- if (_dbus_string_ends_with_c_str (&tmp_str,
- _dbus_string_get_const_data (&f)))
- in_our_file = TRUE;
- else
- in_our_file = FALSE;
-
-#if 0
- fprintf (stderr,
- "File %s in .bb, looking for %s, in_our_file = %d\n",
- _dbus_string_get_const_data (&f),
- fl->name,
- in_our_file);
-#endif
- }
- _dbus_string_free (&f);
- }
- break;
- case BB_FUNCTION:
- {
- DBusString f;
- if (!_dbus_string_init (&f))
- die ("no memory\n");
-
- if (string_get_string (contents, i,
- BB_FUNCTION,
- &f, &i))
- {
-#if 0
- fprintf (stderr, "Function %s\n", _dbus_string_get_const_data (&f));
-#endif
-
- block = 0;
-
- if (in_our_file)
- {
- if (link == NULL)
- {
- fprintf (stderr, "No function object for function %s\n",
- _dbus_string_get_const_data (&f));
- }
- else
- {
- func = link->data;
- link = _dbus_list_get_next_link (&fl->functions, link);
-
- if (func->name == NULL)
- {
- if (!_dbus_string_copy_data (&f, &func->name))
- die ("no memory\n");
- }
- else
- {
- if (!_dbus_string_equal_c_str (&f, func->name))
- {
- fprintf (stderr, "got function name \"%s\" (%d) from .bbg file, but \"%s\" (%d) from .bb file\n",
- func->name, strlen (func->name),
- _dbus_string_get_const_data (&f),
- _dbus_string_get_length (&f));
-
- }
- }
- }
- }
- }
- _dbus_string_free (&f);
-
- n_functions += 1;
- }
- break;
- case BB_ENDOFLIST:
- block += 1;
- break;
- default:
-#if 0
- fprintf (stderr, "Line %ld\n", val);
-#endif
-
- if (val >= fl->n_lines)
- {
- fprintf (stderr, "Line %ld but file only has %d lines\n",
- val, fl->n_lines);
- }
- else if (func != NULL)
- {
- val -= 1; /* To convert the 1-based line number to 0-based */
- _dbus_assert (val >= 0);
-
- if (block < func->n_blocks)
- {
- if (!_dbus_list_append (&func->block_graph[block].lines,
- &fl->lines[val]))
- die ("no memory\n");
-
-
- if (!_dbus_list_append (&fl->lines[val].blocks,
- &func->block_graph[block]))
- die ("no memory\n");
- }
- else
- {
- fprintf (stderr, "Line number for block %d but function only has %d blocks\n",
- block, func->n_blocks);
- }
- }
- else
- {
- fprintf (stderr, "Line %ld given outside of any function\n",
- val);
- }
-
- break;
- }
- }
-
-#if 0
- printf ("%d functions in file\n", n_functions);
-#endif
-}
-
-
-static void
-load_block_line_associations (const DBusString *filename,
- File *f)
-{
- DBusString bb_filename;
- DBusString contents;
- DBusError error;
-
- dbus_error_init (&error);
-
- if (!_dbus_string_init (&bb_filename) ||
- !_dbus_string_copy (filename, 0, &bb_filename, 0) ||
- !_dbus_string_init (&contents))
- die ("no memory\n");
-
- _dbus_string_shorten (&bb_filename, 2);
-
- if (!_dbus_string_append (&bb_filename, ".bb"))
- die ("no memory\n");
-
- if (!_dbus_file_get_contents (&contents, &bb_filename,
- &error))
- {
- fprintf (stderr, "Could not open file: %s\n",
- error.message);
- exit (1);
- }
-
- get_lines_from_bb_file (&contents, f);
-
- _dbus_string_free (&contents);
- _dbus_string_free (&bb_filename);
-}
-
-static int
-count_lines_in_string (const DBusString *str)
-{
- int n_lines;
- const char *p;
- const char *prev;
- const char *end;
- const char *last_line_end;
-
-#if 0
- printf ("Counting lines in source file\n");
-#endif
-
- n_lines = 0;
- prev = NULL;
- p = _dbus_string_get_const_data (str);
- end = p + _dbus_string_get_length (str);
- last_line_end = p;
- while (p != end)
- {
- /* too lazy to handle \r\n as one linebreak */
- if (*p == '\n' || *p == '\r')
- {
- ++n_lines;
- last_line_end = p + 1;
- }
-
- prev = p;
- ++p;
- }
-
- if (last_line_end != p)
- ++n_lines;
-
- return n_lines;
-}
-
-static void
-fill_line_content (const DBusString *str,
- Line *lines)
-{
- int n_lines;
- const char *p;
- const char *prev;
- const char *end;
- const char *last_line_end;
-
-#if 0
- printf ("Saving contents of each line in source file\n");
-#endif
-
- n_lines = 0;
- prev = NULL;
- p = _dbus_string_get_const_data (str);
- end = p + _dbus_string_get_length (str);
- last_line_end = p;
- while (p != end)
- {
- if (*p == '\n' || *p == '\r')
- {
- lines[n_lines].text = dbus_malloc0 (p - last_line_end + 1);
- if (lines[n_lines].text == NULL)
- die ("no memory\n");
-
- memcpy (lines[n_lines].text, last_line_end, p - last_line_end);
- lines[n_lines].number = n_lines + 1;
-
- ++n_lines;
-
- last_line_end = p + 1;
- }
-
- prev = p;
- ++p;
- }
-
- if (p != last_line_end)
- {
- memcpy (lines[n_lines].text, last_line_end, p - last_line_end);
- ++n_lines;
- }
-}
-
-static void
-mark_inside_dbus_build_tests (File *f)
-{
- int i;
- DBusList *link;
- int inside_depth;
-
- inside_depth = 0;
- i = 0;
- while (i < f->n_lines)
- {
- Line *l = &f->lines[i];
- dbus_bool_t is_verbose;
-
- is_verbose = strstr (l->text, "_dbus_verbose") != NULL;
-
- if (inside_depth == 0)
- {
- const char *a, *b;
-
- a = strstr (l->text, "#if");
- b = strstr (l->text, "DBUS_BUILD_TESTS");
- if (a && b && (a < b))
- inside_depth += 1;
- }
- else
- {
- if (strstr (l->text, "#if") != NULL)
- inside_depth += 1;
- else if (strstr (l->text, "#endif") != NULL)
- inside_depth -= 1;
- }
-
- if (inside_depth > 0 || is_verbose)
- {
- /* Mark the line and its blocks */
- DBusList *blink;
-
- l->inside_dbus_build_tests = TRUE;
-
- blink = _dbus_list_get_first_link (&l->blocks);
- while (blink != NULL)
- {
- Block *b = blink->data;
-
- b->inside_dbus_build_tests = TRUE;
-
- blink = _dbus_list_get_next_link (&l->blocks, blink);
- }
- }
-
- ++i;
- }
-
- /* Now mark functions where for all blocks that are associated
- * with a source line, the block is inside_dbus_build_tests.
- */
- link = _dbus_list_get_first_link (&f->functions);
- while (link != NULL)
- {
- Function *func = link->data;
-
- /* The issue is that some blocks aren't associated with a source line.
- * Assume they are inside/outside tests according to the source
- * line of the preceding block. For the first block, make it
- * match the first following block with a line associated.
- */
- if (func->block_graph[0].lines == NULL)
- {
- /* find first following line */
- i = 1;
- while (i < func->n_blocks)
- {
- if (func->block_graph[i].lines != NULL)
- {
- func->block_graph[0].inside_dbus_build_tests =
- func->block_graph[i].inside_dbus_build_tests;
- break;
- }
-
- ++i;
- }
- }
-
- /* Now mark all blocks but the first */
- i = 1;
- while (i < func->n_blocks)
- {
- if (func->block_graph[i].lines == NULL)
- {
- func->block_graph[i].inside_dbus_build_tests =
- func->block_graph[i-1].inside_dbus_build_tests;
- }
-
- ++i;
- }
-
- i = 0;
- while (i < func->n_blocks)
- {
- /* Break as soon as any block is not a test block */
- if (func->block_graph[i].lines != NULL &&
- !func->block_graph[i].inside_dbus_build_tests)
- break;
-
- ++i;
- }
-
- if (i == func->n_blocks)
- func->inside_dbus_build_tests = TRUE;
-
- link = _dbus_list_get_next_link (&f->functions, link);
- }
-}
-
-static void
-mark_coverage (File *f)
-{
- int i;
- DBusList *link;
-
- i = 0;
- while (i < f->n_lines)
- {
- Line *l = &f->lines[i];
- DBusList *blink;
- int n_blocks;
- int n_blocks_executed;
-
- n_blocks = 0;
- n_blocks_executed = 0;
- blink = _dbus_list_get_first_link (&l->blocks);
- while (blink != NULL)
- {
- Block *b = blink->data;
-
- if (b->exec_count > 0)
- n_blocks_executed += 1;
-
- n_blocks += 1;
-
- blink = _dbus_list_get_next_link (&l->blocks, blink);
- }
-
- if (n_blocks_executed > 0 &&
- n_blocks_executed < n_blocks)
- l->partial = TRUE;
-
- ++i;
- }
-
- link = _dbus_list_get_first_link (&f->functions);
- while (link != NULL)
- {
- Function *func = link->data;
- int i;
- int n_test_blocks;
- int n_test_blocks_executed;
- int n_nontest_blocks;
- int n_nontest_blocks_executed;
-
- n_test_blocks = 0;
- n_test_blocks_executed = 0;
- n_nontest_blocks = 0;
- n_nontest_blocks_executed = 0;
-
- i = 0;
- while (i < func->n_blocks)
- {
- if (!func->block_graph[i].inside_dbus_build_tests)
- {
- n_nontest_blocks += 1;
-
- if (func->block_graph[i].exec_count > 0)
- n_nontest_blocks_executed += 1;
- }
- else
- {
- n_test_blocks += 1;
-
- if (func->block_graph[i].exec_count > 0)
- n_test_blocks_executed += 1;
- }
-
- ++i;
- }
-
- if (n_nontest_blocks_executed > 0 &&
- n_nontest_blocks_executed < n_nontest_blocks)
- func->partial = TRUE;
-
- if (n_nontest_blocks_executed == 0 &&
- n_nontest_blocks > 0)
- func->unused = TRUE;
-
- func->n_test_blocks = n_test_blocks;
- func->n_test_blocks_executed = n_test_blocks_executed;
- func->n_nontest_blocks = n_nontest_blocks;
- func->n_nontest_blocks_executed = n_nontest_blocks_executed;
-
- link = _dbus_list_get_next_link (&f->functions, link);
- }
-}
-
-static File*
-load_c_file (const DBusString *filename)
-{
- DBusString contents;
- DBusError error;
- File *f;
-
- f = dbus_new0 (File, 1);
- if (f == NULL)
- die ("no memory\n");
-
- if (!_dbus_string_copy_data (filename, &f->name))
- die ("no memory\n");
-
- if (!_dbus_string_init (&contents))
- die ("no memory\n");
-
- dbus_error_init (&error);
-
- if (!_dbus_file_get_contents (&contents, filename,
- &error))
- {
- fprintf (stderr, "Could not open file: %s\n",
- error.message);
- dbus_error_free (&error);
- exit (1);
- }
-
- load_functions_for_c_file (filename, &f->functions);
-
- f->n_lines = count_lines_in_string (&contents);
- f->lines = dbus_new0 (Line, f->n_lines);
- if (f->lines == NULL)
- die ("no memory\n");
-
- fill_line_content (&contents, f->lines);
-
- _dbus_string_free (&contents);
-
- load_block_line_associations (filename, f);
-
- mark_inside_dbus_build_tests (f);
- mark_coverage (f);
-
- return f;
-}
-
-typedef struct Stats Stats;
-
-struct Stats
-{
- int n_blocks;
- int n_blocks_executed;
- int n_blocks_inside_dbus_build_tests;
-
- int n_lines; /* lines that have blocks on them */
- int n_lines_executed;
- int n_lines_partial;
- int n_lines_inside_dbus_build_tests;
-
- int n_functions;
- int n_functions_executed;
- int n_functions_partial;
- int n_functions_inside_dbus_build_tests;
-};
-
-static dbus_bool_t
-line_was_executed (Line *l)
-{
- DBusList *link;
-
- link = _dbus_list_get_first_link (&l->blocks);
- while (link != NULL)
- {
- Block *b = link->data;
-
- if (b->exec_count > 0)
- return TRUE;
-
- link = _dbus_list_get_next_link (&l->blocks, link);
- }
-
- return FALSE;
-}
-
-
-static int
-line_exec_count (Line *l)
-{
- DBusList *link;
- dbus_int64_t total;
-
- total = 0;
- link = _dbus_list_get_first_link (&l->blocks);
- while (link != NULL)
- {
- Block *b = link->data;
-
- total += b->exec_count;
-
- link = _dbus_list_get_next_link (&l->blocks, link);
- }
-
- return total;
-}
-
-static void
-merge_stats_for_file (Stats *stats,
- File *f)
-{
- int i;
- DBusList *link;
-
- for (i = 0; i < f->n_lines; ++i)
- {
- Line *l = &f->lines[i];
-
- if (l->inside_dbus_build_tests)
- {
- stats->n_lines_inside_dbus_build_tests += 1;
- continue;
- }
-
- if (line_was_executed (l))
- stats->n_lines_executed += 1;
-
- if (l->blocks != NULL)
- stats->n_lines += 1;
-
- if (l->partial)
- stats->n_lines_partial += 1;
- }
-
- link = _dbus_list_get_first_link (&f->functions);
- while (link != NULL)
- {
- Function *func = link->data;
-
- if (func->inside_dbus_build_tests)
- stats->n_functions_inside_dbus_build_tests += 1;
- else
- {
- stats->n_functions += 1;
-
- if (!func->unused)
- stats->n_functions_executed += 1;
-
- if (func->partial)
- stats->n_functions_partial += 1;
- }
-
- stats->n_blocks_inside_dbus_build_tests +=
- func->n_test_blocks;
-
- stats->n_blocks_executed +=
- func->n_nontest_blocks_executed;
-
- stats->n_blocks +=
- func->n_nontest_blocks;
-
- link = _dbus_list_get_next_link (&f->functions, link);
- }
-}
-
-/* The output of this matches gcov exactly ("diff" shows no difference) */
-static void
-print_annotated_source_gcov_format (File *f)
-{
- int i;
-
- i = 0;
- while (i < f->n_lines)
- {
- Line *l = &f->lines[i];
-
- if (l->blocks != NULL)
- {
- int exec_count;
-
- exec_count = line_exec_count (l);
-
- if (exec_count > 0)
- printf ("%12d %s\n",
- exec_count, l->text);
- else
- printf (" ###### %s\n", l->text);
- }
- else
- {
- printf ("\t\t%s\n", l->text);
- }
-
- ++i;
- }
-}
-
-static void
-print_annotated_source (File *f)
-{
- int i;
-
- i = 0;
- while (i < f->n_lines)
- {
- Line *l = &f->lines[i];
-
- if (l->inside_dbus_build_tests)
- printf ("*");
- else
- printf (" ");
-
- if (l->blocks != NULL)
- {
- int exec_count;
-
- exec_count = line_exec_count (l);
-
- if (exec_count > 0)
- printf ("%12d %s\n",
- exec_count, l->text);
- else
- printf (" ###### %s\n", l->text);
- }
- else
- {
- printf ("\t\t%s\n", l->text);
- }
-
- ++i;
- }
-}
-
-static void
-print_block_superdetails (File *f)
-{
- DBusList *link;
- int i;
-
- link = _dbus_list_get_first_link (&f->functions);
- while (link != NULL)
- {
- Function *func = link->data;
-
- printf ("=== %s():\n", func->name);
-
- i = 0;
- while (i < func->n_blocks)
- {
- Block *b = &func->block_graph[i];
- DBusList *l;
-
- printf (" %5d executed %d times%s\n", i,
- (int) b->exec_count,
- b->inside_dbus_build_tests ?
- " [inside DBUS_BUILD_TESTS]" : "");
-
- l = _dbus_list_get_first_link (&b->lines);
- while (l != NULL)
- {
- Line *line = l->data;
-
- printf ("4%d\t%s\n", line->number, line->text);
-
- l = _dbus_list_get_next_link (&b->lines, l);
- }
-
- ++i;
- }
-
- link = _dbus_list_get_next_link (&f->functions, link);
- }
-}
-
-static void
-print_one_file (const DBusString *filename)
-{
- if (_dbus_string_ends_with_c_str (filename, ".bb"))
- {
- DBusString contents;
- DBusError error;
-
- if (!_dbus_string_init (&contents))
- die ("no memory\n");
-
- dbus_error_init (&error);
-
- if (!_dbus_file_get_contents (&contents, filename,
- &error))
- {
- fprintf (stderr, "Could not open file: %s\n",
- error.message);
- dbus_error_free (&error);
- exit (1);
- }
-
- dump_bb_file (&contents);
-
- _dbus_string_free (&contents);
- }
- else if (_dbus_string_ends_with_c_str (filename, ".bbg"))
- {
- DBusString contents;
- DBusError error;
-
- if (!_dbus_string_init (&contents))
- die ("no memory\n");
-
- dbus_error_init (&error);
-
- if (!_dbus_file_get_contents (&contents, filename,
- &error))
- {
- fprintf (stderr, "Could not open file: %s\n",
- error.message);
- dbus_error_free (&error);
- exit (1);
- }
-
- dump_bbg_file (&contents);
-
- _dbus_string_free (&contents);
- }
- else if (_dbus_string_ends_with_c_str (filename, ".da"))
- {
- DBusString contents;
- DBusError error;
-
- if (!_dbus_string_init (&contents))
- die ("no memory\n");
-
- dbus_error_init (&error);
-
- if (!_dbus_file_get_contents (&contents, filename,
- &error))
- {
- fprintf (stderr, "Could not open file: %s\n",
- error.message);
- dbus_error_free (&error);
- exit (1);
- }
-
- dump_da_file (&contents);
-
- _dbus_string_free (&contents);
- }
- else if (_dbus_string_ends_with_c_str (filename, ".c"))
- {
- File *f;
-
- f = load_c_file (filename);
-
- print_annotated_source (f);
- }
- else
- {
- fprintf (stderr, "Unknown file type %s\n",
- _dbus_string_get_const_data (filename));
- exit (1);
- }
-}
-
-static void
-print_untested_functions (File *f)
-{
- DBusList *link;
- dbus_bool_t found;
-
- found = FALSE;
- link = _dbus_list_get_first_link (&f->functions);
- while (link != NULL)
- {
- Function *func = link->data;
-
- if (func->unused &&
- !func->inside_dbus_build_tests)
- found = TRUE;
-
- link = _dbus_list_get_next_link (&f->functions, link);
- }
-
- if (!found)
- return;
-
- printf ("Untested functions in %s\n", f->name);
- printf ("=======\n");
-
- link = _dbus_list_get_first_link (&f->functions);
- while (link != NULL)
- {
- Function *func = link->data;
-
- if (func->unused &&
- !func->inside_dbus_build_tests)
- printf (" %s\n", func->name);
-
- link = _dbus_list_get_next_link (&f->functions, link);
- }
-
- printf ("\n");
-}
-
-static void
-print_poorly_tested_functions (File *f,
- Stats *stats)
-{
- DBusList *link;
- dbus_bool_t found;
-
-#define TEST_FRACTION(function) ((function)->n_nontest_blocks_executed / (double) (function)->n_nontest_blocks)
-
-#define AVERAGE_COVERAGE ((stats)->n_blocks_executed / (double) (stats)->n_blocks)
-
-#define POORLY_TESTED(function) (!(function)->unused && \
- (function)->n_nontest_blocks > 0 && \
- TEST_FRACTION (function) < AVERAGE_COVERAGE)
-
- found = FALSE;
- link = _dbus_list_get_first_link (&f->functions);
- while (link != NULL)
- {
- Function *func = link->data;
-
- if (POORLY_TESTED (func))
- found = TRUE;
-
- link = _dbus_list_get_next_link (&f->functions, link);
- }
-
- if (!found)
- return;
-
- printf ("Below average functions in %s\n", f->name);
- printf ("=======\n");
-
- link = _dbus_list_get_first_link (&f->functions);
- while (link != NULL)
- {
- Function *func = link->data;
-
- if (POORLY_TESTED (func))
- printf (" %s (%d%%)\n", func->name,
- (int) (TEST_FRACTION (func) * 100));
-
- link = _dbus_list_get_next_link (&f->functions, link);
- }
-
- printf ("\n");
-}
-
-static int
-func_cmp (const void *a,
- const void *b)
-{
- Function *af = *(Function**) a;
- Function *bf = *(Function**) b;
- int a_untested = af->n_nontest_blocks - af->n_nontest_blocks_executed;
- int b_untested = bf->n_nontest_blocks - bf->n_nontest_blocks_executed;
-
- /* Sort by number of untested blocks */
- return b_untested - a_untested;
-}
-
-static void
-print_n_untested_blocks_by_function (File *f,
- Stats *stats)
-{
- DBusList *link;
- Function **funcs;
- int n_found;
- int i;
-
- n_found = 0;
- link = _dbus_list_get_first_link (&f->functions);
- while (link != NULL)
- {
- Function *func = link->data;
-
- if (func->n_nontest_blocks_executed <
- func->n_nontest_blocks)
- n_found += 1;
-
- link = _dbus_list_get_next_link (&f->functions, link);
- }
-
- if (n_found == 0)
- return;
-
- /* make an array so we can use qsort */
-
- funcs = dbus_new (Function*, n_found);
- if (funcs == NULL)
- return;
-
- i = 0;
- link = _dbus_list_get_first_link (&f->functions);
- while (link != NULL)
- {
- Function *func = link->data;
-
- if (func->n_nontest_blocks_executed <
- func->n_nontest_blocks)
- {
- funcs[i] = func;
- ++i;
- }
-
- link = _dbus_list_get_next_link (&f->functions, link);
- }
-
- _dbus_assert (i == n_found);
-
- qsort (funcs, n_found, sizeof (Function*),
- func_cmp);
-
- printf ("Incomplete functions in %s\n", f->name);
- printf ("=======\n");
-
- i = 0;
- while (i < n_found)
- {
- Function *func = funcs[i];
-
- printf (" %s (%d/%d untested blocks)\n",
- func->name,
- func->n_nontest_blocks - func->n_nontest_blocks_executed,
- func->n_nontest_blocks);
-
- ++i;
- }
-
- dbus_free (funcs);
-
- printf ("\n");
-}
-
-static void
-print_stats (Stats *stats,
- const char *of_what)
-{
- int completely;
-
- printf ("Summary (%s)\n", of_what);
- printf ("=======\n");
- printf (" %g%% blocks executed (%d of %d)\n",
- (stats->n_blocks_executed / (double) stats->n_blocks) * 100.0,
- stats->n_blocks_executed,
- stats->n_blocks);
-
- printf (" (ignored %d blocks of test-only/debug-only code)\n",
- stats->n_blocks_inside_dbus_build_tests);
-
- printf (" %g%% functions executed (%d of %d)\n",
- (stats->n_functions_executed / (double) stats->n_functions) * 100.0,
- stats->n_functions_executed,
- stats->n_functions);
-
- completely = stats->n_functions_executed - stats->n_functions_partial;
- printf (" %g%% functions completely executed (%d of %d)\n",
- (completely / (double) stats->n_functions) * 100.0,
- completely,
- stats->n_functions);
-
- printf (" (ignored %d functions of test-only/debug-only code)\n",
- stats->n_functions_inside_dbus_build_tests);
-
- printf (" %g%% lines executed (%d of %d)\n",
- (stats->n_lines_executed / (double) stats->n_lines) * 100.0,
- stats->n_lines_executed,
- stats->n_lines);
-
- completely = stats->n_lines_executed - stats->n_lines_partial;
- printf (" %g%% lines completely executed (%d of %d)\n",
- (completely / (double) stats->n_lines) * 100.0,
- completely,
- stats->n_lines);
-
- printf (" (ignored %d lines of test-only/debug-only code)\n",
- stats->n_lines_inside_dbus_build_tests);
-
- printf ("\n");
-}
-
-typedef enum
-{
- MODE_PRINT,
- MODE_REPORT,
- MODE_BLOCKS,
- MODE_GCOV
-} Mode;
-
-int
-main (int argc, char **argv)
-{
- DBusString filename;
- int i;
- Mode m;
-
- if (argc < 2)
- {
- fprintf (stderr, "Must specify files on command line\n");
- return 1;
- }
-
- m = MODE_PRINT;
- i = 1;
-
- if (strcmp (argv[i], "--report") == 0)
- {
- m = MODE_REPORT;
- ++i;
- }
- else if (strcmp (argv[i], "--blocks") == 0)
- {
- m = MODE_BLOCKS;
- ++i;
- }
- else if (strcmp (argv[i], "--gcov") == 0)
- {
- m = MODE_GCOV;
- ++i;
- }
-
-
- if (i == argc)
- {
- fprintf (stderr, "Must specify files on command line\n");
- return 1;
- }
-
- if (m == MODE_PRINT)
- {
- while (i < argc)
- {
- _dbus_string_init_const (&filename, argv[i]);
-
- print_one_file (&filename);
-
- ++i;
- }
- }
- else if (m == MODE_BLOCKS || m == MODE_GCOV)
- {
- while (i < argc)
- {
- File *f;
-
- _dbus_string_init_const (&filename, argv[i]);
-
- f = load_c_file (&filename);
-
- if (m == MODE_BLOCKS)
- print_block_superdetails (f);
- else if (m == MODE_GCOV)
- print_annotated_source_gcov_format (f);
-
- ++i;
- }
- }
- else if (m == MODE_REPORT)
- {
- Stats stats = { 0, };
- DBusList *files;
- DBusList *link;
- DBusHashTable *stats_by_dir;
- DBusHashIter iter;
-
- files = NULL;
- while (i < argc)
- {
- _dbus_string_init_const (&filename, argv[i]);
-
- if (_dbus_string_ends_with_c_str (&filename, ".c"))
- {
- File *f;
-
- f = load_c_file (&filename);
-
- if (!_dbus_list_append (&files, f))
- die ("no memory\n");
- }
- else
- {
- fprintf (stderr, "Unknown file type %s\n",
- _dbus_string_get_const_data (&filename));
- exit (1);
- }
-
- ++i;
- }
-
- link = _dbus_list_get_first_link (&files);
- while (link != NULL)
- {
- File *f = link->data;
-
- merge_stats_for_file (&stats, f);
-
- link = _dbus_list_get_next_link (&files, link);
- }
-
- print_stats (&stats, "all files");
-
- stats_by_dir = _dbus_hash_table_new (DBUS_HASH_STRING,
- dbus_free, dbus_free);
-
- link = _dbus_list_get_first_link (&files);
- while (link != NULL)
- {
- File *f = link->data;
- DBusString dirname;
- char *dirname_c;
- Stats *dir_stats;
-
- _dbus_string_init_const (&filename, f->name);
-
- if (!_dbus_string_init (&dirname))
- die ("no memory\n");
-
- if (!_dbus_string_get_dirname (&filename, &dirname) ||
- !_dbus_string_copy_data (&dirname, &dirname_c))
- die ("no memory\n");
-
- dir_stats = _dbus_hash_table_lookup_string (stats_by_dir,
- dirname_c);
-
- if (dir_stats == NULL)
- {
- dir_stats = dbus_new0 (Stats, 1);
- if (!_dbus_hash_table_insert_string (stats_by_dir, dirname_c,
- dir_stats))
- die ("no memory\n");
- }
- else
- dbus_free (dirname_c);
-
- merge_stats_for_file (dir_stats, f);
-
- link = _dbus_list_get_next_link (&files, link);
- }
-
- _dbus_hash_iter_init (stats_by_dir, &iter);
- while (_dbus_hash_iter_next (&iter))
- {
- const char *dirname = _dbus_hash_iter_get_string_key (&iter);
- Stats *dir_stats = _dbus_hash_iter_get_value (&iter);
-
- print_stats (dir_stats, dirname);
- }
-
- _dbus_hash_table_unref (stats_by_dir);
-
- link = _dbus_list_get_first_link (&files);
- while (link != NULL)
- {
- File *f = link->data;
-
- print_untested_functions (f);
-
- link = _dbus_list_get_next_link (&files, link);
- }
-
- link = _dbus_list_get_first_link (&files);
- while (link != NULL)
- {
- File *f = link->data;
-
- print_poorly_tested_functions (f, &stats);
-
- link = _dbus_list_get_next_link (&files, link);
- }
-
- link = _dbus_list_get_first_link (&files);
- while (link != NULL)
- {
- File *f = link->data;
-
- print_n_untested_blocks_by_function (f, &stats);
-
- link = _dbus_list_get_next_link (&files, link);
- }
- }
-
- return 0;
-}
diff --git a/test/name-test/Makefile.am b/test/name-test/Makefile.am
index 1b5722b0..5f11f0be 100644
--- a/test/name-test/Makefile.am
+++ b/test/name-test/Makefile.am
@@ -18,12 +18,6 @@ if DBUS_BUILD_TESTS
## build even when not doing "make check"
noinst_PROGRAMS=test-pending-call-dispatch test-pending-call-timeout test-threads-init test-ids test-shutdown test-privserver test-privserver-client test-autolaunch
-test_names_SOURCES= \
- test-names.c
-
-test_names_LDADD=$(top_builddir)/dbus/libdbus-convenience.la $(DBUS_TEST_LIBS)
-test_names_LDFLAGS=@R_DYNAMIC_LDFLAG@
-
AM_CPPFLAGS = -DDBUS_STATIC_BUILD
test_pending_call_dispatch_SOURCES = \
test-pending-call-dispatch.c
diff --git a/test/name-test/Makefile.in b/test/name-test/Makefile.in
index 280de4fe..ca97de21 100644
--- a/test/name-test/Makefile.in
+++ b/test/name-test/Makefile.in
@@ -47,10 +47,11 @@ host_triplet = @host@
subdir = test/name-test
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
+ $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+ $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -263,6 +264,8 @@ EXPANDED_PREFIX = @EXPANDED_PREFIX@
EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@
FGREP = @FGREP@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -393,11 +396,6 @@ top_srcdir = @top_srcdir@
INCLUDES = -I$(top_srcdir) $(DBUS_CLIENT_CFLAGS) $(DBUS_GLIB_CFLAGS) $(DBUS_TEST_CFLAGS) -DDBUS_COMPILATION
@DBUS_BUILD_TESTS_TRUE@TESTS_ENVIRONMENT = DBUS_TOP_BUILDDIR=@abs_top_builddir@ DBUS_TOP_SRCDIR=@abs_top_srcdir@
EXTRA_DIST = run-test.sh run-test-systemserver.sh test-wait-for-echo.py test-activation-forking.py
-@DBUS_BUILD_TESTS_TRUE@test_names_SOURCES = \
-@DBUS_BUILD_TESTS_TRUE@ test-names.c
-
-@DBUS_BUILD_TESTS_TRUE@test_names_LDADD = $(top_builddir)/dbus/libdbus-convenience.la $(DBUS_TEST_LIBS)
-@DBUS_BUILD_TESTS_TRUE@test_names_LDFLAGS = @R_DYNAMIC_LDFLAG@
@DBUS_BUILD_TESTS_TRUE@AM_CPPFLAGS = -DDBUS_STATIC_BUILD
@DBUS_BUILD_TESTS_TRUE@test_pending_call_dispatch_SOURCES = \
@DBUS_BUILD_TESTS_TRUE@ test-pending-call-dispatch.c
diff --git a/test/name-test/run-with-tmp-session-bus.conf b/test/name-test/run-with-tmp-session-bus.conf
deleted file mode 100644
index f794c557..00000000
--- a/test/name-test/run-with-tmp-session-bus.conf
+++ /dev/null
@@ -1,91 +0,0 @@
-<!-- This configuration file controls the per-user-login-session message bus.
- Add a session-local.conf and edit that rather than changing this
- file directly. -->
-
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
- <!-- Our well-known bus type, don't change this -->
- <type>session</type>
-
- <!-- If we fork, keep the user's original umask to avoid affecting
- the behavior of child processes. -->
- <keep_umask/>
-
- <syslog/>
-
- <listen>unix:tmpdir=/tmp</listen>
-
- <servicedir>/home/wjt/src/dbus/test/data/valid-service-files</servicedir>
-
- <!-- intended to match system bus -->
- <policy context="default">
- <!-- All users can connect to system bus -->
- <allow user="*"/>
-
- <!-- Holes must be punched in service configuration files for
- name ownership and sending method calls -->
- <deny own="*"/>
- <deny send_type="method_call"/>
-
- <!-- Signals and reply messages (method returns, errors) are allowed
- by default -->
- <allow send_type="signal"/>
- <allow send_requested_reply="true" send_type="method_return"/>
- <allow send_requested_reply="true" send_type="error"/>
-
- <!-- All messages may be received by default -->
- <allow receive_type="method_call"/>
- <allow receive_type="method_return"/>
- <allow receive_type="error"/>
- <allow receive_type="signal"/>
-
- <!-- Allow anyone to talk to the message bus -->
- <allow send_destination="org.freedesktop.DBus"/>
- <!-- But disallow some specific bus services -->
- <deny send_destination="org.freedesktop.DBus"
- send_interface="org.freedesktop.DBus"
- send_member="UpdateActivationEnvironment"/>
-
- <!-- Specific to the test suite -->
- <allow own="org.freedesktop.DBus.TestSuiteEchoService"/>
- <allow send_destination="org.freedesktop.DBus.TestSuiteEchoService"
- send_interface="org.freedesktop.DBus.Introspectable"/>
- <allow send_destination="org.freedesktop.DBus.TestSuiteEchoService"
- send_interface="org.freedesktop.TestSuite"
- send_member="EmitFoo"/>
- </policy>
-
- <policy context="default">
- <allow own="org.freedesktop.DBus.TestSuiteEchoService"/>
- <allow send_destination="org.freedesktop.DBus.TestSuiteEchoService"
- send_interface="org.freedesktop.DBus.Introspectable"/>
- <allow send_destination="org.freedesktop.DBus.TestSuiteEchoService"
- send_interface="org.freedesktop.TestSuite"
- send_member="EmitFoo"/>
- </policy>
-
- <!-- For the session bus, override the default relatively-low limits
- with essentially infinite limits, since the bus is just running
- as the user anyway, using up bus resources is not something we need
- to worry about. In some cases, we do set the limits lower than
- "all available memory" if exceeding the limit is almost certainly a bug,
- having the bus enforce a limit is nicer than a huge memory leak. But the
- intent is that these limits should never be hit. -->
-
- <!-- the memory limits are 1G instead of say 4G because they can't exceed 32-bit signed int max -->
- <limit name="max_incoming_bytes">1000000000</limit>
- <limit name="max_outgoing_bytes">1000000000</limit>
- <limit name="max_message_size">1000000000</limit>
- <limit name="service_start_timeout">120000</limit>
- <limit name="auth_timeout">240000</limit>
- <limit name="max_completed_connections">100000</limit>
- <limit name="max_incomplete_connections">10000</limit>
- <limit name="max_connections_per_user">100000</limit>
- <limit name="max_pending_service_starts">10000</limit>
- <limit name="max_names_per_connection">50000</limit>
- <limit name="max_match_rules_per_connection">50000</limit>
- <limit name="max_replies_per_connection">50000</limit>
- <limit name="reply_timeout">300000</limit>
-
-</busconfig>
diff --git a/test/name-test/test-privserver-client.c b/test/name-test/test-privserver-client.c
index d02eea89..1c43faee 100644
--- a/test/name-test/test-privserver-client.c
+++ b/test/name-test/test-privserver-client.c
@@ -11,18 +11,52 @@ die (const char *message, ...)
exit (1);
}
+#define PRIVSERVER_SERVICE "org.freedesktop.DBus.TestSuite.PrivServer"
+#define PRIVSERVER_INTERFACE PRIVSERVER_SERVICE
+#define PRIVSERVER_DIED_RULE \
+ "type='signal',sender='" DBUS_SERVICE_DBUS "'," \
+ "interface='" DBUS_INTERFACE_DBUS "',member='NameOwnerChanged'," \
+ "arg0='" PRIVSERVER_SERVICE "',arg2=''"
+
+static DBusHandlerResult
+filter_session_message (DBusConnection *connection,
+ DBusMessage *message,
+ void *user_data)
+{
+ dbus_bool_t *service_died_p = user_data;
+ const char *name, *old_owner, *new_owner;
+
+ if (dbus_message_is_signal (message,
+ DBUS_INTERFACE_DBUS,
+ "NameOwnerChanged") &&
+ dbus_message_has_sender (message, DBUS_SERVICE_DBUS) &&
+ dbus_message_get_args (message, NULL,
+ DBUS_TYPE_STRING, &name,
+ DBUS_TYPE_STRING, &old_owner,
+ DBUS_TYPE_STRING, &new_owner,
+ DBUS_TYPE_INVALID) &&
+ strcmp (name, PRIVSERVER_SERVICE) == 0 &&
+ old_owner[0] != '\0' &&
+ new_owner[0] == '\0')
+ {
+ *service_died_p = TRUE;
+ }
+
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+}
+
static DBusHandlerResult
filter_private_message (DBusConnection *connection,
DBusMessage *message,
void *user_data)
{
+ dbus_bool_t *private_conn_lost_p = user_data;
+
if (dbus_message_is_signal (message,
DBUS_INTERFACE_LOCAL,
"Disconnected"))
{
- DBusLoop *loop = user_data;
- _dbus_loop_quit (loop);
- return DBUS_HANDLER_RESULT_HANDLED;
+ *private_conn_lost_p = TRUE;
}
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
@@ -38,8 +72,12 @@ open_shutdown_private_connection (dbus_bool_t use_guid)
DBusConnection *privconn;
char *addr;
char *comma;
+ dbus_bool_t service_died;
+ dbus_bool_t private_conn_lost;
dbus_error_init (&error);
+ service_died = FALSE;
+ private_conn_lost = FALSE;
loop = _dbus_loop_new ();
@@ -47,10 +85,19 @@ open_shutdown_private_connection (dbus_bool_t use_guid)
if (!session)
die ("couldn't access session bus\n");
dbus_connection_set_exit_on_disconnect (session, FALSE);
- msg = dbus_message_new_method_call ("org.freedesktop.DBus.TestSuite.PrivServer",
- "/",
- "org.freedesktop.DBus.TestSuite.PrivServer",
- "GetPrivateAddress");
+ test_connection_setup (loop, session);
+
+ dbus_bus_add_match (session, PRIVSERVER_DIED_RULE, &error);
+ if (dbus_error_is_set (&error))
+ die ("couldn't add match rule \"%s\": %s: %s", PRIVSERVER_DIED_RULE,
+ error.name, error.message);
+
+ if (!dbus_connection_add_filter (session, filter_session_message,
+ &service_died, NULL))
+ die ("couldn't add filter to session bus\n");
+
+ msg = dbus_message_new_method_call (PRIVSERVER_SERVICE, "/",
+ PRIVSERVER_INTERFACE, "GetPrivateAddress");
if (!(reply = dbus_connection_send_with_reply_and_block (session, msg, -1, &error)))
die ("couldn't send message: %s\n", error.message);
dbus_message_unref (msg);
@@ -71,24 +118,29 @@ open_shutdown_private_connection (dbus_bool_t use_guid)
dbus_message_unref (reply);
dbus_connection_set_exit_on_disconnect (privconn, FALSE);
- dbus_connection_add_filter (privconn, filter_private_message, loop, NULL);
+ if (!dbus_connection_add_filter (privconn, filter_private_message,
+ &private_conn_lost, NULL))
+ die ("couldn't add filter to private connection\n");
test_connection_setup (loop, privconn);
- msg = dbus_message_new_method_call ("org.freedesktop.DBus.TestSuite.PrivServer",
- "/",
- "org.freedesktop.DBus.TestSuite.PrivServer",
- "Quit");
+ msg = dbus_message_new_method_call (PRIVSERVER_SERVICE, "/",
+ PRIVSERVER_INTERFACE, "Quit");
if (!dbus_connection_send (session, msg, NULL))
die ("couldn't send Quit message\n");
dbus_message_unref (msg);
- _dbus_loop_run (loop);
+ while (!service_died || !private_conn_lost)
+ _dbus_loop_iterate (loop, TRUE);
+ dbus_connection_remove_filter (session, filter_session_message,
+ &service_died);
+ dbus_bus_remove_match (session, PRIVSERVER_DIED_RULE, NULL);
test_connection_shutdown (loop, session);
dbus_connection_unref (session);
test_connection_shutdown (loop, privconn);
- dbus_connection_remove_filter (privconn, filter_private_message, loop);
+ dbus_connection_remove_filter (privconn, filter_private_message,
+ &private_conn_lost);
dbus_connection_unref (privconn);
_dbus_loop_unref (loop);
diff --git a/test/test-utils.c b/test/test-utils.c
index eda20cd5..05cd7535 100644
--- a/test/test-utils.c
+++ b/test/test-utils.c
@@ -304,16 +304,20 @@ test_server_setup (DBusLoop *loop,
sd,
serverdata_free))
{
- return FALSE;
+ goto nomem;
}
+ sd = serverdata_new (loop, server);
+ if (sd == NULL)
+ goto nomem;
+
if (!dbus_server_set_timeout_functions (server,
add_server_timeout,
remove_server_timeout,
NULL,
sd, serverdata_free))
{
- return FALSE;
+ goto nomem;
}
return TRUE;
@@ -330,6 +334,8 @@ void
test_server_shutdown (DBusLoop *loop,
DBusServer *server)
{
+ dbus_server_disconnect (server);
+
if (!dbus_server_set_watch_functions (server,
NULL, NULL, NULL,
NULL,
diff --git a/tools/Makefile.in b/tools/Makefile.in
index 65bd1c91..1c1e8d5d 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -41,10 +41,11 @@ bin_PROGRAMS = dbus-launch$(EXEEXT) dbus-send$(EXEEXT) \
subdir = tools
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
+ $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
+ $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -229,6 +230,8 @@ EXPANDED_PREFIX = @EXPANDED_PREFIX@
EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@
FGREP = @FGREP@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
diff --git a/tools/dbus-cleanup-sockets.c b/tools/dbus-cleanup-sockets.c
index 487c4b07..1b6709af 100644
--- a/tools/dbus-cleanup-sockets.c
+++ b/tools/dbus-cleanup-sockets.c
@@ -138,16 +138,31 @@ socket_entry_new (const char *dir,
return se;
}
-#if 0
static void
free_socket_entry (SocketEntry *se)
{
- free (se->name);
- if (se->fd >= 0)
- close (se->fd);
- free (se);
+ if (se)
+ {
+ free (se->name);
+ if (se->fd >= 0)
+ close (se->fd);
+ free (se);
+ }
+}
+
+static void
+free_socket_entries (SocketEntry** entries,
+ int n_entries)
+{
+ int i;
+
+ if (entries)
+ {
+ for (i = 0; i < n_entries; ++i)
+ free_socket_entry (entries[i]);
+ free (entries);
+ }
}
-#endif
static void
read_sockets (const char *dir,
@@ -350,6 +365,8 @@ clean_dir (const char *dir)
}
unhandled_count += (n_entries - alive_count - cleaned_count);
+
+ free_socket_entries (entries, n_entries);
}
#endif /* AF_UNIX */
diff --git a/tools/dbus-launch-x11.c b/tools/dbus-launch-x11.c
index fe492227..0f344abe 100644
--- a/tools/dbus-launch-x11.c
+++ b/tools/dbus-launch-x11.c
@@ -293,6 +293,7 @@ init_x_atoms (Display *display)
int
x11_get_address (char **paddress, pid_t *pid, long *wid)
{
+ int result;
Atom type;
Window owner;
int format;
@@ -310,10 +311,10 @@ x11_get_address (char **paddress, pid_t *pid, long *wid)
*wid = (long) owner;
/* get the bus address */
- XGetWindowProperty (xdisplay, owner, address_atom, 0, 1024, False,
- XA_STRING, &type, &format, &items, &after,
- (unsigned char **) &data);
- if (type == None || after != 0 || data == NULL || format != 8)
+ result = XGetWindowProperty (xdisplay, owner, address_atom, 0, 1024, False,
+ XA_STRING, &type, &format, &items, &after,
+ (unsigned char **) &data);
+ if (result != Success || type == None || after != 0 || data == NULL || format != 8)
return FALSE; /* error */
*paddress = xstrdup (data);
@@ -323,10 +324,10 @@ x11_get_address (char **paddress, pid_t *pid, long *wid)
if (pid != NULL)
{
*pid = 0;
- XGetWindowProperty (xdisplay, owner, pid_atom, 0, sizeof pid, False,
- XA_CARDINAL, &type, &format, &items, &after,
- (unsigned char **) &data);
- if (type != None && after == 0 && data != NULL && format == 32)
+ result = XGetWindowProperty (xdisplay, owner, pid_atom, 0, sizeof pid, False,
+ XA_CARDINAL, &type, &format, &items, &after,
+ (unsigned char **) &data);
+ if (result == Success && type != None && after == 0 && data != NULL && format == 32)
*pid = (pid_t) *(long*) data;
XFree (data);
}
@@ -404,6 +405,7 @@ set_address_in_file (char *address, pid_t pid, Window wid)
return FALSE;
f = fopen (session_file, "w");
+ free (session_file);
if (f == NULL)
return FALSE; /* some kind of error */
fprintf (f,
@@ -420,7 +422,6 @@ set_address_in_file (char *address, pid_t pid, Window wid)
address, (long)pid, (long)wid);
fclose (f);
- free (session_file);
return TRUE;
}
diff --git a/tools/lcov.am b/tools/lcov.am
new file mode 100644
index 00000000..3178ba9f
--- /dev/null
+++ b/tools/lcov.am
@@ -0,0 +1,46 @@
+# Copyright © 2008-2011 Collabora Ltd.
+# Copyright © 2008-2011 Nokia Corporation
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+lcov-reset:
+ lcov --directory @abs_top_srcdir@ --zerocounters
+
+# gcov takes ~forever to process config-parser.c for some reason?
+lcov-report:
+ true > bus/bus_test-config-parser.gcno
+ true > bus/dbus_daemon-config-parser.gcno
+ lcov --directory @abs_top_srcdir@ --capture \
+ --output-file @abs_top_builddir@/lcov.info
+ $(mkdir_p) @abs_top_builddir@/lcov.html
+ git_commit=`GIT_DIR=@abs_top_srcdir@/.git git log -1 --pretty=format:%h 2>/dev/null`;\
+ genhtml --title "@PACKAGE_STRING@ $$git_commit" \
+ --output-directory @abs_top_builddir@/lcov.html lcov.info
+ @echo
+ @echo 'lcov report can be found in:'
+ @echo 'file://@abs_top_builddir@/lcov.html/index.html'
+ @echo
+
+lcov-check:
+ $(MAKE) lcov-reset
+ $(MAKE) check $(LCOV_CHECK_ARGS)
+ $(MAKE) lcov-report
+
+## vim:set ft=automake: