/* Validate a group subscription and, if valid, impose it upon current's task security record.  */
int set_current_groups(struct group_info *group_info)
/* Validate a group subscription and, if valid, impose it upon current's task security record.  */
int set_current_groups(struct group_info *group_info)
{
	struct cred *new;
	int ret;
	new = prepare_creds();
	if (!new)
		return -ENOMEM;
	ret = set_groups(new, group_info);
	if (ret < 0) {
		abort_creds(new);
		return ret;
	}
	return commit_creds(new);
}