]> git.ipfire.org Git - thirdparty/dbus.git/log
thirdparty/dbus.git
10 months agoselinux: Don't include unused reference count in verbose logging
Simon McVittie [Tue, 18 Feb 2025 10:37:28 +0000 (10:37 +0000)] 
selinux: Don't include unused reference count in verbose logging

libselinux 3.8 includes an API break in which the `refcnt` field of
struct security_id_t (originally intended to be a reference count, but
in practice always initialized to 1 and never modified) was renamed and
repurposed as an `id` field. This caused a build failure if dbus was
compiled with both SELinux support and verbose mode, for example in the
instrumented debug build that Debian includes in the `dbus-tests` package.

This particular piece of debug logging has little value, so just
remove it.

Reference: https://github.com/SELinuxProject/selinux/commit/e5fd7b078fb8eb0b15eb5beaccd0e6a07ec26758
Bug-Debian: https://bugs.debian.org/1096212
Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agoNEWS: Add notes about Meson behaviour not being identical to Autotools
Simon McVittie [Wed, 18 Dec 2024 14:03:10 +0000 (14:03 +0000)] 
NEWS: Add notes about Meson behaviour not being identical to Autotools

See dbus/dbus#542 for an example of one particularly significant
behaviour change.

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agoUpdate NEWS
Simon McVittie [Tue, 17 Dec 2024 12:49:13 +0000 (12:49 +0000)] 
Update NEWS

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agoREADME: Mention the -alpha, -beta, -rc tags since 1.17.x
Simon McVittie [Tue, 17 Dec 2024 12:48:18 +0000 (12:48 +0000)] 
README: Mention the -alpha, -beta, -rc tags since 1.17.x

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agoREADME: Stop describing odd/even as Linux kernel versioning
Simon McVittie [Tue, 17 Dec 2024 12:48:00 +0000 (12:48 +0000)] 
README: Stop describing odd/even as Linux kernel versioning

The Linux kernel hasn't used this versioning scheme for years
(the last odd-numbered development branch was 2.5).

We are still using the odd/even versioning scheme, and so are some other
library projects. Cite GLib and SDL as better examples of projects that
still use it.

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agoREADME.win, README.cygwin: Describe dbus4win, etc. as historical
Simon McVittie [Tue, 17 Dec 2024 12:44:57 +0000 (12:44 +0000)] 
README.win, README.cygwin: Describe dbus4win, etc. as historical

The merge of Windows-specific dbus ports into the same git repository
as the original Unix-only implementation was a long time ago now,
and exists on several stable-branches, not just master.

This also avoids explicitly mentioning the name of the master branch,
which is likely to be renamed to main in future.

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agoREADME.win: Capitalize "Windows"
Simon McVittie [Tue, 17 Dec 2024 12:43:37 +0000 (12:43 +0000)] 
README.win: Capitalize "Windows"

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agoREADME.win: Mention Meson instead of Autotools
Simon McVittie [Tue, 17 Dec 2024 12:43:25 +0000 (12:43 +0000)] 
README.win: Mention Meson instead of Autotools

The choice of build system is now Meson/CMake rather than Autotools/CMake.

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agoINSTALL, README: Simplify Meson vs. CMake recommendation
Simon McVittie [Tue, 17 Dec 2024 12:42:36 +0000 (12:42 +0000)] 
INSTALL, README: Simplify Meson vs. CMake recommendation

Now that 1.16.0 has been released and 1.15.x is EOL, it's misleading
to say that Meson is the recommended build system for Unix only on the
master branch: it's the recommended build system for Unix on the
dbus-1.16 branch, too.

This also avoids explicitly naming the master branch, which is likely
to get renamed to main.

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agoCONTRIBUTING: Replace Autotools build options with Meson equivalents
Simon McVittie [Tue, 17 Dec 2024 12:40:48 +0000 (12:40 +0000)] 
CONTRIBUTING: Replace Autotools build options with Meson equivalents

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agoCONTRIBUTING: Update details of the current branch
Simon McVittie [Tue, 17 Dec 2024 12:40:10 +0000 (12:40 +0000)] 
CONTRIBUTING: Update details of the current branch

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agotools: Fix a cross-reference to Mesa's master branch
Simon McVittie [Tue, 17 Dec 2024 12:29:37 +0000 (12:29 +0000)] 
tools: Fix a cross-reference to Mesa's master branch

Mesa has renamed its default branch to main.

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agobuild: Bump ABI current and age parameters to distinguish from 1.16.x
Simon McVittie [Mon, 16 Dec 2024 15:29:15 +0000 (15:29 +0000)] 
build: Bump ABI current and age parameters to distinguish from 1.16.x

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agoMerge branch 'dbus-1.16'
Simon McVittie [Mon, 16 Dec 2024 15:28:29 +0000 (15:28 +0000)] 
Merge branch 'dbus-1.16'

12 months agoPrepare v1.16.0 dbus-1.16.0
Simon McVittie [Mon, 16 Dec 2024 12:20:50 +0000 (12:20 +0000)] 
Prepare v1.16.0

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agoMerge branch 'dbus-1.16'
Simon McVittie [Mon, 16 Dec 2024 11:01:14 +0000 (11:01 +0000)] 
Merge branch 'dbus-1.16'

12 months agoNEWS: Update
Simon McVittie [Mon, 16 Dec 2024 11:00:00 +0000 (11:00 +0000)] 
NEWS: Update

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agoINSTALL: libexpat is not required if the dbus-daemon is not built
Simon McVittie [Mon, 16 Dec 2024 10:59:36 +0000 (10:59 +0000)] 
INSTALL: libexpat is not required if the dbus-daemon is not built

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agoINSTALL: Mention how to build as a Meson subproject
Simon McVittie [Mon, 16 Dec 2024 10:59:20 +0000 (10:59 +0000)] 
INSTALL: Mention how to build as a Meson subproject

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agomeson: Don't interpolate the result of configure_file() into a format()
Simon McVittie [Fri, 13 Dec 2024 10:53:23 +0000 (10:53 +0000)] 
meson: Don't interpolate the result of configure_file() into a format()

configure_file() returns a file object, which was not intended to be a
valid parameter for format() (even though in practice it works the way
we wanted it to), causing newer Meson versions to report deprecation
warnings.

If the version of Meson is new enough, we can use the full_path()
method. Otherwise, we'll have to re-compute the output filename.

Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 872ce4d29a4c34b1ae8bb5d4e02fdc7a600a3075)

12 months agomeson: Consistently use boolean defaults for boolean options
Simon McVittie [Fri, 13 Dec 2024 10:48:23 +0000 (10:48 +0000)] 
meson: Consistently use boolean defaults for boolean options

Meson accepts either booleans or strings as defaults for a boolean
option, but recommends booleans, and raises deprecation warnings for
strings.

Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit dc56afed594c63f3b29d68af33397072a300c310)

12 months agoMerge branch 'meson' into 'master'
Simon McVittie [Fri, 13 Dec 2024 17:39:58 +0000 (17:39 +0000)] 
Merge branch 'meson' into 'master'

meson: Fix deprecation warnings

See merge request dbus/dbus!507

12 months agomeson: Don't interpolate the result of configure_file() into a format()
Simon McVittie [Fri, 13 Dec 2024 10:53:23 +0000 (10:53 +0000)] 
meson: Don't interpolate the result of configure_file() into a format()

configure_file() returns a file object, which was not intended to be a
valid parameter for format() (even though in practice it works the way
we wanted it to), causing newer Meson versions to report deprecation
warnings.

If the version of Meson is new enough, we can use the full_path()
method. Otherwise, we'll have to re-compute the output filename.

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agomeson: Consistently use boolean defaults for boolean options
Simon McVittie [Fri, 13 Dec 2024 10:48:23 +0000 (10:48 +0000)] 
meson: Consistently use boolean defaults for boolean options

Meson accepts either booleans or strings as defaults for a boolean
option, but recommends booleans, and raises deprecation warnings for
strings.

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agoCI: Use Debian 12 as default container
Simon McVittie [Fri, 13 Dec 2024 10:54:56 +0000 (10:54 +0000)] 
CI: Use Debian 12 as default container

I don't think we use this for anything any more, because all build
targets run in some more specific container; but just in case it's
used, we should select the current stable release of Debian and not a
previous, EOL version.

Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 431c78b5fbd96b930a50e177e1f0d39e730aadae)

12 months agoMerge branch 'ci' into 'master'
Simon McVittie [Fri, 13 Dec 2024 11:17:30 +0000 (11:17 +0000)] 
Merge branch 'ci' into 'master'

CI: Use Debian 12 as default container

See merge request dbus/dbus!508

12 months agoCI: Use Debian 12 as default container
Simon McVittie [Fri, 13 Dec 2024 10:54:56 +0000 (10:54 +0000)] 
CI: Use Debian 12 as default container

I don't think we use this for anything any more, because all build
targets run in some more specific container; but just in case it's
used, we should select the current stable release of Debian and not a
previous, EOL version.

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agoMerge branch 'dbus-1.16'
Simon McVittie [Fri, 13 Dec 2024 10:32:08 +0000 (10:32 +0000)] 
Merge branch 'dbus-1.16'

12 months agoUpdate NEWS
Simon McVittie [Fri, 13 Dec 2024 10:32:02 +0000 (10:32 +0000)] 
Update NEWS

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agocmake: update minimum required version to 3.10
Ralf Habacker [Thu, 12 Dec 2024 21:02:59 +0000 (22:02 +0100)] 
cmake: update minimum required version to 3.10

This fixes a deprecation warning that compatibility with CMake < 3.10
will be removed from a future version of CMake.

Resolves: dbus/dbus#533

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
(cherry picked from commit ca39b3799ea73fb9876e306c7d87b0856207fee1)

12 months agocmake: add missing environment variables for running tests
Ralf Habacker [Wed, 11 Dec 2024 14:33:44 +0000 (15:33 +0100)] 
cmake: add missing environment variables for running tests

To achieve comparable results with Meson, the test environment should
provide the same set of environment variables when used in the source
code or the test environment.

Resolves: dbus/dbus#541

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
(cherry picked from commit 8a78585514dcf498f3282515d8cef5e5b9a51324)

12 months agoMerge branch 'fix-issue-533' into 'master'
Simon McVittie [Fri, 13 Dec 2024 10:26:40 +0000 (10:26 +0000)] 
Merge branch 'fix-issue-533' into 'master'

cmake: update minimum required version to 3.10

Closes #533

See merge request dbus/dbus!506

12 months agocmake: update minimum required version to 3.10
Ralf Habacker [Thu, 12 Dec 2024 21:02:59 +0000 (22:02 +0100)] 
cmake: update minimum required version to 3.10

This fixes a deprecation warning that compatibility with CMake < 3.10
will be removed from a future version of CMake.

Resolves: dbus/dbus#533

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
12 months agoMerge branch 'fix-issue-541' into 'master'
Simon McVittie [Thu, 12 Dec 2024 15:52:20 +0000 (15:52 +0000)] 
Merge branch 'fix-issue-541' into 'master'

cmake: add missing environment variables for running tests

Closes #541

See merge request dbus/dbus!505

12 months agocmake: add missing environment variables for running tests
Ralf Habacker [Wed, 11 Dec 2024 14:33:44 +0000 (15:33 +0100)] 
cmake: add missing environment variables for running tests

To achieve comparable results with Meson, the test environment should
provide the same set of environment variables when used in the source
code or the test environment.

Resolves: dbus/dbus#541

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
12 months agoMerge branch 'dbus-1.16'
Simon McVittie [Wed, 11 Dec 2024 16:21:26 +0000 (16:21 +0000)] 
Merge branch 'dbus-1.16'

12 months agoPost-release version bump
Simon McVittie [Wed, 11 Dec 2024 16:21:01 +0000 (16:21 +0000)] 
Post-release version bump

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agoPrepare v1.15.92 dbus-1.15.92
Simon McVittie [Wed, 11 Dec 2024 13:27:54 +0000 (13:27 +0000)] 
Prepare v1.15.92

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agoUpdate NEWS
Simon McVittie [Wed, 11 Dec 2024 13:19:40 +0000 (13:19 +0000)] 
Update NEWS

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agoMerge branch 'dbus-1.16'
Simon McVittie [Wed, 11 Dec 2024 13:16:16 +0000 (13:16 +0000)] 
Merge branch 'dbus-1.16'

12 months agoUpdate NEWS
Simon McVittie [Wed, 11 Dec 2024 13:16:10 +0000 (13:16 +0000)] 
Update NEWS

dbus!501 intentionally not mentioned here, it's a purely internal change.

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agocmake: Use a better bug reference
Simon McVittie [Wed, 11 Dec 2024 13:02:57 +0000 (13:02 +0000)] 
cmake: Use a better bug reference

Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 648f4c2c372aac207e711429886e84810ef0c387)

12 months agobus: Update a build system cross-reference
Simon McVittie [Tue, 10 Dec 2024 11:00:28 +0000 (11:00 +0000)] 
bus: Update a build system cross-reference

We no longer have an Autotools build system, but Meson sets the same
environment variables that Autotools used to set. CMake does not, yet,
but ideally should.

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/538
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 229e48f549dfb1af891545fd978974dd462777da)

12 months agosysdeps-unix: Report missing launchd session bus as non-fatal
Mohamed Akram [Tue, 10 Dec 2024 13:30:19 +0000 (17:30 +0400)] 
sysdeps-unix: Report missing launchd session bus as non-fatal

init_connections_unlocked() is called when connecting to any of the
well-known buses, and it initializes all of the well-known addresses:
session, system and starter. This means that a failure here causes
failure to connect to any one of the well-known buses, even if the
failure is actually only relevant to a different well-known bus.
As such, it should only fail on genuinely fatal errors, for example
an out-of-memory condition. It calls init_session_address() and
indirectly _dbus_lookup_session_address(), which therefore need to
have similar behaviour.

Previously, _dbus_lookup_session_address() would fail with a
fatal error whenever the macOS session bus was not correctly set up,
but that breaks the ability to connect to the system bus on macOS,
even though the system bus is not directly related to the session bus.
Instead, we should report a missing session bus as "not supported",
reserving an unsuccessful result for fatal situations like
out-of-memory. This brings _dbus_lookup_session_address_launchd()
into line with the error behaviour of _dbus_lookup_user_bus().

Closes: #510
(cherry picked from commit 827e952793b6ddda1bd84da3ae9f46204661cd6e)

12 months agocmake: Use a better bug reference
Simon McVittie [Wed, 11 Dec 2024 13:02:57 +0000 (13:02 +0000)] 
cmake: Use a better bug reference

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agoMerge branch 'issue538' into 'master'
Simon McVittie [Wed, 11 Dec 2024 12:51:55 +0000 (12:51 +0000)] 
Merge branch 'issue538' into 'master'

bus: Update a build system cross-reference

Closes #538

See merge request dbus/dbus!501

12 months agobus: Update a build system cross-reference
Simon McVittie [Tue, 10 Dec 2024 11:00:28 +0000 (11:00 +0000)] 
bus: Update a build system cross-reference

We no longer have an Autotools build system, but Meson sets the same
environment variables that Autotools used to set. CMake does not, yet,
but ideally should.

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/538
Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agoMerge branch 'diagnose-leaked-fd' into 'master'
Simon McVittie [Wed, 11 Dec 2024 12:50:14 +0000 (12:50 +0000)] 
Merge branch 'diagnose-leaked-fd' into 'master'

_dbus_check_fdleaks_leave: Try to describe what the leaked fd is

See merge request dbus/dbus!503

12 months ago_dbus_check_fdleaks_leave: Try to describe what the leaked fd is
Simon McVittie [Tue, 10 Dec 2024 13:54:00 +0000 (13:54 +0000)] 
_dbus_check_fdleaks_leave: Try to describe what the leaked fd is

Similar to ebf487ef, but in a different situation.

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agoMerge branch 'fix-macos-system-bus' into 'master'
Simon McVittie [Tue, 10 Dec 2024 16:53:11 +0000 (16:53 +0000)] 
Merge branch 'fix-macos-system-bus' into 'master'

sysdeps-unix: Report missing launchd session bus as non-fatal

Closes #510

See merge request dbus/dbus!461

12 months agosysdeps-unix: Report missing launchd session bus as non-fatal
Mohamed Akram [Tue, 10 Dec 2024 13:30:19 +0000 (17:30 +0400)] 
sysdeps-unix: Report missing launchd session bus as non-fatal

init_connections_unlocked() is called when connecting to any of the
well-known buses, and it initializes all of the well-known addresses:
session, system and starter. This means that a failure here causes
failure to connect to any one of the well-known buses, even if the
failure is actually only relevant to a different well-known bus.
As such, it should only fail on genuinely fatal errors, for example
an out-of-memory condition. It calls init_session_address() and
indirectly _dbus_lookup_session_address(), which therefore need to
have similar behaviour.

Previously, _dbus_lookup_session_address() would fail with a
fatal error whenever the macOS session bus was not correctly set up,
but that breaks the ability to connect to the system bus on macOS,
even though the system bus is not directly related to the session bus.
Instead, we should report a missing session bus as "not supported",
reserving an unsuccessful result for fatal situations like
out-of-memory. This brings _dbus_lookup_session_address_launchd()
into line with the error behaviour of _dbus_lookup_user_bus().

Closes: #510
12 months agoStart NEWS for 1.17.x
Simon McVittie [Tue, 10 Dec 2024 16:06:21 +0000 (16:06 +0000)] 
Start NEWS for 1.17.x

For now, the changes that have happened in parallel on the 1.16.x branch
are listed under 1.15.91.

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agoMerge branch 'dbus-1.16'
Simon McVittie [Tue, 10 Dec 2024 16:05:20 +0000 (16:05 +0000)] 
Merge branch 'dbus-1.16'

12 months agoUpdate NEWS for 1.16.x
Simon McVittie [Tue, 10 Dec 2024 16:00:26 +0000 (16:00 +0000)] 
Update NEWS for 1.16.x

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agotests: Exercise NSS group lookup before running tests
Simon McVittie [Tue, 10 Dec 2024 14:31:59 +0000 (14:31 +0000)] 
tests: Exercise NSS group lookup before running tests

Similar to #256, NSS plugins might open file descriptors the first time
they look up a system group, and leave them open. To avoid detecting
this as a leak, do one group lookup (which we expect to fail) before
starting testing, so that the fd is already open the first time we
call _dbus_check_fdleaks_enter(), and therefore is not considered to
have been leaked in _dbus_check_fdleaks_leave().

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/540
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 7cbb7b75dd2803fcb0c6edb18d5c43e4eaeee704)

12 months agosysdeps: Don't check for PROC_SUPER_MAGIC if it isn't defined
Simon McVittie [Mon, 9 Dec 2024 23:22:17 +0000 (23:22 +0000)] 
sysdeps: Don't check for PROC_SUPER_MAGIC if it isn't defined

Debian GNU/Hurd has fstatfs() but not PROC_SUPER_MAGIC.

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/539
Bug-Debian: https://bugs.debian.org/1089641
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 5d7b87496f3bb094b926692036ae656c31efdd8e)

12 months agointernals: Use negative numbers to indicate no malloc failure simulation
Simon McVittie [Mon, 9 Dec 2024 17:12:18 +0000 (17:12 +0000)] 
internals: Use negative numbers to indicate no malloc failure simulation

If we set the countdown to simulating a failed allocation to
_DBUS_INT_MAX, then it will decrement every time we allocate memory,
eventually reaching 0 and triggering a simulated malloc failure.
In practice this does not happen during unit testing, because all of
our tests are (intentionally!) short enough that this can't happen,
but it can happen if a build of dbus with embedded tests enabled is
used for the "real" dbus-daemon or a "real" D-Bus service, either
during debugging or unintentionally, as noted on dbus/dbus!493.

We cannot simply special-case `_DBUS_INT_MAX` to never be decremented,
because _dbus_test_oom_handling() relies on the counter being
decremented even while we are not simulating malloc failure, as a way
to count the number of allocations as an upper bound for how long to
set the countdown during subsequent test runs.

Instead, reserve all negative numbers to represent the absence of
malloc failure simulation, while still being able to count allocations
by comparing two different negative numbers.

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/535
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 0735c401a7b3c9e56096fcde8139e773067302bd)

12 months agocmake: Make intrusive (formerly embedded) tests into a separate option
Simon McVittie [Mon, 9 Dec 2024 18:16:46 +0000 (18:16 +0000)] 
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>
(cherry picked from commit 41c7570e1ea803e9635d9bcabba5fc221c94e7e6)

12 months agoRename "embedded tests" to "intrusive tests"
Simon McVittie [Mon, 9 Dec 2024 17:45:32 +0000 (17:45 +0000)] 
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>
(cherry picked from commit 9c5b5838f5ff667225a913f97006816e3e401d55)

12 months agoMerge branch 'issue540' into 'master'
Simon McVittie [Tue, 10 Dec 2024 14:58:02 +0000 (14:58 +0000)] 
Merge branch 'issue540' into 'master'

tests: Exercise NSS group lookup before running tests

Closes #540

See merge request dbus/dbus!504

12 months agotests: Exercise NSS group lookup before running tests
Simon McVittie [Tue, 10 Dec 2024 14:31:59 +0000 (14:31 +0000)] 
tests: Exercise NSS group lookup before running tests

Similar to #256, NSS plugins might open file descriptors the first time
they look up a system group, and leave them open. To avoid detecting
this as a leak, do one group lookup (which we expect to fail) before
starting testing, so that the fd is already open the first time we
call _dbus_check_fdleaks_enter(), and therefore is not considered to
have been leaked in _dbus_check_fdleaks_leave().

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/540
Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agoMerge branch 'issue530' into 'master'
Simon McVittie [Tue, 10 Dec 2024 12:30:37 +0000 (12:30 +0000)] 
Merge branch 'issue530' into 'master'

build: Allow version number to be followed by "-" and a suffix

See merge request dbus/dbus!494

12 months agobuild: Bump version number to 1.16.99-alpha
Simon McVittie [Fri, 6 Dec 2024 17:49:02 +0000 (17:49 +0000)] 
build: Bump version number to 1.16.99-alpha

This is a placeholder for the first release in the 1.17.x branch, which
is not yet ready, but is intended to be labelled as 1.17.0-alpha when
it is released.

Helps: dbus#530
Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agobuild: Allow version number to be followed by "-" and a suffix
Simon McVittie [Fri, 6 Dec 2024 17:48:04 +0000 (17:48 +0000)] 
build: Allow version number to be followed by "-" and a suffix

Some distributions are known to have shipped dbus 1.15.x as though it
was a stable release, and it isn't clear whether they knew that we use
the odd/even versioning convention like GLib does.

If we add a -alpha, -beta, -rc suffix to development versions starting
from 1.17.0, then distros that know we use odd/even versioning will
know that our development versions are not a stable-branch, and so will
distros that mistakenly think we use the "semantic versioning"
versioning convention popularized by <https://semver.org/>.

(We intentionally do not use semver, because semver would require us to
ship a new minor version every time we add new API, and we do not have
the resources to provide security support for an unlimited number of
minor versions in parallel: we need to be able to nominate a subset of
our releases as having longer-term security support, in a way that signals
to distros that these are the releases they should prefer to ship.)

CMake's `project()` doesn't allow this version number format[1], but
we intend to use version numbers where the (major, minor, micro) tuple
is enough to uniquely identify a release, so we can just tell CMake our
version number without the suffix and there will be no ambiguity.

Similarly, the dash is not allowed in GNU ld version scripts, so use
the form of the version number without the suffix there.

[1] https://gitlab.kitware.com/cmake/cmake/-/issues/16716

Helps: dbus#530
Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agoMerge branch 'hurd' into 'master'
Simon McVittie [Tue, 10 Dec 2024 11:30:05 +0000 (11:30 +0000)] 
Merge branch 'hurd' into 'master'

sysdeps: Don't check for PROC_SUPER_MAGIC if it isn't defined

Closes #539

See merge request dbus/dbus!500

12 months agosysdeps: Don't check for PROC_SUPER_MAGIC if it isn't defined
Simon McVittie [Mon, 9 Dec 2024 23:22:17 +0000 (23:22 +0000)] 
sysdeps: Don't check for PROC_SUPER_MAGIC if it isn't defined

Debian GNU/Hurd has fstatfs() but not PROC_SUPER_MAGIC.

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/539
Bug-Debian: https://bugs.debian.org/1089641
Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agoMerge branch 'issue535' into 'master'
Simon McVittie [Tue, 10 Dec 2024 11:28:49 +0000 (11:28 +0000)] 
Merge branch 'issue535' into 'master'

internals: Use negative numbers to indicate no malloc failure simulation

Closes #535

See merge request dbus/dbus!496

12 months agointernals: Use negative numbers to indicate no malloc failure simulation
Simon McVittie [Mon, 9 Dec 2024 17:12:18 +0000 (17:12 +0000)] 
internals: Use negative numbers to indicate no malloc failure simulation

If we set the countdown to simulating a failed allocation to
_DBUS_INT_MAX, then it will decrement every time we allocate memory,
eventually reaching 0 and triggering a simulated malloc failure.
In practice this does not happen during unit testing, because all of
our tests are (intentionally!) short enough that this can't happen,
but it can happen if a build of dbus with embedded tests enabled is
used for the "real" dbus-daemon or a "real" D-Bus service, either
during debugging or unintentionally, as noted on dbus/dbus!493.

We cannot simply special-case `_DBUS_INT_MAX` to never be decremented,
because _dbus_test_oom_handling() relies on the counter being
decremented even while we are not simulating malloc failure, as a way
to count the number of allocations as an upper bound for how long to
set the countdown during subsequent test runs.

Instead, reserve all negative numbers to represent the absence of
malloc failure simulation, while still being able to count allocations
by comparing two different negative numbers.

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/535
Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agoMerge branch 'intrusive' into 'master'
Simon McVittie [Tue, 10 Dec 2024 11:09:26 +0000 (11:09 +0000)] 
Merge branch 'intrusive' into 'master'

Rename "embedded tests" to "intrusive tests"

Closes #537

See merge request dbus/dbus!495

12 months agocmake: Make intrusive (formerly embedded) tests into a separate option
Simon McVittie [Mon, 9 Dec 2024 18:16:46 +0000 (18:16 +0000)] 
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>
12 months agoRename "embedded tests" to "intrusive tests"
Simon McVittie [Mon, 9 Dec 2024 17:45:32 +0000 (17:45 +0000)] 
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>
12 months agocmake: In client configuration file get DBus1_xxx variables from cmake target
Ralf Habacker [Mon, 1 Nov 2021 12:01:59 +0000 (13:01 +0100)] 
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 29c2e9141a0c0dd850c89b5196fba9fa8eb66d89)

12 months agomemory: Remove redundant guard around _dbus_decrement_fail_alloc_counter()
Simon McVittie [Mon, 9 Dec 2024 18:25:27 +0000 (18:25 +0000)] 
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 6e61173d6462b2793c213aa13d4392f232d1c6ec)

12 months agoMerge branch 'cmake-fixes' into 'master'
Simon McVittie [Tue, 10 Dec 2024 10:19:57 +0000 (10:19 +0000)] 
Merge branch 'cmake-fixes' into 'master'

cmake: In client configuration file get DBus1_xxx variables from cmake target

See merge request dbus/dbus!499

12 months agocmake: In client configuration file get DBus1_xxx variables from cmake target
Ralf Habacker [Mon, 1 Nov 2021 12:01:59 +0000 (13:01 +0100)] 
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.

12 months agoMerge branch 'mem-double-guard' into 'master'
Simon McVittie [Mon, 9 Dec 2024 23:26:19 +0000 (23:26 +0000)] 
Merge branch 'mem-double-guard' into 'master'

memory: Remove redundant guard around _dbus_decrement_fail_alloc_counter()

See merge request dbus/dbus!497

12 months agomemory: Remove redundant guard around _dbus_decrement_fail_alloc_counter()
Simon McVittie [Mon, 9 Dec 2024 18:25:27 +0000 (18:25 +0000)] 
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>
12 months agorelease-checklist: Use a more copy-paste'able scp/rsync destination
Simon McVittie [Mon, 9 Dec 2024 17:06:29 +0000 (17:06 +0000)] 
release-checklist: Use a more copy-paste'able scp/rsync destination

Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 7dc12d17c8c6908205e2f220e579c88c0068d56e)

12 months agorelease-checklist: Give a better reference for deprecation warnings
Simon McVittie [Mon, 9 Dec 2024 17:06:06 +0000 (17:06 +0000)] 
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 f651834427a603e6ac81758e5a300dca3cbe077a)

12 months agorelease-checklist: Fix sequencing
Simon McVittie [Mon, 9 Dec 2024 17:04:39 +0000 (17:04 +0000)] 
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 b97b083f9a0600c51f702cfd452755e8c0625de2)

12 months agorelease-checklist: Use a more copy-paste'able scp/rsync destination
Simon McVittie [Mon, 9 Dec 2024 17:06:29 +0000 (17:06 +0000)] 
release-checklist: Use a more copy-paste'able scp/rsync destination

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agorelease-checklist: Give a better reference for deprecation warnings
Simon McVittie [Mon, 9 Dec 2024 17:06:06 +0000 (17:06 +0000)] 
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>
12 months agorelease-checklist: Fix sequencing
Simon McVittie [Mon, 9 Dec 2024 17:04:39 +0000 (17:04 +0000)] 
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>
12 months ago_dbus_loop_iterate: Fix OOM retry timeout handling
Petr Malat [Wed, 4 Dec 2024 09:30:24 +0000 (10:30 +0100)] 
_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 a6023f49acfda099a7ccac9ebd804d553ec9d666)

12 months agoMerge branch 'oom_retry_tmout' into 'master'
Simon McVittie [Mon, 9 Dec 2024 16:52:39 +0000 (16:52 +0000)] 
Merge branch 'oom_retry_tmout' into 'master'

_dbus_loop_iterate: Fix OOM retry timeout handling

Closes #536

See merge request dbus/dbus!493

12 months ago_dbus_loop_iterate: Fix OOM retry timeout handling
Petr Malat [Wed, 4 Dec 2024 09:30:24 +0000 (10:30 +0100)] 
_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>
12 months agoBump version to 1.16.99 to start 1.17.x branch
Simon McVittie [Fri, 6 Dec 2024 16:52:25 +0000 (16:52 +0000)] 
Bump version to 1.16.99 to start 1.17.x branch

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agoMerge branch 'dbus-1.16', rejecting stable-branch-only changes
Simon McVittie [Fri, 6 Dec 2024 16:50:43 +0000 (16:50 +0000)] 
Merge branch 'dbus-1.16', rejecting stable-branch-only changes

12 months agoPost-release version bump to 1.15.91
Simon McVittie [Fri, 6 Dec 2024 16:49:59 +0000 (16:49 +0000)] 
Post-release version bump to 1.15.91

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agoPrepare 1.15.90 dbus-1.15.90
Simon McVittie [Fri, 6 Dec 2024 13:59:21 +0000 (13:59 +0000)] 
Prepare 1.15.90

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agoUpdate AUTHORS
Simon McVittie [Fri, 6 Dec 2024 13:59:14 +0000 (13:59 +0000)] 
Update AUTHORS

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agoUpdate NEWS
Simon McVittie [Fri, 6 Dec 2024 13:53:23 +0000 (13:53 +0000)] 
Update NEWS

Signed-off-by: Simon McVittie <smcv@collabora.com>
12 months agoMerge branch '1.16-no-containers' into dbus-1.16
Simon McVittie [Fri, 6 Dec 2024 13:43:29 +0000 (13:43 +0000)] 
Merge branch '1.16-no-containers' into dbus-1.16

12 months agoDisable deprecation warnings for stable branch
Simon McVittie [Fri, 6 Dec 2024 13:43:04 +0000 (13:43 +0000)] 
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>
13 months agoUpdate NEWS
Simon McVittie [Fri, 29 Nov 2024 16:24:38 +0000 (16:24 +0000)] 
Update NEWS

Signed-off-by: Simon McVittie <smcv@collabora.com>
13 months agoMerge branch 'issue531' into 'master'
Simon McVittie [Fri, 29 Nov 2024 16:11:18 +0000 (16:11 +0000)] 
Merge branch 'issue531' into 'master'

build: Check for socket(), socketpair() in -lsocket if necessary

Closes #531

See merge request dbus/dbus!491

13 months agobuild: Check for socket(), socketpair() in -lsocket if necessary
Simon McVittie [Fri, 29 Nov 2024 11:46:32 +0000 (11:46 +0000)] 
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>
13 months agoMerge branch 'fix-RANDOM_INDEX-32bit' into 'master'
Simon McVittie [Fri, 29 Nov 2024 12:58:03 +0000 (12:58 +0000)] 
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

13 months agodbus-hash: Fix RANDOM_INDEX signed-integer-overflow on 32-bit
Jami Kettunen [Sat, 9 Nov 2024 23:54:55 +0000 (01:54 +0200)] 
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>
13 months agoCompletely remove the Containers1 interface
Simon McVittie [Tue, 19 Nov 2024 13:11:13 +0000 (13:11 +0000)] 
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>