Commit a59f0d75 authored by David Edmundson's avatar David Edmundson
Browse files

Port from GetSessionByPid

GetSessionByPid is broken especially when the calling process is in a
different cgroup to the session object.

Rather than using the magic "/auto" object path, calling GetSession with
the argument "auto" seems to work on even distros with old bases and is
the smallest code change.

BUG: 433364
parent 7ef4e506
......@@ -92,8 +92,8 @@ LogindIntegration::~LogindIntegration() = default;
void LogindIntegration::logindServiceRegistered()
{
// get the current session
QDBusMessage message = QDBusMessage::createMethodCall(s_login1Service, s_login1Path, s_login1ManagerInterface, QStringLiteral("GetSessionByPID"));
message.setArguments(QVariantList() << (quint32)QCoreApplication::applicationPid());
QDBusMessage message = QDBusMessage::createMethodCall(s_login1Service, s_login1Path, s_login1ManagerInterface, QStringLiteral("GetSession"));
message.setArguments({QStringLiteral("auto")});
QDBusPendingReply<QDBusObjectPath> session = m_bus.asyncCall(message);
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(session, this);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment