Merge pull request #5919 from Rmys/master

kate:root
This commit is contained in:
Rmys
2018-10-18 23:32:10 +03:00
committed by GitHub
3 changed files with 27 additions and 23 deletions
@@ -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 <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
/**
@@ -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
/**
+3 -3
View File
@@ -34,8 +34,8 @@
<Dependency>kded-devel</Dependency>
</BuildDependencies>
<Patches>
<!--Patch level="1">kate-17.04.0-allow-root.patch</Patch>
<Patch level="1">kwrite-17.04.0-allow-root.patch</Patch-->
<Patch level="1">kate-17.04.0-allow-root.patch</Patch>
<Patch level="1">kwrite-17.04.0-allow-root.patch</Patch>
</Patches>
</Source>
@@ -88,7 +88,7 @@
<Update release="21">
<Date>2018-10-18</Date>
<Version>18.08.2</Version>
<Comment>Version bump.</Comment>
<Comment>Version bump</Comment>
<Name>Mustafa Cinasal</Name>
<Email>muscnsl@gmail.com</Email>
</Update>