Commit graph

6880 commits

Author SHA1 Message Date
Alyssa Ross
02ae9dfdbd
meson: fix name of DBUS_ENABLE_LAUNCHD macro
This is the name used previously by autoconf, and still used by the C
code.  Presumably this meant that the launchd ended up never being
built with Meson, even if launchd support was enabled.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
Fixes: cd2e3826 ("Add Meson build system")
2024-07-21 19:52:28 +02:00
Alyssa Ross
3e24ee1e27
build: remove unused macros
These were/are used as autoconf/CMake variable names, but were never
used by C code, so there's no need to export them as macros.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
Fixes: dca6591f ("Keep cmake defines GLIB_VERSION_... in sync with autotools.")
Fixes: cd2e3826 ("Add Meson build system")
2024-07-21 19:52:16 +02:00
Ralf Habacker
68637759b9 Merge branch 'fix-dbus-send-manpage' into 'master'
Document the return value of dbus-send tool.

Closes #452

See merge request dbus/dbus!397
2024-05-27 15:24:18 +00:00
Philip Withnall
a5f8ee16ca Document the return value of dbus-send tool. 2024-05-27 15:24:18 +00:00
Ralf Habacker
fad4fc38ae CI: Disable "debian mingw64 meson debug" until #509 is fixed
See #509

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2024-05-27 16:35:04 +02:00
Ralf Habacker
750cef4baf Merge branch 'string-int-append' into 'master'
sysdeps: Remove _dbus_string_append_int(), _uint()

See merge request dbus/dbus!445
2024-05-18 12:31:46 +00:00
Simon McVittie
e159f1f406 sysdeps: Remove _dbus_string_append_int()
It's a wrapper around snprintf(), so we are not gaining any efficiency
versus _dbus_string_append_printf(), and might as well use the more
general function instead. Doing it this way might even be a little *more*
efficient, since it reduces reallocations; it's certainly more concise.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-05-18 12:19:16 +00:00
Simon McVittie
ac20c7a4ec sysdeps: Remove _dbus_string_append_uint()
It's a wrapper around snprintf(), so we are not gaining any efficiency
versus _dbus_string_append_printf(), and might as well use the more
general function instead.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-05-18 12:19:16 +00:00
Ralf Habacker
0e8d9d2c99 Merge branch 'document-send-with-reply' into 'master'
Document ownership of reference in dbus_connection_send_with_reply()

See merge request dbus/dbus!455
2024-05-18 12:00:02 +00:00
Wiebe Cazemier
da58b29399 Document ownership of reference in dbus_connection_send_with_reply()
Signed-off-by: Wiebe Cazemier <wiebe@ytec.nl>
2024-05-18 11:00:25 +00:00
Simon McVittie
42327d71f4 Merge branch 'update_api_design_doc' into 'master'
doc/dbus-api-design: Update Bustle URL and replace deprecated D-Feet with d-spy

See merge request dbus/dbus!460
2024-05-10 10:49:57 +00:00
Ludovico de Nittis
236aef6e18 doc/dbus-api-design: Replace D-Feet with d-spy
D-Feet is no longer maintained and its closest replacement, as mentioned
in the D-Feet page https://wiki.gnome.org/Apps/DFeet, is d-spy.

The project description doesn't need to be updated because d-spy
provides the same set of features that D-Feet had.

Signed-off-by: Ludovico de Nittis <ludovico.denittis@collabora.com>
2024-05-10 12:07:09 +02:00
Ludovico de Nittis
4bd2b52b23 doc/dbus-api-design: Update Bustle URL
gitlab.fd.o/bustle/bustle points to the old archived project. The new
version has been rewritten in Rust and is now hosted at
gitlab.gnome.org/World/bustle

Signed-off-by: Ludovico de Nittis <ludovico.denittis@collabora.com>
2024-05-10 12:02:13 +02:00
Ralf Habacker
e277bf9070 Merge branch 'cmake-fixes' into 'master'
cmake: complete installed files

Closes #504

See merge request dbus/dbus!459
2024-04-17 09:54:46 +00:00
Ralf Habacker
b58ca0e147 cmake: Inclusion of a link in html overview file corrected
The link for api documentation is now only inserted into the html
overview file when it is built.
2024-04-16 09:53:59 +02:00
Ralf Habacker
5e41498558 cmake: Add missing docbook-based documentation
With this commit, the html documentation for dbus-faq, dbus-specification,
dbus-test-plan, dbus-tutorial is now also created and installed.
2024-04-16 09:53:59 +02:00
Ralf Habacker
1caf0f62e0 Merge branch 'autolaunch-regression' into 'master'
sysdeps-win: Fix autolaunch: regression on Windows

Closes #503

See merge request dbus/dbus!458
2024-04-09 06:27:52 +00:00
Thomas Sondergaard
73b574bd21 sysdeps-win: Fix autolaunch: regression on Windows
Commit f20a05f60f included in dbus-1.15.0 broke autolaunch: on
Windows. autolaunch_custom_command_line_parameter shall be initalized
to null as it is later used in only one place in the code, with this
ternary:

    autolaunch_custom_command_line_parameter ? autolaunch_custom_command_line_parameter : "--session"

Closes #503
2024-04-06 21:12:53 +02:00
Simon McVittie
6c31c381e2 Merge branch 'master' into 'master'
bus/dir-watch:Do not crash when reloading configuration with > 128 dirs

Closes #481

See merge request dbus/dbus!453
2024-01-29 13:54:19 +00:00
hongjinghao
c3b1e4daa5 Do not crash when reloading configuration with > 128 dirs
When `dbus-daemon` sets more than 128 directories for `XDG_DATA_DIRS`,
none of the elements in `new_dirs` will be `NULL`, which resulted in
these loops reading out-of-bounds (undefined behaviour). In practice
this led to a crash.

To avoid this, make sure to stop iteration at the end of the array.

[smcv: Expanded commit message]
Resolves: dbus/dbus#481
2024-01-29 13:31:57 +00:00
Simon McVittie
00449e7543 Merge branch 'meson-visual-studio-2022' into 'master'
meson: Use check_header to confirm headers work

Closes #494

See merge request dbus/dbus!454
2024-01-15 20:00:43 +00:00
Thomas Sondergaard
e52ccaf7c3 meson: Use check_header to confirm headers work
instead of using has_header use check_header to confirm the header
works. This is necessary to get the meson build to work with Visual
Studio 2022. It has <stdatomic.h> but it does not actually work when
compiling a C program. A minimal C program that include <stdatomic.h>
fails with the following errors:

    C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(36): error C2061: syntax error: identifier 'atomic_bool'
    C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(36): error C2059: syntax error: ';'
    C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(37): error C2061: syntax error: identifier 'atomic_char'
    C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.38.33130\include\vcruntime_c11_stdatomic.h(37): error C2059: syntax error: ';'
    ...
    ...

check_header is consistent with CMake's

    check_include_file(stdatomic.h  HAVE_STDATOMIC_H)

which is why the CMake-based build of dbus works with Visual Studio
2022, while the meson build doesn't.

Fixes #494
2024-01-04 17:57:25 +01:00
Ralf Habacker
d9756df2f0 Merge branch 'issue489' into 'master'
CI: Fix more test failures

Closes #489 and #488

See merge request dbus/dbus!452
2023-12-01 21:45:18 +00:00
Simon McVittie
06606bd8cd CI: Set language environment variables to safe values
Recent versions of glibc support C.UTF-8 natively, and both Debian and
openSUSE (which we use for our CI) have been patching it into our glibc
versions for several years before that.

Helps: https://gitlab.freedesktop.org/dbus/dbus/-/issues/488
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-12-01 19:10:56 +00:00
Simon McVittie
accbd6d041 CI: Don't re-run the tests when preparing to build as a subproject
After running the test suite, we don't need (or want) to re-run the test
suite as a side-effect of producing a dist tarball. Historically, this
test-case used Autotools `make dist`, not `make distcheck`, but when
we removed the Autotools build system, it was replaced with
`meson dist` (similar to Autotools `make distcheck`). Change that to
`meson dist --no-tests`, which is more like Autotools `make dist` as
originally intended.

In particular, when we re-ran the test suite, we weren't filtering out
the time-consuming and timeout-prone tests that emulate malloc()
failures, which we don't normally intend to run in CI.

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/489
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-12-01 19:03:49 +00:00
Simon McVittie
ed87c10fdc CI: Remove meson-dist and cmake-dist build systems
Before we removed the Autotools build system, these meant: do a
`make dist` with Autotools, then unpack the resulting tarball, and build
it with Meson or CMake (as appropriate). This was important because the
contents of an Autotools `make dist` differed significantly from what's
in git: only the files that were explicitly declared as sources in the
Autotools build system were distributed, and Autotools would also add its
own generated cruft.

Now that we're doing releases with Meson, the official source release
artifact is basically `git archive`, so there's much less need to
distinguish between official source releases and what's in git, and these
variant build systems became simple aliases for meson and cmake.
Remove those aliases from tools/ci-build.sh, and stop using them in
.gitlab-ci.yml.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-12-01 19:00:20 +00:00
Simon McVittie
c807028db4 Merge branch 'fix-ci-build' into 'master'
CI: force update opensuse image to a newer version

Closes #487

See merge request dbus/dbus!451
2023-12-01 18:09:05 +00:00
Ralf Habacker
79e33f2a3f CI: on openSUSE use cmake from the windows:mingw project instead from devel:tools:building
Since this repo is already used for mingw builds, the additional repo and
associated problems can be avoided.
2023-12-01 17:18:01 +01:00
Ralf Habacker
fa713e51a6 CI: add hint when to update the build images 2023-12-01 16:51:54 +01:00
Ralf Habacker
47d286ef7c CI: force update opensuse image to a newer version
Since a time-frozen image is used in the CI, the tag must be changed to
update to a newer minor version.

Fixes #487
2023-12-01 16:51:28 +01:00
Simon McVittie
172aa1c474 Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-09-01 17:26:54 +01:00
Simon McVittie
1932afdc38 Merge branch 'remove-autotools-support' into 'master'
Remove autotools build support

Closes #443

See merge request dbus/dbus!378
2023-09-01 16:06:10 +00:00
Ralf Habacker
4afcc80544 README,INSTALL: remove references to the autotools build system 2023-09-01 14:05:08 +00:00
Ralf Habacker
aab6e74794 .gitignore: remove autotools related files and pattern 2023-09-01 14:05:08 +00:00
Ralf Habacker
8ea959b24e Remove autotools related files 2023-09-01 14:05:08 +00:00
Ralf Habacker
ff80051410 Remove autotools support from CI jobs
The 'debian mingw32 autotools debug' job was replaced with a corresponding
meson related job named 'debian mingw32 meson debug' and the remaining
autotools related jobs were removed.

The drop in replacement job for 'debian mingw64 autotools' is
'debian mingw32 meson' and is now build by default.
2023-09-01 14:05:08 +00:00
Simon McVittie
0a90d29583 Merge branch 'fix-y2038' into 'master'
time: use dbus_int64_t for seconds instead of long

See merge request dbus/dbus!444
2023-08-24 13:13:37 +00:00
Alexander Kanavin
4c658af0b8 time: use dbus_int64_t for seconds instead of long
On 32 bit systems long will overflow in 2038, causing complete breakage.
This is confirmed by running dbus's test suite on a 32 bit system
with system time set to 2040 (and configured to use 64 bit time_t of course).

Note that both timespec and timeval are specified with time_t for the
seconds component. This should propagate everywhere where that data is
passed and stored, but previously _dbus_get_monotonic_time() and
_dbus_get_monotonic_time() would truncate it to long.

Also add a function for parsing dbus_int64_t from
files, as existing functions can only handle long.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
2023-08-23 14:42:05 +02:00
Simon McVittie
67a7ee7792 Start 1.15.10 development
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-08-21 20:53:07 +01:00
Simon McVittie
c4c868a84b Prepare v1.15.8
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-08-21 18:19:44 +01:00
Simon McVittie
a7fbf3f049 AUTHORS: Update
Automated change:

    ninja -C ${builddir} maintainer-update-authors

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-08-21 18:19:44 +01:00
Simon McVittie
ee03ffc898 Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-08-21 17:55:00 +01:00
Simon McVittie
39d64f70a3 Merge branch 'issue343-3' into 'master'
sysdeps: Improve error reporting for looking up a user

See merge request dbus/dbus!442
2023-08-21 16:50:06 +00:00
Simon McVittie
6f6f861a3a userdb: Use "goto out" pattern for _dbus_groups_from_uid()
This makes it easier to verify that _dbus_user_database_unlock_system()
is called on all exit paths. The only early-return is when locking the
userdb failed.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-08-21 13:49:31 +00:00
Simon McVittie
8de818153b sysdeps: Improve error reporting for looking up a user
Our implementation always assumed that both code paths set errno, but
according to their API documentation, getpwnam_r and getpwuid_r actually
don't: they *return* a code from the same pseudo-enum as errno. They
also return 0 (but with a NULL struct passwd) if the user is not found,
which these APIs don't count as an error (but we do).

Similarly, in the legacy getpwnam/getpwuid code path, it is unspecified
whether looking up a nonexistent user will set errno or not.

Having retrieved an errno-like error code, we might as well use it in
the human-readable message and not just the machine-readable code,
because the human-readable message is what ends up in the system log.

Helps: https://gitlab.freedesktop.org/dbus/dbus/-/issues/343
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-08-21 13:49:31 +00:00
Simon McVittie
12b367daaa sysdeps: Give a more useful error if unable to resolve a numeric uid
If we want to get the struct passwd corresponding to uid 42, but we
can't, it's much better to say

    User ID "42" unknown

rather than

    User "???" unknown

Helps: https://gitlab.freedesktop.org/dbus/dbus/-/issues/343
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-08-21 13:49:31 +00:00
Simon McVittie
80b90e570e sysdeps-unix: Deduplicate error handling for getpwnam and getpwnam_r
The only difference between these was that we only needed to allocate
and free buf in the getpwnam_r case. We expect that all reasonable
Unix platforms will have getpwnam_r (it's in POSIX) so adding a no-op
dbus_free(NULL) to the getpwnam code path seems harmless.

This will be helpful when we make the error handling better, in a
subsequent commit.

Helps: https://gitlab.freedesktop.org/dbus/dbus/-/issues/343
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-08-21 13:49:31 +00:00
Simon McVittie
672f05e5f3 Merge branch 'issue473' into 'master'
bus: Don't crash if inotify fails, even under DBUS_FATAL_WARNINGS=1

Closes #473

See merge request dbus/dbus!441
2023-08-21 13:49:14 +00:00
Simon McVittie
62692cd7e7 bus: Don't crash if inotify fails, even under DBUS_FATAL_WARNINGS=1
When running tests, we use DBUS_FATAL_WARNINGS=1 to make the tests fail
on internal errors. Failing to set up inotify is not really an internal
error: it's more like an environmental error, which can occur for
reasons outside our control.

Instead, log using bus_context_log(), which never crashes the process
and always just logs a warning.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/473
2023-08-18 18:56:59 +00:00
Simon McVittie
01e65daa6a Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-08-18 19:55:59 +01:00