Simon McVittie [Wed, 11 Jul 2018 15:16:38 +0000 (16:16 +0100)]
dbus_server_listen: Don't leak first_connect_error
If an implementation fails to listen, and a subsequent implementation
succeeds, then we would have leaked this. Detected by running
tests/loopback.c under valgrind.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107194
(cherry picked from commit
b14a4517a82f7e7e4c0b59cb663ebf77563decda)
Simon McVittie [Mon, 23 Jul 2018 17:52:01 +0000 (18:52 +0100)]
sysdeps: Reassure gcc 8 that we are not overflowing struct sockaddr_un
Using strncpy (buffer, str, strlen (str)) is a "code smell" that
might indicate a serious bug (it effectively turns strncpy into
strcpy), and gcc 8 now warns about it. In fact we avoided the bug
here, but it wasn't at all obvious.
We already checked that path_len is less than or equal to
_DBUS_MAX_SUN_PATH_LENGTH, which is 99, chosen to be strictly less
than the POSIX minimum sizeof(sun_path) >= 100, so we couldn't
actually be overflowing the available buffer.
The new static assertion in this commit matches a comment above the
definition of _DBUS_MAX_SUN_PATH_LENGTH: we define
_DBUS_MAX_SUN_PATH_LENGTH to 99, because POSIX says struct
sockaddr_un's sun_path member is at least 100 bytes (including space
for a \0 terminator). dbus will now fail to compile on
platforms that are non-POSIX-compliant in this way, except for Windows.
We zeroed the struct sockaddr_un before writing into it, so stopping
one byte short of the end of sun_path ensures that we get \0
termination.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107350
Reviewed-by: Thiago Macieira <thiago@kde.org>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
(cherry picked from commit
f429631365ba59a1749438af2184cab138a31772)
Simon McVittie [Mon, 23 Jul 2018 17:20:54 +0000 (18:20 +0100)]
build: Disable new gcc 8 warning -Wcast-function-type
The foreach(list, (DBusForeachFunction) free, NULL) idiom seems too
entrenched to remove it from stable branches.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107349
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Thiago Macieira <thiago@kde.org>
Simon McVittie [Mon, 4 Jun 2018 16:55:05 +0000 (17:55 +0100)]
Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Mon, 4 Jun 2018 15:27:50 +0000 (16:27 +0100)]
test: Skip TCP tests if getaddrinfo doesn't work
For example, this can be the case in bubblewrap or Debian pbuilder after
unsharing the network namespace:
bwrap \
--bind / / \
--dev-bind /dev /dev \
--bind /dev/shm /dev/shm \
--bind /dev/pts /dev/pts \
--unshare-net \
${builddir}/test/test-loopback --tap
...
ok 1 /connect/tcp # SKIP Name resolution does not work here:
getaddrinfo("127.0.0.1", "0", {flags=ADDRCONFIG, family=INET,
socktype=STREAM, protocol=TCP}): Name or service not known
On some systems this can be circumvented by using nss_wrapper from
<https://cwrap.org/nss_wrapper.html>:
cat > hosts <<EOF
127.0.0.1 localhost
EOF
bwrap \
... \
env \
LD_PRELOAD=libnss_wrapper.so \
NSS_WRAPPER_HOSTS=$(pwd)/hosts \
${builddir}/test/test-loopback --tap
...
# listening at tcp:host=127.0.0.1,port=39219,family=ipv4,guid=...
but for systems where that does't work, we should be prepared to skip
the affected tests.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106812
(cherry picked from commit
f1faafd59bec67d347edb10447c4b9b18193458c)
Simon McVittie [Mon, 4 Jun 2018 15:27:49 +0000 (16:27 +0100)]
server-oom test: Don't assume localhost is resolvable
Pathological autobuilder environments might not list localhost in
/etc/hosts.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106812
(cherry picked from commit
4cfc7de30de7111f589501e5b597063aeb96cf28)
Simon McVittie [Mon, 4 Jun 2018 15:27:49 +0000 (16:27 +0100)]
test: Test the same things with unix: that we do with tcp:
Minimal autobuilder environments don't always have working TCP,
so we may need to skip TCP tests. Make sure we test the equivalent
code paths via Unix sockets in those environments.
One notable exception is test/fdpass.c, which uses TCP as a transport
that is known not to be able to carry Unix fds; this needs to continue
to use TCP.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106812
(cherry picked from commit
cb7dd5bfccb2882d0e9951c41040ff6a97bb827d)
Simon McVittie [Mon, 4 Jun 2018 15:27:48 +0000 (16:27 +0100)]
server-oom test: Parse the address instead of going directly to TCP
This expands test coverage, and lets us reuse the test for other
address schemes.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106812
(cherry picked from commit
b19c9e2f265878801bc48866a7cc3152ca2ad45e)
Simon McVittie [Mon, 4 Jun 2018 15:27:46 +0000 (16:27 +0100)]
sysdeps-unix: Handle errors from getaddrinfo correctly
getaddrinfo and getnameinfo have their own error-handling convention
in which the library call returns either 0 or an EAI_* error code
unrelated to errno. If the error code is not EAI_SYSTEM, then
the value of errno is undefined (in particular it might be carried
over from a previous system call or library call). Introduce a
new helper function _dbus_error_from_gai() to handle this.
The equivalent code paths in Windows appear to be OK: the Windows
implementation of getaddrinfo() is documented to return a Winsock
error code, which we seem to be handling correctly.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106395
(cherry picked from commit
60cedd0cfd775c9fcf7260e12af9b2ffeefc2bbe)
Simon McVittie [Mon, 30 Apr 2018 17:38:55 +0000 (18:38 +0100)]
Start 1.12.10 development
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Fri, 27 Apr 2018 17:03:50 +0000 (18:03 +0100)]
1.12.8
Simon McVittie [Fri, 27 Apr 2018 17:18:07 +0000 (18:18 +0100)]
build: Uninstall JavaScript and CSS from htmldir
Otherwise, distcheck fails when mallard-ducktype is available.
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit
9391d769ae335872e5b770f6741855fde45b8186)
Simon McVittie [Wed, 25 Apr 2018 15:58:53 +0000 (16:58 +0100)]
Preallocate release name
Simon McVittie [Wed, 25 Apr 2018 15:47:03 +0000 (16:47 +0100)]
NEWS: Mention non-local TCP too
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit
2390a325a0f094a87065e6dcfdf99c188a5b360f)
Simon McVittie [Mon, 23 Apr 2018 17:33:42 +0000 (18:33 +0100)]
Update NEWS
(cherry picked from commit
ee0e42ae2d157a5d4c9d5f1a9114632897bc47ad)
Simon McVittie [Thu, 12 Apr 2018 13:07:17 +0000 (14:07 +0100)]
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>
(cherry picked from commit
d0a16b59a8572fbd1934e941e2e3004840306222)
Simon McVittie [Thu, 12 Apr 2018 13:09:19 +0000 (14:09 +0100)]
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>
(cherry picked from commit
aef4475939a773e1a205a71d641ea2bb6793ab92)
Simon McVittie [Thu, 12 Apr 2018 13:08:08 +0000 (14:08 +0100)]
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>
(cherry picked from commit
5d3680486712891c13b85c07fab629bb70f623cc)
Simon McVittie [Thu, 12 Apr 2018 12:57:26 +0000 (13:57 +0100)]
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>
(cherry picked from commit
cf47380641aac0e5b40694b0ae09ffb85ec4b5fc)
Simon McVittie [Thu, 12 Apr 2018 12:57:00 +0000 (13:57 +0100)]
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>
(cherry picked from commit
2513f84db68a9edad8558806b777ed6c284016b9)
Simon McVittie [Mon, 23 Apr 2018 17:00:25 +0000 (18:00 +0100)]
Update NEWS for 1.12.x branch
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Mon, 23 Apr 2018 10:22:41 +0000 (11:22 +0100)]
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>
(cherry picked from commit
fa922639207de16d459983144ddad28b7abe60c2)
Simon McVittie [Mon, 23 Apr 2018 10:21:35 +0000 (11:21 +0100)]
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>
(cherry picked from commit
c84ac8b1ef3a9fa18127b2462ead369c4e8846bd)
Simon McVittie [Mon, 23 Apr 2018 16:38:56 +0000 (17:38 +0100)]
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>
(cherry picked from commit
49ad5b110fd5f5f4e41405d98007a11d8eb741f7)
Simon McVittie [Sat, 21 Apr 2018 18:35:41 +0000 (19:35 +0100)]
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>
(cherry picked from commit
bab857fb6f75ffe0ac3771de4b8272ad97623a2c)
Simon McVittie [Thu, 1 Mar 2018 18:05:09 +0000 (18:05 +0000)]
1.12.6
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Fri, 23 Feb 2018 10:32:43 +0000 (10:32 +0000)]
Clarify NEWS entry with implications of fd.o#105165
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Tue, 20 Feb 2018 18:40:36 +0000 (18:40 +0000)]
Update NEWS for #105165
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit
c62a20624e4616e7fa84427c54f3653312a7edb5)
Simon McVittie [Tue, 20 Feb 2018 11:45:39 +0000 (11:45 +0000)]
Add a unit test for the dbus-daemon resetting its fd limit
Reviewed-by: David King <dking@redhat.com>
[smcv: Fix typo in cmake macro name]
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=105165
(cherry picked from commit
49ca421997d91d3e01626b2c92a826e6a5db0b2f)
Simon McVittie [Tue, 20 Feb 2018 12:20:35 +0000 (12:20 +0000)]
cmake: Check for getrlimit, setrlimit
This gives us feature parity with the Autotools build system for this
particular area, and in particular means a system dbus-daemon built
with cmake can expand its fd limit.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=105165
(cherry picked from commit
a146724f2f7610bc0a968d03a3f20481c03a6a37)
David King [Wed, 7 Feb 2018 14:37:24 +0000 (14:37 +0000)]
bus: raise fd limits before dropping privs
Startup ordering was changed in #92832 to ensure that SELinux audit
messages could be sent. As a side effect, the raising of file descriptor
limits was moved to after the dropping of root privileges, resulting in
the limit change always failing.
Move the raise_file_descriptor_limit() call to ensure that it is called
before dropping root privileges.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=105165
Bug-RedHat: https://bugzilla.redhat.com/show_bug.cgi?id=1529044
[smcv: Call raise_file_descriptor_limit() even if !context->user]
Reviewed-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit
6e42964f5f850f4108fd8f7f3cd385ab4d60f9f6)
Simon McVittie [Thu, 8 Feb 2018 23:37:33 +0000 (23:37 +0000)]
Start towards 1.12.6
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Thu, 8 Feb 2018 14:32:18 +0000 (14:32 +0000)]
1.12.4
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Thu, 8 Feb 2018 14:21:17 +0000 (14:21 +0000)]
Add NEWS for #104925
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit
93433970e9c5a5d0b7f92a37174b40624c711475)
Philip Withnall [Sat, 3 Feb 2018 11:25:17 +0000 (12:25 +0100)]
doc: Fix bracket escaping in Ducktype API design file
There’s no need to escape closing brackets if the paired opening bracket
is escaped (or doesn’t need escaping).
See
https://github.com/projectmallard/mallard-ducktype/issues/16#issuecomment-
362590519.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=104925
Reviewed-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit
ad72d6bc5f45e78d21f64099f670a89dcf32507d)
Simon McVittie [Thu, 8 Feb 2018 14:11:26 +0000 (14:11 +0000)]
Add NEWS for #102839
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit
705db4455d482edba52d0af3fe57521da9d33e86)
Simon McVittie [Thu, 1 Feb 2018 19:47:00 +0000 (19:47 +0000)]
Add new test for waiting on pending calls in threads
Based on code contributed by Manish Narang. This is not included in the
automated test suite, because it isn't reliable on heavily-loaded
automatic test infrastructure like Travis-CI.
Reviewed-by: Philip Withnall <withnall@endlessm.com>
[smcv: Add the test to the CMake build system too, as requested]
[smcv: Convert into a manual test]
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=102839
(cherry picked from commit
0b1e2928606e0cf138c38e75eb248d2ed19bff15)
Simon McVittie [Mon, 24 Jul 2017 11:30:57 +0000 (12:30 +0100)]
Add a simplified backport of g_steal_pointer()
This will be used in tests later in the branch.
Sadly we can't use GLIB_VERSION_2_44 unless we are willing to have a
hard dependency on GLib 2.44, which would force us to do all our
Travis-CI builds in Docker containers rather than in ye olde base
system, and that adds 50% to the time taken to do builds.
Reviewed-by: Philip Withnall <withnall@endlessm.com>
[smcv: Rebase onto 1.13.x branch, fix minor conflicts]
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354
(cherry picked from commit
d5742550ca566317eaddea0ff7db04098f9f044f)
Simon McVittie [Tue, 25 Jul 2017 12:37:52 +0000 (13:37 +0100)]
cmake: Match AC_DEFINE more precisely, respecting [] quoting
The regular expression previously used here to select the second
comma-delimited argument won't work when we introduce an argument
containing a comma, which I need to do now. We can address this by
recognising Autoconf's quoting mechanism (which uses square
brackets).
This is not 100% right (it doesn't understand nested square brackets),
but it's good enough in practice.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Acked-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354
(cherry picked from commit
83b439f7b4c6a946e0fe9a0287910ba4f6318143)
Simon McVittie [Mon, 27 Nov 2017 19:14:23 +0000 (19:14 +0000)]
tests: Add the ability to multiply up test timeouts
Tests that brute-force OOM code paths can be rather slow.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=100317
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit
5c91d85f3ed462dac1e011aab216c9021e826773)
Simon McVittie [Thu, 1 Feb 2018 19:46:28 +0000 (19:46 +0000)]
test_connect_to_bus: Allow skipping the use of a DBusLoop
DBusLoop isn't thread-safe, so we can't use it to test multi-threaded
situations.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=102839
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
(cherry picked from commit
f127c8e110faed76039f96dbc53a87f093fea312)
[smcv: Adjust for older codebase]
Simon McVittie [Thu, 25 Jan 2018 12:35:07 +0000 (12:35 +0000)]
DBusPendingCall: Improve doc-comments around completed flag
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=102839
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
(cherry picked from commit
57a0cf1d14c20765bfc7a36234955b14f3811f2a)
Manish Narang [Thu, 25 Jan 2018 11:39:44 +0000 (11:39 +0000)]
DBusPendingCall: Only update ->completed under the connection lock
If one thread is blocking on a pending call, and another thread is
dispatching the connection, then we need them to agree on the value
of the completed flag by protecting all accesses with a lock. Reads
for this member seem to have the connection lock already, so it's
sufficient to make sure that the only write also happens under the
connection lock.
We already set the completed flag before calling the callback, so it
seems OK to stretch it to meaning that some thread has merely *taken
responsibility for* calling the callback.
The completed flag shares a bitfield with timeout_added, but that
flag is protected by the connection lock already.
Based on suggestions from Simon McVittie on
<https://bugs.freedesktop.org/show_bug.cgi?id=102839>.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=102839
[smcv: Revert indentation changes; add commit message]
Reviewed-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit
d3e03eb50eefa5a38d87f274c7de73f36468459c)
Manish Narang [Thu, 25 Jan 2018 11:39:44 +0000 (11:39 +0000)]
DBusConnection: Pass a pending call around more often
If a pending call is provided, _dbus_connection_do_iteration_unlocked
checks whether it has completed or has a reply ready as soon as it
acquires the I/O path. If that's the case, then the iteration
terminates without trying to carry out I/O, so that the pending call
can be dispatched immediately, without blocking until a timeout is
reached. This change is believed to be necessary, but not sufficient,
to resolve #102839.
Based on part of a patch from Michael Searle on
<https://bugs.freedesktop.org/show_bug.cgi?id=102839>.
Commit message added by Simon McVittie.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=102839
Reviewed-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit
30f8a38b3c8f8756744d6b65dd8207302a683acc)
Simon McVittie [Mon, 29 Jan 2018 12:01:09 +0000 (12:01 +0000)]
NEWS: Mention systemd < 237 here too
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit
38dea203a5514dc4b4e858fce0b6957d4cf116ab)
Simon McVittie [Mon, 29 Jan 2018 11:59:40 +0000 (11:59 +0000)]
tmpfiles: Add a note that one line is not needed with newer systemd
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit
8fd30736917e36b5eb69167dc3ef23be74f76039)
Simon McVittie [Mon, 29 Jan 2018 10:45:43 +0000 (10:45 +0000)]
travis-ci: Get autoconf-archive from Debian 9 'stretch'
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit
acb775a92b1c554f251de129c7e51db19522b65e)
Simon McVittie [Thu, 11 Jan 2018 12:39:39 +0000 (12:39 +0000)]
Update NEWS for #104577
Signed-off-by: Simon McVittie <smcv@collabora.com>
Chris Lesiak [Wed, 10 Jan 2018 21:35:20 +0000 (15:35 -0600)]
Modify systemd tmpfiles.d snippet to create /var/lib/dbus/
This snippet was already attempting to create /var/lib/dbus/machine-id,
but would fail on volatile or stateless systems where /var/lib/dbus/
did not already exist. systemd-tmpfiles automatically creates parent
directories for tmpfiles of type 'd', 'D', etc., but not for files
or symlinks (https://github.com/systemd/systemd/issues/7853).
Signed-off-by: Chris Lesiak <chris.lesiak@licor.com>
[smcv: Extended commit message to clarify why we need this]
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=104577
Reviewed-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit
aeebf801f1ab462cba3a174440c09a86d326002a)
Simon McVittie [Thu, 14 Dec 2017 15:52:24 +0000 (15:52 +0000)]
Update NEWS for #104265
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit
67d04ad1aa5160fdd36ba2108e8f988ddcffe423)
Benedikt Heine [Thu, 14 Dec 2017 14:28:10 +0000 (15:28 +0100)]
Resolve bindir variable in dbus-1.pc file correctly
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=104265
Reviewed-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit
d5c2e5539fcaf37b9150d2391bcf9d6737931464)
Simon McVittie [Tue, 28 Nov 2017 12:30:32 +0000 (12:30 +0000)]
Merge remote-tracking branch 'github/dbus-1.12' into dbus-1.12
Simon McVittie [Mon, 27 Nov 2017 16:23:16 +0000 (16:23 +0000)]
_dbus_server_new_for_socket: Iterate over arrays as intended
Commit
0c03b505 was meant to clear all the fds indexed by j in
[0, n_fds), which socket_disconnect() can't be allowed to close
(because on failure the caller remains responsible for closing them);
but instead it closed the one we failed to add to the main loop
(fd i), repeatedly.
Similarly, it was meant to invalidate all the watches indexed by j
in [i, n_fds) (the one we failed to add to the main loop and the ones
we didn't try to add to the main loop yet), which socket_disconnect()
can't be allowed to see (because it would fail to remove them from
the main loop and hit an assertion failure); but instead it invalidated
fd i, repeatedly.
These happen to be the same thing if you only have one fd, resulting
in the test-case passing on an IPv4-only system, but failing on a
system with both IPv4 and IPv6.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89104
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
(cherry picked from commit
c9aa00ce730f9741ab39ff704e46ec33dd4a11ea)
Simon McVittie [Fri, 24 Nov 2017 19:14:34 +0000 (19:14 +0000)]
NEWS for 1.12.x
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Tue, 21 Nov 2017 13:36:10 +0000 (13:36 +0000)]
Add a targeted test for OOM during _dbus_server_new_for_tcp_socket()
This also covers _dbus_server_new_for_socket(), which is one of the
worse places in terms of complexity of the error-unwinding path
(3 labels).
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89104
(cherry picked from commit
ac6c4d384d83c2e39a4f4156ef11cadcfbfa44f6)
Simon McVittie [Tue, 21 Nov 2017 14:43:01 +0000 (14:43 +0000)]
_dbus_listen_tcp_socket: Don't rely on dbus_realloc setting errno
dbus_realloc() doesn't guarantee to set errno (if it did, the
only reasonable thing it could set it to would be ENOMEM). In
particular, faking OOM conditions doesn't set it. This can cause an
assertion failure when OOM tests assert that the only error that can
validly occur is DBUS_ERROR_NO_MEMORY.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89104
(cherry picked from commit
9ded6907e66b89c3c74620a4485e8f752f092a60)
Simon McVittie [Tue, 21 Nov 2017 14:38:13 +0000 (14:38 +0000)]
_dbus_server_new_for_socket: Properly disconnect during error unwinding
_dbus_server_finalize_base() asserts that the socket has been
disconnected, but in some OOM code paths we would call it without
officially disconnecting. Do so.
This means we need to be a bit more careful about what is
socket_disconnect()'s responsibility to clean up, what is
_dbus_server_new_for_socket()'s responsibility, and what is the caller's
responsibility.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89104
(cherry picked from commit
0c03b505a9718c6d497caffb7d6083371679a852)
Simon McVittie [Tue, 21 Nov 2017 14:36:02 +0000 (14:36 +0000)]
_dbus_server_new_for_socket: Invalidate watches during error unwinding
We assert that every watch is invalidated before it is freed, but
in some OOM code paths this didn't happen.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89104
(cherry picked from commit
1ce34beef85a7a0b3c25890837e3a72f8bdac1f0)
Simon McVittie [Tue, 14 Nov 2017 12:25:58 +0000 (12:25 +0000)]
Update NEWS for 1.12.x
Signed-off-by: Simon McVittie <smcv@collabora.com>
Thomas Zajic [Tue, 14 Nov 2017 12:23:51 +0000 (12:23 +0000)]
Add a missing space in logging output
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103729
(cherry picked from commit
c9ce0a705966c78c680b465fb5747a16c570c4a8)
Simon McVittie [Mon, 13 Nov 2017 17:11:27 +0000 (17:11 +0000)]
Start 1.12.4
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Mon, 13 Nov 2017 13:35:55 +0000 (13:35 +0000)]
1.12.2
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Fri, 10 Nov 2017 16:24:59 +0000 (16:24 +0000)]
Update NEWS for 1.12.x
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Mon, 6 Nov 2017 16:16:31 +0000 (16:16 +0000)]
bus_connections_setup_connection: If we can't set it up, log why
While reviewing fd.o#101354, Philip Withnall pointed out that if we
rejected a connection in the new code there, we didn't log why. It
turns out we didn't log that in the more normal code path either.
Redo the error handling so that failure to set up a connection
is logged.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103592
(cherry picked from commit
56847ae818e8c144b9c7a8102efd1c926ead2f62)
Simon McVittie [Fri, 10 Nov 2017 16:20:02 +0000 (16:20 +0000)]
Update NEWS for 1.12.x
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Tue, 25 Jul 2017 11:43:01 +0000 (12:43 +0100)]
travis-ci: Enable/disable more features in various builds
In the debug build, enable features that are off by default. In the
reduced build, explicitly disable features, some of which are
on by default. In the legacy build, check that we can compile the
default feature-set without inotify, dnotify, systemd, etc.
Reviewed-by: Philip Withnall <withnall@endlessm.com>
[smcv: Rebase onto 1.13.x branch, fix minor conflicts]
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354
(cherry picked from commit
3c031ef5aa1f7f53c6344781cb38b78abe44dc96)
Simon McVittie [Mon, 6 Nov 2017 19:11:32 +0000 (19:11 +0000)]
_dbus_accept_with_noncefile: Don't leak nonce
This was always leaked, both on success and on error.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103597
(cherry picked from commit
37d5af203c0fc22c9ae746b2ae4781ff648a792f)
Simon McVittie [Mon, 6 Nov 2017 19:10:42 +0000 (19:10 +0000)]
do_noncefile_create: Avoid freeing uninitialized memory on error
We could free all of these without having ever successfully
initialized them.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103597
(cherry picked from commit
6d08f5c04e601f16ef4ee2126a90c924b7e26df0)
Simon McVittie [Mon, 6 Nov 2017 19:09:51 +0000 (19:09 +0000)]
do_check_nonce: Don't free uninitialized memory on OOM
If _dbus_string_init() fails, it doesn't guarantee that the string
is initialized to anything in particular. Worse, if
_dbus_string_init (&buffer) fails, p would never have been initialized
at all, due to the use of the short-circuiting || operator.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103597
(cherry picked from commit
0ea0e4b0fddd1109835b8b9f7a8319d59c8d9303)
Simon McVittie [Tue, 31 Oct 2017 13:06:48 +0000 (13:06 +0000)]
Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
Tony Theodore [Tue, 31 Oct 2017 13:02:37 +0000 (13:02 +0000)]
build: Avoid using `echo -e`
`echo -e` is a GNU extension, and in particular not available on
Darwin.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103493
[smcv: Added commit message]
Reviewed-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit
216ae1adfcf9ce9274019b3c29b8f1245c26dec1)
Simon McVittie [Tue, 31 Oct 2017 11:40:29 +0000 (11:40 +0000)]
Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
ilovezfs [Tue, 31 Oct 2017 11:36:05 +0000 (11:36 +0000)]
build: Use $(MKDIR_P) syntax suitable for install-sh
This fixes the build when a GNU-compatible `mkdir -p` is not available.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103521
[smcv: Add commit message]
Reviewed-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit
c7d8b723eb53848f9a86f36d640ea5f564d34590)
Simon McVittie [Mon, 30 Oct 2017 14:49:59 +0000 (14:49 +0000)]
Bump version for 1.12.x branch
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Mon, 30 Oct 2017 12:37:23 +0000 (12:37 +0000)]
Prepare 1.12.0
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Mon, 30 Oct 2017 12:31:03 +0000 (12:31 +0000)]
Disable deprecation warnings for stable branch
We're not going to replace deprecated functions here, similar to commit
88e0ccb2 in the dbus-1.10 branch.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Mon, 23 Oct 2017 15:10:39 +0000 (16:10 +0100)]
NEWS for #103420
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Mon, 23 Oct 2017 14:07:24 +0000 (15:07 +0100)]
build: Remove various unused files from build system
These were in git but not distributed in source tarballs, and in fact
not hooked up to the Autotools build system at all.
test/data/valid-introspection-files was mentioned in the CMake build
system (copied from the source directory to the build directory), but
according to `git grep` is not used for anything.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103420
Simon McVittie [Mon, 23 Oct 2017 12:59:34 +0000 (13:59 +0100)]
build: Include README.cmake in Autotools "make dist"
Our official source releases are Autotools "make dist" tarballs, but
there's no reason why CMake users can't use those too, and we already
include the CMake build files.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103420
Simon McVittie [Mon, 23 Oct 2017 12:57:56 +0000 (13:57 +0100)]
build: Distribute individual files and directories from cmake/
If we distribute the entire directory in "make dist" tarballs, then
we include the generated files cmake/DBus1Config.cmake and
cmake/DBus1ConfigVersion.cmake, which we should not.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103420
Simon McVittie [Mon, 23 Oct 2017 12:32:22 +0000 (13:32 +0100)]
build: Distribute more test data in source tarballs
test-bus exercises the parser by trying to parse every file in these
directories. A couple of files were accidentally left out, meaning
those parsing code paths are tested when we build from git, but not
when we build from a tarball release.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103420
Simon McVittie [Mon, 23 Oct 2017 13:41:24 +0000 (14:41 +0100)]
build: Don't explicitly clean up configure-generated files
cmake/DBus1Config.cmake, cmake/DBus1ConfigVersion.cmake and dbus-1.pc
are all generated by AC_CONFIG_FILES, so they are automatically listed
in $(CONFIG_CLEAN_FILES) and cleaned in "make distclean" without further
help from us.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103420
Simon McVittie [Mon, 23 Oct 2017 12:18:55 +0000 (13:18 +0100)]
build: Don't distribute versioninfo.rc in "make dist" tarballs
It's generated by configure, so we should not distribute it.
Because it's generated by configure, it is automatically cleaned up
by "make distclean" via $(CONFIG_CLEAN_FILES).
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103420
Simon McVittie [Mon, 23 Oct 2017 14:21:58 +0000 (15:21 +0100)]
Start towards 1.11.24 (or maybe 1.12.0)
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Mon, 23 Oct 2017 10:29:57 +0000 (11:29 +0100)]
Prepare 1.11.22
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Mon, 23 Oct 2017 10:09:45 +0000 (11:09 +0100)]
Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
Ralf Habacker [Wed, 18 Oct 2017 06:23:06 +0000 (08:23 +0200)]
Do not add custom UAC related manifest to cmake builds for MSVC on Windows
MSVC compiler >= 8.0 (VS 2005) add an identical manifest (with uac level
set to 'asInvoker' specified by /MANIFEST) by default to generated binaries
(see https://msdn.microsoft.com/en-us/library/f2c0w594.aspx for details).
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=102558
Simon McVittie [Thu, 19 Oct 2017 16:57:53 +0000 (17:57 +0100)]
Add first draft of release notes for 1.12.0
I'm hoping for 1.11.24 to act as 1.12rc1, with a remarkably similar
1.12.0 release shortly after if all goes well.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Thu, 19 Oct 2017 16:56:55 +0000 (17:56 +0100)]
Update NEWS for latest versioninfo changes
Signed-off-by: Simon McVittie <smcv@collabora.com>
Ralf Habacker [Tue, 17 Oct 2017 15:14:43 +0000 (17:14 +0200)]
Fix cmake 3.5 configure error on opening a non existant file
Previous cmake versions seemed to be more tolerant.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103015
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
Reviewed-by: Simon McVittie <smcv@collabora.com>
Ralf Habacker [Fri, 6 Oct 2017 20:46:13 +0000 (22:46 +0200)]
Update versioninfo.rc.in
- include <windows.h> to be able to use constants
- let versioninfo be visible in explorer by adding a "Translation" value
- change FILEOS from VOS_NT_WINDOWS32, which was intended for Windows NT,
to VOS__WINDOWS32
- stop setting FILEFLAGS 0x20 (VS_FF_SPECIALBUILD), which is not
appropriate here because we build the normal version, not a special
version
- use constants
- fix strings
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103015
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
Reviewed-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Wed, 18 Oct 2017 13:48:51 +0000 (14:48 +0100)]
Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
Ralf Habacker [Tue, 17 Oct 2017 18:56:12 +0000 (20:56 +0200)]
Add version info to dbus-1 target for non msvc builds on Windows too
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103015
Reviewed-by: Simon McVittie <smcv@collabora.com>
Ralf Habacker [Tue, 17 Oct 2017 18:57:50 +0000 (20:57 +0200)]
Use cmake build in timestamp function to generate the build time stamp
The recent implementation generates a timestamp containing eol on
linux hosts, which generates unparseable versioninfo.rc.
This commit raises the minimal required cmake version to 3.0.2.
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103015
Reviewed-by: Simon McVittie <smcv@collabora.com>
Simon McVittie [Thu, 28 Sep 2017 16:07:20 +0000 (17:07 +0100)]
Windows: Check for $RC, not $WINDRES
That's what is checked for by LT_LANG([Windows Resource]) further
up, and is what we now use during the build. Its value is typically
i686-w64-mingw32-windres.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103015
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Simon McVittie [Thu, 28 Sep 2017 16:00:29 +0000 (17:00 +0100)]
Windows: Use libtool-detected RC to compile resources in tools/
We have two variables that both expand to i686-w64-mingw32-windres,
namely WINDRES and RC, and we might as well use the same one as
in dbus/ here. However, it seems we can't wrap windres in libtool
when producing an executable: if we use .rc.lo, my Automake 1.15.1
doesn't realise that it needs to include disable-uac.lo in the
list of objects, whereas if we use .rc.o, Ralf's libtool 2.4.2 and
Automake 1.13.4 disagree on where the output should go
(.libs/disable-uac.o vs. disable-uac.o) and the link fails.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103015
Simon McVittie [Fri, 6 Oct 2017 12:00:39 +0000 (13:00 +0100)]
Windows: Stop manipulating line numbering in versioninfo.rc
If __LINE__ doesn't work in MSVC's resource compiler, then removing
the #line directive altogether seems a simpler fix than redefining
__LINE__ to the wrong value.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103015
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Simon McVittie [Fri, 6 Oct 2017 11:54:30 +0000 (12:54 +0100)]
cmake: Stop creating an empty afxres.h
The resource file used to #include this, but it was unnecessary,
and Ralf removed it in commit e3a14eb.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103015
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Simon McVittie [Thu, 28 Sep 2017 15:58:34 +0000 (16:58 +0100)]
Windows: Simplify compiling versioninfo.rc by using libtool facilities
libtool has built-in support for Windows resources, and we even
enable it in configure.ac. What it doesn't have is a built-in rule
for generating Libtool objects using that built-in support, but
we can add one.
We have to generate Libtool pseudo-objects (.lo) rather than native
object files (.o) so that we get both a PIC object for the shared
library and a non-PIC object for the static library.
This mimics the libtool invocations used for compiling C and C++.
Note that $(RC) is typically i686-w64-mingw32-windres, the same as
our project-specific variable $(WINDRES) which was previously used here.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103015
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
David King [Tue, 3 Oct 2017 12:34:03 +0000 (13:34 +0100)]
doc: Fix dbus-send.1 uint16 typo
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103075
Bug-RedHat: https://bugzilla.redhat.com/show_bug.cgi?id=1467415
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Reviewed-by: Simon McVittie <smcv@collabora.com>