Lines Matching refs:group_info
15 struct group_info *groups_alloc(int gidsetsize) in groups_alloc()
17 struct group_info *gi; in groups_alloc()
20 len = sizeof(struct group_info) + sizeof(kgid_t) * gidsetsize; in groups_alloc()
34 void groups_free(struct group_info *group_info) in groups_free() argument
36 kvfree(group_info); in groups_free()
43 const struct group_info *group_info) in groups_to_user() argument
47 unsigned int count = group_info->ngroups; in groups_to_user()
51 gid = from_kgid_munged(user_ns, group_info->gid[i]); in groups_to_user()
59 static int groups_from_user(struct group_info *group_info, in groups_from_user() argument
64 unsigned int count = group_info->ngroups; in groups_from_user()
76 group_info->gid[i] = kgid; in groups_from_user()
89 void groups_sort(struct group_info *group_info) in groups_sort() argument
91 sort(group_info->gid, group_info->ngroups, sizeof(*group_info->gid), in groups_sort()
97 int groups_search(const struct group_info *group_info, kgid_t grp) in groups_search() argument
101 if (!group_info) in groups_search()
105 right = group_info->ngroups; in groups_search()
108 if (gid_gt(grp, group_info->gid[mid])) in groups_search()
110 else if (gid_lt(grp, group_info->gid[mid])) in groups_search()
123 void set_groups(struct cred *new, struct group_info *group_info) in set_groups() argument
125 put_group_info(new->group_info); in set_groups()
126 get_group_info(group_info); in set_groups()
127 new->group_info = group_info; in set_groups()
139 int set_current_groups(struct group_info *group_info) in set_current_groups() argument
147 set_groups(new, group_info); in set_current_groups()
162 i = cred->group_info->ngroups; in SYSCALL_DEFINE2()
168 if (groups_to_user(grouplist, cred->group_info)) { in SYSCALL_DEFINE2()
192 struct group_info *group_info; in SYSCALL_DEFINE2() local
200 group_info = groups_alloc(gidsetsize); in SYSCALL_DEFINE2()
201 if (!group_info) in SYSCALL_DEFINE2()
203 retval = groups_from_user(group_info, grouplist); in SYSCALL_DEFINE2()
205 put_group_info(group_info); in SYSCALL_DEFINE2()
209 groups_sort(group_info); in SYSCALL_DEFINE2()
210 retval = set_current_groups(group_info); in SYSCALL_DEFINE2()
211 put_group_info(group_info); in SYSCALL_DEFINE2()
225 retval = groups_search(cred->group_info, grp); in in_group_p()
237 retval = groups_search(cred->group_info, grp); in in_egroup_p()