delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/02/12/04:08:30

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; q=dns; s=
default; b=Wjxnxy2mQiFvk1aXEojk4zGzZg2gFChGcRayLCK8xfbU9KRBk57TM
tFSwgrTwT01tafcv1IN9A5jDeh0dGL87Eu6zLQGnBLxai/mJvU7IdiYqqXSd1YDg
bFwpenajg1X2gmTZA30Tv4+bPJWLmXFWn4sNEk7fBCiaAXc+w1SVpw=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; s=default;
bh=tSG/GW7IZ+Sh7dKGVBm2mkkB4IM=; b=UEaSzLU/D3SErpWhbzrjuz2ZJUjU
r/t7fOYCrXZQWLWXzeGKqNioQU6f4J95XfwehKMsP4cWt1lOM7jesV4bykiZUhtQ
Cj9VdFQq3Z/VePP7jaT0j2jtmT1a/0lfYm3WzLEPqVZErNqQpv1wbApA5DmKbKwO
Utn2zfZGr4gKNus=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
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
Date: Wed, 12 Feb 2014 10:08:04 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT 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 AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <31347914-BB4F-4039-984B-731B6C72F903 AT etr-usa DOT com> <52F7AEC5 DOT 5090205 AT tiscali DOT co DOT uk> <8B7B5FE0-7413-4358-BA8A-E0B6E0B17653 AT etr-usa DOT com> <52F8B50E DOT 7040307 AT lysator DOT liu DOT se> <52F92D58 DOT 9030408 AT etr-usa DOT com> <52F95D1D DOT 4050108 AT tiscali DOT co DOT uk> <4510121021 DOT 20140211062515 AT mtu-net DOT ru> <52FAB14C DOT 8060800 AT tiscali DOT co DOT uk> <52FABAF5 DOT 2060701 AT etr-usa DOT com> <52FAD730 DOT 9090507 AT redhat DOT com>
MIME-Version: 1.0
In-Reply-To: <52FAD730.9090507@redhat.com>
User-Agent: Mutt/1.5.21 (2010-09-15)

--XBU0trS4VUTrVXJk
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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 <TAB>
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

-----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--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019