Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to upload files from home directory #46

Closed
lentzi90 opened this issue Jul 5, 2019 · 19 comments
Closed

Unable to upload files from home directory #46

lentzi90 opened this issue Jul 5, 2019 · 19 comments
Labels

Comments

@lentzi90
Copy link

lentzi90 commented Jul 5, 2019

The current sandbox permissions does not include home, which means that it is impossible to upload files from say ~/workspace. Only specific folders like Documents or Downloads are included in the permissions right now.

Expected: That I can upload a file from ~/workspace.

Actual: Uploading fails with a message about the file type not being supported. If I move the file to ~/Documents and retry, it works without problem.
This is for drag and drop. If you instead try to use the file chooser, you won't be able to see or open all folders, only those currently covered in the filesystem sandbox permissions.

Suggested change:
I suggest that we replace

"--filesystem=xdg-documents:ro",
"--filesystem=xdg-pictures:ro",
"--filesystem=xdg-music:ro",
"--filesystem=xdg-videos:ro",

with

"--filesystem=home:ro",

or simply add it to the current list.

@FakeShemp
Copy link
Contributor

FakeShemp commented Jul 9, 2019

This is the intended behavior unfortunately. Having home access is a bit more dangerous than specific portals to the XDG directories and probably not necessary for everyone.

If you absolutely need ~/ access, I would say it's recommended for advanced users to just run flatpak run --filesystem=home:ro com.slack.Slack instead. Or you can make it permanent on your system by using sudo flatpak override --filesystem=home:ro com.slack.Slack. You probably know what you're doing in that case :)

@FakeShemp
Copy link
Contributor

However, I've added a notification in the readme on github for anyone who runs into the same issue.

#47

@lentzi90
Copy link
Author

lentzi90 commented Jul 9, 2019

I see, thanks for the info

@Gadgetoid
Copy link

I feel it's worth noting that this breaks what I would expect to be normal drag-and-drop file sharing behaviour in completely confusing and unexpected ways and presents the paradox of requiring advanced knowledge to enable a basic everyday feature.

Case in point:

  1. I have a folder in my home directory from which I want to share a file.
  2. I drag and drop that file into Slack
  3. Instead of getting a "Slack does not have permission to access this directory" I see "File unsupported", "Sorry, test.png is a type of file not supported by Slack", "Try uploading a .zip version of this file instead.":
    image
  4. I zip the file... GOTO 3
  5. The penny drops that this will be one of those problems, and since I am an "advanced" user I hit Google, find this post, run the magic incantation and... it works.

I don't know if I expect you to do anything about it, but hopefully at least this comment will help lead anyone encountering this same baffling mystery to the same fix.

@carlocastoldi
Copy link

Can we either keep this issue open or put the README back up?
This is a frequent problem.

@FedericoCapaldo
Copy link

FedericoCapaldo commented Jul 21, 2021

I have the same issue as @Gadgetoid

@kleinschmidt
Copy link

I was confused by this for so long until I remembered that I installed slack with flatpak.....

@Hoeze
Copy link

Hoeze commented Dec 6, 2021

Why can't we just have a "ask user for permission" dialog in that case?

@FakeShemp
Copy link
Contributor

@Hoeze because we are not the developers of slack.

@Hoeze
Copy link

Hoeze commented Dec 6, 2021

@FakeShemp I mean as I understand this is a permission issue with Flatpak, right?
Slack tries to access ~/ but fails because the Flatpak sandbox denies the request.
Why not let Flatpak open a dialog: "Do you want to allow com.slack.Slack to access ~/..."?

Please excuse me if that's a dumb question, I'm not familiar with Flatpak from a dev's perspective :)

@FakeShemp
Copy link
Contributor

It's not a dumb question, but Slack has no concept of ~/ and cannot do anything with it. It doesn't even exist inside the sandbox.

Issues with how flatpak handles things will have to go to the flatpak repo.

@Benzer1406
Copy link

I installed Slack from the snap store with sudo snap install slack and I could drag'n'drop from any directory.

@nerijus
Copy link

nerijus commented Dec 2, 2022

This github repo is about flatpak, not snap.

@dreua
Copy link

dreua commented Mar 7, 2023

@FakeShemp could you put the readme back up or at least pin this issue? Ideally that would be noted on the flathub page as well. Regular users will never understand this on their own, even me, maintainer of a small flatpak, forgot about this and wasted some time to figure it out.

Is there a way to report this to Slack? They should at least fix their error message imo. Using File Portals would be the ideal solution.

@jbarlow83
Copy link

Since running Slack from the command line is not a good solution, you can use Flatseal to grant it these permissions.
image

After changing permissions, you will have quit Slack and ensure it's been quick from the notification area/system tray/whatever as well, for this to take effect.

It really would be better to have an explanation on the Flathub page or disable sandboxing.

@dreua
Copy link

dreua commented Jun 23, 2023

The best solution would be using file portals but until then at least change the ridiculous hint to zip it.

@merschformann
Copy link

Thank you for the pointers @jbarlow83 ! Worked like a charm for me. 🤗

gtkatakura added a commit to gtkatakura/conventions-tips-tricks that referenced this issue Sep 16, 2023
@sztomi
Copy link

sztomi commented Jan 25, 2024

@jbarlow83 it might be better for most people to only enable access to the home folder or perhaps stick to the already accessible folders when uploading. Granting full file system access is not necessary unless you want to upload system files.

@dreua
Copy link

dreua commented Jan 25, 2024

@sztomi I don't think this is wort reasoning about, in the average home directory there will be enough sensitive data that full file system access doesn't really make a difference IMO. Furthermore the Unix access restrictions will still apply and the flatpak hides or overlays some stuff even with full access. Users may run into problems again if they try to share files from USB drives or network mounts.

In my experience from PDF Arranger, setting filesystem=host is the only user friendly option if you can't use file portals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests