Commit Graph

8 Commits

Author SHA1 Message Date
Stefan Eßer
a397989d4e Add the possibility to specify a threshold for the number of negative cache
results required to have the cache return lookup failure.

A new configuration parameter is introduced, which must be set to a value
greater than 1 to activate this feature. The default behavior is unchanged.

The purpose of this change is to allow probes for the existence of an entry
(which are expected to fail), before that entry is added to one of the
queried databases, without the cache returning the stale information from
the probe query until that cache entry expires. If, for example, a new user
account is created after checking that the new account name is available,
the negative cache entry would prevent immediate access to the account.

For that example, the new configuration option

negative-confidence-threshold passwd 2

will require a second negative query result to consider the negative cache
entry for a passwd entry valid, but if the user account has been created
between the queries, then the positive query result from the second query
will be cached and returned.
2012-07-04 09:02:12 +00:00
Dag-Erling Smørgrav
8eeaaffaac Remove casts from {c,m,re}alloc() and simplify sizeof().
MFC after:	1 week
2009-06-13 13:07:56 +00:00
Dag-Erling Smørgrav
27f2bc9e1b Explain to the compiler why the aliasing we're doing is OK.
MFC after:	1 week
2009-06-13 01:22:56 +00:00
Dag-Erling Smørgrav
2bdde973dd Change hashtable_index_t to unsigned.
Generate prototypes for our hash table.

MFC after:	1 week
2009-06-13 00:54:52 +00:00
Dag-Erling Smørgrav
a5a5d924d2 Further #include cleanup.
MFC after:	1 week
2009-06-13 00:43:56 +00:00
Xin LI
a3c4f7249b Slightly adjust code logic: we allocate a "size"ed length of memory, not
size+1.  Use strlcpy() to avoid using - 1 as length for strncpy().
2008-10-23 00:31:15 +00:00
Xin LI
4f7df5c284 Reduce code duplication: use calloc instead of allocing and memset
afterward.

Approved by:	bushman
2008-10-12 00:44:27 +00:00
Hajimu UMEMOTO
06a99fe36f - Extend the nsswitch to support Services, Protocols and Rpc
databases.
- Make nsswitch support caching.

Submitted by:	Michael Bushkov <bushman__at__rsu.ru>
Sponsored by:	Google Summer of Code 2005
2006-04-28 12:03:38 +00:00