Re: [RFC][PATCH] scripts with stdin replaced

Jamie Lokier (lkd@tantalophile.demon.co.uk)
Tue, 13 Jul 1999 20:41:22 +0200


Stefan Monnier wrote:
> >>>>> "Jamie" == Jamie Lokier <lkd@tantalophile.demon.co.uk> writes:
> > When /proc is mounted, run all scripts using /proc/self/fd.
>
> No, you don't want /proc/self/fd unless it's really necessary (setuid)
> because it loses the path information which is going to break some scripts.

A very good point. I've used this in the past myself.

> This loss is not important for setuid scripts (they didn't work before
> anyway).

Uh oh. A script that uses `basename $0` to gets its own name will fail
-- unless one of the names it recognises is "3". Then it will just
behave incorrectly.

It's bad when simply setting a flag with chmod has such a surprising
effect, but there's not much we can do about it.

-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/