<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/bin/sh/exec.c, branch stable/14</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=stable%2F14</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=stable%2F14'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2023-08-16T17:54:42Z</updated>
<entry>
<title>Remove $FreeBSD$: one-line .c pattern</title>
<updated>2023-08-16T17:54:42Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:54:42Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=1d386b48a555f61cb7325543adbbb5c3f3407a66'/>
<id>urn:sha1:1d386b48a555f61cb7325543adbbb5c3f3407a66</id>
<content type='text'>
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
</content>
</entry>
<entry>
<title>sh: Add -o verify to use O_VERIFY when sourcing scripts</title>
<updated>2021-09-23T08:43:09Z</updated>
<author>
<name>Stephane Rochoy</name>
<email>stephane.rochoy@stormshield.eu</email>
</author>
<published>2021-09-23T08:40:59Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=d2c233176f44944ef3ed941a60010839340c06a7'/>
<id>urn:sha1:d2c233176f44944ef3ed941a60010839340c06a7</id>
<content type='text'>
Add -o verify to sh to make it use O_VERIFY when
sourcing scripts and reading profiles.

Useful in conjunction with mac_veriexec to help protect at
least some parts of the boot sequence, e.g., /etc/rc*.

Differential revision:	https://reviews.freebsd.org/D30464
Reviewed by:		jilles, sjg
Obtained from:		Stormshield
</content>
</entry>
<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/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: 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/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: Unify EXERROR and EXEXEC</title>
<updated>2018-11-09T14:58:24Z</updated>
<author>
<name>Jilles Tjoelker</name>
<email>jilles@FreeBSD.org</email>
</author>
<published>2018-11-09T14:58:24Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=bb324af62ae3b862c2903e698c83de6addda3df0'/>
<id>urn:sha1:bb324af62ae3b862c2903e698c83de6addda3df0</id>
<content type='text'>
The difference between EXERROR and EXEXEC was that EXEXEC passed along
exitstatus and EXERROR set exitstatus to 2 in the handling code.

By changing the places that raised EXERROR to set exitstatus to 2, the
handling of EXERROR and EXEXEC becomes the same.
</content>
</entry>
<entry>
<title>sh: Use exitstatus instead of exerrno to pass EXEXEC status</title>
<updated>2018-10-27T20:17:57Z</updated>
<author>
<name>Jilles Tjoelker</name>
<email>jilles@FreeBSD.org</email>
</author>
<published>2018-10-27T20:17:57Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=b5532964e74ae1028c6f3aa5257f4af52251154c'/>
<id>urn:sha1:b5532964e74ae1028c6f3aa5257f4af52251154c</id>
<content type='text'>
No functional change is intended.
</content>
</entry>
<entry>
<title>sh: Don't treat % specially in CDPATH</title>
<updated>2018-07-15T21:55:17Z</updated>
<author>
<name>Jilles Tjoelker</name>
<email>jilles@FreeBSD.org</email>
</author>
<published>2018-07-15T21:55:17Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=4600b569bb04e0dfe11e7728c40ddc7b5b3b2716'/>
<id>urn:sha1:4600b569bb04e0dfe11e7728c40ddc7b5b3b2716</id>
<content type='text'>
</content>
</entry>
<entry>
<title>sh: Update TOUR and comments for some code changes, some of them old.</title>
<updated>2017-05-06T13:28:42Z</updated>
<author>
<name>Jilles Tjoelker</name>
<email>jilles@FreeBSD.org</email>
</author>
<published>2017-05-06T13:28:42Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=b98072777fd86407714cb3492ac38a2908dc6af3'/>
<id>urn:sha1:b98072777fd86407714cb3492ac38a2908dc6af3</id>
<content type='text'>
Also, improve some terminology in TOUR and comments.
</content>
</entry>
<entry>
<title>Renumber copyright clause 4</title>
<updated>2017-02-28T23:42:47Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2017-02-28T23:42:47Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=fbbd9655e5107c68e4e0146ff22b73d7350475bc'/>
<id>urn:sha1:fbbd9655e5107c68e4e0146ff22b73d7350475bc</id>
<content type='text'>
Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by:	Jan Schaumann &lt;jschauma@stevens.edu&gt;
Pull Request:	https://github.com/freebsd/freebsd/pull/96
</content>
</entry>
<entry>
<title>sh: Fix copying uninitialized field 'special'.</title>
<updated>2016-03-13T22:54:14Z</updated>
<author>
<name>Jilles Tjoelker</name>
<email>jilles@FreeBSD.org</email>
</author>
<published>2016-03-13T22:54:14Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=7d980385e8d1131e2f783eb10b02ff3ebaf0454d'/>
<id>urn:sha1:7d980385e8d1131e2f783eb10b02ff3ebaf0454d</id>
<content type='text'>
This just copied uninitialized data and did not depend on it later, so it
should not be dangerous.

Found by:	clang static analyzer
</content>
</entry>
</feed>
