* spawn.cc (spawn_guts): Don't run additional check for Win32
incompatible CWD if newargv.fixup bailed out already. (av::fixup): Check shell scripts for executability.
This commit is contained in:
parent
e20afc07b0
commit
d6bb3f330d
@ -1,3 +1,9 @@
|
|||||||
|
2009-06-22 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* spawn.cc (spawn_guts): Don't run additional check for Win32
|
||||||
|
incompatible CWD if newargv.fixup bailed out already.
|
||||||
|
(av::fixup): Check shell scripts for executability.
|
||||||
|
|
||||||
2009-06-18 Corinna Vinschen <corinna@vinschen.de>
|
2009-06-18 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* path.cc (chdir): Check error conditions first.
|
* path.cc (chdir): Check error conditions first.
|
||||||
|
@ -357,6 +357,9 @@ spawn_guts (const char *prog_arg, const char *const *argv,
|
|||||||
wascygexec = real_path.iscygexec ();
|
wascygexec = real_path.iscygexec ();
|
||||||
res = newargv.fixup (prog_arg, real_path, ext);
|
res = newargv.fixup (prog_arg, real_path, ext);
|
||||||
|
|
||||||
|
if (res)
|
||||||
|
goto out;
|
||||||
|
|
||||||
if (!real_path.iscygexec ()
|
if (!real_path.iscygexec ()
|
||||||
&& (cygheap->cwd.drive_length == 0
|
&& (cygheap->cwd.drive_length == 0
|
||||||
|| cygheap->cwd.win32.Length >= MAX_PATH * sizeof (WCHAR)))
|
|| cygheap->cwd.win32.Length >= MAX_PATH * sizeof (WCHAR)))
|
||||||
@ -372,9 +375,6 @@ spawn_guts (const char *prog_arg, const char *const *argv,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res)
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
if (ac == 3 && argv[1][0] == '/' && argv[1][1] == 'c' &&
|
if (ac == 3 && argv[1][0] == '/' && argv[1][1] == 'c' &&
|
||||||
(iscmd (argv[0], "command.com") || iscmd (argv[0], "cmd.exe")))
|
(iscmd (argv[0], "command.com") || iscmd (argv[0], "cmd.exe")))
|
||||||
{
|
{
|
||||||
@ -1078,6 +1078,11 @@ just_shell:
|
|||||||
arg1 = NULL;
|
arg1 = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Check if script is executable. Otherwise we start non-executable
|
||||||
|
scripts successfully, which is incorrect behaviour. */
|
||||||
|
if (check_file_access (real_path, X_OK) < 0)
|
||||||
|
return -1; /* errno is already set. */
|
||||||
|
|
||||||
/* Replace argv[0] with the full path to the script if this is the
|
/* Replace argv[0] with the full path to the script if this is the
|
||||||
first time through the loop. */
|
first time through the loop. */
|
||||||
replace0_maybe (prog_arg);
|
replace0_maybe (prog_arg);
|
||||||
|
Loading…
Reference in New Issue
Block a user