Bug 337395

Summary: systemsettings hangs when changing full name, blocking on chfn which waits with a password prompt
Product: [Applications] systemsettings Reporter: JR <zorael>
Component: kcm_useraccountAssignee: Unassigned bugs mailing-list <unassigned-bugs>
Status: RESOLVED INTENTIONAL    
Severity: normal CC: aacid, zorael
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description JR 2014-07-12 12:11:15 UTC
[Arch x86_64]

systemsettings --version:
  Qt: 4.8.6
  KDE Development Platform: 4.13.2
  System Settings: 4.11.10

When applying changes to the user's full name under Account Details -> Password & User Account, a graphical password prompt is spawned, but the application freezes upon entering the password and hitting OK.

Reproducible: Always

Steps to Reproduce:
1. Open systemsettings, navigate to Account Details -> Password & User Account
2. Change full name
3. Hit Apply
4. Enter correct password in graphical prompt
Actual Results:  
5. Application hangs, has to be terminated

Expected Results:  
6. Name is changed, application control restored

A process tree shows the application having executed /usr/bin/chfn -f NewName.
>`-systemsettings,25207 --sync --nofork --nocrashhandler
>       `-chfn,25208,root -f NewName
The fields are [cmd, pid, transitioned uid, args], so note that it's been run as root without having specified the real account to modify.

A backtrace of the systemsettings process (http://pastebin.com/fk0SvL16) shows it waiting for said child process to finish:
#0  0x00007fa5dc4f0553 in select () from /usr/lib/libc.so.6
#1  0x00007fa5c0385536 in KDESu::PtyProcess::waitForChild() () from /usr/lib/libkdesu.so.5
#2  0x00007fa5c07d5f4d in ?? () from /usr/lib/kde4/kcm_useraccount.so
#3  0x00007fa5c07d8e42 in ?? () from /usr/lib/kde4/kcm_useraccount.so
#4  0x00007fa5dec8ec77 in KCModuleProxy::save() () from /usr/lib/libkcmutils.so.4
#5  0x00007fa5dea63e03 in ModuleView::moduleSave(KCModuleProxy*) () from /usr/lib/libsystemsettingsview.so.2

A backtrace of the chfn process shows it trying to read input:
#0  0x00007f348f4057a0 in __read_nocancel () from /usr/lib/libc.so.6
#1  0x00007f348f6d8881 in ?? () from /usr/lib/libpam_misc.so.0
#2  0x00007f348f6d8c90 in misc_conv () from /usr/lib/libpam_misc.so.0
#3  0x00007f348f8e2c90 in pam_vprompt () from /usr/lib/libpam.so.0
#4  0x00007f348f8e2eea in pam_prompt () from /usr/lib/libpam.so.0
#5  0x00007f348eb03e48 in ?? () from /usr/lib/security/pam_unix.so
#6  0x00007f348eb011f4 in pam_sm_authenticate () from /usr/lib/security/pam_unix.so
#7  0x00007f348f8dde1f in ?? () from /usr/lib/libpam.so.0
#8  0x00007f348f8dd6b0 in pam_authenticate () from /usr/lib/libpam.so.0

Forcefully killing the chfn process makes systemsettings give up with an error message:
>An error occured and your name probably has not been changed. The error message was:
>Password:

Conjecture: systemsettings spawns a chfn child process and waits for it to exit, but chfn waits reading the password from stdin, and we get a deadlock.
Comment 1 Albert Astals Cid 2015-09-26 13:32:14 UTC
Starting with Plasma 5.4 kcm_useraccount has been deprecated in favor of user-manager (you can run with kcmshell5 user_manager).

This means that unfortunately we did not get to fix your bug, sorry about that.

We encourage you to try user-manager and report any bug or improvement you may find. 

Sorry again for not fixing your bug and thanks for caring about KDE :)