freebsd-dev/lib
Jacques Vidrine c849849d06 It was reported that when using nss_ldap, getgrent(3) would behave
incorrectly when encountering `large' groups (many members and/or many
long member names).  The reporter tracked this down to the glibc NSS
module compatibility code (nss_compat.c): it would prematurely record
that a NSS module was finished iterating through its database in some
cases.

Two aspects are corrected:

1. nss_compat.c recorded that a NSS module was finished iterating
   whenever the module reported something other than SUCCESS.  The
   correct logic is to continue iteration when the module reports
   either SUCCESS or RETURN.  The __nss_compat_getgrent_r and
   __nss_compat_getpwent_r routines are updated to reflect this.

2. An internal helper macro __nss_compat_result is used to map glibc
   NSS status codes to BSD NSS status codes (e.g. NSS_STATUS_SUCCESS ->
   NS_SUCCESS).  It provided the obvious mapping.

   When a NSS routine is called with a too-small buffer, the
   convention in the BSD NSS code is to report RETURN.  (This is used
   to implement reentrant APIs such as getpwnam_r(3).)  However, the
   convention in glibc for this case is to set errno = ERANGE and
   overload TRYAGAIN.  __nss_compat_result is updated to handle this
   case.

PR:		bin/60287
Reported by:	Lachlan O'Dea <odela01@ca.com>
2004-01-09 13:43:49 +00:00
..
compat
csu
libalias
libatm
libbind
libbluetooth
libbsnmp
libbz2
libc It was reported that when using nss_ldap, getgrent(3) would behave 2004-01-09 13:43:49 +00:00
libc_r MFlibpthread: Add a simple work-around for deadlocking on recursive 2004-01-08 15:39:12 +00:00
libcalendar
libcam
libcom_err
libcompat
libcrypt
libdevinfo
libdevstat
libdisk
libedit
libexpat
libfetch
libform
libftpio
libgeom
libio
libipsec
libipx
libisc
libkiconv
libkse Add a simple work-around for deadlocking on recursive read locks 2004-01-08 15:37:09 +00:00
libkvm
libmd
libmenu
libmilter
libmp
libncp
libncurses
libnetgraph
libngatm
libopie
libpam Fix a strict aliasing issue. Also remove an unnecessary pam_get_item() 2003-12-11 15:51:03 +00:00
libpanel
libpcap
libpthread Add a simple work-around for deadlocking on recursive read locks 2004-01-08 15:37:09 +00:00
libradius
librpcsvc
libsbuf
libsdp
libsm
libsmb
libsmdb
libsmutil
libstand Implement seeking to earlier offsets in gzipfs. This allows my loader 2003-12-10 16:10:34 +00:00
libtacplus
libtelnet
libthr o Implement pthread_mutex_timedlock(), which does not block indefinitely on 2003-12-30 08:44:55 +00:00
libufs
libugidfw
libusbhid Correct URI to USB specs. 2003-12-21 14:30:23 +00:00
libutil
libvgl
libwrap
libxpg4
liby
libypclnt
libz
msun
ncurses
Makefile
Makefile.inc