open() succeeds, though read() fails later, when a pathname
passed as argv[0] on the command line points to a directory,
which somehow results in dash thinking everything is okay:
$ sh dir/
$ echo $?
0
But POSIX makes it clear enough that in sh command_file,
command_file is supposed to be a
Herbert Xu wrote:
On Wed, Oct 06, 2010 at 05:08:04AM -0500, Jonathan Nieder wrote:
But POSIX makes it clear enough that in sh command_file,
command_file is supposed to be a file, not a directory. So
diagnose this with an error message and exit with status 2.
[...]
Is this required by POSIX?
On 10/06/2010 04:55 AM, Jonathan Nieder wrote:
But POSIX makes it clear enough that in sh command_file,
command_file is supposed to be a file, not a directory. So
diagnose this with an error message and exit with status 2.
[...]
Is this required by POSIX? If not this is simply making dash
On Wed, Oct 06, 2010 at 06:18:05AM -0600, Eric Blake wrote:
Right now, dash gets this wrong:
dash -c 'exec .'; echo $?
exec: 1: /: Permission denied
2
And since you already have the code in dash to detect failure to 'exec'
a directory, you should be able to reuse that code when