<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src-test/bin/sh/tests, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src-test/atom?h=main</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src-test/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/'/>
<updated>2020-09-01T13:19:15Z</updated>
<entry>
<title>sh: Write absolute path in command -vV and type</title>
<updated>2020-09-01T13:19:15Z</updated>
<author>
<name>Jilles Tjoelker</name>
<email>jilles@FreeBSD.org</email>
</author>
<published>2020-09-01T13:19:15Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=ccd0a51fda561d10e091926a83e5bca0e6f41d6d'/>
<id>urn:sha1:ccd0a51fda561d10e091926a83e5bca0e6f41d6d</id>
<content type='text'>
POSIX is pretty clear that command -v, command -V and type shall write
absolute pathnames. Therefore, we need to prepend the current directory's
name to relative pathnames.

This can happen either when PATH contains a relative pathname or when the
operand contains a slash but is not an absolute pathname.
</content>
</entry>
<entry>
<title>sh: Keep ignored SIGINT/SIGQUIT after set in a background job</title>
<updated>2020-08-28T15:35:45Z</updated>
<author>
<name>Jilles Tjoelker</name>
<email>jilles@FreeBSD.org</email>
</author>
<published>2020-08-28T15:35:45Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=1cffe8b812e5efda80d7c68dab86d2e1906ef088'/>
<id>urn:sha1:1cffe8b812e5efda80d7c68dab86d2e1906ef088</id>
<content type='text'>
If job control is not enabled, a background job (... &amp;) ignores SIGINT and
SIGQUIT, but this can be reverted using the trap builtin in the same shell
environment.

Using the set builtin to change options would also revert SIGINT and SIGQUIT
to their previous dispositions.

This broke due to r317298. Calling setsignal() reverts the effect of
ignoresig().

Reported by:	bdrewery
MFC after:	1 week
</content>
</entry>
<entry>
<title>sh/tests: Re-enable bin.sh.execution.functional_test.bg12.0</title>
<updated>2020-06-28T21:33:08Z</updated>
<author>
<name>Jilles Tjoelker</name>
<email>jilles@FreeBSD.org</email>
</author>
<published>2020-06-28T21:33:08Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=40276ff30e343cfc83b4c4c6293981f2427cbf8b'/>
<id>urn:sha1:40276ff30e343cfc83b4c4c6293981f2427cbf8b</id>
<content type='text'>
This reverts r362646.

PR:		247559
MFC after:	1 week
</content>
</entry>
<entry>
<title>sh/tests: Fix flaky execution/bg12.0</title>
<updated>2020-06-28T21:15:29Z</updated>
<author>
<name>Jilles Tjoelker</name>
<email>jilles@FreeBSD.org</email>
</author>
<published>2020-06-28T21:15:29Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=c1602cfd61840305f77b94c876f5fbb59aaec542'/>
<id>urn:sha1:c1602cfd61840305f77b94c876f5fbb59aaec542</id>
<content type='text'>
When job control is not enabled, the shell ignores SIGINT while waiting for
a foreground process unless that process exits on SIGINT. In this case, the
foreground process is sleep and it does not exit on SIGINT because the
signal is only sent to the shell. Depending on order of events, this could
cause the SIGINT to be unexpectedly ignored.

On lightly loaded bare metal, the chance of this happening tends to be less
than 0.01% but with higher loads and/or virtualization it becomes more
likely.

Starting the sleep in background and using the wait builtin ensures SIGINT
will not be ignored.

PR:		247559
Reported by:	lwhsu
MFC after:	1 week
</content>
</entry>
<entry>
<title>Temporarily skip flakey bin.sh.execution.functional_test.bg12 in CI</title>
<updated>2020-06-26T09:39:23Z</updated>
<author>
<name>Li-Wen Hsu</name>
<email>lwhsu@FreeBSD.org</email>
</author>
<published>2020-06-26T09:39:23Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=c707e36ef93ca51e049100b685db42dfb33ef04d'/>
<id>urn:sha1:c707e36ef93ca51e049100b685db42dfb33ef04d</id>
<content type='text'>
PR:		238870
Sponsored by:	The FreeBSD Foundation
</content>
</entry>
<entry>
<title>sh/tests: Add tests for SIGINT in non-jobc background commands</title>
<updated>2020-06-14T19:41:24Z</updated>
<author>
<name>Jilles Tjoelker</name>
<email>jilles@FreeBSD.org</email>
</author>
<published>2020-06-14T19:41:24Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=7312c97fa4611ccecff9122d6e4e8681b0539679'/>
<id>urn:sha1:7312c97fa4611ccecff9122d6e4e8681b0539679</id>
<content type='text'>
If job control is not enabled, background commands shall ignore SIGINT and
SIGQUIT, and it shall be possible to override that ignore in the same shell.

MFC after:	1 week
</content>
</entry>
<entry>
<title>sh: Allow more scripts without #!</title>
<updated>2020-05-30T16:00:49Z</updated>
<author>
<name>Jilles Tjoelker</name>
<email>jilles@FreeBSD.org</email>
</author>
<published>2020-05-30T16:00:49Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=e0f5c1387df23c8c4811f5b24a7ef6ecac51a71a'/>
<id>urn:sha1:e0f5c1387df23c8c4811f5b24a7ef6ecac51a71a</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>sh: Fix double INTON with vfork</title>
<updated>2020-05-16T16:29:23Z</updated>
<author>
<name>Jilles Tjoelker</name>
<email>jilles@FreeBSD.org</email>
</author>
<published>2020-05-16T16:29:23Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=6bc7175f315bd4e2c334d60ee3364cbff63574f1'/>
<id>urn:sha1:6bc7175f315bd4e2c334d60ee3364cbff63574f1</id>
<content type='text'>
The shell maintains a count of the number of times SIGINT processing has
been disabled via INTOFF, so SIGINT processing resumes when all disables
have enabled again (INTON).

If an error occurs in a vfork() child, the processing of the error enables
SIGINT processing again, and the INTON in vforkexecshell() causes the count
to become negative.

As a result, a later INTOFF may not actually disable SIGINT processing. This
might cause memory corruption if a SIGINT arrives at an inopportune time. As
of r360452, it causes the shell to abort when it would unsafely allocate or
free memory in certain ways.

Note that various places such as errors in non-special builtins
unconditionally reset the count to 0, so the problem might still not always
be visible.

PR:		246497
Reported by:	jbeich
MFC after:	2 weeks
</content>
</entry>
<entry>
<title>sh/tests: Test some obscure cases with aliasing keywords</title>
<updated>2020-05-12T21:59:21Z</updated>
<author>
<name>Jilles Tjoelker</name>
<email>jilles@FreeBSD.org</email>
</author>
<published>2020-05-12T21:59:21Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=1bb4b6a76af6d04fe9d64ddad72fab84c0c84687'/>
<id>urn:sha1:1bb4b6a76af6d04fe9d64ddad72fab84c0c84687</id>
<content type='text'>
</content>
</entry>
<entry>
<title>sh: Test that executing various binary files is rejected</title>
<updated>2019-12-30T21:32:55Z</updated>
<author>
<name>Jilles Tjoelker</name>
<email>jilles@FreeBSD.org</email>
</author>
<published>2019-12-30T21:32:55Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=2a55bade0ed3e08a8c4f922df0ecf67d1ee32f53'/>
<id>urn:sha1:2a55bade0ed3e08a8c4f922df0ecf67d1ee32f53</id>
<content type='text'>
If executing a file fails with an [ENOEXEC] error, the shell executes the
file as a shell script, except that this execution may instead result in an
error message if the file is binary.

Per a recent Austin Group interpretation, we will need to change this to
allow a concatenation of a shell script and a binary payload. See
Austin Group bugs #1226 and #1250.

MFC after:	1 week
</content>
</entry>
</feed>
