Permalink
Browse files

make is_global_zone check for user namespaces on linux

The only way to do this currently is to check whether
/proc/self/uid_map has the default 0 to 0 mapping.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
  • Loading branch information...
Blub committed Jan 24, 2018
1 parent 512a492 commit 49b2ba2482ef0cba3777d819e849cad447de6bf3
Showing with 5 additions and 1 deletion.
  1. +5 −1 tests/zfs-tests/include/libtest.shlib
@@ -1504,7 +1504,11 @@ function setup_nfs_server
function is_global_zone
{
if is_linux; then
return 0
typeset uid_map=$(cat /proc/self/uid_map 2>/dev/null)
if [[ $uid_map == *( )0+( )0+( )4294967295 ]]; then
return 0
fi
return 1
else
typeset cur_zone=$(zonename 2>/dev/null)
if [[ $cur_zone != "global" ]]; then

0 comments on commit 49b2ba2

Please sign in to comment.