]> git.ipfire.org Git - thirdparty/systemd.git/commit
nspawn: Simplify mkdir_userns() usage, and trickle that up
authorLuke Shumaker <lukeshu@parabola.nu>
Fri, 7 Jul 2017 22:30:03 +0000 (18:30 -0400)
committerLuke Shumaker <lukeshu@parabola.nu>
Fri, 20 Jul 2018 16:12:02 +0000 (12:12 -0400)
commit9c0fad5fb5f47da125bb768dbb4cd0e824cccc7c
tree474be34ee5d1e5215b1551f32d9273f5e840aecf
parentf07b548940ed46722c54b15069a7f08739714659
nspawn: Simplify mkdir_userns() usage, and trickle that up

One of the things that mkdir_userns{,_p}() does is take an (optional) UID,
and chown the directory to that.  So we need a uid_t argument, and a way of
telling if we should use that uid_t argument.  Fortunately, that is built
in to the uid_t type by having UID_INVALID as a possible value.

However, currently mkdir_userns() also takes a MountSettingsMask and checks
a couple of bits in it to decide if it should perform the chown.

Drop the mask argument, and instead have the caller pass UID_INVALID if it
shouldn't chown.
src/nspawn/nspawn-mount.c