chiark / gitweb /
sd-bus: fix object tree to be deeper than 2 levels
authorDavid Herrmann <dh.herrmann@gmail.com>
Wed, 15 Jul 2015 12:35:15 +0000 (14:35 +0200)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 09:06:19 +0000 (10:06 +0100)
commit6fec834165df2fd841e1132d60d5228db0d1c494
treead325a71d933c7859a1ef0c83f994d7a918ee164
parentf6035a5ec8045bf007c7ebc5ee5306418644e7aa
sd-bus: fix object tree to be deeper than 2 levels

So right now our object-tree is limited to 2 levels at most
('/' and '/foo/...../bar'). We never link any intermediate levels, even
though that was clearly the plan. Fix the bus_node_allocate() helper to
actually link all intermediate nodes, too, not just the root node.

This fixes a simple inverse ptr-diff bug.

The downside of this fix is that we clearly never tested (nor used) the
object tree in any way. The only reason that the introspection works is
that our enumerators shortcut the object tree.

Lets see whether that code actually works..

Thanks to: Nathaniel McCallum <nathaniel@themccallums.org>
..for reporting this. See #524 for an actual example code.
src/libelogind/sd-bus/bus-objects.c