summaryrefslogtreecommitdiffstats
path: root/include/linux/utsname.h
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2012-07-26 07:02:49 -0400
committerEric W. Biederman <ebiederm@xmission.com>2012-11-20 07:17:43 -0500
commitbcf58e725ddc45d31addbc6627d4f0edccc824c1 (patch)
treee6dff2fbed40f26d8c45f78e23a7476527573bf1 /include/linux/utsname.h
parent142e1d1d5f088e7a38659daca6e84a730967774a (diff)
userns: Make create_new_namespaces take a user_ns parameter
Modify create_new_namespaces to explicitly take a user namespace parameter, instead of implicitly through the task_struct. This allows an implementation of unshare(CLONE_NEWUSER) where the new user namespace is not stored onto the current task_struct until after all of the namespaces are created. Acked-by: Serge Hallyn <serge.hallyn@canonical.com> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'include/linux/utsname.h')
-rw-r--r--include/linux/utsname.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/utsname.h b/include/linux/utsname.h
index 2b345206722a..221f4a0a7502 100644
--- a/include/linux/utsname.h
+++ b/include/linux/utsname.h
@@ -33,7 +33,7 @@ static inline void get_uts_ns(struct uts_namespace *ns)
33} 33}
34 34
35extern struct uts_namespace *copy_utsname(unsigned long flags, 35extern struct uts_namespace *copy_utsname(unsigned long flags,
36 struct task_struct *tsk); 36 struct user_namespace *user_ns, struct uts_namespace *old_ns);
37extern void free_uts_ns(struct kref *kref); 37extern void free_uts_ns(struct kref *kref);
38 38
39static inline void put_uts_ns(struct uts_namespace *ns) 39static inline void put_uts_ns(struct uts_namespace *ns)
@@ -50,12 +50,12 @@ static inline void put_uts_ns(struct uts_namespace *ns)
50} 50}
51 51
52static inline struct uts_namespace *copy_utsname(unsigned long flags, 52static inline struct uts_namespace *copy_utsname(unsigned long flags,
53 struct task_struct *tsk) 53 struct user_namespace *user_ns, struct uts_namespace *old_ns)
54{ 54{
55 if (flags & CLONE_NEWUTS) 55 if (flags & CLONE_NEWUTS)
56 return ERR_PTR(-EINVAL); 56 return ERR_PTR(-EINVAL);
57 57
58 return tsk->nsproxy->uts_ns; 58 return old_ns;
59} 59}
60#endif 60#endif
61 61