Bug 2354 - --prefsfile fails if preferences file does not exist
: --prefsfile fails if preferences file does not exist
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Platform Support
: unspecified
: PC Debian Linux
: P2 normal (vote)
: ---
Assigned To: Dan Sully
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-10-24 13:03 UTC by Mattias Holmlund
Modified: 2008-09-15 14:37 UTC (History)
0 users

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mattias Holmlund 2005-10-24 13:03:09 UTC
If a preferences file is specified with the --prefsfile parameter, slimserver
refuses to write to the specified file for the wrong reason. The code in
Slim/Utils/Prefs.pm contains the following test:

$canWrite = (-e prefsFile() && -w prefsFile()) || (-w preferencesPath());

When running with --prefsfile /etc/slimserver/slimserver.pref,
prefsFile() is '/etc/slimserver/slimserver.pref', but
preferencesPath() is '/root'. This means that the code checks to see
if /etc/slimserver/slimserver.pref exists, and if it doesn't exist it
checks to see if it can write to /root, which it can't and thus an
error-message is printed:

Cannot write to preferences file
/etc/slimserver/slimserver.pref, any changes made will not be preserved
for the next startup of the server

The correct check is to see if it can write to /etc/slimserver, but I don't know
if preferencesPath() is wrong or if the check -w preferencesPath() is wrong.
Comment 1 Dan Sully 2005-10-27 20:59:07 UTC
Thanks - fixed in change 4895