X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fvnamespace.c;h=c71cc9f8f0c3164d70c435965f31e06beae0b1d2;hb=a15f4fdad07cbbb643a6ef34067781c3c9fe1b09;hp=366b9676ec3c5286fca10b9f9ac155504ea07ebc;hpb=517fb954f46091a78f471435b7f284668138a2da;p=util-vserver.git diff --git a/src/vnamespace.c b/src/vnamespace.c index 366b967..c71cc9f 100644 --- a/src/vnamespace.c +++ b/src/vnamespace.c @@ -36,13 +36,6 @@ #define ENSC_WRAPPERS_VSERVER 1 #include -#ifndef CLONE_NEWUTS -# define CLONE_NEWUTS 0x04000000 -#endif -#ifndef CLONE_NEWIPC -# define CLONE_NEWIPC 0x08000000 -#endif - #define CMD_HELP 0x1000 #define CMD_VERSION 0x1001 @@ -102,9 +95,9 @@ newNamespace(char const *cmd) signal(SIGCHLD, SIG_DFL); #ifdef NDEBUG - pid = sys_clone(CLONE_NEWNS|CLONE_NEWUTS|CLONE_NEWIPC|CLONE_VFORK|SIGCHLD, 0); + pid = sys_clone(CLONE_NEWNS|CLONE_VFORK|SIGCHLD, 0); #else - pid = sys_clone(CLONE_NEWNS|CLONE_NEWUTS|CLONE_NEWIPC|SIGCHLD, 0); + pid = sys_clone(CLONE_NEWNS|SIGCHLD, 0); #endif switch (pid) { @@ -119,18 +112,18 @@ newNamespace(char const *cmd) } static void -enterNamespace(xid_t xid) +enterNamespace(xid_t xid, uint_least64_t mask) { - if (vc_enter_namespace(xid)==-1) { + if (vc_enter_namespace(xid, mask)==-1) { perror("vnamespace: vc_enter_namespace()"); exit(255); } } static void -setNamespace() +setNamespace(xid_t xid, uint_least64_t mask) { - if (vc_set_namespace()==-1) { + if (vc_set_namespace(xid, mask)==-1) { perror("vnamespace: vc_set_namespace()"); exit(255); } @@ -189,9 +182,9 @@ int main(int argc, char *argv[]) WRITE_MSG(2, "No command specified; try '--help' for more information\n"); else { if (do_new) newNamespace(argv[optind]); - else if (do_set) setNamespace(); + else if (do_set) setNamespace(VC_SAMECTX, CLONE_NEWNS|CLONE_FS); else if (do_cleanup) cleanupNamespace(); - else if (do_enter) enterNamespace(xid); + else if (do_enter) enterNamespace(xid, CLONE_NEWNS|CLONE_FS); if (optind