.. | .. |
---|
35 | 35 | struct mnt_namespace *mnt_ns; |
---|
36 | 36 | struct pid_namespace *pid_ns_for_children; |
---|
37 | 37 | struct net *net_ns; |
---|
| 38 | + struct time_namespace *time_ns; |
---|
| 39 | + struct time_namespace *time_ns_for_children; |
---|
38 | 40 | struct cgroup_namespace *cgroup_ns; |
---|
39 | 41 | }; |
---|
40 | 42 | extern struct nsproxy init_nsproxy; |
---|
41 | 43 | |
---|
42 | 44 | /* |
---|
| 45 | + * A structure to encompass all bits needed to install |
---|
| 46 | + * a partial or complete new set of namespaces. |
---|
| 47 | + * |
---|
| 48 | + * If a new user namespace is requested cred will |
---|
| 49 | + * point to a modifiable set of credentials. If a pointer |
---|
| 50 | + * to a modifiable set is needed nsset_cred() must be |
---|
| 51 | + * used and tested. |
---|
| 52 | + */ |
---|
| 53 | +struct nsset { |
---|
| 54 | + unsigned flags; |
---|
| 55 | + struct nsproxy *nsproxy; |
---|
| 56 | + struct fs_struct *fs; |
---|
| 57 | + const struct cred *cred; |
---|
| 58 | +}; |
---|
| 59 | + |
---|
| 60 | +static inline struct cred *nsset_cred(struct nsset *set) |
---|
| 61 | +{ |
---|
| 62 | + if (set->flags & CLONE_NEWUSER) |
---|
| 63 | + return (struct cred *)set->cred; |
---|
| 64 | + |
---|
| 65 | + return NULL; |
---|
| 66 | +} |
---|
| 67 | + |
---|
| 68 | +/* |
---|
43 | 69 | * the namespaces access rules are: |
---|
44 | 70 | * |
---|
45 | 71 | * 1. only current task is allowed to change tsk->nsproxy pointer or |
---|