Bugzilla – Bug 13980
directory scan gets caught in a recursive symlink loop
Last modified: 2011-09-19 06:46:26 UTC
a symlink to the local directory causes an infinitely recursive directory scan loop. suggested fix: do not follow symlinks to targets within the music root, as this will not discover new content and will likely cause recursion.
i see there is protection in Scanner::findFilesMatching() as: elsif (my $file = Slim::Utils::Misc::pathFromMacAlias($file)) { if (dir($file)->subsumes($topDir)) { logWarning("Found an infinite loop! Breaking out: $file -> $topDir"); next; } but this doesn't seem to work properly. ktrace showed after 45 minutes directory scan was deeply recursed, although it did break out eventually. i'll try to get more diagnosis info from subsumes() to see why it is broken, or if this conditional is being missed somehow.
problem is that this is actually not a mac alias, but a recursive unix symlink. therefore, its File::Next that needs to understand the situation. digging further.
*** /Users/dan/slimdev/slim/7.4/trunk/server/Slim/Utils/Scanner.pm 2009-09-09 20:18:44.000000000 -0700 --- Scanner.pm 2009-09-11 14:15:22.000000000 -0700 *************** *** 131,136 **** --- 131,137 ---- 'descend_filter' => $descend_filter, 'sort_files' => 1, 'error_handler' => sub { errorMsg("$_\n") }, + 'follow_symlinks' => 0 }, $topDir); my $found = $args->{'foundItems'} || []; does the trick, although its not perfect. best would be a limit on following recursive symlinks only. enhancement request filed against File::Next maintainer.
Andy: is this one yours to look at?
7.4.x milestone is in the past