mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-02 03:52:33 +00:00
userns: Store uid and gid values in struct cred with kuid_t and kgid_t types
cred.h and a few trivial users of struct cred are changed. The rest of the users of struct cred are left for other patches as there are too many changes to make in one go and leave the change reviewable. If the user namespace is disabled and CONFIG_UIDGID_STRICT_TYPE_CHECKS are disabled the code will contiue to compile and behave correctly. Acked-by: Serge Hallyn <serge.hallyn@canonical.com> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
This commit is contained in:
parent
ae2975bc34
commit
078de5f706
10 changed files with 59 additions and 62 deletions
|
@ -70,15 +70,15 @@ static inline void put_user_ns(struct user_namespace *ns)
|
|||
#endif
|
||||
|
||||
static inline uid_t user_ns_map_uid(struct user_namespace *to,
|
||||
const struct cred *cred, uid_t uid)
|
||||
const struct cred *cred, kuid_t uid)
|
||||
{
|
||||
return from_kuid_munged(to, make_kuid(cred->user_ns, uid));
|
||||
return from_kuid_munged(to, uid);
|
||||
}
|
||||
|
||||
static inline gid_t user_ns_map_gid(struct user_namespace *to,
|
||||
const struct cred *cred, gid_t gid)
|
||||
const struct cred *cred, kgid_t gid)
|
||||
{
|
||||
return from_kgid_munged(to, make_kgid(cred->user_ns, gid));
|
||||
return from_kgid_munged(to, gid);
|
||||
}
|
||||
|
||||
#endif /* _LINUX_USER_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue