SUMMARY KWrite refuses to run with sudo, and claims in the output that it is "not necessary", because the user will be prompted for elevated permissions when they want to save the file. But what if permissions prevent KWrite from opening the file in the first place? There is no prompt for elevated permissions in this case, nor is there an error message, and KWrite shows an untruth: a blank document. STEPS TO REPRODUCE 1. Try to open a file to which you HAVE the r permission, but DON'T have the x permission for its containing directory (e.g. another user's .ssh/id_rsa.pub) OBSERVED RESULT No prompt for elevated permissions, no error message, blank document. An attempt to save the document _does_ prompt for privilege elevation, resulting in a risk of overwriting the file without even having seen its contents first. EXPECTED RESULT The mechanism for permission elevation should be implemented for opening files too. SOFTWARE/OS VERSIONS Operating System: Arch Linux KDE Plasma Version: 5.23.5 KDE Frameworks Version: 5.90.0 Qt Version: 5.15.2 Kernel Version: 5.16.2-zen1-1-zen (64-bit) Graphics Platform: X11 Processors: 8 × AMD FX(tm)-8320 Eight-Core Processor Memory: 15.6 GiB of RAM Graphics Processor: NVIDIA GeForce GTX 960/PCIe/SSE2
Bitten by this again. This issue is an Intercontinental Ballistic Footgun. There MUST be SOME indication of a problem when I try to OPEN a file to which I don't have read access and get a blank buffer. Current behavior is DANGEROUS.
As of 2023.04.3 there is an in-window notification about insufficient permissions to read the file. This is better than no warning at all, but I still think that proper permission elevation should be supported.
An error is now there, but it would be nicer to not have only elevated rights for saving.
*** Bug 496837 has been marked as a duplicate of this bug. ***
I can reproduce on Fedora 41. For what it's worth, there also does not appear to be an error message if Kate is launched from the command line in the situation described above (or when you have neither read to the file nor execute to the directory, like in /boot/grub2 on Fedora), as opposed to trying to open from within the Kate GUI.