Nautilus is following symbolic links when emptying trash

Bug #188361 reported by Chris Coulson
12
Affects Status Importance Assigned to Milestone
Nautilus
Fix Released
Critical
nautilus (Ubuntu)
Fix Released
Medium
Ubuntu Desktop Bugs

Bug Description

Binary package hint: nautilus

When a symbolic link to a folder is moved to trash in Nautilus, the contents of the folder that it links to are then erased when the trash is emptied. For example, Wine creates a link '~/.wine/dos_devices/z:' to the root filesystem. If ~/.wine is moved to trash, and the trash is emptied, everything that you can write to in your root filesystem is then deleted (including the contents of your home folder).

I've confirmed this by creating test folders containing empty files, linking to the folder, moving the link to trash and then emptying the trash. The contents of the folder are deleted.

This is on an up-to-date Hardy (Nautilus version 2.21.90-0ubuntu1

Related branches

Iulian Udrea (iulian)
Changed in nautilus:
importance: Undecided → Medium
status: New → Confirmed
Iulian Udrea (iulian)
Changed in nautilus:
assignee: nobody → desktop-bugs
Revision history for this message
Kow (kow) wrote :

Confirmed, here is a quick way to reproduce:

(1) Create a temporary folder (henceforth folder "A") and put some files in it that can be deleted (ie you dont care about.)
(2) Create another temporary folder which I will refer to as folder "B". Within folder B create a symlink to folder A.
(3) Move folder B to the trash in nautilus
(4) Empty the trash and notice all files in folder "A" are gone.

I think this should be a critical bug as it will delete files people do not expect to be deleted. The coreutils file manipulation programs do not follow symlinks this way so noone expects symlinks to be followed.

Changed in nautilus:
status: Unknown → New
Revision history for this message
Kow (kow) wrote :

Fixed upstream (gnome-bugs #513912), problem with gio/glib/gvfs. I'm not quite sure how this report should be updated but in the end it is invalid for nautilus.

Revision history for this message
A. Walton (awalton) wrote :

2008-02-04 Alexander Larsson <email address hidden>

        * libnautilus-private/nautilus-file-operations.c:
        Don't follow symlinks when emptying trash (#513912)

This probably should be pushed out to Ubuntu ASAP to avoid accidental data loss.

Changed in nautilus:
status: Confirmed → Fix Committed
Changed in nautilus:
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nautilus - 1:2.21.90-0ubuntu3

---------------
nautilus (1:2.21.90-0ubuntu3) hardy; urgency=low

  * debian/control.in:
    - don't build using libbeagle the code needs to be updated
  * debian/patches/90_from_svn_correct_trash_symlink_handling.patch:
    - change from svn, correct the trash symlink handling (LP: #188361)

 -- Sebastien Bacher <email address hidden> Mon, 04 Feb 2008 12:59:02 +0100

Changed in nautilus:
status: Fix Committed → Fix Released
Revision history for this message
Artem Vakhitov (temcat) wrote :

Hi, this probably should be reopened as I can confirm this bug on Hardy as of 24.02.2008, with Nautilus 2.21.91.

sam tygier (samtygier)
Changed in nautilus:
status: Fix Released → New
Revision history for this message
sam tygier (samtygier) wrote :

sam@oberon:~$ mkdir test
sam@oberon:~$ cd test/
sam@oberon:~/test$ mkdir a b
sam@oberon:~/test$ touch a/foo
sam@oberon:~/test$ touch a/bar
sam@oberon:~/test$ touch a/baz
sam@oberon:~/test$ ln -s /home/sam/test/a/ b/link
sam@oberon:~/test$ ls -l a
total 0
-rw-r--r-- 1 sam sam 0 2008-02-24 13:59 bar
-rw-r--r-- 1 sam sam 0 2008-02-24 13:59 baz
-rw-r--r-- 1 sam sam 0 2008-02-24 13:59 foo
sam@oberon:~/test$ ls -l b
total 0
lrwxrwxrwx 1 sam sam 17 2008-02-24 14:00 link -> /home/sam/test/a/
sam@oberon:~/test$ nautilus .
sam@oberon:~/test$ #move b to trash
sam@oberon:~/test$ #empty trash
sam@oberon:~/test$ ls a
sam@oberon:~/test$ ls -a a
. ..

needs to be an absolute (not relative) symlink

Changed in nautilus:
status: New → Confirmed
Revision history for this message
Prakash J Kokkatt (pjkonweb) wrote :

for me,I got this removed by"
rm -rf ~/.gnome/gnome-vfs/.trash_entry_cache

Revision history for this message
Sebastien Bacher (seb128) wrote :

Don't reopen closed bugs because you have a similar issue, you should rather open a new one

Changed in nautilus:
status: Confirmed → Fix Released
Revision history for this message
sam tygier (samtygier) wrote :
Changed in nautilus:
importance: Unknown → Critical
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.