Skip to content

Commit

Permalink
kernel: groups: expose groups_sort
Browse files Browse the repository at this point in the history
  • Loading branch information
ananjaser1211 committed Oct 15, 2023
1 parent 9cf3930 commit cd5ac4d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/linux/cred.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ extern int set_current_groups(struct group_info *);
extern void set_groups(struct cred *, struct group_info *);
extern int groups_search(const struct group_info *, kgid_t);
extern bool may_setgroups(void);
extern void groups_sort(struct group_info *);

/* access the groups "array" with this macro */
#define GROUP_AT(gi, i) \
Expand Down
3 changes: 2 additions & 1 deletion kernel/groups.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ static int groups_from_user(struct group_info *group_info,
}

/* a simple Shell sort */
static void groups_sort(struct group_info *group_info)
void groups_sort(struct group_info *group_info)
{
int base, max, stride;
int gidsetsize = group_info->ngroups;
Expand All @@ -131,6 +131,7 @@ static void groups_sort(struct group_info *group_info)
stride /= 3;
}
}
EXPORT_SYMBOL(groups_sort);

/* a simple bsearch */
int groups_search(const struct group_info *group_info, kgid_t grp)
Expand Down

0 comments on commit cd5ac4d

Please sign in to comment.