kate-17.04.0-allow-root.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. diff -Nuar a/apps/kate/main.cpp b/apps/kate/main.cpp
  2. --- a/apps/kate/main.cpp 2022-09-04 17:28:00.000000000 +0300
  3. +++ b/apps/kate/main.cpp 2022-09-24 14:34:46.081798927 +0300
  4. @@ -37,31 +37,9 @@
  5. #include "SingleApplication/SingleApplication"
  6. -#ifndef Q_OS_WIN
  7. -#include <unistd.h>
  8. -#endif
  9. -#include <iostream>
  10. -
  11. int main(int argc, char **argv)
  12. {
  13. -#if !defined(Q_OS_WIN) && !defined(Q_OS_HAIKU)
  14. - // Prohibit using sudo or kdesu (but allow using the root user directly)
  15. - if (getuid() == 0) {
  16. - if (!qEnvironmentVariableIsEmpty("SUDO_USER")) {
  17. - std::cout << "Running Kate with sudo can cause bugs and expose you to security vulnerabilities. "
  18. - "Instead use Kate normally and you will be prompted for elevated privileges when "
  19. - "saving documents if needed."
  20. - << std::endl;
  21. - return EXIT_FAILURE;
  22. - } else if (!qEnvironmentVariableIsEmpty("KDESU_USER")) {
  23. - std::cout << "Running Kate with kdesu can cause bugs and expose you to security vulnerabilities. "
  24. - "Instead use Kate normally and you will be prompted for elevated privileges when "
  25. - "saving documents if needed."
  26. - << std::endl;
  27. - return EXIT_FAILURE;
  28. - }
  29. - }
  30. -#endif
  31. +
  32. /**
  33. * init resources from our static lib
  34. */