Commit graph

7137 commits

Author SHA1 Message Date
Simon McVittie
41c7570e1e cmake: Make intrusive (formerly embedded) tests into a separate option
Previously, the CMake build enabled tests by default, and enabled both
modular and intrusive (embedded) tests with a single option. This is
a really bad idea if anyone is using CMake-built binaries in production.

DBUS_BUILD_TESTS now enables only the modular tests, which are safe to
enable in production builds.

A new DBUS_ENABLE_INTRUSIVE_TESTS option enables the intrusive test
instrumentation.

To preserve existing test coverage, explicitly enable the intrusive
tests in most CMake-based Gitlab-CI jobs (Debian native, openSUSE native,
Windows).

In jobs that have a mirrored pair of production/debug builds (openSUSE
and Debian mingw32/mingw64 cmake), instead we leave the production
build as-is and only build full test coverage in the debug build.

Co-authored-by: Philip Withnall <philip@tecnocode.co.uk>
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-12-10 10:25:51 +00:00
Simon McVittie
9c5b5838f5 Rename "embedded tests" to "intrusive tests"
This hopefully helps to get across the point that enabling these tests
adds instrumentation to libdbus and dbus-daemon, with a potentially
significant impact on code size, performance and security.

To avoid a huge diffstat which would be difficult to review, the cpp
macro that is checked by most of the C code is still
DBUS_ENABLE_EMBEDDED_TESTS, which is defined or undefined under exactly
the same conditions as the new DBUS_ENABLE_INTRUSIVE_TESTS.

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/537
Co-authored-by: Philip Withnall <philip@tecnocode.co.uk>
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-12-10 10:25:23 +00:00
Ralf Habacker
d440173062 cmake: In client configuration file get DBus1_xxx variables from cmake target
The DBus1_xxx variables defined in DBusConfig.cmake for Windows builds
are currently hard-coded values and independent of those of the underlying
cmake target.
To avoid this, these values are retrieved from the corresponding cmake
target. In addition, the cmake allows the construction of the resulting
relocatable runtime paths.

(cherry picked from commit 29c2e9141a)
2024-12-10 10:24:10 +00:00
Simon McVittie
9907deedb1 memory: Remove redundant guard around _dbus_decrement_fail_alloc_counter()
This function is already inside `#ifdef DBUS_ENABLE_EMBEDDED_TESTS`
and doesn't need a second layer of the same guard.

Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 6e61173d64)
2024-12-10 10:24:04 +00:00
Simon McVittie
2ff58f5083 Merge branch 'cmake-fixes' into 'master'
cmake: In client configuration file get DBus1_xxx variables from cmake target

See merge request dbus/dbus!499
2024-12-10 10:19:57 +00:00
Ralf Habacker
29c2e9141a cmake: In client configuration file get DBus1_xxx variables from cmake target
The DBus1_xxx variables defined in DBusConfig.cmake for Windows builds
are currently hard-coded values and independent of those of the underlying
cmake target.
To avoid this, these values are retrieved from the corresponding cmake
target. In addition, the cmake allows the construction of the resulting
relocatable runtime paths.
2024-12-10 10:12:10 +01:00
Simon McVittie
7cc31643c7 Merge branch 'mem-double-guard' into 'master'
memory: Remove redundant guard around _dbus_decrement_fail_alloc_counter()

See merge request dbus/dbus!497
2024-12-09 23:26:19 +00:00
Simon McVittie
6e61173d64 memory: Remove redundant guard around _dbus_decrement_fail_alloc_counter()
This function is already inside `#ifdef DBUS_ENABLE_EMBEDDED_TESTS`
and doesn't need a second layer of the same guard.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-12-09 18:25:52 +00:00
Simon McVittie
80eac5c99e release-checklist: Use a more copy-paste'able scp/rsync destination
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 7dc12d17c8)
2024-12-09 17:07:08 +00:00
Simon McVittie
cb7f88f8a9 release-checklist: Give a better reference for deprecation warnings
Commit 4ebb275ab7 disabled deprecation warnings in the Autotools build
system, which we no longer have. Future stable-branches will want to
disable deprecation warnings in Meson instead.

Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit f651834427)
2024-12-09 17:07:07 +00:00
Simon McVittie
642a22a0bd release-checklist: Fix sequencing
`meson dist` requires the version you intend to release to have been
committed already, and does not create any generated files in the
`${srcdir}` that are intended to be committed to git.

Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit b97b083f9a)
2024-12-09 17:07:07 +00:00
Simon McVittie
7dc12d17c8 release-checklist: Use a more copy-paste'able scp/rsync destination
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-12-09 17:06:29 +00:00
Simon McVittie
f651834427 release-checklist: Give a better reference for deprecation warnings
Commit 4ebb275ab7 disabled deprecation warnings in the Autotools build
system, which we no longer have. Future stable-branches will want to
disable deprecation warnings in Meson instead.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-12-09 17:06:06 +00:00
Simon McVittie
b97b083f9a release-checklist: Fix sequencing
`meson dist` requires the version you intend to release to have been
committed already, and does not create any generated files in the
`${srcdir}` that are intended to be committed to git.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-12-09 17:04:39 +00:00
Petr Malat
2633d6ba96 _dbus_loop_iterate: Fix OOM retry timeout handling
If there is a pending OOM watch and at the same time there is no
timeout, poll is entered with infinite timeout, because infinite
is expressed with a negative number, which is smaller than any
actual timeout.

Introduce min_poll_timeout(), which returns the smaller non-negative
number of the two, or the larger negative number if both numbers
are negative.

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/536
Signed-off-by: Petr Malat <oss@malat.biz>
[smcv: adjust whitespace]
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit a6023f49ac)
2024-12-09 17:03:01 +00:00
Simon McVittie
013f4f3c9c Merge branch 'oom_retry_tmout' into 'master'
_dbus_loop_iterate: Fix OOM retry timeout handling

Closes #536

See merge request dbus/dbus!493
2024-12-09 16:52:39 +00:00
Petr Malat
a6023f49ac _dbus_loop_iterate: Fix OOM retry timeout handling
If there is a pending OOM watch and at the same time there is no
timeout, poll is entered with infinite timeout, because infinite
is expressed with a negative number, which is smaller than any
actual timeout.

Introduce min_poll_timeout(), which returns the smaller non-negative
number of the two, or the larger negative number if both numbers
are negative.

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/536
Signed-off-by: Petr Malat <oss@malat.biz>
[smcv: adjust whitespace]
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-12-09 16:36:10 +00:00
Simon McVittie
57eaa412f0 Bump version to 1.16.99 to start 1.17.x branch
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-12-06 16:52:25 +00:00
Simon McVittie
f54a4909e3 Merge branch 'dbus-1.16', rejecting stable-branch-only changes 2024-12-06 16:51:13 +00:00
Simon McVittie
3543d23735 Post-release version bump to 1.15.91
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-12-06 16:49:59 +00:00
Simon McVittie
b236012740 Prepare 1.15.90
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-12-06 13:59:21 +00:00
Simon McVittie
841ac5efff Update AUTHORS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-12-06 13:59:14 +00:00
Simon McVittie
8bb48e6cd0 Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-12-06 13:53:23 +00:00
Simon McVittie
ef4440f8cd Merge branch '1.16-no-containers' into dbus-1.16 2024-12-06 13:43:29 +00:00
Simon McVittie
76a68867f8 Disable deprecation warnings for stable branch
We're not going to replace deprecated functions here, similar to commit
88e0ccb2 in the dbus-1.10 branch.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-12-06 13:43:04 +00:00
Simon McVittie
a6df11430b Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-11-29 16:24:38 +00:00
Simon McVittie
411add93ce Merge branch 'issue531' into 'master'
build: Check for socket(), socketpair() in -lsocket if necessary

Closes #531

See merge request dbus/dbus!491
2024-11-29 16:11:18 +00:00
Simon McVittie
1c38c6edcd build: Check for socket(), socketpair() in -lsocket if necessary
On older Solaris, these functions exist in -lsocket rather than in the
standard C library. If we can't find them immediately, try again with
-lsocket added to the dependencies.

Later, use network_libs when checking for optional functions like
socketpair(), so that we will detect it correctly. If socketpair() is
not found, dbus compiles successfully without it, but dbus-daemon will
not start because it cannot set up reload signalling.

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/531
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-11-29 16:10:31 +00:00
Simon McVittie
dce4191c64 Merge branch 'fix-RANDOM_INDEX-32bit' into 'master'
dbus-hash: Fix RANDOM_INDEX signed-integer-overflow on 32-bit

See merge request dbus/dbus!487
2024-11-29 12:58:03 +00:00
Jami Kettunen
f10e92244a dbus-hash: Fix RANDOM_INDEX signed-integer-overflow on 32-bit
Found by compiling with clang -fsanitize=signed-integer-overflow etc and
running dbus-daemon on armv7.

Signed-off-by: Jami Kettunen <jami.kettunen@protonmail.com>
2024-11-29 12:57:15 +00:00
Simon McVittie
c0d4873704 Completely remove the Containers1 interface
This interface is still not ready for production use. To minimize
confusion, let's remove it from the 1.16.x stable branch. We can have
another try during the 1.17.x cycle, via dbus/dbus!449.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-11-19 13:20:49 +00:00
Simon McVittie
1f5affa322 Merge branch 'no-containers-dir' into 'master'
bus: Don't create /run/dbus/containers if the feature is disabled

See merge request dbus/dbus!488
2024-11-19 11:28:51 +00:00
Simon McVittie
54f9aa554a bus: Don't create /run/dbus/containers if the feature is disabled
The `Containers1` interface is not stable or production-ready, and is
compile-time-optional behind a build option, which in fact currently
cannot be enabled (it intentionally provokes a compiler `#error` if
enabled). If it isn't enabled, this directory won't be useful, so
there's no reason to create it.

As discussed in <https://github.com/systemd/mkosi/issues/3189>, if we
use the `@DBUS_USER@` here, it makes `tmpfiles.d/dbus.conf` dependent
on having created the `@DBUS_USER@` via `sysusers.d` or some
appropriate distro-specific mechanism. This is problematic in distros
that split up the functionality of dbus into several layers, such as
Debian: the `@DBUS_USER@` conceptually belongs to the same layer as
the well-known system bus, but `/etc/machine-id` and
`/var/lib/dbus/machine-id` are also used by the well-known session bus,
which is orthogonal to the system bus; so we want `dbus.conf` to be in a
lower layer than the `@DBUS_USER@`.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-11-18 19:00:26 +00:00
Simon McVittie
08d64b1638 doc, maint: Publishing DTDs requires a MR to xdg-specs
We can no longer upload to specifications.freedesktop.org directly.
Instead, that area of the freedesktop.org web space is updated by
sending merge requests to the xdg/xdg-specs> project.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-11-04 15:49:39 +00:00
Simon McVittie
f4cf1ebb6d release-checklist: We only update the wiki page for new stable branches
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-11-04 15:47:53 +00:00
Simon McVittie
87204d19b8 Merge branch 'doc-devhelp' into 'master'
doc: Fix Devhelp index for reorganization of documentation files

See merge request dbus/dbus!486
2024-10-29 17:50:45 +00:00
Simon McVittie
264b5ab484 doc: Use the top-level index.html as the table of contents for Devhelp
Now that we have this table of contents, we might as well use it.

Signed-off-by: Simon McVittie <smcv@debian.org>
2024-10-29 17:49:44 +00:00
Simon McVittie
397f9789e6 doc: Use api/html to link to Doxygen docs in Devhelp index
Now that we're installing the Doxygen documentation in a subdirectory,
the Devhelp index needs to reflect that.

Fixes: 522633b4 "cmake: install api docs in html subdir"
Fixes: f546ddd9 "meson: Install Doxygen docs as api/html/*.html"
Signed-off-by: Simon McVittie <smcv@debian.org>
2024-10-29 17:49:44 +00:00
Simon McVittie
dc89ac01a9 Post-release version bump
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-29 17:48:31 +00:00
Simon McVittie
d30794756d Prepare v1.15.12
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-29 13:16:08 +00:00
Simon McVittie
7d06ca9473 Regenerate AUTHORS as per maint/release-checklist.md
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-29 13:00:23 +00:00
Simon McVittie
90619c3e58 NEWS: Start to summarize what's new in 1.16.x
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-28 19:27:27 +00:00
Simon McVittie
955db66c27 Move old NEWS into separate files, one per stable release
The main NEWS file continues to document all changes since 1.12.0,
including the entire 1.13.x/1.14.x series.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-28 19:26:19 +00:00
Simon McVittie
78883432b3 Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-28 16:13:46 +00:00
Simon McVittie
43bdf1e6d7 Merge branch 'large-rlimit-timeout' into 'master'
tests: Only check whether the first 1024 fds are close-on-exec

Closes #527

See merge request dbus/dbus!481
2024-10-28 16:10:52 +00:00
Simon McVittie
6946489326 tests: Only check whether the first 1024 fds are close-on-exec
On recent Linux systems, systemd sets the hard limit on the number of
file descriptors extremely high (about 1e9, compared with about 1e6 in
previous systemd versions or 4096 in the kernel's historical defaults),
and dbus raises its soft limit to match the hard limit. The result of
sysconf(_SC_OPEN_MAX) is based on the fd limit, and iterating linearly
through that many fds takes long enough for activation to time out.

This particular piece of code is just test instrumentation, which aims to
log (possibly fatal) warnings if any file descriptor is not close-on-exec
as it should be. In practice the test suite doesn't use anywhere near
a thousand fds, so it's sufficient to run this check against a much
smaller number of fds.

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/527
Bug-Debian: https://bugs.debian.org/1086148
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-28 16:10:39 +00:00
Simon McVittie
4e8973398f Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-28 13:29:41 +00:00
Simon McVittie
b6a6b83bb5 Merge branch 'misc-test' into 'master'
test: fix cleanup_test_socket_tempdir on Solaris

See merge request dbus/dbus!480
2024-10-18 14:19:40 +00:00
Alan Coopersmith
66170cbb21 test: fix cleanup_test_socket_tempdir on Solaris
Solaris does not allow rmdir() to remove the cwd, so chdir() out of
the tempdir before removing it.

Without this fix, misc-internal reported a failure on Solaris 11.4:
not ok 16 - failed to remove test socket directory /tmp/dbus-test-tduvWc

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-10-18 14:16:26 +00:00
Simon McVittie
c59108890a Merge branch 'fdpass' into 'master'
Fix fd limit handling in fdpass test

Closes #176

See merge request dbus/dbus!479
2024-10-14 19:24:43 +00:00