Permissions of /var/lib/snapd/snaps/*.snap

Good evening

Why are the permissions on the .snap squashfs files located within /var/lib/snapd/snaps/ so restrictive? They are set to rw------- root root. Would there be a disadvantage if they were set to rw-r--r-- root root? If not, I propose that the files be given these permissions so normal users can inspect the files without having to elevate to root.

Best regards

Daniel

1 Like

These files all get automatically mounted in /snap where you can just use ls or cd to inspect the content…

I don’t necessarily want to mount them, I want to do other things with them.

I’m not talking about you mounting them, if a file lies in that dir it is also mounted in /snap, this is a hard-wired thing, like a bunch of other actions that happen around these files when they get into this dir…

If you want to see their content you can do so without special permission via /snap …

If you want to do any other things with them you should always make pretty sure all the hard-wired things are gone first by using the snap disable command on them, else you might harm your system…

I agree the permission seems to be unnecessarily strict.

In my case I would probably want to copy the package to my own folder, extract it using unsquashfs, and repack it for testing.

Well… Is using sudo cp vs cp so much harder ?

While it isn’t necessarily needed that the files have such strict permissions, it isn’t actually a bad thing either to have them strict…