From: Zbigniew Jędrzejewski-Szmek Date: Fri, 21 Oct 2016 03:41:21 +0000 (-0400) Subject: detect-virt: add --private-users switch to check if a userns is active X-Git-Tag: v232.2~23 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=70cec624a0e54f3c35aff781645b07452fc32596;hp=70cec624a0e54f3c35aff781645b07452fc32596 detect-virt: add --private-users switch to check if a userns is active Various things don't work when we're running in a user namespace, but it's pretty hard to reliably detect if that is true. A function is added which looks at /proc/self/uid_map and returns false if the default "0 0 UINT32_MAX" is found, and true if it finds anything else. This misses the case where an 1:1 mapping with the full range was used, but I don't know how to distinguish this case. 'elogind-detect-virt --private-users' is very similar to 'elogind-detect-virt --chroot', but we check for a user namespace instead. ---