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).
This commit is contained in:
parent
5c0576ca55
commit
fa7fa2a55f
2
NEWS
2
NEWS
|
@ -20,6 +20,8 @@ ver 0.17 (2011/??/??)
|
||||||
- raop: new output plugin
|
- raop: new output plugin
|
||||||
- shout: add possibility to set url
|
- shout: add possibility to set url
|
||||||
- roar: new output plugin for RoarAudio
|
- roar: new output plugin for RoarAudio
|
||||||
|
* playlist:
|
||||||
|
- allow references to songs outside the music directory
|
||||||
* state_file: add option "restore_paused"
|
* state_file: add option "restore_paused"
|
||||||
* cue: show CUE track numbers
|
* cue: show CUE track numbers
|
||||||
* allow port specification in "bind_to_address" settings
|
* allow port specification in "bind_to_address" settings
|
||||||
|
|
|
@ -140,6 +140,12 @@ playlist_check_translate_song(struct song *song, const char *base_uri,
|
||||||
if (uri_has_scheme(uri)) {
|
if (uri_has_scheme(uri)) {
|
||||||
dest = song_remote_new(uri);
|
dest = song_remote_new(uri);
|
||||||
g_free(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 {
|
} else {
|
||||||
dest = db_get_song(uri);
|
dest = db_get_song(uri);
|
||||||
g_free(uri);
|
g_free(uri);
|
||||||
|
|
Loading…
Reference in New Issue