Subject: Re: shell scripts in an emulation environment
To: Matthias Drochner <email@example.com>
From: Bill Studenmund <firstname.lastname@example.org>
Date: 01/29/1998 11:42:08
On Thu, 29 Jan 1998, Matthias Drochner wrote:
> Excerpts from netbsd: 28-Jan-98 Jonathan Stone@DSG.Stanf (983)
> For the script interpreter problem, here is a patch for review
> and discussion.
> The resource management is a bit ugly (as it is in the whole
> exec code).
> (I've dropped the idea to put the emulation lookup into check_exec().
> This is not the right place to care about the allocation of space for
> the new path, and it would impose more penalty on native execs.)
I'm not sure if this patch will do what I'm looking for.
My problem is the user's using a shell running under NetBSD emulation, and
wants to run a script living in an /emulation tree. I want the kernel to
find the /emul/ULTRIX/bin/sh to run this file.
If the shell which called exec had been running under ULTRIX (or Linux)
emulation, all would be well (I think).
Basicaly I want to give shells being exec'd under NetBSD emulation the
"/emul/ultrix" path prefixing search ability when forking scripts living
in /emul directories.
This ability should be a kernel option (well, configurable).
I can't see how to not affect native shell exec's, but the string
comparison against "/emul" should fail fast. We might even check "emul"
and then "/", just so /bin, /sbin, and /usr paths fail instantly.