Subject: Re: Vi still can't remove its own vi-recover files from NFS /var/tmp
To: NetBSD-current Discussion List <>
From: Christian Biere <>
List: current-users
Date: 01/25/2004 00:49:11
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Greg A. Woods wrote:
> Note the file in question is (and was) "/etc/nsswitch.conf".

This file was probably used because /var/tmp or the file to be edited
was on NFS-mounted partition, right?

> As far as I can tell from the code nsdispatch(3) is just using fopen()
> and (since it uses lex & yacc), fread().

Well, flex(3) uses isatty() without checking for a character special
device. So, gethostbyname() etc. will trigger a TIOCGETA for
/etc/nsswitch.conf. Try this for example:

#include <netdb.h>

int main(void)
  return gethostbyname("localhost") =3D=3D NULL;
> As for reproducing the main subject issue, yes that still happens too:
>   4446 vi       CALL  unlink(0xa61e0)
>   4446 vi       NAMI  "/var/tmp/vi.recover/vi.04446b"
>   4446 vi       RET   unlink 0
>   4446 vi       CALL  unlink(0xad440)
>   4446 vi       NAMI  "/var/tmp/vi.recover/recover.04446d"
>   4446 vi       RET   unlink -1 errno 13 Permission denied
> as before the recover.* file can be removed after 'vi' has exited....

Well, vi uses locks for the recover files which might interfere in
some way NFS.


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

Version: GnuPG v1.2.4 (NetBSD)