[SSSD] [PATCHES][PRELIMINARY] Support the 'services' NSS map in SSSD

Stephen Gallagher sgallagh at redhat.com
Sat Jan 21 21:54:10 UTC 2012


These patches add support for getservbyname() and getservbyport() to
the NSS responder. They do not yet support enumeration of services 
through setservent(), getservent() and endservent(). These patches also
include a reference implementation using the proxy ID provider (which I
used to test and validate the functionality).

Work still to come: enumeration support and LDAP provider
implementation.

Patch 0001: Make the sized_string structure available elsewhere in the
source.

Patch 0002: Add support for strtouint16 (needed for managing the port
number)

Patch 0003: Make add_string() and add_ulong() available to all sysdb
files.

Patch 0004: Add routines to save, delete and modify service entries in
the sysdb. (Also includes some very rudimentary unit tests)

Patch 0005: Add LDB indexes for the port and protocol arguments, since
we'll be searching on them.

Patch 0006: Add support to the NSS sss_client to look up getservbyname()
and getservbyport().

Patch 0007: Add support for services in dp requests

Patch 0008: Add routines to the negative cache to handle services

Patch 0009: The big one. This patch adds a new feature to the NSS
responder to handle looking up services by name and by port (optionally
filtering by protocol).

Important note: I did not use the existing check_cache() functionality
here. I changed the cache check and lookup logic to match that which was
proposed in https://fedorahosted.org/sssd/ticket/1126 (to deal with
multiple domains more efficiently). I would like this very carefully
reviewed (by two engineers) because I think our long-term plan is going
to be to migrate the existing NSS responders over to this style.

/* Provider Lookup Logic:
 * Iterate through the available caches. If the cached entry is
 * present and not expired, return it immediately(*). If it is
 * present and expired, add it to a list of domains eligible to
 * be checked. If it is in the negative cache, skip over it and
 * do not add it to the eligible domain list.
 *
 * Once we have searched all of the caches, if the entry has not
 * been determined to be available, search all domains in order
 * to see if any of them contain the requested entry.
 *
 * (*) Optionally perform a midpoint cache refresh if appropriate.
 */

See the functions getserv_send() and lookup_service_*() for more
details.


Patch 0010: This is the reference implementation I used for testing
purposes. I tested against proxy_lib_name = files (and changed the
'services' line in my /etc/nsswitch.conf to contain only 'sss')
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Move-sized_string-declaration-to-utils.patch
Type: text/x-patch
Size: 3013 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20120121/6460b473/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-UTIL-Add-strtouint16.patch
Type: text/x-patch
Size: 1598 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20120121/6460b473/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-SYSDB-Move-add_string-and-add_ulong-to-sysdb_private.patch
Type: text/x-patch
Size: 1973 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20120121/6460b473/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-SYSDB-Add-sysdb-routines-for-manipulating-service-en.patch
Type: text/x-patch
Size: 37070 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20120121/6460b473/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-SYSDB-Add-indexes-for-servicePort-and-serviceProtoco.patch
Type: text/x-patch
Size: 5167 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20120121/6460b473/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-NSS-Add-client-support-for-services-non-enumeration.patch
Type: text/x-patch
Size: 13020 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20120121/6460b473/attachment-0005.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0007-DP-Add-support-for-services-in-dp-requests.patch
Type: text/x-patch
Size: 2080 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20120121/6460b473/attachment-0006.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0008-NSS-Add-negative-cache-routines-for-services.patch
Type: text/x-patch
Size: 7892 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20120121/6460b473/attachment-0007.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0009-NSS-Add-getservbyname-and-getservbyport-support-to-t.patch
Type: text/x-patch
Size: 43157 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20120121/6460b473/attachment-0008.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0010-PROXY-add-support-for-service-lookups-non-enumeratio.patch
Type: text/x-patch
Size: 13412 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20120121/6460b473/attachment-0009.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20120121/6460b473/attachment.sig>


More information about the sssd-devel mailing list