platform/upstream/dbus.git
8 years agotest-segfault: add missing include of <stdio.h> on Windows
Simon McVittie [Mon, 16 May 2016 13:10:36 +0000 (14:10 +0100)]
test-segfault: add missing include of <stdio.h> on Windows

Needed for fprintf (stderr, ...).

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
(cherry picked from commit 07b7dcd7178f927cd0b3a3282396b7f99c0b1d29)

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 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 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 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 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 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 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 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 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 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 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.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 agoNEWS for 1.10 branch
Simon McVittie [Mon, 23 Nov 2015 21:10:09 +0000 (21:10 +0000)]
NEWS for 1.10 branch

8 years agouid-permissions test: don't assert that root can UpdateActivationEnvironment
Simon McVittie [Fri, 20 Nov 2015 17:19:51 +0000 (17:19 +0000)]
uid-permissions test: don't assert that root can UpdateActivationEnvironment

Since 1.10.4 this is hard-coded to be disallowed when an activation
helper is used. That would be a security flaw waiting to happen,
and makes little sense anyway, because the activation helper sanitises
its environment.

Use BecomeMonitor() instead, as our way to assert that root and
messagebus are privileged.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93036
Reviewed-by: Iain Lane
8 years agoname-test: don't run these tests with autotools if targeting Windows.
Simon McVittie [Tue, 17 Nov 2015 16:42:01 +0000 (16:42 +0000)]
name-test: don't run these tests with autotools if targeting Windows.

The wrapper shell script that sets up their environment is nowhere
near being portable. In particular, it uses dbus-run-session,
which is Unix-specific.

[rh: Add autotools scope in commit title]
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92899
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Rewieved-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agoWindows _dbus_get_autolaunch_address: don't leak shm_name
Simon McVittie [Wed, 18 Nov 2015 22:38:20 +0000 (23:38 +0100)]
Windows _dbus_get_autolaunch_address: don't leak shm_name

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92899
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years ago1.10.5
Simon McVittie [Tue, 17 Nov 2015 23:46:34 +0000 (23:46 +0000)]
1.10.5

8 years agodbus 1.10.4
Simon McVittie [Tue, 17 Nov 2015 21:40:36 +0000 (21:40 +0000)]
dbus 1.10.4

8 years agoNEWS
Simon McVittie [Tue, 17 Nov 2015 18:22:37 +0000 (18:22 +0000)]
NEWS

8 years agobus-driver: Support returning org.freedesktop.DBus UID and PID
Jan Alexander Steffens (heftig) [Sat, 14 Nov 2015 15:32:43 +0000 (16:32 +0100)]
bus-driver: Support returning org.freedesktop.DBus UID and PID

Attempting to call SetEnvironment on systemd causes it to inquire
about the caller's connection UID and PID. If this check fails,
the call is rejected.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92857
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
[smcv: go back to DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN as the error code
for failure to determine the pid]

8 years agotest/sd-activation: Test UpdateActivationEnvironment forwarding
Jan Alexander Steffens (heftig) [Sat, 14 Nov 2015 15:32:42 +0000 (16:32 +0100)]
test/sd-activation: Test UpdateActivationEnvironment forwarding

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92857
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agobus_driver_handle_update_activation_environment: Forward to systemd
Jan Alexander Steffens (heftig) [Sun, 15 Nov 2015 15:00:33 +0000 (16:00 +0100)]
bus_driver_handle_update_activation_environment: Forward to systemd

If we use systemd activation, forward all UpdateActivationEnvironment
requests to org.freedesktop.systemd1.Manager.SetEnvironment, in order
to ensure variables needed by D-Bus services are available when these
services are launched by systemd.

Since UpdateActivationEnvironment is not available on the system bus,
this only applies to user buses.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92857
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agobus_driver_handle_update_activation_environment: Error on system buses
Jan Alexander Steffens (heftig) [Sat, 14 Nov 2015 15:32:37 +0000 (16:32 +0100)]
bus_driver_handle_update_activation_environment: Error on system buses

The default policy already disallows calls on system buses. Since any
bus with a service helper cleans the environment anyway, there's no
point in allowing this to be called.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92857
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agofdpass test: assert that TCP connections don't say they can pass fds
Simon McVittie [Tue, 17 Nov 2015 13:23:30 +0000 (13:23 +0000)]
fdpass test: assert that TCP connections don't say they can pass fds

As well as slightly increasing our test coverage, this ensures
that at least one test-case in this test is not skipped, working
around CMake's lack of support for the Automake-style exit code
produced by GTest executables (they exit 77 if everything was skipped).

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92887
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agoFix recursive loop in backtrace generator on windows.
Ralf Habacker [Sun, 15 Nov 2015 18:54:03 +0000 (19:54 +0100)]
Fix recursive loop in backtrace generator on windows.

Backtrace generator called _dbus_warn(), which calls
backtrace generator recursively with DBUS_FATAL_WARNINGS=1.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoDo not fail with fatal message skipping GetConnectionUnixProcessID test-bus test...
Ralf Habacker [Fri, 13 Nov 2015 18:48:16 +0000 (19:48 +0100)]
Do not fail with fatal message skipping GetConnectionUnixProcessID test-bus test on windows.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoFix test-bus test for GetConnectionUnixUser driver method on windows.
Ralf Habacker [Fri, 13 Nov 2015 18:41:43 +0000 (19:41 +0100)]
Fix test-bus test for GetConnectionUnixUser driver method on windows.

Because GetConnectionUnixUser is not supported on windows it fails with
DBUS_ERROR_FAIL.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoSkip launch helper activation tests on windows silently.
Ralf Habacker [Thu, 12 Nov 2015 11:49:46 +0000 (12:49 +0100)]
Skip launch helper activation tests on windows silently.

The system bus is unsupported there and Windows does not
have any concept of setuid binaries, so it can't ever
actually work.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoFix memory leak in _dbus_win_set_error_from_win_error().
Ralf Habacker [Wed, 11 Nov 2015 14:02:44 +0000 (15:02 +0100)]
Fix memory leak in _dbus_win_set_error_from_win_error().

There is no need to make a local (leaked) copy of the message,
because dbus_set_error() already makes a copy of its parameters.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoFix memory leaks in bus_activation_service_reload_test() in case of errors.
Ralf Habacker [Wed, 11 Nov 2015 14:02:00 +0000 (15:02 +0100)]
Fix memory leaks in bus_activation_service_reload_test() in case of errors.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoRevert "Fix memory leaks in bus_activation_service_reload_test() in case of errors."
Ralf Habacker [Wed, 11 Nov 2015 14:01:11 +0000 (15:01 +0100)]
Revert "Fix memory leaks in bus_activation_service_reload_test() in case of errors."

This reverts commit d8569ac647da4d62c7a251d8e809f2d545a77837.

8 years agoFix memory leaks in bus_activation_service_reload_test() in case of errors.
Ralf Habacker [Mon, 9 Nov 2015 12:38:59 +0000 (13:38 +0100)]
Fix memory leaks in bus_activation_service_reload_test() in case of errors.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: https://bugs.freedesktop.org/show_bug.cgi?id=92721
8 years agoFix test-bus segfault_service_no_auto_start test on windows.
Ralf Habacker [Mon, 9 Nov 2015 19:38:03 +0000 (20:38 +0100)]
Fix test-bus segfault_service_no_auto_start test on windows.

Windows returns unhandled exceptions from a running child
by specific exit codes and not by signals as on UNIX.

Therefore we use DBUS_ERROR_SPAWN_CHILD_EXITED for propagating
unhandled exceptions to the parent too.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoupdate NEWS
Simon McVittie [Fri, 6 Nov 2015 17:26:40 +0000 (18:26 +0100)]
update NEWS

8 years agoFix test cases running client and server dispatch design issue.
Ralf Habacker [Fri, 6 Nov 2015 13:03:23 +0000 (14:03 +0100)]
Fix test cases running client and server dispatch design issue.

DBus test cases running the server *and* client loop in the same
process assumed that all messages send from the server has to be
received in one client dispatch, which is not the case in all
environments.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoFix bug unrefing connection too early in check_hello_message().
Ralf Habacker [Fri, 6 Nov 2015 13:02:29 +0000 (14:02 +0100)]
Fix bug unrefing connection too early in check_hello_message().

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoCompile fix on Windows.
Ralf Habacker [Wed, 4 Nov 2015 13:21:20 +0000 (14:21 +0100)]
Compile fix on Windows.

This commit fixes a regression introduced with commit 04b8a7a772cfa9ae8ea6ce452d1fb7f23e25fd3f.

8 years agoFix warning: variable 'ret' set but not used [-Wunused-but-set-variable].
Ralf Habacker [Mon, 2 Nov 2015 20:56:32 +0000 (21:56 +0100)]
Fix warning: variable 'ret' set but not used [-Wunused-but-set-variable].

Only set valid child status in case exit code has been gotten from
child process, otherwise signal failure through thread return value.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoTest system bus config files on Unix only
Ralf Habacker [Mon, 2 Nov 2015 23:23:56 +0000 (00:23 +0100)]
Test system bus config files on Unix only

Previously, we didn't consistently test parsing of every file in
valid-config-files-system/ everywhere that we tested valid-config-files/.
We now test it on Unix.

The system bus is not supported on Windows, so we do not test
valid-config-files-system/ there.

valid-config-files/many-rules.conf contains <user> and <group> rules
which are not applicable to Windows. Copy the original many-rules.conf
to valid-config-files-system/ so that it will be tested on Unix, and
remove the non-portable rules from valid-config-files/many-rules.conf.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
[rh:base patch came from Simon]

8 years agoDon't use _dbus_warn() for intentionally-skipped tests
Simon McVittie [Mon, 2 Nov 2015 18:19:02 +0000 (18:19 +0000)]
Don't use _dbus_warn() for intentionally-skipped tests

The tests are run with _dbus_warn() fatal, so if a particular test is
not applicable on the current platform, we shouldn't call it.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agotest_default_session_servicedirs: use the intended data directory
Simon McVittie [Mon, 2 Nov 2015 14:24:51 +0000 (14:24 +0000)]
test_default_session_servicedirs: use the intended data directory

If D-Bus was configured for /usr/local and built in Z:/build,
the previous code would use

    Z:/build/dbus/.libs/usr/local/share/dbus-1/services

whereas the intention was to replace the configured prefix /usr/local
with the detected location, more like

    Z:/build/dbus/.libs/share/dbus-1/services

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agotest_default_session_servicedirs: simplify to a single exit code-path
Simon McVittie [Mon, 2 Nov 2015 14:15:14 +0000 (14:15 +0000)]
test_default_session_servicedirs: simplify to a single exit code-path

A similar simplification was already done on master as part of commit
f830e14, Bug #83539.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agoFix warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement].
Ralf Habacker [Sat, 31 Oct 2015 20:06:04 +0000 (21:06 +0100)]
Fix warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement].

Includes minor indention fix.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoFix typo and missing eol on debug message.
Ralf Habacker [Sat, 31 Oct 2015 20:05:03 +0000 (21:05 +0100)]
Fix typo and missing eol on debug message.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92721
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agorefs test: reduce number of repeats under Wine
Simon McVittie [Thu, 29 Oct 2015 05:31:38 +0000 (06:31 +0100)]
refs test: reduce number of repeats under Wine

Under Wine, the API calls we use to do this are implemented via IPC
to wineserver, which makes it unreasonably slow to try to brute-force
bugs by having many threads stress-test refcounting. Do a few
repetitions just to verify that refcounting basically works, but
don't do the full stress-test.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92538
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
[rh: add WINESERVERSOCKET related hint]

8 years agoWhen running TAP tests, filter out trailing \r from Windows .exe
Simon McVittie [Mon, 19 Oct 2015 15:02:36 +0000 (16:02 +0100)]
When running TAP tests, filter out trailing \r from Windows .exe

If we're running Windows executables using Wine, then tap-driver.sh
won't accept "1..4\r\n" as TAP syntax.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92538
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agoFix crash running test-syslog on windows/wine.
Ralf Habacker [Tue, 3 Feb 2015 18:56:32 +0000 (19:56 +0100)]
Fix crash running test-syslog on windows/wine.

Use seperate buffer in _dbus_system_logv() to avoid crash in vsprintf().

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92538
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoDisplay autolaunch scope on verbose print of daemon found message on windows.
Ralf Habacker [Sun, 4 Oct 2015 08:33:32 +0000 (10:33 +0200)]
Display autolaunch scope on verbose print of daemon found message on windows.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92080
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years ago1.10.3
Simon McVittie [Mon, 26 Oct 2015 18:54:04 +0000 (18:54 +0000)]
1.10.3

8 years ago1.10.2
Simon McVittie [Mon, 26 Oct 2015 12:54:26 +0000 (12:54 +0000)]
1.10.2

8 years agoAdd a regression test for invalid BecomeMonitor calls
Simon McVittie [Mon, 19 Oct 2015 13:50:37 +0000 (14:50 +0100)]
Add a regression test for invalid BecomeMonitor calls

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

8 years agoNEWS
Simon McVittie [Mon, 26 Oct 2015 12:05:09 +0000 (12:05 +0000)]
NEWS

8 years agouser dbus.socket: Set DBUS_SESSION_BUS_ADDRESS
Jan Alexander Steffens (heftig) [Thu, 22 Oct 2015 17:50:29 +0000 (19:50 +0200)]
user dbus.socket: Set DBUS_SESSION_BUS_ADDRESS

As discussed in <https://github.com/systemd/systemd/issues/1600>.
See also <https://bugs.archlinux.org/task/46721>,
<https://bugzilla.gnome.org/show_bug.cgi?id=756420>

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92612
[smcv: use AC_PATH_PROG to find systemctl; ignore systemctl failure]
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
[smcv: add links to earlier bug reports elsewhere]

8 years agoWhen running dbus-daemon --session in tests, override listen address
Simon McVittie [Mon, 19 Oct 2015 14:19:27 +0000 (15:19 +0100)]
When running dbus-daemon --session in tests, override listen address

Otherwise, we can't reliably run tests for Windows, because the default
listening address on Windows is "autolaunch:" which is global to
a machine, resulting in testing an installed dbus-daemon instead of
the one we intended to test.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92538
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agoDisable activation tests on Windows builds
Simon McVittie [Mon, 19 Oct 2015 14:18:02 +0000 (15:18 +0100)]
Disable activation tests on Windows builds

These rely on the --systemd-activation code path, which is not
compiled for Windows.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92538
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agoKeep cmake build system in sync with autotools (add test-monitor).
Ralf Habacker [Wed, 21 Oct 2015 11:19:48 +0000 (13:19 +0200)]
Keep cmake build system in sync with autotools (add test-monitor).

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92298
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoNEWS
Simon McVittie [Mon, 19 Oct 2015 15:37:34 +0000 (16:37 +0100)]
NEWS

8 years agoBecomeMonitor: do not overwrite error with another error
Simon McVittie [Tue, 6 Oct 2015 11:43:22 +0000 (12:43 +0100)]
BecomeMonitor: do not overwrite error with another error

If the user gave us a syntactically invalid error name, we'd
overwrite the MatchRuleInvalid error with NoMemory, causing an
assertion failure (crash) in the dbus-daemon.

This is not a denial-of-service vulnerability on the system bus,
because monitoring is a privileged action, and root privilege
is checked before this code is reached. However, it's an annoying
bug on the session bus.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92298
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoNEWS
Simon McVittie [Fri, 2 Oct 2015 10:51:40 +0000 (11:51 +0100)]
NEWS

8 years agoOn Windows, load local configuration relative to bus setup
Simon McVittie [Thu, 1 Oct 2015 18:17:49 +0000 (19:17 +0100)]
On Windows, load local configuration relative to bus setup

This makes an installed tree with

    /some-prefix/
        etc/
            dbus-1/
                session-local.conf
        share/
            dbus-1/
                session.conf

relocatable to any location.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92028
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Tested-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agoCancel pending activation on any activation error
Simon McVittie [Wed, 30 Sep 2015 16:15:53 +0000 (17:15 +0100)]
Cancel pending activation on any activation error

This fixes the error reporting if you make two attempts
to activate a service that cannot be activated due to an
error that is reported synchronously, such as a system
service with no User= line in its .service file.

This is easy to reproduce with the gdbus(1) tool, which
sends an Introspect call in addition to the one you asked
it to. If you try to activate a service using

gdbus call --session -d com.example.FailToActivate \
    -o / -m org.freedesktop.DBus.Peer.Ping

then gdbus will actually send two method calls: one
Introspect, and one Ping. The Introspect gets the correct
error reply, but when dbus-daemon enters
bus_activation_activate_service() for the Ping call, it
sees that there is a pending activation and does an
early-return. The pending activation does not finish
until the timeout is reached.

A couple of error cases handled this correctly, but the
majority did not; make them all go into the same code path.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92200
Reviewed-by: Thiago Macieira <thiago@kde.org>
8 years agoNEWS
Simon McVittie [Wed, 30 Sep 2015 14:49:06 +0000 (15:49 +0100)]
NEWS

8 years agoFix creation of Exec path for files not in prefix
Milan Crha [Fri, 18 Sep 2015 15:22:29 +0000 (16:22 +0100)]
Fix creation of Exec path for files not in prefix

Doing strcat() into a static buffer produces incorrect results for
the second and subsequent services if they are not in the ${prefix};
for example, if the first call should have returned
"C:\bar\bin\service1" and the second should have returned
"C:\bar\bin\service2", the second result would actually be
"C:\bar\bin\service1C:\bar\bin\service2".

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83539
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
[smcv: added commit message; used strncpy/strncat to avoid overflow]
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agoMake Windows dbus-daemon look for the config file we install
Ralf Habacker [Sun, 20 Sep 2015 11:47:23 +0000 (13:47 +0200)]
Make Windows dbus-daemon look for the config file we install

The canonical location for bus setup changed from
${sysconfdir}/dbus-1 to ${datadir}/dbus-1 (or their CMake
equivalents) in version 1.9.18.

Also stop trying to use bus/session.conf from the build tree,
which will not work if our ${prefix} contains an older
${sysconfdir}/dbus-1/session.conf.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92028
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
8 years agomention o.fd.DBus.Verbose in the NEWS too
Simon McVittie [Tue, 25 Aug 2015 18:54:18 +0000 (19:54 +0100)]
mention o.fd.DBus.Verbose in the NEWS too

8 years agostart towards 1.10.2
Simon McVittie [Tue, 25 Aug 2015 18:34:54 +0000 (19:34 +0100)]
start towards 1.10.2

8 years ago1.10.0
Simon McVittie [Tue, 25 Aug 2015 15:51:59 +0000 (16:51 +0100)]
1.10.0

8 years agoaudit: make the first few fds close-on-exec
Simon McVittie [Wed, 19 Aug 2015 22:47:40 +0000 (23:47 +0100)]
audit: make the first few fds close-on-exec

libcap-ng < 0.7.7 leaks one non-close-on-exec fd during initialization.
test-bus asserts that all fds beyond 2 passed to an executed subprocess
have the close-on-exec flag set, which will fail at that leaked fd.

This was unnoticed until commit 517c4685, because libaudit was
previously only initialized if we were configured to switch uid,
which the regression tests do not do; the system bus is normally
the only place that happens, but the system bus is not normally
run with the "embedded tests" enabled (since they are bad
for performance and security).

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=91684
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
8 years agoDistribute tap-test.sh.in unconditionally
Simon McVittie [Wed, 19 Aug 2015 21:04:30 +0000 (22:04 +0100)]
Distribute tap-test.sh.in unconditionally

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=91684
Reviewed-by: Tyler Hicks <tyhicks@canonical.com>
8 years ago1.9.21
Simon McVittie [Thu, 6 Aug 2015 23:15:34 +0000 (00:15 +0100)]
1.9.21

8 years agoPrepare 1.9.20 (1.10rc1)
Simon McVittie [Thu, 6 Aug 2015 17:55:31 +0000 (18:55 +0100)]
Prepare 1.9.20 (1.10rc1)

8 years agoNEWS
Simon McVittie [Thu, 6 Aug 2015 16:44:21 +0000 (17:44 +0100)]
NEWS

8 years agoThrow a warning if we cannot open the audit socket as a session bus
Laurent Bigonville [Mon, 15 Jun 2015 13:31:58 +0000 (15:31 +0200)]
Throw a warning if we cannot open the audit socket as a session bus

This will effectively print a warning when failing to open the audit
socket running as a session bus.

The call to audit_open() should succeed even if the dbus-daemon doesn't
have the CAP_AUDIT_WRITE capability.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83856
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoInitialize audit subsystem even for the session bus
Laurent Bigonville [Mon, 15 Jun 2015 13:30:16 +0000 (15:30 +0200)]
Initialize audit subsystem even for the session bus

If SELinux is enabled on the system, dbus will check the permissions but
no audit trails will be generated in case of denial as the audit
subsystem is not initialized. Same should apply for apparmor.

[smcv: without audit, the equivalent of the audit trail goes to stderr
where it can be picked up by systemd-journald]

A unprivileged user should be able to open the audit socket
(audit_open()) but should not have the permissions to log an audit
trail. The CAP_AUDIT_WRITE file capability could be set on the
dbus-daemon executable in order to allow the session bus to log an AVC
denial.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83856
[smcv: s/should/could/ in commit message to reflect lack of consensus that
"setcap cap_audit_write+ep dbus-daemon" is desirable in general]
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoaudit: only check for CAP_AUDIT_WRITE once, during initialization
Simon McVittie [Fri, 3 Jul 2015 15:57:28 +0000 (16:57 +0100)]
audit: only check for CAP_AUDIT_WRITE once, during initialization

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89225
Reviewed-by: Colin Walters <walters@verbum.org>
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoaudit: use DBUS_SYSTEM_LOG_WARNING if we cannot open the audit fd
Simon McVittie [Thu, 19 Feb 2015 12:08:59 +0000 (12:08 +0000)]
audit: use DBUS_SYSTEM_LOG_WARNING if we cannot open the audit fd

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89225
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agobus: move shared libaudit code to a new audit.[ch]
Simon McVittie [Thu, 19 Feb 2015 12:04:26 +0000 (12:04 +0000)]
bus: move shared libaudit code to a new audit.[ch]

This fixes various duplicated libaudit interactions in both
SELinux and AppArmor code paths, including opening two audit sockets
if both SELinux and AppArmor were enabled at compile time.
In particular, audit.c is now the only user of libcap-ng.

This commit is not intended to introduce any functional changes,
except for the de-duplication.

The actual audit_log_user_avc_message() call is still duplicated,
because the SELinux and AppArmor code paths use different mechanisms
to compose the audit message: the SELinux path uses a statically-sized
buffer on the stack which might be subject to truncation, whereas
the AppArmor path uses malloc() (via DBusString) and falls back to
using syslog on a memory allocation failure.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89225
Reviewed-by: Colin Walters <walters@verbum.org>
[smcv: minor issues raised during review are subsequently fixed]
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years agoUse poll's data types directly, where used at all
Rolland Dudemaine [Thu, 6 Aug 2015 13:01:06 +0000 (14:01 +0100)]
Use poll's data types directly, where used at all

[smcv: added commit message; moved fallback implementation
below definition of DBusPollable; more comments; removed unnecessary cast]
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90314
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
8 years ago1.9.19
Simon McVittie [Tue, 21 Jul 2015 20:13:43 +0000 (21:13 +0100)]
1.9.19

8 years agodbus-1.9.16
Simon McVittie [Tue, 21 Jul 2015 16:52:21 +0000 (17:52 +0100)]
dbus-1.9.16

8 years agodbus-1.8.20
Simon McVittie [Tue, 21 Jul 2015 16:32:17 +0000 (17:32 +0100)]
dbus-1.8.20