[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #28934] execve(path, args) should take path as a a relative path if
From: |
Carl Fredrik Hammar |
Subject: |
[bug #28934] execve(path, args) should take path as a a relative path if it doesn't contain slashes |
Date: |
Fri, 16 Apr 2010 12:31:08 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100308 Iceweasel/3.5.8 (like Firefox/3.5.8) |
Follow-up Comment #12, bug #28934 (project hurd):
The patch looks good, but I have a couple of suggestions.
In __execve you cannot just call _hurd_exec_file_name unconditionally
since all exec() variants end up as a __execve(). For instance,
if there is both `/bin/foo' and `./foo', execpv("foo", { "foo", 0 })
will expand to execve("/bin/foo", { "foo", 0 }, ...), which expands to
_hurd_exec_file_name(file, { "foo", 0 }, ...), which will make the exec
server think you meant `./foo'. Instead, you should actually test with
strcmp whether FILE_NAME and ARGV[0] are one and the same.
Also I think you should have a flags argument to _hurd_exec_generic
instead of a boolean, pass along the EXEC_FILE_NAME flag, and
perhaps rename the function to _hurd_exec_flags. You could even drop
_hurd_exec_file_name all together then, though you would have to move out
the #ifdef EXEC_FILE_NAME to the callers, so perhaps its worth keeping...
Regards,
Fredrik
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?28934>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/