summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSerge E. Hallyn <serue@us.ibm.com>2007-03-27 07:32:22 +0200
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-27 18:05:15 +0200
commit78d832f62643ac6209beccbfb29228314423935e (patch)
tree07f438ab6e780f39adf8c98d8f0d2f36b9c9ebc4 /include
parent[PATCH] tty: minor merge correction (diff)
downloadlinux-78d832f62643ac6209beccbfb29228314423935e.tar.xz
linux-78d832f62643ac6209beccbfb29228314423935e.zip
[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> 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/utsname.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/utsname.h b/include/linux/utsname.h
index a4555fe3754c..e10267d402c5 100644
--- a/include/linux/utsname.h
+++ b/include/linux/utsname.h
@@ -70,6 +70,8 @@ static inline int unshare_utsname(unsigned long unshare_flags,
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)