diff options
| author | Serge E. Hallyn <serue@us.ibm.com> | 2007-03-27 01:32:31 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-03-27 12:05:16 -0400 |
| commit | a28d193cbf01375974683c13e99a52ef489e5eb0 (patch) | |
| tree | d252eeefa13627847f87f2a72a5cdfd3d3484973 /include | |
| parent | d1985ad1da28eac507d855af8099f6010c51b167 (diff) | |
[PATCH] ipcns: fix !CONFIG_IPC_NS behavior
When CONFIG_IPC_NS=n, clone(CLONE_NEWIPC) claims success, but did not actually
clone a new IPC namespace.
Fix this to return -EINVAL so the caller knows his request was denied.
Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/ipc.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/include/linux/ipc.h b/include/linux/ipc.h index 636094c29b16..6da6772c19ff 100644 --- a/include/linux/ipc.h +++ b/include/linux/ipc.h | |||
| @@ -92,19 +92,16 @@ extern struct ipc_namespace init_ipc_ns; | |||
| 92 | 92 | ||
| 93 | #ifdef CONFIG_SYSVIPC | 93 | #ifdef CONFIG_SYSVIPC |
| 94 | #define INIT_IPC_NS(ns) .ns = &init_ipc_ns, | 94 | #define INIT_IPC_NS(ns) .ns = &init_ipc_ns, |
| 95 | extern int copy_ipcs(unsigned long flags, struct task_struct *tsk); | ||
| 95 | #else | 96 | #else |
| 96 | #define INIT_IPC_NS(ns) | 97 | #define INIT_IPC_NS(ns) |
| 98 | static inline int copy_ipcs(unsigned long flags, struct task_struct *tsk) | ||
| 99 | { return 0; } | ||
| 97 | #endif | 100 | #endif |
| 98 | 101 | ||
| 99 | #ifdef CONFIG_IPC_NS | 102 | #ifdef CONFIG_IPC_NS |
| 100 | extern void free_ipc_ns(struct kref *kref); | 103 | extern void free_ipc_ns(struct kref *kref); |
| 101 | extern int copy_ipcs(unsigned long flags, struct task_struct *tsk); | ||
| 102 | extern int unshare_ipcs(unsigned long flags, struct ipc_namespace **ns); | 104 | extern int unshare_ipcs(unsigned long flags, struct ipc_namespace **ns); |
| 103 | #else | ||
| 104 | static inline int copy_ipcs(unsigned long flags, struct task_struct *tsk) | ||
| 105 | { | ||
| 106 | return 0; | ||
| 107 | } | ||
| 108 | #endif | 105 | #endif |
| 109 | 106 | ||
| 110 | static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) | 107 | static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) |
