Perl Net::DBus: Setting properties with "complex" types fails

Nicolas Calderon nicolas.calderon.asselin at gmail.com
Mon Feb 17 22:34:17 PST 2014


Hi,

I found an issue with Net:DBus while trying to use it with one of my DBus
services. My interface exports a property of type a(oo).

Trying to get and then set the property leads to an error:

use Net::DBus;
my $bus = Net::DBus->session;
my $service = $bus->get_service("com.example.endpoint");
my $object = $service->get_object("/object", "com.example.ComplexProp");
my $prop = $object->complex_prop();
$object->complex_prop($prop);

Result: org.freedesktop.DBus.Error.InvalidSignature: property expects a
different type

Using dbus-monitor, I noticed the method signature for Set was wrong, as
props's type gets incorrectly guessed as an array of array of objects.
Also, looking at Net:DBus:Intrspector::encode, I notice that introspection
information is only fetched for the method signature. The proposed patch
fetches property type information on calls to
org.freedesktop.DBus.Properties::Set() and appends them to the variant
type. I tested it for my case and it worked, and didn't seem to introduce
regressions for simple properties (string). I also feel like this could be
useful for other compound types.

--
Nicolas Calderon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20140218/ffa73c1b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fixed-type-encoding-errors-when-setting-properties.patch
Type: text/x-patch
Size: 3864 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20140218/ffa73c1b/attachment.bin>


More information about the dbus mailing list