Commit graph

6772 commits

Author SHA1 Message Date
Simon McVittie
b230cf03b0 Merge branch 'override_dep_name' into 'master'
meson: Override "dbus-1" dependency name

See merge request dbus/dbus!415
2023-06-13 18:53:14 +00:00
Barnabás Pőcze
67036a2fdf meson: Override "dbus-1" dependency name
Since meson 0.54.0, it is possible to override a dependency name,
so do that to make it easy to use dbus as a subproject. After this
change, simply

  dependency('dbus-1')

will fall back to the subproject automatically and there is no need
for using `fallback` keyword argument. Of course this assumes that
the dbus source tree is at subprojects/dbus-1 and not subprojects/dbus
but it is easy to achieve that.

If the dbus source tree for some reason needs to be at subprojects/dbus,

  dependency('dbus-1', fallback: 'dbus')

may be used, which still has the advantage of not needing to
depend on the variable names in the dbus build definitions.
2023-06-13 18:12:26 +02:00
Simon McVittie
0a440c93db Merge branch 'wip/work-around-462' into 'master'
CI: Don't run windows-meson-mingw-ucrt64 by default

See merge request dbus/dbus!414
2023-06-13 13:16:30 +00:00
Simon McVittie
f8767c8e4a CI: Enable "debian mingw64 meson debug" by default
This gives us coverage for Meson mingw-w64 by default, but
cross-compiling from Debian with MSVCRT rather than a native compilation
on Windows with UCRT. When combined with "windows msys64 ucrt64 cmake",
this fills in most of the missing coverage caused by disabling
windows-meson-mingw-ucrt64 to work around dbus#462.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-13 13:59:21 +01:00
Simon McVittie
2c11190b6a CI: Don't run windows-meson-mingw-ucrt64 by default
Workaround for dbus#462: if this doesn't run reliably as a result of
external factors, then we shouldn't be using it as a CI gate.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-13 13:57:25 +01:00
Simon McVittie
d219c8af45 Merge branch 'issue-455' into 'master'
CI: Fix problem with configuration when cross building with cmake

Closes #455

See merge request dbus/dbus!413
2023-06-13 11:58:07 +00:00
Ralf Habacker
a2ae66ff1a CI: restore cross building with cmake 2023-06-12 21:37:05 +02:00
Ralf Habacker
4e45eb06b1 CI: Fix problem with configuration when cross building with cmake
Due to an adaptation of an rpm macro for cross-compiling with cmake, there
was a problem with the previous method of using the current directory as
the build directory. Instead, the command line options provided by cmake
are now used to define the source and build directories, which provide more
stable behavior.

Fix #455
2023-06-12 21:36:41 +02:00
Simon McVittie
4a1f6a0c2c Merge branch 'wip/meson-warnings' into 'master'
meson: Disable some warnings when asserts/checks are disabled

See merge request dbus/dbus!412
2023-06-07 12:26:30 +00:00
Simon McVittie
ba515347cf meson: Disable some warnings when asserts/checks are disabled
Some labels are only used when checks are enabled, and some variables
are only used when assertions and/or checks are enabled. Instead of
cluttering the code with extra #ifdefs, we silence those warnings:
they're harmless in this case. We already do this in Autotools.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-07 12:09:31 +00:00
Simon McVittie
2ca68e9544 Merge branch 'wip/issue453' into 'master'
cmake: Define _GNU_SOURCE before checking for any symbols

Closes #453

See merge request dbus/dbus!411
2023-06-07 12:08:04 +00:00
Simon McVittie
66772a683d sysdeps: Correct fallback signature of Linux close_range()
Linux generally declares syscalls with flags as type int. It's the same
ABI, but a slightly different API, and it seems better for our fallback
definition to match it exactly.

Related to dbus/dbus#453.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-06 17:30:36 +00:00
Simon McVittie
80392649da cmake: Define _GNU_SOURCE before checking for any symbols
Some of the symbols we check for, such as close_range(), are only
declared in their corresponding header files if _GNU_SOURCE was
defined.

Resolves: dbus/dbus#453
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-06 17:30:36 +00:00
Simon McVittie
67ac3e6bc3 Release v1.15.6
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-06 14:00:04 +01:00
Simon McVittie
27cbd9bad4 AUTHORS: Update
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-06 13:58:16 +01:00
Simon McVittie
05367daa10 Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-06 12:01:02 +01:00
Simon McVittie
986611ad0f monitor test: Reproduce dbus/dbus#457
The exact failure mode reported in dbus/dbus#457 is quite difficult
to achieve in a reliable way in a unit test, because we'd have to send
enough messages to a client to fill up its queue, then stop that client
from draining its queue, while still triggering a message that gets a
reply from the bus driver. However, we can trigger the same crash in a
slightly different way by not allowing the client to receive a
particular message. I chose NameAcquired.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-06 12:01:02 +01:00
hongjinghao
b159849e03 bus: Assign a serial number for messages from the driver
Normally, it's enough to rely on a message being given a serial number
by the DBusConnection just before it is actually sent. However, in the
rare case where the policy blocks the driver from sending a message
(due to a deny rule or the outgoing message quota being full), we need
to get a valid serial number sooner, so that we can copy it into the
DBUS_HEADER_FIELD_REPLY_SERIAL field (which is mandatory) in the error
message sent to monitors. Otherwise, the dbus-daemon will crash with
an assertion failure if at least one Monitoring client is attached,
because zero is not a valid serial number to copy.

This fixes a denial-of-service vulnerability: if a privileged user is
monitoring the well-known system bus using a Monitoring client like
dbus-monitor or `busctl monitor`, then an unprivileged user can cause
denial-of-service by triggering this crash. A mitigation for this
vulnerability is to avoid attaching Monitoring clients to the system
bus when they are not needed. If there are no Monitoring clients, then
the vulnerable code is not reached.

Co-authored-by: Simon McVittie <smcv@collabora.com>
Resolves: dbus/dbus#457
2023-06-06 12:01:02 +01:00
Simon McVittie
8ee5d3e044 monitor test: Log the messages that we monitored
This is helpful while debugging test failures.

Helps: dbus/dbus#457
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-06 12:01:02 +01:00
Simon McVittie
08e175a511 Revert "CI: Remove an obsolete workaround"
It appears some freedesktop CI runners still have /builds/dbus/dbus
owned by a different user ID.
This reverts commit 3f6400b8b9.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-06 11:01:00 +01:00
Simon McVittie
803e8aff8e README: Mention not opening merge requests for security issues
The dbus maintainers can open confidential merge requests by using a
private git repository, but other contributors (including most security
researchers) cannot, so the safest simple recommendation is no merge
requests.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-06 10:41:35 +01:00
Simon McVittie
c8a4aeb4ba README: Adjust wording
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-06 10:39:40 +01:00
Simon McVittie
6801627502 Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-05 19:49:31 +01:00
Simon McVittie
b6f081ee2c Merge branch 'readme-meson-steps' into 'master'
README: add meson build steps

See merge request dbus/dbus!402
2023-06-02 15:09:12 +00:00
Ahmed Abdelfattah
9f33a2d097 README: add meson build steps
* Add meson build instructions and reorder the README sections
* Fix a small typo for the security section

Signed-off-by: Ahmed Abdelfattah <a.abfattah@gmail.com>
2023-05-16 12:05:01 +00:00
Simon McVittie
a6654eae7f Merge branch 'wip/smcv/reinstate-windows-ci' into 'master'
Revert "CI: Disable native Windows builds for now"

Closes #456

See merge request dbus/dbus!406
2023-05-16 11:01:27 +00:00
Simon McVittie
d994f85f4d Revert "CI: Disable native Windows builds for now"
It seems they do work, it was just very slow to build the image.

This reverts commit a3a14ea09e.

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/456
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-05-16 11:47:16 +01:00
Simon McVittie
20c1eb5216 Merge branch 'read_procfs' into 'master'
Support /proc in _dbus_file_get_content

See merge request dbus/dbus!401
2023-05-15 20:16:02 +00:00
Luca Boccassi
4364b9ebb3 Support /proc in _dbus_file_get_content
procfs has special semantics: most files are 0 size,
only one read can be done on a file, and they are
not larger than 4MB. Enhance _dbus_file_get_content()
so that we can read files from /proc with it.

Signed-off-by: Luca Boccassi <bluca@debian.org>
2023-05-15 19:06:54 +00:00
Simon McVittie
1a74c43c0e Merge branch 'use_func_macro' into 'master'
do not use __FUNCTION__ directly

See merge request dbus/dbus!404
2023-05-15 19:01:40 +00:00
Barnabás Pőcze
d42c42d999 dbus-spawn-win: use _DBUS_FUNCTION_NAME instead of __FUNCTION__
dbus-internals.h already defines a macro which expands to the name
of the current function based on C standard version, etc. So use
that instead of hard-coding `__FUNCTION__`.

Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>
2023-05-15 18:56:09 +00:00
Barnabás Pőcze
0098e30602 dbus-sysdeps-win: do not log function name twice
`_dbus_verbose()` already logs the function name,
do not log it again in the message.

Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>
2023-05-15 18:56:09 +00:00
Barnabás Pőcze
e8af583857 dbus-internals: use _DBUS_FUNCTION_NAME in _dbus_verbose()
dbus-internals.h already defines a macro which expands to the name
of the current function based on C standard version, etc. So use
that instead of hard-coding `__FUNCTION__`.

Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>
2023-05-15 18:56:09 +00:00
Simon McVittie
16232bdd33 Merge branch 'dbus_msg_iter_fix_memleak' into 'master'
dbus_message_iter_get_signature: Fix two memory leaks

See merge request dbus/dbus!403
2023-05-15 18:55:43 +00:00
Barnabás Pőcze
b5a87e214f dbus_message_iter_get_signature: Fix two memory leaks on OOM
Previously,  `retstr` would not be freed when `_dbus_string_append_len()`
or `_dbus_string_steal_data()` failed.

Fix those by:
 * jumping to `_dbus_string_free()` when `_dbus_string_append_len()` fails
 * ignoring the return value of `_dbus_string_free()`.

The latter works because in case of failure, `ret` will be set
to NULL by `_dbus_string_steal_data()`.

Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>
2023-05-12 18:16:47 +00:00
Simon McVittie
a841b8ec8f Merge branch 'wip/smcv/fix-ci' into 'master'
Fix CI

See merge request dbus/dbus!405
2023-05-12 18:06:36 +00:00
Simon McVittie
a3a14ea09e CI: Disable native Windows builds for now
These are extremely slow (the image build is currently at 36 minutes
and still running) which is standing in the way of us having functional
CI at all. They can be re-enabled if someone will maintain them.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-05-12 18:35:13 +01:00
Simon McVittie
21f2f4f757 CI: Disable "opensuse mingw64 cmake debug" until #455 is fixed
Having some CI is better than having no CI.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-05-12 18:32:35 +01:00
Simon McVittie
a56de4684b CI: Avoid using a no-op download location that gives a 403 error
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-05-12 17:48:48 +01:00
Simon McVittie
b1712683ad CI: Make creation of user idempotent
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-05-12 17:47:25 +01:00
Simon McVittie
a6da40b206 CI: Disable OOM-testing code paths for Meson, matching Autotools and CMake
Repeatedly re-running each test with different malloc() calls failing
is really slow, and in particular this is making
dbus:dbus / marshal-recursive time out on freedesktop.org CI.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-05-12 15:40:45 +01:00
Simon McVittie
66a4119fb9 CI: Install mingw64-cross-cmake in openSUSE image
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-05-12 15:40:45 +01:00
Simon McVittie
e271f286e3 CI: Sort lists of openSUSE packages alphabetically
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-05-12 15:40:45 +01:00
Simon McVittie
7a6e9f5beb CI: Update Windows runners
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-05-12 15:40:45 +01:00
Simon McVittie
3f6400b8b9 CI: Remove an obsolete workaround
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-05-12 15:40:45 +01:00
Simon McVittie
3629e8a2e4 CI: Update to current fdo CI templates
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-05-12 15:40:45 +01:00
Simon McVittie
4a514593d6 CI: Only run for pushes to dbus
In practice the pipeline is going to fail for namespaces other than
dbus, so don't waste time on trying to run it there; only run the
detached pipeline for the MR.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-05-12 15:40:45 +01:00
Simon McVittie
dbbd4a32f1 CI: Run a detached pipeline for merge requests
After abuses of fdo infrastructure were mitigated in
freedesktop/freedesktop#540, contributors cannot usually run pipelines
in their own forks of dbus.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-05-12 15:00:34 +01:00
Simon McVittie
35ade3c8f7 Merge branch 'cmake_unistd' into 'master'
cmake: add missing HAVE_SYS_SYSCALL_H define

See merge request dbus/dbus!400
2023-03-21 20:21:22 +00:00
Luca Boccassi
62c870aa5e cmake: add missing HAVE_SYS_SYSCALL_H define
Signed-off-by: Luca Boccassi <bluca@debian.org>
2023-03-20 22:10:41 +00:00