get rid of getpwent? (Was: cygwin-1.7.28 getpwent header declaration changes ?)
Corinna Vinschen
corinna-cygwin@cygwin.com
Wed Feb 12 09:09:00 GMT 2014
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.
> >
> > 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?
> >
> > That is, do any of these programs really need to visit every record in
> > /etc/passwd?
>
> 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
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20140212/fb08b4eb/attachment.sig>
More information about the Cygwin
mailing list