Commit graph

7147 commits

Author SHA1 Message Date
Ralf Habacker
030d48250f bus/: keep header copyright in sync with implementation
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2025-11-05 10:32:39 +01:00
Ralf Habacker
d3a0661030 bus/selinux.c|h: Add missing copyright
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2025-11-05 10:32:39 +01:00
Ralf Habacker
734a29e0ca test/data/: Add SPDX license information based on current knowledge
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2025-11-05 10:31:59 +01:00
Ralf Habacker
4498a26d33 test/name-test: Add missing license AFL-2.1 OR GPL-2.0-or-later
This file was added by an employee of ubuntu.com, which
is owned by Canonical Ltd, and they use the license
mentioned.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2025-11-05 10:31:31 +01:00
Ralf Habacker
b1473761fb test/: add missing license AFL-2.1 OR GPL-2.0-or-later
Other files added by the same author use the same license,
so it can also be used for this file.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2025-11-05 10:31:31 +01:00
Ralf Habacker
e17b0cd850 test/: add missing license AFL-2.1 OR GPL-2.0-or-later
This file was added by a member of the KDE organisation.
Other files added by members of this organization use the
license mentioned.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2025-11-05 10:31:31 +01:00
Ralf Habacker
c12b40af36 test/: add missing license AFL-2.1 OR GPL-2.0-or-later
These files were added by an employee of codefactory.se,
which use the license mentioned.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2025-11-05 10:31:31 +01:00
Ralf Habacker
b9864c7f1e test/: add missing license AFL-2.1 OR GPL-2.0-or-later
These files were added by an employee of redhat.com, which
use the license mentioned.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2025-11-05 10:31:31 +01:00
Ralf Habacker
3e98dfde6a doxbook templates: Fix issue not having license information in SPDX format
When running reuse lint it complained that license informations in SPDX
format were not present for the mentioned files.
2025-11-05 10:31:31 +01:00
Ralf Habacker
07f7b551f5 Ugrade reuse config file to modern style
This fixes the following warning when running reuse:

    "PendingDeprecationWarning: '.reuse/dep5' is deprecated.
    You are recommended to instead use REUSE.toml"
2025-11-05 10:31:31 +01:00
Simon McVittie
1bcf396c78 Merge branch 'replace-free-to-g_free' into 'main'
test: replace free to g_free because g_strdup_printf using g_malloc

See merge request dbus/dbus!537
2025-08-26 12:24:03 +00:00
GermanAizek
7015de5160 test: replace free to g_free because g_strdup_printf using g_malloc 2025-08-26 12:23:46 +00:00
Simon McVittie
649411f65d Merge branch 'rempve-excess-auth-config' into 'main'
config-parser-common: remove duplicate check "auth" config param

See merge request dbus/dbus!536
2025-08-22 19:55:42 +00:00
GermanAizek
b1b8db6e7a
config-parser-common: remove duplicate check "auth" config param 2025-08-22 22:20:10 +03:00
Simon McVittie
8c1e83deaa Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-08-19 14:37:22 +01:00
Simon McVittie
4d75035d24 Rebuild FreeBSD image with space available for some upgrades
Hopefully fixes dbus/dbus#558, but we won't know until some time has
passed.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-08-19 14:30:14 +01:00
Simon McVittie
e835c7bd1a Merge branch 'solaris-illumos' into 'main'
meson: fix builds to work on both Solaris and illumos

Closes #557

See merge request dbus/dbus!533
2025-08-19 12:34:16 +00:00
Alan Coopersmith
4c300d40cd build: add -lsocket -lnsl if needed on illumos and older Solaris
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2025-08-19 12:34:00 +00:00
Alan Coopersmith
095c199e04 build: enable solaris_console_owner_file by default on Solaris & illumos
Makes the meson config match what the autotools config used to do.

v2: include changes suggested by @smcv to allow disabling if desired

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2025-08-19 12:34:00 +00:00
Alan Coopersmith
6cda1e82a1 build: test to see which -D flags are needed on Solaris & illumos
Instead of hardcoding these as always needed, test to see, since
they're not needed on Solaris 11.4, but are on older versions & illumos.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2025-08-19 12:34:00 +00:00
Alan Coopersmith
68fe6edd9d build: default to not trying to build epoll on non-Linux systems
dbus/dbus-pollable-set-epoll.c currently errors out if __linux__ is not
defined.  Allows passing -Depoll=enabled to override.

Based on patch by Jonathan Perkin for pkgsrc on illumos:
https://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/sysutils/dbus/patches/patch-meson.build?rev=1.2
but modified to only change default of 'auto' and check for all non-Linux OSes.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2025-08-19 12:34:00 +00:00
Alan Coopersmith
14917abfa5 meson: host_os needs to check for 'sunos', not 'solaris'
https://mesonbuild.com/Reference-tables.html#operating-system-names
documents 'sunos' as the return value from .system() on Solaris & illumos

Based on patch from Jonathan Perkins for pkgsrc in:
https://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/sysutils/dbus/patches/patch-meson.build?rev=1.2
but modified to add a new platform_sunos symbol as suggested by @smcv

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2025-08-19 12:34:00 +00:00
Simon McVittie
4ed7438270 Merge branch 'locale' into 'main'
meson: remove duplicate 'locale.h' entry in check_headers

See merge request dbus/dbus!534
2025-08-19 12:32:27 +00:00
Alan Coopersmith
95782c4941 meson: remove duplicate 'locale.h' entry in check_headers
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2025-08-18 17:49:11 -07:00
Simon McVittie
5d0b20e51c Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-08-11 16:30:12 +01:00
Simon McVittie
dd998d569c Merge branch 'elogind-support' into 'main'
build: add elogind support

See merge request dbus/dbus!509
2025-08-11 15:09:54 +00:00
Dudemanguy
79e7e69aaa build: add elogind support
Checking the uid of the user seat also works if elogind is used. Add
this as an option to the build and make it mutually exclusive with
enabling systemd.
2025-08-11 14:35:17 +00:00
Simon McVittie
a2ca9bc228 Merge branch 'pollhup-fix' into 'main'
dbus-transport-socket: Handle _DBUS_POLLHUP case in socket_do_iteration

Closes #553

See merge request dbus/dbus!526
2025-08-11 13:55:51 +00:00
Gleb Popov
878f35e5fb dbus-transport-socket: Handle _DBUS_POLLHUP case in socket_do_iteration
Without this change the bus-normal-activation test on FreeBSD ends up with
a busy-loop under one of malloc failures.

Fixes #553
2025-08-11 13:37:56 +00:00
Simon McVittie
48589b3be2 Merge branch 'wip/issue556' into 'main'
sysdeps-pthread: Fix timeout overflow adjustment

Closes #556

See merge request dbus/dbus!532
2025-08-11 13:33:41 +00:00
Johan Bolmsjö
1d73f69afb sysdeps-pthread: Fix timeout overflow adjustment
Fix an off by one error which could produce a tv_nsec value of
1'000'000'000. The valid tv_nsec range is [0, 999,999,999], see
https://en.cppreference.com/w/c/chrono/timespec for reference.

Passing a timespec with a tv_nsec value of 1'000'000'000 to
pthread_cond_timedwait has been observed to cause it to return an error
code which in turn makes the DBUS library abort the application when
compiled with asserts enabled (by PTHREAD_CHECK).

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/556
Reviewed-by: Simon McVittie <smcv@collabora.com>
2025-08-11 14:08:34 +01:00
Simon McVittie
718476760e Merge branch 'wip/smcv/ci' into 'main'
CI: Update FreeBSD image

See merge request dbus/dbus!531
2025-08-08 16:36:45 +00:00
Simon McVittie
538fc647e2 CI: Update FreeBSD to 14.3
14.2 reaches end-of-life in September, and our 14.2-based image has a
sufficiently small amount of space available that it fails to upgrade
now.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-08-08 17:13:45 +01:00
Simon McVittie
a560246feb CI: Update freedesktop.org CI templates
Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-08-08 17:11:43 +01:00
Simon McVittie
37afc6128b Merge branch 'ci' into 'main'
CI: Use a more accurate URL describing the environ problem on FreeBSD

See merge request dbus/dbus!528
2025-06-09 14:02:56 +00:00
Gleb Popov
c1dafe3908 CI: Use a more accurate URL describing the environ problem on FreeBSD 2025-06-08 08:33:00 +00:00
Simon McVittie
6bba6c58c5 Merge branch 'mr524-followup' into 'main'
Make it more obvious that negative timeouts are handled correctly

See merge request dbus/dbus!525
2025-05-23 10:36:45 +00:00
Simon McVittie
481c3cd168 connection, transport: Assert that timeout >= -1 where it matters
We recommend that assertions are disabled in production builds of dbus,
which means that they are "cheap" to add to development builds as
"executable documentation" for our assumptions.

Lower-level code assumes that timeouts must be either -1 to block
forever, or non-negative to block for a finite time (but possibly 0,
to poll without blocking).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-05-23 10:36:33 +00:00
Simon McVittie
e3dcdc6227 connection: Never call _dbus_condvar_wait_timeout() with negative timeout
Previously we were checking for -1 as the special-cased "block forever"
value, but as noted on dbus!524 it is a programming error to call
_dbus_condvar_wait_timeout() with any negative timeout.

Throughout DBusConnection the timeout is in fact constrained to be >= -1
(non-negative to have a timeout, or exactly -1 to block forever) but
checking for non-negative is presumably no more expensive than checking
for exactly -1, so let's be a little more defensive here, to make it
more obvious that we're doing this correctly.

This is the only caller of _dbus_condvar_wait_timeout() in our codebase.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-05-23 10:36:33 +00:00
Simon McVittie
cee059de0c threads: Assert that timeout is non-negative
As noted in dbus!524 by source code inspection, the Unix/pthread
implementation assumes that the timeout is non-negative and does not
support a mode where it blocks forever (which we normally represent as
a negative timeout, like POSIX poll(2)).

This means that it would be a programming error if we ever call
this with a negative timeout, so put an equivalent assertion in the
platform-independent layer. We recommend that assertions are disabled in
production builds, so it's "cheap" to have a redundant assertion here.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-05-23 10:36:33 +00:00
Simon McVittie
626ae07151 timeout: Assert that the timeout interval is non-negative
We should never allocate a DBusTimeout with a negative timeout set:
if we want to wait forever for an event to happen, that's represented
by the absence of a DBusTimeout.

This ensures that code in DBusConnection can safely assume that the
timeout retrieved from a DBusTimeout will always be in its allowed range
(-1 to INT_MAX inclusive).

I've checked that all current callers get this right.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-05-23 10:36:33 +00:00
Simon McVittie
7b272b7d8b timeout: Document fallibility of _dbus_timeout_new()
Like all other functions that allocate memory, libdbus assumes that this
can fail on OOM.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-05-23 10:36:33 +00:00
Simon McVittie
51f72a14e0 connection: Make _dbus_connection_do_iteration_unlocked() static
It has no callers outside this translation unit.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-05-23 10:36:33 +00:00
Simon McVittie
0e8331151d Merge branch 'asserts' into 'main'
Fix building with asserts enabled in FreeBSD

See merge request dbus/dbus!527
2025-05-22 10:16:19 +00:00
Gleb Popov
2bf407f5bb Fix building with asserts enabled in FreeBSD
The backtrace() function on FreeBSD resides in the libexecinfo library, so
we need to link to it.
2025-05-19 10:32:55 +03:00
Simon McVittie
91eb832de0 Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-05-16 12:18:48 +01:00
Simon McVittie
aa53ceb2b9 Merge branch 'dbus-connection-timeout' into 'main'
dbus-connection: Avoid computing a negative timeout

See merge request dbus/dbus!524
2025-05-16 10:26:34 +00:00
Gleb Popov
a834a877c6 Assert that timeout >= 0 in _dbus_platform_condvar_wait_timeout 2025-05-16 10:26:23 +00:00
Gleb Popov
fdb6746d85 dbus-connection: Avoid computing a negative timeout
Getting into the `if (timeout == NULL)` block means that
timeout_milliseconds == -1, so it doesn't make sense to do arithmetic on it.

Pass -1 instead of a nonsensical value in this case
2025-05-16 10:26:23 +00:00
Simon McVittie
5035f4bda6 Merge branch 'no-hard-coded-tmpdir' into 'main'
build: Don't use build-time TMPDIR, TEMP, TMP as socket directory

Closes #551

See merge request dbus/dbus!522
2025-05-16 10:22:18 +00:00