summaryrefslogtreecommitdiff
blob: 3eb9d2bf3d1d5009e443cff44c9fc6dce1b50411 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Index: linux-2.6.17/kernel/vserver/context.c
===================================================================
--- linux-2.6.17.orig/kernel/vserver/context.c
+++ linux-2.6.17/kernel/vserver/context.c
@@ -847,16 +847,21 @@ int vc_ctx_create(uint32_t xid, void __u
 int vc_ctx_migrate(struct vx_info *vxi, void __user *data)
 {
 	struct vcmd_ctx_migrate vc_data = { .flagword = 0 };
+	int ret;
 
 	if (data && copy_from_user (&vc_data, data, sizeof(vc_data)))
 		return -EFAULT;
 
-	vx_migrate_task(current, vxi);
+	ret = vx_migrate_task(current, vxi);
+	if (ret)
+		return ret;
 	if (vc_data.flagword & VXM_SET_INIT)
-		vx_set_init(vxi, current);
+		ret = vx_set_init(vxi, current);
+	if (ret)
+		return ret;
 	if (vc_data.flagword & VXM_SET_REAPER)
-		vx_set_reaper(vxi, current);
-	return 0;
+		ret = vx_set_reaper(vxi, current);
+	return ret;
 }
 
 
@@ -890,8 +895,14 @@ int vc_set_cflags(struct vx_info *vxi, v
 		if (trigger & VXF_STATE_SETUP)
 			vx_mask_cap_bset(vxi, current);
 		if (trigger & VXF_STATE_INIT) {
-			vx_set_init(vxi, current);
-			vx_set_reaper(vxi, current);
+			int ret;
+
+			ret = vx_set_init(vxi, current);
+			if (ret)
+				return ret;
+			ret = vx_set_reaper(vxi, current);
+			if (ret)
+				return ret;
 		}
 	}
 
Index: linux-2.6.17/kernel/vserver/switch.c
===================================================================
--- linux-2.6.17.orig/kernel/vserver/switch.c
+++ linux-2.6.17/kernel/vserver/switch.c
@@ -335,7 +335,7 @@ long do_vserver(uint32_t cmd, uint32_t i
 		VC_VERSION(cmd), id, data, compat,
 		perm, args, flags);
 
-	ret = -EPERM;
+	ret = -ENOSYS;
 	if (perm < 0)
 		goto out;