Allow daemon to access users home directory

I have packaged the Plex Media Server snap. See https://www.plex.tv if you don’t know what it is.

The server runs in the background as a daemon, which makes perfect sense to me. However, this poses some problems with permissions to access media content. Currently, the snap is able to access media content inside of an external drive or the root user’s home. I don’t like the latter very much!

What I would like was to be able to access media content from a common user’s home. I don’t know how to do this with snaps or if this is even possible. Can anybody help shed some light on this issue?

Best regards,
David

1 Like

Thanks for snapping this! :smiley: Could you link your snapcraft.yaml and have you included home under plugs?

You’re welcome. It was very easy in fact.
Here is the link to the git repository where I keep the snap files: https://github.com/davidfialho14/plexmediaserver_snap

The home plug does not solve the issue. Since the snap runs as a daemon, the home plug only gives access to the root user’s home directory and not to the home directory of a regular user.

Thank you for trying to help.

To be very specific, the security policy for the home interface allows access to non-hidden files owned by the process that are in the home directory of that process’ uid. Eg, root-owned files in /root, and user-owned files in /home/*/*.

There currently is not an interface to allow reading arbitrary files on the filesystem. In the future session services will be supported that will allow the daemon to start as part of session login, but I suspect with your snap, you would also want to be able to read files from any user on the system. For now, you might consider using classic confinement.

1 Like