mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] utsns: fix !CONFIG_UTS_NS behavior
@ 2007-03-23 20:00 Serge E. Hallyn
  2007-03-25  9:07 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Serge E. Hallyn @ 2007-03-23 20:00 UTC (permalink / raw)
  To: lkml

From: "Serge E. Hallyn" <serue@us.ibm.com>
Subject: [PATCH] utsns: fix !CONFIG_UTS_NS behavior

When CONFIG_UTS_NS=n, clone(CLONE_NEWUTS) quietly refuses.  So correctly does
not unshare a new uts namespace, but also does not return -EINVAL.

Fix this to return -EINVAL so the caller knows his request was denied.

Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>

---

 include/linux/utsname.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

bc350994ac67df8f1b917f9979c065d87757eabe
diff --git a/include/linux/utsname.h b/include/linux/utsname.h
index a4555fe..e10267d 100644
--- a/include/linux/utsname.h
+++ b/include/linux/utsname.h
@@ -70,6 +70,8 @@ static inline int unshare_utsname(unsign
 
 static inline int copy_utsname(int flags, struct task_struct *tsk)
 {
+	if (flags & CLONE_NEWUTS)
+		return -EINVAL;
 	return 0;
 }
 static inline void put_uts_ns(struct uts_namespace *ns)
-- 
1.1.6

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

end of thread, other threads:[~2007-03-25 16:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-23 20:00 [PATCH] utsns: fix !CONFIG_UTS_NS behavior Serge E. Hallyn
2007-03-25  9:07 ` Andrew Morton
2007-03-25 16:16   ` Serge E. Hallyn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®