1 --- linux-i686-2.6.22/kernel/vserver/space.c.orig 2008-03-11 20:14:21.000000000 -0400
2 +++ linux-i686-2.6.22/kernel/vserver/space.c 2008-03-11 20:13:53.000000000 -0400
4 #include <linux/utsname.h>
5 #include <linux/nsproxy.h>
7 +#include <net/net_namespace.h>
8 #include <asm/uaccess.h>
10 #include <linux/vs_context.h>
11 #include <linux/vserver/space.h>
12 #include <linux/vserver/space_cmd.h>
14 +#include <linux/capability.h>
17 atomic_t vs_global_nsproxy = ATOMIC_INIT(0);
18 atomic_t vs_global_fs = ATOMIC_INIT(0);
20 struct mnt_namespace *old_ns;
21 struct uts_namespace *old_uts;
22 struct ipc_namespace *old_ipc;
23 + struct net *old_net;
24 struct nsproxy *nsproxy;
26 + /* Dunno if task_lock is really needed */
28 + if (!cap_raised(current->cap_effective, CAP_SYS_ADMIN)) {
29 + current->cap_effective = cap_raise(current->cap_effective, CAP_SYS_ADMIN);
31 nsproxy = copy_nsproxy(old_nsproxy);
32 + if (cap_raised(current->cap_effective, CAP_SYS_ADMIN)) {
33 + current->cap_effective = cap_lower(current->cap_effective, CAP_SYS_ADMIN);
35 + task_unlock(current);
42 get_ipc_ns(nsproxy->ipc_ns);
46 + if (mask & CLONE_NEWNET) {
47 + old_net = nsproxy->net_ns;
48 + nsproxy->net_ns = new_nsproxy->net_ns;
49 + if (nsproxy->net_ns) {
50 + get_net(nsproxy->net_ns);
70 int vc_enter_space(struct vx_info *vxi, void __user *data)
72 - struct vcmd_space_mask vc_data = { .mask = 0 };
73 + /* Ask dhozac how to pass this flag from user space - Sapan*/
74 + struct vcmd_space_mask vc_data = { .mask = CLONE_NEWNET };
76 if (data && copy_from_user(&vc_data, data, sizeof(vc_data)))