v4 [PATCH 3/6] nss: Implement <nss_database.h>

Siddhesh Poyarekar siddhesh@gotplt.org
Sat Nov 21 03:17:37 GMT 2020


On 11/21/20 3:36 AM, DJ Delorie wrote:
> Siddhesh Poyarekar <siddhesh@gotplt.org> writes:
>> The patch itself is OK, but this is still missing a description of what
>> functionality the patch implements.
> 
> Besides the big comment block in nss_database.h ?
> 
> 
> /* Each "line" in nsswitch.conf maps a supported database (example:
>     passwd) to one or more name service providers (example: files dns).
>     Internally, each name service provider (example: dns) is a
>     dynamically loadable module (i.e. libnss_dns.so), managed by
>     nss_module.h.  The sequence of providers and rules (example: files
>     [SUCCESS=RETURN] dns) is mapped by nss_action.h to a cached entry
>     which encodes the sequence of modules and rules.  Keeping track of
>     all supported databases and their corresponding actions is done
>     here.
> 
>     The key entry is __nss_database_get, which provides a set of
>     actions which can be used with nss_lookup_function() and
>     nss_next().  Callers should assume that these functions are fast,
>     and should not cache the result longer than needed.  */
> 

Yes, that's a design note for someone reading the code, the commit note 
is for tracking changes.  I'd suggest something like the following:

~~~
Implement the database abstraction that describes various NSS databases 
(i.e. passwd, group, etc.).  It uses the NSS actions abstractions 
implemented in the previous patch and allows dynamic reloading on 
changes to nsswitch.conf.
~~~

Siddhesh


More information about the Libc-alpha mailing list