Commit graph

6945 commits

Author SHA1 Message Date
Simon McVittie
4012eb96db spec: Recommend using the same IDs for Containers1 and security-context
These two specifications have been made intentionally similar.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 18:21:50 +01:00
Simon McVittie
12f66ac590 spec: Make the Containers spec consistent with other interfaces
Follow-up after dbus!472.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 18:21:50 +01:00
Simon McVittie
093f317444 containers test: Assert metadata still works after creator disconnected
In some of the tests involving test_stop_server(), the creator of the
server (the mock container engine) already disconnected from the bus,
so it seems worthwhile to check that its credentials can still be
retrieved via GetServerInfo() even though the connection itself is no
longer there.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 18:21:50 +01:00
Simon McVittie
70930672d4 containers test: Show server/connection info in test log
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 18:21:50 +01:00
Simon McVittie
168a8edad0 containers test: Exercise StopOnDisconnect and StopOnNotify
In the STOP_SERVER_VIA_NOTIFY test, the server would stop whenever
either the mock container manager disconnects from the bus or the
notify fd is closed, whichever comes first. In the
STOP_SERVER_VIA_NOTIFY_NOT_MANAGER test, we assert that the server does
not stop when the mock container manager disconnects, only when the
notify fd is closed.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 18:21:50 +01:00
Simon McVittie
5db4c852fa containers: Add named arguments to alter how the server is stopped
This adds the initial named arguments that we anticipate we will need
for Flatpak and Snap: Flatpak will want to hold the server open until the
xdg-dbus-proxy exits, while Snap developers want to clean up the
per-container servers explicitly and have their existence stored as part
of the persistent state of the restartable snapd service.

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/186
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 18:21:50 +01:00
Simon McVittie
9a8d7fb90f containers test: Factor out waiting for the unconfined connection to close
We'll want to do this from more than one place in future.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 18:21:49 +01:00
Simon McVittie
ed65ef6708 containers test: Add infrastructure for sending fds to AddServer
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 18:21:49 +01:00
Simon McVittie
52317e15fa containers test: Show the AddServer call and response in the log
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 18:21:49 +01:00
Simon McVittie
256b9dbe1e spawn-unix: Move _dbus_unix_make_pipe() to common code
I want to use this in a test-case.

Note that this changes the error code used if pipe() fails (which in
practice should not happen) from DBUS_ERROR_SPAWN_FAILED to some
reasonable interpretation of errno.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 18:21:49 +01:00
Simon McVittie
76380efdbd containers: Convert out parameters into an a{sv}
This allows for potential future mechanisms where the caller, rather than
the message bus, is responsible for creating the socket, without needing
to have a "null-like" representation for the absence of a path and the
absence of an address (in practice the empty string).

I've left the per-container server object path as a top-level thing
rather than moving it into the a{sv}, because I don't see any reason
why we would want to crate a per-container server without having a way
to talk about it in future API calls.

Requested-by: Sebastian Wick
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 18:21:49 +01:00
Simon McVittie
70526a3381 Containers: Reserve all metadata fields for future standardization
Now that we have the instance ID, Flatpak-aware apps can look up
per-instance metadata in a Flatpak-specific way (by reading the file
that Flatpak provides), and similarly any other container framework
can provide its own mechanism to get extensible metadata; so the value
of providing container-manager-defined metadata is perhaps limited.

However, it seems valuable to have somewhere to put standardized
metadata: for example, we could have a shared specification between
Wayland and D-Bus to define a name for keys that could be common to
multiple sandbox frameworks. For example, it could include a
string that is a freedesktop.org app ID, or a string that is an icon
name, or a boolean that is true if networking is permitted.

This takes dbus/dbus#479 off the critical path for getting this feature
merged.

Helps: https://gitlab.freedesktop.org/dbus/dbus/-/issues/479
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 18:21:49 +01:00
Simon McVittie
3d5d9152aa Containers: Replace "name" with the app ID and instance ID
This aligns it with the analogous Wayland specification
security-context-v1, and in particular allows Flatpak-aware applications
to look up the instance's sandboxing parameters and other metadata.

Helps: https://gitlab.freedesktop.org/dbus/dbus/-/issues/479
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 18:21:49 +01:00
Simon McVittie
59ebc4e62a spec: Reduce repetition in Containers1
All outputs from GetServerInfo are the same as GetConnectionInfo, so
only give a very short summary in GetServerInfo.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 18:21:49 +01:00
Simon McVittie
70c9402fa8 containers: Rename "container instance" to "container server"
Flatpak has the concept of an "instance ID" for a running app, which we
should expose in Containers1, similar to the analogous Wayland
specification security-context-v1[1]. If we use the word "instance" for
both the Flatpak (or other container manager) side and the D-Bus side,
the resulting API will be really confusing.

[1] https://gitlab.freedesktop.org/wayland/wayland-protocols/-/tree/main/staging/security-context

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 18:21:49 +01:00
Simon McVittie
2c884a5e5f CI: Enable Containers1 in debug builds, explicitly disable in reduced build
This ensures that both "enabled" and "disabled" are tested, regardless
of whether it is enabled by default (currently it is not).

Create /var/local/run/dbus/containers so that we can run the tests.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 18:21:49 +01:00
Simon McVittie
0196ed3543 spec: GetConnectionCredentials doesn't include container context metadata
In early prototypes we put the Type and Name here, but that leads to
some difficult questions about whether they can be trusted, and the answer
is unfortunately "it depends".

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 18:21:49 +01:00
Simon McVittie
9428df3740 specification: Describe the trust model for container info
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 18:21:49 +01:00
Simon McVittie
af407343d1 specification: Document container info as containing the creator
This was added to the implementation after Containers was removed from
the spec.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 18:21:49 +01:00
Simon McVittie
bc4a8d8985 spec: Add an introduction to the Containers1 interface
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 18:21:49 +01:00
Simon McVittie
5e6580ca19 Reapply "spec: Document the initial Containers1 interface"
This reverts commit f8a2a03ca0.
2024-10-01 17:51:13 +01:00
Simon McVittie
3690de9398 Revert "Disable the Containers interface"
This reverts commit 9d60676ae0.
2024-10-01 17:45:22 +01:00
Simon McVittie
83476b7a93 NEWS: Update
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 15:51:23 +01:00
Simon McVittie
579afc0924 Merge branch 'message-bus-ifaces' into 'master'
spec: Give each message bus interface a section, and document Debug and Verbose

See merge request dbus/dbus!472
2024-10-01 14:41:25 +00:00
Simon McVittie
f8b9513050 spec: Document the o.fd.DBus.Verbose interface
Like Debug.Stats, this was implemented but never documented. Do so now.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 14:41:06 +00:00
Simon McVittie
07c0a5232e spec: Document the o.fd.DBus.Debug.Stats interface
We never actually documented this when it was added to the dbus-daemon.
Do so now.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 14:41:06 +00:00
Simon McVittie
ec2e24630c spec: Add a reminder of how to access Properties
Readers of the message bus specification might be encountering Properties
for the first time, so for the basic properties in the o.fd.DBus
interface, link to the interface definition.

I'm not intending to add similar text for extension interfaces like
Containers.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 14:41:06 +00:00
Simon McVittie
bafb2c455d spec: Have a sect2 per interface documented for the message bus
Previously, we arbitrarily divided o.fd.DBus into "messages"
(methods and signals), in one sect2, and Properties, in another sect2;
and for the only extended interface that is documented so far,
o.fd.DBus.Monitoring, we included its single method in the list of
o.fd.DBus methods.

This is putting too much weight on implementation details of how the
D-Bus protocol is implemented (with Properties being "less core" than
methods and signals), and not enough weight on how interfaces are
conceptually structured. It's more usual to group together all aspects
of an interface into one document or section, and the current arbitrary
separation is going to look more and more odd as we start documenting
more interfaces like Containers (dbus!449), Stats and Verbose.

Instead, repurpose the "Message Bus Messages" section to become the
documentation for the o.fd.DBus interface, and introduce a separate
section for each other interface that the message bus provides.
Each one contains a full list of methods, signals and properties (if any)
if it is specific to the message bus, or a cross-reference to a more
generic interface description if it is equally applicable to the message
bus and its clients.

Prompted by discussion on dbus!449.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 14:41:06 +00:00
Simon McVittie
a36d0e1cdb Merge branch 'apidoc-link' into 'master'
doc: Substitute DBUS_APIDOC_LINK from Meson build, not just CMake

See merge request dbus/dbus!470
2024-10-01 14:40:01 +00:00
Simon McVittie
34a31730ec meson: Substitute DBUS_APIDOC_LINK
doc/index.html.in is common to the Meson and CMake build systems, so
every time a new variable gets substituted into it, both the Meson and
CMake build systems need to provide a value for that variable.

Fixes: b58ca0e1 "cmake: Inclusion of a link in html overview file corrected"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 14:39:20 +00:00
Simon McVittie
f546ddd937 meson: Install Doxygen docs as api/html/*.html
This ensures that the Doxygen-built documentation has the same layout
in the installed files that it does in the build tree and on the
website. If we don't keep the same layout, then there is no value for
the `DBUS_APIDOC_LINK` in index.html that would be correct for both
the build tree and the installed tree. The build tree effectively has
a html subdirectory hard-coded, because that's how Doxygen lays out
its outputs.

This commit is the Meson equivalent of
commit 522633b4 "cmake: install api docs in html subdir" in the CMake
build system (dbus!473, dbus#519).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 14:39:20 +00:00
Simon McVittie
88239d7603 Merge branch 'spec-trivia' into 'master'
spec: Multiple small improvements

See merge request dbus/dbus!471
2024-10-01 14:16:18 +00:00
Simon McVittie
35c3a2f67b spec: Don't expect clients to support obsolete message buses
The newest release of the reference message bus that did not support
GetConnectionCredentials was 1.6.30, almost a decade ago.
It's entirely reasonable for new code to assume that
GetConnectionCredentials will succeed, and not implement a fallback.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 15:00:56 +01:00
Simon McVittie
c0d9495a06 spec: Improve flow of text when cross-referencing methods, etc.
`<xref>` will typically be replaced by something like
"the section called “Foo”", so if we want to name a specific method
in running text, we need to use `<link>`.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 15:00:56 +01:00
Simon McVittie
c16d34e7bf spec: Be consistent about the case of feature flags
The `AppArmor` feature flag is a case-sensitive string literal,
so consistently use its correct case-combination.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 15:00:56 +01:00
Simon McVittie
d60bc69f57 spec: Provide better cross-reference links for common interfaces
There's no need to make readers go looking for these in a larger section,
we can link directly to the individual interfaces.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 15:00:56 +01:00
Simon McVittie
a5f50e122f Merge branch 'deb12' into 'master'
Update CI jobs to be more reliable

See merge request dbus/dbus!474
2024-10-01 13:54:39 +00:00
Simon McVittie
abedc312ca Update Debian CI container from version 11 to 12
Debian 11 recently reached EOL, and we should really be using the
latest stable release as our reference.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 14:40:30 +01:00
Simon McVittie
9d5e78798d CI: Only configure wine as an exe_wrapper if we are going to run tests
This choice of exe_wrapper doesn't appear to work on Debian 12, causing
a build failure while checking that the output of the C++ compiler is
executable.

Another advantage of this is that if we're not running the test suite,
we can do a more traditional cross-build where running host-architecture
executables is impossible, which doubles as a way to prove that this
still works.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 14:40:26 +01:00
Simon McVittie
129c1c5d00 CI: Install clang with its Recommends
On Debian 12, this is necessary to get libclang-rt-14-dev (which
contains the headers for LeakSanitizer) without hard-coding the clang
major version.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 14:30:02 +01:00
Simon McVittie
4a99452aab CI: Don't run test suite under Wine on Debian
This has been noted to be unreliable (dbus#509) and we now have more
realistic test coverage on actual Windows.

I'm marking these CI jobs to do the build but not run the tests,
instead of skipping them completely, because having coverage for a
successful build on mingw-w64 (32-bit, 64-bit) bit × (release, debug)
does still seem like a useful thing for us to have.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 14:30:02 +01:00
Simon McVittie
6c8f4f0d65 CI: Comment opensuse mingw32 cmake as known-failing
See dbus#520

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 14:30:02 +01:00
Simon McVittie
34284edecf CI: Stop working around httpredir.debian.org
All Debian Docker images from the last few years use deb.debian.org,
which is reliable, by default.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 14:29:50 +01:00
Simon McVittie
c3ef9c9805 Merge branch 'more-test-deps' into 'master'
build: test/name-test/run-test.sh needs dbus-launch

See merge request dbus/dbus!468
2024-10-01 12:00:13 +00:00
Simon McVittie
e01e03cf97 build: test/name-test/run-test.sh needs dbus-launch
If we're building on Unix with the message bus and tools enabled, then
we need to compile dbus-launch before we can expect this test to pass.

Continuation of commit 55e60abe "test: add missing test dependencies".

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-10-01 11:59:52 +00:00
Simon McVittie
5f5cd5d65e Merge branch 'fix-519' into 'master'
cmake: install api docs in html subdir

Closes #519

See merge request dbus/dbus!473
2024-10-01 11:22:00 +00:00
Ralf Habacker
522633b4f9 cmake: install api docs in html subdir
CMake has previously installed the api documentation in the api/
subdirectory, but api/html is required to correspond to the link
in the generated index file (index.html).

Fix #519
2024-09-27 17:51:40 +02:00
Simon McVittie
21e94c209d Start changelog for v1.15.12
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-09-25 21:02:02 +01:00
Simon McVittie
ebc9117525 Prepare v1.15.10
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-09-25 15:16:47 +01:00
Simon McVittie
0800f981da Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-09-25 15:15:59 +01:00