提交 78d832f6 编写于 作者: S Serge E. Hallyn 提交者: Linus Torvalds

[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: NSerge E. Hallyn <serue@us.ibm.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 62b3e920
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册