Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Avoid using integer identifiers in install script #4346

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

matthewbauer
Copy link
Member

A common issue in multi-user installation is that a group with id
30000 or a user with 30001+ already exists. We don’t have either of
these reserved so any other package could also use these values,
causing conflicts.

  • We don’t need to know up front what UID or GID to use for Linux’s
    adduser. Leaving this blank will result in adduser finding an open id
    in SYS_UID_MIN, SYS_UID_MAX for uid and SYS_GID_MIN, SYS_GID_MAX for
    gid. In addition, --gid accepts the group name, no need for an
    integer.

  • For macOS’s dscl, we do need unique uids and gids up front. We can
    figure these out by finding the greatest [ug]id allocated & adding 1.
    Nothing else requires us to know what the id is.

Nix doesn’t appear to have any requirements that identifiers be
consecutive. Each nixbldN can be any value in UID_MIN, UID_MAX.

A common issue in multi-user installation is that a group with id
30000 and a user with 30001+ already exists. We don’t have either of
these reserved so any other package could also use these values,
causing conflicts.

- We don’t need to know up front what UID or GID to use for Linux’s
adduser. Leaving this blank will result in adduser finding an open id
in SYS_UID_MIN, SYS_UID_MAX for uid and SYS_GID_MIN, SYS_GID_MAX for
gid. In addition, --gid accepts the group name, no need for an
integer.

- For macOS’s dscl, we do need unique uids and gids up front. We can
figure these out by finding the greatest [ug]id allocated & adding 1.
Nothing else requires us to know what the id is.

Nix doesn’t appear to have any requirements that identifiers be
consecutive. Each nixbldN can be any value in UID_MIN, UID_MAX.
@abathur
Copy link
Member

abathur commented Feb 7, 2021

Some unknown subset of Big Sur versions might have complicated this.

You can see more in #4531 and #4532, (and in #nix-darwin logs this past week) but TL;DR: it looks like we may need to stay between UID 200-400 on macOS, so it isn't sufficient to just start at the max current.

I wrote a migration script for existing users which has at least at first swing at this (though it's probably a bit time-wasteful to use as-is

@stale
Copy link

stale bot commented Aug 7, 2021

I marked this as stale due to inactivity. → More info

@Ericson2314
Copy link
Member

@matthewbauer What exactly was WIP about this? Were you waiting on review of the concept to finish?

@stale stale bot removed the stale label Jun 14, 2023
@matthewbauer
Copy link
Member Author

I think the main thing left was review and some kind of testing. I think CI has a pretty good test of the install script now?

@Ericson2314
Copy link
Member

Ericson2314 commented Jun 14, 2023

I am not too familiar with it, but yeah there is some sort of VM tests.

@abathur
Copy link
Member

abathur commented Jun 17, 2023

There are at least 2 types:

@Ericson2314
Copy link
Member

With the testing situation pretty good, you interested in finishing this @matthewbauer?

@Ericson2314 Ericson2314 marked this pull request as draft June 22, 2023 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Friday Hacking Extravaganza
UX
To discuss
Development

Successfully merging this pull request may close these issues.

None yet

4 participants