History log of /freebsd-12.1/bin/sh/exec.c (Results 1 – 25 of 74)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: release/12.2.0, release/11.4.0, release/12.1.0, release/11.3.0, release/12.0.0
# 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, release/7.4.0, release/8.2.0, release/8.1.0, release/7.3.0, release/8.0.0
# f6d21b6e 11-Oct-2009 Jilles Tjoelker <[email protected]>

MFC r196483,r196634:
sh: Fix crash when undefining or redefining a currently executing function

Add a reference count to function definitions.
Memory may leak if a SIGINT arrives in interactive mode

MFC r196483,r196634:
sh: Fix crash when undefining or redefining a currently executing function

Add a reference count to function definitions.
Memory may leak if a SIGINT arrives in interactive mode at exactly the wrong
time, this will be fixed later by changing SIGINT handling.

PR: bin/137640
Approved by: re (kib)

show more ...


# c0b3cf06 11-Feb-2012 Jilles Tjoelker <[email protected]>

sh: Make 'hash' return 1 if at least one utility is not found.

Reported by: lme


# 2fae4c3d 25-Jan-2012 Philippe Charnier <[email protected]>

Add prototypes, ANSIfy functions definitions to reduce WARNS=6 output.


# 260fc3f4 01-Jan-2012 Jilles Tjoelker <[email protected]>

sh: Make various functions static.


# c059d822 05-Feb-2011 Jilles Tjoelker <[email protected]>

sh: Remove clearcmdentry()'s now unused argument.


# ef0cb80d 05-Feb-2011 Jilles Tjoelker <[email protected]>

sh: Forget all cached command locations on any PATH change.

POSIX requires this and it is simpler than the previous code that remembered
command locations when appending directories to PATH.

In par

sh: Forget all cached command locations on any PATH change.

POSIX requires this and it is simpler than the previous code that remembered
command locations when appending directories to PATH.

In particular,
PATH=$PATH
is no longer a no-op but discards all cached command locations.

show more ...


# 604e8224 05-Feb-2011 Jilles Tjoelker <[email protected]>

sh: Do not try to execute binary files as scripts.

If execve() returns an [ENOEXEC] error, check if the file is binary before
trying to execute it using sh. A file is considered binary if at least o

sh: Do not try to execute binary files as scripts.

If execve() returns an [ENOEXEC] error, check if the file is binary before
trying to execute it using sh. A file is considered binary if at least one
of the first 256 bytes is '\0'.

In particular, trying to execute ELF binaries for the wrong architecture now
fails with an "Exec format error" message instead of syntax errors and
potentially strange results.

show more ...


123