From owner-cvs-src@FreeBSD.ORG Fri Jan 9 05:43:54 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AED4216A4CE; Fri, 9 Jan 2004 05:43:54 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1019D43D62; Fri, 9 Jan 2004 05:43:50 -0800 (PST) (envelope-from nectar@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i09Dhn0B063154; Fri, 9 Jan 2004 05:43:49 -0800 (PST) (envelope-from nectar@repoman.freebsd.org) Received: (from nectar@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i09Dhn7j063153; Fri, 9 Jan 2004 05:43:49 -0800 (PST) (envelope-from nectar) Message-Id: <200401091343.i09Dhn7j063153@repoman.freebsd.org> From: Jacques Vidrine Date: Fri, 9 Jan 2004 05:43:49 -0800 (PST) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/include nss.h src/lib/libc/net nss_compat.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jan 2004 13:43:54 -0000 nectar 2004/01/09 05:43:49 PST FreeBSD src repository Modified files: include nss.h lib/libc/net nss_compat.c Log: 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 Revision Changes Path 1.2 +3 -2 src/include/nss.h 1.2 +15 -8 src/lib/libc/net/nss_compat.c