Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
userns: add implicit 0-max to root when no sub[ug]ids are assigned
Previously, we assigned to root the entire range if we couldn't assign more than one UID/GID in the generated maps. This worked, but left an inconsistency when using --uid-map and --gid-map: even as root, it was not possible to assign arbitrary IDs when no range was allotted for root in /etc/subuid and /etc/subgid. This commit fixes this by instead moving the implicit range allocation in the subid loading function. That is, if root has no uid range defined in /etc/subuid, then it gets an implicit [0, 4294967294) range. This preserves the behaviour of assigning that range during the generation of the id maps while also allowing root to use arbitrary ranges with the --[ug]id-map flags _if_ root hasn't been assigned sub[ug]ids already.
- Loading branch information