predr / typora-snap

https://snapcraft.io/typora
2 stars 3 forks source link

Unable to access /media due to lacking plug permission. #2

Closed SuibianP closed 3 years ago

SuibianP commented 3 years ago

First of all, thank you very much for the snap package.

Short summary

It might be necessary for the removable-media plug to be added to snapcraft.yaml.

Long story

I tried accessing a file on a mounted network drive in /media but was denied permission despite the subfolder being owned by my user and has 755 permission. Other snap applications such as vlc works just fine.

The message in journalctl is

AVC apparmor="DENIED" operation="open" profile="snap.typora.typora" name=HEXENCODEDDIRECTORYTOFILE pid=26654 comm="Typora" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000

It seems that the typora snap does not have the necessary removable permission to access /media mounts. I tried snap connect typora:removable-media but was alerted error: snap "typora" has no plug named "removable-media".

predr commented 3 years ago

Added and released Typora with removable-media. Refresh and connect plug:

snap refresh typora
snap connect typora:removable-media

I might later request to be auto-connected on install but I don't think it will be granted. For now you will have to connect manually.

NirmalManoj commented 3 years ago

@predr I think this permission should be enabled by default. I installed typora for the first time yesterday and was surprised to see that I couldn't read/write mounted partitions. (It had access to the Manjaro home partition though). I had to search quite a bit to find this issue and running the command snap connect typora:removable-media gave permissions to typora.

Please consider making permission available on install itself, or at least, have a FAQ on the snap description so that people can easily find the fix.

predr commented 3 years ago

making permission available on install itself

Requested auto-connect on snapcraft forum. Will see if they grant it.

on the snap description so that people can easily find the fix

I don't think it's needed because once you know how permissions work you don't need explanation in every snap description.

typora-permissions

NirmalManoj commented 3 years ago

I don't think it's needed because once you know how permissions work you don't need explanation in every snap description.

Only once you know how permissions work. I think there are many who don't know this. Why is not having this any better while this is the case?

NirmalManoj commented 3 years ago

@predr I use latest Manjaro (xfce). The permissions is not accessible like in the image. At least, I couldn't find it. I assume this is the default state of the package manager in Manjaro XFCE. So I had to use the commands you shared in this thread. image

predr commented 3 years ago

@NirmalManoj I understand this can be a problem for some (I've been there). However, I think we have past the point where access permissions was a novel idea and had to be explained in description boxes. It's on users to learn to use them and on software distributors to make them easy to use.

Image was not meant for you specific case, just to show there are ways for users to discover and use permissions. Work within your community to add this feature if it is missing in your software manager.

predr commented 3 years ago

Snap transferred to application author (upstream) and auto-connect will be given to them.