diff -Nru flatpak-xdg-utils-1.0.2/debian/changelog flatpak-xdg-utils-1.0.4/debian/changelog --- flatpak-xdg-utils-1.0.2/debian/changelog 2020-08-16 16:13:55.000000000 +0000 +++ flatpak-xdg-utils-1.0.4/debian/changelog 2020-10-09 07:52:05.000000000 +0000 @@ -1,3 +1,17 @@ +flatpak-xdg-utils (1.0.4-1) unstable; urgency=medium + + * New upstream release + - In flatpak-spawn, close fds after they have been forwarded + + -- Simon McVittie Fri, 09 Oct 2020 08:52:05 +0100 + +flatpak-xdg-utils (1.0.3-1) unstable; urgency=medium + + * New upstream release + - Better compatibility with xdg-desktop-portal 1.8.0 + + -- Simon McVittie Mon, 05 Oct 2020 13:11:14 +0100 + flatpak-xdg-utils (1.0.2-1) unstable; urgency=medium * New upstream release diff -Nru flatpak-xdg-utils-1.0.2/debian/rules flatpak-xdg-utils-1.0.4/debian/rules --- flatpak-xdg-utils-1.0.2/debian/rules 2020-08-16 16:13:55.000000000 +0000 +++ flatpak-xdg-utils-1.0.4/debian/rules 2020-10-09 07:52:05.000000000 +0000 @@ -1,7 +1,7 @@ #!/usr/bin/make -f export DEB_BUILD_MAINT_OPTIONS = hardening=+all -export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed -Wl,-O1 +export DEB_LDFLAGS_MAINT_APPEND = -Wl,-O1 export LC_ALL=C.UTF-8 include /usr/share/dpkg/default.mk diff -Nru flatpak-xdg-utils-1.0.2/meson.build flatpak-xdg-utils-1.0.4/meson.build --- flatpak-xdg-utils-1.0.2/meson.build 2020-08-12 13:07:06.864546800 +0000 +++ flatpak-xdg-utils-1.0.4/meson.build 2020-10-08 08:11:28.995254300 +0000 @@ -1,6 +1,6 @@ project( 'flatpak-xdg-utils', 'c', - version: '1.0.2', + version: '1.0.4', license: 'LGPL-2.1+', default_options: [ 'buildtype=debugoptimized', diff -Nru flatpak-xdg-utils-1.0.2/NEWS flatpak-xdg-utils-1.0.4/NEWS --- flatpak-xdg-utils-1.0.2/NEWS 2020-08-12 13:07:06.864546800 +0000 +++ flatpak-xdg-utils-1.0.4/NEWS 2020-10-08 08:11:28.994254000 +0000 @@ -1,3 +1,13 @@ +Changes in 1.0.4 +================ + +Close intermediate copies of forwarded fds in flatpak-spawn. + +Changes in 1.0.3 +================ + +Better compatibility with xdg-desktop-portals 1.8.0. + Changes in 1.0.2 ================ diff -Nru flatpak-xdg-utils-1.0.2/src/flatpak-spawn.c flatpak-xdg-utils-1.0.4/src/flatpak-spawn.c --- flatpak-xdg-utils-1.0.2/src/flatpak-spawn.c 2020-08-12 13:07:06.864546800 +0000 +++ flatpak-xdg-utils-1.0.4/src/flatpak-spawn.c 2020-10-08 08:11:28.997254100 +0000 @@ -520,6 +520,8 @@ g_printerr ("Failed to add fd to list for %s: %s\n", paths[i], error->message); return FALSE; } + /* The GUnixFdList keeps a duplicate, so we should release the original */ + close (path_fd); g_variant_builder_add (builder, "h", handle); } @@ -711,6 +713,8 @@ g_printerr ("Can't append fd: %s\n", error->message); return 1; } + /* The GUnixFdList keeps a duplicate, so we should release the original */ + close (fd); g_variant_builder_add (fd_builder, "{uh}", fd, handle); } @@ -933,6 +937,10 @@ g_debug ("child_pid: %d", child_pid); + /* Release our reference to the fds, so that only the copy we sent over + * D-Bus remains open */ + g_clear_object (&fd_list); + loop = g_main_loop_new (NULL, FALSE); g_signal_connect (session_bus, "closed", G_CALLBACK (session_bus_closed_cb), loop); diff -Nru flatpak-xdg-utils-1.0.2/src/xdg-open.c flatpak-xdg-utils-1.0.4/src/xdg-open.c --- flatpak-xdg-utils-1.0.2/src/xdg-open.c 2020-08-12 13:07:06.865547000 +0000 +++ flatpak-xdg-utils-1.0.4/src/xdg-open.c 2020-10-08 08:11:28.997254100 +0000 @@ -106,7 +106,7 @@ GUnixFDList *fd_list; path = g_file_get_path (file); - fd = open (path, O_PATH | O_CLOEXEC); + fd = open (path, O_RDONLY | O_CLOEXEC); if (fd == -1) { g_printerr ("Failed to open '%s': %s", path, g_strerror (errno));