From 23e1928a19c3e93296b83c10eeb19be288ccddee Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 10 Oct 2019 11:45:53 +0100 Subject: [PATCH] session-helper: Correctly annotate use of Unix FDs in D-Bus API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes compilation with GLib 2.63’s `gdbus-codegen`, which automatically enables Unix FD support for D-Bus APIs which use the `h` type, even if the `org.gtk.GDBus.C.UnixFD` annotation is missing. By adding the annotation, the generated header whether using `gdbus-codegen` 2.63 or < 2.63. This is a slight API break in GLib, but it’s questionable about whether flatpak should have always had the annotation. Signed-off-by: Philip Withnall --- data/org.freedesktop.Flatpak.xml | 1 + session-helper/flatpak-session-helper.c | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data/org.freedesktop.Flatpak.xml b/data/org.freedesktop.Flatpak.xml index 46cbad61..497a54a5 100644 --- a/data/org.freedesktop.Flatpak.xml +++ b/data/org.freedesktop.Flatpak.xml @@ -41,6 +41,7 @@ to do this. For instance for developer tools this lets you build flatpaks from inside a flatpak. --> + diff --git a/session-helper/flatpak-session-helper.c b/session-helper/flatpak-session-helper.c index 26e83fc6..a7465aa1 100644 --- a/session-helper/flatpak-session-helper.c +++ b/session-helper/flatpak-session-helper.c @@ -201,6 +201,7 @@ child_setup_func (gpointer user_data) static gboolean handle_host_command (FlatpakDevelopment *object, GDBusMethodInvocation *invocation, + GUnixFDList *fd_list, const gchar *arg_cwd_path, const gchar *const *arg_argv, GVariant *arg_fds, @@ -208,8 +209,6 @@ handle_host_command (FlatpakDevelopment *object, guint flags) { g_autoptr(GError) error = NULL; - GDBusMessage *message = g_dbus_method_invocation_get_message (invocation); - GUnixFDList *fd_list = g_dbus_message_get_unix_fd_list (message); ChildSetupData child_setup_data = { NULL }; GPid pid; PidData *pid_data; @@ -362,7 +361,7 @@ handle_host_command (FlatpakDevelopment *object, pid_data); - flatpak_development_complete_host_command (object, invocation, + flatpak_development_complete_host_command (object, invocation, NULL, pid_data->pid); return TRUE; }