Bug 1152 - SlimServer execute with the user argument creates log and conf with incorrect and unusable privileges.
: SlimServer execute with the user argument creates log and conf with incorrect...
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Misc
: 5.x or older
: Other Linux (other)
: P4 normal (vote)
: ---
Assigned To: Dan Sully
http://www.realisticsoftware.com/PrIv...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-03-21 15:57 UTC by Brian Beardmore
Modified: 2008-12-18 11:54 UTC (History)
0 users

See Also:
Category: ---


Attachments
proposed patch to slimserver.pl v6.0b2 (1.17 KB, patch)
2005-03-21 16:18 UTC, Brian Beardmore
Details | Diff
proposed patch to slimserver.pl v5.4.1 (818 bytes, patch)
2005-03-21 16:22 UTC, Brian Beardmore
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Beardmore 2005-03-21 15:57:23 UTC
Summary: SlimServer execute with the user argument creates log and conf with incorrect and unusable 
privileges.

The SlimServer is unusable after a new install of the SlimServer using the user argument.  This is 
because the log and configuration files are created and privileged based on the user that launched the 
SlimServer.

I have a code fix to address the configuration file.  The code change diffs are listed in the bug and the 
entire source file changes can be downloaded from the bug link.  My proposed code change is to 
reorder the functionality in the "daemonize" function in "slimserver.pl" file.

Please contact me for any follow up, if it is needed.


Note: this bug occurs in SlimServer versions 5.4.0, 5.4.1, 6.0b1, and 6.0b2 

LAN hardware involved
---------------------
Qube3 (slimserver)
  - patched with all the latest updates
  - used perl 5.4.1 or 5.4.6 
Netgear 10/100 switch
Netgear WGT624 gateway
Zoom cable modem
DTA-310 (packet8 VoIP) device latest firmware v1034
Macs & PCs on and off network
slimp3 (powered down every night and other times when it is not being used)
Comcast ISP


Steps to reproduce
------------------
-Install new SlimServer software
-Run SlimServer with user argument set to a user different then the one executing
 ie
 ./slimserver.pl --user slimp3 --cachedir ./ServerFiles 
   	  	--logfile ./ServerFiles/slimserver.log --prefsfile ./ServerFiles/slimserver.conf --daemon
-Attempt to configure the SlimServer through the web interface
-Quit SlimServer
-Rerun SlimServer with user argument set to a user different then the one executing
* Note the server changes where not saved.  Also inspect the newly created log and conf file privileges.  
The files are only writable by the launching user.

Workaround
----------
Simply chown the log and conf to the user used in the --user argument.


File Diffs v5.4.1
-----------------
#####slimserver.pl.pm
707,710d706
<       if ($logfile) { $log = $logfile } else { $log = '/dev/null' };
< 
<       if (!open STDIN, '/dev/null') { die "Can't read /dev/null: $!";}
<       if (!open STDOUT, ">>$log") { die "Can't write to $log: $!";}
762a759,762
> 
>       if ($logfile) { $log = $logfile } else { $log = '/dev/null' };
>       if (!open STDIN, '/dev/null') { die "Can't read /dev/null: $!";}
>       if (!open STDOUT, ">>$log") { die "Can't write to $log: $!";}
Comment 1 Brian Beardmore 2005-03-21 16:18:40 UTC
Created attachment 357 [details]
proposed patch to slimserver.pl v6.0b2

diff -u
Comment 2 Brian Beardmore 2005-03-21 16:22:36 UTC
Created attachment 358 [details]
proposed patch to slimserver.pl v5.4.1

diff -u
Comment 3 Blackketter Dean 2005-03-21 22:18:46 UTC
Looks reasonable.  Dan: should we take this for 6.0?
Comment 4 Dan Sully 2005-03-21 22:21:10 UTC
Yes - looks good. Will integrate.
Comment 5 Dan Sully 2005-03-21 22:30:58 UTC
Yes - looks good.

Checked in a subversion changes 2643 & 2644.

Thanks
Comment 6 Chris Owens 2008-12-18 11:54:23 UTC
Routine bug db maintenance; removing old versions which cause confusion.  I apologize for the inconvenience.