Subject: Re: emul vs. symlinks
To: Quentin Garnier <cube@NetBSD.org>
From: Bill Studenmund <email@example.com>
Date: 07/09/2004 19:00:44
Content-Type: text/plain; charset=us-ascii
On Fri, Jul 09, 2004 at 11:33:20PM +0200, Quentin Garnier wrote:
> Hi folks,
> There is an issue with the way the emulation layer works with symlinks.
> When opening a file or looking for an interpreter, the emul_find()
> function is usually called, and its main purpose is to try and find a file
> in the emulation root and failback on the real root if it isn't found
> It doesn't work well with symlinks since that part is completely handled
> by namei(), which doesn't know, and therefore ignore, the emulation root.
I think the thing to do is either teach namei about emulations or have=20
your lookup routine enforce NOFOLLOW (i.e. clear FOLLOW) and handle=20
Actually, since the emulation code already does the "/emul/foo/path" then=
"/path" stuff, you just need to put a symlink handling wrapper outside of=
I really think that you don't need to add your own namei() routine. Since=
you can tell namei() to not follow symlinks and the symlink following=20
isn't hard, just do it yourself.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)
-----END PGP SIGNATURE-----