diff options
author | jilles <jilles@FreeBSD.org> | 2011-01-09 21:07:30 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2011-01-09 21:07:30 +0000 |
commit | 2a782244a979d547efd9b9a664b03682ee43762b (patch) | |
tree | dfc78a13bf1df40e16086dd9a22480b709aefe36 /include | |
parent | 7864be44ec3b92093ab6b590e152838c38a31e8d (diff) | |
download | FreeBSD-src-2a782244a979d547efd9b9a664b03682ee43762b.zip FreeBSD-src-2a782244a979d547efd9b9a664b03682ee43762b.tar.gz |
sh: Remove special %builtin PATH entry.
All builtins are now always found before a PATH search.
Most ash derivatives have an undocumented feature where the presence of an
entry "%builtin" in $PATH will cause builtins to be checked at that point of
the PATH search, rather than before looking at any directories as documented
in the man page (very old versions do document this feature).
I am removing this feature from sh, as it complicates the code, may violate
expectations (for example, /usr/bin/alias is very close to a forkbomb with
PATH=/usr/bin:%builtin, only /usr/bin/builtin not being another link saves
it) and appears to be unused (all the %builtin google code search finds is
in some sort of ash source code).
Note that aliases and functions took and take precedence above builtins.
Because aliases work on a lexical level they can only ever be overridden on
a lexical level (quoting or preceding 'builtin' or 'command'). Allowing
override of functions via PATH does not really fit in the model of sh and it
would work differently from %builtin if implemented.
Note: POSIX says special builtins are found before functions. We comply to
this because we do not allow functions with the same name as a special
builtin.
Silence from: freebsd-hackers@ (message sent 20101225)
Discussed with: dougb
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions