1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
From 4daa0519150f38bd322964157157fb3369ee0f38 Mon Sep 17 00:00:00 2001
From: Justin Bronder <jsbronder@gmail.com>
Date: Wed, 16 Sep 2009 11:43:59 -0400
Subject: [PATCH 1/3] MPD_CONF_FILE should be readable
When looking for the MPD_CONF_FILE, the existance is not enough, the
file also needs to be readable by the current user.
---
src/pm/mpd/mpdlib.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/pm/mpd/mpdlib.py b/src/pm/mpd/mpdlib.py
index 8ea8a05..31ddcb4 100644
--- a/src/pm/mpd/mpdlib.py
+++ b/src/pm/mpd/mpdlib.py
@@ -1359,11 +1359,11 @@ class MPDParmDB(dict):
if os.environ.has_key(k):
self[('env',k)] = os.environ[k]
def get_parms_from_rcfile(self,parmsToOverride,errIfMissingFile=0):
- if os.environ.has_key('MPD_CONF_FILE'):
+ if os.environ.has_key('MPD_CONF_FILE') and os.access(os.environ['MPD_CONF_FILE'], os.R_OK):
parmsRCFilename = os.environ['MPD_CONF_FILE']
elif hasattr(os,'getuid') and os.getuid() == 0: # if ROOT
parmsRCFilename = os.path.abspath('/etc/mpd.conf')
- elif os.environ.has_key('HOME'):
+ elif os.environ.has_key('HOME') and os.access(os.path.join(os.environ['HOME'], '.mpd.conf'), os.R_OK):
parmsRCFilename = os.path.join(os.environ['HOME'],'.mpd.conf')
elif os.environ.has_key('HOMEPATH'): # e.g. win32
parmsRCFilename = os.path.join(os.environ['HOMEPATH'],'.mpd.conf')
--
1.6.3.3
|