[Toybox] unshare/nsenter and flags

enh enh at google.com
Thu May 2 11:14:21 PDT 2024


another googler wanted a host unshare(1) for some testing... i added
that, and they complained that although the docs say

    -r Become root (map current euid/egid to 0/0, implies -U) (--map-root-user)

it seems like -r _doesn't_ actually imply -U in practice (and they
seemed to have strace output to prove it).

i was assuming the code was just missing, but when i looked, i found:

// unshare -U does not imply -r, so we cannot use [+rU]
if (test_r()) toys.optflags |= FLAG_U;

but note the unshare/nsenter sharing there --- is it a problem that i
have unshare enabled but not nsenter? is that expected to work?


More information about the Toybox mailing list