diff --git a/desktop/kde/applications/kate/files/kate-17.04.0-allow-root.patch b/desktop/kde/applications/kate/files/kate-17.04.0-allow-root.patch index 55bf29f38a..69104f7503 100755 --- a/desktop/kde/applications/kate/files/kate-17.04.0-allow-root.patch +++ b/desktop/kde/applications/kate/files/kate-17.04.0-allow-root.patch @@ -1,7 +1,7 @@ - ---- a/kate/main.cpp -+++ b/kate/main.cpp -@@ -51,24 +51,9 @@ +diff -Nuar a/kate/main.cpp b/kate/main.cpp +--- a/kate/main.cpp 2018-10-03 20:00:34.000000000 +0300 ++++ b/kate/main.cpp 2018-10-13 09:30:25.415054269 +0300 +@@ -52,26 +52,9 @@ #include "qtsingleapplication/qtsingleapplication.h" #endif @@ -14,13 +14,15 @@ int main(int argc, char **argv) { -#ifndef Q_OS_WIN -- /** -- * Check whether we are running as root -- **/ +- // Prohibit using sudo or kdesu (but allow using the root user directly) - if (getuid() == 0) { -- std::cout << "Executing Kate as root is not possible. To edit files as root use:" << std::endl; -- std::cout << "SUDO_EDITOR=kate sudoedit " << std::endl; -- return 0; +- if (!qEnvironmentVariableIsEmpty("SUDO_USER")) { +- std::cout << "Executing Kate with sudo is not possible due to unfixable security vulnerabilities." << std::endl; +- return EXIT_FAILURE; +- } else if (!qEnvironmentVariableIsEmpty("KDESU_USER")) { +- std::cout << "Executing Kate with kdesu is not possible due to unfixable security vulnerabilities." << std::endl; +- return EXIT_FAILURE; +- } - } -#endif /** diff --git a/desktop/kde/applications/kate/files/kwrite-17.04.0-allow-root.patch b/desktop/kde/applications/kate/files/kwrite-17.04.0-allow-root.patch index 09f9e1df80..cc31a24700 100755 --- a/desktop/kde/applications/kate/files/kwrite-17.04.0-allow-root.patch +++ b/desktop/kde/applications/kate/files/kwrite-17.04.0-allow-root.patch @@ -1,7 +1,7 @@ - ---- a/kwrite/main.cpp -+++ b/kwrite/main.cpp -@@ -42,23 +42,8 @@ +diff -Nuar a/kwrite/main.cpp b/kwrite/main.cpp +--- a/kwrite/main.cpp 2018-10-03 20:00:34.000000000 +0300 ++++ b/kwrite/main.cpp 2018-10-13 09:31:37.316058274 +0300 +@@ -42,25 +42,8 @@ #include "../urlinfo.h" @@ -13,13 +13,15 @@ extern "C" Q_DECL_EXPORT int main(int argc, char **argv) { -#ifndef Q_OS_WIN -- /** -- * Check whether we are running as root -- **/ +- // Prohibit using sudo or kdesu (but allow using the root user directly) - if (getuid() == 0) { -- std::cout << "Executing KWrite as root is not possible. To edit files as root use:" << std::endl; -- std::cout << "SUDO_EDITOR=kwrite sudoedit " << std::endl; -- return 0; +- if (!qEnvironmentVariableIsEmpty("SUDO_USER")) { +- std::cout << "Executing Kate with sudo is not possible due to unfixable security vulnerabilities." << std::endl; +- return EXIT_FAILURE; +- } else if (!qEnvironmentVariableIsEmpty("KDESU_USER")) { +- std::cout << "Executing Kate with kdesu is not possible due to unfixable security vulnerabilities." << std::endl; +- return EXIT_FAILURE; +- } - } -#endif /** diff --git a/desktop/kde/applications/kate/pspec.xml b/desktop/kde/applications/kate/pspec.xml index a59d6a1566..f90cf5a26e 100755 --- a/desktop/kde/applications/kate/pspec.xml +++ b/desktop/kde/applications/kate/pspec.xml @@ -34,8 +34,8 @@ kded-devel - + kate-17.04.0-allow-root.patch + kwrite-17.04.0-allow-root.patch @@ -88,7 +88,7 @@ 2018-10-18 18.08.2 - Version bump. + Version bump Mustafa Cinasal muscnsl@gmail.com