Re: Please allow util-vserver 0.30.212-1 into etch
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Micah Anderson wrote:
> If I remove all the useless stuff (.svn stuff that crept in, upstream
> Changelog which for some reason had a number of changes, autotools
> noise, debian patches that have been incorporated into upstream, NOOP
> RCS header date changes, fedora yum repo gpg key change (unrelated to
> debian) gentoo initscript changes (unrelated to debian), redhat initpost
> changes (unrelated to debian), documentation changes
> (doc/configuration.html, configuration-xhtml.xsl, configuration.xml),
> redhat spec file changes (unrelated to debian) and the THANKS change,
> leaves:
>
> 58 files changed, 189 insertions(+), 446 deletions(-)
>
> Removing the 20+ trivial fixes of:
>
> - WRITE_MSG(2, " --help\" for more information.\n");
> + WRITE_MSG(2, " --help' for more information.\n");
>
> Leaves 40 changes, 169 insertions(+), 426 deletions, not that much when
> you consider a new kernel API is supported.
Attached cleaned up patch for review.
Micah
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFF6yja9n4qXRzy1ioRAlujAKC3QtqSi/DRuJFO6GMohmfq3JVFBwCgtCkI
L+cG5Vhu2AytJvADG2LPALc=
=/4wu
-----END PGP SIGNATURE-----
diff -ur ./config.h.in ../0.30.212-1/config.h.in
--- ./config.h.in 2006-10-07 13:32:22.000000000 -0600
+++ ../0.30.212-1/config.h.in 2006-12-09 11:56:07.000000000 -0700
@@ -232,6 +232,9 @@
/* Enable support for some obsoleted API of vserver 1.3.x */
#undef VC_ENABLE_API_V13OBS
+/* Enable support for API of vserver 2.1.x */
+#undef VC_ENABLE_API_V21
+
/* Version number of package */
#undef VERSION
diff -ur ./ensc_wrappers/wrappers-vserver.hc ../0.30.212-1/ensc_wrappers/wrappers-vserver.hc
--- ./ensc_wrappers/wrappers-vserver.hc 2007-03-04 12:25:45.000000000 -0700
+++ ../0.30.212-1/ensc_wrappers/wrappers-vserver.hc 2006-12-09 11:56:07.000000000 -0700
@@ -132,15 +132,15 @@
}
inline static WRAPPER_DECL void
-Evc_set_namespace()
+Evc_set_namespace(xid_t xid, uint_least64_t mask)
{
- FatalErrnoError(vc_set_namespace()==-1, "vc_set_namespace()");
+ FatalErrnoError(vc_set_namespace(xid, mask)==-1, "vc_set_namespace()");
}
inline static WRAPPER_DECL void
-Evc_enter_namespace(xid_t xid)
+Evc_enter_namespace(xid_t xid, uint_least64_t mask)
{
- FatalErrnoError(vc_enter_namespace(xid)==-1, "vc_enter_namespace()");
+ FatalErrnoError(vc_enter_namespace(xid, mask)==-1, "vc_enter_namespace()");
}
inline static WRAPPER_DECL xid_t
diff -ur ./kernel/cacct_cmd.h ../0.30.212-1/kernel/cacct_cmd.h
--- ./kernel/cacct_cmd.h 2007-03-04 12:25:45.000000000 -0700
+++ ../0.30.212-1/kernel/cacct_cmd.h 2006-12-09 11:56:07.000000000 -0700
@@ -13,11 +13,4 @@
};
-#ifdef __KERNEL__
-
-#include <linux/compiler.h>
-
-extern int vc_sock_stat(struct vx_info *, void __user *);
-
-#endif /* __KERNEL__ */
#endif /* _VX_CACCT_CMD_H */
diff -ur ./kernel/context_cmd.h ../0.30.212-1/kernel/context_cmd.h
--- ./kernel/context_cmd.h 2007-03-04 12:25:45.000000000 -0700
+++ ../0.30.212-1/kernel/context_cmd.h 2006-12-09 11:56:07.000000000 -0700
@@ -6,10 +6,6 @@
#define VCMD_task_xid VC_CMD(VINFO, 1, 0)
-#ifdef __KERNEL__
-extern int vc_task_xid(uint32_t, void __user *);
-
-#endif /* __KERNEL__ */
#define VCMD_vx_info VC_CMD(VINFO, 5, 0)
@@ -19,10 +15,6 @@
/* more to come */
};
-#ifdef __KERNEL__
-extern int vc_vx_info(struct vx_info *, void __user *);
-
-#endif /* __KERNEL__ */
#define VCMD_ctx_stat VC_CMD(VSTAT, 0, 0)
@@ -32,10 +24,6 @@
/* more to come */
};
-#ifdef __KERNEL__
-extern int vc_ctx_stat(struct vx_info *, void __user *);
-
-#endif /* __KERNEL__ */
/* context commands */
@@ -53,11 +41,6 @@
uint64_t flagword;
};
-#ifdef __KERNEL__
-extern int vc_ctx_create(uint32_t, void __user *);
-extern int vc_ctx_migrate(struct vx_info *, void __user *);
-
-#endif /* __KERNEL__ */
/* flag commands */
@@ -70,11 +53,6 @@
uint64_t mask;
};
-#ifdef __KERNEL__
-extern int vc_get_cflags(struct vx_info *, void __user *);
-extern int vc_set_cflags(struct vx_info *, void __user *);
-
-#endif /* __KERNEL__ */
/* context caps commands */
@@ -96,13 +74,6 @@
uint64_t cmask;
};
-#ifdef __KERNEL__
-extern int vc_get_ccaps_v0(struct vx_info *, void __user *);
-extern int vc_set_ccaps_v0(struct vx_info *, void __user *);
-extern int vc_get_ccaps(struct vx_info *, void __user *);
-extern int vc_set_ccaps(struct vx_info *, void __user *);
-
-#endif /* __KERNEL__ */
/* bcaps commands */
@@ -115,9 +86,4 @@
uint64_t bmask;
};
-#ifdef __KERNEL__
-extern int vc_get_bcaps(struct vx_info *, void __user *);
-extern int vc_set_bcaps(struct vx_info *, void __user *);
-
-#endif /* __KERNEL__ */
#endif /* _VX_CONTEXT_CMD_H */
diff -ur ./kernel/cvirt_cmd.h ../0.30.212-1/kernel/cvirt_cmd.h
--- ./kernel/cvirt_cmd.h 2007-03-04 12:25:45.000000000 -0700
+++ ../0.30.212-1/kernel/cvirt_cmd.h 2006-12-09 11:56:07.000000000 -0700
@@ -24,14 +24,6 @@
};
-#ifdef __KERNEL__
-
-#include <linux/compiler.h>
-
-extern int vc_set_vhi_name(struct vx_info *, void __user *);
-extern int vc_get_vhi_name(struct vx_info *, void __user *);
-
-#endif /* __KERNEL__ */
#define VCMD_virt_stat VC_CMD(VSTAT, 3, 0)
@@ -46,8 +38,4 @@
uint32_t load[3];
};
-#ifdef __KERNEL__
-extern int vc_virt_stat(struct vx_info *, void __user *);
-
-#endif /* __KERNEL__ */
#endif /* _VX_CVIRT_CMD_H */
diff -ur ./kernel/debug_cmd.h ../0.30.212-1/kernel/debug_cmd.h
--- ./kernel/debug_cmd.h 2007-03-04 12:25:45.000000000 -0700
+++ ../0.30.212-1/kernel/debug_cmd.h 2006-12-09 11:56:07.000000000 -0700
@@ -12,47 +12,14 @@
struct vcmd_read_history_v0 {
uint32_t index;
uint32_t count;
- char __user *data;
+ char *data;
};
struct vcmd_read_monitor_v0 {
uint32_t index;
uint32_t count;
- char __user *data;
+ char *data;
};
-#ifdef __KERNEL__
-
-#ifdef CONFIG_COMPAT
-
-#include <asm/compat.h>
-
-struct vcmd_read_history_v0_x32 {
- uint32_t index;
- uint32_t count;
- compat_uptr_t data_ptr;
-};
-
-struct vcmd_read_monitor_v0_x32 {
- uint32_t index;
- uint32_t count;
- compat_uptr_t data_ptr;
-};
-
-#endif /* CONFIG_COMPAT */
-
-extern int vc_dump_history(uint32_t);
-
-extern int vc_read_history(uint32_t, void __user *);
-extern int vc_read_monitor(uint32_t, void __user *);
-
-#ifdef CONFIG_COMPAT
-
-extern int vc_read_history_x32(uint32_t, void __user *);
-extern int vc_read_monitor_x32(uint32_t, void __user *);
-
-#endif /* CONFIG_COMPAT */
-
-#endif /* __KERNEL__ */
#endif /* _VX_DEBUG_CMD_H */
diff -ur ./kernel/dlimit_cmd.h ../0.30.212-1/kernel/dlimit_cmd.h
--- ./kernel/dlimit_cmd.h 2007-03-04 12:25:45.000000000 -0700
+++ ../0.30.212-1/kernel/dlimit_cmd.h 2006-12-09 11:56:07.000000000 -0700
@@ -11,12 +11,12 @@
#define VCMD_get_dlimit VC_CMD(DLIMIT, 6, 0)
struct vcmd_ctx_dlimit_base_v0 {
- const char __user *name;
+ const char *name;
uint32_t flags;
};
struct vcmd_ctx_dlimit_v0 {
- const char __user *name;
+ const char *name;
uint32_t space_used; /* used space in kbytes */
uint32_t space_total; /* maximum space in kbytes */
uint32_t inodes_used; /* used inodes */
@@ -29,46 +29,4 @@
#define CDLIM_INFINITY ((uint32_t)~0UL)
#define CDLIM_KEEP ((uint32_t)~1UL)
-#ifdef __KERNEL__
-
-#ifdef CONFIG_COMPAT
-
-#include <asm/compat.h>
-
-struct vcmd_ctx_dlimit_base_v0_x32 {
- compat_uptr_t name_ptr;
- uint32_t flags;
-};
-
-struct vcmd_ctx_dlimit_v0_x32 {
- compat_uptr_t name_ptr;
- uint32_t space_used; /* used space in kbytes */
- uint32_t space_total; /* maximum space in kbytes */
- uint32_t inodes_used; /* used inodes */
- uint32_t inodes_total; /* maximum inodes */
- uint32_t reserved; /* reserved for root in % */
- uint32_t flags;
-};
-
-#endif /* CONFIG_COMPAT */
-
-#include <linux/compiler.h>
-
-extern int vc_add_dlimit(uint32_t, void __user *);
-extern int vc_rem_dlimit(uint32_t, void __user *);
-
-extern int vc_set_dlimit(uint32_t, void __user *);
-extern int vc_get_dlimit(uint32_t, void __user *);
-
-#ifdef CONFIG_COMPAT
-
-extern int vc_add_dlimit_x32(uint32_t, void __user *);
-extern int vc_rem_dlimit_x32(uint32_t, void __user *);
-
-extern int vc_set_dlimit_x32(uint32_t, void __user *);
-extern int vc_get_dlimit_x32(uint32_t, void __user *);
-
-#endif /* CONFIG_COMPAT */
-
-#endif /* __KERNEL__ */
#endif /* _VX_DLIMIT_CMD_H */
diff -ur ./kernel/inode_cmd.h ../0.30.212-1/kernel/inode_cmd.h
--- ./kernel/inode_cmd.h 2007-03-04 12:25:45.000000000 -0700
+++ ../0.30.212-1/kernel/inode_cmd.h 2006-12-09 11:56:07.000000000 -0700
@@ -19,43 +19,11 @@
};
struct vcmd_ctx_iattr_v1 {
- const char __user *name;
+ const char *name;
uint32_t xid;
uint32_t flags;
uint32_t mask;
};
-#ifdef __KERNEL__
-
-
-#ifdef CONFIG_COMPAT
-
-#include <asm/compat.h>
-
-struct vcmd_ctx_iattr_v1_x32 {
- compat_uptr_t name_ptr;
- uint32_t xid;
- uint32_t flags;
- uint32_t mask;
-};
-
-#endif /* CONFIG_COMPAT */
-
-#include <linux/compiler.h>
-
-extern int vc_get_iattr_v0(uint32_t, void __user *);
-extern int vc_set_iattr_v0(uint32_t, void __user *);
-
-extern int vc_get_iattr(uint32_t, void __user *);
-extern int vc_set_iattr(uint32_t, void __user *);
-
-#ifdef CONFIG_COMPAT
-
-extern int vc_get_iattr_x32(uint32_t, void __user *);
-extern int vc_set_iattr_x32(uint32_t, void __user *);
-
-#endif /* CONFIG_COMPAT */
-
-#endif /* __KERNEL__ */
#endif /* _VX_INODE_CMD_H */
diff -ur ./kernel/legacy.h ../0.30.212-1/kernel/legacy.h
--- ./kernel/legacy.h 2006-10-07 13:32:22.000000000 -0600
+++ ../0.30.212-1/kernel/legacy.h 2006-12-09 11:56:07.000000000 -0700
@@ -41,9 +41,4 @@
#define VX_INFO_NAMESPACE 128 /* save private namespace */
-#ifdef __KERNEL__
-extern int vc_new_s_context(uint32_t, void __user *);
-extern int vc_set_ipv4root(uint32_t, void __user *);
-
-#endif /* __KERNEL__ */
#endif /* _VX_LEGACY_H */
diff -ur ./kernel/limit_cmd.h ../0.30.212-1/kernel/limit_cmd.h
--- ./kernel/limit_cmd.h 2007-03-04 12:25:45.000000000 -0700
+++ ../0.30.212-1/kernel/limit_cmd.h 2006-12-09 11:56:07.000000000 -0700
@@ -36,34 +36,4 @@
#define CRLIM_INFINITY (~0ULL)
#define CRLIM_KEEP (~1ULL)
-#ifdef __KERNEL__
-
-#ifdef CONFIG_IA32_EMULATION
-
-struct vcmd_ctx_rlimit_v0_x32 {
- uint32_t id;
- uint64_t minimum;
- uint64_t softlimit;
- uint64_t maximum;
-} __attribute__ ((aligned (4)));
-
-#endif /* CONFIG_IA32_EMULATION */
-
-#include <linux/compiler.h>
-
-extern int vc_get_rlimit_mask(uint32_t, void __user *);
-extern int vc_get_rlimit(struct vx_info *, void __user *);
-extern int vc_set_rlimit(struct vx_info *, void __user *);
-extern int vc_reset_minmax(struct vx_info *, void __user *);
-
-extern int vc_rlimit_stat(struct vx_info *, void __user *);
-
-#ifdef CONFIG_IA32_EMULATION
-
-extern int vc_get_rlimit_x32(struct vx_info *, void __user *);
-extern int vc_set_rlimit_x32(struct vx_info *, void __user *);
-
-#endif /* CONFIG_IA32_EMULATION */
-
-#endif /* __KERNEL__ */
#endif /* _VX_LIMIT_CMD_H */
diff -ur ./kernel/network_cmd.h ../0.30.212-1/kernel/network_cmd.h
--- ./kernel/network_cmd.h 2007-03-04 12:25:45.000000000 -0700
+++ ../0.30.212-1/kernel/network_cmd.h 2006-12-09 11:56:07.000000000 -0700
@@ -6,10 +6,6 @@
#define VCMD_task_nid VC_CMD(VINFO, 2, 0)
-#ifdef __KERNEL__
-extern int vc_task_nid(uint32_t, void __user *);
-
-#endif /* __KERNEL__ */
#define VCMD_nx_info VC_CMD(VINFO, 6, 0)
@@ -18,10 +14,6 @@
/* more to come */
};
-#ifdef __KERNEL__
-extern int vc_nx_info(struct nx_info *, void __user *);
-
-#endif /* __KERNEL__ */
#define VCMD_net_create_v0 VC_CMD(VNET, 1, 0)
#define VCMD_net_create VC_CMD(VNET, 1, 1)
@@ -44,14 +36,6 @@
};
-#ifdef __KERNEL__
-extern int vc_net_create(uint32_t, void __user *);
-extern int vc_net_migrate(struct nx_info *, void __user *);
-
-extern int vc_net_add(struct nx_info *, void __user *);
-extern int vc_net_remove(struct nx_info *, void __user *);
-
-#endif /* __KERNEL__ */
/* flag commands */
@@ -64,11 +48,6 @@
uint64_t mask;
};
-#ifdef __KERNEL__
-extern int vc_get_nflags(struct nx_info *, void __user *);
-extern int vc_set_nflags(struct nx_info *, void __user *);
-
-#endif /* __KERNEL__ */
/* network caps commands */
@@ -81,9 +60,4 @@
uint64_t cmask;
};
-#ifdef __KERNEL__
-extern int vc_get_ncaps(struct nx_info *, void __user *);
-extern int vc_set_ncaps(struct nx_info *, void __user *);
-
-#endif /* __KERNEL__ */
#endif /* _VX_CONTEXT_CMD_H */
diff -ur ./kernel/network.h ../0.30.212-1/kernel/network.h
--- ./kernel/network.h 2007-03-04 12:25:45.000000000 -0700
+++ ../0.30.212-1/kernel/network.h 2006-12-09 11:56:07.000000000 -0700
@@ -36,107 +36,6 @@
#define NXA_TYPE_ANY ((uint16_t)-1)
-#ifdef __KERNEL__
-
-#include <linux/list.h>
-#include <linux/spinlock.h>
-#include <linux/rcupdate.h>
-#include <asm/atomic.h>
-
-
-struct nx_info {
- struct hlist_node nx_hlist; /* linked list of nxinfos */
- nid_t nx_id; /* vnet id */
- atomic_t nx_usecnt; /* usage count */
- atomic_t nx_tasks; /* tasks count */
- int nx_state; /* context state */
-
- uint64_t nx_flags; /* network flag word */
- uint64_t nx_ncaps; /* network capabilities */
-
- int nbipv4;
- __u32 ipv4[NB_IPV4ROOT]; /* Process can only bind to these IPs */
- /* The first one is used to connect */
- /* and for bind any service */
- /* The other must be used explicity */
- __u32 mask[NB_IPV4ROOT]; /* Netmask for each ipv4 */
- /* Used to select the proper source */
- /* address for sockets */
- __u32 v4_bcast; /* Broadcast address to receive UDP */
-
- char nx_name[65]; /* network context name */
-};
-
-
-/* status flags */
-
-#define NXS_HASHED 0x0001
-#define NXS_SHUTDOWN 0x0100
-#define NXS_RELEASED 0x8000
-
-/* check conditions */
-
-#define NX_ADMIN 0x0001
-#define NX_WATCH 0x0002
-#define NX_BLEND 0x0004
-#define NX_HOSTID 0x0008
-
-#define NX_IDENT 0x0010
-#define NX_EQUIV 0x0020
-#define NX_PARENT 0x0040
-#define NX_CHILD 0x0080
-
-#define NX_ARG_MASK 0x00F0
-
-#define NX_DYNAMIC 0x0100
-#define NX_STATIC 0x0200
-
-#define NX_ATR_MASK 0x0F00
-
-
-extern struct nx_info *lookup_nx_info(int);
-
-extern int get_nid_list(int, unsigned int *, int);
-extern int nid_is_hashed(nid_t);
-
-extern int nx_migrate_task(struct task_struct *, struct nx_info *);
-
-extern long vs_net_change(struct nx_info *, unsigned int);
-
-struct in_ifaddr;
-struct net_device;
-
-#ifdef CONFIG_INET
-int ifa_in_nx_info(struct in_ifaddr *, struct nx_info *);
-int dev_in_nx_info(struct net_device *, struct nx_info *);
-
-#else /* CONFIG_INET */
-static inline
-int ifa_in_nx_info(struct in_ifaddr *a, struct nx_info *n)
-{
- return 1;
-}
-
-static inline
-int dev_in_nx_info(struct net_device *d, struct nx_info *n)
-{
- return 1;
-}
-#endif /* CONFIG_INET */
-
-struct sock;
-
-#ifdef CONFIG_INET
-int nx_addr_conflict(struct nx_info *, uint32_t, struct sock *);
-#else /* CONFIG_INET */
-static inline
-int nx_addr_conflict(struct nx_info *n, uint32_t a, struct sock *s)
-{
- return 1;
-}
-#endif /* CONFIG_INET */
-
-#endif /* __KERNEL__ */
#else /* _VX_NETWORK_H */
#warning duplicate inclusion
#endif /* _VX_NETWORK_H */
diff -ur ./kernel/sched_cmd.h ../0.30.212-1/kernel/sched_cmd.h
--- ./kernel/sched_cmd.h 2007-03-04 12:25:45.000000000 -0700
+++ ../0.30.212-1/kernel/sched_cmd.h 2006-12-09 11:56:07.000000000 -0700
@@ -60,13 +60,4 @@
#define SCHED_KEEP (-2) /* only for v2 */
-#ifdef __KERNEL__
-
-#include <linux/compiler.h>
-
-extern int vc_set_sched_v2(struct vx_info *, void __user *);
-extern int vc_set_sched_v3(struct vx_info *, void __user *);
-extern int vc_set_sched(struct vx_info *, void __user *);
-
-#endif /* __KERNEL__ */
#endif /* _VX_SCHED_CMD_H */
diff -ur ./kernel/signal_cmd.h ../0.30.212-1/kernel/signal_cmd.h
--- ./kernel/signal_cmd.h 2007-03-04 12:25:45.000000000 -0700
+++ ../0.30.212-1/kernel/signal_cmd.h 2006-12-09 11:56:07.000000000 -0700
@@ -17,27 +17,15 @@
int32_t exit_code;
};
-#ifdef __KERNEL__
-
-extern int vc_ctx_kill(struct vx_info *, void __user *);
-extern int vc_wait_exit(struct vx_info *, void __user *);
-
-#endif /* __KERNEL__ */
/* process alteration commands */
-#define VCMD_get_pflags VC_CMD(PROCALT, 1, 0)
-#define VCMD_set_pflags VC_CMD(PROCALT, 2, 0)
+#define VCMD_get_pflags VC_CMD(PROCALT, 5, 0)
+#define VCMD_set_pflags VC_CMD(PROCALT, 6, 0)
struct vcmd_pflags_v0 {
uint32_t flagword;
uint32_t mask;
};
-#ifdef __KERNEL__
-
-extern int vc_get_pflags(uint32_t pid, void __user *);
-extern int vc_set_pflags(uint32_t pid, void __user *);
-
-#endif /* __KERNEL__ */
#endif /* _VX_SIGNAL_CMD_H */
diff -ur ./kernel/switch.h ../0.30.212-1/kernel/switch.h
--- ./kernel/switch.h 2007-03-04 12:25:45.000000000 -0700
+++ ../0.30.212-1/kernel/switch.h 2006-12-09 11:56:07.000000000 -0700
@@ -88,13 +88,6 @@
#define VCMD_get_vci VC_CMD(VERSION, 1, 0)
-#ifdef __KERNEL__
-
-#include <linux/errno.h>
-
-
-#else /* __KERNEL__ */
#define __user
-#endif /* __KERNEL__ */
#endif /* _VX_SWITCH_H */
diff -ur ./lib/getxidtype.c ../0.30.212-1/lib/getxidtype.c
--- ./lib/getxidtype.c 2006-10-07 13:32:22.000000000 -0600
+++ ../0.30.212-1/lib/getxidtype.c 2006-12-09 11:56:07.000000000 -0700
@@ -21,14 +21,21 @@
#endif
#include "vserver.h"
-#include "virtual.h"
+#include "internal.h"
vcXidType
vc_getXIDType(xid_t xid)
{
- if (xid==0) return vcTYPE_MAIN;
- if (xid==1) return vcTYPE_WATCH;
- if (xid>1 && xid<MIN_D_CONTEXT) return vcTYPE_STATIC;
- if (xid>=MIN_D_CONTEXT && xid<MAX_S_CONTEXT) return vcTYPE_DYNAMIC;
+ static xid_t MIN_D_CONTEXT = 0;
+ const xid_t MAX_S_CONTEXT = 65535;
+ if (MIN_D_CONTEXT == 0 && (utilvserver_checkCompatConfig() & VC_VCI_NO_DYNAMIC) == 0)
+ MIN_D_CONTEXT = 49152;
+ else
+ MIN_D_CONTEXT = MAX_S_CONTEXT;
+
+ if (xid==0) return vcTYPE_MAIN;
+ if (xid==1) return vcTYPE_WATCH;
+ if (xid>1 && xid<MIN_D_CONTEXT) return vcTYPE_STATIC;
+ if (xid>=MIN_D_CONTEXT && xid<MAX_S_CONTEXT) return vcTYPE_DYNAMIC;
return vcTYPE_INVALID;
}
diff -ur ./lib/internal.h ../0.30.212-1/lib/internal.h
--- ./lib/internal.h 2006-10-07 13:32:22.000000000 -0600
+++ ../0.30.212-1/lib/internal.h 2006-12-09 11:56:07.000000000 -0700
@@ -38,6 +38,7 @@
int utilvserver_checkCompatVersion();
+uint_least32_t utilvserver_checkCompatConfig();
bool utilvserver_isDirectory(char const *path, bool follow_link);
bool utilvserver_isFile(char const *path, bool follow_link);
bool utilvserver_isLink(char const *path);
diff -ur ./lib/isdynamicxid.c ../0.30.212-1/lib/isdynamicxid.c
--- ./lib/isdynamicxid.c 2006-10-07 13:32:22.000000000 -0600
+++ ../0.30.212-1/lib/isdynamicxid.c 2006-12-09 11:56:07.000000000 -0700
@@ -26,5 +26,5 @@
bool
vc_is_dynamic_xid(xid_t xid)
{
- return xid>=MIN_D_CONTEXT;
+ return vc_getXIDType(xid) == vcTYPE_DYNAMIC;
}
diff -ur ./lib/Makefile-files ../0.30.212-1/lib/Makefile-files
--- ./lib/Makefile-files 2007-03-04 12:25:45.000000000 -0700
+++ ../0.30.212-1/lib/Makefile-files 2006-12-09 11:56:07.000000000 -0700
@@ -121,7 +121,12 @@
lib/syscall_virtstat.c \
lib/syscall_virtstat-v21.hc \
lib/syscall_ctxstat.c \
- lib/syscall_ctxstat-v21.hc
+ lib/syscall_ctxstat-v21.hc \
+ lib/syscall_getspacemask.c \
+ lib/syscall_getspacemask-v21.hc \
+ lib/syscall_enternamespace-v21.hc \
+ lib/syscall_setnamespace-v21.hc \
+ lib/syscall_ctxmigrate-v21.hc
if ENSC_HAVE_C99_COMPILER
lib_v13_SRCS += lib/syscall_adddlimit-v13.hc \
@@ -138,6 +143,7 @@
lib_SRCS = lib/syscall.c \
lib/checkversion.c \
+ lib/checkconfig.c \
lib/isdirectory.c \
lib/isfile.c \
lib/islink.c \
diff -ur ./lib/nflags-net.c ../0.30.212-1/lib/nflags-net.c
--- ./lib/nflags-net.c 2007-03-04 12:25:45.000000000 -0700
+++ ../0.30.212-1/lib/nflags-net.c 2006-12-09 11:56:07.000000000 -0700
@@ -34,6 +34,8 @@
DECL("lock", VC_NXF_INFO_LOCK),
DECL("private", VC_NXF_INFO_PRIVATE),
+ DECL("single_ip", VC_NXF_SINGLE_IP),
+
DECL("hide_netif", VC_NXF_HIDE_NETIF),
DECL("state_setup", VC_NXF_STATE_SETUP),
diff -ur ./lib/syscall_ctxmigrate.c ../0.30.212-1/lib/syscall_ctxmigrate.c
--- ./lib/syscall_ctxmigrate.c 2006-10-07 13:32:22.000000000 -0600
+++ ../0.30.212-1/lib/syscall_ctxmigrate.c 2006-12-09 11:56:07.000000000 -0700
@@ -21,17 +21,26 @@
#endif
#include "vserver.h"
-#include "vserver-internal.h"
#include "virtual.h"
+#if defined(VC_ENABLE_API_V13) && defined(VC_ENABLE_API_V21)
+# define VC_MULTIVERSION_SYSCALL 1
+#endif
+#include "vserver-internal.h"
+
#if defined(VC_ENABLE_API_V13)
# include "syscall_ctxmigrate-v13.hc"
#endif
-#if defined(VC_ENABLE_API_V13)
+#if defined(VC_ENABLE_API_V21)
+# include "syscall_ctxmigrate-v21.hc"
+#endif
+
+#if defined(VC_ENABLE_API_V13) || defined(VC_ENABLE_API_V21)
int
vc_ctx_migrate(xid_t xid)
{
- CALL_VC(CALL_VC_V13A(vc_ctx_migrate, xid));
+ CALL_VC(CALL_VC_SPACES(vc_ctx_migrate, xid),
+ CALL_VC_V13A (vc_ctx_migrate, xid));
}
#endif
diff -ur ./lib/syscall_enternamespace.c ../0.30.212-1/lib/syscall_enternamespace.c
--- ./lib/syscall_enternamespace.c 2006-10-07 13:32:22.000000000 -0600
+++ ../0.30.212-1/lib/syscall_enternamespace.c 2006-12-09 11:56:07.000000000 -0700
@@ -23,14 +23,24 @@
#include "vserver.h"
#include "virtual.h"
+#if defined(VC_ENABLE_API_V13) && defined(VC_ENABLE_API_V21)
+# define VC_MULTIVERSION_SYSCALL 1
+#endif
#include "vserver-internal.h"
#ifdef VC_ENABLE_API_V13
# include "syscall_enternamespace-v13.hc"
#endif
+#ifdef VC_ENABLE_API_V21
+# include "syscall_enternamespace-v21.hc"
+#endif
+
+#if defined(VC_ENABLE_API_V13) || defined(VC_ENABLE_API_V21)
int
-vc_enter_namespace(xid_t xid)
+vc_enter_namespace(xid_t xid, uint_least64_t mask)
{
- CALL_VC(CALL_VC_V13(vc_enter_namespace, xid));
+ CALL_VC(CALL_VC_SPACES(vc_enter_namespace, xid, mask),
+ CALL_VC_V13 (vc_enter_namespace, xid, mask));
}
+#endif
diff -ur ./lib/syscall_enternamespace-v13.hc ../0.30.212-1/lib/syscall_enternamespace-v13.hc
--- ./lib/syscall_enternamespace-v13.hc 2006-10-07 13:32:22.000000000 -0600
+++ ../0.30.212-1/lib/syscall_enternamespace-v13.hc 2006-12-09 11:56:07.000000000 -0700
@@ -23,7 +23,9 @@
#include "vserver.h"
static inline ALWAYSINLINE int
-vc_enter_namespace_v13(xid_t xid)
+vc_enter_namespace_v13(xid_t xid, uint_least64_t mask)
{
- return vserver(VCMD_enter_namespace, CTX_USER2KERNEL(xid), 0);
+ if ((mask & (CLONE_NEWNS|CLONE_FS)) == 0)
+ return 0;
+ return vserver(VCMD_enter_space_v0, CTX_USER2KERNEL(xid), 0);
}
diff -ur ./lib/syscall_getvci.c ../0.30.212-1/lib/syscall_getvci.c
--- ./lib/syscall_getvci.c 2007-03-04 12:25:45.000000000 -0700
+++ ../0.30.212-1/lib/syscall_getvci.c 2006-12-09 11:56:07.000000000 -0700
@@ -33,7 +33,7 @@
int
vc_get_vci()
{
- CALL_VC(CALL_VC_V21(vc_get_vci));
+ CALL_VC(CALL_VC_V21(vc_get_vci, 0));
}
#endif
diff -ur ./lib/syscall_getvci-v21.hc ../0.30.212-1/lib/syscall_getvci-v21.hc
--- ./lib/syscall_getvci-v21.hc 2007-03-04 12:25:45.000000000 -0700
+++ ../0.30.212-1/lib/syscall_getvci-v21.hc 2006-12-09 11:56:07.000000000 -0700
@@ -21,7 +21,7 @@
#endif
static inline ALWAYSINLINE int
-vc_get_vci_v21()
+vc_get_vci_v21(int UNUSED tmp)
{
return vserver(VCMD_get_vci, 0, 0);
}
diff -ur ./lib/syscall_setnamespace.c ../0.30.212-1/lib/syscall_setnamespace.c
--- ./lib/syscall_setnamespace.c 2006-10-07 13:32:22.000000000 -0600
+++ ../0.30.212-1/lib/syscall_setnamespace.c 2006-12-09 11:56:07.000000000 -0700
@@ -23,14 +23,24 @@
#include "vserver.h"
#include "virtual.h"
+#if defined(VC_ENABLE_API_V13) && defined(VC_ENABLE_API_V21)
+# define VC_MULTIVERSION_SYSCALL 1
+#endif
#include "vserver-internal.h"
#ifdef VC_ENABLE_API_V13
# include "syscall_setnamespace-v13.hc"
#endif
+#ifdef VC_ENABLE_API_V21
+# include "syscall_setnamespace-v21.hc"
+#endif
+
+#if defined(VC_ENABLE_API_V13) || defined(VC_ENABLE_API_V21)
int
-vc_set_namespace()
+vc_set_namespace(xid_t xid, uint_least64_t mask)
{
- CALL_VC(CALL_VC_V13(vc_set_namespace,0));
+ CALL_VC(CALL_VC_SPACES(vc_set_namespace, xid, mask),
+ CALL_VC_V13 (vc_set_namespace, xid, mask));
}
+#endif
diff -ur ./lib/syscall_setnamespace-v13.hc ../0.30.212-1/lib/syscall_setnamespace-v13.hc
--- ./lib/syscall_setnamespace-v13.hc 2006-10-07 13:32:22.000000000 -0600
+++ ../0.30.212-1/lib/syscall_setnamespace-v13.hc 2006-12-09 11:56:07.000000000 -0700
@@ -23,7 +23,9 @@
#include "vserver.h"
static inline ALWAYSINLINE int
-vc_set_namespace_v13(int UNUSED tmp)
+vc_set_namespace_v13(xid_t xid, uint_least64_t mask)
{
- return vserver(VCMD_set_namespace_v0, -1, 0);
+ if ((mask & (CLONE_NEWNS|CLONE_FS)) == 0)
+ return 0;
+ return vserver(VCMD_set_space_v0, CTX_USER2KERNEL(xid), 0);
}
diff -ur ./lib/virtual.h ../0.30.212-1/lib/virtual.h
--- ./lib/virtual.h 2006-10-07 13:32:22.000000000 -0600
+++ ../0.30.212-1/lib/virtual.h 2006-12-09 11:56:07.000000000 -0700
@@ -19,20 +19,18 @@
#ifndef H_UTIL_VSERVER_LIB_VIRTUAL_H
#define H_UTIL_VSERVER_LIB_VIRTUAL_H
-#include <kernel/context.h>
#include <kernel/context_cmd.h>
#include <kernel/cvirt_cmd.h>
#include <kernel/cvirt_cmd.h>
-#include <kernel/dlimit.h>
#include <kernel/dlimit_cmd.h>
#include <kernel/inode_cmd.h>
#include <kernel/limit_cmd.h>
-#include <kernel/namespace_cmd.h>
+#include <kernel/space_cmd.h>
+#include <kernel/network.h>
#include <kernel/network_cmd.h>
#include <kernel/sched_cmd.h>
#include <kernel/signal_cmd.h>
-#include <kernel/network.h>
#include <kernel/legacy.h>
#endif // H_UTIL_VSERVER_LIB_VIRTUAL_H
diff -ur ./lib/vserver.h ../0.30.212-1/lib/vserver.h
--- ./lib/vserver.h 2007-03-04 12:25:45.000000000 -0700
+++ ../0.30.212-1/lib/vserver.h 2006-12-09 11:56:07.000000000 -0700
@@ -28,6 +28,7 @@
#include <stdlib.h>
#include <stdbool.h>
#include <sys/types.h>
+#include <sched.h>
#ifndef IS_DOXYGEN
#if defined(__GNUC__)
@@ -232,6 +233,8 @@
#define VC_NXF_INFO_LOCK 0x00000001ull
#define VC_NXF_INFO_PRIVATE 0x00000008ull
+#define VC_NXF_SINGLE_IP 0x00000100ull
+
#define VC_NXF_HIDE_NETIF 0x02000000ull
#define VC_NXF_STATE_SETUP (1ULL<<32)
@@ -249,6 +252,23 @@
#define VC_VLIMIT_SEMARY 20
#define VC_VLIMIT_NSEMS 21
#define VC_VLIMIT_DENTRY 22
+#define VC_VLIMIT_MAPPED 23
+
+
+// the VCI bit values
+#define VC_VCI_NO_DYNAMIC (1 << 0)
+#define VC_VCI_SPACES (1 << 10)
+
+
+#ifndef CLONE_NEWNS
+# define CLONE_NEWNS 0x00020000
+#endif
+#ifndef CLONE_NEWUTS
+# define CLONE_NEWUTS 0x04000000
+#endif
+#ifndef CLONE_NEWIPC
+# define CLONE_NEWIPC 0x08000000
+#endif
@@ -605,9 +625,10 @@
/** Returns true iff \a xid is a dynamic xid */
bool vc_is_dynamic_xid(xid_t xid);
- int vc_enter_namespace(xid_t xid);
- int vc_set_namespace();
+ int vc_enter_namespace(xid_t xid, uint_least64_t mask);
+ int vc_set_namespace(xid_t xid, uint_least64_t mask);
int vc_cleanup_namespace();
+ uint_least64_t vc_get_space_mask();
/** \brief Flags of process-contexts
diff -ur ./lib/vserver-internal.h ../0.30.212-1/lib/vserver-internal.h
--- ./lib/vserver-internal.h 2007-03-04 12:25:45.000000000 -0700
+++ ../0.30.212-1/lib/vserver-internal.h 2006-12-09 11:56:07.000000000 -0700
@@ -41,12 +41,16 @@
#define CALL_VC_NOOP vc_noop0()
#define CALL_VC_GENERAL(ID, SUFFIX, FUNC, ...) \
VC_PREFIX; VC_SELECT(ID) return FUNC ## _ ## SUFFIX(__VA_ARGS__); VC_SUFFIX
+#define CALL_VC_GENERAL_CONFIG(BIT, SUFFIX, FUNC, ...) \
+ VC_PREFIX; VC_CBIT(BIT) return FUNC ## _ ## SUFFIX(__VA_ARGS__); VC_SUFFIX
#ifdef VC_MULTIVERSION_SYSCALL
# define VC_SELECT(ID) if (ver>=(ID))
+# define VC_CBIT(BIT) if ((conf&BIT) == BIT)
# define CALL_VC(...) \
do { \
int ver = utilvserver_checkCompatVersion(); \
+ int UNUSED conf = utilvserver_checkCompatConfig(); \
if (ver==-1) return -1; \
VC_SUFFIX, __VA_ARGS__, VC_PREFIX; \
errno = ENOSYS; \
@@ -54,6 +58,7 @@
} while (0)
#else
# define VC_SELECT(ID) if (1)
+# define VC_CBIT(BIT) if (1)
# define CALL_VC(...) \
do { \
if (1) {} VC_SUFFIX, __VA_ARGS__, VC_PREFIX; \
@@ -103,13 +108,17 @@
# define CALL_VC_V13OBS(F,...) CALL_VC_NOOP
#endif
-
#ifdef VC_ENABLE_API_V21
# define CALL_VC_V21(F,...) CALL_VC_GENERAL(0x00020100, v21, F, __VA_ARGS__)
#else
# define CALL_VC_V21(F,...) CALL_VC_NOOP
#endif
+#ifdef VC_ENABLE_API_V21
+# define CALL_VC_SPACES(F,...) CALL_VC_GENERAL_CONFIG(VC_VCI_SPACES, spaces, F, __VA_ARGS__)
+#else
+# define CALL_VC_SPACES(F,...) CALL_VC_NOOP
+#endif
#ifdef VC_ENABLE_API_NET
# define CALL_VC_NET(F,...) CALL_VC_GENERAL(0x00010016, net, F, __VA_ARGS__)
diff -ur ./lib_internal/sys_clone.h ../0.30.212-1/lib_internal/sys_clone.h
--- ./lib_internal/sys_clone.h 2006-10-07 13:32:22.000000000 -0600
+++ ../0.30.212-1/lib_internal/sys_clone.h 2006-12-09 11:56:07.000000000 -0700
@@ -23,10 +23,6 @@
#include "lib/syscall-wrap.h"
#define __NR__sys_clone __NR_clone
-#ifndef CLONE_NEWNS
-# define CLONE_NEWNS 0x00020000
-#endif
-
#ifndef ENSC_SYSCALL_TRADITIONAL
# include <errno.h>
diff -ur ./scripts/functions ../0.30.212-1/scripts/functions
--- ./scripts/functions 2007-03-04 12:25:45.000000000 -0700
+++ ../0.30.212-1/scripts/functions 2006-12-09 11:56:07.000000000 -0700
@@ -268,13 +268,27 @@
_VS_LOCKS="$@"
}
+function get_init_cwd
+{
+ if test -n "$INIT_CWD"; then
+ echo "$INIT_CWD"
+ else
+ pwd
+ fi
+}
+function set_init_cwd
+{
+ INIT_CWD="`pwd`"
+ export INIT_CWD
+}
+
function _getVserverDir
{
local vserver="$1"
case "$vserver" in
- ./*) VSERVER_DIR=`pwd`/$vserver ;;
- /*) VSERVER_DIR=$vserver ;;
- *) VSERVER_DIR=$__CONFDIR/$vserver;;
+ ./*) VSERVER_DIR="`get_init_cwd`/$vserver";;
+ /*) VSERVER_DIR="$vserver" ;;
+ *) VSERVER_DIR="$__CONFDIR/$vserver" ;;
esac
}
@@ -622,13 +636,17 @@
eval read "$_gfv_var" <"$_gfv_file"
}
-## Called as 'getFileArray <varname> <filename>'
+## Called as 'getFileArray <varname> <filename>+'
function getFileArray
{
- test -r "$2" || return 1
-
+ local _gfa_var=$1
+ local _gfa_file
+ shift
+
+ findFile _gfa_file "$@" ''
+ test -n "$_gfa_file" -a -r "$_gfa_file" || return 0
local IFS=$_VS_NEWLINE
- eval "$1"='( $(< "$2") )'
+ eval "$_gfa_var"='( $(< "$_gfa_file") )'
}
function checkComponents
@@ -711,10 +729,10 @@
#$_VKILL -s CONT --xid "$1" 1 &>/dev/null || :
}
-function useVlogin
-{
- test ! -e "$__CONFDIR/.defaults/apps/vlogin/disable"
-}
+function useVlogin
+{
+ test ! -e "$__CONFDIR/.defaults/apps/vlogin/disable"
+}
## Usage: pkgmgmt.guessStyle <vserver> <resultvar>
function pkgmgmt.guessStyle()
diff -ur ./scripts/vserver ../0.30.212-1/scripts/vserver
--- ./scripts/vserver 2007-03-04 12:25:45.000000000 -0700
+++ ../0.30.212-1/scripts/vserver 2006-12-09 11:56:07.000000000 -0700
@@ -206,6 +206,9 @@
! isVserverRunning "$VSERVER_DIR" || \
exec $_VNAMESPACE --enter "$VSERVER_DIR" -- $_VSERVER ----nonamespace "${OPTIONS_ORIG[@]}"
+set_init_cwd
+cd /
+
. $__PKGLIBDIR/vserver.functions
case "$2" in
(start|stop|delete)
diff -ur ./scripts/vserver.functions ../0.30.212-1/scripts/vserver.functions
--- ./scripts/vserver.functions 2007-03-04 12:25:45.000000000 -0700
+++ ../0.30.212-1/scripts/vserver.functions 2006-12-09 11:56:07.000000000 -0700
@@ -1199,7 +1199,7 @@
# these are things that have to be accessible post-cleanup
for tmp in "$root" "$__SBINDIR" "$__PKGLIBDIR" "$vdir" \
- "$__PKGSTATEDIR" "`pwd`" "${skip[@]}"; do
+ "$__PKGSTATEDIR" "${skip[@]}"; do
while test -n "$tmp"; do
list=( "${list[@]}" "$tmp" )
tmp="${tmp%/*}"
diff -ur ./src/chroot-sh.c ../0.30.212-1/src/chroot-sh.c
--- ./src/chroot-sh.c 2007-03-04 12:25:45.000000000 -0700
+++ ../0.30.212-1/src/chroot-sh.c 2006-12-09 11:56:07.000000000 -0700
@@ -178,6 +178,7 @@
if (!isNumberUnsigned(argv[1], &mode, 1)) {
WRITE_MSG(2, "Invalid mode: '");
WRITE_STR(2, argv[1]);
+ WRITE_MSG(2, "'\n");
return EXIT_FAILURE;
}
diff -ur ./src/ncontext.c ../0.30.212-1/src/ncontext.c
--- ./src/ncontext.c 2007-03-04 12:25:45.000000000 -0700
+++ ../0.30.212-1/src/ncontext.c 2006-12-09 11:56:07.000000000 -0700
@@ -183,7 +183,7 @@
}
static inline ALWAYSINLINE int
-doit(struct Arguments const *args, int argc, char *argv[])
+doit(struct Arguments const *args, char *argv[])
{
int p[2][2];
pid_t pid = initSync(p, args->do_disconnect);
@@ -279,7 +279,7 @@
args.nid = Evc_get_task_nid(0);
if (!args.do_create && !args.do_migrate)
- WRITE_MSG(2, "Neither '--create' nor '--migrate specified; try '--help' for more information\n");
+ WRITE_MSG(2, "Neither '--create' nor '--migrate' specified; try '--help' for more information\n");
else if (args.do_create && args.do_migrate)
WRITE_MSG(2, "Can not specify '--create' and '--migrate' at the same time; try '--help' for more information\n");
else if (!args.do_create && args.nid==VC_DYNAMIC_XID)
@@ -287,7 +287,7 @@
else if (optind>=argc)
WRITE_MSG(2, "No command given; use '--help' for more information.\n");
else
- return doit(&args, argc, argv);
+ return doit(&args, argv);
return wrapper_exit_code;
}
diff -ur ./src/vcontext.c ../0.30.212-1/src/vcontext.c
--- ./src/vcontext.c 2006-10-07 13:32:22.000000000 -0600
+++ ../0.30.212-1/src/vcontext.c 2006-12-09 11:56:07.000000000 -0700
@@ -274,8 +274,8 @@
if (args->do_chroot) {
Echroot(".");
if (args->set_namespace) {
- if (args->do_migrateself) Evc_set_namespace();
- else if (args->do_migrate) Evc_enter_namespace(xid);
+ if (args->do_migrateself) Evc_set_namespace(xid, 0);
+ else if (args->do_migrate) Evc_enter_namespace(xid, 0);
}
}
@@ -438,7 +438,7 @@
args.xid = Evc_get_task_xid(0);
if (!args.do_create && !args.do_migrate)
- WRITE_MSG(2, "Neither '--create' nor '--migrate specified; try '--help' for more information\n");
+ WRITE_MSG(2, "Neither '--create' nor '--migrate' specified; try '--help' for more information\n");
else if (args.do_create && args.do_migrate)
WRITE_MSG(2, "Can not specify '--create' and '--migrate' at the same time; try '--help' for more information\n");
else if (!args.do_migrate && args.is_initpid)
diff -ur ./src/vdlimit.c ../0.30.212-1/src/vdlimit.c
--- ./src/vdlimit.c 2006-10-07 13:32:22.000000000 -0600
+++ ../0.30.212-1/src/vdlimit.c 2006-12-09 11:56:07.000000000 -0700
@@ -21,7 +21,6 @@
#endif
#include "util.h"
-#include <lib_internal/sys_clone.h>
#include <lib/internal.h>
#include <vserver.h>
diff -ur ./src/vnamespace.c ../0.30.212-1/src/vnamespace.c
--- ./src/vnamespace.c 2007-03-04 12:25:45.000000000 -0700
+++ ../0.30.212-1/src/vnamespace.c 2006-12-09 11:56:07.000000000 -0700
@@ -36,13 +36,6 @@
#define ENSC_WRAPPERS_VSERVER 1
#include <wrappers.h>
-#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 @@
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 @@
}
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 @@
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<argc)
EexecvpD(argv[optind], argv+optind);
diff -ur ./src/vsched.c ../0.30.212-1/src/vsched.c
--- ./src/vsched.c 2007-03-04 12:25:45.000000000 -0700
+++ ../0.30.212-1/src/vsched.c 2006-12-09 11:56:07.000000000 -0700
@@ -31,6 +31,7 @@
#include <dirent.h>
#include <fcntl.h>
#include <sys/stat.h>
+#include <stddef.h>
#define ENSC_WRAPPERS_PREFIX "vsched: "
#define ENSC_WRAPPERS_VSERVER 1
@@ -168,6 +169,8 @@
if (strcmp(name, opt->name) == 0)
break;
}
+ if (opt->name == 0)
+ return;
fd = Eopen(name, O_RDONLY, 0);
len = Eread(fd, buf, sizeof(buf)-1);
Reply to: