bin/60287: [patch] NSS does not handle NSS_STATUS_TRYAGAIN properly

Jacques A. Vidrine nectar at FreeBSD.org
Thu Dec 18 06:54:56 PST 2003


Hi Lachlan,

Thank you for your report!  I believe your analysis is correct.

There is one subtlety that must also be resolved.  Within FreeBSD's
nsswitch, one indicates that the given buffer is too small by setting
errno to ERANGE and return RETURN.  The convention for GNU libc
modules seems to be to set errno to ERANGE and return TRYAGAIN.
Unfortunately, nss_ldap seems to do neither :-)  It does return
TRYAGAIN, but it does not set errno, so one cannot distinguish between
providing a too-small-buffer and, say, not enough heap memory.

So, I believe I need to apply something approximating your patch,
but also nss_ldap needs to be corrected to set ERANGE where
appropriate.

Cheers,
-- 
Jacques Vidrine   NTT/Verio SME      FreeBSD UNIX       Heimdal
nectar at celabo.org jvidrine at verio.net nectar at freebsd.org nectar at kth.se

P.S. If I cannot address this today, I'm afraid it will be early
January before I get to it--- I'm leaving home early tomorrow and
won't be back until then.


More information about the freebsd-bugs mailing list