Commit f41d7a14 authored by Simon McVittie's avatar Simon McVittie

Imported Upstream version 1.5.4

parent 8452b2be
......@@ -224,6 +224,8 @@ DBUS_CONSOLE_AUTH_DIR = @DBUS_CONSOLE_AUTH_DIR@
DBUS_CONSOLE_OWNER_FILE = @DBUS_CONSOLE_OWNER_FILE@
DBUS_DAEMONDIR = @DBUS_DAEMONDIR@
DBUS_DATADIR = @DBUS_DATADIR@
DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@
DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@
DBUS_HAVE_INT64 = @DBUS_HAVE_INT64@
DBUS_INT16_TYPE = @DBUS_INT16_TYPE@
DBUS_INT32_TYPE = @DBUS_INT32_TYPE@
......@@ -269,6 +271,8 @@ EXPANDED_PREFIX = @EXPANDED_PREFIX@
EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@
FGREP = @FGREP@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_LIBS = @GLIB_LIBS@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
......@@ -313,7 +317,6 @@ PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
RC = @RC@
R_DYNAMIC_LDFLAG = @R_DYNAMIC_LDFLAG@
SECTION_LDFLAGS = @SECTION_LDFLAGS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
......
D-Bus 1.5.4 (2010-06-10)
==
Security (local denial of service):
• Byte-swap foreign-endian messages correctly, preventing a long-standing
local DoS if foreign-endian messages are relayed through the dbus-daemon
(backporters: this is git commit c3223ba6c401ba81df1305851312a47c485e6cd7)
(fd.o #38120, Debian #629938, no CVE number yet; Simon McVittie)
New things:
• The constant to use for an infinite timeout now has a name,
DBUS_TIMEOUT_INFINITE. It is numerically equivalent to 0x7fffffff (INT32_MAX)
which can be used for source compatibility with older versions of libdbus.
• If GLib and DBus-GLib are already installed, more tests will be built,
providing better coverage. The new tests can also be installed via
./configure --enable-installed-tests
for system integration testing, if required. (fd.o #34570, Simon McVittie)
Changes:
• Consistently use atomic operations for the DBusConnection's refcount,
fixing potential threading problems (fd.o #38005, Simon McVittie)
• Don't use -Wl,--gc-sections by default: in practice the size decrease is
small (300KiB on x86-64) and it frequently doesn't work in unusual
toolchains. To optimize for minimum installed size, you should benchmark
various possibilities for CFLAGS and LDFLAGS, and set the best flags for
your particular toolchain at configure time. (fd.o #33466, Simon McVittie)
• Use #!/bin/sh for run-with-tmp-session-bus.sh, making it work on *BSD
(fd.o #35880, Timothy Redaelli)
• Use ln -fs to set up dbus for systemd, which should fix reinstallation
when not using a DESTDIR (fd.o #37870, Simon McVittie)
• Windows-specific changes:
· don't try to build dbus-daemon-launch-helper (fd.o #37838, Mark Brand)
D-Bus 1.5.2 (2011-06-01)
==
The "Boar Hunter" release.
Notes for distributors:
This version of D-Bus no longer uses -fPIE by default. Distributions wishing
......
......@@ -89,7 +89,7 @@ dbus_daemon_LDADD= \
$(EFENCE) \
$(DBUS_BUS_LIBS)
dbus_daemon_LDFLAGS=@R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@
dbus_daemon_LDFLAGS=@R_DYNAMIC_LDFLAG@
LAUNCH_HELPER_SOURCES= \
$(XML_SOURCES) \
......@@ -115,7 +115,7 @@ dbus_daemon_launch_helper_LDADD= \
$(top_builddir)/dbus/libdbus-internal.la \
$(DBUS_LAUNCHER_LIBS)
dbus_daemon_launch_helper_LDFLAGS=@R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@
dbus_daemon_launch_helper_LDFLAGS=@R_DYNAMIC_LDFLAG@
## we build another binary so we can do the launch testing without root privs.
## DO NOT INSTALL THIS FILE
......@@ -127,7 +127,7 @@ dbus_daemon_launch_helper_test_LDADD= \
$(top_builddir)/dbus/libdbus-internal.la \
$(DBUS_LAUNCHER_LIBS)
dbus_daemon_launch_helper_test_LDFLAGS=@R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@
dbus_daemon_launch_helper_test_LDFLAGS=@R_DYNAMIC_LDFLAG@
dbus_daemon_launch_helper_test_CPPFLAGS= -DDBUS_STATIC_BUILD \
-DACTIVATION_LAUNCHER_TEST
......@@ -141,7 +141,7 @@ bus_test_launch_helper_LDADD= \
$(top_builddir)/dbus/libdbus-internal.la \
$(DBUS_LAUNCHER_LIBS)
bus_test_launch_helper_LDFLAGS=@R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@
bus_test_launch_helper_LDFLAGS=@R_DYNAMIC_LDFLAG@
bus_test_launch_helper_CPPFLAGS= -DDBUS_STATIC_BUILD \
-DACTIVATION_LAUNCHER_TEST \
-DACTIVATION_LAUNCHER_DO_OOM
......@@ -150,7 +150,9 @@ bus_test_launch_helper_CPPFLAGS= -DDBUS_STATIC_BUILD \
## even when not doing "make check"
noinst_PROGRAMS = $(TESTS)
dbus_daemon_exec_PROGRAMS = dbus-daemon
if DBUS_UNIX
libexec_PROGRAMS = dbus-daemon-launch-helper
endif DBUS_UNIX
## note that TESTS has special meaning (stuff to use in make check)
## so if adding tests not to be run in make check, don't add them to
......@@ -202,14 +204,16 @@ install-data-hook:
$(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/services
$(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/system-services
if HAVE_SYSTEMD
# Install dbus.socket as default implementation of a D-Bus stack
# Install dbus.socket as default implementation of a D-Bus stack.
# Deliberately not using $(LN_S) here: ln -fs is not universally portable,
# but neither is systemd, so it's OK to assume here that ln complies with SUS.
$(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/dbus.target.wants
$(LN_S) ../dbus.socket $(DESTDIR)$(systemdsystemunitdir)/dbus.target.wants/dbus.socket
ln -fs ../dbus.socket $(DESTDIR)$(systemdsystemunitdir)/dbus.target.wants/dbus.socket
# Unconditionally enable D-Bus on systemd installations
$(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants
$(LN_S) ../dbus.socket $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants/dbus.socket
ln -fs ../dbus.socket $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants/dbus.socket
$(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/multi-user.target.wants
$(LN_S) ../dbus.service $(DESTDIR)$(systemdsystemunitdir)/multi-user.target.wants/dbus.service
ln -fs ../dbus.service $(DESTDIR)$(systemdsystemunitdir)/multi-user.target.wants/dbus.service
endif
if DBUS_UNIX
......
......@@ -38,7 +38,7 @@ build_triplet = @build@
host_triplet = @host@
noinst_PROGRAMS = $(am__EXEEXT_3) $(am__EXEEXT_4)
dbus_daemon_exec_PROGRAMS = dbus-daemon$(EXEEXT)
libexec_PROGRAMS = dbus-daemon-launch-helper$(EXEEXT)
@DBUS_UNIX_TRUE@libexec_PROGRAMS = dbus-daemon-launch-helper$(EXEEXT)
TESTS = $(am__EXEEXT_1) $(am__EXEEXT_2)
@DBUS_BUILD_TESTS_TRUE@am__append_1 = bus-test bus-test-system
@DBUS_BUILD_TESTS_TRUE@@DBUS_UNIX_TRUE@am__append_2 = bus-test-launch-helper
......@@ -338,6 +338,8 @@ DBUS_CONSOLE_AUTH_DIR = @DBUS_CONSOLE_AUTH_DIR@
DBUS_CONSOLE_OWNER_FILE = @DBUS_CONSOLE_OWNER_FILE@
DBUS_DAEMONDIR = @DBUS_DAEMONDIR@
DBUS_DATADIR = @DBUS_DATADIR@
DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@
DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@
DBUS_HAVE_INT64 = @DBUS_HAVE_INT64@
DBUS_INT16_TYPE = @DBUS_INT16_TYPE@
DBUS_INT32_TYPE = @DBUS_INT32_TYPE@
......@@ -383,6 +385,8 @@ EXPANDED_PREFIX = @EXPANDED_PREFIX@
EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@
FGREP = @FGREP@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_LIBS = @GLIB_LIBS@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
......@@ -427,7 +431,6 @@ PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
RC = @RC@
R_DYNAMIC_LDFLAG = @R_DYNAMIC_LDFLAG@
SECTION_LDFLAGS = @SECTION_LDFLAGS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
......@@ -579,7 +582,7 @@ dbus_daemon_LDADD = \
$(EFENCE) \
$(DBUS_BUS_LIBS)
dbus_daemon_LDFLAGS = @R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@
dbus_daemon_LDFLAGS = @R_DYNAMIC_LDFLAG@
LAUNCH_HELPER_SOURCES = \
$(XML_SOURCES) \
config-parser-common.c \
......@@ -603,7 +606,7 @@ dbus_daemon_launch_helper_LDADD = \
$(top_builddir)/dbus/libdbus-internal.la \
$(DBUS_LAUNCHER_LIBS)
dbus_daemon_launch_helper_LDFLAGS = @R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@
dbus_daemon_launch_helper_LDFLAGS = @R_DYNAMIC_LDFLAG@
dbus_daemon_launch_helper_test_SOURCES = \
activation-helper-bin.c \
$(LAUNCH_HELPER_SOURCES)
......@@ -612,7 +615,7 @@ dbus_daemon_launch_helper_test_LDADD = \
$(top_builddir)/dbus/libdbus-internal.la \
$(DBUS_LAUNCHER_LIBS)
dbus_daemon_launch_helper_test_LDFLAGS = @R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@
dbus_daemon_launch_helper_test_LDFLAGS = @R_DYNAMIC_LDFLAG@
dbus_daemon_launch_helper_test_CPPFLAGS = -DDBUS_STATIC_BUILD \
-DACTIVATION_LAUNCHER_TEST
......@@ -624,7 +627,7 @@ bus_test_launch_helper_LDADD = \
$(top_builddir)/dbus/libdbus-internal.la \
$(DBUS_LAUNCHER_LIBS)
bus_test_launch_helper_LDFLAGS = @R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@
bus_test_launch_helper_LDFLAGS = @R_DYNAMIC_LDFLAG@
bus_test_launch_helper_CPPFLAGS = -DDBUS_STATIC_BUILD \
-DACTIVATION_LAUNCHER_TEST \
-DACTIVATION_LAUNCHER_DO_OOM
......@@ -2581,14 +2584,16 @@ install-data-hook:
$(mkinstalldirs) $(DESTDIR)$(configdir)/session.d
$(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/services
$(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/system-services
# Install dbus.socket as default implementation of a D-Bus stack
# Install dbus.socket as default implementation of a D-Bus stack.
# Deliberately not using $(LN_S) here: ln -fs is not universally portable,
# but neither is systemd, so it's OK to assume here that ln complies with SUS.
@HAVE_SYSTEMD_TRUE@ $(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/dbus.target.wants
@HAVE_SYSTEMD_TRUE@ $(LN_S) ../dbus.socket $(DESTDIR)$(systemdsystemunitdir)/dbus.target.wants/dbus.socket
@HAVE_SYSTEMD_TRUE@ ln -fs ../dbus.socket $(DESTDIR)$(systemdsystemunitdir)/dbus.target.wants/dbus.socket
# Unconditionally enable D-Bus on systemd installations
@HAVE_SYSTEMD_TRUE@ $(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants
@HAVE_SYSTEMD_TRUE@ $(LN_S) ../dbus.socket $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants/dbus.socket
@HAVE_SYSTEMD_TRUE@ ln -fs ../dbus.socket $(DESTDIR)$(systemdsystemunitdir)/sockets.target.wants/dbus.socket
@HAVE_SYSTEMD_TRUE@ $(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/multi-user.target.wants
@HAVE_SYSTEMD_TRUE@ $(LN_S) ../dbus.service $(DESTDIR)$(systemdsystemunitdir)/multi-user.target.wants/dbus.service
@HAVE_SYSTEMD_TRUE@ ln -fs ../dbus.service $(DESTDIR)$(systemdsystemunitdir)/multi-user.target.wants/dbus.service
@DBUS_UNIX_TRUE@install-exec-hook:
@DBUS_UNIX_TRUE@ if test `id -u` -eq 0; then \
......
......@@ -226,7 +226,7 @@ ENABLE_TESTING()
option (DBUS_BUILD_TESTS "enable unit test code" ON)
if(DBUS_BUILD_TESTS)
add_definitions(-DDBUS_BUILD_TESTS)
add_definitions(-DDBUS_BUILD_TESTS -DDBUS_ENABLE_EMBEDDED_TESTS)
endif(DBUS_BUILD_TESTS)
option (DBUS_USE_OUTPUT_DEBUG_STRING "enable win32 debug port for message output" OFF)
......
......@@ -9,7 +9,7 @@
/* Directory for installing the binaries */
#undef DBUS_BINDIR
/* Build test code */
/* Define to build test code into the library and binaries */
#undef DBUS_BUILD_TESTS
/* Define to build X11 functionality */
......@@ -51,9 +51,15 @@
/* Disable public API sanity checking */
#undef DBUS_DISABLE_CHECKS
/* Define to build test code into the library and binaries */
#undef DBUS_ENABLE_EMBEDDED_TESTS
/* Use launchd autolaunch */
#undef DBUS_ENABLE_LAUNCHD
/* Define to build independent test binaries (requires GLib) */
#undef DBUS_ENABLE_MODULAR_TESTS
/* Build with caching of user data */
#undef DBUS_ENABLE_USERDB_CACHE
......@@ -114,9 +120,6 @@
/* The name of the gettext domain */
#undef GETTEXT_PACKAGE
/* Disable GLib assertion macros */
#undef G_DISABLE_ASSERT
/* Disable GLib public API sanity checking */
#undef G_DISABLE_CHECKS
......
This diff is collapsed.
......@@ -3,7 +3,7 @@ AC_PREREQ([2.63])
m4_define([dbus_major_version], [1])
m4_define([dbus_minor_version], [5])
m4_define([dbus_micro_version], [2])
m4_define([dbus_micro_version], [4])
m4_define([dbus_version],
[dbus_major_version.dbus_minor_version.dbus_micro_version])
AC_INIT([dbus],[dbus_version],[https://bugs.freedesktop.org/enter_bug.cgi?product=dbus],[dbus])
......@@ -36,7 +36,7 @@ LT_CURRENT=9
## increment any time the source changes; set to
## 0 if you increment CURRENT
LT_REVISION=1
LT_REVISION=2
## increment if any interfaces have been added; set to 0
## if any interfaces have been changed or removed. removal has
......@@ -122,7 +122,6 @@ AM_CONDITIONAL(DBUS_WINCE, test "$dbus_wince" = yes)
AM_CONDITIONAL(DBUS_UNIX, test "$dbus_unix" = yes)
AM_CONDITIONAL(DBUS_CYGWIN, test "$dbus_cygwin" = yes)
AC_ARG_ENABLE(tests, AS_HELP_STRING([--enable-tests],[enable unit test code in the library and binaries]),enable_tests=$enableval,enable_tests=$USE_MAINTAINER_MODE)
AC_ARG_ENABLE(ansi, AS_HELP_STRING([--enable-ansi],[enable -ansi -pedantic gcc flags]),enable_ansi=$enableval,enable_ansi=no)
AC_ARG_ENABLE(verbose-mode, AS_HELP_STRING([--enable-verbose-mode],[support verbose debug mode]),enable_verbose_mode=$enableval,enable_verbose_mode=$USE_MAINTAINER_MODE)
AC_ARG_ENABLE(asserts, AS_HELP_STRING([--enable-asserts],[include assertion checks]),enable_asserts=$enableval,enable_asserts=$USE_MAINTAINER_MODE)
......@@ -151,12 +150,73 @@ AC_ARG_WITH(launchd-agent-dir, AS_HELP_STRING([--with-launchd-agent-dir=[dirname
AC_ARG_WITH(dbus_user, AS_HELP_STRING([--with-dbus-user=<user>],[User for running the DBUS daemon (messagebus)]))
AC_ARG_WITH(dbus_daemondir, AS_HELP_STRING([--with-dbus-daemondir=[dirname]],[Directory for installing the DBUS daemon]))
dnl DBUS_BUILD_TESTS controls unit tests built in to .c files
dnl and also some stuff in the test/ subdir
AM_CONDITIONAL(DBUS_BUILD_TESTS, test x$enable_tests = xyes)
if test x$enable_tests = xyes; then
AC_DEFINE(DBUS_BUILD_TESTS,1,[Build test code])
AC_ARG_ENABLE([embedded-tests],
AS_HELP_STRING([--enable-embedded-tests],
[enable unit test code in the library and binaries]),
[], [enable_embedded_tests=$USE_MAINTAINER_MODE])
AC_ARG_ENABLE([modular-tests],
AS_HELP_STRING([--enable-modular-tests],
[enable modular regression tests (requires GLib)]),
[], [enable_modular_tests=auto])
# --enable-tests overrides both --enable-embedded-tests and
# --enable-modular-tests
AC_ARG_ENABLE([tests],
AS_HELP_STRING([--enable-tests],
[enable/disable all tests, overriding embedded-tests/modular-tests]),
[enable_embedded_tests=$enableval; enable_modular_tests=$enableval],
[])
# DBUS_ENABLE_EMBEDDED_TESTS controls unit tests built in to .c files
# and also some stuff in the test/ subdir. DBUS_BUILD_TESTS was an older
# name for this.
AM_CONDITIONAL([DBUS_BUILD_TESTS], [test "x$enable_embedded_tests" = xyes])
AM_CONDITIONAL([DBUS_ENABLE_EMBEDDED_TESTS],
[test "x$enable_embedded_tests" = xyes])
if test "x$enable_embedded_tests" = xyes; then
AC_DEFINE([DBUS_ENABLE_EMBEDDED_TESTS], [1],
[Define to build test code into the library and binaries])
AC_DEFINE([DBUS_BUILD_TESTS], [1],
[Define to build test code into the library and binaries])
fi
# DBUS_ENABLE_MODULAR_TESTS controls tests that work based on public API.
# These use GTest, from GLib, because life's too short. They're enabled by
# default (unless you don't have GLib), because they don't bloat the library
# or binaries.
if test "x$enable_modular_tests" != xno; then
PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22, gio-2.0 >= 2.22],
[],
[if test "x$enable_modular_tests" = xyes; then
AC_MSG_ERROR([GLib is required by the modular tests])
else # assumed to be "auto"
enable_modular_tests=no
fi])
# If dbus-gmain.[ch] returned to libdbus then we wouldn't need this
PKG_CHECK_MODULES([DBUS_GLIB], [dbus-glib-1],
[],
[if test "x$enable_modular_tests" = xyes; then
AC_MSG_ERROR([dbus-glib is required by the modular tests (for now)])
else # assumed to be "auto"
enable_modular_tests=no
fi])
if test "x$enable_modular_tests" != xno; then
# dependencies checked, switch from auto to yes
enable_modular_tests=yes
fi
fi
if test "x$enable_modular_tests" = xyes; then
AC_DEFINE([DBUS_ENABLE_MODULAR_TESTS], [1],
[Define to build independent test binaries (requires GLib)])
fi
AM_CONDITIONAL([DBUS_ENABLE_MODULAR_TESTS],
[test "x$enable_modular_tests" = xyes])
AC_ARG_ENABLE([installed-tests],
AS_HELP_STRING([--enable-installed-tests],
[enable unit test code in the library and binaries]),
[], [enable_installed_tests=no])
AM_CONDITIONAL([DBUS_ENABLE_INSTALLED_TESTS],
[test "x$enable_installed_tests" = xyes])
if test x$enable_verbose_mode = xyes; then
AC_DEFINE(DBUS_ENABLE_VERBOSE_MODE,1,[Support a verbose mode])
......@@ -164,7 +224,6 @@ fi
if test x$enable_asserts = xno; then
AC_DEFINE(DBUS_DISABLE_ASSERT,1,[Disable assertion checking])
AC_DEFINE(G_DISABLE_ASSERT,1,[Disable GLib assertion macros])
R_DYNAMIC_LDFLAG=""
else
# -rdynamic is needed for glibc's backtrace_symbols to work.
......@@ -1193,34 +1252,6 @@ dnl but prepending to CFLAGS (so the user can override it with later CFLAGS)
dnl is the next best thing
CFLAGS="$WARNING_CFLAGS $CFLAGS"
# Disabling gc-sections makes our binaries bigger, but some toolchains
# have known-broken support for it which discards sections that are needed.
# See https://bugs.freedesktop.org/show_bug.cgi?id=33466
SECTION_LDFLAGS=
AC_ARG_ENABLE([gc-sections],
[AS_HELP_STRING([--disable-gc-sections],
[disable --gc-sections to work around broken toolchains])],
[enable_gc_sections=$enableval],
[enable_gc_sections=yes])
if test "x$GCC,$enable_gc_sections,$dbus_win" = xyes,yes,no; then
save_CFLAGS="$CFLAGS"
save_LDFLAGS="$LDFLAGS"
AC_MSG_CHECKING([for ability to link with --gc-sections])
CFLAGS="-ffunction-sections -fdata-sections"
LDFLAGS="-Wl,--gc-sections"
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
[rc=yes],
[rc=no])
AC_MSG_RESULT([$rc])
CFLAGS="$save_CFLAGS"
LDFLAGS="$save_LDFLAGS"
if test "x$rc" = xyes; then
SECTION_LDFLAGS="-Wl,--gc-sections"
CFLAGS="-ffunction-sections -fdata-sections $CFLAGS"
fi
fi
AC_SUBST([SECTION_LDFLAGS])
case $host_os in
solaris*)
# Solaris' C library apparently needs these runes to be threadsafe...
......@@ -1597,7 +1628,8 @@ echo "
echo "
Maintainer mode: ${USE_MAINTAINER_MODE}
gcc coverage profiling: ${enable_compiler_coverage}
Building unit tests: ${enable_tests}
Building embedded tests: ${enable_embedded_tests}
Building modular tests: ${enable_modular_tests}
Building verbose mode: ${enable_verbose_mode}
Building assertions: ${enable_asserts}
Building checks: ${enable_checks}
......@@ -1629,11 +1661,11 @@ if test x$have_launchd = xyes; then
fi
echo
if test x$enable_tests = xyes; then
if test x$enable_embedded_tests = xyes; then
echo "NOTE: building with unit tests increases the size of the installed library and renders it insecure."
fi
if test x$enable_tests = xyes -a x$enable_asserts = xno; then
echo "NOTE: building with unit tests but without assertions means tests may not properly report failures (this configuration is only useful when doing something like profiling the tests)"
if test x$enable_embedded_tests = xyes -a x$enable_asserts = xno; then
echo "NOTE: building with embedded tests but without assertions means tests may not properly report failures (this configuration is only useful when doing something like profiling the tests)"
fi
if test x$enable_compiler_coverage = xyes; then
echo "NOTE: building with coverage profiling is definitely for developers only."
......
......@@ -374,6 +374,8 @@ DBUS_CONSOLE_AUTH_DIR = @DBUS_CONSOLE_AUTH_DIR@
DBUS_CONSOLE_OWNER_FILE = @DBUS_CONSOLE_OWNER_FILE@
DBUS_DAEMONDIR = @DBUS_DAEMONDIR@
DBUS_DATADIR = @DBUS_DATADIR@
DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@
DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@
DBUS_HAVE_INT64 = @DBUS_HAVE_INT64@
DBUS_INT16_TYPE = @DBUS_INT16_TYPE@
DBUS_INT32_TYPE = @DBUS_INT32_TYPE@
......@@ -419,6 +421,8 @@ EXPANDED_PREFIX = @EXPANDED_PREFIX@
EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@
FGREP = @FGREP@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_LIBS = @GLIB_LIBS@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
......@@ -463,7 +467,6 @@ PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
RC = @RC@
R_DYNAMIC_LDFLAG = @R_DYNAMIC_LDFLAG@
SECTION_LDFLAGS = @SECTION_LDFLAGS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
......
......@@ -1400,13 +1400,8 @@ _dbus_connection_ref_unlocked (DBusConnection *connection)
_dbus_assert (connection->generation == _dbus_current_generation);
HAVE_LOCK_CHECK (connection);
#ifdef DBUS_HAVE_ATOMIC_INT
_dbus_atomic_inc (&connection->refcount);
#else
_dbus_assert (connection->refcount.value > 0);
connection->refcount.value += 1;
#endif
return connection;
}
......@@ -1426,22 +1421,8 @@ _dbus_connection_unref_unlocked (DBusConnection *connection)
_dbus_assert (connection != NULL);
/* The connection lock is better than the global
* lock in the atomic increment fallback
*/
#ifdef DBUS_HAVE_ATOMIC_INT
last_unref = (_dbus_atomic_dec (&connection->refcount) == 1);
#else
_dbus_assert (connection->refcount.value > 0);
connection->refcount.value -= 1;
last_unref = (connection->refcount.value == 0);
#if 0
printf ("unref_unlocked() connection %p count = %d\n", connection, connection->refcount.value);
#endif
#endif
if (last_unref)
_dbus_connection_last_unref (connection);
}
......@@ -2127,11 +2108,23 @@ _dbus_connection_send_and_unlock (DBusConnection *connection,
void
_dbus_connection_close_if_only_one_ref (DBusConnection *connection)
{
dbus_int32_t tmp_refcount;
CONNECTION_LOCK (connection);
_dbus_assert (connection->refcount.value > 0);
if (connection->refcount.value == 1)
/* We increment and then decrement the refcount, because there is no
* _dbus_atomic_get (mirroring the fact that there's no InterlockedGet
* on Windows). */
_dbus_atomic_inc (&connection->refcount);
tmp_refcount = _dbus_atomic_dec (&connection->refcount);
/* The caller should have one ref, and this function temporarily took
* one more, which is reflected in this count even though we already
* released it (relying on the caller's ref) due to _dbus_atomic_dec
* semantics */
_dbus_assert (tmp_refcount >= 2);
if (tmp_refcount == 2)
_dbus_connection_close_possibly_shared_and_unlock (connection);
else
CONNECTION_UNLOCK (connection);
......@@ -2633,25 +2626,8 @@ dbus_connection_ref (DBusConnection *connection)
{
_dbus_return_val_if_fail (connection != NULL, NULL);
_dbus_return_val_if_fail (connection->generation == _dbus_current_generation, NULL);
/* The connection lock is better than the global
* lock in the atomic increment fallback
*
* (FIXME but for now we always use the atomic version,
* to avoid taking the connection lock, due to
* the mess with set_timeout_functions()/set_watch_functions()
* calling out to the app without dropping locks)
*/
#if 1
_dbus_atomic_inc (&connection->refcount);
#else
CONNECTION_LOCK (connection);
_dbus_assert (connection->refcount.value > 0);
connection->refcount.value += 1;
CONNECTION_UNLOCK (connection);
#endif
_dbus_atomic_inc (&connection->refcount);
return connection;
}
......@@ -2788,33 +2764,9 @@ dbus_connection_unref (DBusConnection *connection)
_dbus_return_if_fail (connection != NULL);
_dbus_return_if_fail (connection->generation == _dbus_current_generation);
/* The connection lock is better than the global
* lock in the atomic increment fallback
*
* (FIXME but for now we always use the atomic version,
* to avoid taking the connection lock, due to
* the mess with set_timeout_functions()/set_watch_functions()
* calling out to the app without dropping locks)
*/
#if 1
last_unref = (_dbus_atomic_dec (&connection->refcount) == 1);
#else
CONNECTION_LOCK (connection);
_dbus_assert (connection->refcount.value > 0);
connection->refcount.value -= 1;
last_unref = (connection->refcount.value == 0);
last_unref = (_dbus_atomic_dec (&connection->refcount) == 1);
#if 0
printf ("unref() connection %p count = %d\n", connection, connection->refcount.value);
#endif
CONNECTION_UNLOCK (connection);
#endif
if (last_unref)
{
#ifndef DBUS_DISABLE_CHECKS
......@@ -3362,8 +3314,9 @@ reply_handler_timeout (void *data)
*
* If -1 is passed for the timeout, a sane default timeout is used. -1
* is typically the best value for the timeout for this reason, unless
* you want a very short or very long timeout. If INT_MAX is passed for
* the timeout, no timeout will be set and the call will block forever.
* you want a very short or very long timeout. If #DBUS_TIMEOUT_INFINITE is
* passed for the timeout, no timeout will be set and the call will block
* forever.
*
* @warning if the connection is disconnected or you try to send Unix
* file descriptors on a connection that does not support them, the
......@@ -3375,7 +3328,9 @@ reply_handler_timeout (void *data)
* object, or #NULL if connection is disconnected or when you try to
* send Unix file descriptors on a connection that does not support
* them.
* @param timeout_milliseconds timeout in milliseconds, -1 for default or INT_MAX for no timeout
* @param timeout_milliseconds timeout in milliseconds, -1 (or
* #DBUS_TIMEOUT_USE_DEFAULT) for default or #DBUS_TIMEOUT_INFINITE for no
* timeout
* @returns #FALSE if no memory, #TRUE otherwise.
*
*/
......@@ -3508,7 +3463,9 @@ dbus_connection_send_with_reply (DBusConnection *connection,
*
* @param connection the connection
* @param message the message to send
* @param timeout_milliseconds timeout in milliseconds, -1 for default or INT_MAX for no timeout.
* @param timeout_milliseconds timeout in milliseconds, -1 (or
* #DBUS_TIMEOUT_USE_DEFAULT) for default or #DBUS_TIMEOUT_INFINITE for no
* timeout
* @param error return location for error message
* @returns the message that is the reply or #NULL with an error code if the
* function fails.
......
......@@ -1468,14 +1468,20 @@ void
_dbus_header_byteswap (DBusHeader *header,
int new_order)
{
unsigned char byte_order;
if (header->byte_order == new_order)
return;
byte_order = _dbus_string_get_byte (&header->data, BYTE_ORDER_OFFSET);
_dbus_assert (header->byte_order == byte_order);
_dbus_marshal_byteswap (&_dbus_header_signature_str,
0, header->byte_order,
new_order,
&header->data, 0);
_dbus_string_set_byte (&header->data, BYTE_ORDER_OFFSET, new_order);
header->byte_order = new_order;
}
......
......@@ -4680,7 +4680,7 @@ dbus_message_demarshal_bytes_needed(const char *buf,
if (validity == DBUS_VALID)
{
_dbus_assert(have_message);
_dbus_assert (have_message || (header_len + body_len) > len);
return header_len + body_len;
}
else
......
......@@ -84,7 +84,9 @@ static dbus_int32_t notify_user_data_slot = -1;
* Creates a new pending reply object.
*
* @param connection connection where reply will arrive
* @param timeout_milliseconds length of timeout, -1 for default, INT_MAX for no timeout
* @param timeout_milliseconds length of timeout, -1 (or
* #DBUS_TIMEOUT_USE_DEFAULT) for default,
* #DBUS_TIMEOUT_INFINITE for no timeout
* @param timeout_handler timeout handler, takes pending call as data
* @returns a new #DBusPendingCall or #NULL if no memory.
*/
......@@ -112,7 +114,7 @@ _dbus_pending_call_new_unlocked (DBusConnection *connection,
return NULL;
}
if (timeout_milliseconds != _DBUS_INT_MAX)
if (timeout_milliseconds != DBUS_TIMEOUT_INFINITE)
{
timeout = _dbus_timeout_new (timeout_milliseconds,
timeout_handler,
......@@ -515,6 +517,26 @@ _dbus_pending_call_set_data_unlocked (DBusPendingCall *pending,
* @{
*/
/**
* @def DBUS_TIMEOUT_INFINITE
*
* An integer constant representing an infinite timeout. This has the
* numeric value 0x7fffffff (the largest 32-bit signed integer).
*
* For source compatibility with D-Bus versions earlier than 1.4.12, use
* 0x7fffffff, or INT32_MAX (assuming your platform has it).
*/
/**
* @def DBUS_TIMEOUT_USE_DEFAULT
*
* An integer constant representing a request to use the default timeout.
* This has numeric value -1.
*
* For source compatibility with D-Bus versions earlier than 1.4.12, use a
* literal -1.
*/
/**
* @typedef DBusPendingCall
*
......
......@@ -38,6 +38,9 @@ DBUS_BEGIN_DECLS
* @{
*/
#define DBUS_TIMEOUT_INFINITE ((int) 0x7fffffff)
#define DBUS_TIMEOUT_USE_DEFAULT (-1)
DBUS_EXPORT
DBusPendingCall* dbus_pending_call_ref (DBusPendingCall *pending);
DBUS_EXPORT
......
......@@ -116,6 +116,8 @@ DBUS_CONSOLE_AUTH_DIR = @DBUS_CONSOLE_AUTH_DIR@
DBUS_CONSOLE_OWNER_FILE = @DBUS_CONSOLE_OWNER_FILE@
DBUS_DAEMONDIR = @DBUS_DAEMONDIR@
DBUS_DATADIR = @DBUS_DATADIR@
DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@
DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@
DBUS_HAVE_INT64 = @DBUS_HAVE_INT64@
DBUS_INT16_TYPE = @DBUS_INT16_TYPE@
DBUS_INT32_TYPE = @DBUS_INT32_TYPE@
......@@ -161,6 +163,8 @@ EXPANDED_PREFIX = @EXPANDED_PREFIX@
EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@
FGREP = @FGREP@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_LIBS = @GLIB_LIBS@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
......@@ -205,7 +209,6 @@ PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
RC = @RC@
R_DYNAMIC_LDFLAG = @R_DYNAMIC_LDFLAG@
SECTION_LDFLAGS = @SECTION_LDFLAGS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
......
This diff is collapsed.
This diff is collapsed.
......@@ -38,7 +38,7 @@
Message Builder. The message builder can take a serialized
message in string-form and convert it into a raw character
string which can then be loaded by the message loader.
</p><div class="figure"><a name="idp59024"></a><p class="title"><b>Figure 1. Example of a message in string form</b></p><div class="figure-contents"><pre class="programlisting">
</p><div class="figure"><a name="idp24476880"></a><p class="title"><b>Figure 1. Example of a message in string form</b></p><div class="figure-contents"><pre class="programlisting">
# Standard org.freedesktop.DBus.Hello message
VALID_HEADER
......@@ -75,7 +75,7 @@
can read authentication sequences from a file and play them
back to a dummy server and client to make sure that
authentication is working according to the specification.
</p><div class="figure"><a name="idp65712"></a><p class="title"><b>Figure 2. Example of an authentication script</b></p><div class="figure-contents"><pre class="programlisting">
</p><div class="figure"><a name="idp24483568"></a><p class="title"><b>Figure 2. Example of an authentication script</b></p><div class="figure-contents"><pre class=