[snap] File dialogs show snap's home directory instead of user's

Bug #1798450 reported by Samuel Kaiser
72
This bug affects 16 people
Affects Status Importance Assigned to Milestone
chromium-browser (Ubuntu)
Fix Released
Medium
Unassigned
libreoffice (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

How to reproduce:

- Find a web page that has a file chooser, e.g. https://developer.mozilla.org/docs/Web/HTML/Element/input/file
- Click the "Choose File" button
- Click "Home" if you didn't start here
- See that Chromium uses `/home/$USER/snap/chromium/500` as the home folder

Expected behavior:

The file picker should use the user's home folder, not the snap's, because everything else would be confusing for end users.

Versions:

snap 2.35.4+18.10
snapd 2.35.4+18.10
series 16
ubuntu 18.10
kernel 4.18.11-surface-linux-surface

Chromium 70.0.3538.67 snap

Tags: snap
Revision history for this message
Samuel Kaiser (samuel-kaiser01) wrote :
Revision history for this message
Olivier Tilloy (osomon) wrote :

This also affects the libreoffice snap, and more generally all snaps using the desktop helpers (and it should be fixed there).

tags: added: snap
Changed in chromium-browser (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Changed in libreoffice (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Olivier Tilloy (osomon) wrote :

And I filed https://github.com/ubuntu/snapcraft-desktop-helpers/issues/167 to track the issue where it belongs.

affects: df-libreoffice → snapcraft
Changed in snapcraft:
status: Unknown → New
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

This is a runtime thing, not build time

affects: snapcraft → snapd
Revision history for this message
Paweł Stołowski (stolowski) wrote :

I don't think we want (or can) change HOME in snapd (due to undesired consequences and breaking many snaps), it works as designed, i.e. gives snaps dedicated areas where they can freely write data to, including hidden files; access to real user $HOME may not even be allowed unless home interface is connected. I see an alternative approach that only affects file picker is already discussed in the snapcraft-desktop-helpers issue above, for now marking it invalid for snapd.

no longer affects: snapd
Revision history for this message
Fritz Hudnut (este-el-paz) wrote :

Just adding that this issue has recently affected my work flow trying to upload a file to social media site in hopes of generating actual deniro . . . but could not get my own files to show up in what I was hoping would be my /home directory . . . but was instead a "snap" "virtual home" directory, so that it showed as "empty" . . . ?? very disruptive to routine uses . . . ??? I posted to wxl that if this was to prevent me from uploading his files to my social media then that "makes sense" . . . but to prevent me from simply uploading my own files n the system I'm booted and logged into . . . non-sensical . . .

Revision history for this message
Mateusz Stachowski (stachowski-mateusz) wrote :

So the issue is somewhat still present with newest snap system. I'm on 20.04 LTS.

The file picker in Chromium opens up in the snap directory but you can easily switch to your home directory.

I've uploaded this screenshot using Chromium snap.

Revision history for this message
Mateusz Stachowski (stachowski-mateusz) wrote :

Correction it seems that you can select an image from your Images folder but it doesn't actually get uploaded.

I'm trying again to upload the image. Maybe this time it will work.

Revision history for this message
Jani Jaakkola (jj-lousa) wrote :

I fixed this by installing chromium .deb package from Linux Mint repositories.

Revision history for this message
udippel (udippel) wrote :

I'm affected, too. While I understand the concept, as sysadmin I'm tearing out my hairs. I hate to have users on that system, where suddenly their 'Home' looks empty. Some - you know this type - get heated blood; thinking all their data would be gone. I do sympathize with them.
In a nutshell: It ought not happen. Better: *buntu ought better never have switched to a system not fully transparent to the average user; I think.?field.comment=I'm affected, too. While I understand the concept, as sysadmin I'm tearing out my hairs. I hate to have users on that system, where suddenly their 'Home' looks empty. Some - you know this type - get heated blood; thinking all their data would be gone. I do sympathize with them.
In a nutshell: It ought not happen. Better: *buntu ought better never have switched to a system not fully transparent to the average user; I think.

Revision history for this message
udippel (udippel) wrote :
Revision history for this message
Olivier Tilloy (osomon) wrote :

With browsers now using portals for file dialogs, this shouldn't be happening any longer. In fact, I cannot reproduce the problem here, neither in chromium nor in firefox.

udippel, does your system have xdg-desktop-portal (and the corresponding frontend package for your preferred desktop environment) installed?

description: updated
Revision history for this message
Tomislav (hefest) wrote :

It blows my mind that people would consider snaps remotely usable when e.g. clicking "Home" in Nautilus does not lead a user to his/her actual home directory (did anyone ever actually store a file in the sandboxed home directory???) or when the user cannot access e.g. /tmp (where I routinely put a lot of stuff I temporarily use from virtually any other software).

It is hard to imagine a clearer example of buggy behaviour than this thing with the Home directory, as far as I'm concerned. I understand the appeal of using snaps from Canonical's side, but as they are, snaps are nowhere near good enough for end users and are the main reason I am considering switching away from Ubuntu after probably 10 years of continuous use.

Revision history for this message
Nathan Teodosio (nteodosio) wrote :

As said in #12 this should be fixed by now.

If not, please state if this is observed in both programs (Libreoffice and Chromium) or only one of them or a different one, and also attach the output of

  apt list --installed | grep desktop-portal

Changed in chromium-browser (Ubuntu):
status: Confirmed → Incomplete
Changed in libreoffice (Ubuntu):
status: Confirmed → Incomplete
Changed in chromium-browser (Ubuntu):
status: Incomplete → Fix Released
Changed in libreoffice (Ubuntu):
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.