Subject: Re: Vi still can't remove its own vi-recover files from NFS /var/tmp
To: NetBSD-current Discussion List <current-users@NetBSD.org>
From: Luke Mewburn <lukem@NetBSD.org>
List: netbsd-users
Date: 01/26/2004 03:40:20
--+PbGPm1eXpwOoWkI
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Jan 24, 2004 at 10:06:58PM -0500, Greg A. Woods wrote:
  | [ On Sunday, January 25, 2004 at 00:49:11 (+0100), Christian Biere wrot=
e: ]
  | > Well, flex(3) uses isatty() without checking for a character special
  | > device. So, gethostbyname() etc. will trigger a TIOCGETA for
  | > /etc/nsswitch.conf.
  |=20
  | Ah, of course.  I was a bit quick to give up on looking for a separate
  | isatty() call in the (f)lex generated code when I found the fread() call
  | since they would both occur at the same position in the ktrace output.
  |=20
  | Adding "%option never-interactive" to the lex source fixes this "proble=
m".
  |=20
  | Lex should probably also be invoked with '-B' as well.

Good call.

I've added "%option never-interactive" to nslexer.l, which is
sufficient to prevent isatty() from being called.


(Arguably the parser could just be written using fgetln() and
C string parsing instead of yacc & lex.  That's a project for
another day.)

--+PbGPm1eXpwOoWkI
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)

iD8DBQFAE/F0pBhtmn8zJHIRAqHvAJ9DHIt521CNISO7Rtcd9NuSH1hHJACgsn4H
fUzZtiUJ4ZLC34PmJk2/4GU=
=CC2X
-----END PGP SIGNATURE-----

--+PbGPm1eXpwOoWkI--