Simon McVittie [Mon, 12 Jun 2017 10:45:26 +0000 (11:45 +0100)]
NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Fri, 9 Jun 2017 13:56:16 +0000 (14:56 +0100)]
Opt-in to deprecation warnings for GLib 2.38 and 2.40
Now that g_test_trap_fork() has gone, we no longer have any calls to
GLib functions deprecated in or before 2.40.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101362
Simon McVittie [Fri, 9 Jun 2017 13:47:39 +0000 (14:47 +0100)]
test/internals/syslog: Switch to g_test_trap_subprocess()
This re-executes the same binary with special command-line options
instead of forking. As a result, it can work on Windows, and is less
dependent on Unix libraries continuing to work across a fork().
(This has been confirmed to work in Windows binaries running under Wine.)
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101362
Simon McVittie [Fri, 9 Jun 2017 13:46:32 +0000 (14:46 +0100)]
Bump GLib dependency for tests to 2.40
This is quite old (it's the version in Ubuntu 14.04 LTS, and older
than the version in Debian 8) but gives us g_test_skip(),
g_test_trap_subprocess() and GVariantDict, all of which will be
useful in the regression tests.
Remove workarounds for old versions.
After this commit we are still using the deprecated g_test_trap_fork(),
which will be removed in a subsequent commit. Don't opt-in to the new
deprecation warnings from 2.38 and 2.40 yet, because under our recommended
settings for dbus developers (-Werror) they would break the build.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101362
Simon McVittie [Thu, 8 Jun 2017 17:41:47 +0000 (18:41 +0100)]
dbus-launch: Use 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
Simon McVittie [Thu, 8 Jun 2017 17:43:38 +0000 (18:43 +0100)]
test-autolaunch: Make recently-added message similar to the others
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Thu, 8 Jun 2017 17:37:08 +0000 (18:37 +0100)]
NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Thu, 8 Jun 2017 17:34:33 +0000 (18:34 +0100)]
Refer to dbus_try_get_local_machine_id() in doc-comments
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Wed, 7 Jun 2017 16:26:03 +0000 (17:26 +0100)]
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
Simon McVittie [Wed, 7 Jun 2017 16:14:00 +0000 (17:14 +0100)]
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
Simon McVittie [Thu, 8 Jun 2017 16:04:24 +0000 (17:04 +0100)]
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
Simon McVittie [Wed, 7 Jun 2017 15:13:25 +0000 (16:13 +0100)]
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
Simon McVittie [Thu, 8 Jun 2017 16:13:41 +0000 (17:13 +0100)]
NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Fri, 2 Jun 2017 12:32:13 +0000 (13:32 +0100)]
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
Simon McVittie [Fri, 2 Jun 2017 11:22:59 +0000 (12:22 +0100)]
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
Simon McVittie [Wed, 7 Jun 2017 13:47:12 +0000 (14:47 +0100)]
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
Simon McVittie [Fri, 2 Jun 2017 11:04:00 +0000 (12:04 +0100)]
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
Simon McVittie [Fri, 2 Jun 2017 11:02:48 +0000 (12:02 +0100)]
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
Simon McVittie [Fri, 2 Jun 2017 10:59:08 +0000 (11:59 +0100)]
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
Simon McVittie [Wed, 31 May 2017 19:34:25 +0000 (20:34 +0100)]
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
Simon McVittie [Wed, 31 May 2017 19:33:14 +0000 (20:33 +0100)]
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
Simon McVittie [Wed, 31 May 2017 19:32:38 +0000 (20:32 +0100)]
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
Simon McVittie [Mon, 5 Jun 2017 17:16:42 +0000 (18:16 +0100)]
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
Simon McVittie [Fri, 2 Jun 2017 11:19:18 +0000 (12:19 +0100)]
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
Simon McVittie [Fri, 2 Jun 2017 09:53:49 +0000 (10:53 +0100)]
NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Wed, 31 May 2017 17:32:05 +0000 (18:32 +0100)]
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
Simon McVittie [Wed, 31 May 2017 17:27:11 +0000 (18:27 +0100)]
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
Simon McVittie [Wed, 31 May 2017 17:20:25 +0000 (18:20 +0100)]
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
Simon McVittie [Wed, 31 May 2017 17:00:40 +0000 (18:00 +0100)]
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
Simon McVittie [Wed, 31 May 2017 17:45:42 +0000 (18:45 +0100)]
NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
Tom Gundersen [Wed, 31 May 2017 15:23:20 +0000 (16:23 +0100)]
spec: Fix indentation
[smcv: separated out from a larger commit, added commit message]
Reviewed-by: Simon McVittie <smcv@collabora.com>
Tom Gundersen [Wed, 31 May 2017 15:22:21 +0000 (16:22 +0100)]
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>
Tom Gundersen [Wed, 31 May 2017 15:21:44 +0000 (16:21 +0100)]
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>
Tom Gundersen [Wed, 31 May 2017 15:21:00 +0000 (16:21 +0100)]
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>
Simon McVittie [Wed, 31 May 2017 15:17:22 +0000 (16:17 +0100)]
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>
Simon McVittie [Wed, 31 May 2017 15:17:02 +0000 (16:17 +0100)]
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>
Simon McVittie [Wed, 31 May 2017 15:16:20 +0000 (16:16 +0100)]
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>
Simon McVittie [Wed, 31 May 2017 12:44:08 +0000 (13:44 +0100)]
Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
Laurent Bigonville [Thu, 4 May 2017 12:06:14 +0000 (14:06 +0200)]
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
ba088208bc0c35ca418a097a8482c4a7705f4a43, in 2013.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=100912
Reviewed-by: Simon McVittie <smcv@collabora.com>
Laurent Bigonville [Mon, 3 Oct 2016 18:12:32 +0000 (20:12 +0200)]
Remove unnecessary cast, bus_sid is already of type security_id_t
Reviewed-by: Simon McVittie <smcv@collabora.com>
Laurent Bigonville [Mon, 3 Oct 2016 18:08:20 +0000 (20:08 +0200)]
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>
Simon McVittie [Wed, 19 Apr 2017 10:45:42 +0000 (11:45 +0100)]
Merge branch 'dbus-1.10'
Simon McVittie [Wed, 19 Apr 2017 10:44:52 +0000 (11:44 +0100)]
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
Simon McVittie [Tue, 18 Apr 2017 16:21:35 +0000 (17:21 +0100)]
Update NEWS
Simon McVittie [Sat, 15 Apr 2017 20:06:23 +0000 (21:06 +0100)]
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
Simon McVittie [Tue, 18 Apr 2017 11:52:35 +0000 (12:52 +0100)]
Update NEWS
Signed-off-by: Simon McVittie <smcv@debian.org>
Simon McVittie [Wed, 6 May 2015 08:17:06 +0000 (09:17 +0100)]
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
Simon McVittie [Fri, 14 Apr 2017 12:04:13 +0000 (13:04 +0100)]
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
Simon McVittie [Fri, 14 Apr 2017 11:35:06 +0000 (12:35 +0100)]
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
Simon McVittie [Fri, 14 Apr 2017 11:34:46 +0000 (12:34 +0100)]
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
Simon McVittie [Mon, 10 Apr 2017 11:54:31 +0000 (12:54 +0100)]
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>
Simon McVittie [Mon, 10 Apr 2017 11:53:07 +0000 (12:53 +0100)]
NEWS for fd.o #69801
Simon McVittie [Fri, 7 Apr 2017 12:46:18 +0000 (13:46 +0100)]
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>
Simon McVittie [Fri, 7 Apr 2017 12:43:33 +0000 (13:43 +0100)]
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>
Simon McVittie [Fri, 7 Apr 2017 17:57:14 +0000 (18:57 +0100)]
Start changelog for 1.10.20
Simon McVittie [Fri, 7 Apr 2017 17:56:39 +0000 (18:56 +0100)]
Start towards 1.11.14
Simon McVittie [Fri, 7 Apr 2017 15:00:16 +0000 (16:00 +0100)]
1.11.12
Simon McVittie [Fri, 7 Apr 2017 13:03:14 +0000 (14:03 +0100)]
NEWS
Simon McVittie [Fri, 24 Mar 2017 19:41:10 +0000 (19:41 +0000)]
Stop opting out of -Wswitch-enum and -Wswitch-default
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98191
Simon McVittie [Tue, 17 Jan 2017 20:50:08 +0000 (20:50 +0000)]
DBusTransport: be explicit about _dbus_auth_do_work() results
Explicitly enumerate the states where we reset the maybe_authenticated
flag, and assert that _dbus_auth_do_work() doesn't return an impossible
or invalid state (by source code inspection, it doesn't).
This silences -Wswitch-enum. Based on part of a patch from
Thomas Zimmermann.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98191
Simon McVittie [Fri, 7 Apr 2017 11:54:30 +0000 (12:54 +0100)]
NEWS for fd.o #99839
Philip Withnall [Wed, 22 Feb 2017 10:56:56 +0000 (10:56 +0000)]
dbus: Fix writing off the end of an fd_set when testing with Valgrind
If the test-bus test is run under Valgrind, its code to detect FD leaks
accidentally writes off the end of the fd_set it uses, as Valgrind opens
some high FDs (≥1024) for internal use.
Ignore those FDs. Realistically, they are never going to be leaks — in
order to have a false negative from omitting this check, D-Bus would
have to allocate and not leak all the FDs up to FD_SETSIZE, and then
leak the first FD over that which it allocated. D-Bus never allocates
anywhere near that number of FDs concurrently.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Reviewed-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99839
Simon McVittie [Fri, 7 Apr 2017 11:28:19 +0000 (12:28 +0100)]
NEWS
Simon McVittie [Tue, 17 Jan 2017 21:09:07 +0000 (21:09 +0000)]
bus policy: assert that no invalid rule types are seen
This silences -Wswitch-default.
Based on part of a patch from Thomas Zimmermann.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98191
Simon McVittie [Tue, 17 Jan 2017 21:07:00 +0000 (21:07 +0000)]
config-parser tests: explicitly skip non-comparable elements
For these types, the tagged union in the Element struct does not store
anything we could usefuly compare.
Based on part of a patch from Thomas Zimmermann.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98191
Simon McVittie [Tue, 17 Jan 2017 20:59:57 +0000 (20:59 +0000)]
config-parser: assert elements are of a known type
This silences -Wswitch-default.
Based on part of a patch from Thomas Zimmermann.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98191
Simon McVittie [Tue, 17 Jan 2017 20:58:06 +0000 (20:58 +0000)]
config-parser: treat impossible policy type as IGNORED
This silences -Wswitch-default.
Based on part of a patch from Thomas Zimmermann.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98191
Simon McVittie [Tue, 17 Jan 2017 20:54:20 +0000 (20:54 +0000)]
sysdeps: assert that log severity is one we expect
This silences -Wswitch-default.
Based on part of a patch from Thomas Zimmermann.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98191
Simon McVittie [Tue, 17 Jan 2017 20:52:25 +0000 (20:52 +0000)]
_dbus_global_lock: move success case up into switch
This silences -Wswitch-default.
Based on part of a patch from Thomas Zimmermann.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98191
Simon McVittie [Tue, 17 Jan 2017 20:49:31 +0000 (20:49 +0000)]
DBusTransport: assert that invalid results don't happen
This silences -Wswitch-default.
Based on part of a patch from Thomas Zimmermann.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98191
Simon McVittie [Tue, 17 Jan 2017 20:47:16 +0000 (20:47 +0000)]
dbus-launch: clarify signal handler
We only register signal_handler() for the three signals that we want
to handle as "kill dbus-daemon and exit", so there's no point in the
switch. Silence -Wswitch-default by removing it altogether.
The variable name got_fatal_signal and the verbose message are both
misleading, because actually this is a handler for multiple signals,
not just SIGHUP. Rename them to be generic.
Based on part of a patch from Thomas Zimmermann.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98191
Simon McVittie [Tue, 17 Jan 2017 20:42:31 +0000 (20:42 +0000)]
dbus-monitor: handle default case for binary mode header
Also comment why it's OK to not do anything for the modes that don't
have a header. We are effectively treating the default case as one
of those, on the assumption that future modes are more likely to
lack a header than to have one.
Based on part of a patch from Thomas Zimmermann.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98191
Simon McVittie [Tue, 17 Jan 2017 20:41:17 +0000 (20:41 +0000)]
test, tools: assert impossible values of local enums are not reached
Based on part of a patch from Thomas Zimmermann.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98191
Simon McVittie [Tue, 17 Jan 2017 20:28:15 +0000 (20:28 +0000)]
dbus-spawn: assert impossible returns from read functions don't happen
This silences -Wswitch-default.
Based on a patch from Thomas Zimmermann.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98191
Simon McVittie [Tue, 17 Jan 2017 20:25:14 +0000 (20:25 +0000)]
_dbus_lm_strerror: move default behaviour inside switch
This silences -Wswitch-default.
Part of a larger commit from Thomas Zimmermann.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98191
Simon McVittie [Tue, 17 Jan 2017 20:21:21 +0000 (20:21 +0000)]
dbus-daemon: silence -Wswitch-default
There should be no way signal_handler() can be called for a signal
we didn't ask for. If it somehow happens, ignore it.
Based on a patch from Thomas Zimmermann.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98191
Simon McVittie [Tue, 17 Jan 2017 20:18:47 +0000 (20:18 +0000)]
bus dispatch tests: treat impossible message_kind as GOT_SOMETHING_ELSE
check_got_service_info() can't actually return an invalid
GotServiceInfo, but if it somehow does, we want to fail the test.
GOT_SOMETHING_ELSE already has that effect, and a similar meaning.
Based on a patch from Thomas Zimmermann.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98191
Simon McVittie [Wed, 5 Apr 2017 20:40:57 +0000 (21:40 +0100)]
Merge branch 'dbus-1.10'
Simon McVittie [Wed, 5 Apr 2017 15:24:12 +0000 (16:24 +0100)]
1.10.18
Signed-off-by: Simon McVittie <smcv@debian.org>
Philip Withnall [Wed, 5 Apr 2017 10:36:12 +0000 (11:36 +0100)]
test: Fix a couple of memory leaks in test-corrupt
Spotted while testing bug #100568.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Reviewed-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=100568
Philip Withnall [Wed, 5 Apr 2017 10:35:27 +0000 (11:35 +0100)]
test: Fix reading off the end of an array in test-corrupt
One level of pointer indirection too many when passing the arguments to
dbus_message_append_args().
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=100568
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Reviewed-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Wed, 22 Mar 2017 10:01:53 +0000 (10:01 +0000)]
refer to Debian bug in NEWS
Simon McVittie [Wed, 22 Mar 2017 09:35:17 +0000 (09:35 +0000)]
NEWS
Laurent Bigonville [Tue, 17 Nov 2015 20:47:05 +0000 (21:47 +0100)]
Initialize SELinux and Apparmor after capabilities are set
avc_init() in the SELinux code path is creating a new thread, we need to
set to capabilities before it gets created so it has the permission to
send audit messages.
It also make more sense to open the audit netlink before the different
logging callbacks are set.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92832
[smcv: add comments explaining why initialization must happen in this
specific order]
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=857660
Reviewed-by: Stephen Smalley <sds@tycho.nsa.gov>
(cherry picked from commit
a3a5935a0a038c3b44c61ce5719f0f7e647b96c6)
Simon McVittie [Mon, 20 Mar 2017 14:56:28 +0000 (14:56 +0000)]
Update NEWS
Philip Withnall [Tue, 28 Feb 2017 08:56:25 +0000 (08:56 +0000)]
test: Remove an unnecessary NULL check in sd-activation
test_transient_services() was checking whether (config == NULL), then
shortly afterwards dereferencing config->bus_name (which is in fact
dereferenced on all branches of the function). Remove the check and add
some assertions to ensure a Config struct is always passed into the test
(which it currently is).
Coverity ID: 141877
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99999
Reviewed-by: Simon McVittie <smcv@collabora.com>
Philip Withnall [Tue, 28 Feb 2017 08:55:26 +0000 (08:55 +0000)]
test: Fix copy-paste error in waiting for a message in the tests
The parameters to the test_pending_call_store_reply() call should match
those to the dbus_pending_call_set_notify() immediately after.
Coverity ID: 141876
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99999
Reviewed-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Fri, 24 Feb 2017 20:19:47 +0000 (20:19 +0000)]
Update NEWS
Simon McVittie [Fri, 3 Mar 2017 13:37:04 +0000 (13:37 +0000)]
autotools: Allow relocatable pkg-config metadata on an opt-in basis
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99721
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Signed-off-by: Simon McVittie <smcv@collabora.com>
Ralf Habacker [Fri, 3 Mar 2017 11:39:23 +0000 (11:39 +0000)]
cmake, autotools: Add find package config support for cmake clients
With this support cmake and autotools generates cmake equivalent of
pkgconfig files on configure time named DBus1Config*.cmake. These
files are installed into the related directory where cmake expects
find_package related config files.
For instructions how to use this feature with clients see readme.cmake.
With previous DBus versions each cmake client using DBus as dependency
needed a related FindDBus*.cmake in its source distribution or in
the cmake binary packages. With the 'config' find package style support
provided by this patch this requirement has been removed.
The generated config file uses pkgconfig on unix or autotools to
fetch package build flags, which is the prefered way. On Windows
we do not want to require CMake users to have pkg-config installed
so it uses cmake buildin target export support for exporting all
targets into DBus1ConfigTargets*.cmake.
[smcv: make sure variable substitution works in Autotools too]
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99721
Reviewed-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Signed-off-by: Simon McVittie <smcv@collabora.com>
Ralf Habacker [Wed, 15 Feb 2017 15:02:32 +0000 (16:02 +0100)]
cmake: Optionally create relocatable dbus-1.pc file
Relocatable pkgconfig files are necessary when using packages installed to
a location that does not match the location for which they were compiled.
However, using ${pcfiledir} is problematic for system installations
in standard locations, because it interferes with pkg-config's
ability to filter out -I, -L options that are redundant with compiler
defaults (which is important if you are trying to use a newer version
of a library than the system copy).
In practice operating system vendors installing dbus to standard
locations use Autotools, so we enable relocatable builds by default
when building with CMake.
For simplicity, we're also not relocatable if the library directory
is something more complicated than lib or lib64 (e.g. under Debian
multiarch); we don't want to have to compute how many ../ to add.
This is non-trivial to determine in an Autotools build, so for now
there is no support for relocation when built with Autotools,
even as an opt-in feature.
Going via the ${original_prefix} variable is because under Autotools,
both ${prefix} and ${exec_prefix} technically default to NONE, with
NONE replaced with their real defaults of /usr/local and '${prefix}'
(respectively) later on. If we tried to expand ${prefix} at the time
that we choose the value of ${pkgconfig_prefix}, that would cause
a broken value "prefix=NONE" to be hard-coded.
[smcv: no relocation on Autotools, make it optional in CMake,
expand commit message]
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99721
Reviewed-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Signed-off-by: Simon McVittie <smcv@collabora.com>
Philip Withnall [Wed, 22 Feb 2017 13:22:37 +0000 (13:22 +0000)]
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>
Simon McVittie [Wed, 22 Feb 2017 11:22:19 +0000 (11:22 +0000)]
NEWS
Philip Withnall [Thu, 22 Jan 2015 20:11:07 +0000 (20:11 +0000)]
dbus-socket-set-epoll: initialize all bytes of struct epoll_event
This should be a no-op, but it shuts Valgrind up.
The reason for the warning is that we fill in event.events and
event.data.fd, but the union event.data actually contains more bytes
than that. We'll get the same partially initialized union back from the
kernel in socket_set_epoll_poll(), where we take events[i].data.fd and
ignore the rest. So the current code is safe, but valgrind is right to
worry.
This is an expanded version of an older patch by Simon McVittie.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88808
Signed-off-by: Simon McVittie <smcv@debian.org>
Simon McVittie [Tue, 21 Feb 2017 14:57:37 +0000 (14:57 +0000)]
Add a simple integration test for transient services
Because this is in a subdirectory, it requires some extra `mkdir -p`
and some `nobase_` variables. Make all the installed-tests `nobase_`
for consistency.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99825
Reviewed-by: Andre Moreira Magalhaes <andre.magalhaes@collabora.co.uk>
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Simon McVittie [Tue, 21 Feb 2017 13:30:51 +0000 (13:30 +0000)]
Update NEWS
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Simon McVittie [Fri, 17 Feb 2017 20:54:44 +0000 (20:54 +0000)]
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>
Simon McVittie [Fri, 17 Feb 2017 20:54:14 +0000 (20:54 +0000)]
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>
Simon McVittie [Tue, 14 Feb 2017 15:10:20 +0000 (15:10 +0000)]
sd-activation test: Exercise transient services
To do this, we have to use the <standard_session_servicedirs/>.
A previous commit ensured that those don't provide any service files
we don't expect.
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>
Simon McVittie [Mon, 13 Feb 2017 20:58:51 +0000 (20:58 +0000)]
config-parser: Add transient service directories
For configuration purposes these are treated as part of the standard
session service directories, to avoid having to add new configuration
syntax which would prevent an old dbus-daemon from reloading
successfully. From an API perspective, they're separate, though.
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>