kate:root

This commit is contained in:
Rmys
2018-10-18 23:31:07 +03:00
parent 7c2f1c4adc
commit 3b6487b3d5
3 changed files with 27 additions and 23 deletions
@@ -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 <file>" << 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
/**