xdg-open within Flatpak does not honor default application settings of outside world

Alexander Larsson alexl at redhat.com
Wed Feb 6 07:23:03 UTC 2019


On Thu, Jan 31, 2019 at 9:51 AM Robin Lee <robinlee.sysu at gmail.com> wrote:
>
> Hi,
>
> I am on Fedora 28 GNOME with following packages:
> flatpak-libs-1.0.6-4.fc28.x86_64
> flatpak-builder-1.0.2-1.fc28.x86_64
> flatpak-1.0.6-4.fc28.x86_64
> xdg-desktop-portal-1.0.3-1.fc28.x86_64
> xdg-desktop-portal-gtk-1.0-1.fc28.x86_64
>
> When I run xdg-open within a Flatpak, it always ask me to choose a
> program. But in the outside
> world, a default application is already set for this kind of file.

Well, the idea of a portal is that it is safe to use for any sandboxed
application. Its not necessarily safe to allow an application to
silently open a file with some other application. For instance, you
might feed a pdf reader a pdf with an exploit that takes over the pdf
reader process while its starting, and thus break out of the sandbox.

The idea is that the portal is typically an interactive thing, so that
it can't be used in the background by malicious applications without
the user being aware of, and in control of, what it does outside the
sandbox.

Exactly what this interaction does is up to the implementation of the
portal backend. The way it goes is  app -> xdg-desktop-portal -> look
up the current desktop -> portal backend. The xdg-desktop-portal-gtk
backend is used on gnome and other gtk desktops, while plasma contains
one for kde.

I'm not totally up to speed on the gnome backend here, but i believe
its supposed to show you a list of all the apps that can handle the
type of file, with the default one being selected. And then there is
some kind of memory so that it stops asking for this type/app combo
after a while. If you have any specific behaviour complaints these
would be best filed against xdg-desktop-portal-gtk.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                Red Hat, Inc
       alexl at redhat.com         alexander.larsson at gmail.com


More information about the Flatpak mailing list