Bug 151851 - renaming filename in konqueror when broken symlink with new name exists does not give rename/overwrite dialog
Summary: renaming filename in konqueror when broken symlink with new name exists does ...
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-04 16:49 UTC by Shriramana Sharma
Modified: 2009-02-17 18:47 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shriramana Sharma 2007-11-04 16:49:49 UTC
Version:            (using KDE KDE 3.5.8)
Installed from:    Ubuntu Packages

With two files:
---------------

1. Create two files named foo and goo in a dir.
2. Create a symlink to foo called moo.
3. Delete foo.
4. Using Konqueror, rename goo to moo.
5. moo is overwritten without warning.

Other cases:
------------

With foo as directory and goo as file, behaviour is as with two files.

When foo and goo are both directories, step 4 gives a fatal error message saying: Could not rename file goo.

With foo and file and goo as directory, same.

Summary:
--------

Apparently the behaviour depends on whether goo is a directory or not. Either way, it is not the expected behaviour.

Expected: I should be given the usual warning about overwriting an existing file and given the choice of renaming or overwriting. The renaming should neither be done without warning nor should I be given a dumb fatal error message.
Comment 1 Jaime Torres 2008-06-06 16:39:15 UTC
Confirmed in konqueror 4 trunk r813735 
Comment 2 Jaime Torres 2008-06-06 17:37:57 UTC
I forgot to say that only the following cases remain:
* foo and goo files
* foo and goo directories
Comment 3 David Faure 2009-02-13 15:31:56 UTC
SVN commit 925561 by dfaure:

Re-testing #151851 (rename file to name of existing symlink) I found that it worked (I do get the overwrite dialog),
but after overwriting the icon wouldn't be updated correctly. KDirLister was emitting the renaming before the
deletion, which would make kdirmodel lose the new data.

And when writing the unittest for this I discovered another bug: KDirLister didn't process correctly
the KDirWatch signal emitted when an old file is re-created again.
BUG: 151851


 M  +44 -27    kio/kdirlister.cpp  
 M  +1 -1      kio/kdirlister_p.h  
 M  +49 -0     tests/kdirlistertest.cpp  
 M  +1 -0      tests/kdirlistertest.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=925561
Comment 4 David Faure 2009-02-16 11:25:12 UTC
Ah closed it too early. Overwriting the symlink with a directory still breaks.

Note that the type of "foo" doesn't matter, the test matrix is
- overwriting a symlink [or a file] with a file
- overwriting a symlink [or a file] with a directory
- and the case of overwriting a directory with a file, which can't work, but needs to be handled correctly.
Comment 5 David Faure 2009-02-17 01:14:15 UTC
SVN commit 927192 by dfaure:

Fix non-working (and/or crashing) overwriting of a file (or symlink) with a directory.
CCBUG: 151851


 M  +10 -11    kio/copyjob.cpp  
 M  +22 -20    kio/kdirlister.cpp  
 M  +17 -2     kio/kdirmodel.cpp  
 M  +38 -0     tests/kdirmodeltest.cpp  
 M  +2 -1      tests/kdirmodeltest.h  
 M  +54 -0     tests/kiotesthelper.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=927192
Comment 6 David Faure 2009-02-17 18:47:42 UTC
SVN commit 927501 by dfaure:

Don't offer to Overwrite "dir" with "file" when renaming "file" to "dir", it won't do it, offer the rename dialog for choosing another name.
BUG: 151851


 M  +11 -3     copyjob.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=927501