[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Misleading error when attempting to run foreign executable
From: |
Chet Ramey |
Subject: |
Re: Misleading error when attempting to run foreign executable |
Date: |
Mon, 11 Oct 2021 11:00:54 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 |
On 10/11/21 7:09 AM, Robert Elz wrote:
> Date: Sun, 10 Oct 2021 21:09:53 -0400
> From: Eli Schwartz <eschwartz@archlinux.org>
> Message-ID: <4a362385-066d-0795-9a02-ff8bbb92007f@archlinux.org>
>
> | So I wonder, if bash already in this exact case attempts to open() the
> | file and read() it to look for a shebang, what's the harm in assuming
> | (or checking) that it exists in this patch?
>
> This is clearly an OS problem, not one in bash.
This is true. And yet:
> POSIX says of ENOENT as it applies to the exec*() set of functions:
>
> [ENOENT] A component of path or file does not name an existing file
> or path or file is an empty string.
When execve returns this error for what is a clearly invalid reason, it's
not unreasonable that the shell help. It's a quality of implementation
issue at that point. If execve ever returns a different error for this
situation, the 5 lines of code will no longer be needed.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/
- Re: Misleading error when attempting to run foreign executable, (continued)
- Re: Misleading error when attempting to run foreign executable, Chet Ramey, 2021/10/04
- Re: Misleading error when attempting to run foreign executable, Ilkka Virta, 2021/10/04
- Re: Misleading error when attempting to run foreign executable, Dennis Williamson, 2021/10/04
- Re: Misleading error when attempting to run foreign executable, Chet Ramey, 2021/10/08
- Re: Misleading error when attempting to run foreign executable, Alex fxmbsw7 Ratchev, 2021/10/09
- Re: Misleading error when attempting to run foreign executable, Ángel, 2021/10/10
- Re: Misleading error when attempting to run foreign executable, Dmitry Goncharov, 2021/10/10
- Re: Misleading error when attempting to run foreign executable, Eli Schwartz, 2021/10/10
- Re: Misleading error when attempting to run foreign executable, Dmitry Goncharov, 2021/10/10
- Re: Misleading error when attempting to run foreign executable, Robert Elz, 2021/10/11
- Re: Misleading error when attempting to run foreign executable,
Chet Ramey <=
- Re: Misleading error when attempting to run foreign executable, Robert Elz, 2021/10/11
- Re: Misleading error when attempting to run foreign executable, Alex fxmbsw7 Ratchev, 2021/10/11
- Re: Misleading error when attempting to run foreign executable, Ángel, 2021/10/12
- Re: Misleading error when attempting to run foreign executable, Eli Schwartz, 2021/10/11
Re: Misleading error when attempting to run foreign executable, Andrea Monaco, 2021/10/13