Fix new user creation
ClosedPublic

Authored by meven on Jan 29 2020, 5:54 PM.

Details

Summary

UserAdded was called only when other parameters were provided for a new user beside name and realname.
Which could not happen since 2471fa7d252de904b305dac77171fa300d66c05d and given the order the setData are called in accountinfo.cpp

Alternative to D26977

BUG: 416801
FIXED-IN: 5.18

Test Plan

Create a new user with a password
in a terminal su new_user

Diff Detail

Repository
R128 User Manager
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
meven created this revision.Jan 29 2020, 5:54 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJan 29 2020, 5:54 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
meven requested review of this revision.Jan 29 2020, 5:54 PM

I reached that same conclusion late last night (so in a sense ++++), and abandoned the other patch thinking I had everything understood.

But then I tried it and it didn't work.

meven added a comment.Jan 29 2020, 6:05 PM

I reached that same conclusion late last night (so in a sense ++++), and abandoned the other patch thinking I had everything understood.

But then I tried it and it didn't work.

Do you mean you tried the same as this patch and it does not fix the issue ?
Could you have mistyped your test user password, not entered a password in the UI ( currently in the password window you need to wait 400 ms before the ok is enabled and if you hit enter then, you hit cancel without a warning) ?

According to my testing and debugging, it fixes the issue.

I had deleted

if (m_newUserData.isEmpty()) {
        return true;
    }

which is effectively the same thing.

and I was catting /etc/shadow to see if it was blank or not as my test

Let me completely everything and retry with this. Maybe I had mixed up changes or something

davidedmundson accepted this revision.Jan 29 2020, 6:09 PM

Ignore my ramblings. Seems to work, and the logic makes sense

This revision is now accepted and ready to land.Jan 29 2020, 6:09 PM
This revision was automatically updated to reflect the committed changes.