GNOME Bugzilla – Bug 312536
[PATCH] gnome-vfs does not resolve partially qualified symlinks properly
Last modified: 2005-09-14 00:18:25 UTC
Please describe the problem: FreeBSD recently had a change such that the default symlink for /home now points to usr/home instead of /usr/home. This was to accommodate jails on FreeBSD. This change breaks certain features needing gnome-vfs (namely Nautilus Trash). Basically, gnome-vfs gets into a loop trying to resolve the symlink until it hits the maximum number of links, and returns a error. Steps to reproduce: 1. Make sure your home directory contains a partially qualified symlink (e.g. /home/marcus -> usr/home/marcus) 2. Try to move something to the Trash in Nautilus Actual results: Nautilus will claim it cannot move the file to Trash. Further debugging in gnome-vfs shows that it was trying to resolve file:///home/usr/home until it reached the maximum number of links. Expected results: I would expect gnome-vfs to resolve the symlink properly much the way ``realpath /home'' would. Does this happen every time? Yes. Other information: I have attached a patch that fixes this problem. I'm not certain this is the best fix, but it does work for me, and it works with subdirectories off of /home/marcus (e.g. /home/marcus/Desktop/Downloads). Basically, if the symlink being resolved starts with a path delimiter character, start the resolution search from root.
Created attachment 50210 [details] [review] Fix symlink resolution
Confirming so developers can take a look.
Thanks for your bug report and your patch! GnomeVFS HEAD contains another fix in attachment 52143 [details] [review] from bug 308639, which ensures that the symlink name is resolved relative to the parent URI of the symlink instead of the symlink itself, thus having the same effect as your solution. Therefore, I'm marking this one as a duplicate of bug 308639. *** This bug has been marked as a duplicate of 308639 ***