All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch -mm] utsname namespace : fix unshare when CONFIG_UTS_NS is not set
@ 2006-09-14 15:36 Cedric Le Goater
  2006-09-14 15:51 ` Serge E. Hallyn
  0 siblings, 1 reply; 2+ messages in thread
From: Cedric Le Goater @ 2006-09-14 15:36 UTC (permalink / raw)
  To: Linux Kernel Mailing List
  Cc: Andrew Morton, Serge E. Hallyn, Linux Containers

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@fr.ibm.com>
Cc: Andrew Morton <akpm@osdl.org>
Cc: Serge E. Hallyn <serue@us.ibm.com>
Cc: Linux Containers <containers@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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-09-14 15:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-14 15:36 [patch -mm] utsname namespace : fix unshare when CONFIG_UTS_NS is not set Cedric Le Goater
2006-09-14 15:51 ` Serge E. Hallyn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.