[CRIU] [PATCH] zdtm: don't exclude ipc and uts namespaces in case of userns

Andrey Vagin avagin at gmail.com
Mon Oct 5 04:21:41 PDT 2015


From: Andrei Vagin <avagin at openvz.org>

---
 test/zdtm/lib/ns.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/test/zdtm/lib/ns.c b/test/zdtm/lib/ns.c
index ecf1e0c..420d9c2 100644
--- a/test/zdtm/lib/ns.c
+++ b/test/zdtm/lib/ns.c
@@ -400,17 +400,12 @@ void ns_create(int argc, char **argv)
 		exit(1);
 	}
 
+	flags = CLONE_NEWPID | CLONE_NEWNS | CLONE_NEWUTS |
+		CLONE_NEWNET | CLONE_NEWIPC | SIGCHLD;
+
 	val = getenv("ZDTM_USERNS");
 	if (val)
-		/*
-		 * CLONE_NEWIPC and CLONE_NEWUTS are excluded, because
-		 * their sysctl-s are protected by CAP_SYS_ADMIN
-		 */
-		flags = CLONE_NEWPID | CLONE_NEWNS  |
-			CLONE_NEWNET | CLONE_NEWUSER | SIGCHLD;
-	else
-		flags = CLONE_NEWPID | CLONE_NEWNS | CLONE_NEWUTS |
-			CLONE_NEWNET | CLONE_NEWIPC | SIGCHLD;
+		flags |= CLONE_NEWUSER;
 
 	if (construct_root())
 		exit(1);
-- 
2.4.3



More information about the CRIU mailing list