freebsd-dev/lib/libc
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
..
alpha Add required headers and function declarations. 2004-01-06 19:28:07 +00:00
amd64 "Fix" makecontext() so that the C code begins execution with its 2003-12-05 01:36:44 +00:00
compat-43 mdoc(7): Use the new feature of the .In macro. 2003-09-08 19:57:22 +00:00
db mdoc(7): Use the new feature of the .In macro. 2003-09-08 19:57:22 +00:00
gdtoa Userland spinlocks bad. Sleep locks good. 2003-06-21 08:20:14 +00:00
gen Remove unused variables and function declarations. Add missing headers. 2004-01-06 18:26:15 +00:00
gmon Use ANSI C function definition for _mcount' and remove static' 2004-01-06 18:49:54 +00:00
i386 mdoc(7): Use the new feature of the .In macro. 2003-09-08 19:57:22 +00:00
ia64 Add required headers. 2004-01-06 19:40:28 +00:00
include Remove #include of spinlock.h from libc_private.h. Declare spinlocks as 2003-11-05 18:17:30 +00:00
locale Remove unused variables and function declarations. Add missing headers. 2004-01-06 18:26:15 +00:00
net It was reported that when using nss_ldap, getgrent(3) would behave 2004-01-09 13:43:49 +00:00
nls Remove incomplete support for running FreeBSD userland on old NetBSD kernels 2003-10-29 10:45:01 +00:00
posix1e Adjust for brain outage that affected the previous commit. 2004-01-06 20:29:40 +00:00
powerpc - Put manh/manl bitfields into correct-sized integral type. 2003-12-10 13:04:42 +00:00
quad libc_r wasn't so tied to libc for 22 months. 2002-11-18 09:50:57 +00:00
regex mdoc(7): Use the new feature of the .In macro. 2003-09-08 19:57:22 +00:00
rpc Add missing declaration. 2004-01-06 18:45:58 +00:00
sparc64 Remove unused variables. Add required headers and function 2004-01-06 18:53:26 +00:00
stdio Make intentions explicit with additional parenthesis. 2004-01-06 18:32:24 +00:00
stdlib Implement __cxa_atexit/__cxa_finalize as specified by the cross-vendor 2003-12-19 17:11:21 +00:00
stdtime Detect range errors when using the %s specifier. Previously, LONG_MAX 2003-11-17 04:19:15 +00:00
string Brucification: Don't initialize in declaration, make sure extra lines 2003-12-18 07:44:53 +00:00
sys Describe kern.ipc.nsfbufsused and kern.ipc.nsfbufspeak. 2003-12-29 12:29:37 +00:00
uuid Remove stale DCE 1.1 pointers to the IBM site. The URLs aren't valid 2003-08-08 19:18:43 +00:00
xdr Fix amd(8) clients, if a FreeBSD mountd(8) server is used. 2003-05-28 09:13:09 +00:00
yp Back out the `hiding' of strlcpy and strlcat. Several people 2003-05-01 19:03:14 +00:00
Makefile Fixed English error in previous commit. Fixed some older English errors. 2003-12-11 09:53:25 +00:00