platform/upstream/dbus.git
8 years agoMerge branch 'dbus-1.10'
Ralf Habacker [Mon, 16 May 2016 10:57:04 +0000 (12:57 +0200)]
Merge branch 'dbus-1.10'

8 years agoFix ambiguous setup of DBusBabySitter struct member child_handle on Windows.
Ralf Habacker [Mon, 16 May 2016 10:52:25 +0000 (12:52 +0200)]
Fix ambiguous setup of DBusBabySitter struct member child_handle on Windows.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=95191
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agodbus-spawn-win: Do not attempt to call child_setup (again)
Simon McVittie [Fri, 13 May 2016 13:54:33 +0000 (14:54 +0100)]
dbus-spawn-win: Do not attempt to call child_setup (again)

This reinstates part of commit 420f3474, fixing a mis-merge in
commit 8c0d5980.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoMerge branch 'dbus-1.10'
Ralf Habacker [Fri, 13 May 2016 13:32:44 +0000 (15:32 +0200)]
Merge branch 'dbus-1.10'

8 years agoPrefix debug messages displayed with _dbus_verbose() with a timestamp.
Ralf Habacker [Wed, 11 May 2016 06:06:04 +0000 (08:06 +0200)]
Prefix debug messages displayed with _dbus_verbose() with a timestamp.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=95191
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoDisplay thread id in _dbus_verbose to be able to see threading issues.
Ralf Habacker [Tue, 10 May 2016 14:51:25 +0000 (16:51 +0200)]
Display thread id in _dbus_verbose to be able to see threading issues.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=95191
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoOn Windows make access to member 'refcount' of struct DBusBabysitter thread safe.
Ralf Habacker [Tue, 10 May 2016 14:53:57 +0000 (16:53 +0200)]
On Windows make access to member 'refcount' of struct DBusBabysitter thread safe.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=95191
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoEliminates a race condition accessing DBusBabysitter instance at startup of babysitte...
Ralf Habacker [Thu, 12 May 2016 22:56:42 +0000 (00:56 +0200)]
Eliminates a race condition accessing DBusBabysitter instance at startup of babysitter() on Windows.

Ensure that the babysitter thread already owns its one reference to the
babysitter when it starts up, and eliminates the race condition.
This patch requires that DBusBabysitter refcounting is thread-safe
and is based on an analysis and proposal of Simon Mc Vittie.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=95191
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoFix memory leak in _dbus_replace_install_prefix() on success case on Windows.
Ralf Habacker [Mon, 9 May 2016 21:38:21 +0000 (23:38 +0200)]
Fix memory leak in _dbus_replace_install_prefix() on success case on Windows.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=95191
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoMerge branch 'dbus-1.10'
Ralf Habacker [Mon, 9 May 2016 19:50:56 +0000 (21:50 +0200)]
Merge branch 'dbus-1.10'

8 years agoSuppress Windows popups and jit debugger when app crashes with exception.
Ralf Habacker [Mon, 9 May 2016 15:31:17 +0000 (17:31 +0200)]
Suppress Windows popups and jit debugger when app crashes with exception.

Based on a patch from Yiyang Fei.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=95155
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agosysdeps: increase listen() backlog of AF_UNIX sockets to SOMAXCONN
Lennart Poettering [Wed, 4 May 2016 16:06:17 +0000 (18:06 +0200)]
sysdeps: increase listen() backlog of AF_UNIX sockets to SOMAXCONN

Previously, the listen() backlog was set to an arbitrary 30. This means
that if dbus-daemon is overloaded only 30 more connections may be queued
by the kernel, before connect() fails with EAGAIN. (Note that EAGAIN !=
EINPROGRESS -- the latter is what is returned if a connection is queued
and being processed for asynchronous sockets; EAGAIN in this case is
really an error, that cannot be recovered from).

Most software simply sets SOMAXCONN as backlog for AF_UNIX sockets, to
allow queuing of as many connections as the kernel allows. SOMAXCONN is
128 on Linux, which is not particularly high, but at least higher than
30.

This patch changes dbus-daemon to do the same.

I noticed this when flooding dbus-daemon with a lot of connections,
where it pretty quickly ceased to respond, much earlier than it really
should.

Note that the backlog has nothing to do with the number of concurrent
connections allowed, it simply controls how many queued, but not
accept()ed connections there may be on the listening socket.

https://bugs.freedesktop.org/show_bug.cgi?id=95264

8 years agoMerge branch 'dbus-1.10'
Ralf Habacker [Mon, 2 May 2016 05:19:41 +0000 (07:19 +0200)]
Merge branch 'dbus-1.10'

8 years agoFix crash in test-spawn unit test app on Windows.
Yiyang Fei [Wed, 27 Apr 2016 15:10:06 +0000 (08:10 -0700)]
Fix crash in test-spawn unit test app on Windows.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=95160
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoFix assert in test-spawn caused by missing initialization of DBusError instance on...
Ralf Habacker [Fri, 29 Apr 2016 07:47:51 +0000 (09:47 +0200)]
Fix assert in test-spawn caused by missing initialization of DBusError instance on gcc builds.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=95160
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
(cherry picked from commit 9323a621e868d6a5b628b89696b1efe0300ff939)

8 years agoFix assert in test-spawn caused by missing initialization of DBusError instance on...
Ralf Habacker [Fri, 29 Apr 2016 07:47:51 +0000 (09:47 +0200)]
Fix assert in test-spawn caused by missing initialization of DBusError instance on gcc builds.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=95160
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agodbus_internal_do_not_use_try_message_data: Calling _dbus_message_loader_get_max_messa...
Ralf Habacker [Thu, 14 Apr 2016 11:58:13 +0000 (13:58 +0200)]
dbus_internal_do_not_use_try_message_data: Calling _dbus_message_loader_get_max_message_size(loader) is only useful for its return value, which is ignored (CID 54725).

Reported by Coverity: CID 54725: Useless call (USELESS_CALL)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021

8 years ago1.11.3
Simon McVittie [Mon, 7 Mar 2016 20:54:05 +0000 (20:54 +0000)]
1.11.3

8 years ago1.11.2
Simon McVittie [Mon, 7 Mar 2016 19:36:01 +0000 (19:36 +0000)]
1.11.2

8 years agoMerge branch 'dbus-1.10'
Simon McVittie [Mon, 7 Mar 2016 19:33:04 +0000 (19:33 +0000)]
Merge branch 'dbus-1.10'

8 years ago1.10.9
Simon McVittie [Mon, 7 Mar 2016 19:31:52 +0000 (19:31 +0000)]
1.10.9

8 years ago1.10.8
Simon McVittie [Mon, 7 Mar 2016 16:07:20 +0000 (16:07 +0000)]
1.10.8

Signed-off-by: Simon McVittie <smcv@debian.org>
8 years agoMerge branch 'dbus-1.10-ci'
Simon McVittie [Thu, 3 Mar 2016 07:31:42 +0000 (07:31 +0000)]
Merge branch 'dbus-1.10-ci'

8 years agoDisable travis-ci apt source for Google Chrome
Simon McVittie [Wed, 2 Mar 2016 22:26:47 +0000 (22:26 +0000)]
Disable travis-ci apt source for Google Chrome

This prevents adding i386 as a foreign architecture. We don't need
Chrome anyway.

Signed-off-by: Simon McVittie <smcv@debian.org>
8 years agoUpdate NEWS for 1.11.2
Simon McVittie [Wed, 2 Mar 2016 19:15:07 +0000 (19:15 +0000)]
Update NEWS for 1.11.2

8 years agoMerge branch 'dbus-1.10'
Simon McVittie [Wed, 2 Mar 2016 19:00:00 +0000 (19:00 +0000)]
Merge branch 'dbus-1.10'

8 years agoMerge branch 'dbus-1.10' into dbus-1.10-ci
Simon McVittie [Wed, 2 Mar 2016 18:52:34 +0000 (18:52 +0000)]
Merge branch 'dbus-1.10' into dbus-1.10-ci

8 years agoupdate NEWS
Simon McVittie [Wed, 2 Mar 2016 18:24:11 +0000 (18:24 +0000)]
update NEWS

8 years agodbus-test-tool echo: fix sleep documentation
Dmitri Iouchtchenko [Mon, 22 Feb 2016 04:50:49 +0000 (23:50 -0500)]
dbus-test-tool echo: fix sleep documentation

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=94244
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoStatically assert that the DBusMessageIter struct has no padding
Simon McVittie [Mon, 15 Feb 2016 13:52:52 +0000 (13:52 +0000)]
Statically assert that the DBusMessageIter struct has no padding

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Thiago Macieira <thiago@kde.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=94136

8 years agoDBusMessageIter: eliminate padding on 64-bit platforms
Simon McVittie [Mon, 15 Feb 2016 15:00:22 +0000 (15:00 +0000)]
DBusMessageIter: eliminate padding on 64-bit platforms

Previously, 64-bit (LP64 or LLP64) platforms would have had 32 bits
of padding between pad2 and pad3. We want to guarantee that an ISO C
compiler will copy the entire struct when assigning between structs,
but padding is not guaranteed to be copied, so we want to ensure that
the struct is "packed".

Statically assert that the old ABI is compatible with the new ABI.

Reviewed-by: Thiago Macieira <thiago@kde.org>
[smcv: change >= to == as Thiago requested]
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=94136

8 years agoDBusMessage: assert the properties we need DBusMessageIter to have
Simon McVittie [Mon, 15 Feb 2016 14:58:59 +0000 (14:58 +0000)]
DBusMessage: assert the properties we need DBusMessageIter to have

We already asserted that DBusMessageIter must be at least as large
as DBusMessageRealIter (so that casting DBusMessageIter * to
DBusMessageRealIter * does not result in overflowing the stack
variable). Also assert that it must have alignment requirements at
least as strict as those of DBusMessageRealIter * (so that casting
does not increase the required alignment).

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Thiago Macieira <thiago@kde.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=94136

8 years agodbus-internals: add _DBUS_ALIGNOF
Simon McVittie [Mon, 15 Feb 2016 13:45:49 +0000 (13:45 +0000)]
dbus-internals: add _DBUS_ALIGNOF

This is useful when making static assertions about our types'
properties.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Thiago Macieira <thiago@kde.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=94136

8 years agoNEWS so far
Simon McVittie [Wed, 24 Feb 2016 10:50:22 +0000 (10:50 +0000)]
NEWS so far

8 years agoMove _dbus_hash_table_{to,from}_array out of #ifdef DBUS_ENABLE_EMBEDDED_TESTS
Simon McVittie [Fri, 12 Feb 2016 15:39:36 +0000 (15:39 +0000)]
Move _dbus_hash_table_{to,from}_array out of #ifdef DBUS_ENABLE_EMBEDDED_TESTS

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoMerge branch 'dbus-1.10' into dbus-1.10-ci
Simon McVittie [Fri, 12 Feb 2016 15:32:38 +0000 (15:32 +0000)]
Merge branch 'dbus-1.10' into dbus-1.10-ci

8 years agoAdd new functions _dbus_hash_table_to_array() and _dbus_hash_table_from_array() from...
Ralf Habacker [Tue, 9 Feb 2016 14:23:39 +0000 (15:23 +0100)]
Add new functions _dbus_hash_table_to_array() and _dbus_hash_table_from_array() from related activation code.

These functions are required for dbus-run-session.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92899
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoRename function string_array_length() to _dbus_string_array_length() and move it...
Ralf Habacker [Fri, 27 Nov 2015 11:10:54 +0000 (12:10 +0100)]
Rename function string_array_length() to _dbus_string_array_length() and move it to dbus-internals.c.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92899
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoname-test: run most C tests directly, not via run-test.sh
Simon McVittie [Mon, 8 Feb 2016 20:32:34 +0000 (20:32 +0000)]
name-test: run most C tests directly, not via run-test.sh

The exception is test-autolaunch, which is really not particularly
useful as a build-time test. The only way we can really test
autolaunch is as a whole-system integration test, and "make check"
is not that.

The two tests written in Python and one test based on dbus-send
are also not run directly yet; in particular, that includes both
the tests in run-test-systemserver.sh.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92899
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agoname-test C tests: produce structured (TAP) output
Simon McVittie [Mon, 8 Feb 2016 20:28:21 +0000 (20:28 +0000)]
name-test C tests: produce structured (TAP) output

Similar to commit 58eefa1031e14cb402ed0aae85e6bce1ba030a28.

test-privserver is a helper executable, not a test. I moved its output
from stdout to stderr so it can't be misinterpreted as the test's
stdout.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92899
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agoReplace $DBUS_USE_TEST_BINARY with $DBUS_TEST_DBUS_LAUNCH
Simon McVittie [Mon, 8 Feb 2016 20:09:58 +0000 (20:09 +0000)]
Replace $DBUS_USE_TEST_BINARY with $DBUS_TEST_DBUS_LAUNCH

Instead of using $DBUS_USE_TEST_BINARY to control whether to use the
hard-coded test binary TEST_BUS_LAUNCH_BINARY, we can just use
$DBUS_TEST_DBUS_LAUNCH to control what we launch directly, as we
were already doing for $DBUS_TEST_DAEMON.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92899
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agoMerge branch 'dbus-1.10'
Simon McVittie [Fri, 12 Feb 2016 15:26:00 +0000 (15:26 +0000)]
Merge branch 'dbus-1.10'

8 years agoRevert "Replace $DBUS_USE_TEST_BINARY with $DBUS_TEST_DBUS_LAUNCH"
Simon McVittie [Fri, 12 Feb 2016 15:25:15 +0000 (15:25 +0000)]
Revert "Replace $DBUS_USE_TEST_BINARY with $DBUS_TEST_DBUS_LAUNCH"

This reverts commit 8fd2be6013e3d0ff6a6ff63ea022f9606d9a87c6.
This change was intended for 1.11.

8 years agoRevert "name-test C tests: produce structured (TAP) output"
Simon McVittie [Fri, 12 Feb 2016 15:25:13 +0000 (15:25 +0000)]
Revert "name-test C tests: produce structured (TAP) output"

This reverts commit fec99c9b3d8318e3abae432f2aca50802a87f90e.
This change was intended for 1.11.

8 years agoRevert "name-test: run most C tests directly, not via run-test.sh"
Simon McVittie [Fri, 12 Feb 2016 15:25:12 +0000 (15:25 +0000)]
Revert "name-test: run most C tests directly, not via run-test.sh"

This reverts commit d893121efdea39d2b32037b32e336ea483829b2e.
This change was intended for 1.11.

8 years agoRevert "Rename function string_array_length() to _dbus_string_array_length() and...
Simon McVittie [Fri, 12 Feb 2016 15:25:09 +0000 (15:25 +0000)]
Revert "Rename function string_array_length() to _dbus_string_array_length() and move it to dbus-internals.c."

This reverts commit 1370b44035da90a7fbcebea17074c66c832de0b1.
This change was intended for 1.11.

8 years agoRevert "Add new functions _dbus_hash_table_to_array() and _dbus_hash_table_from_array...
Simon McVittie [Fri, 12 Feb 2016 15:24:55 +0000 (15:24 +0000)]
Revert "Add new functions _dbus_hash_table_to_array() and _dbus_hash_table_from_array() from related activation code."

This reverts commit 610ff8d9646c1bb944bc5e56f22750f1754b308e.
This change was intended for 1.11.

8 years agoAdd new functions _dbus_hash_table_to_array() and _dbus_hash_table_from_array() from...
Ralf Habacker [Tue, 9 Feb 2016 14:23:39 +0000 (15:23 +0100)]
Add new functions _dbus_hash_table_to_array() and _dbus_hash_table_from_array() from related activation code.

These functions are required for dbus-run-session.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92899
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoEnable -Wpointer-sign warnings for autotools and cmake.
Ralf Habacker [Thu, 26 Nov 2015 14:03:56 +0000 (15:03 +0100)]
Enable -Wpointer-sign warnings for autotools and cmake.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93069
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoKeep cmake gcc builds in sync with autotools warnings.
Ralf Habacker [Thu, 26 Nov 2015 14:02:51 +0000 (15:02 +0100)]
Keep cmake gcc builds in sync with autotools warnings.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93069
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoRefactored cmake part dealing with compiler warnings to use warnings identifier.
Ralf Habacker [Thu, 26 Nov 2015 14:00:59 +0000 (15:00 +0100)]
Refactored cmake part dealing with compiler warnings to use warnings identifier.

It is now possible to use msvc warnings identifiers
(e.g. '4114') or gcc warnings keys (e.g. 'pointer-sign').

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93069
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoAdd missing include
hyeric [Thu, 11 Feb 2016 17:11:48 +0000 (18:11 +0100)]
Add missing include

  - included <dbus/dbus.h> for dbus_bool_t

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=94094
[smcv: use conventional spacing]
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoRename function string_array_length() to _dbus_string_array_length() and move it...
Ralf Habacker [Fri, 27 Nov 2015 11:10:54 +0000 (12:10 +0100)]
Rename function string_array_length() to _dbus_string_array_length() and move it to dbus-internals.c.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92899
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoname-test: run most C tests directly, not via run-test.sh
Simon McVittie [Mon, 8 Feb 2016 20:32:34 +0000 (20:32 +0000)]
name-test: run most C tests directly, not via run-test.sh

The exception is test-autolaunch, which is really not particularly
useful as a build-time test. The only way we can really test
autolaunch is as a whole-system integration test, and "make check"
is not that.

The two tests written in Python and one test based on dbus-send
are also not run directly yet; in particular, that includes both
the tests in run-test-systemserver.sh.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92899
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agoname-test C tests: produce structured (TAP) output
Simon McVittie [Mon, 8 Feb 2016 20:28:21 +0000 (20:28 +0000)]
name-test C tests: produce structured (TAP) output

Similar to commit 58eefa1031e14cb402ed0aae85e6bce1ba030a28.

test-privserver is a helper executable, not a test. I moved its output
from stdout to stderr so it can't be misinterpreted as the test's
stdout.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92899
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agoReplace $DBUS_USE_TEST_BINARY with $DBUS_TEST_DBUS_LAUNCH
Simon McVittie [Mon, 8 Feb 2016 20:09:58 +0000 (20:09 +0000)]
Replace $DBUS_USE_TEST_BINARY with $DBUS_TEST_DBUS_LAUNCH

Instead of using $DBUS_USE_TEST_BINARY to control whether to use the
hard-coded test binary TEST_BUS_LAUNCH_BINARY, we can just use
$DBUS_TEST_DBUS_LAUNCH to control what we launch directly, as we
were already doing for $DBUS_TEST_DAEMON.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92899
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years ago_dbus_read_socket_with_unix_fds: make n_fds unsigned
Simon McVittie [Wed, 10 Feb 2016 13:05:40 +0000 (13:05 +0000)]
_dbus_read_socket_with_unix_fds: make n_fds unsigned

This makes it consistent with _dbus_message_loader_get_unix_fds().

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93069
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agoAppArmor: do not mix dbus_bool_t with int
Simon McVittie [Wed, 10 Feb 2016 13:15:56 +0000 (13:15 +0000)]
AppArmor: do not mix dbus_bool_t with int

libdbus uses dbus_bool_t for booleans; that type is unsigned 32-bit.
However, libapparmor uses int, which is signed, leading to
-Wpointer-sign warnings when we pass a dbus_bool_t * where an int *
was expected.

This file is Linux-specific, and all Linux platforms have 32-bit int
and an in-memory representation of the integers 0 and 1 that is
independent of signedness, so the previous code was harmless
in practice.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93069
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agostring_squash_nonprintable: correct signedness mismatch
Simon McVittie [Wed, 10 Feb 2016 13:11:54 +0000 (13:11 +0000)]
string_squash_nonprintable: correct signedness mismatch

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93069
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agoConsistently use socklen_t for getsockname, getsockopt etc.
Simon McVittie [Wed, 10 Feb 2016 13:11:28 +0000 (13:11 +0000)]
Consistently use socklen_t for getsockname, getsockopt etc.

This fixes signedness mismatch warnings on platforms where socklen_t
is unsigned, notably Linux (where it's an unsigned int).

We still use int for the fallback case where the platform does not
define socklen_t, because that was the traditional (pre-POSIX) type:
for details see NOTES in Linux accept(2),
<http://manpages.debian.org/cgi-bin/man.cgi?query=accept&sektion=2>.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93069
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agoDo not require binfmt support for running cross compiled test applications.
Ralf Habacker [Mon, 8 Feb 2016 22:16:23 +0000 (23:16 +0100)]
Do not require binfmt support for running cross compiled test applications.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88966
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoMerge branch 'dbus-1.10'
Simon McVittie [Mon, 8 Feb 2016 19:21:13 +0000 (19:21 +0000)]
Merge branch 'dbus-1.10'

8 years agoMerge branch 'dbus-1.10' into dbus-1.10-ci
Simon McVittie [Mon, 8 Feb 2016 19:21:02 +0000 (19:21 +0000)]
Merge branch 'dbus-1.10' into dbus-1.10-ci

8 years agomarshal-validate: run all the tests instead of just the even ones
Nick Lewycky [Thu, 28 Jan 2016 20:24:56 +0000 (12:24 -0800)]
marshal-validate: run all the tests instead of just the even ones

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93908
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
[smcv: Re-enable the failing test that Nick disabled, and fix the
expected result; the result given by our current implementation is
reasonable.]

8 years agoMerge branch 'dbus-1.10' into dbus-1.10-ci
Simon McVittie [Mon, 8 Feb 2016 17:35:51 +0000 (17:35 +0000)]
Merge branch 'dbus-1.10' into dbus-1.10-ci

8 years agoMerge branch 'dbus-1.10'
Simon McVittie [Mon, 8 Feb 2016 17:25:48 +0000 (17:25 +0000)]
Merge branch 'dbus-1.10'

8 years agoconfigure.ac: support large-file for stat64
Simon McVittie [Mon, 8 Feb 2016 17:25:38 +0000 (17:25 +0000)]
configure.ac: support large-file for stat64

dbus-daemon is not expected to open files with large *sizes*, but without
large file support, calling [f]stat() on a file that happens to have a
large inode number will fail with EOVERFLOW (see stat(2)). For example,
files mounted from an NFS server might have large inode numbers.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93545
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
[smcv: shorten and clarify commit message; move AC_SYS_LARGEFILE
after AC_USE_SYSTEM_EXTENSIONS because nothing should compile C before
that point]
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoMerge branch 'dbus-1.10'
Simon McVittie [Mon, 25 Jan 2016 15:06:43 +0000 (15:06 +0000)]
Merge branch 'dbus-1.10'

8 years agoMerge branch 'dbus-1.10' into dbus-1.10-ci
Simon McVittie [Mon, 25 Jan 2016 15:06:18 +0000 (15:06 +0000)]
Merge branch 'dbus-1.10' into dbus-1.10-ci

8 years agotest/name-test/run-test.sh: output correct result if a C test fails
Simon McVittie [Tue, 15 Dec 2015 17:23:00 +0000 (17:23 +0000)]
test/name-test/run-test.sh: output correct result if a C test fails

Loosely based on a patch from amit tewari.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93379
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years ago1.11.1
Simon McVittie [Wed, 2 Dec 2015 23:53:20 +0000 (23:53 +0000)]
1.11.1

8 years ago1.11.0
Simon McVittie [Wed, 2 Dec 2015 21:03:07 +0000 (21:03 +0000)]
1.11.0

8 years agoUpdate NEWS
Simon McVittie [Wed, 2 Dec 2015 20:54:37 +0000 (20:54 +0000)]
Update NEWS

8 years agoMerge branch 'dbus-1.10-ci'
Simon McVittie [Wed, 2 Dec 2015 18:51:57 +0000 (18:51 +0000)]
Merge branch 'dbus-1.10-ci'

No actual change; this is just to mark the conflicts as resolved.

8 years agoadd travis-ci.org build machinery
Simon McVittie [Tue, 1 Dec 2015 17:31:18 +0000 (17:31 +0000)]
add travis-ci.org build machinery

The idea is that .travis.yml is specific to Travis-CI, but most of the
actual work is done in tools/ci-build.sh, which should be reasonably
CI-platform-agnostic (it currently assumes that build-dependendencies are
preinstalled, that the "native" platform we're building on is GNU/Linux
or something very close, and that "mingw" means mingw-w64 as packaged
in Debian and Ubuntu).

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93194
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agoDon't try to run manual tests in installcheck
Simon McVittie [Fri, 27 Nov 2015 12:46:52 +0000 (12:46 +0000)]
Don't try to run manual tests in installcheck

We were mistakenly running all installed executables, even manual tests
that never terminate.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93194
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agoFix shell syntax for installcheck-local with no DESTDIR
Simon McVittie [Fri, 27 Nov 2015 11:50:57 +0000 (11:50 +0000)]
Fix shell syntax for installcheck-local with no DESTDIR

A closing brace must be preceded by a semicolon. The CI integration
added later in this branch actually runs "make installcheck"
with no DESTDIR; apparently nobody else has ever tried that.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93194
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agoDo not require systemd to have a service file if using it for activation
Simon McVittie [Fri, 27 Nov 2015 11:31:03 +0000 (11:31 +0000)]
Do not require systemd to have a service file if using it for activation

With --systemd-activation we special-case the name
org.freedesktop.systemd1 by assuming that it will eventually connect
to the bus. With that in mind, we can ignore whether it has a
.service file, and let it be "activated" regardless.

This fixes a regression test failure on non-systemd systems such
as the Ubuntu 14.04 OS on travis-ci.org: UpdateActivationEnvironment
failed, because it tried to update the (fake) systemd environment,
but because systemd was not actually installed, there was no
service file for it in the system's search paths. We could address this
by placing a dummy service file with Exec=/bin/false in our search path
like the real systemd does, but it seems cleaner to not require this;
this would eventually enable the real systemd to stop installing
that dummy service file.

This would not happen outside the regression tests, because there is
no sense in using --systemd-activation without systemd installed.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93194
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years ago_dbus_test_oom_handling: allow disabling it as documented
Simon McVittie [Tue, 24 Nov 2015 09:21:12 +0000 (09:21 +0000)]
_dbus_test_oom_handling: allow disabling it as documented

We documented DBUS_TEST_MALLOC_FAILURES=0 in HACKING, but it didn't
actually work: we'd iterate from i=-1 to i=0.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93194
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agocmake: run all automated tests with --tap for better diagnostics
Simon McVittie [Tue, 24 Nov 2015 01:19:55 +0000 (01:19 +0000)]
cmake: run all automated tests with --tap for better diagnostics

For GLib-based tests it's useful, because it means g_test_message()
gets logged. For the embedded tests it's now accepted and ignored.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93194
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agoembedded tests: accept and ignore --tap argument
Simon McVittie [Tue, 24 Nov 2015 01:19:27 +0000 (01:19 +0000)]
embedded tests: accept and ignore --tap argument

This makes them semi-command-line-compatible with a way we can
invoke the GLib-based tests to get more useful debug logs.

These tests still do not actually produce TAP output yet; I tried
implementing that, but it requires changing a lot of noise on stdout
to come out of stderr, and there was something weird going on with
subprocesses restarting the test numbering which will need further
investigation before making that change.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93194
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agocmake: copy the systemd-activation directory too
Simon McVittie [Tue, 24 Nov 2015 01:17:53 +0000 (01:17 +0000)]
cmake: copy the systemd-activation directory too

It is needed for a couple of test-cases.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93194
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agocmake: manual-tcp is not an automated test
Simon McVittie [Tue, 24 Nov 2015 01:17:29 +0000 (01:17 +0000)]
cmake: manual-tcp is not an automated test

Don't run it when we run automated tests.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93194
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
[smcv: backport to dbus-1.10]

8 years agoAvoid -Wunused-label when compiling with libselinux but no libaudit
Simon McVittie [Sat, 21 Nov 2015 23:30:34 +0000 (23:30 +0000)]
Avoid -Wunused-label when compiling with libselinux but no libaudit

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93194
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agoadd travis-ci.org build machinery
Simon McVittie [Tue, 1 Dec 2015 17:31:18 +0000 (17:31 +0000)]
add travis-ci.org build machinery

The idea is that .travis.yml is specific to Travis-CI, but most of the
actual work is done in tools/ci-build.sh, which should be reasonably
CI-platform-agnostic (it currently assumes that build-dependendencies are
preinstalled, that the "native" platform we're building on is GNU/Linux
or something very close, and that "mingw" means mingw-w64 as packaged
in Debian and Ubuntu).

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93194
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agoDon't try to run manual tests in installcheck
Simon McVittie [Fri, 27 Nov 2015 12:46:52 +0000 (12:46 +0000)]
Don't try to run manual tests in installcheck

We were mistakenly running all installed executables, even manual tests
that never terminate.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93194
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agoFix shell syntax for installcheck-local with no DESTDIR
Simon McVittie [Fri, 27 Nov 2015 11:50:57 +0000 (11:50 +0000)]
Fix shell syntax for installcheck-local with no DESTDIR

A closing brace must be preceded by a semicolon. The CI integration
added later in this branch actually runs "make installcheck"
with no DESTDIR; apparently nobody else has ever tried that.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93194
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agoDo not require systemd to have a service file if using it for activation
Simon McVittie [Fri, 27 Nov 2015 11:31:03 +0000 (11:31 +0000)]
Do not require systemd to have a service file if using it for activation

With --systemd-activation we special-case the name
org.freedesktop.systemd1 by assuming that it will eventually connect
to the bus. With that in mind, we can ignore whether it has a
.service file, and let it be "activated" regardless.

This fixes a regression test failure on non-systemd systems such
as the Ubuntu 14.04 OS on travis-ci.org: UpdateActivationEnvironment
failed, because it tried to update the (fake) systemd environment,
but because systemd was not actually installed, there was no
service file for it in the system's search paths. We could address this
by placing a dummy service file with Exec=/bin/false in our search path
like the real systemd does, but it seems cleaner to not require this;
this would eventually enable the real systemd to stop installing
that dummy service file.

This would not happen outside the regression tests, because there is
no sense in using --systemd-activation without systemd installed.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93194
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years ago_dbus_test_oom_handling: allow disabling it as documented
Simon McVittie [Tue, 24 Nov 2015 09:21:12 +0000 (09:21 +0000)]
_dbus_test_oom_handling: allow disabling it as documented

We documented DBUS_TEST_MALLOC_FAILURES=0 in HACKING, but it didn't
actually work: we'd iterate from i=-1 to i=0.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93194
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agocmake: run all automated tests with --tap for better diagnostics
Simon McVittie [Tue, 24 Nov 2015 01:19:55 +0000 (01:19 +0000)]
cmake: run all automated tests with --tap for better diagnostics

For GLib-based tests it's useful, because it means g_test_message()
gets logged. For the embedded tests it's now accepted and ignored.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93194
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agoembedded tests: accept and ignore --tap argument
Simon McVittie [Tue, 24 Nov 2015 01:19:27 +0000 (01:19 +0000)]
embedded tests: accept and ignore --tap argument

This makes them semi-command-line-compatible with a way we can
invoke the GLib-based tests to get more useful debug logs.

These tests still do not actually produce TAP output yet; I tried
implementing that, but it requires changing a lot of noise on stdout
to come out of stderr, and there was something weird going on with
subprocesses restarting the test numbering which will need further
investigation before making that change.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93194
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agocmake: copy the systemd-activation directory too
Simon McVittie [Tue, 24 Nov 2015 01:17:53 +0000 (01:17 +0000)]
cmake: copy the systemd-activation directory too

It is needed for a couple of test-cases.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93194
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agocmake: manual-tcp is not an automated test
Simon McVittie [Tue, 24 Nov 2015 01:17:29 +0000 (01:17 +0000)]
cmake: manual-tcp is not an automated test

Don't run it when we run automated tests.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93194
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agoAvoid -Wunused-label when compiling with libselinux but no libaudit
Simon McVittie [Sat, 21 Nov 2015 23:30:34 +0000 (23:30 +0000)]
Avoid -Wunused-label when compiling with libselinux but no libaudit

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93194
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agoAdd linking to dbghelp for autotools on Windows which is required for backtrace gener...
Ralf Habacker [Fri, 27 Nov 2015 12:30:55 +0000 (13:30 +0100)]
Add linking to dbghelp for autotools on Windows which is required for backtrace generator.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoInitialize SELinux and Apparmor after capabilities are set
Laurent Bigonville [Tue, 17 Nov 2015 20:47:05 +0000 (21:47 +0100)]
Initialize SELinux and Apparmor after capabilities are set

avc_init() in the SELinux code path is creating a new thread, we need to
set to capabilities before it gets created so it has the permission to
send audit messages.

It also make more sense to open the audit netlink before the different
logging callbacks are set.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92832
[smcv: add comments explaining why initialization must happen in this
specific order]
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoMerge branch 'dbus-1.10'
Simon McVittie [Tue, 1 Dec 2015 21:37:48 +0000 (21:37 +0000)]
Merge branch 'dbus-1.10'

8 years ago1.10.7
Simon McVittie [Tue, 1 Dec 2015 21:36:02 +0000 (21:36 +0000)]
1.10.7

8 years ago1.10.6 dbus-1.10.6
Simon McVittie [Tue, 1 Dec 2015 18:19:17 +0000 (18:19 +0000)]
1.10.6

8 years agoDo not attempt to call child_setup on Windows
Simon McVittie [Thu, 26 Nov 2015 10:37:48 +0000 (10:37 +0000)]
Do not attempt to call child_setup on Windows

child_setup() is defined to be called after fork() and before exec(),
but Windows' process model does not have fork(): the equivalent of
those two operations is a single CreateProcess() call. This means
that there is no point at which we could call child_setup() and
have it affect only the child's process-global state. At the point
where it is currently executed, it affects the parent's process-global
state instead, which would be actively harmful if we used any
child_setup() function that was not a no-op on Windows.

The equivalent function in GLib, g_spawn_async_with_pipes(), documents
child_setup() as unused on Windows. Do the same here.

In practice, our only use of child_setup() outside tests
is #ifdef DBUS_UNIX anyway, so this change has no practical effect
right now.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=85857
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>