Bug 320142

Summary: kate/kwrite refuse to overwrite writeable file in a read only directory
Product: [Applications] kate Reporter: Deri James <deri>
Component: applicationAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Mageia RPMs   
OS: Linux   
Latest Commit: Version Fixed In:

Description Deri James 2013-05-22 18:00:23 UTC
If you edit a file for which you have write permissions in a directory you don't have write permission, you cannot save the changes. Kate 4.10.2. In previous versions this was possible although a warning would be given about inability to create a backup (i.e. "file.txt~"), the option to try to save "file.txt" would succeed.

Reproducible: Always

Steps to Reproduce:
mkdir ro
chmod u=rwx ro             # Directory is writeable
echo "Read" > ro/file.txt # Create file.txt in ro directory
chmod u=rw ro/file.txt    # Ensure file is writable
chmod u-w ro                 # Remove write access to directory ro
kwrite ro/file.txt

Edit file and then save.
Actual Results:  
Error received:-

The document could not be saved, as it was not possible to write to /home/derij/ro/file.txt.
Check that you The document could not be saved, as it was not possible to write to /home/derij/ro/file.

Check that you have write access to this file or that enough disk space is available.have write access to this file or that enough disk space is available.

(Enough disk space is available)

Expected Results:  
It should warn that backup file "ro/file.txt~" cannot be created but give an option to attempt to save "ro/file.txt" which would succeed.

 kwrite --version
Qt: 4.8.4
KDE Development Platform: 4.10.2
KWrite: 4.10.2

Same behaviour is seen in kate as well.
Comment 1 Deri James 2013-05-22 22:37:42 UTC
A little hunting in the code shows this has been fixed in 4.10.3, sorry for the noise!

*** This bug has been marked as a duplicate of bug 312415 ***