Guest User

dolhin-root

a guest
Jun 10th, 2019
135
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --- a/src/dolphinviewcontainer.cpp
  2. +++ b/src/dolphinviewcontainer.cpp
  3. @@ -108,14 +108,6 @@
  4. m_messageWidget->setCloseButtonVisible(true);
  5. m_messageWidget->hide();
  6.  
  7. -#ifndef Q_OS_WIN
  8. - if (getuid() == 0) {
  9. -
  10. - // We must be logged in as the root user; show a big scary warning
  11. - showMessage(i18n("Running Dolphin as root can be dangerous. Please be careful."), Warning);
  12. - }
  13. -#endif
  14. -
  15. m_view = new DolphinView(url, this);
  16. connect(m_view, &DolphinView::urlChanged,
  17. m_urlNavigator, &KUrlNavigator::setLocationUrl);
  18. --- a/src/main.cpp
  19. +++ b/src/main.cpp
  20. @@ -35,26 +35,8 @@
  21. #include <QApplication>
  22. #include <QCommandLineParser>
  23.  
  24. -#ifndef Q_OS_WIN
  25. -#include <unistd.h>
  26. -#endif
  27. -#include <iostream>
  28. -
  29. extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv)
  30. {
  31. -#ifndef Q_OS_WIN
  32. - // Prohibit using sudo or kdesu (but allow using the root user directly)
  33. - if (getuid() == 0) {
  34. - if (!qEnvironmentVariableIsEmpty("SUDO_USER")) {
  35. - std::cout << "Executing Dolphin with sudo is not possible due to unfixable security vulnerabilities." << std::endl;
  36. - return EXIT_FAILURE;
  37. - } else if (!qEnvironmentVariableIsEmpty("KDESU_USER")) {
  38. - std::cout << "Executing Dolphin with kdesu is not possible due to unfixable security vulnerabilities." << std::endl;
  39. - return EXIT_FAILURE;
  40. - }
  41. - }
  42. -#endif
  43. -
  44. QApplication app(argc, argv);
  45. app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
  46. app.setWindowIcon(QIcon::fromTheme(QStringLiteral("system-file-manager"), app.windowIcon()));
RAW Paste Data