Commit graph

5153 commits

Author SHA1 Message Date
Simon McVittie
d4d6cdab99 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 5c91d85f3e)
2018-02-06 19:14:27 +00:00
Simon McVittie
bd31f268e2 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 f127c8e110)
[smcv: Adjust for older codebase]
2018-02-06 19:14:27 +00:00
Simon McVittie
3c73f2e8f3 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 57a0cf1d14)
2018-02-06 19:14:27 +00:00
Manish Narang
a6e5364d84 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 d3e03eb50e)
2018-02-06 19:14:27 +00:00
Manish Narang
1572ca928b 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 30f8a38b3c)
2018-02-06 19:14:27 +00:00
Simon McVittie
47ab11cb42 NEWS: Mention systemd < 237 here too
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 38dea203a5)
2018-01-29 12:01:15 +00:00
Simon McVittie
5663d36454 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 8fd3073691)
2018-01-29 11:59:51 +00:00
Simon McVittie
25a1926cf8 travis-ci: Get autoconf-archive from Debian 9 'stretch'
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit acb775a92b)
2018-01-29 11:59:50 +00:00
Simon McVittie
7f4d9b0b00 Update NEWS for #104577
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-01-11 12:39:39 +00:00
Chris Lesiak
49c6c61966 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 aeebf801f1)
2018-01-11 12:36:47 +00:00
Simon McVittie
402b79206c Update NEWS for #104265
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 67d04ad1aa)
2017-12-14 15:52:53 +00:00
Benedikt Heine
6f0cbee93d 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 d5c2e5539f)
2017-12-14 14:58:47 +00:00
Simon McVittie
fc2ab95515 Merge remote-tracking branch 'github/dbus-1.12' into dbus-1.12 2017-11-28 12:30:32 +00:00
Simon McVittie
9a8428831b _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 c9aa00ce73)
2017-11-27 19:48:36 +00:00
Simon McVittie
f634f16984 NEWS for 1.12.x
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-11-24 19:14:34 +00:00
Simon McVittie
3e245e15d6 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 ac6c4d384d)
2017-11-24 13:48:15 +00:00
Simon McVittie
c393aefb34 _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 9ded6907e6)
2017-11-24 13:42:27 +00:00
Simon McVittie
d166252a8d _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 0c03b505a9)
2017-11-24 13:16:30 +00:00
Simon McVittie
58c9a56dbb _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 1ce34beef8)
2017-11-24 13:16:17 +00:00
Simon McVittie
a1121674a7 Update NEWS for 1.12.x
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-11-14 12:25:58 +00:00
Thomas Zajic
64a5ba63be 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 c9ce0a7059)
2017-11-14 12:24:40 +00:00
Simon McVittie
7f92c3cfcf Start 1.12.4
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-11-13 17:11:27 +00:00
Simon McVittie
0f0968336b 1.12.2
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-11-13 13:35:55 +00:00
Simon McVittie
06c105545f Update NEWS for 1.12.x
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-11-10 16:24:59 +00:00
Simon McVittie
1a29dc8544 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 56847ae818)
2017-11-10 16:22:20 +00:00
Simon McVittie
35238ed567 Update NEWS for 1.12.x
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-11-10 16:20:02 +00:00
Simon McVittie
b672a683be 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 3c031ef5aa)
2017-11-10 16:10:15 +00:00
Simon McVittie
a208e02421 _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 37d5af203c)
2017-11-07 11:43:37 +00:00
Simon McVittie
d000891624 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 6d08f5c04e)
2017-11-07 11:43:34 +00:00
Simon McVittie
208af9a447 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 0ea0e4b0fd)
2017-11-07 11:43:31 +00:00
Simon McVittie
b5d1585b0f Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-10-31 13:07:03 +00:00
Tony Theodore
47d2e5a345 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 216ae1adfc)
2017-10-31 13:06:55 +00:00
Simon McVittie
d6eb0039c1 Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-10-31 11:40:56 +00:00
ilovezfs
c416bb37dd 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 c7d8b723eb)
2017-10-31 11:40:52 +00:00
Simon McVittie
b299a226b3 Bump version for 1.12.x branch
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-10-30 14:49:59 +00:00
Simon McVittie
98294ab81a Prepare 1.12.0
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-10-30 12:37:23 +00:00
Simon McVittie
93efaf7873 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>
2017-10-30 12:31:03 +00:00
Simon McVittie
d5746922de NEWS for #103420
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-10-23 16:10:39 +01:00
Simon McVittie
1e8c52c647 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
2017-10-23 16:08:32 +01:00
Simon McVittie
27b60e4c5b 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
2017-10-23 16:08:32 +01:00
Simon McVittie
7b21a8ab74 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
2017-10-23 16:08:32 +01:00
Simon McVittie
a3d6ec26a2 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
2017-10-23 16:08:32 +01:00
Simon McVittie
60993c27e1 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
2017-10-23 16:08:32 +01:00
Simon McVittie
bfee8772bf 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
2017-10-23 16:08:32 +01:00
Simon McVittie
dd89b359f0 Start towards 1.11.24 (or maybe 1.12.0)
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-10-23 15:21:58 +01:00
Simon McVittie
f87fea641f Prepare 1.11.22
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-10-23 11:29:57 +01:00
Simon McVittie
ec51d53828 Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-10-23 11:09:45 +01:00
Ralf Habacker
b23dc40ce3 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
2017-10-23 11:07:17 +01:00
Simon McVittie
6ad07c4c6d 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>
2017-10-19 17:57:53 +01:00
Simon McVittie
b3c612ac4c Update NEWS for latest versioninfo changes
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-10-19 17:56:55 +01:00