From ea82b267c985e6d3b16d08fc5313737e97244fe2 Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Wed, 18 Aug 2021 22:06:16 +0200 Subject: [PATCH] only run test_unshare_userns() if not root user --- mmdebstrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmdebstrap b/mmdebstrap index ab019a4..6b66332 100755 --- a/mmdebstrap +++ b/mmdebstrap @@ -4239,7 +4239,7 @@ sub main() { # lxc-usernsexec -- lxc-unshare -s 'MOUNT|PID|UTSNAME|IPC' ... # but without needing lxc if ($ARGV[0] eq "--unshare-helper") { - if (!test_unshare_userns(1)) { + if ($EFFECTIVE_USER_ID != 0 && !test_unshare_userns(1)) { exit 1; } my @idmap = read_subuid_subgid;