aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-10-06 22:57:14 +0200
committerMax Kellermann <max@duempel.org>2011-10-06 22:57:14 +0200
commitfa7fa2a55f6ddd90e3eed274b0eb8d1e00abea9b (patch)
tree3b1d0f8636382e758f9f592e1398b67f8e1a0a56
parent5c0576ca5519d525c6c383cd138da917b67a2810 (diff)
downloadmpd-fa7fa2a55f6ddd90e3eed274b0eb8d1e00abea9b.tar.gz
mpd-fa7fa2a55f6ddd90e3eed274b0eb8d1e00abea9b.tar.xz
mpd-fa7fa2a55f6ddd90e3eed274b0eb8d1e00abea9b.zip
playlist_song: allow references to songs outside the musicdir
When we have an absolute path that's not inside the music directory, allow loading it anyway, if we're in "secure" mode (i.e. the client is connected via UNIX socket).
Diffstat (limited to '')
-rw-r--r--NEWS2
-rw-r--r--src/playlist_song.c6
2 files changed, 8 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 933b97958..2577f9d95 100644
--- a/NEWS
+++ b/NEWS
@@ -20,6 +20,8 @@ ver 0.17 (2011/??/??)
- raop: new output plugin
- shout: add possibility to set url
- roar: new output plugin for RoarAudio
+* playlist:
+ - allow references to songs outside the music directory
* state_file: add option "restore_paused"
* cue: show CUE track numbers
* allow port specification in "bind_to_address" settings
diff --git a/src/playlist_song.c b/src/playlist_song.c
index afdc0cf9c..d40ef63cf 100644
--- a/src/playlist_song.c
+++ b/src/playlist_song.c
@@ -140,6 +140,12 @@ playlist_check_translate_song(struct song *song, const char *base_uri,
if (uri_has_scheme(uri)) {
dest = song_remote_new(uri);
g_free(uri);
+ } else if (g_path_is_absolute(uri) && secure) {
+ dest = song_file_load(uri, NULL);
+ if (dest == NULL) {
+ song_free(song);
+ return NULL;
+ }
} else {
dest = db_get_song(uri);
g_free(uri);