GNOME Bugzilla – Bug 688907
DBusProxy.call_with_unix_fd_list is unusable
Last modified: 2018-05-22 14:37:36 UTC
DBusProxy.call_with_unix_fd_list (and I assume its sister function DBusConnection.call_with_unix_fd_list?) do not generate code that works. Specifically, I see it generate code like: <GVariant*> = g_dbus_proxy_call_with_unix_fd_list_finish (<GDBusProxy*>, <GAsyncResult*>, <GUnixFDList**>, <GError**>); But it *should* be generating code like: <GVariant*> = g_dbus_proxy_call_with_unix_fd_list_finish (<GDBusProxy*>, <GUnixFDList**>, <GAsyncResult*>, <GError**>); (That is, the result and fd list arguments should be swapped.) This obviously results in a build warning and runtime failure.
Is there any reason why you are using this method (besides the fact that is broken)? You can use fd list by calling dbus methods with unix streams and vala will automatically create fd lists for you. See tests as an example: http://git.gnome.org/browse/vala/tree/tests/dbus/filedescriptor.test
I could do that. But I suspect I'd run into bug https://bugzilla.gnome.org/show_bug.cgi?id=688838, this time on the client side. The specific code I was working with had a return format like "ah". So I suppose Vala wouldn't pick up on it? It certainly wouldn't be able to if the format was "av" with handles inside the "v". So this function (call_with_unix_fd_list) is still useful.
I believe the method can be fixed by using the CCode pos on the parameter to come before the GAsyncResult, though I'm not very sure of this. As for "ah", we may want Vala to handle that case. For "av", it may be done on the client side as well, to pack an fd in a variant like any other type... no idea on the server side.
Also occurs for DBusConnection.call_with_unix_fd_list (see bug 710583)
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/340.