]> git.ipfire.org Git - thirdparty/dbus.git/log
thirdparty/dbus.git
7 years agobus/containers: Emit InstanceRemoved signal
Simon McVittie [Fri, 23 Jun 2017 11:54:34 +0000 (12:54 +0100)] 
bus/containers: Emit InstanceRemoved signal

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354

7 years agotest/containers: Exercise the various ways to stop a container
Simon McVittie [Tue, 20 Jun 2017 18:48:45 +0000 (19:48 +0100)] 
test/containers: Exercise the various ways to stop a container

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354

7 years agobus/containers: Don't allow stopping other users' containers
Simon McVittie [Fri, 23 Jun 2017 14:20:04 +0000 (15:20 +0100)] 
bus/containers: Don't allow stopping other users' containers

On the system bus, that would be a denial of service, assuming we
relax the access-control from METHOD_FLAG_PRIVILEGED to a new
METHOD_FLAG_NOT_CONTAINERS later.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354

7 years agobus/containers: Implement methods to stop containers explicitly
Simon McVittie [Thu, 22 Jun 2017 21:18:34 +0000 (22:18 +0100)] 
bus/containers: Implement methods to stop containers explicitly

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354

7 years agobus/containers: Give each instance a list of all its connections
Simon McVittie [Mon, 6 Nov 2017 16:25:42 +0000 (16:25 +0000)] 
bus/containers: Give each instance a list of all its connections

Reviewed-by: Philip Withnall <withnall@endlessm.com>
[smcv: Fix minor conflict]
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354

7 years agobus/containers: Shut down container servers when initiator goes away
Simon McVittie [Thu, 22 Jun 2017 17:47:03 +0000 (18:47 +0100)] 
bus/containers: Shut down container servers when initiator goes away

We will eventually want to have other ways to signal that a
container server should stop listening, so that the container manager
doesn't have to stay on D-Bus (fd-passing the read end of a pipe
whose write end will be closed by the container manager has been
suggested as easier to deal with for Flatpak/Bubblewrap), but for
now we're doing the simplest possible thing.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354

7 years agobus/containers: Link each container to its initiating connection
Simon McVittie [Mon, 6 Nov 2017 16:25:01 +0000 (16:25 +0000)] 
bus/containers: Link each container to its initiating connection

We will need this to be able to shut down the container when its
creator vanishes.

Reviewed-by: Philip Withnall <withnall@endlessm.com>
[smcv: Fix minor conflict]
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354

7 years agobus/containers: Each connection to a container holds a reference
Simon McVittie [Mon, 6 Nov 2017 16:24:03 +0000 (16:24 +0000)] 
bus/containers: Each connection to a container holds a reference

Reviewed-by: Philip Withnall <withnall@endlessm.com>
[smcv: Fix minor conflicts]
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354

7 years agotest/containers: Exercise connecting to the new socket as the wrong uid
Simon McVittie [Thu, 6 Jul 2017 15:37:50 +0000 (16:37 +0100)] 
test/containers: Exercise connecting to the new socket as the wrong uid

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354

7 years agobus/containers: Require connecting uid to match caller of AddServer
Simon McVittie [Thu, 22 Jun 2017 17:02:00 +0000 (18:02 +0100)] 
bus/containers: Require connecting uid to match caller of AddServer

If we're strict now, we can relax this later (either with a named
parameter or always); but if we're lenient now, we'll be stuck with it
forever, so be strict.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354

7 years agotest/containers: Exercise a successful call to AddServer
Simon McVittie [Tue, 20 Jun 2017 14:55:53 +0000 (15:55 +0100)] 
test/containers: Exercise a successful call to AddServer

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354

7 years agobus/containers: Set up new connections to join the bus
Simon McVittie [Thu, 22 Jun 2017 16:58:42 +0000 (17:58 +0100)] 
bus/containers: Set up new connections to join the 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=101354

7 years agobus_context_add_incoming_connection: factor out
Simon McVittie [Mon, 6 Nov 2017 16:28:11 +0000 (16:28 +0000)] 
bus_context_add_incoming_connection: factor out

Reviewed-by: Philip Withnall <withnall@endlessm.com>
[smcv: Fix minor conflict]
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354

7 years agobus/containers: Create a DBusServer and add it to the main loop
Simon McVittie [Fri, 21 Jul 2017 19:09:15 +0000 (20:09 +0100)] 
bus/containers: Create a DBusServer and add it to the main loop

This means we can accept connections on the new socket. For now, we
don't process them and they get closed.

For the system bus (or root's session bus, where the difference is
harmless but makes automated testing easier), rely on system-wide
infrastructure to create /run/dbus/containers. The upstream dbus
distribution no longer contains integration glue for non-systemd boot
systems, but downstreams that maintain a non-systemd boot system and are
interested in the Containers interface should create /run/dbus/containers
during boot.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354

7 years agobus/containers: Build a global data structure for container instances
Simon McVittie [Tue, 20 Jun 2017 11:31:18 +0000 (12:31 +0100)] 
bus/containers: Build a global data structure for container instances

We still don't actually create a DBusServer for incoming connections
at this point, much less accept incoming connections.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354

7 years agotest/containers: Exercise the new parameter checking
Simon McVittie [Fri, 2 Jun 2017 18:35:56 +0000 (19:35 +0100)] 
test/containers: Exercise the new parameter checking

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354

7 years agobus/containers: Do some basic checking on the parameters
Simon McVittie [Fri, 2 Jun 2017 18:32:24 +0000 (19:32 +0100)] 
bus/containers: Do some basic checking on the parameters

In particular, we now fail early if we can't extract the file
descriptor, or if there are named parameters (none are supported yet).

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354

7 years agotest/containers: New test
Simon McVittie [Tue, 20 Jun 2017 16:37:33 +0000 (17:37 +0100)] 
test/containers: New test

So far it only exercises SupportedArguments.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354

7 years agotest/uid-permissions: Assert that AddServer is privileged
Simon McVittie [Tue, 20 Jun 2017 16:36:59 +0000 (17:36 +0100)] 
test/uid-permissions: Assert that AddServer is privileged

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354

7 years agotravis-ci: Do at least one build with and one without containers
Simon McVittie [Tue, 25 Jul 2017 11:43:40 +0000 (12:43 +0100)] 
travis-ci: Do at least one build with and one without containers

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354

7 years agodriver: Add a stub implementation of the Containers1 interface
Simon McVittie [Fri, 2 Jun 2017 13:51:54 +0000 (14:51 +0100)] 
driver: Add a stub implementation of the Containers1 interface

For now, this is considered to be a privileged operation, because the
resource-limiting isn't wired up yet. It only contains the bare minimum
of API.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354

7 years agospec: Document the initial Containers1 interface
Simon McVittie [Fri, 2 Jun 2017 13:52:03 +0000 (14:52 +0100)] 
spec: Document the initial Containers1 interface

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354

8 years ago_dbus_test_oom_handling: print TAP diagnostics
Simon McVittie [Tue, 28 Nov 2017 13:29:58 +0000 (13:29 +0000)] 
_dbus_test_oom_handling: print TAP diagnostics

These aren't *that* verbose, so it seems OK to print them all the time,
not just in the needlessly spammy verbose mode.

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>
8 years agotests: Add the ability to multiply up test timeouts
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>
8 years agotest-utils: Separate failable and non-failable functions
Simon McVittie [Mon, 27 Nov 2017 19:26:03 +0000 (19:26 +0000)] 
test-utils: Separate failable and non-failable functions

test_object_try_whatever() now has libdbus-like OOM handling,
while test_object_whatever() has GLib-like OOM handling. This is
because an overwhelming majority of the callers of these functions
either didn't check for OOM anyway, or checked for it but then
aborted. In the uncommon case where we do care, we can use the _try_
version.

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>
8 years agotest_connection_setup: Don't crash on unlikely OOM
Simon McVittie [Mon, 27 Nov 2017 19:23:10 +0000 (19:23 +0000)] 
test_connection_setup: Don't crash on unlikely OOM

If _dbus_loop_queue_dispatch fails with OOM, we'd try to free cd,
while cd is already owned by the connection's timeout functions.

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>
8 years agotest_try_connect_to_bus: Cope with OOM while setting up connection
Simon McVittie [Mon, 27 Nov 2017 19:21:09 +0000 (19:21 +0000)] 
test_try_connect_to_bus: Cope with OOM while setting up connection

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>
8 years agotest_try_connect_to_bus: Don't leak the connection on OOM
Simon McVittie [Mon, 27 Nov 2017 19:14:57 +0000 (19:14 +0000)] 
test_try_connect_to_bus: Don't leak the connection on OOM

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>
8 years agodbus_message_demarshal: Set error if we can't allocate the loader
Simon McVittie [Mon, 27 Nov 2017 19:13:25 +0000 (19:13 +0000)] 
dbus_message_demarshal: Set error if we can't allocate the loader

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>
8 years agoDBusHeader: Add a diagram of the header
Simon McVittie [Tue, 21 Nov 2017 19:46:56 +0000 (19:46 +0000)] 
DBusHeader: Add a diagram of the header

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>
8 years ago_dbus_header_load: Operate on the entire string, not a substring
Simon McVittie [Fri, 1 Dec 2017 19:18:28 +0000 (19:18 +0000)] 
_dbus_header_load: Operate on the entire string, not a substring

This function worked with a (string,position,length) triple, but it
turns out to only have one caller, which tells it to look at the
entire string anyway. It'll be easier to document if all the offsets
start from 0.

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>
8 years ago_dbus_server_new_for_socket: Iterate over arrays as intended
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>
8 years agoNEWS for 1.13.x
Simon McVittie [Fri, 24 Nov 2017 13:14:16 +0000 (13:14 +0000)] 
NEWS for 1.13.x

Signed-off-by: Simon McVittie <smcv@collabora.com>
8 years agotests: Use test_main_context_call_and_wait
Simon McVittie [Tue, 21 Nov 2017 16:01:02 +0000 (16:01 +0000)] 
tests: Use test_main_context_call_and_wait

Also use test_oom() where the relevant lines are changing anyway.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103600

8 years agotest_main_context_call_and_wait: Add
Simon McVittie [Tue, 21 Nov 2017 12:15:04 +0000 (12:15 +0000)] 
test_main_context_call_and_wait: Add

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103600

8 years agotest-utils: Use TAP syntax to die with a fatal error
Simon McVittie [Tue, 21 Nov 2017 12:10:01 +0000 (12:10 +0000)] 
test-utils: Use TAP syntax to die with a fatal 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=103600

8 years agotests: Don't use the same variable for call and reply
Simon McVittie [Tue, 21 Nov 2017 11:59:20 +0000 (11:59 +0000)] 
tests: Don't use the same variable for call and reply

It seemed like a nice idea at the time, but I now think it's more
confusing than it's worth.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103600

8 years agotest/sd-activation: Make more use of dbus_clear_message()
Simon McVittie [Tue, 21 Nov 2017 12:03:34 +0000 (12:03 +0000)] 
test/sd-activation: Make more use of dbus_clear_message()

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103600

8 years agotests: Don't leak pending calls
Simon McVittie [Tue, 21 Nov 2017 12:01:23 +0000 (12:01 +0000)] 
tests: Don't leak pending calls

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103600

8 years agotest/dbus-daemon: Don't leak method call messages if we skip tests
Simon McVittie [Tue, 21 Nov 2017 10:56:56 +0000 (10:56 +0000)] 
test/dbus-daemon: Don't leak method call messages if we skip 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=103600

8 years agotest_peer_ping: Don't leak one method call per invocation
Simon McVittie [Tue, 21 Nov 2017 10:50:37 +0000 (10:50 +0000)] 
test_peer_ping: Don't leak one method call per invocation

Previously, we allocated m both during initialization, and after
deciding not to skip this test.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103600

8 years ago_dbus_server_new_for_tcp_socket: Simplify error unwinding
Simon McVittie [Tue, 21 Nov 2017 15:43:55 +0000 (15:43 +0000)] 
_dbus_server_new_for_tcp_socket: Simplify error unwinding

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

8 years ago_dbus_server_new_for_socket: Simplify error unwinding
Simon McVittie [Tue, 21 Nov 2017 15:16:05 +0000 (15:16 +0000)] 
_dbus_server_new_for_socket: Simplify error unwinding

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

8 years agoAdd a targeted test for OOM during _dbus_server_new_for_tcp_socket()
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

8 years agodbus-nonce: Don't crash on encountering OOM
Simon McVittie [Tue, 21 Nov 2017 14:46:06 +0000 (14:46 +0000)] 
dbus-nonce: Don't crash on encountering OOM

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

8 years ago_dbus_listen_tcp_socket: Don't rely on dbus_realloc setting errno
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

8 years ago_dbus_server_new_for_tcp_socket: Don't pile up errors on OOM
Simon McVittie [Tue, 21 Nov 2017 14:39:58 +0000 (14:39 +0000)] 
_dbus_server_new_for_tcp_socket: Don't pile up errors on OOM

If _dbus_noncefile_create() has failed and set error, it is incorrect
for us to set it again.

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

8 years ago_dbus_server_new_for_launchd: Don't leak fd on failure
Simon McVittie [Tue, 21 Nov 2017 14:39:11 +0000 (14:39 +0000)] 
_dbus_server_new_for_launchd: Don't leak fd on failure

If _dbus_server_new_for_socket() fails, it is the caller's
responsibility to close the fds. All other callers did this.

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

8 years ago_dbus_server_new_for_socket: Properly disconnect during error unwinding
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

8 years ago_dbus_server_new_for_socket: Invalidate watches during error unwinding
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

8 years ago_dbus_transport_new_for_socket: Simplify with _DBUS_STRING_INIT_INVALID
Simon McVittie [Tue, 21 Nov 2017 12:40:07 +0000 (12:40 +0000)] 
_dbus_transport_new_for_socket: Simplify with _DBUS_STRING_INIT_INVALID

This is one of the few places that has test coverage for all the OOM
code paths. It was also one of the worst (most complicated)
error-unwinding locations, with labels failed_0 up to failed_4.

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

8 years agoDBusString: Add _DBUS_STRING_INIT_INVALID and allow "freeing" it
Simon McVittie [Mon, 3 Jul 2017 16:59:10 +0000 (17:59 +0100)] 
DBusString: Add _DBUS_STRING_INIT_INVALID and allow "freeing" it

This means we can finally use patterns like this:

      DBusString buffer = _DBUS_STRING_INIT_INVALID;
      dbus_bool_t ret = FALSE;

      ... some long setup ...

      if (!_dbus_string_init (&buffer))
        goto out;

      ... some long operation ...

      ret = TRUE;

    out:
      ... free things ...
      _dbus_string_free (&buffer);
      ... free more things ...
      return ret;

without having to have a separate boolean to track whether buffer has
been initialized.

One observable difference is that if s is a "const" (borrowed pointer)
string, _dbus_string_free (&s) now sets it to be invalid. Previously,
it would have kept its (borrowed pointer) contents, which seems like
a violation of least-astonishment.

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

8 years agoDBusString: Reverse the sense of ->invalid
Simon McVittie [Mon, 3 Jul 2017 16:31:37 +0000 (17:31 +0100)] 
DBusString: Reverse the sense of ->invalid

It's easier to implement a stack-allocated string that is valid to
free (but for no other purpose) if we consider all-bits-zero to be
invalid.

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

8 years agoRemove references to test/data/incomplete-messages too
Simon McVittie [Wed, 15 Nov 2017 15:28:11 +0000 (15:28 +0000)] 
Remove references to test/data/incomplete-messages too

Signed-off-by: Simon McVittie <smcv@collabora.com>
8 years agotests: Remove leftover references to valid-messages directory
Simon McVittie [Wed, 15 Nov 2017 15:04:44 +0000 (15:04 +0000)] 
tests: Remove leftover references to valid-messages directory

Now that the directory doesn't exist in git, the embedded tests fail
in a clean git checkout.

Signed-off-by: Simon McVittie <smcv@collabora.com>
8 years agoUpdate NEWS for 1.13.x test changes
Simon McVittie [Wed, 15 Nov 2017 14:01:16 +0000 (14:01 +0000)] 
Update NEWS for 1.13.x test changes

Signed-off-by: Simon McVittie <smcv@collabora.com>
8 years agoRemove test data in the "message builder" domain-specific language
Simon McVittie [Wed, 15 Nov 2017 12:28:21 +0000 (12:28 +0000)] 
Remove test data in the "message builder" domain-specific language

These tests were disabled by commit 9c3d566, which rewrote the D-Bus
type system to be fully recursive, back in 2005. The message builder
was subsequently removed by commit 9d21554, also in early 2005.

It will probably take significant work to turn these files into
test-cases that use the current D-Bus type system and so can be run
this decade. Until that work is done, let's not ship them: we can
always fetch them from git history if we want them.

The single .message-raw file can still be read and has been retained,
although it hasn't actually tested the intended failure mode since
2005 due to changes to the D-Bus specification (it is a wire-protocol
version 0 message, and the recursive type system introduced in commit
9c3d566 changed the wire-protocol version to 1).

Reviewed-by: Philip Withnall <withnall@endlessm.com>
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103758

8 years ago_dbus_test_diag: Flush stdout after each diagnostic
Simon McVittie [Wed, 15 Nov 2017 12:14:16 +0000 (12:14 +0000)] 
_dbus_test_diag: Flush stdout after each diagnostic

If we crash, we'll want to know what the most recent diagnostic was.

Reviewed-by: Philip Withnall <withnall@endlessm.com>
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103601

8 years agodispatch test: Output finer-grained TAP
Simon McVittie [Tue, 14 Nov 2017 19:07:22 +0000 (19:07 +0000)] 
dispatch test: Output finer-grained TAP

This lets us see which bits are painfully slow. (Spoilers:
check_existent_service_no_auto_start.)

Reviewed-by: Philip Withnall <withnall@endlessm.com>
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103601

8 years agotest-bus*: Output TAP directly
Simon McVittie [Tue, 14 Nov 2017 17:53:31 +0000 (17:53 +0000)] 
test-bus*: Output TAP directly

Reviewed-by: Philip Withnall <withnall@endlessm.com>
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103601

8 years agotest-dbus: Produce machine-readable TAP output
Simon McVittie [Tue, 14 Nov 2017 17:20:40 +0000 (17:20 +0000)] 
test-dbus: Produce machine-readable TAP output

See http://testanything.org/ for more information on TAP.

Reviewed-by: Philip Withnall <withnall@endlessm.com>
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103601

8 years agobus: Silence the output of the test services when doing OOM testing
Simon McVittie [Tue, 14 Nov 2017 16:41:23 +0000 (16:41 +0000)] 
bus: Silence the output of the test services when doing OOM testing

The echo service frequently fails to connect to the bus when we are
testing OOM code paths, again causing a lot of noise in the log.

Reviewed-by: Philip Withnall <withnall@endlessm.com>
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103601

8 years agobus: Silence most log messages when testing OOM handling
Simon McVittie [Tue, 14 Nov 2017 16:06:05 +0000 (16:06 +0000)] 
bus: Silence most log messages when testing OOM handling

In parts of the OOM testing, our logging produces multiple megabytes
of output. Let's not do that.

Reviewed-by: Philip Withnall <withnall@endlessm.com>
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103601

8 years agoUnix: Flush stdout and stderr streams before forking
Simon McVittie [Tue, 14 Nov 2017 15:30:03 +0000 (15:30 +0000)] 
Unix: Flush stdout and stderr streams before forking

stdout and stderr are close-on-exec and buffered, so we can't rely on
their buffers being empty. If we continue to execute application code
after forking (as opposed to immediately exec()ing), then the child
process might later flush the libc stdio buffers, resulting in
output that is printed by the parent also being printed by the child.

In particular, test-bus.log sometimes grows extremely large for
this reason, because this test repeatedly attempts to carry out
legacy activation.

Reviewed-by: Philip Withnall <withnall@endlessm.com>
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103601

8 years agoPrefer to use _dbus_test_fatal() for assertion failures in tests
Simon McVittie [Tue, 14 Nov 2017 14:17:53 +0000 (14:17 +0000)] 
Prefer to use _dbus_test_fatal() for assertion failures in tests

This is a little more self-documenting - it justifies why it's
acceptable to fail hard on out-of-memory conditions. _dbus_test_fatal()
isn't compiled unless we are compiling embedded tests, so compiling
with embedded tests disabled provides reasonable confidence that we
aren't using _dbus_test_fatal() inappropriately.

Reviewed-by: Philip Withnall <withnall@endlessm.com>
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103601

8 years agoUse _dbus_test_fatal to include more detail in test failure diagnostics
Simon McVittie [Tue, 14 Nov 2017 14:13:45 +0000 (14:13 +0000)] 
Use _dbus_test_fatal to include more detail in test failure diagnostics

Unlike _dbus_assert_not_reached(), this new function takes a printf-style
format string, so we don't need to use a _dbus_warn() to explain why
the failure occurred (unless the failure message is multi-line).

Reviewed-by: Philip Withnall <withnall@endlessm.com>
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103601

8 years agoEmbedded tests: Emit TAP diagnostics instead of printf
Simon McVittie [Tue, 14 Nov 2017 14:09:59 +0000 (14:09 +0000)] 
Embedded tests: Emit TAP diagnostics instead of printf

Reviewed-by: Philip Withnall <withnall@endlessm.com>
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103601

8 years agoAdd utility functions to emit TAP diagnostics and fatal errors
Simon McVittie [Tue, 14 Nov 2017 14:01:56 +0000 (14:01 +0000)] 
Add utility functions to emit TAP diagnostics and fatal errors

Reviewed-by: Philip Withnall <withnall@endlessm.com>
[smcv: Add an explanatory comment as suggested]
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103601

8 years agoDo not export dbus_internal_do_not_use_run_tests if unused
Simon McVittie [Tue, 14 Nov 2017 15:17:32 +0000 (15:17 +0000)] 
Do not export dbus_internal_do_not_use_run_tests if unused

Reviewed-by: Philip Withnall <withnall@endlessm.com>
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103601

8 years agoWindows autolaunch: Turn stdout spam into stderr spam
Simon McVittie [Tue, 14 Nov 2017 14:11:25 +0000 (14:11 +0000)] 
Windows autolaunch: Turn stdout spam into stderr spam

This is still not how warnings and diagnostics should be done
(the advice should probably be included in the DBusError) but at least
this way it won't interfere with machine-readable output on stdout.
See also https://bugs.freedesktop.org/show_bug.cgi?id=103756

Reviewed-by: Philip Withnall <withnall@endlessm.com>
[smcv: Added a reference to #103756]
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103601

8 years agoRemove commented-out printf debugging
Simon McVittie [Tue, 14 Nov 2017 13:59:12 +0000 (13:59 +0000)] 
Remove commented-out printf debugging

Printing to stdout would interfere with generating TAP syntax.

Reviewed-by: Philip Withnall <withnall@endlessm.com>
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103601

8 years agoUpdate NEWS for 1.13.x
Simon McVittie [Tue, 14 Nov 2017 12:25:50 +0000 (12:25 +0000)] 
Update NEWS for 1.13.x

Signed-off-by: Simon McVittie <smcv@collabora.com>
8 years agoAdd a missing space in logging output
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

8 years agoMerge branch 'dbus-1.12'
Simon McVittie [Mon, 13 Nov 2017 17:12:48 +0000 (17:12 +0000)] 
Merge branch 'dbus-1.12'

8 years agoStart 1.12.4
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>
8 years ago1.12.2 dbus-1.12.2
Simon McVittie [Mon, 13 Nov 2017 13:35:55 +0000 (13:35 +0000)] 
1.12.2

Signed-off-by: Simon McVittie <smcv@collabora.com>
8 years agoUpdate NEWS for 1.12.x
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>
8 years agoUpdate NEWS for 1.13.x
Simon McVittie [Fri, 10 Nov 2017 16:24:47 +0000 (16:24 +0000)] 
Update NEWS for 1.13.x

Signed-off-by: Simon McVittie <smcv@collabora.com>
8 years agobus_connections_setup_connection: If we can't set it up, log why
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)

8 years agobus_connections_setup_connection: If we can't set it up, log why
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

8 years agoUpdate NEWS for 1.13.x
Simon McVittie [Fri, 10 Nov 2017 16:20:25 +0000 (16:20 +0000)] 
Update NEWS for 1.13.x

Signed-off-by: Simon McVittie <smcv@collabora.com>
8 years agoUpdate NEWS for 1.12.x
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>
8 years agotravis-ci: Enable/disable more features in various builds
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)

8 years agoDBusNonceFile: Don't rely on caller preallocating the object
Simon McVittie [Mon, 6 Nov 2017 19:27:48 +0000 (19:27 +0000)] 
DBusNonceFile: Don't rely on caller preallocating the object

If we combine the dbus_new0, populating the DBusString members and the
actual creation of the file, RAII-style, then we never need to worry
about a partially-initialized or uninitialized DBusNonceFile becoming
visible to a caller.

Similarly, if we combine deletion of the file, freeing of the
DBusString members, freeing the structure and clearing the pointer to
the structure, then we can never be in an inconsistent situation,
except during the actual implementation of _dbus_noncefile_delete().

Note that there are two implementations each of
_dbus_noncefile_create() and _dbus_noncefile_delete(). This is because
on Unix we must use a subdirectory of _dbus_get_tmpdir() (the nonce
filename is not created atomically, so that would not be safe), while
on Windows we use the directory directly (the Windows temp directory
is private to a user, so this is OK).

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

8 years ago_dbus_accept_with_noncefile: Don't leak nonce
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)

8 years agodo_noncefile_create: Avoid freeing uninitialized memory on error
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)

8 years agodo_check_nonce: Don't free uninitialized memory on OOM
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)

8 years ago_dbus_accept_with_noncefile: Don't leak nonce
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

8 years agodo_noncefile_create: Avoid freeing uninitialized memory on error
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

8 years agodo_check_nonce: Don't free uninitialized memory on OOM
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

8 years agotests: Assert that _DBUS_STRING_DEFINE_STATIC looks as expected
Simon McVittie [Mon, 6 Nov 2017 18:44:43 +0000 (18:44 +0000)] 
tests: Assert that _DBUS_STRING_DEFINE_STATIC looks as expected

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

8 years ago_DBUS_STRING_DEFINE_STATIC: Don't include zero termination in length
Simon McVittie [Mon, 6 Nov 2017 18:41:40 +0000 (18:41 +0000)] 
_DBUS_STRING_DEFINE_STATIC: Don't include zero termination in length

_dbus_string_init_const() doesn't include the trailing '\0' in
the DBusRealString->len, so this surely shouldn't either.
In practice none of the users of _DBUS_STRING_DEFINE_STATIC care one
way or the other, but it seems better to be consistent.

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

8 years agoUpdate NEWS
Simon McVittie [Mon, 6 Nov 2017 17:21:31 +0000 (17:21 +0000)] 
Update NEWS

Signed-off-by: Simon McVittie <smcv@collabora.com>
8 years agotest-utils-glib: Add function to connect with GDBus as another uid
Simon McVittie [Thu, 6 Jul 2017 14:58:48 +0000 (15:58 +0100)] 
test-utils-glib: Add function to connect with GDBus as another uid

This will be used in a test for connecting to container servers
as the wrong uid.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354

8 years agotest-utils-glib: Factor out functions for switching uid
Simon McVittie [Thu, 6 Jul 2017 14:57:18 +0000 (15:57 +0100)] 
test-utils-glib: Factor out functions for switching uid

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354

8 years agotest-utils-glib: Add failable functions to connect to a bus
Simon McVittie [Thu, 6 Jul 2017 14:57:18 +0000 (15:57 +0100)] 
test-utils-glib: Add failable functions to connect to a bus

Instead of calling g_test_skip() internally, raise a distinctive error
and let the caller handle it.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354

8 years ago_dbus_asv_add_object_path: Add
Simon McVittie [Fri, 9 Jun 2017 14:57:30 +0000 (15:57 +0100)] 
_dbus_asv_add_object_path: Add

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354

8 years agoAdd a simplified backport of g_steal_pointer()
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

8 years agocmake: Match AC_DEFINE more precisely, respecting [] quoting
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

8 years agotravis-ci: Enable/disable more features in various builds
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