Commit graph

738 commits

Author SHA1 Message Date
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
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
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
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
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
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
Philip Withnall
a5f8ee16ca Document the return value of dbus-send tool. 2024-05-27 15:24:18 +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
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
8ea959b24e Remove autotools related files 2023-09-01 14:05:08 +00: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
3190b488e3 Add SPDX license tags for the MIT (Expat) license, where straightforward
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-08-14 17:18:04 +00:00
Simon McVittie
7c4d0d6281 doc: Repeat a copyright notice in a form understood by SPDX tools
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-08-14 16:58:21 +01:00
Luca Boccassi
baac5ce171 spec: add ProcessFD to GetConnectionCredentials()
Make D-Bus implementations return a file descriptor
pinning the process as part of the credentials on
platforms that implement such concept, like Linux.

Pinning the process allows to defend against PID
reuse attacks, making authentication by
service/cgroup possible.

Signed-off-by: Luca Boccassi <bluca@debian.org>
2023-08-01 19:31:33 +00:00
Yen-Chin, Lee
e80f4cbf78 doc/dbus-api-design: fix wrong closing tag
The original code of 'ProgressNotification' had a wrong closing tag,
which should use '</signal>' instead of '</method>'

Signed-off-by: Yen-Chin, Lee <coldnew.tw@gmail.com>
2023-03-02 15:31:28 +08:00
Simon McVittie
6156578eaa Prepare v1.15.4
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-02-08 12:03:30 +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
Simon McVittie
33bc01e1b5 tools: Mark GPL-only files with SPDX license identifier
These files are licensed under the GPL only, without the AFL dual-license
of most of the dbus codebase.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Co-authored-by: Ralf Habacker <ralf.habacker@freenet.de>
2022-11-29 13:33:53 +00:00
Simon McVittie
cc0544cd36 spec: Mention that the system bus address might actually be in /run
The interoperable address is unix:path=/var/run/dbus/system_bus_socket.
However, in most (perhaps all) current Linux distributions, /var/run
is guaranteed to be a symbolic link to /run, and using the path in /run
has some advantages (particularly if automounters are used).

Implementations that intend to be interoperable are not required to
listen on exactly /var/run/dbus/system_bus_socket, as long as clients
that connect to that socket will work correctly. Similarly, clients
are not required to connect to exactly /var/run/dbus/system_bus_socket,
as long as the overall system (consisting of the client and the OSs
that it supports) ensures that it ends up connecting to the same
well-known system bus that is available at
/var/run/dbus/system_bus_socket.

Because of the Unix conventions for how software installs into a prefix,
building a D-Bus implementation with its default build-time
configuration options will not necessarily result in an interoperable
system bus. The system bus is normally shipped by OS distributors,
who should ensure that they have configured it in a way that is
interoperable.

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/180
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-10-11 17:14:11 +01:00
Simon McVittie
ed866a9488 Prepare v1.15.2
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-10-05 11:00:56 +01:00
Simon McVittie
d1951de9b8 spec: Mention the consequences of abstract sockets when using namespaces
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-10-02 11:43:11 +01:00
Simon McVittie
4033dc5786 spec: Clarify that unix:tmpdir may create unix:path sockets even on Linux
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-10-02 11:42:30 +01:00
Simon McVittie
c4c521d37f maint: Make maintainer-upload-docs.sh executable
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-09-22 13:52:38 +01:00
Simon McVittie
28e0a57262 Prepare spec v0.39
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-09-22 12:16:40 +01:00
Jordan Williams
fac146f44d
Use project relative paths in CMake files
This makes it possible for projects to incorporate D-Bus as a CMake sub-project in a larger CMake project.
Before this PR, doing so would result in many errors.
This is because CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR would point to directories above the D-Bus project.
Using paths relative to the project directory, PROJECT_SOURCE_DIR and PROJECT_BINARY_DIR, corrects for this.
2022-07-25 14:14:57 -05:00
Marc-André Lureau
b937c4aec1 spec: AF_UNIX now available on Windows as well
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-07-15 16:26:54 +01:00
Marc-André Lureau
e6f2eed6f8 spec: try to improve comment about AF_UNIX path
The comment refers to the nul-padding of sockaddr_un member sun_path and
using an addrlen of sizeof(sockaddr_un). There is not much need to
document an old now "broken" behaviour.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-07-15 16:26:54 +01:00
Simon McVittie
822b63fc6f maintainer-upload-docs: Use paths pointing into the source directory
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-14 11:37:48 +01:00
Simon McVittie
47deeb4a9e doc: Don't install introspect.xsl for now
Maybe this should be installed, but for now maintain parity with
Autotools.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
c74504fb7e doc: Make Meson yelp-build invocation compatible with older versions
Older versions of yelp-build like the one in Debian 11 do not allow
permuting arguments, so all options (in this case -o) must appear
before all positional parameters.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
29ae675978 doc: Write absolute path to DTDS into XML catalog
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
37e1728638 maintainer-upload-docs: Remove assumptions about source, build dirs
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00
Simon McVittie
4655d00952 maintainer-upload-docs: Fail if an undefined variable is referenced
"Unofficial strict mode" for shell scripting.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-07-13 20:36:13 +01:00