| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
When running with a custom locale setup, it's easy to confuse the
date regression tests and cause them to fail, e.g. when LANG='C'
but LC_ALL='el_GR.UTF-8'. Set LC_ALL to 'C', which overrides all
other LC_xxx options, to avoid this sort of problem.
Reviewed by: uqs, edwin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
It should use the original exit status, just like falling off the
end of the trap handler.
Outside an EXIT trap, 'exit' is still equivalent to 'exit $?'.
|
| |
|
|
|
|
|
| |
PR: bin/153261
MFC after: 2 weeks
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Sort the includes of pack.c, moving sys/*.h files near the top.
- Add a couple of missing #include lines, and remove the need for
custom -include options in the CFLAGS of the test Makefile.
- Remove the ad-hoc 'all' target, but keep its 'regress' bits for
testing.
- Convert the ad-hoc 'clean' target to proper CLEANFILES stuff,
so that the normal bsd.prog.mk machinery can clean up.
- Use `make -V .OBJDIR' to detect the place where 'pack' lives,
so that regress.t works both with and without 'make obj'.
Reviewed by: uqs
MFC after: 1 week
|
|
|
|
|
|
| |
itself.
This ensures that certain traps caused by builtins are executed.
|
| |
|
|
|
|
|
|
| |
hob-nailed tennis shoe of progress demands it!
Submitted by: phk
|
|
|
|
| |
Submitted by: phk
|
| |
|
|
|
|
|
|
|
|
|
|
| |
An error message is written, the builtin is not executed, nonzero exit
status is returned but the shell does not abort.
This was already checked for special builtins and external commands, with
the same consequences except that the shell aborts for special builtins.
Obtained from: NetBSD
|
|
|
|
|
|
|
|
| |
A failure (e.g. caused by ulimit -n being set very low) is a redirection
error.
Example:
ulimit -n 9; exec 9<.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change the criterion for builtins to be safe to execute in the same process
in optimized command substitution from a blacklist of only cd, . and eval to
a whitelist.
This avoids clobbering the main shell environment such as by $(exit 4) and
$(set -x).
The builtins jobid, jobs, times and trap can still show information not
available in a child process; this is deliberately permitted. (Changing
traps is not.)
For some builtins, whether they are safe depends on the arguments passed to
them. Some of these are always considered unsafe to keep things simple; this
only harms efficiency a little in the rare case they are used alone in a
command substitution.
|
|
|
|
| |
work in stable/8.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before considering to execute a command substitution in the same process,
check if any of the expansions may have a side effect; if so, execute it in
a new process just like happens if it is not a single simple command.
Although the check happens at run time, it is a static check that does not
depend on current state. It is triggered by:
- expanding $! (which may cause the job to be remembered)
- ${var=value} default value assignment
- assignment operators in arithmetic
- parameter substitutions in arithmetic except ${#param}, $$, $# and $?
- command substitutions in arithmetic
This means that $((v+1)) does not prevent optimized command substitution,
whereas $(($v+1)) does, because $v might expand to something containing
assignment operators.
Scripts should not depend on these exact details for correctness. It is also
imaginable to have the shell fork if and when a side effect is encountered
or to create a new temporary namespace for variables.
Due to the $! change, the construct $(jobs $!) no longer works. The value of
$! should be stored in a variable outside command substitution first.
|
|
|
|
|
|
|
|
| |
This test verifies that certain expansions without side effects do not
cause the command substitution to be executed in a child process.
This is not a correctness requirement, but it involves a nontrivial amount
of code and it would be unfortunate if it stopped working.
|
|
|
|
|
|
| |
Command substitutions consisting of a single simple command are executed in
the main shell process but this should be invisible apart from performance
and very few exceptions such as $(trap).
|
|
|
|
|
|
|
| |
If a command substitution consists of one special builtin and there is a
redirection error, this should not abort the outer shell.
It was fixed in r201366 by ignoring special builtin properties for command
substitutions consisting of one builtin.
|
|
|
|
|
|
| |
These two cases pass on -CURRENT but fail on stable/8.
Reviewed by: jilles
|
|
|
|
| |
Discussed with: jilles
|
|
|
|
|
|
|
|
| |
The #define for warnx now behaves much like the libc function (except that
it uses sh command name and output).
Also, it now uses C99 __VA_ARGS__ so there is no need for three different
macros for 0, 1 or 2 parameters.
|
|
|
|
|
|
|
|
|
| |
Constants in arithmetic starting with 0 should be octal only.
This avoids the following highly puzzling result:
$ echo $((018-017))
3
by making it an error instead.
|
|
|
|
|
|
|
|
| |
The CTLESC byte to protect a special character was output before instead of
after a newline directly preceding the special character.
The special handling of newlines is because command substitutions discard
all trailing newlines.
|
| |
|
|
|
|
|
|
|
| |
so they tested the wrong sh.
This was caused because these tests were committed after the sh -> ${SH}
change but were created before.
|
| |
|
|
|
|
|
| |
Note that to run it, you need not only ZFSv28, but also a modified setfacl(1),
which is not in the tree yet.
|
|
|
|
| |
This allows to specify selected file system and not only /tmp/.
|
| |
|
| |
|
|
|
|
| |
that it always returns the same nonzero value.
|
| |
|
| |
|
|
|
|
|
|
|
| |
Remove the only duplicate found by the optional files check. Fix typos,
while here.
Suggested by: netchild
|
|
|
|
|
| |
Requested and reviewed by: rwatson
MFC after: 1 week
|
|
|
|
|
|
|
|
| |
o Create a sparse file instead of a fully zerod one. This trades the
possibiltiy of running out of space during the build for the speed
gain not having do write all those zeros...
Submitted by: n_hibma
|
|
|
|
| |
SRCCONF=/dev/null.
|
| |
|
|
|
|
|
| |
* Use $(getconf PATH_MAX /) to make sure we actually exercise the hard part
* Delete our test area even if the test fails
|
| |
|
| |
|
|
|
|
|
| |
we already did the target port, and by leaving behind a /tmp/_.plist.dot
which documents which ports pulled in what other ports.
|
|
|
|
|
|
| |
It is quite effective at detecting mistakes in memalloc.c and code using it.
It is somewhat slow, but some of the patches in my queue improve it.
|
| |
|
| |
|
|
|
|
| |
Submitted by: Alexander Best <arundel@freebsd.org>
|
| |
|
|
|
|
|
|
| |
liblwres.so.10 has been replaced by liblwres.so.50.
Reported by: arundel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a fast machine first brings up some non TCP networking program
it is quite possible that we will drop packets due to the fact that
only one packet can be held per ARP entry. This leads to packets
being missed when a program starts or restarts if the ARP data is
not currently in the ARP cache.
This code adds a new sysctl, net.link.ether.inet.maxhold, which defines
a system wide maximum number of packets to be held in each ARP entry.
Up to maxhold packets are queued until an ARP reply is received or
the ARP times out. The default setting is the old value of 1
which has been part of the BSD networking code since time
immemorial.
Expose the time we hold an incomplete ARP entry by adding
the sysctl net.link.ether.inet.wait, which defaults to 20
seconds, the value used when the new ARP code was added..
Reviewed by: bz, rpaulo
MFC after: 3 weeks
|