linuxunixauthenticationsystem-callsgetpwnam

Does getpwnam respect /etc/nsswitch.conf?


Does getpwnam respect /etc/nsswitch.conf?

The manpage for getpwnam states

The getpwnam() function returns a pointer to a structure containing the broken-out fields of the record in the password database (e.g., the local password file /etc/passwd, NIS, and LDAP) that matches the username name.

This leads me to believe that it should respect /etc/nsswitch.conf, iterating over whatever entries are listed for the passwd line (... but I have a bug report indicating that it's not behaving that way).

Edit: I found a 3c manpage that indicates that it does respect it, so now the question is under which operating systems is it supported


Solution

  • It does respect /etc/nsswitch.conf under every operating system which is POSIX conform.