Bug 9384 - slimserver.pl --user <$USER> does run transoder programs as root and not as $USER
: slimserver.pl --user <$USER> does run transoder programs as root and not as $...
Status: NEW
Product: Logitech Media Server
Classification: Unclassified
Component: Transcoding
: 7.3.0
: PC Linux (other)
: P5 minor (vote)
: 8.0.0
Assigned To: Andy Grundman
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-09-03 13:11 UTC by Markus Schiegl
Modified: 2011-03-16 04:39 UTC (History)
1 user (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Schiegl 2008-09-03 13:11:42 UTC
Hi,

while debugging another problem i found out, that programs like flac or lame (called while transcoding) are executed as root and not as the user specified with --user <USER> on the command line.

I'm running SC 7.3-trunk, with

root@host:/.../slimserver.pl ... --user control

ps-output:

$ ps auxw |grep -i squee |grep -v mysql
control  20692  0.7  4.0 247872 162352 ?       Ss   21:42   0:06 /usr/bin/perl -w /opt/squeezecenter/slimserver.pl --daemon --logdir /var/log/squeezecenter --pidfile /var/run/squeezecenter.pid --prefsdir /home/control/squeezecenter/prefs --playlistdir /home/control/squeezecenter/playlist --cachedir /home/control/squeezecenter/cache --user control --group users
control  20713  0.0  0.0   1568   488 ?        S    21:43   0:00 /opt/SqueezeCenter_svn/7.3/trunk/server/Bin/i386-linux/mDNSResponderPosix -f /home/control/squeezecenter/cache/mDNS.conf
root     20782  0.0  0.0  11160  1312 ?        S    21:54   0:00 sh -c "/opt/SqueezeCenter_svn/7.3/trunk/server/Bin/i386-linux/flac" -dcs --skip=0 --until=-0 -- "-" | "/usr/bin/lame" --silent -q 3 -v -B 128 - -
root     20783  0.6  0.0   7016   836 ?        S    21:54   0:00 /opt/SqueezeCenter_svn/7.3/trunk/server/Bin/i386-linux/flac -dcs --skip=0 --until=-0 -- -

AFAIK the problem is in the area of "uid, euid and open2". I've attached a test.pl programm to bug 9356 (I know it's offtopic there ;-)

You'll not see this in problem in any distro packages, because
suse uses:
...startproc -u $SQUEEZECENTER_USER $SQUEEZECENTER_BIN $SQUEEZECENTER_ARGS...
redhat:
...daemon --user $SQUEEZECENTER_USER $SQUEEZECENTER_BIN $SQUEEZECENTER_ARGS...
debian/ubuntu:
...start-stop-daemon --start --quiet --chuid $SLIMUSER...

Those helper programs will drop root privileges and from SC's POV it's uid=euid=$USER and therefore no problem.

I'd like to see lame/flac/... being executed as $USER. If this is not feasible please tell me and i'll revert to start-stop-daemon for my installation. thanks!

kind regards,
Markus
Comment 1 Mark Miksis 2008-09-03 13:56:41 UTC
This is kind of a dupe of bug 5035.  Basically, --user and --group seem to be broken.
Comment 2 Chris Owens 2009-03-16 09:37:54 UTC
We are now planning to make a 7.3.3 release.  Please review your bugs (all marked open against 7.3.3) to see if they can be fixed in the next few weeks, or if they should be retargeted for 7.4 or future.

Thanks!
Comment 3 Chris Owens 2009-03-30 17:30:15 UTC
Since there's now a planned 7.3.3 release, bugs which won't make the cut-off are being moved to the next target out.  If you feel that this bug needs to be addressed more (or less) urgently than the 7.4 release, please cc chris@slimdevices.com and leave a comment in the bug to that effect so we can review it.

Thanks.
Comment 4 Chris Owens 2009-03-31 08:52:38 UTC
For some reason Bugzilla did not change the target when I did this yesterday.  Or maybe it was me.  In either case, I'm trying it again.
Comment 5 Andy Grundman 2009-07-29 14:58:45 UTC
Moving 7.4 bugs to 8.0.