Bugzilla – Bug 1152
SlimServer execute with the user argument creates log and conf with incorrect and unusable privileges.
Last modified: 2008-12-18 11:54: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: $!";}
Created attachment 357 [details] proposed patch to slimserver.pl v6.0b2 diff -u
Created attachment 358 [details] proposed patch to slimserver.pl v5.4.1 diff -u
Looks reasonable. Dan: should we take this for 6.0?
Yes - looks good. Will integrate.
Yes - looks good. Checked in a subversion changes 2643 & 2644. Thanks
Routine bug db maintenance; removing old versions which cause confusion. I apologize for the inconvenience.