makedeb


kate-root 23.04.2-1


Advanced Text Editor, patched to be able to run as root

Viewing /0001-Defuse-root-block.patch.

View raw.

Click here to go back to the Git tree for kate-root.

diff --git a/apps/lib/kateapp.cpp b/apps/lib/kateapp.cpp
index d81e3372..859648ba 100644
--- a/apps/lib/kateapp.cpp
+++ b/apps/lib/kateapp.cpp
@@ -98,28 +98,6 @@ Q_LOGGING_CATEGORY(LOG_KATE, "kate", QtWarningMsg)
 
 void KateApp::initPreApplicationCreation(bool detach)
 {
-#if !defined(Q_OS_WIN) && !defined(Q_OS_HAIKU)
-    // Prohibit using sudo or kdesu (but allow using the root user directly)
-    if (getuid() == 0) {
-        setlocale(LC_ALL, "");
-        bindtextdomain("kate", KDE_INSTALL_FULL_LOCALEDIR);
-        if (!qEnvironmentVariableIsEmpty("SUDO_USER")) {
-            auto message = kli18n(
-                "Running this editor with sudo can cause bugs and expose you to security vulnerabilities. "
-                "Instead use this editor normally and you will be prompted for elevated privileges when "
-                "saving documents if needed.");
-            std::cout << dgettext("kate", message.untranslatedText()) << std::endl;
-            exit(EXIT_FAILURE);
-        } else if (!qEnvironmentVariableIsEmpty("KDESU_USER")) {
-            auto message = kli18n(
-                "Running this editor with kdesu can cause bugs and expose you to security vulnerabilities. "
-                "Instead use this editor normally and you will be prompted for elevated privileges when "
-                "saving documents if needed.");
-            std::cout << dgettext("kate", message.untranslatedText()) << std::endl;
-            exit(EXIT_FAILURE);
-        }
-    }
-#endif
 
     /**
      * enable dark mode for title bar on Windows