mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-01 03:50:28 +08:00
98669a2476
When the exec family of functions is called for a script-like file, the av::setup function handles the exec[vl]p case as well. The execve case for files not starting with a she-bang is handled first by returning ENOEXEC. Only after that, the file's executability is checked. This leads to the problem that ENOEXEC is returned for non-executable files as well. A calling shell interprets this as a file it should try to run as script. This is not desired for non-executable files. Fix this problem by checking the file for executability first. Only after that, follow the other potential code paths. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cygwin documentation is available on the net at https://cygwin.com You might especially be interested in https://cygwin.com/faq/faq.html#faq.programming.building-cygwin