flatpak / xdg-desktop-portal

Desktop integration portal
https://flatpak.github.io/xdg-desktop-portal/
GNU Lesser General Public License v2.1
547 stars 183 forks source link

File chooser/Filechooser portal can't handle some symlinks if in flatpak #960

Open RushingAlien opened 1 year ago

RushingAlien commented 1 year ago

Hello! It appears that if you expose the destination of a symlink to the flatpak with --filesystem override, file chooser portal will fail to grab the file if chosen from the symlink. Meanwhile it works if the destination directory of the symlink is not exposed with --filesystem. https://github.com/flatpak/flatpak/issues/5227 related

in short what works :

RushingAlien commented 1 year ago

Looks like this also affects the document portal

Wonder if the bug is rooted in d-bus or fuse

Edit : Also affects the file transfer portal

cincodenada commented 9 months ago

Ran into this today, I think - if I open a file from a symlinked path, it fails to open. To be explicit, a repro:

  1. Pick a folder to test (e.g. ~/Downloads)
  2. Create a symlink to that folder (ln -s ~/Downloads ~/symlink-example)
  3. Use the file chooser dialog to navigate to ~/symlink-example and open a file

In my test (Gear Lever, specifically) this logs "file or directory doesn't exist" error and fails to open the file. Is it possible for applications to work around this (by e.g. canonicalizing the path before trying to open it?)

RushingAlien commented 8 months ago

After some testing, looks like xdg-desktop-portal-kde is not affected, only xdg-desktop-portal-{gtk,gnome}

RushingAlien commented 8 months ago

https://github.com/flatpak/xdg-desktop-portal-gtk/issues/437
https://gitlab.gnome.org/GNOME/xdg-desktop-portal-gnome/-/issues/92

Made seperate reports just in case with attachements if it helps

RushingAlien commented 8 months ago

https://gitlab.gnome.org/GNOME/glib/-/issues/3104

Another bug related to symlinks, makes me suspect the root issue is in gllib?

Since issue occurs on both gtk and gnome portal, both uses glib while kde portal, i assume does not use glib