1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-30 22:43:12 +03:00

* posix/execvp.c (execvp): Use file name including path when

trying to run it with shell.
	* posix/Makefile: Add rules to build and run tst-execvp3.
	* posix/tst-execvp3.c: New file.
This commit is contained in:
Ulrich Drepper
2005-04-14 21:20:51 +00:00
parent 806bc96abb
commit 506cbf1f43
4 changed files with 54 additions and 3 deletions

View File

@ -133,14 +133,14 @@ execvp (file, argv)
else
startp = (char *) memcpy (name - (p - path), path, p - path);
/* Try to execute this name. If it works, execv will not return. */
/* Try to execute this name. If it works, execve will not return. */
__execve (startp, argv, __environ);
if (errno == ENOEXEC)
{
if (script_argv == NULL)
{
script_argv = allocate_scripts_argv (file, argv);
script_argv = allocate_scripts_argv (startp, argv);
if (script_argv == NULL)
{
/* A possible EACCES error is not as important as