[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Success, to some extent

tb@MIT.EDU (Thomas Bushnell, BSG) writes:

> /dev/fd is currently used mostly by certain cases in #! exec.  Exec
> tries to figure out a filename to give as the argument to the exec.
> Unlike the Unix exec call, the exec server does not have access to the
> actual pathname the user specified to do the exec, so it tries to find
> the file.
> If the file being execed is argv[0] or can be found in the path under
> the name argv[0], and if the exec is not setuid, then it takes the
> filename thus found and uses it as the argument to the script.
> Otherwise (if we are setuid, or if the file could not be located) then
> it hooks the file up to a new descriptor NNN and sets the script
> filename to /dev/fd/NNN.  Probably this is where the case you are
> seeing comes from.

A stupid question: Is there any particular reason for not using the
/dev/fd/NNN method by default? To me, it sounds more reliable than
searching for the file in $PATH.


Reply to: