GNOME Bugzilla – Bug 512144
symlinks to folders are deleted recursively
Last modified: 2009-01-30 22:38:44 UTC
Please describe the problem: When finally deleting a symlink to a folder, the contents of the folder are being deleted too. Steps to reproduce: 1. Move a link to a folder to trash 2. Empty the trash 3. Data in the linked folder is gone Actual results: All files within the linked directory are being deleted Expected results: only the symlink is deleted, no other files Does this happen every time? yes Other information:
Can't reproduce this bug with 2.21.6. Which version of Nautilus and gvfs you have?
Nautilus version is a 2.21.6 too, gvfs 0.1.4-0 However, as i see now it doesn't happen with usual directories. the case for which the bug was filed was my ~/Music and ~/Pictures directories (unfortunately...), being both xdg-user-dirs and living on another partition. so one of those two might be the reason for the different behaviour. here are the commands which should reproduce the bug (with some partition mounted @ /mnt/data): #as root (probably doesn't matter): cd /mnt/data mkdir Pictures chown some_user_name Pictures #as normal user cd /mnt/data/Pictures touch a touch b touch c ln -s /mnt/data/Pictures/ ~/Pictures #now go into nautilus, move the symlink to trash and empty it ls #the files a, b and c are gone
2008-02-04 Alexander Larsson <alexl@redhat.com> * libnautilus-private/nautilus-file-operations.c: Don't follow symlinks when emptying trash (#513912)
seems to be an issue with nautilus 2.25.3 and gvfs 1.1.4 these steps reproduce the issue: * create a folder on the desktop, create some documents inside. * right click on the folder and select create a link * move the link to the trash * empty the trash * go to the folder previously created on the desktop, folder is empty However cannot reproduce the bug if i create a symlink with ln. Thanks.
there's also an Ubuntu report about it here: https://bugs.edge.launchpad.net/nautilus/+bug/323321
the delete code in the trash says: enumerator = g_file_enumerate_children (directory, G_FILE_ATTRIBUTE_STANDARD_NAME, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL, NULL); let me guess: NOFOLLOW_SYMLINKS doesn't mean what i think it means here... (ie: a symlink to a directory is still followed and the directory contents are still enumerated...)
Created attachment 127586 [details] [review] don't attempt to enumerate symlinks, even with no-follow set
completely untested patch
Seb and I tested to confirm the patch fixes the bug. Sorry about that, everyone. *covers face with bag* Committed revision 2187.