[Top][All Lists]

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

exec server and /dev/fd/N

From: Emilio Pozuelo Monfort
Subject: exec server and /dev/fd/N
Date: Mon, 24 May 2010 12:08:10 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20100515 Icedove/3.0.4


These are a series of patches to fix https://savannah.gnu.org/bugs/?28934

Basically the problem is that in some cases the exec server can't find the file
name of the file being executed (when it's a script), and then makes a hack
passing /dev/fd/N to the interpreter.

I tried to fix it with heuristics such as "if the file name contains no slashes,
then it's relative" and passing just a flag to the exec server to avoid needing
to create new RPCs, but that's not enough, since a call like execv("foo",{"bar",
NULL}) (i.e. filename != argv[0]) should work too. So the only option is to pass
filename to the exec server, and just use that.

So this patch adds two new RPCs: exec_exec_file_name RPC and file_exec_file_name
one. Then libc can use exec_exec_file_name in hurdexec.c.

There's a little bootstrapping problem here: you can't apply the four Hurd
patches directly and build the whole Hurd, because lib*fs will be using
exec_exec_file_name, but the dynamic linker can't find it, since libhurduser.so
should provide it but you haven't build glibc yet. So to bootstrap it (without
hacks like partially building Hurd, e.g. what we would need to do in the Debian
packages) one would need to apply all but 0004 patches to Hurd and build it,
then build glibc with the new Hurd installed, and then finally build Hurd with
the 0004 patch. I mentioned this on #hurd and antrik said that the Hurd specific
parts of libhurduser.so should maybe be moved to Hurd.


Attachment: 0001-Extend-check_hashbang-with-a-filename-argument.patch
Description: Text Data

Attachment: 0002-Add-a-filename-argument-to-do_exec.patch
Description: Text Data

Attachment: 0003-Add-a-new-exec_exec_file_name-RPC.patch
Description: Text Data

Attachment: 0004-Add-a-file_exec_file_name-RPC.patch
Description: Text Data

Attachment: 0001-Use-the-new-__hurd_exec_file_name-RPC.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]