[Devel] [patch -mm] utsname namespace : fix unshare when CONFIG_UTS_NS is not set
Cedric Le Goater
clg at fr.ibm.com
Thu Sep 14 08:36:59 PDT 2006
If the kernel is not configured with the CONFIG_UTS_NS, unshare of
ipc namespace will fail and return -EINVAL.
The patch changes the dummy unshare_utsname() to check the clone flags
before returning.
Signed-off-by: Cedric Le Goater <clg at fr.ibm.com>
Cc: Andrew Morton <akpm at osdl.org>
Cc: Serge E. Hallyn <serue at us.ibm.com>
Cc: Linux Containers <containers at lists.osdl.org>
---
include/linux/utsname.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
Index: 2.6.18-rc6-mm2/include/linux/utsname.h
===================================================================
--- 2.6.18-rc6-mm2.orig/include/linux/utsname.h
+++ 2.6.18-rc6-mm2/include/linux/utsname.h
@@ -60,8 +60,12 @@ static inline void put_uts_ns(struct uts
static inline int unshare_utsname(unsigned long unshare_flags,
struct uts_namespace **new_uts)
{
- return -EINVAL;
+ if (unshare_flags & CLONE_NEWUTS)
+ return -EINVAL;
+
+ return 0;
}
+
static inline int copy_utsname(int flags, struct task_struct *tsk)
{
return 0;
_______________________________________________
Containers mailing list
Containers at lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers
More information about the Devel
mailing list