mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
userns: Convert in_group_p and in_egroup_p to use kgid_t
Acked-by: Serge Hallyn <serge.hallyn@canonical.com> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
This commit is contained in:
@@ -256,27 +256,25 @@ SYSCALL_DEFINE2(setgroups, int, gidsetsize, gid_t __user *, grouplist)
|
||||
/*
|
||||
* Check whether we're fsgid/egid or in the supplemental group..
|
||||
*/
|
||||
int in_group_p(gid_t grp)
|
||||
int in_group_p(kgid_t grp)
|
||||
{
|
||||
const struct cred *cred = current_cred();
|
||||
int retval = 1;
|
||||
|
||||
if (grp != cred->fsgid)
|
||||
retval = groups_search(cred->group_info,
|
||||
make_kgid(cred->user_ns, grp));
|
||||
if (!gid_eq(grp, cred->fsgid))
|
||||
retval = groups_search(cred->group_info, grp);
|
||||
return retval;
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(in_group_p);
|
||||
|
||||
int in_egroup_p(gid_t grp)
|
||||
int in_egroup_p(kgid_t grp)
|
||||
{
|
||||
const struct cred *cred = current_cred();
|
||||
int retval = 1;
|
||||
|
||||
if (grp != cred->egid)
|
||||
retval = groups_search(cred->group_info,
|
||||
make_kgid(cred->user_ns, grp));
|
||||
if (!gid_eq(grp, cred->egid))
|
||||
retval = groups_search(cred->group_info, grp);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user