Re: getgrouplist(3) vs. getgroups(3)



Hello,

On Fri, 22 Jul 2005, Roland Illig wrote:

> Roland Illig wrote:
> > Why do we use getgrouplist(3) at all? What we're interested in are the
> > permissions of the current process, not what's in the system-wide database.
>

This question seems reasonable.

> After applying this patch, everything works as usual.

I only hope you are not missing something ? But this indeed seems
much better. Btw a case which is not handled in you patch I think - from
the SUSv3:

[...]
It is implementation-defined whether getgroups() also returns the
effective group ID in the grouplist array.
[...]

and

[...]
If the effective group ID of the process is returned with the
supplementary group IDs, the value returned shall always be greater than
or equal to one and less than or equal to the value of {NGROUPS_MAX}+1.
[...]

And please, why don't you first query what getgroups() will return but use
NGROUPS_MAX.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]