From: Serge E. Hallyn Date: Tue, 27 Mar 2007 05:32:22 +0000 (-0800) Subject: [PATCH] utsns: fix !CONFIG_UTS_NS behavior X-Git-Tag: v2.6.21-rc6~100 X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;h=78d832f62643ac6209beccbfb29228314423935e;p=cascardo%2Flinux.git [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 Cc: "Eric W. Biederman" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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)