Source-Changes archive

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

Re: CVS commit: [elad-kernelauth] src/sys/kern



> David Laight wrote:
> 
> > Are you really sure you want to replace a memcmp() with an O(n^2) operation 
> > ?
> 
> I'll elaborate some more...
> 
> kauth(9) sorts the group on its own, so we could make that a binary
> search, improving performance a bit.
> 
> But using memcmp() will treat the groups associated with the credentials
> as a block of memory, while they're not guaranteed (in the future) to be
> one.

as far as you hide it by a sane api, there's nothing wrong with
using memcmp (or memcmp-like loop which compares each gids) internally.

btw, i think the name "kauth_cred_compare" should be reserved for
a function which compares two kauth_cred_t. :-)

YAMAMOTO Takashi



Home | Main Index | Thread Index | Old Index