Check if sddm user exists
ClosedPublic

Authored by filipf on Aug 23 2019, 2:59 PM.

Details

Summary

Sddm-kcm should depend on sddm.
Sddm sets up an sddm user which is used to run the greeter.
Therefore it should not be possible to run sddm-kcm without an sddm user existing.

But if it should happen that's the case, this patch adds a check for the sddm user.
If the user is not present, everything will be aborted and an error message will pop-up.

openSUSE BUG:

Test Plan

changed line QString sddmHomeDirPath = KUser("sddm").homeDir(); to look up some bogus user
syncing and resetting is aborted, error message pops up

Diff Detail

Repository
R123 SDDM Configuration Panel (KCM)
Branch
sddm-user-check (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 15542
Build 15560: arc lint + arc unit
filipf created this revision.Aug 23 2019, 2:59 PM
Restricted Application added a project: Plasma. · View Herald TranscriptAug 23 2019, 2:59 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
filipf requested review of this revision.Aug 23 2019, 2:59 PM

Whilst client checks are nice, for the reason you're changing it this should (also?) be in the authhelper.

filipf edited the summary of this revision. (Show Details)Aug 23 2019, 3:01 PM
filipf edited the test plan for this revision. (Show Details)
filipf added reviewers: Plasma, davidedmundson, ngraham, VDG.
filipf updated this revision to Diff 64428.Aug 23 2019, 3:17 PM
filipf edited the summary of this revision. (Show Details)

also apply the check for the auth helper

filipf updated this revision to Diff 64429.Aug 23 2019, 3:26 PM

add qDebug info in auth helper

How about refactoring this "does SDDM user exist?" check into a function so we don't have to write virtually the same code three times?

davidedmundson added inline comments.Aug 23 2019, 3:52 PM
sddmauthhelper.cpp
79

can we use sddmHomeDirPath + "whatever"

instead now

and get rid of this sddmUserConfig map entry

170

and here

filipf updated this revision to Diff 65000.Aug 30 2019, 2:25 PM

Rebase on master

How about refactoring this "does SDDM user exist?" check into a function so we don't have to write virtually the same code three times?

I would need help with this. If someone can speed things up feel free to commandeer the revision.

ngraham accepted this revision.Sep 19 2019, 7:46 PM

On second look, given that each one does actually do slightly different things, I rescind my request. Since this contains no new translated strings, let's land it on the 5.17 branch.

This revision is now accepted and ready to land.Sep 19 2019, 7:46 PM
filipf updated this revision to Diff 66544.Sep 20 2019, 3:10 PM

Address David's comment, remove one entry from the map

filipf added a comment.Oct 2 2019, 7:37 PM

Gonna land this in 24hrs if there are no objections.

This revision was automatically updated to reflect the committed changes.