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 431472 - Copy/move should not replace a file by itself
Copy/move should not replace a file by itself
Status: RESOLVED OBSOLETE
Product: nautilus
Classification: Core
Component: File and Folder Operations
2.16.x
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-04-19 20:40 UTC by Josselin Mouette
Modified: 2008-02-18 18:48 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
Abort when overwriting a file by itself (3.85 KB, patch)
2007-04-19 20:42 UTC, Josselin Mouette
none Details | Review

Description Josselin Mouette 2007-04-19 20:40:41 UTC
[ Forwarded from http://bugs.debian.org/419525 by Dieter Lucking ]

Doing this;
        cd /tmp/
        echo > a
        ln -s /tmp
        cd tmp
        mv a /tmp/
Gives me:
        mv: `a' and `/tmp/a' are the same file

Replacing /tmp/a with /tmp/tmp/a in nautilus leads to deletion - copy/paste, cut/paste or drag/drop will do it.

===

This bug leads to user data loss in this very rare case.
Comment 1 Josselin Mouette 2007-04-19 20:42:23 UTC
Created attachment 86662 [details] [review]
Abort when overwriting a file by itself

This patch aborts the transfer when the source and destination are the same file (be it because of a hard link or a symbolic link manipulation like the user described).
Comment 2 Loïc Minier 2008-01-07 12:55:14 UTC
FYI doesn't seem to apply against 2.21.1 anymore.  :-/

I guess this patch has been victim of the new "common progress bar" dialog.
Comment 3 Cosimo Cecchi 2008-02-18 18:48:00 UTC
This seems to be fixed in 2.21.91, clicking on Replace replaces the file just fine. Please reopen this bug and move it in the GIO component of nautilus bugzilla if it happens again, thanks!