delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/02/09/11:16:36

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=h7Yz+Wgk4gH6GqBBhyEbPjo7SL0CGbI93Wb8PM9dKn/iCAXSLajX1
adFgtSvLo6HhNoa17IBgJdfYCN+PVq4JHPiyMCJQ5XwUfrwTNw/JVqRKOEZdsBeP
ahihSTg/2uMlhaR9eam37J+h+5CTar/j7/HwgmJ3ZfZz2BO7wOnHlk=
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=mJFbU5Av6rx4L40QvdL80knzJuo=; b=UMD/7NXOvCDWLDgAyZ114IX0iSUb
Rqugk0FB0HwcsyQXLA4VoE22Du6dy3jLP3g1zekyeapXgJPzE/eJC/oFQNZL9P0p
ICjoq5VS0+AjzMIJNnXuBMw1sN2kfaYd8m0l1UgNzy9USmSAr74BeetA2C+suw5j
tppk9xal1AzANxE=
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: Sun, 9 Feb 2014 17:16:09 +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: <20140209161609.GD2821@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <52F339CA DOT 5070305 AT gmail DOT com> <20140206090117 DOT GD2821 AT calimero DOT vinschen DOT de> <52F361C5 DOT 3000807 AT gmail DOT com> <20140206141321 DOT GI2821 AT calimero DOT vinschen DOT de> <52F40208 DOT 5030901 AT etr-usa DOT com> <20140207094917 DOT GN2821 AT calimero DOT vinschen DOT de> <52F4E540 DOT 2010606 AT tiscali DOT co DOT uk> <52F51D19 DOT 6080807 AT etr-usa DOT com> <31347914-BB4F-4039-984B-731B6C72F903 AT etr-usa DOT com> <20140209161045 DOT GC2821 AT calimero DOT vinschen DOT de>
MIME-Version: 1.0
In-Reply-To: <20140209161045.GC2821@calimero.vinschen.de>
User-Agent: Mutt/1.5.21 (2010-09-15)

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

On Feb  9 17:10, Corinna Vinschen wrote:
> On Feb  9 08:45, Warren Young wrote:
> > On Feb 7, 2014, at 10:51 AM, Warren Young <warren AT etr-usa DOT com> wrote:
> >=20
> > > Here's a better check that doesn't give false positives:
> > >=20
> > >    $ cat <<END > checkfile
> > >    #!/bin/sh
> > >    if egrep -q '_getgrent(32|64)' "$1" ; then echo $1 ; fi
> > >    END
> > >    $ find /bin -name \*.exe -exec ./checkfile {} \;
> >=20
> > The strings(1) call got left out of that test.  Here=E2=80=99s a workin=
g variant, which tests for getpwent() calls instead:
> >=20
> >     $ cat <<END > checkfile
> >     if strings "$1" | egrep -q '^getpwent$' ; then echo $1 ; fi
> >     END
> >     $ find /bin -name \*.exe -exec sh checkfile {} \;
> >=20
> > Alas, Vim *does* call this API.  Results:
>=20
> It does so to evaluate a ~user in a path and I guess that's what other
> apps do as well.  This is kind of weird since it would obviously not be
> necessary to enumerate accounts for this functionality:
>=20
>   if (~ in path)
>     if (~ is solo)
>       getpwuid(getuid ())
>     else
>       getpwname (username after the ~);

Huh, even though tcsh calls getpwent as well, this works fine:

  $ cd ~foo

with foo being some not yet cached user name.

However, with my current code this:

  $ cd ~<TAB>

only returns the cached user entries.


Corinna

--=20
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--SqO8Hf1xXlNBrDgg
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJS96nJAAoJEPU2Bp2uRE+ge3wP/3DknTfsW9h8Xhk26X6bQ93d
HB8wUNgcbcwpSFj8xy7wJQKV/jxdFQrU9ogqturNFZqGqby58XEc45VPutmABvIG
4Qh1dl61AgFCVPK3d2PNLsKVAmXgSzAjGTMowKU1R/EtCZRel7sBVVAIY2twM3YT
ihGJz2omQ/OYaBHy1uzANcWYG4ebCH4ZlyMgt/+TyWHBBUU1xgb/2/4Vex4wAA+n
7QdntLFH2UjkGa4Zdg1x2J0GK5TbfnfdVHTm/8UpXLazHt4dyWVopVj58kjR2HW2
bMms3so6QPvq6Yqlb+k4SAQSjz06NjEIPNMM01y/DY8aEJZQ03dNuzK/aPlbi4ib
hL324vUYUBx0Pru3dhDMSj2lzOi1RPX3Mp39nrZgruiJH8VZ2yxs/xDvbLeROWe7
QLC9Oo6E9cHgzGFlG1oechKgIQCF2XyA7hR+/7LE6B2xo3u+psLki6j1vzwChk5X
yt7yY/cYMIPbszsF06EqJZsBdehyMMeGpGeciq8SE+H/iLbZJ3VsgT0t2f7mHXes
jwOCz+elZaefgookzAze8B+Mr6m4Nffhe1D+4z0PQ+ht2iNxjQZcDFUgJy/dC+BC
pLMqDB7y67Otl7yEl8q31EgZi3nwqv0mX7hwKF9tyRA5P3UPpQOf97vn9lv4oYKQ
r1zxGGHZDjokp4SDSFb+
=Ba9P
-----END PGP SIGNATURE-----

--SqO8Hf1xXlNBrDgg--

- Raw text -


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