Commit graph

5938 commits

Author SHA1 Message Date
Ralf Habacker
08eb885be6 cmake: build and install dbus-cleanup-sockets on non Windows platforms 2020-04-29 17:35:08 +00:00
Ralf Habacker
f88ca3b853 cmake: build and install dbus-uuidgen on non Windows platforms 2020-04-29 17:35:08 +00:00
Ralf Habacker
681efdde5d Merge branch 'qthelp-docs-support' into 'master'
Add support to generate the api documentation in Qt help format

See merge request dbus/dbus!150
2020-04-29 15:32:32 +00:00
Ralf Habacker
6e8d75834e Add support to generate the api documentation in Qt help format
Qt help files are used by Qt Creator and KDevelop, for example, to support
the development of Qt-based applications and libraries.

Generating api documentation in Qt help format is controlled by two
user specific options named --enable-qt-help and --with-qchdir (autotools)
and -DENABLE_QT_HELP and -DINSTALL_QCH_DIR (cmake).
2020-04-29 15:23:23 +00:00
Ralf Habacker
dc9a0af697 cmake: remove component 'dev' as we never used that consistently
Marking targets with a component would only be useful if we
marked every target with a component in a consistent way,
but because we don't do that, it's pointless to have it
in just a few places.
2020-04-29 15:23:23 +00:00
Simon McVittie
7cc3ba0e25 Merge branch 'fix-dbus_poll-buffer-overflow' into 'master'
_dbus_poll(): Prevent buffer overflow in Windows verbose logging

See merge request dbus/dbus!125
2020-04-29 10:59:08 +00:00
Ralf Habacker
2658b2571c Fix return type and usage of WSAWaitForMultipleEvents()
The former int type leads to warnings.
2020-04-29 10:52:23 +00:00
Ralf Habacker
b09ba846aa Add debug output functions for _dbus_poll_xx() functions 2020-04-29 10:52:22 +00:00
Ralf Habacker
96b8295831 Fix bug not detecting out of memory condition in _dbus_poll_events ()
For cleaning purpose the event list members are initialized with
WSA_INVALID_EVENT. The cleanup code detects and handles the
case that the event list has been created from calloc ().
2020-04-29 10:52:22 +00:00
Ralf Habacker
0d714aed9d Separate the event based implementation for _dbus_poll() from the fd based one
The function _dbus_poll() has been split into two functions,
_dbus_poll_events() and _dbus_poll_select(), each containing the
corresponding implementation.

_dbus_poll() now calls the corresponding function.
2020-04-29 10:52:22 +00:00
Ralf Habacker
becf2e3feb dbus_poll(): Remove debug output to make room for a better implementation 2020-04-29 10:52:22 +00:00
Simon McVittie
0e8017b85a Merge branch 'shell-test-tap' into 'master'
shell-test: Print diagnostics to stderr

See merge request dbus/dbus!157
2020-04-28 11:00:29 +00:00
Félix Piédallu
362b22605c shell-test: Print diagnostics to stderr
Some of the command-lines that we print as diagnostics contain newlines,
which will cause warnings or errors under a strict TAP parser (and one of
them wasn't correctly prefixed with '#' anyway). TAP parsers only parse
stdout, not stderr, so we can use stderr for these diagnostic messages.

[smcv: Expand commit message]

Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-04-28 11:50:23 +01:00
Ralf Habacker
35974233e2 Merge branch 'coverity-354884' into 'master'
Free allocated buffer in test_content() to avoid a resource leak

See merge request dbus/dbus!146
2020-04-27 15:15:10 +00:00
Ralf Habacker
44c8b03c34 desktop-file test: Free result on all code paths
Otherwise, Coverity will diagnose this as a resource leak,
because it doesn't understand that our assertions end up guaranteeing
that the result is freed if and only if it's non-`NULL`.

Coverity CID: 354884
2020-04-27 12:39:35 +00:00
Ralf Habacker
65ea9d1625 Merge branch 'dbus-get-autolaunch-address-stderr-fixes' into 'master'
In dbus_get_autolaunch_address() return all errors as dbus error

Closes #191

See merge request dbus/dbus!131
2020-04-27 12:16:46 +00:00
Ralf Habacker
faef720d9d In dbus_get_autolaunch_address() return all errors as dbus error
This provides a consistent error reporting.

Fixes #191
2020-04-27 12:09:57 +00:00
Ralf Habacker
a36cd88514 Fix indention in _dbus_get_autolaunch_address() 2020-04-27 12:09:57 +00:00
Ralf Habacker
062f62a3de Merge branch 'dbus_logv-uses-dbusstring' into 'master'
Fix possible truncation of protocol output in dbus_logv()

See merge request dbus/dbus!134
2020-04-27 12:01:30 +00:00
Ralf Habacker
e3075c3cfa _dbus_verbose_real: Use the Python convention for quoting potentially multi-line strings when memory is unavailable on Windows 2020-04-27 12:01:30 +00:00
Simon McVittie
da0db314a3 Start dbus 1.13.16 development
Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-04-21 21:02:03 +01:00
Simon McVittie
f741c14d17 Reference implementation v1.13.14 and Specification v0.36
Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-04-21 11:25:27 +01:00
Simon McVittie
cb3d9d2c6a Update NEWS 2020-04-20 19:28:05 +01:00
Simon McVittie
6a4f205022 Merge branch 'more-modular-tests' into 'master'
Make more tests modular

See merge request dbus/dbus!153
2020-04-20 17:46:52 +00:00
Simon McVittie
9251d32206 test: Replace some _dbus_assert() with _dbus_test_check()
Assertions can be disabled, but in test code the assertions are the
whole point, so use checks that can't be disabled instead.

Because there's a lot of test code, I haven't done this globally, only
in the tests that I recently converted from "embedded" to "modular".

Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-04-20 10:13:07 +01:00
Simon McVittie
e559663e03 test: Replace _dbus_assert_not_reached()
Assertions can be disabled; but in test code the assertions are the
entire point, so we don't want to disable them. Use _dbus_test_fatal()
instead.

test-service is actually a test helper rather than a test, so use its
pre-existing die() function instead.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-04-20 10:13:07 +01:00
Simon McVittie
c383f151be test: Enable more tests when embedded tests are disabled
These previously relied on embedding test-specific code in libdbus,
but they actually only need public APIs, private interfaces that get
exported anyway for the benefit of dbus-daemon, and the TAP helpers;
so we can run them even in production builds.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-04-20 10:13:07 +01:00
Simon McVittie
fcbb5e6586 test: Move TAP helpers into dbus-testutils if embedded tests are disabled
This lets us run a subset of the tests that previously relied on extra
test-only code being compiled into libdbus.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-04-20 10:13:04 +01:00
Simon McVittie
c46e002fe6 _dbus_test_check: Wrap body of macro in do/while
This avoids unexpected precedence when used as the body of an "if" or
"else" without being wrapped in {}.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-04-20 10:11:38 +01:00
Simon McVittie
0ddc510130 Merge branch 'ci-updates' into 'master'
CI: Update to Debian 10 'buster', drop Debian 8 'jessie', add qhelpgenerator

See merge request dbus/dbus!151
2020-04-16 10:25:39 +00:00
Simon McVittie
9c255cbd7e Merge branch 'fix-bar-length' into 'master'
spec: fix typo in example

See merge request dbus/dbus!152
2020-04-16 09:49:37 +00:00
Zygmunt Krynicki
d61d10eb67 spec: fix typo in example
The length of "bar" is encoded as 3. The annotation is incorrect.
2020-04-16 06:55:42 +00:00
Simon McVittie
23e1f044f4 CI: Install qhelpgenerator for native production build on buster
This will be used in dbus!150.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-04-06 14:59:34 +01:00
Simon McVittie
3ce28815e9 CI: Don't build on Debian 8 'jessie'
Debian 8 'jessie' has reached EOL for mainstream security support,
which puts it outside our usual distribution/OS support policy.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-04-06 14:50:02 +01:00
Simon McVittie
73cfcb95c6 CI: Build on Debian 10 'buster' by default
Previously, we built on Debian 9 'stretch' by default, and on
Debian 10 'buster' only on request. Let's reverse that so that we get
more modern toolchains, before Debian 9 'stretch' reaches EOL.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-04-06 14:49:19 +01:00
Simon McVittie
1530582863 Merge branch 'fix-poll-header' into 'master'
sysdeps: use POSIX poll.h instead of sys/poll.h

See merge request dbus/dbus!148
2020-04-01 14:17:52 +00:00
Simon McVittie
16ce800e99 Merge branch 'fallback_to_getrandom' into 'master'
_dbus_generate_random_bytes: fallback to getrandom(2)

See merge request dbus/dbus!147
2020-04-01 14:16:39 +00:00
Natanael Copa
3509748dce sysdeps: use POSIX poll.h instead of sys/poll.h
POSIX.1-2001 and POSIX.1-2008 specifies include <poll.h> so use that
rather than the non-standard/legacy include <sys/poll.h>.

This fixes the following warnings when building with musl libc:

    1 | #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
      |  ^~~~~~~

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
2020-03-26 18:17:22 +01:00
Natanael Copa
6d92e8e983 _dbus_generate_random_bytes: use getrandom(2)
Use getrandom(2) and fall back to /dev/urandom if it is missing or if it
fails some any reason.

This solves problem where dbus-uuidgen is called from a chroot which
lacks /dev/urandom.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
2020-03-26 16:56:59 +01:00
Simon McVittie
09a50e76d2 Merge branch 'fix_indentation' into 'master'
Fix indentation in bus source file

See merge request dbus/dbus!149
2020-03-25 14:19:40 +00:00
Taras Zaporozhets
73139d57bb Fix indentation in bus source file 2020-03-25 13:22:38 +01:00
Ralf Habacker
07ba6c0a40 Merge branch 'mr143-refactoring' into 'master'
sysdeps-win: Refactor cleanup of struct addrinfo during connect()

See merge request dbus/dbus!145
2020-03-11 16:13:47 +00:00
Simon McVittie
3197cbe369 Merge branch 'non-posix-getwpnam-r' into 'master'
Remove support for non-POSIX getpwnam_r()

See merge request dbus/dbus!11
2020-03-11 14:15:29 +00:00
Simon McVittie
e70f19d48f Merge branch 'mr143-but-unix' into 'master'
sysdeps-unix: Don't leak struct addrinfo on OOM during connect()

See merge request dbus/dbus!144
2020-03-11 14:11:09 +00:00
Simon McVittie
ab705c14cb sysdeps-win: Refactor cleanup of struct addrinfo during connect()
As suggested on !143. Instead of remembering to free it in every error
condition, let's move its cleanup to the "out" phase so that it's done
every time.

Change the iterator variable tmp to be const so that it's obvious we
aren't meant to free that too.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-03-11 13:17:43 +00:00
Simon McVittie
682e619196 sysdeps-unix: Don't leak struct addrinfo on OOM during connect()
If we ran out of memory while handling connect() errors, we didn't
free the linked list of struct addrinfo. Move their cleanup to the
"out" phase of the function so that we always do it.

While I'm there, change the iterator variable tmp to be const, to make
it more obvious that we aren't meant to free it.

This is similar to commit 00badeba (!143) in the corresponding Windows
code path, but with some refactoring.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-03-11 13:12:55 +00:00
Simon McVittie
041cadb738 Merge branch 'coverity-354880' into 'master'
Fix missing release of the memory allocated in _dbus_connect_tcp_socket_with_nonce() in OOM case

See merge request dbus/dbus!143
2020-03-11 13:03:34 +00:00
Ralf Habacker
00badebaac Fix missing release of the memory allocated in _dbus_connect_tcp_socket_with_nonce() in OOM case
If there is no more memory available within the mentiond function, e.g.,
when checking memory management, the release of memory allocated by
getaddrinfo() is missing.

Coverity CID: 354880
2020-03-10 23:03:03 +01:00
Simon McVittie
bf0eaec4d9 Merge branch 'monitor-list' into 'master'
bus: Don't explicitly clear BusConnections.monitors

Closes #291

See merge request dbus/dbus!140
2020-02-25 12:49:44 +00:00
Simon McVittie
0f04661531 Merge branch 'fix-cmake-doc-build' into 'master'
Fix cmake doc build

See merge request dbus/dbus!137
2020-02-21 00:59:46 +00:00