How can I grant access to an additional directory (e.g not /home/user) to a snap package?
There is no slot available for directories other than :desktop and :home in snap connections.
Is it possible at all?
How can I grant access to an additional directory (e.g not /home/user) to a snap package?
There is no slot available for directories other than :desktop and :home in snap connections.
Is it possible at all?
You can bind-mount additional directories into your home dir or into ~/snap/<snapname>/current to be able to access them.
(snaps use apparmor to achieve the filesystem access confinement, apparmor does not deal with symlinks, but can handle bind mounts very well instead)
For more information on bind mounts, see this answer on the Unix stackexchange.
It's possible today to manually manage snaps connections.
Grand access to removable medias:
snap connect [package_name]:removable-media
Replace [package_name] with actual package name (example fslint-unofficial)
Grand access to home folder:
snap connect [package_name]:home
Replace [package_name] with actual package name (example fslint-unofficial)
Read https://snapcraft.io/docs/snapcraft-interfaces for complete interfaces list
removable-media will allow any removable media. What about - say - /a/b/c/?
– DarkTrick
Jun 17 '24 at 16:02