opnsense-src/bin/sh/tests
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
..
builtins sh: Don't treat % specially in CDPATH 2018-07-15 21:55:17 +00:00
errors sh: Use 126 and 127 exit status for failures opening a script 2018-11-27 21:49:59 +00:00
execution sh: Allow more scripts without #! 2020-05-30 16:00:49 +00:00
expansion sh/tests: Improve failure messages of expansion/arith15.0 2019-03-07 22:51:58 +00:00
invocation DIRDEPS_BUILD: Connect new directories. 2017-10-31 00:04:07 +00:00
parameters sh: Do not import IFS's value from the environment. 2016-10-08 13:40:12 +00:00
parser sh/tests: Test some obscure cases with aliasing keywords 2020-05-12 21:59:21 +00:00
set-e Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
functional_test.sh sh: Don't hardcode relative paths in the tests stderr files. 2014-08-17 14:26:12 +00:00
Makefile sh: Add tests for sh -c that already pass. 2017-08-12 19:17:48 +00:00
Makefile.depend DIRDEPS_BUILD: Connect MK_TESTS. 2016-03-09 22:46:01 +00:00