From 4f807b3aaa9617dfc35fb73ec898c8c9a22fded4 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 23 Oct 2008 09:54:42 +0200 Subject: stored_playlist: don't map files outside the database Don't attempt to map paths which are already absolute with map_song_fs(): check with song_in_database() instead of song_is_file(). --- src/playlist_save.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/playlist_save.c') diff --git a/src/playlist_save.c b/src/playlist_save.c index c89afe684..9c72e0aef 100644 --- a/src/playlist_save.c +++ b/src/playlist_save.c @@ -29,7 +29,7 @@ playlist_print_song(FILE *file, const struct song *song) { char tmp1[MPD_PATH_MAX], tmp2[MPD_PATH_MAX]; - if (playlist_saveAbsolutePaths && song_is_file(song)) { + if (playlist_saveAbsolutePaths && song_in_database(song)) { const char *path = map_song_fs(song, tmp1); if (path != NULL) fprintf(file, "%s\n", path); @@ -46,7 +46,8 @@ playlist_print_uri(FILE *file, const char *uri) char tmp[MPD_PATH_MAX]; const char *s; - if (playlist_saveAbsolutePaths && !isValidRemoteUtf8Url(uri)) + if (playlist_saveAbsolutePaths && !isValidRemoteUtf8Url(uri) && + uri[0] != '/') s = map_directory_child_fs(db_get_root(), uri, tmp); else s = utf8_to_fs_charset(tmp, uri); -- cgit v1.2.3