In Kate, Kwrite, Kdevelop, etc, if you try to save a file and you do not have permission, you will be prompted to authenticate an account that does. So, you can ‘save as root’.
On openSUSE distros, this is disabled. I see a question about this every week or so, but never quite enough details to fix it… so I’m posting a solution here. I hope this is helpful. This solution does get a little nerdy (creating and maintaining your own package, adding your repository, etc) so if that’s not for you, you might consider using the flatpak of the application instead.
Be aware that openSUSE do disable this for a reason, there are security concerns. They don’t mind if you have this feature, they just can’t say it’s safe to package up for everyone. Refer to the bug linked below for more info.
From the changelog (of the kf5 package):
on May 15 13:53:15 CEST 2017 -
- Revert upstream feature as disliked by the security team (boo#1033055)
- 0001-Revert-KAuth-integration-in-document-saving-vol.-2.patch
- 0002-Revert-KAuth-integration-in-document-saving.patch
The referenced bug: (please don’t make requests and spam the devs there, make a new bug if you want to discuss it… but don’t, because they know)
https://bugzilla.opensuse.org/show_bug.cgi?id=1033055
Thus endeth my disclaimers Pls don’t shoot the messenger.
The openSUSE package which needs to be patched to allow this is kf6-ktexteditor
. In the spec file, You need to add a build dependency on KF6Auth, change -DENABLE_KAUTH:BOOL=FALSE
to TRUE, and include the extra files. These two files (just these two, no other sources req’d) in a package on OBS (or locally) will do the trick:
_link
:
<link project="openSUSE:Factory" package="kf6-ktexteditor">
<patches>
<apply name="enable_kauth.patch" />
</patches>
</link>
enable_kauth.patch
:
Index: kf6-ktexteditor.spec
===================================================================
--- kf6-ktexteditor.spec (revision 10)
+++ kf6-ktexteditor.spec (revision 4)
@@ -41,6 +41,7 @@
BuildRequires: pkgconfig
BuildRequires: cmake(EditorConfig)
BuildRequires: cmake(KF6Archive) >= %{_kf6_bugfix_version}
+BuildRequires: cmake(KF6Auth) >= %{_kf6_bugfix_version}
BuildRequires: cmake(KF6Config) >= %{_kf6_bugfix_version}
BuildRequires: cmake(KF6GuiAddons) >= %{_kf6_bugfix_version}
BuildRequires: cmake(KF6I18n) >= %{_kf6_bugfix_version}
@@ -90,7 +91,7 @@
%build
%cmake_kf6 -DBUILD_QCH:BOOL=TRUE \
- -DENABLE_KAUTH:BOOL=FALSE
+ -DENABLE_KAUTH:BOOL=TRUE
%kf6_build
@@ -109,6 +110,11 @@
# TODO split
%dir %{_kf6_plugindir}/kf6/parts
%{_kf6_plugindir}/kf6/parts/katepart.so
+# KAuth files
+%_libexecdir/kf6/kauth/kauth_ktexteditor_helper
+%{_datadir}/dbus-1/system-services/org.kde.ktexteditor6.katetextbuffer.service
+%{_datadir}/dbus-1/system.d/org.kde.ktexteditor6.katetextbuffer.conf
+%{_datadir}/polkit-1/actions/org.kde.ktexteditor6.katetextbuffer.policy
%files -n libKF6TextEditor6
%license LICENSES/*
Note that trying this right now will fail, because KF6.10 is in QA. It’ll work again in a day or two when that snapshot is released.