Commit Graph

6720 Commits

Author SHA1 Message Date
Nedko Arnaudov 3e10cc7b69 LADI dbus 1.15.4.2 (2023-06-01)
• seat support is now also possible via elogind
2023-06-01 19:17:43 +03:00
Nedko Arnaudov 3c3d4665ab elogind support
Gentoo dbus-1.15.0-enable-elogind.patch imported

https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/53
https://bugs.gentoo.org/599494
2023-06-01 19:14:47 +03:00
Nedko Arnaudov 2e425bb355 Revert "NEWS: Describe the behaviour change resulting from fixing dbus#416"
This reverts commit 8246113fb1.

Using abstract sockets can improve security and does not always
reduce it.

#1
2023-05-24 18:13:22 +03:00
Nedko Arnaudov a29a8ec352 Revert "dbus-server-socket: Make unix:tmpdir equivalent to unix:dir"
This reverts commit f01382ae31.

Using abstract sockets can improve security and does not always
reduce it.

#1
2023-05-24 18:09:54 +03:00
Simon McVittie 6156578eaa Prepare v1.15.4
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-02-08 12:03:30 +00:00
Simon McVittie 50852eb085 NEWS: Add #421
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-02-08 12:03:30 +00:00
Ralf Habacker 8d54aa2ffd _dbus_string_skip_blank(): Let the final assert follow the previous search
This appears to have been a copy/paste mistake. If only blanks (defined as
spaces or tabs) were removed, then it cannot be right to check for white
space (defined as spaces, tabs, carriage return or linefeed) afterwards.

If libdbus was compiled with assertions enabled, then this is a
denial-of-service issue for dbus-daemon or other users of DBusServer:
an unauthenticated user with access to the server's socket can send
whitespace that triggers this assertion failure. We recommend that
production versions of dbus, for example in OS distributions, should be
compiled with checks but without assertions.

[smcv: expanded commit message]

Thanks: Evgeny Vereshchagin
Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/421
2023-02-08 12:03:30 +00:00
Ralf Habacker 8189a74c6c Add test for _dbus_string_skip_blank()
[smcv: Fix a memory leak]

Reproduces: https://gitlab.freedesktop.org/dbus/dbus/-/issues/421
2023-02-08 12:03:19 +00:00
Simon McVittie 7a30ab94e6 Update NEWS for 1.15.x
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-02-08 10:32:54 +00:00
Simon McVittie 3b872b44eb Merge branch 'add-ci-build-libdbus-subproject' into 'master'
gitlab-ci: build libdbus as subproject

See merge request dbus/dbus!388
2023-02-07 10:05:16 +00:00
Daniel Wagner b1e8793e8d gitlab-ci: build libdbus as subproject
Test it's possible to consume libdbus as a subproject.

Suggested-by: Simon McVittie <smcv@collabora.com>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2023-02-07 09:07:32 +01:00
Daniel Wagner cd1a9bb09a build: Use list for dbus_static_flags
Meson complains that it is only allowed to concatenate list to lists and
not strings.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Origin: https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/388
2023-02-06 14:02:55 +00:00
Simon McVittie 90a9482cca Merge branch 'add-test-header-fields' into 'master'
cmake: add missing test for header-fields

See merge request dbus/dbus!322
2023-02-06 13:58:57 +00:00
Ralf Habacker 15b6b53ff9 .gitlab-ci.yml: exclude non-functioning test 'header-fields' in job 'windows vs15-64 cmake'
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2023-02-06 13:43:59 +00:00
Ralf Habacker 57ab4c7a48 cmake: add missing test for header-fields
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2023-02-06 13:43:59 +00:00
Simon McVittie 7501a04401 Merge branch 'gitlab-ci' into 'master'
CI: Avoid changing uid, except when running installed-tests

Closes #447

See merge request dbus/dbus!392
2023-02-06 13:36:43 +00:00
Simon McVittie 25e1512c17 CI: Re-run some tests as root or as non-root, as appropriate
On Gitlab-CI we're always running the overall script as root (and
therefore we'll only enter the code path to re-run as non-root),
but when using these scripts for manual testing they might be run as
non-root to begin with.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-02-06 13:24:11 +00:00
Simon McVittie dfa7eede44 CI: Remove vestigial support for re-running tests in a Docker container
Travis CI needed this, but Gitlab-CI always runs our tests in a Docker
container of our choice, so there's never any need to enter another
(and it's not allowed anyway).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-02-06 13:23:05 +00:00
Simon McVittie ce6af6721f CI: Re-clone the git repository every time
This cleans up checkouts that were subjected to `chown -R` prior to this.

Resolves: dbus/dbus#447
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-02-06 13:14:23 +00:00
Simon McVittie 88dd9d5cc7 CI: Don't change ownership of source directory
These CI scripts were originally used on Travis-CI, which starts all
builds as an ordinary user that has the ability to become root via `sudo`.
On Gitlab-CI, we don't need that: we start as uid 0, and can do the
whole CI run like that. This also means we get somewhat better test
coverage, because some of our unit tests benefit from being run as uid 0.

The only test coverage we lose by being uid 0 is that
test_pending_fd_timeout() in test/dbus-daemon.c is skipped, because
uid 0 bypasses the limit that's under test there.
2023-02-06 13:13:04 +00:00
Simon McVittie cca6c04637 Merge branch 'alignof' into 'master'
Define _DBUS_ALIGNOF using _Alignof when using C11 or newer

See merge request dbus/dbus!389
2023-01-16 12:23:20 +00:00
Khem Raj c3e2c873ff Define _DBUS_ALIGNOF using _Alignof when using C11 or newer
WG14 N2350 made very clear that it is an UB having type definitions
within "offsetof" [1]. This patch changes the implementation of macro
_DBUS_ALIGNOF to builtin "_Alignof" to avoid undefined behavior.

clang 16+ has started to diagnose this [2]

Fixes build when using -std >= gnu11 and using clang16+

[1] https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2350.htm
[2] https://reviews.llvm.org/D133574

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-01-14 12:43:15 -08:00
Simon McVittie 218b35a57c Merge branch 'jepio/fix-log-callback-segfault' into 'master'
bus/selinux: Move vsnprintf call to avoid va_list reuse

See merge request dbus/dbus!386
2023-01-10 11:59:06 +00:00
Jeremi Piotrowski 52b73d511b bus/selinux: Move vsnprintf call to avoid va_list reuse
In log_callback() the same va_list is reused for a call to vsnprintf and
vsyslog. A va_list can't be reused in this manner, such use is undefined
behavior that changes depending on glibc version.

In current glibc versions a segfault can be observed from the callsite at
bus/selinux.c:412. When trying to log a non-auditable event, the segfault
happens in strlen inside vsyslog.

Moving the call to vsnprintf closer to audit_log_user_avc_message (which is
followed by a 'goto out') avoids the reuse and segfault.

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
2023-01-09 20:03:29 +00:00
Simon McVittie 237063358e Merge branch 'meson-fvisibility-hidden' into 'master'
meson: Use -fvisibility=hidden on Unix if supported

See merge request dbus/dbus!383
2023-01-09 15:01:52 +00:00
Simon McVittie c1661d7c5d meson: Use -fvisibility=hidden on Unix if supported
This avoids accidentally exporting all of our private symbols as part
of the LIBDBUS_PRIVATE_x.y.z verdef, including ones that don't need to
be visible outside the shared library even when testing internals
(_dbus_watch_set_handler is a good example).

Helps: https://gitlab.freedesktop.org/dbus/dbus/-/issues/437
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-01-09 14:46:02 +00:00
Ralf Habacker 81dc8af6ae Merge branch 'fix-data-race' into 'master'
Fix data race with members of struct DBusCounter

Closes #426

See merge request dbus/dbus!379
2023-01-07 09:17:43 +00:00
Ralf Habacker 1741df3b97 Fix data race in multithreaded application
This commit fixes a data race condition discovered by the
gcc thread sanitizer by also locking the associated mutex
when reading the corresponding counter.

Fixes #426
2023-01-05 16:44:25 +01:00
Ralf Habacker 20febb522b Add multithreaded unit test for DBusCounter to available build systems
The mentioned test is build on unix like platforms when embedded tests
are enabled.
2023-01-05 16:43:55 +01:00
Simon McVittie 255f103b5c Merge branch 'meson-declare-dependency' into 'master'
meson: Declare dependency for use as a subproject

See merge request dbus/dbus!368
2023-01-04 14:26:56 +00:00
Daniel Wagner afb5bbaba4 meson: Introduce message_bus and tools command line option
To make the consume libdbus via Meson's subproject use case more useful,
introduce message_bus and tools command line options which control if
the D-Bus daemon and/or the tools are build. The idea here is that
depending projects are interested only in the library.

The strong recommendation is only to build libdbus as static library:

  libdbus_dep = dependency(
    'dbus-1',
    required: get_option('libdbus'),
    fallback: ['dbus', 'libdbus_dep'],
    default_options: [
      'default_library=static',
      'embedded_tests=false',
      'message_bus=false',
      'modular_tests=disabled',
      'tools=false',
    ],
  )

This ensures that any installed D-Bus infrastructure on the target
system is not overwritten.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2023-01-04 09:35:06 +01:00
Daniel Wagner 6a774fbb79 meson: Declare dependency
Allow other Meson project to consume libdbus as subproject. For this
we need to instantiate a dependency object.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2023-01-04 09:04:57 +01:00
Ralf Habacker a33ce73f1f Merge branch 'spdx-afl-2.1-or-gpl-2.0' into 'master'
Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license

See merge request dbus/dbus!375
2023-01-04 07:54:16 +00:00
Ralf Habacker dcf62703d9 dbus/dbus-macros-internal.h: Add blank line after the copyright state
Thus it is identical with the other places.
2023-01-04 07:53:44 +00:00
Ralf Habacker 2dee523608 Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later license
The full license texts are not added because they were already
added in a previous commit.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>

see #394
2023-01-04 07:53:44 +00:00
Ralf Habacker 53733fcc58 Merge branch 'master' into 'master'
_dbus_loop_iterate: `timeout` can be defined as int

See merge request dbus/dbus!381
2023-01-04 07:40:59 +00:00
Xin Shi 5073b0f8a6 _dbus_loop_iterate: `timeout` can be defined as int
all places where `timeout` is used can be represented as int.
This MR is a response to issue #430.

Signed-off-by: Xin Shi <shixin21@huawei.com>
2023-01-04 10:24:46 +08:00
Simon McVittie fee1595c68 Merge branch 'spdx-FSFULLR' into 'master'
Add SPDX license marker for the FSFULLR license

See merge request dbus/dbus!376
2023-01-03 19:24:08 +00:00
Ralf Habacker 410704bdda Add SPDX license marker for the FSFULLR license
The associated full license text was retrieved from https://spdx.org.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2023-01-03 19:24:02 +00:00
Simon McVittie 719b9cdbab Merge branch 'fix-425' into 'master'
Permit access to /tmp dbus socket

See merge request dbus/dbus!380
2023-01-03 19:02:12 +00:00
Dave Jones 9950464761 Permit access to /tmp dbus socket
After 6e48c317 the test-apparmor-activation test fails as it can no
longer access the dbus socket in /tmp. This commit updates the apparmor
profile used within the test
2023-01-03 18:42:51 +00:00
Ralf Habacker 45b7e104ca Merge branch 'master' into 'master'
socket_handle_watch: break when `found` is TRUE in server

See merge request dbus/dbus!374
2023-01-03 10:47:04 +00:00
Aiknow 4f6e029598 socket_handle_watch: break when `found` is TRUE in server
skip useless loop when `found` is TRUE.
This MR is a response to issue #431.

Signed-off-by: Aiknow <shixin21@huawei.com>
2023-01-03 10:51:35 +08:00
Simon McVittie ce5c01ae41 Merge branch 'use-gitlab-uri' into 'master'
cleanup: Use gitlab URI for bug reporting

See merge request dbus/dbus!372
2022-11-30 19:17:33 +00:00
Marco Trevisan (Treviño) dc59aa5df2 cleanup: Use gitlab URI for bug reporting
Bugzilla is dead for long time now.
2022-11-30 16:51:27 +01:00
Simon McVittie a3636a1d9e Merge branch 'pointer-assumptions' into 'master'
Statically assert some things we assume about pointers

See merge request dbus/dbus!345
2022-11-29 22:26:39 +00:00
Simon McVittie 0b221c4694 internals: Statically assert some things we assume about pointers
Like many relatively-low-level codebases, dbus has historically assumed
that data pointers are interchangeable with function pointers (which is
implied by POSIX and also true on Windows, but not guaranteed by ISO C).

Before dbus!335 was merged, we also assumed that size_t is the same
size as a pointer (which is frequently assumed, but not guaranteed by
ISO C, and notably not true on CHERI). dbus!335 is believed to have
removed all uses of that assumption.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-11-29 22:11:07 +00:00
Simon McVittie c0805bc3f1 dbus-marshal-basic: Use _DBUS_ALIGNOF to compare alignments
This means we get the alignment comparisons even on non-gcc compilers.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-11-29 22:11:07 +00:00
Simon McVittie 721307c401 Merge branch 'cmake-licenseref' into 'master'
Fix SPDX license reference in FindGLIB2

See merge request dbus/dbus!371
2022-11-29 22:10:46 +00:00
Simon McVittie 0827d76553 Fix SPDX license reference in FindGLIB2
The `.txt` here was unnecessary.

Fixes: d6abc1da "cmake: Add BSD-style licenses"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-11-29 20:44:50 +00:00