Commit graph

5393 commits

Author SHA1 Message Date
Simon McVittie
171fccffdb 1.13.4 2018-04-30 13:54:17 +01:00
Simon McVittie
9391d769ae build: Uninstall JavaScript and CSS from htmldir
Otherwise, distcheck fails when mallard-ducktype is available.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-04-27 18:18:11 +01:00
Simon McVittie
2390a325a0 NEWS: Mention non-local TCP too
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-04-25 16:47:03 +01:00
Simon McVittie
3aa8bff8e2 spec: Describe nonce-tcp as "nonce-authenticated", not "nonce-secured"
nonce-tcp isn't really any more secure than tcp, unless you are
using ANONYMOUS authentication, which should not be considered
secure in any case. Avoid the word "secured" so that people don't
get the wrong idea.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106004
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
2018-04-25 16:42:54 +01:00
Simon McVittie
d0a16b59a8 spec, dbus-daemon(1): Mention and deprecate shared session buses
This might (?) have made sense behind a firewall in 2003; but now it's
2018, the typical threat model that we are defending against has
changed from "vandals want to feel proud of their l33t skills"
to "organised crime wants your money", and a "trusted" local LAN
probably contains an obsolete phone, tablet, games console or
Internet-of-Things-enabled toaster with remote root exploits.
This make network topologies that used to be acceptable look
increasingly irresponsible.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106004
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
2018-04-25 16:42:28 +01:00
Simon McVittie
856ad90e82 spec: Note that EXTERNAL is not *completely* impossible via TCP
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106004
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2018-04-25 16:41:25 +01:00
Simon McVittie
ad5036f1bd spec: Expand on how tcp connections are normally authenticated
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106004
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
2018-04-25 16:41:21 +01:00
Simon McVittie
ee0e42ae2d Update NEWS 2018-04-23 18:33:42 +01:00
Simon McVittie
aef4475939 dbus-daemon(1): Recommend requiring EXTERNAL on non-Windows OSs
This is the default, and blocks TCP-based attacks by making the
attacker fail to authenticate (while also preventing inadvisable
TCP-based configurations from working).

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106004
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
2018-04-23 18:27:44 +01:00
Simon McVittie
5d36804867 dbus-daemon(1): Put some scary warnings on <allow_anonymous/>
I'm far from convinced that this option should even *exist*, but it
should definitely be documented as a very bad thing.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106004
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
2018-04-23 18:27:44 +01:00
Simon McVittie
7fc89fb1f8 spec: Describe the security properties of nonce-tcp in terms of tcp
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106004
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
2018-04-23 18:27:44 +01:00
Simon McVittie
cf47380641 spec, dbus-daemon(1): Recommend against remote TCP for debugging
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106004
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
[smcv: Add a TODO comment as suggested]
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-04-23 18:27:44 +01:00
Simon McVittie
2513f84db6 spec, dbus-daemon(1): Say that non-local TCP is insecure
With some fairly reasonable threat models (active or passive local
attacker able to eavesdrop on the network link, confidential
information being transferred via D-Bus), secure authentication is
insufficient to make this transport secure: it does not protect
confidentiality or integrity either.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106004
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
2018-04-23 18:27:44 +01:00
Simon McVittie
17e28cb1b8 spec: Don't claim that the nonce-tcp transport is "secured"
Like the normal TCP transport, it has no confidentiality or integrity
protection. The only difference is that it adds an extra layer of
authentication.

However, this extra authentication is easily defeated if an attacker
could be eavesdropping on the link between client and server (unlike
DBUS_COOKIE_SHA1, which for all its flaws does at least protect the
confidentiality of the magic cookie).

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106004
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
2018-04-23 18:27:44 +01:00
Simon McVittie
20128fa664 spec: Recommend Unix domain sockets for all non-Windows platforms
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106004
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
2018-04-23 18:27:44 +01:00
Simon McVittie
127ca71689 Update NEWS for 1.13.x branch
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-04-23 18:00:42 +01:00
Simon McVittie
fa92263920 doxygen_to_devhelp: Produce Devhelp index format v2
The old version-1 format is deprecated and now produces warnings.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106186
Reviewed-by: Philip Withnall <withnall@endlessm.com>
[smcv: Add the .devhelp2 file to .gitignore as suggested]
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-04-23 17:44:09 +01:00
Simon McVittie
c84ac8b1ef doxygen_to_devhelp: Make the API reference the front page
The tutorial is not necessarily a great entry point for the libdbus
documentation: it's infrequently updated, and we should probably have
the "If you use this low-level API directly, you're signing up for some
pain" message from the API reference show up in devhelp more immediately.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106186
Reviewed-by: Philip Withnall <withnall@endlessm.com>
[smcv: Add longer commit message with rationale]
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-04-23 17:39:21 +01:00
Simon McVittie
49ad5b110f doc: Install highlight.pack.js if present
Newer versions of yelp-build use this instead of a jQuery syntax
highlighter.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106171
Reviewed-by: Philip Withnall <withnall@endlessm.com>
[smcv: Also add it to .gitignore as suggested]
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-04-23 17:38:56 +01:00
Simon McVittie
bab857fb6f doc: Only install ancillary files from yelp-build if they exist
Newer versions of yelp-build don't install jquery.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106171
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
2018-04-23 17:37:12 +01:00
Ralf Habacker
d22e7901b5 travis-ci: Add cross building support for mingw 64 bit compiler
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
Reviewed-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=105662
2018-03-22 21:13:47 +01:00
Ralf Habacker
577813cf3a sysdeps-win: Print word-size-dependent offset correctly
AddrPC.Offset is the same size as a pointer, but previously
we printed it as though it was the same size as a long,
which is 32 bits on 64-bit Windows.

Reviewed-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=105662
2018-03-22 21:13:47 +01:00
Ralf Habacker
18d4ff6644 dbus-transport-socket: Correctly print DBusSocket with DBUS_SOCKET_FORMAT
Previously, on 64-bit Windows we were passing a 32-bit int where the
format string expects a 64-bit SOCKET.

Reviewed-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=105662
2018-03-22 21:13:47 +01:00
Simon McVittie
16dac1bd49 Preallocate next release name 2018-03-22 19:25:57 +00:00
Simon McVittie
66246fff2a bus: Clear INVOCATION_ID when carrying out traditional activation
We weren't sure whether this one should be inherited or not, so I
asked on systemd-devel, and Lennart thought it shouldn't.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=104641
Reviewed-by: Philip Withnall <withnall@endlessm.com>
2018-03-22 19:25:16 +00:00
Ralf Habacker
b6b3348596 cmake: Fix warning on travis-ci 'CMAKE_FORCE_C.._COMPILER macro is deprecated'
CMake suggests to set CMAKE_C.._COMPILER instead and let allow CMake to
identify the compiler.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=105636
Reviewed-by: Simon McVittie <smcv@collabora.com>
2018-03-21 15:02:38 +01:00
Ralf Habacker
7c9f6ca79b bus_connection_get_unix_groups: NULL-check *groups, not groups
groups is never NULL here, but *groups can be NULL on OOM, and that's the
check that was intended.

Coverity ID 265358.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103737
Reviewed-by: Simon McVittie <smcv@collabora.com>
2018-03-20 13:27:59 +01:00
Ralf Habacker
a3bc4392be Fix using uninitialized value "name" in _dbus_combine_tcp_errors
Coverity CID 265359.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61922
Reviewed-by: Simon McVittie <smcv@collabora.com>
2018-03-20 13:26:51 +01:00
Ralf Habacker
00babc0bae Add actual used ip family to --print-address output in case of listening on tcp
Specifying a dbus tcp address without a family let dbus-daemon the choice
for listen on ipv4 or ipv6, but did not return the real used ip family,
which is fixed with this commit.

Bug:https://bugs.freedesktop.org/show_bug.cgi?id=105489
Reviewed-by: Simon McVittie <smcv@collabora.com>
2018-03-19 22:24:09 +01:00
Simon McVittie
4e3bfe0c97 cmake: Fold GObject detection into GLib detection
Everywhere that we want GLib, we also want GObject and GIO. Detecting
GLib and GIO but not GObject makes very little sense anyway, because
GIO depends on GObject.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=105521
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2018-03-19 12:33:45 +00:00
Simon McVittie
27113c75f3 NEWS for #105460
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-03-15 19:58:05 +00:00
Daniel Wendt
37b6e180e1 Enable "unused result" warning for Visual Studio >= 2012 (MSVC 11.0)
The _Must_inspect_result_ annotation is documented to be used in both
the declaration and implementation, but in testing with the MSVC 2012
compiler it appears to be sufficient to use the annotation only in the
declaration to get a compiler warning, as with the GCC compiler.
So the annotation is not necessary in the C implementation.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=105460
[smcv: Rebase dbus-sysdeps.h changes on master]
[smcv: Clarify commit message]
Reviewed-by: Simon McVittie <smcv@collabora.com>
Tested-by: Daniel Wendt <daniel.wendt@linux.com>
2018-03-15 19:53:05 +00:00
Simon McVittie
29afefef72 Update NEWS for fd.o#61922, #103387
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-03-13 12:57:36 +00:00
Simon McVittie
9dfbe7f78d DBusSocket helpers: Declare as _DBUS_GNUC_WARN_UNUSED_RESULT
There is no point in calling these functions for their side-effects,
because they don't have any.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61922
2018-03-12 20:33:36 +01:00
Ralf Habacker
39efd6ebdd Add version info to installed executables for cmake build system on Windows
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
Reviewed-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103387
2018-03-12 19:47:28 +01:00
Ralf Habacker
64a1d59b3d Windows _dbus_connect_tcp_socket_with_nonce: Simplify initialization of variable noncefileStr
This optimization has been detected while comparing the related unix
implemention.

Reviewed-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61922
2018-03-12 18:38:19 +01:00
Ralf Habacker
9d1cdce2b4 Remove obsolete call to _dbus_string_free() in unix variant of _dbus_connect_tcp_socket_with_nonce
A DBusString that was initialized with a constant doesn't hold any
allocated memory, so it doesn't need to be freed.

Reviewed-by: Simon McVittie <smcv@collabora.com>
https://bugs.freedesktop.org/show_bug.cgi?id=61922
2018-03-12 18:38:13 +01:00
Ralf Habacker
a0ac4c4022 Windows _dbus_listen_tcp_socket: Set socket options SO_REUSEADDR and TCP_NODELAY
Reviewed-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61922
2018-03-12 18:38:03 +01:00
Ralf Habacker
98a5011b81 Windows _dbus_listen_tcp_socket: Use AF_UNSPEC if family is unspecified
Now that we cope with getting WSAEADDRNOTAVAIL when trying to listen on
::1 with IPv6 disabled, and gracefully fall back to only listening on
127.0.0.1, we can use AF_UNSPEC like the corresponding Unix code does.

Reviewed-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61922
2018-03-12 18:37:54 +01:00
Ralf Habacker
bbf1cb70a5 Windows _dbus_connect_tcp_socket_with_nonce: Keep error code for 'Unknown address family' in sync with unix
Reviewed-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61922
2018-03-12 18:37:43 +01:00
Ralf Habacker
3c5d2eda0d Windows _dbus_connect_tcp_socket_with_nonce: Combine all connect() errors
Previously, we took the errno from the most recent connect() error,
and used a more generic diagnostic message.

Reviewed-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61922
2018-03-12 18:37:35 +01:00
Ralf Habacker
cc7efde510 Windows _dbus_listen_tcp_socket: Treat bind() failures as non-fatal
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61922
Reviewed-by: Simon McVittie <smcv@collabora.com>
2018-03-12 15:01:24 +01:00
Simon McVittie
6c5be2e146 Unix _dbus_connect_tcp_socket_with_nonce: Combine all connect() errors
Previously, we took the errno from the most recent connect() error,
and used a more generic diagnostic message.

Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Signed-off-by: Simon McVittie <smcv@collabora.com>
https://bugs.freedesktop.org/show_bug.cgi?id=61922
2018-03-10 12:14:52 +01:00
Simon McVittie
23fb280143 Unix _dbus_connect_tcp_socket_with_nonce: Always goto out
This will make it easier to do single-exit-path cleanup.

Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Signed-off-by: Simon McVittie <smcv@collabora.com>
https://bugs.freedesktop.org/show_bug.cgi?id=61922
2018-03-10 12:14:45 +01:00
Simon McVittie
ff359872b9 sysdeps-unix: Treat bind() failures as non-fatal
When we use AF_UNSPEC, we are likely to get multiple addresses back
from getaddrinfo(), and perhaps we won't be able to use them all.
Give that failure mode, or any other bind() failure, the same treatment
as EADDRINUSE failures here and all connect() failures in
_dbus_connect_tcp_socket_with_nonce(): if any address succeeds, then
the overall operation succeeds, but if all of them fail, then the
overall operation fails.

I've made _dbus_combine_tcp_errors() generic enough that
_dbus_connect_tcp_socket_with_nonce() could use it too, although that
isn't implemented here.

Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
[smcv: Adjust commit message]
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61922
2018-03-09 12:28:27 +00:00
Simon McVittie
e894c94562 sysdeps-unix: Set more specific IP-related errors when listening
When we have resolved a hostname/port pair to a list of IPv4 or IPv6
addresses, if we are unable to listen on a a specific one of those
addresses, we should report which one.

When IPv6 is disabled for the loopback interface, this changes the
diagnostic from:

Failed to bind socket "localhost:1234": Cannot assign requested address

to the more informative

Failed to bind socket "::1" port 1234: Cannot assign requested address

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61922
2018-03-09 12:27:31 +00:00
Simon McVittie
abb4d1a87b _dbus_append_address_from_socket: Factor out inet_sockaddr_to_string
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61922
2018-03-09 12:27:04 +00:00
Simon McVittie
83549e28ec Windows: Target Windows Vista or higher
This will give us the RFC-2553 inet_ntop() interface.
Windows Vista extended security support ended in 2017, but we don't
actually need anything from versions newer than Vista yet.

Loosely based on part of a patch by Ralf Habacker.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61922
2018-03-09 12:26:08 +00:00
Simon McVittie
dc15de1f7b _dbus_get_low_level_socket_errno: Add
Some libdbus functions have as their API "this function sets errno",
but that just leads to strangeness on Windows, where socket (Winsock)
functions don't actually set errno themselves, leading to those
functions having to copy the Winsock error into errno to fake the
Unix-like behaviour. With hindsight, that was probably a bad idea.

This function should be portable enough to be used with functions that
are essentially the same on Unix and Windows, like inet_ntop().

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61922
2018-03-09 12:25:46 +00:00
Simon McVittie
a97b6b597b _dbus_append_address_from_socket: Correct misleading error message
If what actually failed was reading the address from the socket,
we might as well say so.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61922
2018-03-09 12:25:36 +00:00