summaryrefslogtreecommitdiffstats
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* sh: Detect various additional errors in the parser.jilles2010-10-291-0/+4
| | | | | | | | | | | | | Apart from detecting breakage earlier or at all, this also fixes a segfault in the testsuite. The "handling" of the breakage left an invalid internal representation in some cases. Examples: echo a; do echo b echo `) echo a` echo `date; do do do` Exp-run done by: pav (with some other sh(1) changes)
* sh: Fix some issues with CTL* bytes and ${var#pat}.jilles2010-10-291-0/+22
| | | | | | | | | | | | | | subevalvar() incorrectly assumed that CTLESC bytes were present iff the expansion was quoted. However, they are present iff various processing such as word splitting is to be done later on. Example: v=@$e@$e@$e@ y="${v##*"$e"}" echo "$y" failed if $e contained the magic CTLESC byte. Exp-run done by: pav (with some other sh(1) changes)
* sh: Do IFS splitting on word in ${v+word} and ${v-word}.jilles2010-10-291-0/+34
| | | | | | | | | | | | | | | | | The code is inspired by NetBSD sh somewhat, but different because we preserve the old Almquist/Bourne/Korn ability to have an unquoted part in a quoted ${v+word}. For example, "${v-"*"}" expands to $v as a single field if v is set, but generates filenames otherwise. Note that this is the only place where we split text literally from the script (the similar ${v=word} assigns to v and then expands $v). The parser must now add additional markers to allow the expansion code to know whether arbitrary characters in substitutions are quoted. Example: for i in ${$+a b c}; do echo $i; done Exp-run done by: pav (with some other sh(1) changes)
* sh: Only accept a '}' inside ${v+-=?...} if double-quote state matches.jilles2010-10-281-0/+31
| | | | | | | | | | | | | If double-quote state does not match, treat the '}' literally. This ensures double-quote state remains the same before and after a ${v+-=?...} which helps with expand.c. It makes things like ${foo+"\${bar}"} which I have seen in the wild work as expected. Exp-run done by: pav (with some other sh(1) changes)
* sh: Make double-quotes quote a '}' inside ${v#...} and ${v%...}.jilles2010-10-281-0/+28
| | | | | Exp-run done by: pav (with some other sh(1) changes) PR: bin/57554
* sh: Do not allow overriding a special builtin with a function.jilles2010-10-241-0/+7
| | | | | | | | | | | | | | | | | This is a syntax error. POSIX does not say explicitly whether defining a function with the same name as a special builtin is allowed, but it does say that it is impossible to call such a function. A special builtin can still be overridden with an alias. This commit is part of a set of changes that will ensure that when something looks like a special builtin to the parser, it is one. (Not the other way around, as it remains possible to call a special builtin named by a variable or other substitution.) Exp-run done by: pav (with some other sh(1) changes)
* sh: Make sure defined functions can actually be called.jilles2010-10-241-0/+25
| | | | | | | | | | | | | | | | | Add some conservative checks on function names: - Disallow expansions or quoting characters; these can only be called via strange control characters - Disallow '/'; these functions cannot be called anyway, as exec.c assumes they are pathnames - Make the CTL* bytes work properly in function names. These are syntax errors. POSIX does not require us to support more than names (letters, digits and underscores, not starting with a digit), but I do not want to restrict it that much at this time. Exp-run done by: pav (with some other sh(1) changes)
* sh: Check whether dup2 was successful for >&FD and <&FD.jilles2010-10-241-0/+4
| | | | | | A failure (usually caused by FD not being open) is a redirection error. Exp-run done by: pav (with some other sh(1) changes)
* sh: Add a test trying to close a descriptor that is not open.jilles2010-10-241-0/+3
| | | | | In stable/8 and older, this fails. Some of the redirection changes in head have fixed it.
* sh: Change ! within a pipeline to start a new pipeline instead.jilles2010-10-241-0/+3
| | | | | | | | | | | | | | This is how ksh93 treats ! within a pipeline and makes the ! in a | ! b | c negate the exit status of the pipeline, as if it were a | { ! b | c; } Side effect: something like f() ! a is now a syntax error, because a function definition takes a command, not a pipeline. Exp-run done by: pav (with some other sh(1) changes)
* sh: Add some testcases for alias expansion.jilles2010-10-242-0/+11
|
* Add microbenchmark for create/unlink of a zero-byte file.rwatson2010-10-241-3/+32
| | | | | Sponsored by: Google, Inc. MFC after: 2 weeks
* Validate syscall_timing test names before starting to provide earlierrwatson2010-10-221-12/+68
| | | | | | | | | | | | | | feedback regarding user error. Provide default loop and timing settings. Add a new test that just times pread() without the open()/close(). Mark tests requiring a path argument so we can provide better feedback to the user than EFAULT on (null). Sponsored by: Google, Inc. MFC after: 2 weeks
* Universally use uintmax_t in syscall_timing; rearrange arithmetic torwatson2010-10-211-64/+65
| | | | | | | | suffer fewer rounding errors with smaller numbers; fix argc validation so multiple tests run on a single command line. Sponsored by: Google, Inc. MFC after: 2 weeks
* Add Cambridge/Google tag since the copyright has been updated.rwatson2010-10-211-0/+3
| | | | MFC after: 2 weeks
* Further syscall_timing improvements: allow an arbitrary "path" stringrwatson2010-10-211-45/+41
| | | | | | | | argument to be passed on the command line, allowing file-related tests to be pointed at wherever desired. Sponsored by: Google, Inc. MFC after: 2 weeks
* Fix bug in recent syscall_timing change: measure the number of iterationsrwatson2010-10-211-3/+4
| | | | | | | | each loop, rather than once up front. The distinction is unimportant when doing a fix iteration count, but when using a timer, it should vary. Sponsored by: Google, Inc. MFC after: 2 weeks
* Further enhancements to syscall_timing:rwatson2010-10-211-79/+258
| | | | | | | | | | | | - Use getopt rather than hand-parsed arguments - Allow iterations to be specified and/or a new number of seconds bound on the number of iterations - Fix printout of timer resolution - Add new tests, such as TCP and UDP socket creation, and open/read/close of /dev/zero and /dev/null. Sponsored by: Google, Inc. MFC after: 2 weeks
* Improve the structure and implementation of the syscall_timingrwatson2010-10-211-106/+374
| | | | | | | | | | | | | | | | microbenchmark suite: - Use common benchmark_start/benchmark_stop routines to simplify individual benchmarks. - Add a central table of tests with names, where new tests can be hooked in easily. - Add new benchmarks for dup, shm_open, shm_open + fstat, fork, vfork, vfork + exec, chroot, setuid. - Accept a number of loops, not just a number of iterations. - Report results more usefully in a table. Sponsored by: Google, Inc. MFC after: 2 weeks
* sh: Allow running 'prove' from tools/regression/bin/sh againjilles2010-10-151-5/+1
| | | | | without needing to set special environment variables, testing the 'sh' from PATH.
* Embellish this testcase a little bit to be more clear what the output isobrien2010-10-142-0/+18
| | | | | | and why. The first case is correct usage which has but one correct output. The 2nd and 3rd cases are incorrect usage in which the exact output is not standardized and various shells give various allowable output.
* Do not assume in growstackstr() that a "precious" character will beobrien2010-10-131-0/+15
| | | | | | | | | | | | | | | | immediately written into the stack after the call. Instead let the caller manage the "space left". Previously, growstackstr()'s assumption causes problems with STACKSTRNUL() where we want to be able to turn a stack into a C string, and later pretend the NUL is not there. This fixes a bug in STACKSTRNUL() (that grew the stack) where: 1. STADJUST() called after a STACKSTRNUL() results in an improper adjust. This can be seen in ${var%pattern} and ${var%%pattern} evaluation. 2. Memory leak in STPUTC() called after a STACKSTRNUL(). Reviewed by: jilles
* Allow one to regression test 'sh' changes without having to installobrien2010-10-1228-82/+97
| | | | a potentially bad /bin/sh first.
* Correct regression test to not show a false positive when run as root.obrien2010-10-111-6/+9
|
* Don't blow away /bin/rmail symlink if we are keeping mailwrapper.markm2010-10-081-0/+2
| | | | | Mailwrapper can provide a perfectly good rmail with other mailers.
* Clean up tools in tools/tools/netrate.pluknet2010-10-082-6/+11
| | | | | | | | | | | | | - tcpconnect incorrectly uses err() in usage() with errx() semantics [1] That produces dirty error message: tcpconnect: usage: tcpconnect [ip]: Unknown error: 0 - 64-bit aware fixes in printf() usage [2] o netrate/juggle: time_t has arch-dependent size o netrate/tcpconnect: don't assume %ll has always 64bit. PR: 146088 [1], 146086 [2] (modified) Approved by: kib (mentor) MFC after: 1 week
* Add some missing files to optionally delete.netchild2010-10-061-0/+27
| | | | Submitted by: Paul B Mahol <onemda@gmail.com>
* - Add WITH_GPIO entry to src.conf(5) man pagegonzo2010-10-051-0/+2
|
* Change the output of mctest to give a summary of the results insteadgnn2010-10-012-13/+34
| | | | | | | | | | | | of printing a long list. Add a default base port, and default mulitcast address to the runner script. Add support for specifying a different local and remote interface in the runner script. MFC after: 1 week
* - simplify by using one build scriptmr2010-10-018-678/+32
| | | | | | - use label for mounting - use GENERIC kernel - create empty Pkg directory
* tr: Fix '[=]=]' equivalence class.jilles2010-09-293-1/+5
| | | | | | | | | | | A closing bracket immediately after '[=' should not be treated as special. Different from the submitted patch, a string ending with '[=' does not cause access beyond the terminating '\0'. PR: bin/150384 Submitted by: Richard Lowe MFC after: 2 weeks
* Correct message.pjd2010-09-271-1/+1
| | | | | Pointed out by: jhb MFC after: 2 weeks
* Add some regression tests for newly added -J and -j options.pjd2010-09-251-0/+126
| | | | MFC after: 2 weeks
* Don't hardcode md0 in message, use $md instead.pjd2010-09-251-1/+1
| | | | Reported by: Ronald Klop <ronald-freebsd8@klop.yi.org>
* Don't leave zombies behind.trasz2010-09-251-0/+2
|
* Add a shell script to generate a test script for trivial ACLs.trasz2010-09-251-0/+53
|
* Update regression tests after AES-XTS addition.pjd2010-09-257-21/+70
| | | | MFC after: 2 weeks
* - Use $md instead of md0, which fixes tests when md(4) device is alreadypjd2010-09-251-2/+2
| | | | | | | present. - Correct message - we create GPT, not MBR. MFC after: 2 weeks
* Add test cases for stack unwinding.davidxu2010-09-258-0/+265
|
* Make the labels match the device name that's mounted, not just theimp2010-09-221-2/+4
| | | | | | | | | | slice they are on. When NANO_LABEL is not defined, the fstab generates entries that specify /dev/ad0s1a. When NANO_LABEL is defined, it generates /dev/usb/${NANO_LABEL}s1a. The prior code created the file system with a label of ${NANO_LABEL}s1, leading to problems on boot. Pointy hat to: imp@
* tools/umastat: more cleanupsavg2010-09-211-3/+5
| | | | | | PR: misc/146119 Submitted by: pluknet <pluknet@gmail.com> MFC after: 1 week
* Support new variable NANO_LABEL. When set to a non-null string,imp2010-09-201-16/+37
| | | | | | | | | nanobsd will build a system that uses this label (via /dev/ufs/${NANO_LABEL}sX) in preference to NANO_DRIVE (well, it forces NANO_DRIVE to be ufs/${NANO_LABEL}). This allows images that will boot off usb stick or CF card easily well. There is no change if you don't set this variable.
* Add a geli resize subcommand to resize encrypted filesystems priorbrian2010-09-201-0/+149
| | | | | | | | | | | | | | | to growing the filesystem. Refuse to attach providers where the metadata provider size is wrong. This makes post-boot attaches behave consistently with pre-boot attaches. Also refuse to restore metadata to a provider of the wrong size without the new -f switch. The new -f switch forces the metadata restoration despite the provider size, and updates the provider size in the restored metadata to the correct value. Helped by: pjd Reviewed by: pjd
* tools/umastat: fix build on amd64avg2010-09-201-8/+8
| | | | | | | And perhaps other 64-bit platforms. Submitted by: Fabian Keil <freebsd-listen@fabiankeil.de> MFC after: 1 week
* Revise r197763 which fixes filesystem corruption when extendingbrian2010-09-193-0/+102
| | | | | | | | | | | | into un-zeroed storage. The original patch was questioned by Kirk as it forces the filesystem to do excessive work initialising inodes on first use, and was never MFC'd. This change mimics the newfs(8) approach of zeroing two blocks of inodes for each new cylinder group. Reviewed by: mckusick MFC after: 3 weeks
* sh: Fix exit status if return is used within a loop condition.jilles2010-09-112-0/+9
|
* sh: Apply variable assignments left-to-right in bltinlookup().jilles2010-09-111-0/+3
| | | | | Example: HOME=foo HOME=bar cd
* sh: Fix 'read' if all chars before the first IFS char are backslash-escaped.jilles2010-09-082-0/+18
| | | | | | Backslash-escaped characters did not set the flag for a non-IFS character. MFC after: 2 weeks
* sh: Add simple tests for backslashes in the read builtin.jilles2010-09-082-0/+20
|
* sh: Add a test that 'read' leaves the file pointer at the correct place.jilles2010-09-031-0/+31
| | | | | Naive buffering would break the common while read x... construct, which did not appear to be tested yet.
OpenPOWER on IntegriCloud