Bug 194120 - multimedia/plexmediaserver overrides /tmp permissions
Summary: multimedia/plexmediaserver overrides /tmp permissions
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Mark Felder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-03 20:00 UTC by Nikolai Nespor
Modified: 2014-10-04 14:52 UTC (History)
0 users

See Also:
bugs: maintainer-feedback? (feld)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nikolai Nespor 2014-10-03 20:00:08 UTC
Using the settings suggested in the rc script, the plexmediaserver_tmp directory is set to /tmp. When the media server is started the command

install -d -g ${plexmediaserver_group} -o ${plexmediaserver_user} "${plexmediaserver_tmp}"

is run, which sets the user and group for /tmp to plex:plex and changes the permissions to 0755 (IIRC), which is not a good thing :)

Please change the suggested plexmediaserver_tmp in the rc script to something less intrusive like /tmp/plexmediaerver or /var/tmp/plexmediaserver.

Regards,

Nikolai
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2014-10-03 20:00:08 UTC
Auto-assigned to maintainer feld@FreeBSD.org
Comment 2 Mark Felder freebsd_committer freebsd_triage 2014-10-03 20:23:33 UTC
plexmediaserver_tmp is *not* set by default. It is documented how to use it though, displaying setting it to "/tmp". That example should probably be changed to "/var/tmp/plex" as you suggested so someone doesn't shoot themselves in the foot...

The actual code in the start_precmd is:

        if [ ${plexmediaserver_tmp} ]; then
                export TMPDIR=${plexmediaserver_tmp};
                install -d -g ${plexmediaserver_group} -o ${plexmediaserver_user} "${plexmediaserver_tmp}";
        fi


So if someone declares plexmediaserver_tmp in rc.conf it will attempt to set permissions on that directory. Hopefully they don't set to /tmp, because that's what Plex uses by default anyway for its TMPDIR env.


I'll update the example so nobody makes that mistake through copy+paste.
Comment 3 commit-hook freebsd_committer freebsd_triage 2014-10-03 20:27:27 UTC
A commit references this bug:

Author: feld
Date: Fri Oct  3 20:26:46 UTC 2014
New revision: 369936
URL: https://svnweb.freebsd.org/changeset/ports/369936

Log:
  Adjust documentation for the configurable tmp directory used for
  transcoding so nobody shoots themselves in the foot and causes /tmp to
  have its permissions changed...

  PR:		194120

Changes:
  head/multimedia/plexmediaserver/files/plexmediaserver.in
  head/multimedia/plexmediaserver-plexpass/files/plexmediaserver_plexpass.in
Comment 4 Mark Felder freebsd_committer freebsd_triage 2014-10-03 20:28:14 UTC
Thanks for the report. Change committed.
Comment 5 Nikolai Nespor 2014-10-04 14:52:04 UTC
Thanks for the quick fix and sorry for misreading the rc script.