Commit graph

693 commits

Author SHA1 Message Date
Simon McVittie
6589f664fa spec: Document versioning of eavesdrop='true'
The wording and formatting used here is consistent with other
semi-recently-added match keys.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101567
2017-06-29 17:46:47 +01:00
Simon McVittie
8b1b8beece spec: Formally deprecate eavesdropping
Reviewed-by: Philip Withnall <withnall@endlessm.com>
[smcv: Wrap BecomeMonitor in <literal> as per Philip's review]
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101567
2017-06-29 17:46:44 +01:00
Simon McVittie
3f3e8d5dd2 spec: Do not promise match rules with eavesdrop='true' can be added
This is no longer true, and it seems less misleading to raise an
error than to obey the letter of the spec by quietly ignoring calls
from an inappropriate caller.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101567
2017-06-29 17:46:26 +01:00
Simon McVittie
b951c5006c Add unix:dir=/something addresses
These are like unix:tmpdir=/something, except that the resulting
socket is always path-based, never abstract.

This is desirable for two reasons:

* If a Linux container manager wants to expose a path-based socket
  into the container, it can do so by bind-mounting it in the
  container's filesystem namespace. That cannot work for abstract
  sockets because they are not files.

* Conversely, if a Linux container manager does not want to expose
  a path-based socket in the container, it can avoid bind-mounting it,
  or bind-mount some harmless object like /dev/null over it.
  That cannot work for abstract sockets because access to abstract
  sockets is part of the network namespace, which is all-or-nothing.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101567
2017-06-29 14:03:03 +01:00
Simon McVittie
e327478e75 spec: Document the Features and Interfaces properties on o.fd.DBus
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101257
2017-06-08 17:00:22 +01:00
Simon McVittie
b460f9117b spec: Document the Peer and Properties interfaces for the message bus
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101257
2017-06-08 17:00:14 +01:00
Simon McVittie
b62a77118a spec: Document the canonical object path for the bus driver
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101256
2017-06-02 10:43:34 +01:00
Tom Gundersen
5f499a5040 spec: Fix indentation
[smcv: separated out from a larger commit, added commit message]
Reviewed-by: Simon McVittie <smcv@collabora.com>
2017-05-31 16:28:02 +01:00
Tom Gundersen
f9330c02d0 spec: Re-word documentation of ListQueuedOwners
This was previously written in an unusual message-passing-oriented
style, which obscured the meaning. Use a more method-call-oriented
style instead.

[smcv: separated out from a larger commit, added commit message]
Reviewed-by: Simon McVittie <smcv@collabora.com>
2017-05-31 16:27:51 +01:00
Tom Gundersen
93136d6245 spec: Re-word documentation of ReleaseName
This was previously written in an unusual message-passing-oriented
style, which obscured the meaning. Use a more method-call-oriented
style instead.

[smcv: separated out from a larger commit, added commit message]
Reviewed-by: Simon McVittie <smcv@collabora.com>
2017-05-31 16:27:34 +01:00
Tom Gundersen
f612b067eb Spec: Re-word documentation of RequestName
This was previously written in an unusual message-passing-oriented
style, which obscured the meaning. Use a more method-call-oriented
style instead.

[smcv: separated out from a larger commit, added commit message]
Reviewed-by: Simon McVittie <smcv@collabora.com>
2017-05-31 16:26:06 +01:00
Simon McVittie
6725cac9d0 spec: Move ListQueuedOwners API description to list of methods
Tom Gundersen pointed out that RequestName, ReleaseName and
ListQueuedOwners were documented in their own section instead of being
put together with the other method calls, which makes it more difficult
to apply changes consistently across all methods.

I'm moving them one at a time to make the changes reviewable, since
the diff resulting from moving all three as a unit is too large to
review sensibly.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-05-31 16:26:05 +01:00
Simon McVittie
f3f347a850 spec: Move ReleaseName API description to list of methods
Tom Gundersen pointed out that RequestName, ReleaseName and
ListQueuedOwners were documented in their own section instead of being
put together with the other method calls, which makes it more difficult
to apply changes consistently across all methods.

I'm moving them one at a time to make the changes reviewable, since
the diff resulting from moving all three as a unit is too large to
review sensibly.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-05-31 16:25:59 +01:00
Simon McVittie
24a5eca834 spec: Move RequestName API description to list of methods
Tom Gundersen pointed out that RequestName, ReleaseName and
ListQueuedOwners were documented in their own section instead of being
put together with the other method calls, which makes it more difficult
to apply changes consistently across all methods.

I'm moving them one at a time to make the changes reviewable, since
the diff resulting from moving all three as a unit is too large to
review sensibly.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-05-31 16:24:06 +01:00
Simon McVittie
01019f2bb4 Ensure hyphen/minus is treated as literal in regexes
Each U+002D HYPHEN-MINUS in [0-9A-Za-z_-/.\] is treated as a member of a
range. The third one, which appears to have been intended to be a
literal, is part of an empty range because the starting point
U+005F LOW LINE is greater than the endpoint U+002F SOLIDUS, resulting
in at least some grep implementations not considering U+002D, U+002F
or U+005F to match the pattern. This resulted in one of the
dbus-launch tests being unintentionally skipped when it used a
regex based on the one in the spec.

regex(7) suggests "To include a literal '-' [in a bracketed character
set], make it the first or last character".

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=100686
2017-04-18 12:46:20 +01:00
Philip Withnall
71959d5bca doc: Clarify /etc/dbus-1/system.d and /usr/share/dbus-1/system.d
The documentation generally only mentioned the directory in /etc, even
though we actually prefer security policies to be installed in
/usr/share to allow for stateless and volatile systems (i.e. booting up
with an empty /etc).

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99901
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2017-02-24 18:34:22 +00:00
Simon McVittie
9381469dca dbus-daemon(1): Describe how session and system services are found
For Unix, this partially duplicates the D-Bus Specification, but
provides more detail about the intention of each search path element.
It also documents the non-standardized path elements searched by the
reference implementation.

For Windows, there are no standardized path elements in the D-Bus
Specification (and it isn't clear how useful it would be to standardize
them, since Windows software that uses D-Bus tends to be installed
as an integrated "stack" with a bundled copy of a suitable dbus-daemon),
so we just document what the reference implementation does.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99825
Reviewed-by: Philip Withnall <withnall@endlessm.com>
[smcv: fix formatting nitpicks]
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2017-02-21 13:26:29 +00:00
Simon McVittie
968e2cce93 spec: Don't say implementation-specific locations must be lowest priority
We're treating transient services as higher-priority than those in
the XDG_DATA_HOME or XDG_DATA_DIRS, which is consistent with systemd.

The specific list used by the standard session dbus-daemon will be
added to dbus-daemon(1) in the next commit.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99825
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2017-02-21 13:24:04 +00:00
Simon McVittie
c64db84836 Start towards 1.11.10
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-11-29 12:31:23 +00:00
Simon McVittie
c45454668b dbus 1.11.8 and D-Bus Specification 0.30
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-11-28 20:25:35 +00:00
Simon McVittie
457f79c262 Spec: document AppArmor mediation of auto-starting
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98666
2016-11-28 12:12:01 +00:00
Simon McVittie
8cb7194176 Spec: be clearer about "starting" and "activation" being synonyms
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98671
2016-11-22 19:02:20 +00:00
Philip Withnall
8eca3f6ed9 spec: Clarify behaviour of o.f.D.P.GetAll
Clarify its intended behaviour in two situations:
 • For interfaces which have no properties.
 • Where some properties are not visible to the caller (due to access
   control, for example).

The intention here is for this behaviour to be mandatory, but given that
this is quite late on in the specification’s life, and various D-Bus
libraries like dbus-glib and telepathy-glib cannot support access
control at a per-property level, for example. GDBus can, although it’s
questionable whether this is a good idea. Deliberately leave the
specification open to allow access control at a higher level as well
(such as per-(object, interface)).

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=36190
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-11-22 11:26:46 +00:00
Simon McVittie
086ec1a8f0 Spec: mostly use versioned interface and bus names
Using versioned names here reinforces the advice given in
<https://dbus.freedesktop.org/doc/dbus-api-design.html#api-versioning>.

I haven't added versions to the sample parameters "com.example.tea" and
"com.example.cappuccino" for methods that query information about
names, on the basis that I assume they are more likely to be intended
to represent an implementation than an API.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98671
2016-11-22 11:24:24 +00:00
Simon McVittie
239618fac6 Spec: document systemd activation
We didn't say that SystemdService existed. Now we do, together with
enough context to make it make sense.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98671
2016-11-22 11:24:20 +00:00
Simon McVittie
28bbac7dc8 Spec: document what auto-starting is, and recommend it
For something we recommend, that is important enough to have its own
header flag, it doesn't have very good documentation. Redo the text
to suggest that auto-starting is the normal thing and
StartServiceByName is the oddity. That's usually a good principle
to follow, since it dodges time-of-check/time-of-use issues, and the
method call that you presumably wanted to do needs to handle errors
anyway.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98671
2016-11-22 11:24:16 +00:00
Simon McVittie
bda106632a Spec: be clearer about what activation means
The spec previously mentioned that CORBA calls this activation, but
did not explicitly say that D-Bus has copied this jargon term.
It's 2016, and developers are probably more likely to be familiar
with D-Bus than with CORBA at this point: explicitly say that *our*
jargon term for this action is activation.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98671
2016-11-22 11:23:31 +00:00
Simon McVittie
655b3e613c Release 1.11.6 and spec 0.29
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-10-10 10:19:54 +01:00
Philip Withnall
371e7109f8 doc: Install introspection and busconfig DTDs
Install them to $(datadir)/xml/dbus-1, which seems to be the standard
location for installed DTDs. This means that developers can use them to
validate their introspection XML, and sysadmins can use them to validate
their bus configuration files.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89011
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-10-05 10:08:10 +01:00
Philip Withnall
f354940111 spec: Allow <annotation> in <arg> elements in introspection XML
This is widely used in practice (especially by GLib — just look at files
in /usr/share/dbus-1/interfaces/), and there is no reason not to allow
it. Update the specification, introspection DTD and XSL file to allow
and represent it.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=86162
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-10-03 11:33:47 +01:00
Philip Withnall
699fbe8df6 doc: Add missing space in introspect.xsl
This adds a space in the output between ‘annotation’ and the key of the
annotation. A Saturday afternoon cosmetic fix.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=86162
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-10-03 11:33:34 +01:00
Philip Withnall
bfebafc256 spec: Recommend against using ‘/’ for object paths
As discussed in http://0pointer.de/blog/projects/versioning-dbus.html
and in https://dbus.freedesktop.org/doc/dbus-api-design.html,
un-versioned object paths make it hard to work out which interface a
signal was emitted from.

Clarify this in the specification to try and avoid people making this
mistake.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37095
Reviewed-by: Simon McVittie <smcv@debian.org>
2016-10-01 16:32:51 +01:00
Simon McVittie
1c807207bb dbus-daemon: add --syslog, --nosyslog, --syslog-only
Like --fork and --nofork, these override what the configuration says.

Use --syslog-only to force the systemd services to log to the Journal
(via syslog, which means we see the severity metadata) instead of
testing sd_booted() in the configuration implementation.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-09-30 19:36:50 +01:00
Simon McVittie
b25d78a16d 1.11.4 2016-08-15 21:44:06 +01:00
Simon McVittie
b04d9324fb dbus-launch: add --exit-with-x11 option
This is more suitable for distributions' Xsession scripts: it verifies
that X is already available, and so never results in an attempt to poll
stdin.

We read the machine UUID because it is needed to set the X atoms.
x11_init() assumes that the machine UUID (global variable) has been
set, either via read_machine_uuid_if_needed() or save_machine_uuid().
This is pretty tangled, but to make The Right Thing happen
automatically, we'd need to redo dbus-launch in terms of DBusError.

Reviewed-by: Will Thompson
Reviewed-by: Thiago Macieira
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39197
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-07-20 13:32:36 +01:00
Philip Withnall
771593c21d spec: Clarify the marshaling format in a few minor ways
This is an attempt to make that section a little clearer. I don’t think
any factual inaccuracies have been fixed (because I couldn’t find any).

Including some wording and an example by Simon McVittie.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93382
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-06-30 14:07:10 +01:00
Simon McVittie
e691124e28 Merge branch 'dbus-1.10' 2016-03-02 19:00:00 +00:00
Dmitri Iouchtchenko
bfd9c8a3b3 dbus-test-tool echo: fix sleep documentation
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=94244
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-03-02 18:19:35 +00:00
Simon McVittie
15097157ce 1.11.0 2015-12-02 21:03:07 +00:00
Lennart Poettering
5739c6f73f spec: trailing whitespace clean-up
It's generally a good idea to avoid trailing whitespace in order to keep
patchs minimal. While it's common to enforce such restrictions for C code,
it's important for docbok XML files too. Hence, let's clean this up and
remove all trailing whitespace currently in place.

[By policy we do not clean up historical trailing whitespace and
tab-indentation in the C source code unless we are modifying those lines
anyway, to retain the ability to merge stable-branch bugfixes into the
development branch. However, the copy of the spec in the development
branch is the only one that receives any updates, so that concern
doesn't apply here. -smcv]

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=91755
2015-11-07 11:33:52 +01:00
Simon McVittie
18c73c4095 Update NEWS (and pending spec version) 2015-11-06 18:34:46 +01:00
Lars Uebernickel
fc255f66f1 Disallow unexpected replies
Allowing to send replies when NO_REPLY_EXPECTED is set is useless in
practice: Clients need to be careful not to send these replies, because
bus policy could deny these messages. The spec even mentions that this
issue exists.

To make this more clear and misbehaving clients less likely, disallow
sending unexpected replies entirely.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=75749
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-11-06 18:29:56 +01:00
Simon McVittie
54f94fce08 dbus-daemon.1: document the new locations
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89280
Reviewed-by: Dimitri John Ledkov <dimitri.j.ledkov@intel.com>
2015-06-17 16:06:39 +01:00
Simon McVittie
536c5eb7cb dbus-run-session(1): document modern Automake syntax
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89846
2015-04-16 13:06:27 +01:00
Simon McVittie
2a6cefbc3b Add dbus-update-activation-environment tool
If OS builders (distributions) have chosen to use the per-user bus,
this provides two possible modes of operation for compatibility with
existing X session startup hooks.

A legacy-free system can just upload DISPLAY, XAUTHORITY and possibly
DBUS_SESSION_BUS_ADDRESS into dbus-daemon's and systemd's activation
environments, similar to
http://cgit.freedesktop.org/systemd/systemd/tree/xorg/50-systemd-user.sh
installed by systemd (but unlike systemctl,
dbus-update-activation-environment works for traditional
D-Bus-activated services, not just for systemd services).

A system where compatibility is required for environment variables
exported by snippets in /etc/X11/xinit/xinitrc.d (in Red Hat derivatives,
Gentoo, etc.) or /etc/X11/Xsession.d (Debian derivatives) can upload
the entire environment of the X session, minus some selected environment
variables which are specific to a login session (notably XDG_SESSION_ID).

In Debian, I plan to put the former in a new dbus-user-session package
that enables a user-session-centric mode of operation for D-Bus,
and the latter in the existing dbus-x11 package, with the intention that
dbus-x11 eventually becomes a tool for change-averse setups or goes
away entirely.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61301
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
2015-02-24 11:15:52 +00:00
Simon McVittie
e3f117e761 Add support for unix:runtime=yes as an address mode
This is not used by default, but can be configured by OS builders (or
regression-test environments) if desired.

If used, this listens on $XDG_RUNTIME_DIR/bus, or fails if $XDG_RUNTIME_DIR
is not set. Fallback behaviour is unnecessary, because it is already
possible to use a string of semicolon-separated addresses like
<listen>unix:runtime=yes;unix:tmpdir=/tmp</listen>, resulting in
listening on either $XDG_RUNTIME_DIR/bus or /tmp/something.

We use a non-abstract socket here, because that is desirable for
use with Linux containers: abstract sockets are attached to the
network namespace, whereas non-abstract sockets are part of the
filesystem and can be bind-mounted between domains if necessary.
The major advantage of abstract sockets is that they do not need
cleanup, but the specification of XDG_RUNTIME_DIR guarantees to
provide cleanup anyway.

Based on prior work by Simon McVittie, Colin Walters and Alexander
Larsson.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61303
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
2015-02-24 11:14:46 +00:00
Simon McVittie
87fe648a5c 1.9.12 2015-02-19 13:29:31 +00:00
Tyler Hicks
e6b90976c8 Add apparmor element and attributes to the bus config dtd
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=75113
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-02-18 17:03:56 +00:00
Tyler Hicks
7e142554d3 Document AppArmor enforcement in the dbus-daemon man page
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=75113
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-02-18 17:03:42 +00:00
Simon McVittie
82f9f6423a Add LinuxSecurityLabel to specification
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89041
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
2015-02-18 10:35:05 +00:00