From 27462bcddb2500769751352c48cbe305d3ce2be4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Sun, 10 Dec 2017 18:08:28 +0000 Subject: [PATCH] Remove workaround to access user dbus session as root. --- src/core/operationrunner.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/core/operationrunner.cpp b/src/core/operationrunner.cpp index 01771c7..092e8f4 100644 --- a/src/core/operationrunner.cpp +++ b/src/core/operationrunner.cpp @@ -50,15 +50,6 @@ void OperationRunner::run() bool status = true; // Disable Plasma removable device automounting - unsigned int currentUid = getuid(); // 0 if running as root - char *login = getlogin(); - if (login != nullptr){ - passwd* pwnam = getpwnam(login); - if (pwnam != nullptr) { - unsigned int userId = pwnam->pw_uid; // uid of original user before sudo - seteuid(userId); - } - } QStringList modules; QDBusConnection bus = QDBusConnection::connectToBus(QDBusConnection::SessionBus, QStringLiteral("sessionBus")); QDBusInterface kdedInterface( QStringLiteral("org.kde.kded5"), QStringLiteral("/kded"), QStringLiteral("org.kde.kded5"), bus ); @@ -69,7 +60,6 @@ void OperationRunner::run() bool automounter = modules.contains(automounterService); if (automounter) kdedInterface.call( QStringLiteral("unloadModule"), automounterService ); - seteuid(currentUid); for (int i = 0; i < numOperations(); i++) { suspendMutex().lock();