Commit graph

6194 commits

Author SHA1 Message Date
Simon McVittie
20f623c79b Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-03-01 18:44:30 +00:00
Simon McVittie
e3cb728ee6 Merge branch 'configure_with-x_option' into 'master'
build: Fix logic for --with-x configure option

See merge request dbus/dbus!263
2022-03-01 18:28:06 +00:00
Lars Wendler
c71f013a64
Convert "if" calls to AS_IF macro for the block that handles X11 2022-03-01 19:02:22 +01:00
Lars Wendler
bf3cb42c6d
Add have_x11=no if --without-x was given to make later checks happy 2022-03-01 19:02:15 +01:00
Lars Wendler
17c88a8944
Emit an error when --with-x was given but no X11 libs were found 2022-03-01 19:01:17 +01:00
Lars Wendler
51e468d828
Move DBUS_X_* definitions into PKG_CHECK_MODULES block 2022-03-01 19:01:07 +01:00
Lars Wendler
99cc28e0eb
build: Treat --with-x[=yes] the same as --with-x=auto
Previously, --with-x would disable the check for X11 libraries, which
was not intended.
2022-03-01 18:59:00 +01:00
Simon McVittie
b6880eb675 Merge branch 'bus-inotify-error-handling' into 'master'
bus: Fix error handling for inotify_init()

See merge request dbus/dbus!235
2022-02-28 23:00:58 +00:00
Simon McVittie
25e22b2540 bus: Show the errno if inotify cannot be initialized
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-28 22:50:26 +00:00
Simon McVittie
7e61e0b53b bus: Correct check for inotify_init() failure
fd 0 is a valid fd - although if we are using stdin as our inotify fd,
something is weird somewhere.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-28 22:50:26 +00:00
Simon McVittie
f0df311466 Revert "spec: Go back to v0.38"
This reverts commit 428f60e8b2.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-28 18:20:17 +00:00
Simon McVittie
d0cdd94a3e Post-release version bump for 1.15.x
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-28 18:20:08 +00:00
Simon McVittie
6fd1509ba3 Prepare v1.14.0
Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/350
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-28 11:43:32 +00:00
Simon McVittie
428f60e8b2 spec: Go back to v0.38
Nothing changed in v0.39 yet, and it would be confusing to have the
version uploaded alongside dbus 1.14.0 say "not yet finalized".

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-28 11:23:39 +00:00
Simon McVittie
fce6a676d9 Revert "Disable MSVC CI by default for now"
This reverts commit 254b17977e.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-28 11:22:35 +00:00
Simon McVittie
90a2d9d948 Update AUTHORS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-28 11:15:32 +00:00
Ralf Habacker
c8ca3ecebc Merge branch 'doc_dbus-api-design_link_fixes' into 'master'
doc/dbus-api-design: fix broken links

See merge request dbus/dbus!257
2022-02-28 08:16:17 +00:00
Michael Nosthoff
bed735b493 doc/dbus-api-design: fix broken links
* use version independent qtdbus url
* developer.gnome.org links moved to developer-old.gnome.org
* bustle now on freedesktop gitlab
2022-02-28 08:01:34 +00:00
Ralf Habacker
fc92ceada7 Merge branch 'mingw-w64-printf' into 'master'
build: Opt out from using mingw-w64's replacement printf(), etc.

Closes #380

See merge request dbus/dbus!261
2022-02-28 07:47:19 +00:00
Simon McVittie
b03cb9f9cd CI: Make most gcc warnings fatal for CMake builds
This makes sure we notice problems early.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-27 17:09:33 +00:00
Simon McVittie
81e6a5e662 CI: Use current Debian stable release for mingw-w64 builds
Now that we have resolved the failure to build with newer mingw-w64,
we don't need to hold these back to Debian 10 'buster' and can upgrade
to the current stable release, Debian 11 'bullseye'.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-27 17:05:58 +00:00
Simon McVittie
daf362ee61 build: Opt out from using mingw-w64's replacement printf(), etc.
The Windows code in dbus is careful to use Windows-specific equivalents
of the Standard C features that are not implemented by msvcrt.dll, so
we don't need to substitute a Standard C printf implementation.

This avoids compiler warnings/errors when gcc expects us to be using
Microsoft printf syntax (`ms_printf` attribute), but newer versions of
mingw-w64 expect us to be using GNU or Standard C printf syntax
(`gnu_printf` attribute) as a result of `__USE_MINGW_ANSI_STDIO` being
enabled by default if not otherwise specified.

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/380
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-27 17:05:56 +00:00
Simon McVittie
71f74ee530 Merge branch 'ci' into 'master'
CI: Update Debian releases

See merge request dbus/dbus!260
2022-02-25 14:55:49 +00:00
Simon McVittie
61cfa140cb CI: Use https to download MSYS packages
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-25 14:08:58 +00:00
Simon McVittie
97c2f9e306 CI: Install ci-certificates
We need this to be able to download MSYS packages now.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-25 14:08:58 +00:00
Simon McVittie
cfbc3a429e CI: Build on Debian 11 'bullseye' instead of Debian 10 'buster'
This is the current stable release for Debian, making Debian 10 a much
less interesting target for backports. Add a manually-triggered job
so we can still try buster occasionally.

Continue to use buster for mingw-w64 builds until format string issues
with bullseye toolchains can be sorted out.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-25 14:08:55 +00:00
Simon McVittie
69c610f6f0 CI: Remove EOL versions of Debian and Ubuntu
Debian 9 'stretch' is EOL, and Ubuntu 16.04 is EOL unless you enter into
a special subscription with Canonical. This puts them outside our
informal security-support policy, and realistically, anyone sufficiently
change-averse to be following these distributions is not going to be
backporting a current version of dbus.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-25 13:54:05 +00:00
Simon McVittie
254b17977e Disable MSVC CI by default for now
The necessary CI runner doesn't seem to be available, and we shouldn't
let that prevent us from merging dbus changes. This can be reverted
when the runner comes back.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-25 13:54:05 +00:00
Simon McVittie
1df1955b04 build: Fix update-authors rule to work out-of-tree
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-23 19:42:46 +00:00
Simon McVittie
d15a2328f1 AUTHORS: Update from git history
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-23 19:42:26 +00:00
Simon McVittie
21784cacd3 Start development of dbus 1.13.24
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-23 19:40:15 +00:00
Simon McVittie
0381298e45 Prepare dbus 1.13.22 and spec 0.38
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-23 14:35:10 +00:00
Simon McVittie
b7fff71884 Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-23 14:30:46 +00:00
Simon McVittie
10d39a649f Merge branch 'oom-score-adj' into 'master'
Fix handling of /proc/self/oom_score_adj on Linux

Closes #374 and #378

See merge request dbus/dbus!255
2022-02-23 12:29:22 +00:00
Simon McVittie
226f24144a sysdeps-unix: Diagnose failure to open /proc/self/oom_score_adj
Previously, we silently ignored this, but now that we're more careful
about the contexts in which we try to reset the OOM score and whether
we log failures as a warning, we can let the dbus-daemon-launch-helper
show a message if it can't write there.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-22 19:31:42 +00:00
Simon McVittie
7ee72a2795 spawn-unix: Don't log an error if unable to reset Linux OOM score
We cannot safely log between fork() and exec() because it isn't an
async-signal-safe operation (in particular it might allocate memory).

We also don't want to treat a failure here as a real problem, because
it might legitimately not work: in a system dbus-daemon that has dropped
privileges from root, the pseudo-file representing this process parameter
remains owned by root and cannot be altered by the unprivileged user.

For the main use-case for this operation, the system dbus-daemon, we
have another opportunity to do this in the dbus-daemon-launch-helper
(see the previous commit).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-22 19:30:30 +00:00
Simon McVittie
2efb462466 dbus-daemon-launch-helper: Reset Linux OOM score adjustment here
Previously, we were relying on the system bus being able to reset
its OOM score adjustment after it forks, but before it execs the
dbus-daemon-launch-helper. However, it can't actually do that (leading
to dbus#378), because the system bus typically starts as root, uses its
root privileges to adjust resource limits, and then drops privileges
to the `@DBUS_USER@`, typically `dbus` or `messagebus`. This leaves the
pseudo-files in /proc for its process parameters owned by root, and the
`@DBUS_USER@` is not allowed to open them for writing.

The dbus-daemon-launch-helper is setuid root, so it can certainly
alter its OOM score adjustment before exec'ing the actual activated
service. We need to do this before dropping privileges, because after
dropping privileges we would be unable to write to this process
parameter.

This is a non-async-signal-safe context, so we can safely log errors
here, unlike the fork-and-exec code paths.

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/378
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-22 19:26:58 +00:00
Simon McVittie
c42bb64457 spawn-unix: On Linux, don't try to increase OOM-killer protection
The oom_score_adj parameter is a signed integer, with increasingly
positive values being more likely to be killed by the OOM-killer,
and increasingly negative values being less likely.

Previously, we assumed that oom_score_adj would be negative or zero,
and reset it to zero, which does not require privileges because it
meant we're voluntarily giving up our OOM-killer protection.
In particular, bus/dbus.service.in has OOMScoreAdjust=-900, which
we don't want system services to inherit.

However, systemd >= 250 has started putting a positive oom_score_adj
on user processes, to make it more likely that the OOM killer will kill
a user process rather than a system process. Changing from a positive
oom_score_adj to zero is increasing protection from the OOM-killer,
which only a privileged process is allowed to do, resulting in warnings
whenever we carry out traditional (non-systemd) service activation
on the session bus.

To avoid this, do the equivalent of:

    if (oom_score_adj < 0)
        oom_score_adj = 0;

which is always allowed.

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/374
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-22 19:26:55 +00:00
Simon McVittie
f3ffe9a873 sysdeps-unix: Factor out _dbus_reset_oom_score_adj
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-22 19:21:14 +00:00
Simon McVittie
715a1a920d spawn-unix: Correct indentation
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-02-22 19:21:12 +00:00
Simon McVittie
9b7bea10c2 Merge branch 'integration-test' into 'master'
tests: Ensure session bus has started before integration test

See merge request dbus/dbus!256
2022-02-22 17:05:05 +00:00
Simon McVittie
47a4bdfaf8 tests: Ensure session bus has started before integration test
The session dbus-daemon won't necessarily be run immediately on login
if we are using systemd socket activation for it, and the transient
services directory $XDG_RUNTIME_DIR/dbus-1/services isn't created until
it's actually run. Ping the dbus-daemon to make sure it's available.

Signed-off-by: Simon McVittie <smcv@debian.org>
Bug-Debian: https://bugs.debian.org/1005889
2022-02-21 18:09:22 +00:00
Ralf Habacker
d1ad22c93d Merge branch 'cmake-fixes' into 'master'
cmake: remove obsolete variable DBUS_SOURCE_DIR

See merge request dbus/dbus!254
2022-02-21 14:50:14 +00:00
Ralf Habacker
b6dd487d43 cmake: remove obsolete variable DBUS_SOURCE_DIR
This issue has been reported at #377

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2022-02-21 14:14:27 +00:00
Simon McVittie
25909d16c1 Merge branch 'xml-catalog' into 'master'
doc: Introduce XML catalog

See merge request dbus/dbus!202
2022-02-21 14:11:02 +00:00
Jan Tojnar
2ac9a348f0 doc: Introduce XML catalog
This adds a nice way of loading the DTD files based on the identifier
in the DOCTYPE declaration, no matter where the DTDs are installed.
See also ‘XML catalog’ Wikipedia entry and update-xmlcatalog(8).
2022-02-21 14:01:20 +00:00
Simon McVittie
7488756a0c Merge branch 'add-confidential-mr-doc' into 'master'
CONTRIBUTING.md: creation of "confidential" merge requests added

See merge request dbus/dbus!252
2022-02-21 13:55:18 +00:00
Ralf Habacker
55f79f882d CONTRIBUTING.md: creation of "confidential" merge requests added
See #368
2022-02-21 13:54:38 +00:00
Simon McVittie
817e1c6e5d Merge branch 'fix-issue-377' into 'master'
cmake: fix for ninja phony cycle related configuring errors

Closes #377

See merge request dbus/dbus!253
2022-02-17 14:57:23 +00:00
Ralf Habacker
673d48c7c9 cmake: fix for ninja phony cycle related configuring errors
A prefix has been added to the custom target names in docbook-related
macros to fix the reported error:

  ninja: error: build.ninja:xxx: multiple rules generate
  doc/dbus-xxx.1.html [-w dupbuild=err]

Fixes #377

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2022-02-17 14:12:09 +01:00