hush/shell/hush_test
Denys Vlasenko 215b0ca6e4 hush: fix a bug in FEATURE_SH_STANDALONE=y config. Closes 9186
Run this in a "sh SCRIPT":

sha256sum /dev/null
echo END

sha256sum is a NOEXEC applet. It runs in a forked child. Then child exit()s.
By this time, entire script is read, and buffered in a FILE object
from fopen("SCRIPT"). But fgetc() did not consume entire input.
exit() lseeks back by -9 bytes, from <eof> to 'e' in 'echo'.
(this may be libc-specific).
This change of fd position *is shared with the parent*!

Now parent can read more, and it thinks there is another "echo END".
End result: two "echo END"s are run.

Fix this by _exit()ing instead.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2016-08-19 18:43:06 +02:00
..
hush-arith
hush-bugs hush: document buggy handling of duplicate "local" 2015-04-18 19:38:13 +02:00
hush-glob ash,hush: add a test which fails for ash since commit 549deab 2015-09-04 03:33:02 +02:00
hush-leak
hush-misc hush-misc/func_args1.tests: remove "UNFIXED BUG", it does not fail 2015-11-04 14:50:19 +01:00
hush-parsing hush: fix remaining known two bugs with IFS expansion. Closes 4027. 2011-08-01 18:16:43 +02:00
hush-psubst
hush-read
hush-trap
hush-vars hush: add recent ash tests to hush testsuite too (they all pass for hush) 2015-05-18 10:23:16 +02:00
hush-z_slow
.gitignore
run-all hush: fix a bug in FEATURE_SH_STANDALONE=y config. Closes 9186 2016-08-19 18:43:06 +02:00