On Wed, 12 Sep 2018, Todd C. Miller wrote:
> Thanks for the feedback, here's an updated diff that eliminates 
> pwcache.h, gracefully handles table allocation failure and massages the 
> comments to be a bit more general.
> 
> I can take a look at supporting arbitrary length names in the future.

ok guenther@


> +/*
> + * Constants and data structures used to implement group and password file
> + * caches.  Name lengths have been chosen to be as large as those supported
> + * by the passwd and group files as well as the standard archive formats.
> + * CACHE SIZES MUST BE PRIME
> + */

Side note: I seem to recall reading an analysis somewhere that found that 
with a good hash function, the size of the table didn't matter.  I 
remember Kernighan & Pike's The Practice of Programming showing the 
primality of the size didn't matter for the hash table they whip up in the 
algorithms section.  Maybe the current hash just needs updating...

Reply via email to