Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/external/cddl/osnet/sys/sys



In article <20190206201922.GA8980%homeworld.netbsd.org@localhost>,
 <maya%netbsd.org@localhost> wrote:
>On Wed, Feb 06, 2019 at 12:56:57PM -0500, Christos Zoulas wrote:
>D.org>
>> @@ -66,7 +66,7 @@ crgetgroups(cred_t *cr)
>>  {
>>  	static gid_t gids[NGROUPS_MAX];
>
>I feel uncomfortable seeing unnecessary use of static.
>(I find it too magical)
>
>What do others think?
>
>>  
>> -	memset(gids, 0, NGROUPS_MAX);
>> +	memset(gids, 0, sizeof(gids));
>>  	if (kauth_cred_getgroups(cr, gids, NGROUPS_MAX, UIO_SYSSPACE) != 0) 
>>  		return NULL;

The simplest way to fix this is to add:

const gid_t *
kauth_cred_getgroups_internal(const kauth_cred_t cred)
{
	return cred->cr_groups;
}

christos



Home | Main Index | Thread Index | Old Index