- } else {
- if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_STRING, attempted_property, DBUS_TYPE_INVALID))
- return INVALID_MESSAGE_ARGUMENTS;
-
- if (*interface) {
- if ((*iface_entry = pa_hashmap_get(obj_entry->interfaces, interface)) &&
- (*property_handler = pa_hashmap_get((*iface_entry)->property_handlers, *attempted_property))) {
- if (dbus_message_has_member(msg, "Get"))
- return (*property_handler)->get_cb ? FOUND_GET_PROPERTY : PROPERTY_ACCESS_DENIED;
- else if (dbus_message_has_member(msg, "Set"))
- return (*property_handler)->set_cb ? FOUND_SET_PROPERTY : PROPERTY_ACCESS_DENIED;
+
+ } else if (pa_streq(call_info->method, "Get")) {
+ call_info->expected_method_sig = "ss";
+ if (!pa_streq(call_info->method_sig, call_info->expected_method_sig))
+ return INVALID_METHOD_SIG;
+
+ pa_assert_se(dbus_message_get_args(call_info->message, NULL,
+ DBUS_TYPE_STRING, &call_info->property_interface,
+ DBUS_TYPE_STRING, &call_info->property,
+ DBUS_TYPE_INVALID));
+
+ if (*call_info->property_interface) {
+ if (!(call_info->iface_entry = pa_hashmap_get(call_info->obj_entry->interfaces, call_info->property_interface)))
+ return NO_SUCH_PROPERTY_INTERFACE;
+ else if ((call_info->property_handler =
+ pa_hashmap_get(call_info->iface_entry->property_handlers, call_info->property)))
+ return call_info->property_handler->get_cb ? FOUND_GET_PROPERTY : PROPERTY_ACCESS_DENIED;
+ else
+ return NO_SUCH_PROPERTY;
+
+ } else
+ return find_handler_by_property(call_info);
+
+ } else if (pa_streq(call_info->method, "Set")) {
+ DBusMessageIter msg_iter;
+
+ call_info->expected_method_sig = "ssv";
+ if (!pa_streq(call_info->method_sig, call_info->expected_method_sig))
+ return INVALID_METHOD_SIG;
+
+ pa_assert_se(dbus_message_iter_init(call_info->message, &msg_iter));
+
+ dbus_message_iter_get_basic(&msg_iter, &call_info->property_interface);
+ pa_assert_se(dbus_message_iter_next(&msg_iter));
+ dbus_message_iter_get_basic(&msg_iter, &call_info->property);
+ pa_assert_se(dbus_message_iter_next(&msg_iter));
+
+ dbus_message_iter_recurse(&msg_iter, &call_info->variant_iter);
+
+ call_info->property_sig = dbus_message_iter_get_signature(&call_info->variant_iter);
+
+ if (*call_info->property_interface) {
+ if (!(call_info->iface_entry = pa_hashmap_get(call_info->obj_entry->interfaces, call_info->property_interface)))
+ return NO_SUCH_PROPERTY_INTERFACE;
+
+ else if ((call_info->property_handler =
+ pa_hashmap_get(call_info->iface_entry->property_handlers, call_info->property))) {
+ call_info->expected_property_sig = call_info->property_handler->type;
+
+ if (pa_streq(call_info->property_sig, call_info->expected_property_sig))
+ return call_info->property_handler->set_cb ? FOUND_SET_PROPERTY : PROPERTY_ACCESS_DENIED;