|
Revision tags: release/13.4.0-p5, release/13.5.0-p1, release/14.2.0-p3, release/13.5.0, release/14.2.0-p2, release/14.1.0-p8, release/13.4.0-p4, release/14.1.0-p7, release/14.2.0-p1, release/13.4.0-p3, release/14.2.0, release/13.4.0, release/14.1.0, release/13.3.0, release/14.0.0 |
|
| #
1d386b48 |
| 16-Aug-2023 |
Warner Losh <[email protected]> |
Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
|
Revision tags: release/13.2.0, release/12.4.0, release/13.1.0, release/12.3.0 |
|
| #
d2c23317 |
| 23-Sep-2021 |
Stephane Rochoy <[email protected]> |
sh: Add -o verify to use O_VERIFY when sourcing scripts
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 prote
sh: Add -o verify to use O_VERIFY when sourcing scripts
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
show more ...
|
|
Revision tags: release/13.0.0, release/12.2.0 |
|
| #
ccd0a51f |
| 01-Sep-2020 |
Jilles Tjoelker <[email protected]> |
sh: Write absolute path in command -vV and type
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
sh: Write absolute path in command -vV and type
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.
show more ...
|
|
Revision tags: release/11.4.0 |
|
| #
e0f5c138 |
| 30-May-2020 |
Jilles Tjoelker <[email protected]> |
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)
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.
show more ...
|
|
Revision tags: release/12.1.0, release/11.3.0, release/12.0.0 |
|
| #
bb324af6 |
| 09-Nov-2018 |
Jilles Tjoelker <[email protected]> |
sh: Unify EXERROR and EXEXEC
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 rais
sh: Unify EXERROR and EXEXEC
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.
show more ...
|
| #
b5532964 |
| 27-Oct-2018 |
Jilles Tjoelker <[email protected]> |
sh: Use exitstatus instead of exerrno to pass EXEXEC status
No functional change is intended.
|
| #
4600b569 |
| 15-Jul-2018 |
Jilles Tjoelker <[email protected]> |
sh: Don't treat % specially in CDPATH
|
|
Revision tags: release/11.2.0, release/10.4.0, release/11.1.0 |
|
| #
b9807277 |
| 06-May-2017 |
Jilles Tjoelker <[email protected]> |
sh: Update TOUR and comments for some code changes, some of them old.
Also, improve some terminology in TOUR and comments.
|
| #
fbbd9655 |
| 28-Feb-2017 |
Warner Losh <[email protected]> |
Renumber copyright clause 4
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
Renumber copyright clause 4
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 <[email protected]> Pull Request: https://github.com/freebsd/freebsd/pull/96
show more ...
|
|
Revision tags: release/11.0.1, release/11.0.0, release/10.3.0 |
|
| #
7d980385 |
| 13-Mar-2016 |
Jilles Tjoelker <[email protected]> |
sh: Fix copying uninitialized field 'special'.
This just copied uninitialized data and did not depend on it later, so it should not be dangerous.
Found by: clang static analyzer
|
| #
d3fa2c78 |
| 03-Jan-2016 |
Jilles Tjoelker <[email protected]> |
sh: Reduce size of builtins table.
|
|
Revision tags: release/10.2.0 |
|
| #
c3c85727 |
| 24-Jun-2015 |
Jilles Tjoelker <[email protected]> |
sh: Fix some arithmetic undefined behaviour.
Fix shifts of possibly negative numbers found with ubsan and avoid signed integer overflow when hashing an extremely long command name.
MFC after: 1 week
|
|
Revision tags: release/10.1.0 |
|
| #
e61ae4ff |
| 20-Jul-2014 |
Jilles Tjoelker <[email protected]> |
sh: Remove prefix() function. Use strncmp() instead.
|
|
Revision tags: release/9.3.0 |
|
| #
2ceda702 |
| 31-May-2014 |
Jilles Tjoelker <[email protected]> |
sh: Simplify find_command() slightly.
|
| #
1632bf1a |
| 26-Mar-2014 |
Jilles Tjoelker <[email protected]> |
sh: Fix possible memory leaks and double frees with unexpected SIGINT.
|
|
Revision tags: release/10.0.0 |
|
| #
670dd3f0 |
| 30-Nov-2013 |
Jilles Tjoelker <[email protected]> |
sh: Prefer memcpy() to strcpy() in most cases. Remove the scopy macro.
|
| #
5d4d10e3 |
| 10-Nov-2013 |
Jilles Tjoelker <[email protected]> |
sh: Properly quote alias output from command -v.
An alias should be printed by command -v as a command line; therefore, make the alias definition suitable for re-input to the shell.
|
|
Revision tags: release/9.2.0 |
|
| #
65519ccb |
| 30-Aug-2013 |
Jilles Tjoelker <[email protected]> |
sh: Recognize "--" as end of options in type builtin.
This implementation makes minimal changes: command names starting with "-" (other than "--") can still be queried normally.
|
| #
338b821b |
| 25-Jul-2013 |
Jilles Tjoelker <[email protected]> |
sh: Remove mkinit.
Replace the RESET blocks with regular functions and a reset() function that calls them all.
This code generation tool is unusual and does not appear to provide much benefit. I do
sh: Remove mkinit.
Replace the RESET blocks with regular functions and a reset() function that calls them all.
This code generation tool is unusual and does not appear to provide much benefit. I do not think isolating the knowledge about which modules need to be reset is worth an almost 500-line build tool and wider scope for variables used by the reset functions.
Also, relying on reset functions is often wrong: the cleanup should be done in exception handlers so that no stale state remains after 'command eval' and the like.
show more ...
|
|
Revision tags: release/8.4.0 |
|
| #
46c6b52d |
| 01-Apr-2013 |
Jilles Tjoelker <[email protected]> |
sh: Fix various compiler warnings.
It now passes WARNS=7 with clang on i386.
GCC 4.2.1 does not understand setjmp() properly so will always trigger -Wuninitialized. I will not add the volatile keyw
sh: Fix various compiler warnings.
It now passes WARNS=7 with clang on i386.
GCC 4.2.1 does not understand setjmp() properly so will always trigger -Wuninitialized. I will not add the volatile keywords to suppress this.
show more ...
|
| #
523646ee |
| 14-Jan-2013 |
Jilles Tjoelker <[email protected]> |
sh: Simplify cd-hash interaction.
Instead of rechecking relative paths for all hashed utilities after a cd, track if any utility in cmdtable depends on a relative path in PATH. If there is such a ut
sh: Simplify cd-hash interaction.
Instead of rechecking relative paths for all hashed utilities after a cd, track if any utility in cmdtable depends on a relative path in PATH. If there is such a utility, cd clears the entire table.
As a result, the '*' in hash no longer happens.
show more ...
|
|
Revision tags: release/9.1.0 |
|
| #
d172408c |
| 05-Nov-2012 |
Jilles Tjoelker <[email protected]> |
sh: Change cmdtype in tblentry from short to signed char.
If this is a smaller type than int anyway, we can make it the smallest possible.
|
| #
422c281c |
| 03-Nov-2012 |
Jilles Tjoelker <[email protected]> |
sh: Use C99 flexible array instead of accessing array beyond bounds.
Although sufficient memory is available for a longer string in cmdname, this is undefined behaviour anyway.
Side effect: for ali
sh: Use C99 flexible array instead of accessing array beyond bounds.
Although sufficient memory is available for a longer string in cmdname, this is undefined behaviour anyway.
Side effect: for alignment reasons, an additional byte of memory is allocated per hashed command.
show more ...
|
| #
84fbdd8c |
| 15-Jul-2012 |
Jilles Tjoelker <[email protected]> |
sh: Expand assignment-like words specially for export/readonly/local.
Examples: export x=~ now expands the tilde local y=$1 is now safe, even if $1 contains IFS characters or metacharacters.
Fo
sh: Expand assignment-like words specially for export/readonly/local.
Examples: export x=~ now expands the tilde local y=$1 is now safe, even if $1 contains IFS characters or metacharacters.
For a word to "look like an assignment", it must start with a name followed by an equals sign, none of which may be quoted.
The special treatment applies when the first word (potentially after "command") is "export", "readonly" or "local". There may be quoting characters but no expansions. If "local" is overridden with a function there is no special treatment ("export" and "readonly" cannot be overridden with a function).
If things like local arr=(1 2 3) are ever allowed in the future, they cannot call a "local" function. This would either be a run-time error or it would call the builtin.
This matches Austin Group bug #351, planned for the next issue of POSIX.1.
PR: bin/166771
show more ...
|
|
Revision tags: release/8.3.0_cvs, release/8.3.0 |
|
| #
c0b3cf06 |
| 11-Feb-2012 |
Jilles Tjoelker <[email protected]> |
sh: Make 'hash' return 1 if at least one utility is not found.
Reported by: lme
|