From b2175629fde13ce58ccb7cd1c4c39b9707225b84 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 20 Jul 2011 07:05:10 +0200 Subject: [PATCH] update_walk: apply follow_inside_symlinks to absolute symlinks --- NEWS | 1 + src/update_walk.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index e6580c5f0..b642c820b 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ ver 0.16.4 (2011/??/??) * fix memory leaks * don't resume playback when seeking to another song while paused +* apply follow_inside_symlinks to absolute symlinks * decoder: - ffmpeg: workaround for semantic API change in recent ffmpeg versions - flac: validate the sample rate when scanning the tag diff --git a/src/update_walk.c b/src/update_walk.c index 845f152eb..bf3c8f54b 100644 --- a/src/update_walk.c +++ b/src/update_walk.c @@ -714,8 +714,14 @@ skip_symlink(const struct directory *directory, const char *utf8_name) return false; } - if (buffer[0] == '/') - return !follow_outside_symlinks; + if (g_path_is_absolute(buffer)) { + /* if the symlink points to an absolute path, see if + that path is inside the music directory */ + const char *relative = map_to_relative_path(buffer); + return relative > buffer + ? !follow_inside_symlinks + : !follow_outside_symlinks; + } p = buffer; while (*p == '.') {