Skip to content

unshare: Add support for mapping ranges of user/group IDs

Sean Anderson util-linux 2 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 6 repliesApplied
  2. v15 patches 4 repliesSuperseded

Changes in v2 from the cover letter

- Add "auto" option for --map-users and --map-groups
- Add UID_BUFSIZ macro to hold the maximum size of a uid represented as a string
- Add some documentation for waitchild
- Add some helpers for forking and synchronizing
- Copy names from string_to_idarray into a buffer to add a nul-terminator, instead of modifying them directly
- Document new "auto" value for --map-user and --map-group
- Fix most of read_subid_range using spaces instead of tabs
- Fix typo of --group instead of --user
- Update doc comments for uint_to_id() and get_map_range()
- Use more meaningful numbers in map_ids
- Use pathname macros for /etc/sub{u,g}id
- Use sync helpers for idmap

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/6include/c: Add abs_diff macroinclude/c.h+8 -00 replies
2/6unshare: Add waitchild helpersys-utils/unshare.c+25 -120 replies
3/6unshare: Add some helpers for forking and synchronizingsys-utils/unshare.c+68 -410 replies
4/6unshare: Add options to map blocks of user/group IDssys-utils/unshare.c+251 -40 replies
5/6unshare: Add option to automatically create user and group mapsinclude/pathnames.h sys-utils/unshare.c+85 -20 replies
6/6unshare: Document --map-{groups,users,auto}sys-utils/unshare.1.adoc+32 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/6] unshare: Add support for mapping ranges of user/group IDs

This series adds support for mapping ranges of user/group IDs using the newuidmap and newgidmap programs from shadow. The intent is to allow for root-less bootstrapping of Linux root filesystems with correct ownership. My primary inspiration is mmdebstrap [1], which uses unshare(2) to create Debian root filesystems without needing root access.

[1] https://gitlab.mister-muffin.de/josch/mmdebstrap

Changes in v2:
- Add "auto" option for --map-users and --map-groups
- Add UID_BUFSIZ macro to hold the maximum size of a uid represented as a string
- Add some documentation for waitchild
- Add some helpers for forking and synchronizing
- Copy names from string_to_idarray into a buffer to add a nul-terminator, instead of modifying them directly
- Document new "auto" value for --map-user and --map-group
- Fix most of read_subid_range using spaces instead of tabs
- Fix typo of --group instead of --user
- Update doc comments for uint_to_id() and get_map_range()
- Use more meaningful numbers in map_ids
- Use pathname macros for /etc/sub{u,g}id
- Use sync helpers for idmap

Sean Anderson (6):
include/c: Add abs_diff macro
unshare: Add waitchild helper
unshare: Add some helpers for forking and synchronizing
unshare: Add options to map blocks of user/group IDs
unshare: Add option to automatically create user and group maps
unshare: Document --map-{groups,users,auto}

 include/c.h              |   8 +
 include/pathnames.h      |   3 +
 sys-utils/unshare.1.adoc |  32 +++
 sys-utils/unshare.c      | 477 ++++++++++++++++++++++++++++++++++-----
 4 files changed, 465 insertions(+), 55 deletions(-)
Signature · 1 line
2.33.0