Skip to content

Commit

Permalink
nspawn: optionally fix up OS tree uid/gids for userns
Browse files Browse the repository at this point in the history
This adds a new --private-userns-chown switch that may be used in combination
with --private-userns. If it is passed a recursive chmod() operation is run on
the OS tree, fixing all file owner UID/GIDs to the right ranges. This should
make user namespacing pretty workable, as the OS trees don't need to be
prepared manually anymore.
  • Loading branch information
poettering committed Apr 25, 2016
1 parent 6402d5c commit 7336138
Show file tree
Hide file tree
Showing 6 changed files with 560 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@
/test-ns
/test-nss
/test-parse-util
/test-patch-uid
/test-path
/test-path-lookup
/test-path-util
Expand Down
13 changes: 13 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3021,6 +3021,8 @@ systemd_nspawn_SOURCES = \
src/nspawn/nspawn-setuid.h \
src/nspawn/nspawn-stub-pid1.c \
src/nspawn/nspawn-stub-pid1.h \
src/nspawn/nspawn-patch-uid.c \
src/nspawn/nspawn-patch-uid.h \
src/core/mount-setup.c \
src/core/mount-setup.h \
src/core/loopback-setup.c \
Expand Down Expand Up @@ -3048,6 +3050,17 @@ systemd_nspawn_LDADD += \
libfirewall.la
endif

test_patch_uid_SOURCES = \
src/nspawn/nspawn-patch-uid.c \
src/nspawn/nspawn-patch-uid.h \
src/nspawn/test-patch-uid.c

test_patch_uid_LDADD = \
libshared.la

manual_tests += \
test-patch-uid

# ------------------------------------------------------------------------------
systemd_run_SOURCES = \
src/run/run.c
Expand Down
Loading

0 comments on commit 7336138

Please sign in to comment.