From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24980 invoked by alias); 12 Feb 2014 09:08:08 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 24969 invoked by uid 89); 12 Feb 2014 09:08:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: calimero.vinschen.de Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 12 Feb 2014 09:08:06 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id 1DC22520524; Wed, 12 Feb 2014 10:08:04 +0100 (CET) Date: Wed, 12 Feb 2014 09:09:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: get rid of getpwent? (Was: cygwin-1.7.28 getpwent header declaration changes ?) Message-ID: <20140212090804.GM2821@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <31347914-BB4F-4039-984B-731B6C72F903@etr-usa.com> <52F7AEC5.5090205@tiscali.co.uk> <8B7B5FE0-7413-4358-BA8A-E0B6E0B17653@etr-usa.com> <52F8B50E.7040307@lysator.liu.se> <52F92D58.9030408@etr-usa.com> <52F95D1D.4050108@tiscali.co.uk> <4510121021.20140211062515@mtu-net.ru> <52FAB14C.8060800@tiscali.co.uk> <52FABAF5.2060701@etr-usa.com> <52FAD730.9090507@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XBU0trS4VUTrVXJk" Content-Disposition: inline In-Reply-To: <52FAD730.9090507@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2014-02/txt/msg00268.txt.bz2 --XBU0trS4VUTrVXJk Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1437 On Feb 11 19:06, Eric Blake wrote: > On 02/11/2014 05:06 PM, Warren Young wrote: > > On 2/11/2014 16:25, David Stacey wrote: > >> getpwent() is called in three different places. > >=20 > > To those of you who have investigated these code paths: do any of them > > look like they couldn't be replaced by getpwnam() or other calls that > > would let cygwin1.dll do single-record AD/SAM lookups, rather than > > whole-table/tree scans? > >=20 > > That is, do any of these programs really need to visit every record in > > /etc/passwd? >=20 > libreadline wants to know how to tab-complete ~foo; to do that, it has > to find all usernames beginning with foo. How would you do that without > visiting every single record? This seems to be the major usage of getpwent these days. The question is, how bad is it if only a handful entries, or even only a single one (of oneself) show up? Either way, implementing a full getpwent requires to return the local users, the users of the primary domain, and the users of all trusted domains. I know of domains with 200K users and there are probably bigger ones. How long should a search take when a user presses after the ~? And then, shall the process running the getpwent actually cache all of them? This seems really excessive. Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --XBU0trS4VUTrVXJk Content-Type: application/pgp-signature Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJS+znzAAoJEPU2Bp2uRE+gPDIP/j+wD6pOfNqxIWK1sNdtTRJi Pjpe7MKMzfjy7Jxt3l6nCkhfP5Sjn0XJLDRm2meuHBKhEzOW1M4drPQI/Ctnrqkt THePXkhpaj2xbrl9QcXihxczlO/TZQI+kzlEcCkNKMHGQft7S30ha4WQ3xw9ASSH Z0E+35kkwoDnQzbmNixhyMV/nqo2m0kFdsazn/YDiMRkJlGJO2A2G53rie7OdZiC EDaBJkeH2knBW4kXw2w1mFG3ow91AB2n4g/2xKPeje0axSH9acF5/xAjvUBkqrZR cR8UfzUXKTrhPKRvQ0Z/wJrd1s3YvO+cVj3rG4OmbmQfh+Qxqv/epZeh+WDxum5M y4We4f2K6kWgWWN3OU83i03hGLyoyL8RsszZVdloRhCGZ1PLnkPDT11rD+PZ9PwG sLbp/ws4Cq5AnEpWU4O8MCJTFhLT/S4b7RysDYjIS23jsY6H0OUYqLjJ7UJ0lAjF HqmDf+73EEf6DfRVwU4dq7S4laJxZAboHEdM3YURDMJnST5Sg6EXexe3WFXfw92c Ep6lVSjp/m6yav5+7CCJSFzhH/P9SGilQVzWDG46vy1L5kOEsErPqbjXgmLce7x5 bSTOemqARBqeDu2FjHVc7xWbwd2SYd0OMKvzEvZjfNgMpj+w6xKjDpmRfvYojC3k uGe8ou+OwD9p/+C8gu+Z =iYD+ -----END PGP SIGNATURE----- --XBU0trS4VUTrVXJk--