-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support/scripts/mkusers: allow option for system uid/gid
Some software decides based on uid/gid whether a user is a system or normal (human) user, with different behaviour for those flavors (example journald [2]). So adding logic to create system-users is necessary, we take the now common ranges from [1]. This extends the mkusers script to allow -2 for uid/gid, this argument will take an identifier from the user range. All identifiers used up to now should have been from the system range, so -1 is now interpreted as a system user/group. Note that after this commit, all the UIDs and GIDs that are created automatically (with -1) will change. That means if there is peristent data on an existing system that was created by such an automatic user, it will suddenly belong to a different user. However, this could already happen before: if a USERS line is added to a package, then other UIDs may change as well. Add system/user ranges as variables, and the argument for user/system uid variable as well. Thus some magic constants could be removed, some further occurences of -1 were replaced with equivalent logic. For consistency, the existing MIN/MAX_UID/GID variables are renamed to FIRST/LAST_USER_UID/GID. Update the documentation with the new automatic ranges. [1] - https://systemd.io/UIDS-GIDS/ [2] - https://www.freedesktop.org/software/systemd/man/journald.conf.html Signed-off-by: Norbert Lange <[email protected]> [Arnout: use -1 for system users; refactor the changes a bit] Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <[email protected]>
- Loading branch information
Showing
2 changed files
with
63 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters