nsss
Software
skarnet.org

The nsss library interface

General information

libnsss is the generic name for the nsss client library. This library is made of several parts:

Both nsss-unix and nsss-switch are made of two parts:

nsss-all does not have an internal API. It only contains the implementation of the above standard functions, as nsss_all_getpwnam() and similar.

Compiling

Application programs can use the internal API directly, or the prefixed nsss_ functions directly. Most programs, however, will simply use the standard pwd.h, grp.h or shadow.h interfaces. nsss provides a version of these standard headers: if an application is built with these headers, then getpwnam() will automatically be aliased to nsss_all_getpwnam(), and the other functions will be aliased similarly.

If the NSSS_DISABLE_SWITCH macro is defined before inclusion of the nsss headers, then getpwnam() will be aliased to nsss_unix_getpwnam() instead, and the other functions will follow the same pattern. If, instead, the NSSS_DISABLE_UNIX macro is defined before inclusion of the nsss headers, then getpwnam() will be aliased to nsss_switch_getpwnam(), and the other functions will follow the same pattern.

So, the proper steps to compile an application with libnsss are:

Linking

Programming