Don't hardcode the spaces to create/unshare.
authorDaniel Hokka Zakrisson <daniel@hozac.com>
Wed, 8 Aug 2007 23:10:52 +0000 (23:10 +0000)
committerDaniel Hokka Zakrisson <daniel@hozac.com>
Wed, 8 Aug 2007 23:10:52 +0000 (23:10 +0000)
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2582 94cd875c-1c1d-0410-91d2-eb244daf1a30

lib/syscall_ctxcreate-v21.hc

index 600c9ef..20e7462 100644 (file)
@@ -38,8 +38,9 @@ vc_ctx_create_v21(xid_t xid, struct vc_ctx_flags *flags)
 
   if (res != VC_NOCTX) {
     if (utilvserver_checkCompatConfig() & VC_VCI_SPACES) {
-      sys_unshare(CLONE_NEWUTS | CLONE_NEWIPC);
-      vc_set_namespace(VC_SAMECTX, CLONE_NEWUTS | CLONE_NEWIPC);
+      uint32_t spaces = vc_get_space_mask() & ~(CLONE_NEWNS|CLONE_FS);
+      sys_unshare(spaces);
+      vc_set_namespace(VC_SAMECTX, spaces);
     }
   }