WIP: Avoid using integer identifiers in install script #4346
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.