Crossfire wrote:
>
> Del was once rumoured to have said:
> > Luke McKee wrote:
> >
> > Some older brain dead programs don't even do an NSS lookup, preferring
> > to read /etc/passwd themselves, or do getpwent(). If you find one,
> > shoot it.
>
> Uh, getpwent() goes through the nss system. read nsswitch.conf(5),
> under passwd. Its this fact that also allows NIS so work everywhere
> automatically when its enabled.
getpwent() isn't guaranteed to be implemented, or implemented in the
same way, for all NSS types.
Most programs should use getpwnam() (preferably) or getpwuid() instead.
For example, getpwent() is not implemented for nss_nds, and only
returns users in the root container for nss_ldap. Also be aware
that getpwuid() returns NULL for nss_ldap under certain circumstances.
--
Del
--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug