Bug 459309

Summary: Unable to change user password
Product: [Applications] systemsettings Reporter: Dmitry Godlevskiy <jjhesrbhf>
Component: kcm_usersAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: major CC: kde, nate, notmart, rikmills, s_chriscollins, uhhadd
Priority: NOR Keywords: regression
Version: 5.25.5   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 5.24.7
Sentry Crash Report:

Description Dmitry Godlevskiy 2022-09-18 06:32:19 UTC
SUMMARY
***
I'm unable to change the current user's password using KDE users settings. When I press Set Password button - nothing is changed.
***


STEPS TO REPRODUCE
1. Open Users settings
2. Press Change Password
3. Input the new password and the confirmation
4. Press Set Password

OBSERVED RESULT
Nothing is changed. I can login using my old password

EXPECTED RESULT
I can login using the new password


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 5.19.9-arch1-1 (x64)
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.6

ADDITIONAL INFORMATION
Comment 1 Marc Guhr 2022-09-20 07:56:28 UTC
Your password may be too short, try to change it to the one you tried on the terminal with passwd
See my report https://bugs.kde.org/show_bug.cgi?id=459430
Comment 2 Dmitry Godlevskiy 2022-09-20 09:28:24 UTC
(In reply to Marc Guhr from comment #1)
> Your password may be too short, try to change it to the one you tried on the
> terminal with passwd
> See my report https://bugs.kde.org/show_bug.cgi?id=459430

Just tried the following:
1. Changed password using passwd
2. Tried to set it back using UI
3. Set it back using passwd

Still nothing is changed from UI settings but works with passwd. So it doesn't seem to be related to the password length
Comment 3 Nate Graham 2022-09-22 19:06:38 UTC
Can you run `systemsettings kcm_users` in a terminal window?

Then clear the scrollback with Ctrl+Shift+K.

Then change the password.

After that, please paste any new output in the terminal window into a comment here. Thanks!
Comment 4 Dmitry Godlevskiy 2022-09-22 20:30:33 UTC
(In reply to Nate Graham from comment #3)
> Can you run `systemsettings kcm_users` in a terminal window?
> 
> Then clear the scrollback with Ctrl+Shift+K.
> 
> Then change the password.
> 
> After that, please paste any new output in the terminal window into a
> comment here. Thanks!

No new output appeared. But I noticed the following error on first run, maybe it will help.

file:///usr/share/kpackage/kcms/kcm_users/contents/ui/UserDetailsPage.qml:345: ReferenceError: modelData is not defined
QFSFileEngine::open: No file name specified
kf.coreaddons.desktopparser: Error: Failed to open  ""
QFileDevice::seek: IODevice is not open
Comment 5 Nate Graham 2022-09-23 17:04:32 UTC
Darn. Thanks anyway.
Comment 7 Rik Mills 2022-09-26 06:35:04 UTC
Also confirmed on fresh install of the KDE Neon 22.04 preview
Comment 8 Nate Graham 2022-09-26 16:47:42 UTC
I wonder if an accountsservice regression might have caused this? I have version 0.6.55 in Fedora. What versions are affected folks using?
Comment 9 Rik Mills 2022-09-27 11:01:31 UTC
(In reply to Nate Graham from comment #8)
> I wonder if an accountsservice regression might have caused this? I have
> version 0.6.55 in Fedora. What versions are affected folks using?

22.07.5 it seems.

https://packages.ubuntu.com/jammy-updates/accountsservice

Downgrading accountsservice and libaccountsservice0 in the Neon Jammy 22.04 preview to the 0.6.55 from Focal, does seem to fix the issue.
Comment 10 Rik Mills 2022-09-27 11:31:33 UTC
(In reply to Rik Mills from comment #9)
> Downgrading accountsservice and libaccountsservice0 in the Neon Jammy 22.04
> preview to the 0.6.55 from Focal, does seem to fix the issue.

So does doing the same on Kubuntu 22.04
Comment 11 Nate Graham 2022-09-27 14:08:27 UTC
So it looks like there are two options here:
1. It was an unintentional regression in accountsservice that needs to be fixed
2. It was an intentional change in accountsservice (perhaps we were using the API wrong, or using deprecated API) and we need to adapt to it

Someone with accountsservice experience will need to investigate or bisect it.
Comment 12 Marco Martin 2022-09-28 09:10:16 UTC
It seems that when you try to change the password polkit doesn't ask for authentication and doesn't do anything.

if you do something else before, like changing the real name, it authenticates, and from  now on, changing the password will work.
Comment 13 Bug Janitor Service 2022-09-28 09:37:04 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2175
Comment 14 Marco Martin 2022-09-28 09:48:45 UTC
Git commit 48ccb433ca79e94ef705734d9cab599f01df97e8 by Marco Martin.
Committed on 28/09/2022 at 09:33.
Pushed by mart into branch 'master'.

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

M  +8    -3    kcms/users/src/user.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/48ccb433ca79e94ef705734d9cab599f01df97e8
Comment 15 Marco Martin 2022-09-28 09:51:43 UTC
Git commit 84dcfc45b9a354827b9bbf6ae58902d04e8fe915 by Marco Martin.
Committed on 28/09/2022 at 09:51.
Pushed by mart into branch 'Plasma/5.25'.

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

M  +8    -3    kcms/users/src/user.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/84dcfc45b9a354827b9bbf6ae58902d04e8fe915
Comment 16 Marco Martin 2022-09-28 09:52:01 UTC
Git commit 9043786def19940129c341a7c550aebe7406c6f5 by Marco Martin.
Committed on 28/09/2022 at 09:50.
Pushed by mart into branch 'Plasma/5.26'.

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

M  +8    -3    kcms/users/src/user.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/9043786def19940129c341a7c550aebe7406c6f5
Comment 17 Nate Graham 2022-09-28 13:57:51 UTC
Git commit b66f8019a3db00aa1e4e1c54d19f55c9cbff4d12 by Nate Graham, on behalf of Marco Martin.
Committed on 28/09/2022 at 13:57.
Pushed by ngraham into branch 'Plasma/5.24'.

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


(cherry picked from commit 48ccb433ca79e94ef705734d9cab599f01df97e8)

M  +8    -3    kcms/users/src/user.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/b66f8019a3db00aa1e4e1c54d19f55c9cbff4d12
Comment 18 Marc Guhr 2022-10-01 15:15:23 UTC
*** Bug 459430 has been marked as a duplicate of this bug. ***
Comment 19 Dmitry Godlevskiy 2022-10-11 10:41:57 UTC
Still doesn't work in 5.25.5. It looks like the fix wasn't merged

https://invent.kde.org/plasma/plasma-workspace/-/blob/v5.25.5/kcms/users/src/user.cpp
Comment 20 Rik Mills 2022-10-11 11:11:41 UTC
(In reply to Dmitry Godlevskiy from comment #19)
> Still doesn't work in 5.25.5. It looks like the fix wasn't merged
> 
> https://invent.kde.org/plasma/plasma-workspace/-/blob/v5.25.5/kcms/users/src/
> user.cpp

The fix was commited to the 5.25 branch, but as 5.25 will not get any more releases it is up to distros to apply the patch to 5.25.5
Comment 21 Dmitry Godlevskiy 2022-10-11 11:21:54 UTC
(In reply to Rik Mills from comment #20)
> (In reply to Dmitry Godlevskiy from comment #19)
> > Still doesn't work in 5.25.5. It looks like the fix wasn't merged
> > 
> > https://invent.kde.org/plasma/plasma-workspace/-/blob/v5.25.5/kcms/users/src/
> > user.cpp
> 
> The fix was commited to the 5.25 branch, but as 5.25 will not get any more
> releases it is up to distros to apply the patch to 5.25.5

Ah okay, thanks