After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 312536 - [PATCH] gnome-vfs does not resolve partially qualified symlinks properly
[PATCH] gnome-vfs does not resolve partially qualified symlinks properly
Status: RESOLVED DUPLICATE of bug 308639
Product: gnome-vfs
Classification: Deprecated
Component: File operations
2.11.x
Other All
: Normal normal
: ---
Assigned To: gnome-vfs maintainers
gnome-vfs maintainers
Depends on:
Blocks:
 
 
Reported: 2005-08-04 06:06 UTC by Joe Marcus Clarke
Modified: 2005-09-14 00:18 UTC
See Also:
GNOME target: ---
GNOME version: 2.11/2.12


Attachments
Fix symlink resolution (1.08 KB, patch)
2005-08-04 06:06 UTC, Joe Marcus Clarke
reviewed Details | Review

Description Joe Marcus Clarke 2005-08-04 06:06:08 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.
Comment 1 Joe Marcus Clarke 2005-08-04 06:06:40 UTC
Created attachment 50210 [details] [review]
Fix symlink resolution
Comment 2 Christian Kirbach 2005-08-05 08:38:44 UTC
Confirming so developers can take a look.
Comment 3 Christian Neumair 2005-09-14 00:18:25 UTC
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 ***