]> Git Repo - linux.git/commitdiff
[PATCH] utsns: fix !CONFIG_UTS_NS behavior
authorSerge E. Hallyn <[email protected]>
Tue, 27 Mar 2007 05:32:22 +0000 (21:32 -0800)
committerLinus Torvalds <[email protected]>
Tue, 27 Mar 2007 16:05:15 +0000 (09:05 -0700)
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 <[email protected]>
Cc: "Eric W. Biederman" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/utsname.h

index a4555fe3754cdb639775d5152307692d186a1151..e10267d402c5b982d46869d1c4f49345081b7f5c 100644 (file)
@@ -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)
This page took 0.06739 seconds and 4 git commands to generate.