chiark / gitweb /
sd-bus: fix encoding/decoding gvariant root container
authorDavid Herrmann <dh.herrmann@gmail.com>
Wed, 29 Jul 2015 13:58:25 +0000 (15:58 +0200)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 09:07:20 +0000 (10:07 +0100)
commit14204fc284cf8083286e621bb8fda4bca5bc410f
treee21e40fb493220a5fa8b92b567190c1e1d5a583d
parent9abef11725a3fc2bbeca06ec89ae17b3da0f6250
sd-bus: fix encoding/decoding gvariant root container

The gvariant root container contains a 'variant' at the end, which embeds
the whole message body. This variant *must* contain a structure so we are
compatible to dbus1. Otherwise, it could encode at most 1 type, instead
of a full signature.

Our gvariant message parser already parses the variant-content as a
structure, so we're mostly good. However, it does *not* include the
opening and closing parantheses, nor does it parse them.

This patch fixes the decoder to verify a message contains the
parantheses, and also make the encoder add those parantheses into the
marshaled message.
src/libelogind/sd-bus/bus-message.c