/* Validate a group subscription and, if valid, insert it into a set of credentials.  */
int set_groups(struct cred *new, struct group_info *group_info)
/* Validate a group subscription and, if valid, insert it into a set of credentials.  */
int set_groups(struct cred *new, struct group_info *group_info)
{
	int retval;
	retval = security_task_setgroups(group_info);
	if (retval)
		return retval;
	put_group_info(new->group_info);
	groups_sort(group_info);
	get_group_info(group_info);
	new->group_info = group_info;
	return 0;
}