Bug 470222

Summary: kate is unable to view/open files owned by root nor does it prompt for password when trying to save a root owned file
Product: [Applications] kate Reporter: imthenachoman
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: normal CC: imthenachoman
Priority: NOR    
Version First Reported In: 23.04.1   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description imthenachoman 2023-05-24 17:15:56 UTC
SUMMARY

From what I have read, there are two ways to have `kate` open/edit root files but neither of them work.

1. `SUDO_EDITOR=kate sudoedit <file>` => Will open a blank file, that does not have the contents of `<file>`. In fact, terminal spits out the message `<file> unchanged` even before I exit kate.
2. `kate <file>` > save > enter password => Does not prompt for the password.

If I try to `kate <file>` from a root terminal session, it spits out this message:

> THIS IS POTENTIALLY INSECURE!
> To edit files as root please use:
> SUDO_EDITOR=kwrite sudoedit <file>

According to https://www.reddit.com/r/kde/comments/bagrhp/how_to_save_file_as_root_with_kate_with_password/ this was disabled a few years ago but bugs/features for this were closed so I assume it should work. But it still doesn't.

From what I can gather, this is some sort of bug. I just don't know where. I can't tell if this is an issue with KDE or with openSUSE.

STEPS TO REPRODUCE
covered above

OBSERVED RESULT
covered above

EXPECTED RESULT
covered above

SOFTWARE/OS VERSIONS
OS: Linux openSUSE Tumbleweed 20230522
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.106.0
Qt Verson: 5.15.9
Kernel Version: 6.3.2-1-default (64-bit)
Graphics Platform: Wayland
Comment 1 imthenachoman 2023-05-24 17:19:03 UTC
I forgot to add, for #2, it gives the following error:

> The document could not be saved, as it was not possible to write to <file>.
> Check that you have write access to this file or that enough disk space is available.
> The original file may be lost or damaged. Don't quit the application  until the file is successfully written.