aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-07-20 07:05:10 +0200
committerMax Kellermann <max@duempel.org>2011-07-20 14:15:20 +0200
commitb2175629fde13ce58ccb7cd1c4c39b9707225b84 (patch)
treecf2a168a9fde698787d63a58023ced5cd7241908 /src
parent2e28ed8f81630cdadf9e3a22d0cd460f6afffe1a (diff)
downloadmpd-b2175629fde13ce58ccb7cd1c4c39b9707225b84.tar.gz
mpd-b2175629fde13ce58ccb7cd1c4c39b9707225b84.tar.xz
mpd-b2175629fde13ce58ccb7cd1c4c39b9707225b84.zip
update_walk: apply follow_inside_symlinks to absolute symlinks
Diffstat (limited to '')
-rw-r--r--src/update_walk.c10
1 files changed, 8 insertions, 2 deletions
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 == '.') {