Bug 347942 - Minimum and maximum user ids are not saved
Summary: Minimum and maximum user ids are not saved
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_sddm (show other bugs)
Version: 5.3.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: David Edmundson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-19 11:26 UTC by Wolfgang Bauer
Modified: 2015-09-12 13:10 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.4.2
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Bauer 2015-05-19 11:26:01 UTC
If you change the minimum or maximum user id to be displayed on the sddm greeter, the setting is not saved to /etc/sddm.conf at all.

A manually added "MinimumUid" or "MaximumUid" option will be shown correctly in the KCM though.

Reproducible: Always

Steps to Reproduce:
1. Open the SDDM configuration module in systemsettings or via "kcmshell5 sddm"
2. Change "Minimum UID" and/or "Maximum UID" on the "Advanced" tab
3. Click on "OK" or "Apply" and enter the root password

Actual Results:  
The corresponding options are not added to the sddm config file, so sddm still shows the default users.

Expected Results:  
sddm.conf should contain "MinimumUid=x" and "MaximumUid=y" in the "[Users]" section.

Other settings (like the theme) are saved correctly, so it shouldn't be an installation issue.
Comment 1 Hrvoje Senjan 2015-05-26 17:36:45 UTC
bool AdvanceConfig::isUidRangeValid(int minUid, int maxUid) const
{
    if (minUid < MIN_UID || minUid > maxUid)
        return false;
    
    return true;
}
 
const int MIN_UID = 1000;
const int MAX_UID = 65000;

i guess the defines are somehow defeating the purpose of the ability to change allowed UID's ;-)
Comment 2 Wolfgang Bauer 2015-09-12 11:35:43 UTC
Right, the Uids are just not saved when you try to lower the MinimumId. (If you raise the MinimumId, the KCM crashes when saving, but I'll report this separately)

I would propose to change the test from minUid < MIN_UID to minUid < 0.

Especially on older systems (or systems upgraded for years), the actual user id might be below 1000. E.g. on my openSUSE system here, my standard user has an id of 500 (was the default years ago).
SDDM accepts them just fine, so why should the user not be allowed to set them?

https://git.reviewboard.kde.org/r/125191/
Comment 3 Wolfgang Bauer 2015-09-12 13:10:43 UTC
Git commit 9afb3c627bb43969edf1a9bbe83b2107e002eb4f by Wolfgang Bauer.
Committed on 12/09/2015 at 13:08.
Pushed by wbauer into branch 'Plasma/5.4'.

Allow to set minimum user id lower than 1000

Allow to set a minimum user id lower than 1000. Especially on older
systems (and/or systems upgraded since years), the user ids might be
below 1000 (e.g. on openSUSE, 500+ was the default for normal users
years ago).
FIXED-IN: 5.4.2
REVIEW: 125191

M  +1    -1    src/advanceconfig.cpp

http://commits.kde.org/sddm-kcm/9afb3c627bb43969edf1a9bbe83b2107e002eb4f