Just lost a couple hours due to this bug.

What Vincent reported seems debatable as -c is explicitely documented as
"Read commands from the command_string operand instead of from the standard
input." which suggests the file is to be interpreted as a shell script.

But same happens for ./foo or `foo` where one would expect the ability to
execute arbitrary binary files.  Thus, dash must handle the case of a binary
that currently has no binfmt handler loaded.

Looking at dash's "competitors", I see that:
* bash looks for \0 bytes in a sample at the start of the file
  (somehow only up to first \n)
* mksh knows a bunch of magic signatures
* zsh looks for \0 bytes in a sample at the start of the file


-- 
A tit a day keeps the vet away.

Reply via email to