]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc-checkconfig: verify new[ug]idmap are setuid-root
authorSerge Hallyn <serge@hallyn.com>
Tue, 14 Mar 2017 18:16:48 +0000 (13:16 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 20 Mar 2017 21:47:15 +0000 (17:47 -0400)
Signed-off-by: Serge Hallyn <serge@hallyn.com>
src/lxc/lxc-checkconfig.in

index 27689fee7af8c920af871df515c43c1165c60b6e..ff6ee072ac6bb5b8c5e159bb3e1c0edd0aa35fed 100644 (file)
@@ -78,6 +78,24 @@ echo -n "Utsname namespace: " && is_enabled CONFIG_UTS_NS
 echo -n "Ipc namespace: " && is_enabled CONFIG_IPC_NS yes
 echo -n "Pid namespace: " && is_enabled CONFIG_PID_NS yes
 echo -n "User namespace: " && is_enabled CONFIG_USER_NS
+if is_set CONFIG_USER_NS; then
+       if type newuidmap > /dev/null 2>&1; then
+               f=`type -P newuidmap`
+               if [ ! -u "${f}" ]; then
+                       echo "Warning: newuidmap is not setuid-root"
+               fi
+       else
+               echo "newuidmap is not installed"
+       fi
+       if type newgidmap > /dev/null 2>&1; then
+               f=`type -P newgidmap`
+               if [ ! -u "${f}" ]; then
+                       echo "Warning: newgidmap is not setuid-root"
+               fi
+       else
+               echo "newgidmap is not installed"
+       fi
+fi
 echo -n "Network namespace: " && is_enabled CONFIG_NET_NS
 echo -n "Multiple /dev/pts instances: " && is_enabled DEVPTS_MULTIPLE_INSTANCES
 echo