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: Christian Biere <firstname.lastname@example.org>
Date: 01/25/2004 00:49:11
Content-Type: text/plain; charset=us-ascii
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:
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.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (NetBSD)
-----END PGP SIGNATURE-----