[Top][All Lists]

[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: Wed, 24 Feb 2010 13:43:59 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20091216 Iceweasel/3.5.6 (like Firefox/3.5.6; Debian-3.5.6-2)

Follow-up Comment #2, bug #28934 (project hurd):

Hi Emilio,

I'm pretty sure you are correct in that execve() should not look in $PATH,
because glibc's sysdeps/mach/hurd/execve.c does a regular file lookup.
As you say the exec server gets confused since it does not find bar in
$PATH, and tries to reconstruct a `correct' path to the file.

The root problem is that the exec server can't tell which exec() variant
was called, so it doesn't know how to interpret argv[0].  The easiest
way to fix this is to prepend `./' to argv[0] if needed in execve().
This is probably the correct way to fix it as well.  I'm not sure if
this should be done to all relative paths or only ones that doesn't
contain slashes.  I'll leave it up to you to investigate further what
POSIX says about it and how Linux does it.



Reply to this item at:


  Message sent via/by Savannah

reply via email to

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