This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[COMMITTED] manual/nss.texi: Document NSS_STATUS_NOTFOUND + SUCCESS.


Several userspace daemons have started adding their NSS plugins
to /etc/nsswitch.conf at distribution install time. This allows
the plugins to be loaded by all processes but run in a "disconnected"
mode where the daemon is not actually installed or loaded, but when
it is all processes are ready to immediately start using data from
this source.

In this case the NSS plugin must act as if the data source is empty
and return NSS_STATUS_NOTFOUND and SUCCESS. There is no configuration
error, and there is no communication problem with the data source.

There are some versions of SSSD which would return NSS_STATUS_NOTFOUND
and an error, but this causes serious problems when trying to access
entries since the error is propagated back to the caller. I worked with
with the SSSD developers to ensure their NSS plugin returned SUCCESS
in these cases.

This documents the best practice for these kinds of NSS plugins which
can run in "disconnected" mode without error.

2015-12-10  Carlos O'Donell  <carlos@redhat.com>

	* manual/nss.texi (NSS Modules Interface): Document
	NSS_STATUS_NOTFOUND and SUCCESS.

diff --git a/manual/nss.texi b/manual/nss.texi
index bf3e69d..66dccef 100644
--- a/manual/nss.texi
+++ b/manual/nss.texi
@@ -448,6 +448,13 @@ The function should be called again with a larger buffer.
 @item
 @code{NSS_STATUS_NOTFOUND} @tab
         @code{ENOENT} @tab The requested entry is not available.
+
+@item
+@code{NSS_STATUS_NOTFOUND} @tab
+       @code{SUCCESS} @tab There are no entries.
+Use this to avoid returning errors for inactive services which may
+be enabled at a later time. This is not the same as the service
+being temporarily unavailable.
 @end multitable
 
 These are proposed values.  There can be other error codes and the
---

Cheers,
Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]