From owner-freebsd-bugs@FreeBSD.ORG Thu Dec 18 06:54:56 2003 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CBEDD16A4CE for ; Thu, 18 Dec 2003 06:54:56 -0800 (PST) Received: from gw.celabo.org (gw.celabo.org [208.42.49.153]) by mx1.FreeBSD.org (Postfix) with ESMTP id 821D243D2D for ; Thu, 18 Dec 2003 06:54:54 -0800 (PST) (envelope-from nectar@celabo.org) Received: from madman.celabo.org (madman.celabo.org [10.0.1.111]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "madman.celabo.org", Issuer "celabo.org CA" (verified OK)) by gw.celabo.org (Postfix) with ESMTP id 03EB254883; Thu, 18 Dec 2003 08:54:54 -0600 (CST) Received: by madman.celabo.org (Postfix, from userid 1001) id 94D036D455; Thu, 18 Dec 2003 08:54:53 -0600 (CST) Date: Thu, 18 Dec 2003 08:54:53 -0600 From: "Jacques A. Vidrine" To: Lachlan O'Dea Message-ID: <20031218145453.GB35590@madman.celabo.org> Mail-Followup-To: "Jacques A. Vidrine" , Lachlan O'Dea , freebsd-bugs@FreeBSD.org References: <200312181414.hBIEENcW093868@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200312181414.hBIEENcW093868@freefall.freebsd.org> X-Url: http://www.celabo.org/ User-Agent: Mutt/1.5.4i-ja.1 cc: freebsd-bugs@FreeBSD.org Subject: Re: bin/60287: [patch] NSS does not handle NSS_STATUS_TRYAGAIN properly X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2003 14:54:56 -0000 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@celabo.org jvidrine@verio.net nectar@freebsd.org nectar@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.