logind: fix PropertiesChanged parser
authorDavid Herrmann <dh.herrmann@gmail.com>
Tue, 30 Dec 2014 13:33:23 +0000 (14:33 +0100)
committerBryce Harrington <bryce@osg.samsung.com>
Sat, 17 Jan 2015 02:34:10 +0000 (18:34 -0800)
commit5dbc79ffaed3e2646aee1a9426072e0f65ec14e3
tree76fff35d48bc1cd2bc9fbef31f841a88a53b3a81
parent2ecb84a20dab56b9479186e5a32ae7aa31565756
logind: fix PropertiesChanged parser

The current parser directly reads a BOOLEAN on the PropertiesChanged
signal for 'Active' properties. However, all property-values are packed in
a VARIANT, otherwise, we wouldn't know the type. Fix the parser to recurse
into the variant before reading the boolean.

To avoid such bugs in the future, we extract the 'Active' parser into a
helper function parse_active(), which is then shared between the
PropertiesChanged and Get handlers.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Tested-by: nerdopolis <bluescreen_avenger@verizon.net>
src/logind-util.c