Bug 127793

Summary: Renaming in FTP overwrites existing files without confirmation
Product: [Frameworks and Libraries] kio Reporter: Martin Pärtel <martin.partel>
Component: ftpAssignee: David Faure <faure>
Status: RESOLVED FIXED    
Severity: grave CC: dsk1, florian.reinhard, rasasi78
Priority: NOR    
Version: 3.5   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description Martin Pärtel 2006-05-22 00:24:28 UTC
Version:           3.5.2 (using KDE 3.5.2, Debian Package 4:3.5.2-2+b1 (testing/unstable))
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.16-beyond3

Renaming a file on an FTP server does not ask for confirmation if the name is used by another file. Instead, it silently overwrites the existing file! The GUI shows two files with the same name until the directory is refreshed.
Comment 1 Bram Schoenmakers 2007-08-20 21:27:39 UTC
*** Bug 149036 has been marked as a duplicate of this bug. ***
Comment 2 Pino Toscano 2008-06-09 03:08:53 UTC
*** Bug 163568 has been marked as a duplicate of this bug. ***
Comment 3 Pino Toscano 2008-06-09 03:10:49 UTC
*** Bug 138447 has been marked as a duplicate of this bug. ***
Comment 4 Pino Toscano 2008-06-09 10:01:38 UTC
data loss, thus grave.
Comment 5 Raúl 2008-06-09 10:09:35 UTC
Reproduced from http://bugs.kde.org/show_bug.cgi?id=163568 for the sake of completeness:
 
 Steps to reproduce: 
 1. launch konqueror or dolphin 
 2. connect to a ftp server (in my case vsftpd on kubuntu) 
 3. create two files foo.txt and bar.txt 
 4. select bar.txt and rename it to foo.txt 
 
 you won't get warned or asked if you'd like to suggest another filename, the file is just being overwritten and the most confusing thing: you see foo.txt twice unless you hit F5. 
 
Comment 6 Florian Reinhard 2008-06-09 12:18:44 UTC
and to be really complete: bug 163568 was discovered on svn trunk r818551 :)
Comment 7 David Faure 2008-06-09 14:32:21 UTC
SVN commit 818728 by dfaure:

ftpRename: must check if dest already exists, RNFR+RNTO overwrites by default
BUG: 127793


 M  +28 -15    ftp.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=818728
Comment 8 D. Schwartzkopff 2008-07-03 16:58:27 UTC
Sorry this bug is not fixed for all ftp servers. I am using z/OS 1.8 (IBM mainframe) with default configuration. If I try to rename a file to an existing one the following conversation happens:
Request: SIZE /home/user/x
Response: 501 command aborted -- FTP server not configured for SIZE
Request: cwd /home/user/x
Response: 550 CWD cmd failed : EDC5135I Not a directory. (errno2=0x0519004F)
Request: RNFR x_1
Response: 350 RNFR accepted. Please supply new name for RNTO.
Request: RNTO /home/user/x
Response: 250 /home/user/x_1 renamed to /home/user/x