Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Add min_uid and max_uid configuration values. #498

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JOT85
Copy link

@JOT85 JOT85 commented Apr 23, 2024

aad-auth assigns users to UIDs which are too large for some common software.

There are many reports of this problem, notably relating to xdg-desktop-portal-gnome not working:

Adding a min_uid and max_uid configuration option allows the user to specify the range in which UIDs should be generated, thereby enabling admins to cap the UIDs at a range which works with most software.

To prevent existing installations from changing their behaviour, the default values, when the parameters aren't specified in the configuration file, remain at 100000 and math.MaxUint32, however the config template now explicitly sets the values to values which play nicely with xdg-desktop-portal-gnome, in an attempt to give new users a better experience.

Also, when a collision is found, instead of only incrementing the UID, which may overflow and end up as UID 0 (root!!!), we instead wrap around only within the specified range.

aad-auth assigns users to UIDs which are too large for some common software.

There are many reports of this problem, notably relating to
xdg-desktop-portal-gnome not working:

- In ubuntu#278, screensharing does not work
  because the portal is not loaded.
  - We have also had this problem.
- In ubuntu#200, applications take
  excessively long to open.
  - We have experienced this issue with a variety of apps, including the
    nmapplet, gnome-terminal, and chromium.
- In ubuntu#441 brings up exactly this issue,
  but hasn't had a response.

Adding a `min_uid` and `max_uid` configuration option allows the user to specify
the range in which UIDs should be generated, thereby enabling admins to cap the
UIDs at a range which works with most software.

To prevent existing installations from changing their behaviour, the default
values, when the parameters aren't specified in the configuration file, remain
at `100000` and `math.MaxUint32`, however the config template now explicitly
sets the values to values which play nicely with xdg-desktop-portal-gnome, in an
attempt to give new users a better experience.

Also, when a collision is found, instead of only incrementing the UID, which may
overflow and end up as UID 0 (root!!!), we instead wrap around only within the
specified range.
@JOT85 JOT85 requested a review from a team as a code owner April 23, 2024 14:35
Copy link

Hey! JOT85 has not signed the Canonical CLA which is required to get this contribution merged on this project.

Please head over to https://ubuntu.com/legal/contributors to read more about it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant