fixed execution order of chroot(2) and context-creation; this caused
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Thu, 27 Jan 2005 19:16:54 +0000 (19:16 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Thu, 27 Jan 2005 19:16:54 +0000 (19:16 +0000)
errors on kernel 2.6 when the vserver is not running yet

git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@1818 94cd875c-1c1d-0410-91d2-eb244daf1a30

util-vserver/src/rpm-fake.c

index f6c9770..7b27923 100644 (file)
@@ -311,10 +311,12 @@ initPwSocket()
       *ptr++ = resolver;
       *ptr++ = "-F"; *ptr++ = flag_str;
       *ptr++ = "-C"; *ptr++ = caps_str;
-      if (root)  { *ptr++ = "-r"; *ptr++ = root;  }
+      if (root)  { *ptr++ = "-r"; *ptr++ = ".";   }
       if (uid)   { *ptr++ = "-u"; *ptr++ = uid;   }
       if (gid)   { *ptr++ = "-g"; *ptr++ = gid;   }
 
+      if (root) Echdir(root);
+
       if (setupContext(ctx, &xid_str)) { *ptr++ = "-s"; }
       else if (xid_str)                { *ptr++ = "-c"; *ptr++ = xid_str; }