Should find_directory() canonicalize all symlinks?


I'm debugging an interesting problem in Nautilus (please bear with me; I
think the problem is in gnome-vfs).  The summary is this:

1. You mount a network volume under /foo/mountpoint.  Once mounted, you
don't have write permission to /foo/mountpoint, but you have permission
under /foo/mountpoint/subdir.

2. Create a symlink from /foo/mountpoint to /home/federico/shortcut

3. Tell Nautilus to visit /home/federico/shortcut/subdir.  Select a file
inside there, and move it to the trash.  Nautilus does nothing.

4. Now, tell Nautilus to visit /foo/mountpoint/subdir directly instead
of going through the symlink.  Try to move a file inside there to the
trash.  Nautilus tells you that it can't move the file to the trash, and
would you like to delete it permanently.  If you tell it to do that, the
file gets deleted permanently.

Different things happen for cases 3 and 4 when I'm right here:

              gnome_vfs_find_directory_cancellable (

In case 3, can_move_uri_to_trash() returns TRUE because it tries to use
my ~/.Trash, and succeeds.

In case 4, can_move_uri_to_trash() returns FALSE because
gnome_vfs_find_directory_cancellable() gets
near_uri="/foo/mountpoint/subdir".  It finds the root directory of that
volume in file-method.c:find_disk_top_directory(), which
is /foo/mountpoint.  Then it tries to
create /foo/mountpoint/.Trash-federico and fails because I don't have
write permission there.

Looking at gnome_vfs_find_directory_cancellable(), I saw that it does
nothing to near_uri if it is non-NULL.  If near_uri is NULL, however,
the function takes your home directory and canonicalizes all symlinks to

My question is:  why doesn't gnome_vfs_find_directory_cancellable()
canonicalize the near_uri unconditionally?  It would take care of my
trash problem, and it looks like the right thing to do in general.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]