summaryrefslogtreecommitdiffstats
path: root/source/kde/kde/patch/plasma-workspace/48ccb433ca79e94ef705734d9cab599f01df97e8.patch
blob: 163ca16d3216b6068dbff9417c3f414ac016b8a8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From 48ccb433ca79e94ef705734d9cab599f01df97e8 Mon Sep 17 00:00:00 2001
From: Marco Martin <notmart@gmail.com>
Date: Wed, 28 Sep 2022 11:33:33 +0200
Subject: [PATCH] set setInteractiveAuthorizationAllowed on SetPassword call

is important that the setpasswod call uses interactive authorization,
otherwise will be denied, unless the user had been modified beforehand
so an authorization was already granted

BUG:459309
---
 kcms/users/src/user.cpp | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/kcms/users/src/user.cpp b/kcms/users/src/user.cpp
index a28d6b713a..909170d008 100644
--- a/kcms/users/src/user.cpp
+++ b/kcms/users/src/user.cpp
@@ -225,9 +225,14 @@ void User::setPassword(const QString &password)
 {
     // Blocking because we need to wait for the password to be changed before we
     // can ask the user about also possibly changing their KWallet password
-    auto invocation = m_dbusIface->SetPassword(saltPassword(password), QString());
-    invocation.waitForFinished();
-    if (!invocation.isError()) {
+
+    auto mc = QDBusMessage::createMethodCall(m_dbusIface->service(), m_dbusIface->path(), m_dbusIface->interface(), "SetPassword");
+    mc.setArguments({saltPassword(password), QString()});
+    mc.setInteractiveAuthorizationAllowed(true);
+    auto message = QDBusConnection::systemBus().call(mc);
+
+    // Not an error or invalid message
+    if (message.type() == QDBusMessage::ReplyMessage) {
         Q_EMIT passwordSuccessfullyChanged();
     }
 }
-- 
GitLab