summaryrefslogtreecommitdiffstats
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* sh: Weaken some tests to allow /rescue/sh to pass everything.jilles2011-02-053-3/+13
| | | | /rescue/sh has a different _PATH_STDPATH which affects command -p.
* sh: Fix two things about {(...)} <redir:jilles2011-02-051-0/+3
| | | | | | | | * In {(...) <redir1;} <redir2, do not drop redir1. * Maintain the difference between (...) <redir and {(...)} <redir: In (...) <redir, the redirection is performed in the child, while in {(...)} <redir it should be performed in the parent (like {(...); :;} <redir)
* sh: Forget all cached command locations on any PATH change.jilles2011-02-051-0/+12
| | | | | | | | | 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.
* sh: Do not try to execute binary files as scripts.jilles2011-02-051-0/+12
| | | | | | | | | | 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.
* sh: Add test for shell script without '#!'.jilles2011-02-021-0/+11
|
* sh: Send messages about signals to stderr.jilles2011-01-301-0/+10
| | | | | | This is required by POSIX and seems to make more sense. See also r217557.
* Keep this in sync with the ar5212 power rate table size.adrian2011-01-291-1/+1
| | | | This doesn't yet know about the 802.11n radios or rates.
* sh: Add test for EXIT trap in command substitution.jilles2011-01-271-0/+3
| | | | This is not really realistic but is an opposition to $(trap).
* Fix this tool to use the updated (corrected) v4k eeprom definition ↵adrian2011-01-251-7/+20
| | | | introduced in a previous commit.
* Add a simple tool to print the contents of a v4k EEPROM dump.adrian2011-01-247-1/+480
|
* Add a new tool which takes a text hexdump of the current EEPROM contents.adrian2011-01-223-1/+157
|
* Patch the athstats code/Makefile to cross-compile correctly.adrian2011-01-222-13/+13
|
* Add in a new tool which prints a formatted v14 eeprom from an eepromadrian2011-01-213-1/+454
| | | | | | | | | hexdump. This is a part replacement of the old athprom code, which tries to both fetch and print the contents of an eeprom dump. A tool to generate hexdumps from a running system will follow shortly.
* Remove an un-needed trailing / after OBJDIR.adrian2011-01-211-1/+1
| | | | Nitpicked by: juli
* Make the existing ath tools build again.adrian2011-01-218-3/+22
| | | | | | | | | | | * add missing includes to quieten warnings * fix an inline function decl to have a return type * since .h files are created during the build (opt_ah.h, ah_osdep.h) which modify the behaviour of the HAL include/source files, include OBJDIR in the path so the #include's work. The tools should now build when the directory is added to LOCAL_DIRS during a make buildworld.
* Make sure the PKGDIR exists before we move stuff into it.phk2011-01-181-0/+1
|
* sh: Fix signal messages being sent to the wrong file sometimes.jilles2011-01-181-0/+8
| | | | | | | | | | | | | When a foreground job exits on a signal, a message is printed to stdout about this. The buffer was not flushed after this which could result in the message being written to the wrong file if the next command was a builtin and had stdout redirected. Example: sh -c 'kill -9 $$'; : > foo; echo FOO:; cat foo Reported by: gcooper MFC after: 1 week
* sh: If exit is used without args from a trap action, exit on the signal.jilles2011-01-161-0/+9
| | | | | | | | | | | | This is useful so that it is easier to exit on a signal than to reset the trap to default and resend the signal. It matches ksh93. POSIX says that 'exit' without args from a trap action uses the exit status from the last command before the trap, which is different from 'exit $?' and matches this if the previous command is assumed to have exited on the signal. If the signal is SIGSTOP, SIGTSTP, SIGTTIN or SIGTTOU, or if the default action for the signal is to ignore it, a normal _exit(2) is done with exit status 128+signal_number.
* sh: Fix some things about -- in trap:jilles2011-01-151-0/+19
| | | | | | | * Make 'trap --' do the same as 'trap' instead of nothing. * Make '--' stop option processing (note that '-' action is not an option). Side effect: The error message for an unknown option is different.
* regression/date: unset all LC_xxx vars and set LANG/LC_ALLkeramida2011-01-091-1/+1
| | | | | | | | | 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
* sh: Remove special %builtin PATH entry.jilles2011-01-091-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* sh: Make exit without parameters from EXIT trap POSIX-compliant.jilles2011-01-081-0/+5
| | | | | | | 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 $?'.
* sh: Add simple test for 'exit' without parameters.jilles2011-01-081-0/+7
|
* sed: Add test for r217133 (-i race).jilles2011-01-082-0/+84
| | | | | PR: bin/153261 MFC after: 2 weeks
* tests: sort & fix includes, remove -include from CFLAGS of acct testskeramida2011-01-063-15/+19
| | | | | | | | | | | | | | | - 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
* sh: Do not call exitshell() from evalcommand() unless evalcommand() forkedjilles2011-01-051-0/+17
| | | | | | itself. This ensures that certain traps caused by builtins are executed.
* Update gateworks exclusion list to match latest tree.imp2011-01-031-2/+14
|
* Bump the media size from approx 600MB to approx 750MB. The greatimp2011-01-031-1/+1
| | | | | | hob-nailed tennis shoe of progress demands it! Submitted by: phk
* Put in the other half of the SRCCONF patch.imp2011-01-031-1/+1
| | | | Submitted by: phk
* sh: Test that exit $? replaces the original exit status in an EXIT trap.jilles2011-01-011-0/+6
|
* sh: Check readonly status for assignments on regular builtins.jilles2011-01-011-0/+8
| | | | | | | | | | 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
* sh: Check if dup2 for redirection from/to a file succeeds.jilles2010-12-311-0/+7
| | | | | | | | A failure (e.g. caused by ulimit -n being set very low) is a redirection error. Example: ulimit -n 9; exec 9<.
* sh: Avoid side effects from builtins in optimized command substitution.jilles2010-12-301-0/+51
| | | | | | | | | | | | | | | | | | 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.
* sh: Add two tests for special cases in command substitution that alreadyjilles2010-12-302-0/+28
| | | | work in stable/8.
* sh: Don't do optimized command substitution if expansions have side effects.jilles2010-12-281-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* sh: Add test for optimized command substitution.jilles2010-12-281-0/+53
| | | | | | | | 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.
* sh: Make expansion errors in optimized command substitution non-fatal.jilles2010-12-281-0/+5
| | | | | | 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).
* sh: Add a testcase for cmdsubst errors that already works properly.jilles2010-12-271-0/+4
| | | | | | | 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.
* Restore two commented-out tests from plus-minus1.0 to a new file.emaste2010-12-272-3/+26
| | | | | | These two cases pass on -CURRENT but fail on stable/8. Reviewed by: jilles
* Remove commented-out test that's covered in plus-minus2.0 anyway.emaste2010-12-261-2/+0
| | | | Discussed with: jilles
* sh: Make warnings in the printf builtin non-fatal, like in the program.jilles2010-12-202-0/+10
| | | | | | | | 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.
* sh: arith: Disallow decimal constants starting with 0 (containing 8 or 9).jilles2010-12-181-0/+4
| | | | | | | | | 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.
* sh: Fix corruption of command substitutions with special chars after newlinejilles2010-12-161-0/+20
| | | | | | | | 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.
* Recognize NFSv4 ACL semantics and run proper regression test.trasz2010-12-131-1/+5
|
* sh: Fix some tests that used sh instead of ${SH}jilles2010-12-122-2/+2
| | | | | | | so they tested the wrong sh. This was caused because these tests were committed after the sh -> ${SH} change but were created before.
* sh: Add a test for r216387 (long arithmetic expression in here document).jilles2010-12-121-0/+12
|
* Add regression test for new NFSv4 ACL semantics, verified with ZFSv28.trasz2010-12-121-0/+562
| | | | | Note that to run it, you need not only ZFSv28, but also a modified setfacl(1), which is not in the tree yet.
* Allow to specify path to a file we want to test with sendfile(2).pjd2010-12-111-3/+16
| | | | This allows to specify selected file system and not only /tmp/.
* printf: Test that the "--" option terminator works.jilles2010-12-082-1/+3
|
* Work around gcc constant folding bugs.das2010-12-061-1/+6
|
OpenPOWER on IntegriCloud