Bug 343158 - Kate ignores umask when creating new (local) files
Summary: Kate ignores umask when creating new (local) files
Alias: None
Product: kate
Classification: Applications
Component: application (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
Depends on:
Reported: 2015-01-22 14:25 UTC by Samu Juvonen
Modified: 2015-07-26 12:49 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Note You need to log in before you can comment on or make changes to this bug.
Description Samu Juvonen 2015-01-22 14:25:09 UTC
For new files, Kate seems to ignore umask for 'group' and 'other', i.e. it follows it only for file owner. Perms are always set to *00 regardless of umask. Only the file owner perms are set according to umask value. 

This bug appeared since upgrading to KDE Apps 14.12.

Reproducible: Always

Steps to Reproduce:
1. Create new file in Kate
2. Save file onto disk
3. Check file permissions

Actual Results:  
New files are always chmod'd to *00.

Expected Results:  
File perms should probably follow umask.
Comment 1 Michal Humpula 2015-02-17 19:14:41 UTC
This is a problem with current implementation using QSaveFile to write data. That one is using QTemporaryFile and that one is forcing new file to be created with 0600 rights, which makes sense for temporary file.

There is no way I can see to tell the QTemporaryFile(Engine) to create file with different rights. So the only way IMHO to circumvent this would to compute the correct rights after the KTE is trought saving.
Comment 2 Michal Humpula 2015-02-17 21:37:21 UTC
Comment 3 Christoph Cullmann 2015-07-26 12:49:40 UTC
Git commit 3999d5678ad41c0b5a9b2f24147591dc5e1e7321 by Christoph Cullmann.
Committed on 26/07/2015 at 12:48.
Pushed by cullmann into branch 'master'.

obey umask rules when saving new file

REVIEW: 122612

M  +18   -3    src/buffer/katetextbuffer.cpp