Since Firefox in Ubuntu 21.10 became a snap app it does not see files in /tmp. I could of course remove the snap version and install an "ordinary" version, but this seems as a bad work around as I suspect that more and more apps will use snap. How can I give snap apps access to files outside /home? In this specific case, can I have a temporary directory in a dierctory available to a snap app?
Is there a specific reason for you to grant Firefox access to the systemwide
/tmp
? Indeed, as part of the confinement, Firefox only sees its private/tmp
.Snaps can be granted connections through interfaces. These interfaces are quite specific, and include
home
for access to (visible only) files in the user's home directory, andremovable-media
for access to removable drives. What is more, these interfaces are available only if the developer implemented them in the snap package. Connecting to such interfaces, providing they are implemented in the specific snap, is your only way to give snaps access to directories and files outside/home
.A snap application has access to files and directories in its directory under
~/snap
. So indeed you can create extra directories there, and the snap application will have access to them. However, no other snap application will have access there. In principle, you could link standard locations through to locations where a snap has access using symbolic links or mount binds, but only not confined applications next to the specific snap application will have access.Still, it is difficult to provide a general answer here because an optimal solution depends on what you ultimately want to achieve. That does not necessarily involve a need to grant Firefox access to the systemwide
/tmp
.