manager: check for object type in do_set_property_check()

This commit is contained in:
Thomas Haller 2015-08-20 14:20:16 +02:00
parent c79d6dfc1b
commit 52ed6a8e5c

View file

@ -4449,6 +4449,14 @@ do_set_property_check (gpointer user_data)
(error_message = "Object doesn't exist."));
goto out;
}
/* If we lookup the object, we expect the object to be of a certain type.
* Only NMDevice type have settable properties. */
if (!NM_IS_DEVICE (pfd->object)) {
reply = g_dbus_message_new_method_error (pfd->message,
"org.freedesktop.DBus.Error.InvalidArgs",
(error_message = "Object is of unexpected type."));
goto out;
}
g_object_ref (pfd->object);
}