On Mon, May 13, 2002 at 05:45:21PM -0400, Roland McGrath wrote:
[me wrote]
> > However, if I don't lock the node, I get "/dev/fd/3: Bad file descriptor".
> 
> Please investigate the latter problem.  Firstly, (assuming non-suid
> scripts) it should find a name instead of using the /dev/fd kludge unless
> argv[0] has a stupid value.  But even with that broken, the /dev/fd/3 ought
> to work (unless the script itself closes the descriptor before using it or
> something).

I don't get it.  I have verified that exec correctly increases the dtable
size from 3 to 4, and adds the file port to it.  I set a breakpoint at
S_exec_exec, and first it is hit executing "bashbug" with dtablesize 3, and then
it is hit executing /bin/sh /dev/fd/3 with dtablesize being 4, and dtable[0]
- dtable[3] look reasonable.

OTOH, I don't quite understand that code.  For example, I don't see where
exactly the (new) file descriptors are added to the new task.  However, I
verified that the /dev/fd/3 mechanism works in a non-fakeroot environment.
:-/

Thanks,
Marcus

-- 
`Rhubarb is no Egyptian god.' Debian http://www.debian.org [EMAIL PROTECTED]
Marcus Brinkmann              GNU    http://www.gnu.org    [EMAIL PROTECTED]
[EMAIL PROTECTED]
http://www.marcus-brinkmann.de

_______________________________________________
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd

Reply via email to