Jilles Tjoelker e0f5c1387d sh: Allow more scripts without #!
Austin Group bugs #1226 and #1250 changed the requirements for shell scripts
without #! (POSIX does not specify #!; this is about the shell execution
when execve(2) returns an [ENOEXEC] error).

POSIX says we shall allow execution if the initial part intended to be
parsed by the shell consists of characters and does not contain the NUL
character.  This allows concatenating a shell script (ending with exec or
exit) and a binary payload.

In order to reject common binary files such as PNG images, check that there
is a lowercase letter or expansion before the last newline before the NUL
character, in addition to the check for the newline character suggested by
POSIX.
2020-05-30 16:00:49 +00:00
..
2017-10-31 00:07:04 +00:00
2019-03-09 00:30:13 +00:00
2019-09-30 22:00:48 +00:00
2018-11-04 17:56:16 +00:00
2017-12-07 01:57:27 +00:00
2020-05-21 15:15:50 +00:00
2018-12-03 20:01:51 +00:00
2020-02-02 20:51:28 +00:00
2018-06-17 05:14:50 +00:00
2017-10-31 00:07:04 +00:00
2020-05-30 16:00:49 +00:00
2017-10-31 00:07:04 +00:00
2017-10-31 00:07:04 +00:00
2017-10-06 08:43:14 +00:00