Hi! I suppose you already know that, but I haven't found a bug about it: In previous versions of Plasma, if the user executed kdesudo kate FILE and saved the file, then the owner and group of FILE were respected. However, nowadays the owner and group of FILE end up being "root". Note: The operating system is Kubuntu 16.04 and in <https://bugs.launchpad.net/kdesudo/+bug/1430761/comments/2> Jonathan Riddell wrote that "kdesudo has moved to KDE infrastructure. If you feel your bug is still relevant please open a new bug on bugs.kde.org", so I'm writing here. Thanks for all! Reproducible: Always Steps to Reproduce: 1. Execute: kdesudo kate FILE 2. Write something, save FILE Actual Results: See that the owner and the group of FILE are "root". Expected Results: It was expected that the owner and the group of FILE were the same as they were before. This was the behavior in the prior Kubuntu LTS version (14.04), and the previous ones.
If the file is not owned by root, why are you using a root account to edit it?
For example some files are scripts in /usr/local/bin, scripts owned by root, but with a group that is not root; if those files are edited with kdesudo kate, then the group is not respected (and so the group of those files ends up being root, too).
I got the similar problem. I created the file from PHP, owner "www-data", access mode "0644". Then I open it in Kate under my account (user: Vijit, sudoers group, inter alia). Inspite of I haven't access to write, I can do it in Kate! And after saving the changes the owner of this file changes too. It become "vijit". I suppose, Kate creates the backup file (*.kate-swp) with owner of me, of course, and then changes the original one on saving. So, I believe, we got an access violation here.
Changing to confirmed per comment 3
This is a duplicate of bug #333577. If you want to edit files as root, please follow: https://blog.martin-graesslin.com/blog/2017/02/editing-files-as-root/ In short, use: SUDO_EDITOR=kwrite sudoedit <file> Commit: https://cgit.kde.org/kate.git/commit/?id=9adcebd3c2e476c8a32e9b455cc99f46b0e12a7e Discussion: git.net/ml/kwrite-devel/2016-01/msg00011.html Of course, in general, the problem with changing file owner still exists, see duplicate report. *** This bug has been marked as a duplicate of bug 333577 ***