Commit graph

4957 commits

Author SHA1 Message Date
Simon McVittie
91c235e316 test-autolaunch: Make recently-added message similar to the others
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-06-08 18:43:38 +01:00
Simon McVittie
fac3ae2239 NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-06-08 18:37:08 +01:00
Simon McVittie
aa3e40cb21 Refer to dbus_try_get_local_machine_id() in doc-comments
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-06-08 18:34:40 +01:00
Simon McVittie
22bdf2365e Add dbus_try_get_local_machine_id()
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=13194
2017-06-08 18:31:10 +01:00
Simon McVittie
6f751caf5f Make _dbus_get_local_machine_uuid_encoded() properly failable
This function already raised an error, and all callers handled that
error as gracefully as they could (because _dbus_generate_uuid() is
failable, since 2015). Given that, it seems unnecessarily hostile
to do a _dbus_warn_check_failed() unless we have no better alternative:
yes, it indicates that dbus has not been installed correctly, but
during build-time tests it's entirely reasonable that dbus has not
yet been installed.

Callers are:

* DBusConnection, to implement Peer.GetMachineId()
* The bus driver, to implement Peer.GetMachineId()
* X11 autolaunching
* dbus_get_local_machine_id()

Of those, only the last one is not in a position to return an error
gracefully, so move the _dbus_warn_check_failed() to there.

Migrate the text about the D-Bus library being incorrectly set up
into the error emitted by the Unix implementation, and to make it
less misleading, include separate error messages for both the
files we try to read:

$ bwrap --ro-bind / / --dev /dev --tmpfs /etc --tmpfs /var \
  ./tools/dbus-uuidgen --get
D-Bus library appears to be incorrectly set up: see the manual
page for dbus-uuidgen to correct this issue. (Failed to open
"/var/lib/dbus/machine-id": No such file or directory; Failed to open
"/etc/machine-id": No such file or directory)

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=13194
2017-06-08 18:31:06 +01:00
Simon McVittie
ffa410a040 tests: Don't exercise GetMachineId() or autolaunch if no machine ID
At the moment there is a hack in the implementation of GetMachineId()
to stop tests from failing during "make check" on a system where
dbus has never been installed, by silently generating a new unique
fake "machine ID" for each process. I'm about to change that
behaviour to report errors properly; skip affected test-cases if we
can't read the real machine ID.

The shell scripts to test dbus-launch are run both as "make check"
tests (for which it is valid for dbus to be not correctly installed)
and as installed-tests (for which that is not valid), so make them
pass during "make check" but fail during installed testing.
The tests in bus/ and test/name-test/ are only run during "make check"
so they only have the code path where they are skipped.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=13194
2017-06-08 18:30:39 +01:00
Simon McVittie
015a5cf36d uuidgen: Remove unimplemented declaration
As far as I can tell from git history, this function never existed.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=13194
2017-06-08 17:32:59 +01:00
Simon McVittie
108a1c45bc NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-06-08 17:13:41 +01:00
Simon McVittie
4256df5fb0 test/dbus-daemon: Exercise Properties, Features and Interfaces
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:42 +01:00
Simon McVittie
cc1ee6c39d test/dbus-daemon: Exercise the Peer interface
We have to skip the GetMachineId() part during build-time testing
if it wouldn't work - there is no guarantee that dbus has ever been
installed on the build system. However, we can insist on it during
installed-tests, if we make sure to complete the installation for the
Travis-CI build by running dbus-uuidgen.

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:38 +01:00
Simon McVittie
bde40c8970 Unix sysdeps: Only copy /etc/machine-id to ${sysconfdir} in "ensure" mode
System integration scripts use dbus-uuidgen --ensure, so they are
unaffected by this, and in particular the solution to Bug #77941
is still valid.

The shared library is typically loaded by unprivileged users, so
trying to write out the machine-id file is not going to work anyway.
However, if we *can* write to our ${sysconfdir} - notably during
`make distcheck` - then it is unexpected that merely reading the
machine ID has the side-effect of writing to ${sysconfdir},
and in particular it will make the check for a complete uninstall
fail. We definitely must not delete the machine ID during
`make uninstall`.

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:35 +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
faa0ab1f2f driver: Implement the Peer interface, for completeness
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:01 +01:00
Simon McVittie
3e9a13f7cd driver: Implement Properties, with Features and Interfaces properties
We recommend using Properties for this sort of thing when designing
D-Bus APIs, so it's a bit hypocritical that the reference message bus
didn't. The Features and Interfaces properties can be used for
feature-discovery as we add new larger features, while the Properties
support can be used for finer-grained properties, for example in the
interface planned for #100344.

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 16:59:50 +01:00
Simon McVittie
175c6c14d3 driver: Generate child node elements in introspection
This makes the /org/freedesktop/DBus path discoverable.

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 16:59:48 +01:00
Simon McVittie
db5bab32fe asv-util: Expose functions to open an arbitrary entry
We'll need this to implement o.fd.DBus.Properties.

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 16:59:46 +01:00
Simon McVittie
ecdcb86bff transport: Don't pile up errors for semicolon-separated components
If we somehow get an autolaunch address with multiple
semicolon-separated components, and one of them fails, then we will
hit an assertion failure when we try the next one.

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 16:59:13 +01:00
Simon McVittie
2ee52a6a07 test/dbus-daemon: Fix some memory leaks
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 16:58:40 +01:00
Simon McVittie
53376b06a2 NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-06-02 10:53:49 +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
Simon McVittie
e3083cc200 bus/driver: Only allow specific methods to be called at wrong paths
The default for the future should be that new functionality should
only be available at /org/freedesktop/DBus, which is the canonical
path of the "bus driver" object that represents the message bus.

The disallowed methods are still in Introspect() output, and
raise AccessDenied instead of UnknownMethod, to preserve the invariant
that the o.fd.DBus interface has constant contents.

test/dbus-daemon.c already asserts that UpdateActivationEnvironment()
still raises AccessDenied when invoked on a non-canonical path;
this has been in place since 1.8.14.

Reviewed-by: Philip Withnall <withnall@endlessm.com>
[smcv: Adjust comments, enum order, variable naming as per Philip's review]
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101256
2017-06-02 10:43:34 +01:00
Simon McVittie
093ec67b8f bus/driver: Make non-core interfaces unavailable on most object paths
The o.fd.DBus interface needs to remain available on arbitrary object
paths for backwards compatibility, and the Introspectable interface
is genuinely useful, but everything else can be skipped.

This is arguably an incompatible change for the undocumented Verbose
interface, and for the GetAllMatchRules method on the undocumented
Stats interface: previously those were available at all object paths.

Reviewed-by: Philip Withnall <withnall@endlessm.com>
[smcv: Adjust comments, enum order, variable naming as per Philip's review]
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101256
2017-06-02 10:43:29 +01:00
Simon McVittie
36893e76c4 test/monitor: Assert that BecomeMonitor() on wrong object path fails
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:38:30 +01:00
Simon McVittie
520aa04464 NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-05-31 18:45:42 +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
f5e373af00 Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-05-31 13:44:08 +01:00
Laurent Bigonville
d8ad72ccb9 configure.ac: Drop check for selinux/av_permissions.h
selinux/av_permissions.h is deprecated and is not even used in the code
since commit ba088208bc, in 2013.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=100912
Reviewed-by: Simon McVittie <smcv@collabora.com>
2017-05-31 13:40:19 +01:00
Laurent Bigonville
4111263800 Remove unnecessary cast, bus_sid is already of type security_id_t
Reviewed-by: Simon McVittie <smcv@collabora.com>
2017-05-31 13:39:50 +01:00
Laurent Bigonville
89419e0a8c Remove calls to sidget/sidput
sidget and sidput functions are noop and deprecated since libselinux 2.0.86.

Also use pkg-config to detect libselinux and force version >= 2.0.86

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=100912
Reviewed-by: Simon McVittie <smcv@collabora.com>
2017-05-31 13:39:29 +01:00
Simon McVittie
b119366d0b Merge branch 'dbus-1.10' 2017-04-19 11:45:42 +01:00
Simon McVittie
1cd23aa0c9 HACKING: Update git URIs to sync up with cgit.freedesktop.org
git.freedesktop.org no longer offers anonymous checkouts; that facility
moved to anongit.freedesktop.org.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=100715
2017-04-19 11:44:52 +01:00
Simon McVittie
3201c19df9 Update NEWS 2017-04-18 17:21:35 +01:00
Simon McVittie
36fcd43005 Pass in DBUS_TEST_EXEC via environment, not hard-coded into binaries
This avoids "capturing" the build directory in the built binaries
when built with embedded tests, which is good for reproducible builds.
See <https://reproducible-builds.org/> for more information.

Signed-off-by: Simon McVittie <smcv@debian.org>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=100692
2017-04-18 17:20:30 +01:00
Simon McVittie
53959c9924 Update NEWS
Signed-off-by: Simon McVittie <smcv@debian.org>
2017-04-18 12:52:35 +01:00
Simon McVittie
0310ead002 Doxyfile.in: do not put timestamps in HTML
The build timestamp is not particularly useful (the version number of
the package is already present in the HTML), and it prevents the build
from being reproducible. See <https://reproducible-builds.org/> for more
information.

Signed-off-by: Simon McVittie <smcv@debian.org>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=100692
2017-04-18 12:47:17 +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
Simon McVittie
ef628c3b0a transient-services integration test: Create the right directory
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:18 +01:00
Simon McVittie
5be3d5faac AppArmor test: Allow writing to our temporary XDG_RUNTIME_DIR
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:45:16 +01:00
Simon McVittie
996f22c337 Travis-CI: Omit -I, -L from cross-compilation options
Now that we detect Expat via pkg-config, this is no longer needed.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-04-10 13:55:24 +01:00
Simon McVittie
e2e4435ec4 NEWS for fd.o #69801 2017-04-10 12:53:07 +01:00
Simon McVittie
3cd51e7b92 build: Remove indirection from uses of Expat
We haven't supported XML libraries other than Expat since 2013.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69801
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
2017-04-10 12:40:52 +01:00
Simon McVittie
54c81ee9e8 Autotools build: Use pkg-config to find libexpat
The version of expat that added the .pc file was released in 2012.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69801
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
2017-04-10 12:40:19 +01:00
Simon McVittie
3f14630698 Start changelog for 1.10.20 2017-04-07 18:57:14 +01:00