]> git.ipfire.org Git - thirdparty/dbus.git/log
thirdparty/dbus.git
6 years agoconfigure.ac: Forbid AX_-prefixed patterns more selectively
Simon McVittie [Mon, 21 Jan 2019 14:28:24 +0000 (14:28 +0000)] 
configure.ac: Forbid AX_-prefixed patterns more selectively

We want to make autoconf fail early and with a user-comprehensible
message if autoconf-archive isn't installed, rather than generating
a configure script with syntax errors, or a configure script that runs
successfully but doesn't do what we intended.

However, autoconf-archive doesn't actually guarantee not to use
AX_-prefixed shell variable names without m4_pattern_allow'ing them
(unlike Autoconf, Automake, Libtool and pkg-config, which explicitly use
m4_pattern_allow for variables with AC_, AM_, LT_ and PKG_ prefixes), so
it isn't safe to assume that they won't be used. In particular, recent
versions of AX_CHECK_GNU_MAKE appear to be using
$AX_CHECK_GNU_MAKE_HEADLINE as a shell variable.

Instead, specifically forbid the names of the finite list of macros
that we actually use.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Resolves: dbus#249

6 years agoMerge branch 'fix-ctest-runtime-path-issue' into 'master'
Simon McVittie [Thu, 10 Jan 2019 21:45:55 +0000 (21:45 +0000)] 
Merge branch 'fix-ctest-runtime-path-issue' into 'master'

Make sure ctest on Windows uses the currently built dbus library

See merge request dbus/dbus!83

6 years agoMake sure ctest on Windows uses the currently built dbus library
Ralf Habacker [Thu, 10 Jan 2019 14:29:59 +0000 (15:29 +0100)] 
Make sure ctest on Windows uses the currently built dbus library

The ctest application is usually not installed in the dbus build
directory. If an older dbus library is contained in this path, it will
be used instead of the currently built one, which can lead to runtime
errors (e.g.: c0000139) if the internal dbus API differs.

6 years agoMerge branch 'rename-dbus-socket-set' into 'master'
Ralf Habacker [Wed, 9 Jan 2019 17:54:07 +0000 (17:54 +0000)] 
Merge branch 'rename-dbus-socket-set' into 'master'

Rename structure DBusSocketSet to DBusPollableSet and adjust the corresponding functions/files

See merge request dbus/dbus!81

Reviewed-by: Simon McVittie
6 years agoRename structure DBusSocketSet to DBusPollableSet and adjust the corresponding functi...
Ralf Habacker [Mon, 7 Jan 2019 12:07:12 +0000 (13:07 +0100)] 
Rename structure DBusSocketSet to DBusPollableSet and adjust the corresponding functions/files

Because the implementation of DBusSocketSet already supports non-socket
pollables like pipes and inotify fd on Unix, DBusPollableSet is a better
name.

6 years agoMerge branch 'windows-spawn-cleanup' into 'master'
Simon McVittie [Mon, 7 Jan 2019 11:06:16 +0000 (11:06 +0000)] 
Merge branch 'windows-spawn-cleanup' into 'master'

Windows spawn cleanup

See merge request dbus/dbus!80

6 years agoMerge branch 'glib-2.38-support' into 'master'
Ralf Habacker [Mon, 7 Jan 2019 09:27:55 +0000 (09:27 +0000)] 
Merge branch 'glib-2.38-support' into 'master'

Add glib 2.38 support

See merge request dbus/dbus!79

Reviewed-by: Philip Withnall
Reviewed-by: Simon McVittie
6 years agoAdd glib 2.38 support
Ralf Habacker [Thu, 3 Jan 2019 22:54:56 +0000 (23:54 +0100)] 
Add glib 2.38 support

6 years agodbus-spawn-win.c: Simplify logic of return value from call to _dbus_spawn_program()
Ralf Habacker [Fri, 21 Dec 2018 16:55:29 +0000 (17:55 +0100)] 
dbus-spawn-win.c: Simplify logic of return value from call to _dbus_spawn_program()

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
6 years agodbus-spawn-win.c: Return valid error if child could not be spawned
Ralf Habacker [Fri, 21 Dec 2018 16:54:16 +0000 (17:54 +0100)] 
dbus-spawn-win.c: Return valid error if child could not be spawned

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
6 years agodbus-spawn-win.c: Don't wait for babysitter thread to start
Ralf Habacker [Fri, 21 Dec 2018 16:03:27 +0000 (17:03 +0100)] 
dbus-spawn-win.c: Don't wait for babysitter thread to start

Now that we start the spawned program from the main thread, there
is no need to wait for it before dereferencing `sitter->child_handle`.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
6 years agodbus-spawn-win.c: Move out argv copy from DBusSitter struct
Ralf Habacker [Fri, 21 Dec 2018 15:38:02 +0000 (16:38 +0100)] 
dbus-spawn-win.c: Move out argv copy from DBusSitter struct

Since the child program is started in the main thread, there is no
need to pass a copy of argv to the thread waiting for the child's
termination.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
6 years agodbus-spawn: Don't take ownership of envp
Simon McVittie [Thu, 20 Dec 2018 15:27:03 +0000 (15:27 +0000)] 
dbus-spawn: Don't take ownership of envp

It's unexpected for a function to take ownership of its arguments
without indicating that in its name, or at least documenting it.

The only caller with envp != NULL is in
bus_activation_activate_service(), which has been updated.

Based on part of a larger commit by Ralf Habacker.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agodbus-spawn-win: Move _dbus_spawn_program() to main thread
Simon McVittie [Thu, 20 Dec 2018 15:17:13 +0000 (15:17 +0000)] 
dbus-spawn-win: Move _dbus_spawn_program() to main thread

We would like to stop taking ownership of envp, but we can't do that
without a deep copy if a different thread might still be using it
(asynchronously) after the main thread has returned from
_dbus_spawn_async_with_babysitter().

Originally part of a larger commit by Ralf Habacker.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoMerge branch 'cmake-custom-install-dirs' into 'master'
Simon McVittie [Fri, 4 Jan 2019 18:27:50 +0000 (18:27 +0000)] 
Merge branch 'cmake-custom-install-dirs' into 'master'

In cmake use variables provided from GNUInstallDirs consequently

See merge request dbus/dbus!77

6 years agoIn cmake use variables provided from GNUInstallDirs consequently
Ralf Habacker [Fri, 21 Dec 2018 18:36:37 +0000 (19:36 +0100)] 
In cmake use variables provided from GNUInstallDirs consequently

This is required to support a custom installation layout, e.g. the
KDE binary factory.

6 years agoMerge branch 'test-defend-getenv' into 'master'
Simon McVittie [Thu, 20 Dec 2018 13:28:42 +0000 (13:28 +0000)] 
Merge branch 'test-defend-getenv' into 'master'

test-wrappers: Copy strings that might come from getenv()

Closes #240

See merge request dbus/dbus!74

Reviewed-by: Philip Withnall
6 years agoMerge branch 'test-main-boilerplate' into 'master'
Simon McVittie [Thu, 20 Dec 2018 13:27:42 +0000 (13:27 +0000)] 
Merge branch 'test-main-boilerplate' into 'master'

Consolidate boilerplate from embedded tests' main()

See merge request dbus/dbus!73

Reviewed-by: Ralf Habacker
6 years agoMerge branch 'deprecate-packaged-xml-in-sysconfdir' into 'master'
Simon McVittie [Thu, 20 Dec 2018 13:25:21 +0000 (13:25 +0000)] 
Merge branch 'deprecate-packaged-xml-in-sysconfdir' into 'master'

Deprecate packaged XML policies in ${sysconfdir}

See merge request dbus/dbus!76

Reviewed-by: Tom Gundersen
6 years agodbus-daemon(1): Give more comprehensive examples of how to add services
Simon McVittie [Wed, 19 Dec 2018 17:29:11 +0000 (17:29 +0000)] 
dbus-daemon(1): Give more comprehensive examples of how to add services

While writing the wording to deprecate XML policy installed by packages
into ${sysconfdir}, I realised we didn't give a typical example of
what packages *should* do.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoOfficially deprecate package-supplied dbus-daemon policy in ${sysconfdir}
Simon McVittie [Wed, 19 Dec 2018 17:27:15 +0000 (17:27 +0000)] 
Officially deprecate package-supplied dbus-daemon policy in ${sysconfdir}

Now that dbus 1.10 has become widely available, we should start to
treat ${sysconfdir} as reserved for the sysadmin, and encourage
third-party software packages to install their integration files into
${datadir}.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoMerge branch '135-session-test-support-windows' into 'master'
Ralf Habacker [Tue, 18 Dec 2018 07:15:01 +0000 (07:15 +0000)] 
Merge branch '135-session-test-support-windows' into 'master'

name-test: Run most tests in CMake, via dbus-run-session

See merge request dbus/dbus!23

6 years agoFix multi-configuration generator support
Ralf Habacker [Mon, 17 Dec 2018 15:37:16 +0000 (16:37 +0100)] 
Fix multi-configuration generator support

Multi-configuration generators (VS, Xcode) append a per-configuration
subdirectory to the specified CMAKE_xxx_OUTPUT_DIRECTORY} directory.

To use the real output paths in test applications, this subdirectory
must be added to the corresponding cmake variables.

6 years agoAdd cmake support for session based test executables
Ralf Habacker [Mon, 17 Dec 2018 15:36:32 +0000 (16:36 +0100)] 
Add cmake support for session based test executables

This patch introduces a new cmake macro add_session_test_executable,
which uses dbus-run-session to start a dbus-daemon process with a
temporary session bus in the background and the desired client file.

add_session_test_executable requires additional environment variables
defined in the top level CMakeLists.txt.

Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/135
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
6 years agoAdd cmake support for session based test executables
Ralf Habacker [Mon, 17 Dec 2018 15:13:00 +0000 (16:13 +0100)] 
Add cmake support for session based test executables

This patch introduces a new cmake macro add_session_test_executable,
which uses dbus-run-session to start a dbus-daemon process with a
temporary session bus in the background and the desired client file.

add_session_test_executable requires additional environment variables
defined in the top level CMakeLists.txt.

Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/135
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
6 years agoUse prefined variables to setup environment in cmake macro add_test_executable
Ralf Habacker [Mon, 17 Dec 2018 15:12:33 +0000 (16:12 +0100)] 
Use prefined variables to setup environment in cmake macro add_test_executable

Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/135

6 years agoAdd missing extension to TEST_LAUNCH_HELPER_BINARY in cmake
Ralf Habacker [Mon, 17 Dec 2018 15:11:48 +0000 (16:11 +0100)] 
Add missing extension to TEST_LAUNCH_HELPER_BINARY in cmake

6 years agoFix setup of build time output paths in cmake
Ralf Habacker [Sat, 15 Dec 2018 09:54:47 +0000 (10:54 +0100)] 
Fix setup of build time output paths in cmake

Instead of the variables EXECUTABLE_OUTPUT_PATH and
LIBRARY_OUTPUT_PATH, which have become obsolete since
cmake 3.x, CMAKE_xxx_OUTPUT_PATH is now used to define
output paths in the build directory.

6 years agotest-wrappers: Copy strings that might come from getenv()
Simon McVittie [Fri, 14 Dec 2018 20:31:31 +0000 (20:31 +0000)] 
test-wrappers: Copy strings that might come from getenv()

It is not safe to assume that the result of getenv() is not invalidated
by a subsequent call to setenv(), and dbus#240 demonstrates that this
can be a problem in practice when running Windows code under Wine.

Closes: https://gitlab.freedesktop.org/dbus/dbus/issues/240
Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotests: Collect common code from embedded-test main executables
Simon McVittie [Mon, 3 Sep 2018 21:53:24 +0000 (14:53 -0700)] 
tests: Collect common code from embedded-test main executables

This all seems to have been written by Red Hat or by Collabora, so we
have permission to relicense it under the MIT/X11 license, and we
might as well do so.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agobus tests: Skip unsupported fd-passing test internally, not from main()
Simon McVittie [Mon, 3 Sep 2018 21:13:45 +0000 (14:13 -0700)] 
bus tests: Skip unsupported fd-passing test internally, not from main()

This results in one less special case in test-main, which will be
significant when we want to make the tests more data-driven.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoembedded tests: Time how long each test takes
Simon McVittie [Mon, 3 Sep 2018 19:46:25 +0000 (12:46 -0700)] 
embedded tests: Time how long each test takes

This will help to split them up into modules that each take a
reasonable time.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoembedded tests: Conform to the same API for all tests
Simon McVittie [Mon, 3 Sep 2018 19:18:39 +0000 (12:18 -0700)] 
embedded tests: Conform to the same API for all tests

This will make it possible to unify the wrapper code that runs them.

I'm using a plain C string rather than a DBusString to make it
more straightforward to carve out tests into their own executables.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agodbus-marshal-validate.h: Make self-contained
Simon McVittie [Mon, 3 Sep 2018 21:59:02 +0000 (14:59 -0700)] 
dbus-marshal-validate.h: Make self-contained

This header mentions DBusString, so it had better include dbus-string.h.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoMerge branch 'copyright-whitespace' into 'master'
Simon McVittie [Mon, 17 Dec 2018 12:13:12 +0000 (12:13 +0000)] 
Merge branch 'copyright-whitespace' into 'master'

trivial: Remove trailing whitespace from copyright notices

See merge request dbus/dbus!75

Reviewed-by: pwithnall
6 years agotrivial: Remove trailing whitespace from copyright notices
Simon McVittie [Mon, 17 Dec 2018 10:56:38 +0000 (10:56 +0000)] 
trivial: Remove trailing whitespace from copyright notices

We don't usually mass-remove trailing whitespace from the actual source
code because it would complicate cherry-picking bug fixes to older
branches, but that reasoning doesn't really apply to the comments
containing copyright and licensing notices.

Removing trailing whitespace makes it much easier to move code around:
we have a commit hook that rejects commits containing trailing
whitespace, but that commit hook counts moving a file as a delete + add
pair, so it objects to moving code that contains trailing whitespace.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoMerge branch 'remove-threads-init-debug' into 'master'
Simon McVittie [Mon, 17 Dec 2018 10:28:07 +0000 (10:28 +0000)] 
Merge branch 'remove-threads-init-debug' into 'master'

_dbus_threads_init_debug: Remove

See merge request dbus/dbus!72

6 years ago_dbus_threads_init_debug: Remove
Simon McVittie [Fri, 14 Dec 2018 20:06:02 +0000 (20:06 +0000)] 
_dbus_threads_init_debug: Remove

libdbus has been thread-safe by default since 1.7.6 (2013):
dbus_threads_init_default() is called on a just-in-time basis
whenever needed, and _dbus_thread_init_debug() is equivalent to that.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoMerge branch 'gitignore' into 'master'
Simon McVittie [Fri, 14 Dec 2018 15:11:51 +0000 (15:11 +0000)] 
Merge branch 'gitignore' into 'master'

trivial: Clean up .gitignore files

See merge request dbus/dbus!70

Reviewed-by: pwithnall
6 years ago.gitignore: Ignore many more generated files
Simon McVittie [Fri, 14 Dec 2018 13:28:50 +0000 (13:28 +0000)] 
.gitignore: Ignore many more generated files

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoMerge branch 'reduce-test-refs-run-time' into 'master'
Simon McVittie [Fri, 14 Dec 2018 13:08:01 +0000 (13:08 +0000)] 
Merge branch 'reduce-test-refs-run-time' into 'master'

Decrease the runtime of test-refs under Windows

Closes #244

See merge request dbus/dbus!65

6 years ago.gitignore: Normalize into LC_ALL=C sort order
Simon McVittie [Fri, 14 Dec 2018 12:51:51 +0000 (12:51 +0000)] 
.gitignore: Normalize into LC_ALL=C sort order

If lists are in a completely arbitrary order, sorting them consistently
means that there is only one correct place to insert a new entry, avoiding
the merge conflicts that would occur if we always append new entries.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years ago.gitignore: Make match patterns more specific
Simon McVittie [Fri, 14 Dec 2018 12:50:25 +0000 (12:50 +0000)] 
.gitignore: Make match patterns more specific

In subdirectories we mostly only want to match at the current level,
not in nested subdirectories.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agovalid-config-files-system .gitignore: Don't ignore many-rules.conf
Simon McVittie [Fri, 14 Dec 2018 12:48:41 +0000 (12:48 +0000)] 
valid-config-files-system .gitignore: Don't ignore many-rules.conf

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years ago.gitignore: Remove obsolete patterns
Simon McVittie [Fri, 14 Dec 2018 12:48:08 +0000 (12:48 +0000)] 
.gitignore: Remove obsolete patterns

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years ago.gitignore: Consolidate generic patterns at top level
Simon McVittie [Fri, 14 Dec 2018 12:46:35 +0000 (12:46 +0000)] 
.gitignore: Consolidate generic patterns at top level

Patterns in the top-level .gitignore match in all subdirectories, so
there's no need to repeat ourselves quite so much for generic
C, Autotools and gcov patterns.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoTop level .gitignore: Sort anchored patterns in LC_ALL=C sort order
Simon McVittie [Fri, 14 Dec 2018 12:42:52 +0000 (12:42 +0000)] 
Top level .gitignore: Sort anchored patterns in LC_ALL=C sort order

If lists are in a completely arbitrary order, sorting them consistently
means that there is only one correct place to insert a new entry, avoiding
the merge conflicts that would occur if we always append new entries.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoTop level .gitignore: Group anchored and unanchored patterns
Simon McVittie [Fri, 14 Dec 2018 12:42:22 +0000 (12:42 +0000)] 
Top level .gitignore: Group anchored and unanchored patterns

The anchored patterns match only in the top directory; the unanchored
patterns match in any subdirectory. While I'm moving the unanchored
patterns around anyway, sort them in lexicographical (LC_ALL=C sort)
order.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years ago.gitignore: Anchor patterns for files that are only at top level
Simon McVittie [Fri, 14 Dec 2018 12:39:33 +0000 (12:39 +0000)] 
.gitignore: Anchor patterns for files that are only at top level

There shouldn't be an aclocal.m4 in any subdirectory, for instance,
so there's no need to ignore it.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoTop level .gitignore: Remove files that now live in build-aux/
Simon McVittie [Fri, 14 Dec 2018 12:37:48 +0000 (12:37 +0000)] 
Top level .gitignore: Remove files that now live in build-aux/

We put these in build-aux/ since 15e6b4f5, and we ignore all of
build-aux/, so we don't need to ignore them separately.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoMerge branch 'all-helpers-in-test' into 'master'
Simon McVittie [Fri, 14 Dec 2018 12:17:14 +0000 (12:17 +0000)] 
Merge branch 'all-helpers-in-test' into 'master'

test-privserver: Move helper executable out of name-test/

See merge request dbus/dbus!67

6 years agoIncrease the number of references/threads to be tested under Windows by default to...
Ralf Habacker [Fri, 14 Dec 2018 09:54:31 +0000 (10:54 +0100)] 
Increase the number of references/threads to be tested under Windows by default to detect errors

6 years agoDecrease the runtime of test refs under Windows by default
Ralf Habacker [Fri, 7 Dec 2018 16:52:58 +0000 (17:52 +0100)] 
Decrease the runtime of test refs under Windows by default

If the environment variable DBUS_TEST_SLOW is not set or is 0
fewer iterations are performed in test-refs enough to demonstrate
that it works, rather than seriously trying to reproduce race
conditions.

This solves the long runtime that Wine 3.x (4 times longer than
native Windows 7) or Windows 7 as a VirtualBox 5.22 guest (10
times longer) is to be seen.

Fixes #244

6 years agotest-privserver: Move helper executable out of name-test/
Simon McVittie [Tue, 11 Dec 2018 11:52:38 +0000 (11:52 +0000)] 
test-privserver: Move helper executable out of name-test/

This means we don't need to distinguish between DBUS_NAME_TEST_EXEC and
DBUS_TEST_EXEC any more, because all test helper executables are in the
same place, both during build and when installed (we don't install
test-privserver since no installed test requires it yet, but in
principle we could).

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest-privserver: Add copyright and licensing information
Simon McVittie [Thu, 13 Dec 2018 13:07:20 +0000 (13:07 +0000)] 
test-privserver: Add copyright and licensing information

I've assumed that trivial changes from Scott James Remnant (correcting
some bus names) and Marcus Brinkmann (adding a <config.h> include
tree-wide) are not significant here. All the other potential copyright
holders from the git log are listed, and all have given permission to
relicense their dbus contributions under the MIT/X11 license.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest-privserver: Remove all trailing whitespace
Simon McVittie [Thu, 13 Dec 2018 12:42:11 +0000 (12:42 +0000)] 
test-privserver: Remove all trailing whitespace

Otherwise the commit hook would forbid commits that move it to a new
location.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoMerge branch 'wip/asan' into 'master'
Simon McVittie [Wed, 12 Dec 2018 12:01:40 +0000 (12:01 +0000)] 
Merge branch 'wip/asan' into 'master'

Add AddressSanitizer and UBSan support

See merge request dbus/dbus!57

Reviewed-by: pwithnall
6 years agoMerge branch 'basic-value-align' into 'master'
Simon McVittie [Wed, 12 Dec 2018 12:00:03 +0000 (12:00 +0000)] 
Merge branch 'basic-value-align' into 'master'

Don't cast user-supplied pointers to DBusBasicValue *

See merge request dbus/dbus!69

Reviewed-by: thiago
6 years agoci: Apply AddressSanitizer to Linux "debug" builds
Simon McVittie [Mon, 3 Dec 2018 17:48:45 +0000 (17:48 +0000)] 
ci: Apply AddressSanitizer to Linux "debug" builds

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agobuild: Add a way to set CFLAGS for AddressSanitizer etc.
Simon McVittie [Wed, 29 Aug 2018 19:06:00 +0000 (20:06 +0100)] 
build: Add a way to set CFLAGS for AddressSanitizer etc.

We don't want to set these globally via the normal CFLAGS, because if
we did, AddressSanitizer would catch test-segfault deliberately
segfaulting, and "helpfully" turn it into exit status 1, which in turn
makes our test fail because it asserts that the segfault is reported
as a segfault.

A typical use with gcc as compiler, on a reasonably recent Debian,
would be:

    ./configure SANITIZE_CFLAGS="-fsanitize=address -fsanitize=undefined -fPIE -pie"

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoMove _dbus_disable_crash_handling() back into test/ directory
Simon McVittie [Mon, 3 Dec 2018 16:04:56 +0000 (16:04 +0000)] 
Move _dbus_disable_crash_handling() back into test/ directory

It's only used in test code. We have to put it in its own translation
unit with no non-libc dependencies so that we can compile a copy of it
without AddressSanitizer support, because in a subsequent commit we will
special-case test-segfault to be compiled without using AddressSanitizer,
which would make linking to an AddressSanitizer-instrumented libdbus fail.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotests: Allow timeout to be multiplied by an arbitrary factor
Simon McVittie [Fri, 17 Aug 2018 14:48:50 +0000 (15:48 +0100)] 
tests: Allow timeout to be multiplied by an arbitrary factor

Running tests under instrumentation (libasan) or emulation (qemu)
is not fast.

Inspired by the --timeout-factor option in
<https://salsa.debian.org/ci-team/autopkgtest>.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoMerge branch 'privserver-leak' into 'master'
Simon McVittie [Tue, 11 Dec 2018 12:38:59 +0000 (12:38 +0000)] 
Merge branch 'privserver-leak' into 'master'

test-privserver: Don't leak the DBusServer

See merge request dbus/dbus!68

6 years agoDon't cast user-supplied pointers to DBusBasicValue *
Simon McVittie [Thu, 6 Dec 2018 13:49:56 +0000 (13:49 +0000)] 
Don't cast user-supplied pointers to DBusBasicValue *

If we cast a user-supplied pointer to DBusBasicValue *, that's like
promising that the pointer is to an object at least as strictly aligned
as a DBusBasicValue. In practice, it often isn't: for example, when
we marshal a dbus_uint32_t, a pointer to it is only guaranteed to be
32-bit-aligned, whereas DBusBasicValue typically requires 64-bit
alignment.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest-privserver: Don't leak the DBusServer
Simon McVittie [Tue, 11 Dec 2018 10:04:18 +0000 (10:04 +0000)] 
test-privserver: Don't leak the DBusServer

This results in (harmless) leak reports when running under the
AddressSanitizer, which could make real leaks harder to find.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoAdd build system variable DBUS_NAME_TEST_EXEC to cover differences in executable...
Ralf Habacker [Tue, 20 Nov 2018 15:33:57 +0000 (16:33 +0100)] 
Add build system variable DBUS_NAME_TEST_EXEC to cover differences in executable paths

Autotools creates executable applications in the respective
subdirectory of the build directory, while cmake creates
them in <build-root>/bin.

This leads to different paths in the file created
from org.freedesktop.DBus.TestSuite.PrivServer.service.in,
which are fixed by the new variable.

Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/135
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
Reviewed-by: Simon McVittie <smcv@collabora.com>
6 years agoRefer to correct bus in test-ids error message
Ralf Habacker [Fri, 7 Dec 2018 18:06:35 +0000 (19:06 +0100)] 
Refer to correct bus in test-ids error message

The test tries to connect to the session bus, not system bus.

Reviewed-by: Simon McVittie <smcv@collabora.com>
6 years agorun-session: Fix warning 'array subscript 3 is above array bounds of 'char *[3]'...
Ralf Habacker [Fri, 7 Dec 2018 18:02:14 +0000 (19:02 +0100)] 
run-session: Fix warning 'array subscript 3 is above array bounds of 'char *[3]' on Windows

After the merge request !22 was created, this bug was fixed in !23,
the associated branch was used for local tests, but the fix was not
transferred to !22. After merging !22 into the master branch and
rebasing !23 to the master, this fix was lost.

Reviewed-by: Simon McVittie <smcv@collabora.com>
6 years agoMerge branch 'skip-server-oom-test' into 'master'
Simon McVittie [Thu, 6 Dec 2018 16:42:09 +0000 (16:42 +0000)] 
Merge branch 'skip-server-oom-test' into 'master'

Skip server oom wildcard test on Windows to avoid firewall exception request

See merge request dbus/dbus!64

Reviewed-by: smcv
6 years agoSkip server oom wildcard test on Windows to avoid firewall exception request
Ralf Habacker [Thu, 6 Dec 2018 16:08:29 +0000 (17:08 +0100)] 
Skip server oom wildcard test on Windows to avoid firewall exception request

After starting the test on Windows 10, whether the local user is an
administrator or not, a dialog box appears with a warning that some
features of the app have been blocked by the firewall and prompts for
credentials for an administrator account while the test continues to
run and pass.

If this request is aborted, the dialog disappears; no restrictions are
visible for the test case. When the test is restarted, the dialog is also
no longer displayed.

In the firewall configuration you can then see that test-server-oom.exe
has been added (but not enabled) for public networks, although no
confirmation has been received from an administrator account.

6 years agoMerge branch 'fix-cmake-wine-support' into 'master'
Simon McVittie [Thu, 6 Dec 2018 12:24:37 +0000 (12:24 +0000)] 
Merge branch 'fix-cmake-wine-support' into 'master'

Fix cmake wine support

See merge request dbus/dbus!60

Reviewed-by: smcv
6 years agoAdd new cmake configure option DBUS_USE_WINE
Ralf Habacker [Wed, 5 Dec 2018 07:30:17 +0000 (08:30 +0100)] 
Add new cmake configure option DBUS_USE_WINE

If this variable is set, ctest uses wine to run cross compiled
test applications. Otherwise, they are assumed to run on a native
Windows operating system.

The new cmake variables Z_DRIVE_IF_WINE and TEST_WRAPPER have been
added to support this function.

6 years agoMerge branch 'fix-cmake-tests' into 'master'
Simon McVittie [Wed, 5 Dec 2018 16:06:05 +0000 (16:06 +0000)] 
Merge branch 'fix-cmake-tests' into 'master'

Fix cmake tests

See merge request dbus/dbus!59

Reviewed-by: smcv
6 years agoUpdate NEWS
Simon McVittie [Wed, 5 Dec 2018 15:02:42 +0000 (15:02 +0000)] 
Update NEWS

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoAdds uac manifest to all executable test files to prevent the Windows 740 error when...
Ralf Habacker [Wed, 5 Dec 2018 06:56:22 +0000 (07:56 +0100)] 
Adds uac manifest to all executable test files to prevent the Windows 740 error when running

The case occurred during test-pending-call-dispatch. To avoid further
applications being affected in the future, the manifest is added to
all test applications.

Windows Error 740 is defined as 'The Requested Operation Requires Elevation'

6 years agoDrop cmake variable DBUS_WIN_FIXME
Ralf Habacker [Wed, 5 Dec 2018 13:59:17 +0000 (14:59 +0100)] 
Drop cmake variable DBUS_WIN_FIXME

6 years agoAvoid memory leaks on running check_shell_service_success_auto_start on Windows
Ralf Habacker [Mon, 26 Nov 2018 11:09:48 +0000 (12:09 +0100)] 
Avoid memory leaks on running check_shell_service_success_auto_start on Windows

6 years agoCI: Install yelp-tools, for yelp-build, in recent distros
Simon McVittie [Wed, 5 Dec 2018 13:17:17 +0000 (13:17 +0000)] 
CI: Install yelp-tools, for yelp-build, in recent distros

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoCI: Make adduser properly non-interactive
Simon McVittie [Wed, 5 Dec 2018 13:52:12 +0000 (13:52 +0000)] 
CI: Make adduser properly non-interactive

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoCI: Don't install weak dependencies (Recommends)
Simon McVittie [Wed, 5 Dec 2018 13:16:10 +0000 (13:16 +0000)] 
CI: Don't install weak dependencies (Recommends)

In particular this avoids installing the TeX toolchain.

However, this also means we don't install dbus, which broke some tests
in minimal containers where dbus wasn't already installed, because the
messagebus user wouldn't have been created. Make sure that user exists,
using the same adduser call as the Debian dbus package.

CMake really wants to find a C++ compiler (even though we only use C++
when compiling for Windows), so explicitly install the default
version of the GNU C++ compiler, g++.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoMerge branch 'sysdeps-test-wait' into 'master'
Ralf Habacker [Wed, 5 Dec 2018 14:32:53 +0000 (14:32 +0000)] 
Merge branch 'sysdeps-test-wait' into 'master'

sysdeps test: Wait for spawned process to exit

Closes #238
See merge request dbus/dbus!61
Reviewed-by: rhabacker
6 years agosysdeps test: Wait for spawned process to exit
Simon McVittie [Wed, 5 Dec 2018 12:58:22 +0000 (12:58 +0000)] 
sysdeps test: Wait for spawned process to exit

On Windows, the "out" parameter for the process handle isn't set
unless we specify G_SPAWN_FLAGS_DO_NOT_REAP_CHILD. That means we
can't terminate it, and the child process is leaked. When running the
test individually, the leaked process is harmless apart from its
resource cost, but when running under CTest, it holds a file descriptor
open (or something) which causes CTest to not exit.

If we *do* specify G_SPAWN_FLAGS_DO_NOT_REAP_CHILD, we become
responsible for "reaping" the child process by waiting for its exit
status, which is an OS-specific action.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Resolves: https://gitlab.freedesktop.org/dbus/dbus/issues/238

6 years agoMerge branch 'syslog-test-newlines' into 'master'
Ralf Habacker [Wed, 5 Dec 2018 14:28:36 +0000 (14:28 +0000)] 
Merge branch 'syslog-test-newlines' into 'master'

syslog test: Don't assert that we see plain LF newlines

Closes #243

See merge request dbus/dbus!62

6 years agosyslog test: Don't assert that we see plain LF newlines
Simon McVittie [Wed, 5 Dec 2018 13:40:46 +0000 (13:40 +0000)] 
syslog test: Don't assert that we see plain LF newlines

In at least some build configurations that target Windows, we see CRLF
newlines in the stderr of the subprocess. Leave the newlines unspecified
and let "*" match them.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Resolves: https://gitlab.freedesktop.org/dbus/dbus/issues/243

6 years agoMerge branch 'unprivileged-container' into 'master'
Simon McVittie [Wed, 5 Dec 2018 14:09:19 +0000 (14:09 +0000)] 
Merge branch 'unprivileged-container' into 'master'

dbus-daemon test: Don't test fd limits if in an unprivileged container

See merge request dbus/dbus!58

Reviewed-by: pwithnall
6 years agoMerge branch 'unpythonize' into 'master'
Simon McVittie [Wed, 5 Dec 2018 14:09:00 +0000 (14:09 +0000)] 
Merge branch 'unpythonize' into 'master'

Translate Python-based tests to C

See merge request dbus/dbus!37

Reviewed-by: pwithnall
6 years agoMerge branch 'hash-assertion' into 'master'
Simon McVittie [Wed, 5 Dec 2018 14:07:55 +0000 (14:07 +0000)] 
Merge branch 'hash-assertion' into 'master'

DBusHash: Recalculate bucket used if the table is rebuilt

See merge request dbus/dbus!44

6 years agoFix test-shutdown bail out on Windows
Ralf Habacker [Wed, 24 Oct 2018 10:03:14 +0000 (12:03 +0200)] 
Fix test-shutdown bail out on Windows

test-shutdown expects a GUID in the bus address by default,
which is not available under Windows, because on this platform
an autolaunch address is provided by dbus-run-session and is
not returned by dbus-daemon.

Bug: https://gitlab.freedesktop.org/dbus/dbus/merge_requests/59
Reviewed-by: Simon McVittie <smcv@collabora.com>
7 years agoStart working on dbus 1.13.10
Simon McVittie [Tue, 4 Dec 2018 17:25:20 +0000 (17:25 +0000)] 
Start working on dbus 1.13.10

Signed-off-by: Simon McVittie <smcv@collabora.com>
7 years ago1.13.8 dbus-1.13.8
Simon McVittie [Tue, 4 Dec 2018 12:27:32 +0000 (12:27 +0000)] 
1.13.8

Signed-off-by: Simon McVittie <smcv@collabora.com>
7 years agoNEWS: Note new weak dependency on xsltproc for CMake
Simon McVittie [Tue, 4 Dec 2018 12:26:03 +0000 (12:26 +0000)] 
NEWS: Note new weak dependency on xsltproc for CMake

Signed-off-by: Simon McVittie <smcv@collabora.com>
7 years agodbus-daemon test: Don't test fd limits if in an unprivileged container
Simon McVittie [Tue, 4 Dec 2018 12:09:26 +0000 (12:09 +0000)] 
dbus-daemon test: Don't test fd limits if in an unprivileged container

In an unprivileged container, uid 0 doesn't have CAP_SYS_RESOURCE, so
we can't expect the dbus-daemon to be able to escalate its fd limit.

This can be reproduced using bubblewrap:

    sudo bwrap \
        --cap-drop CAP_SYS_RESOURCE \
        --ro-bind / / \
        --dev /dev \
    env \
        DBUS_TEST_DAEMON=.../bus/dbus-daemon \
        DBUS_TEST_DATA=.../test/data \
    .../test/test-dbus-daemon \
        -p /fd-limit \
        --verbose

Bug-Debian: https://bugs.debian.org/908092

7 years agoCI: Exercise maintainer-only documentation build
Simon McVittie [Tue, 4 Dec 2018 11:25:21 +0000 (11:25 +0000)] 
CI: Exercise maintainer-only documentation build

Signed-off-by: Simon McVittie <smcv@collabora.com>
7 years agoCI: Remove unimplemented --with-glib option
Simon McVittie [Tue, 4 Dec 2018 11:29:12 +0000 (11:29 +0000)] 
CI: Remove unimplemented --with-glib option

dbus has never actually had this option.

Signed-off-by: Simon McVittie <smcv@collabora.com>
7 years agoCI: List attributes, sizes etc. of installed files, not just names
Simon McVittie [Tue, 4 Dec 2018 11:25:02 +0000 (11:25 +0000)] 
CI: List attributes, sizes etc. of installed files, not just names

Signed-off-by: Simon McVittie <smcv@collabora.com>
7 years agodoc: Remove obsolete message about man2html
Simon McVittie [Tue, 4 Dec 2018 11:41:11 +0000 (11:41 +0000)] 
doc: Remove obsolete message about man2html

We no longer run man2html.

Signed-off-by: Simon McVittie <smcv@collabora.com>
7 years agodoc: Don't include ChangeLog in dbus-docs.tar.xz
Simon McVittie [Tue, 4 Dec 2018 11:18:39 +0000 (11:18 +0000)] 
doc: Don't include ChangeLog in dbus-docs.tar.xz

Signed-off-by: Simon McVittie <smcv@collabora.com>
Fixes: e93b421137493710cb6b81420d15928eb13014e3
7 years agodoc: Use tar --xz to create dbus-docs.tar.xz
Simon McVittie [Tue, 4 Dec 2018 11:17:05 +0000 (11:17 +0000)] 
doc: Use tar --xz to create dbus-docs.tar.xz

Signed-off-by: Simon McVittie <smcv@collabora.com>
Fixes: b805744029e6c497b0b92051199a304636e82fcd
7 years agoCI: Start supporting Debian 10 'buster', currently under development
Simon McVittie [Mon, 3 Dec 2018 19:45:46 +0000 (19:45 +0000)] 
CI: Start supporting Debian 10 'buster', currently under development

This gives us a way to build on a more recent host OS if we want to.
For Gitlab-CI it's disabled by default.

Signed-off-by: Simon McVittie <smcv@collabora.com>
7 years agoCI: Stop building on Ubuntu 14.04 'trusty'
Simon McVittie [Mon, 3 Dec 2018 19:44:47 +0000 (19:44 +0000)] 
CI: Stop building on Ubuntu 14.04 'trusty'

The version of gcc in trusty is too old for AddressSanitizer, which we
want to be able to start using, and Travis-CI finally supports Ubuntu
16.04 'xenial' now. This lets us remove some workarounds, but we need
to update others.

Signed-off-by: Simon McVittie <smcv@collabora.com>