summaryrefslogtreecommitdiffstats
path: root/bin
Commit message (Collapse)AuthorAgeFilesLines
* r* commands are not precious anymorebapt2015-03-041-1/+0
|
* sh: Fix more compiler warnings related to variable declarations.jilles2015-03-035-6/+7
|
* sh: Fix more compiler warnings.jilles2015-03-016-13/+20
|
* sh: Fix compiler warnings related to duplicate or missing declarations.jilles2015-03-016-8/+6
|
* Fix unitialized variable that broke sh on PowerPC starting with r278826.nwhitehorn2015-02-261-1/+1
|
* sh: Add details about importing the environment and initializing OPTIND.jilles2015-02-221-7/+14
|
* Disguising stderr from jls generally considered harmfulngie2015-02-212-2/+4
| | | | | | | | Undisguising it dumps out the following logspew: jls: unknown parameter: allow PR: 191019
* symlink(7): Mention chflagsat() (can take AT_SYMLINK_NOFOLLOW).jilles2015-02-161-1/+2
| | | | MFC after: 1 week
* sh: Various cleanups to expand.c:jilles2015-02-151-60/+55
| | | | | | * Remove some gotos. * Remove unused parameter. * Remove duplicate code.
* sh: Prefer "" to nullstr where possible.jilles2015-02-158-9/+8
|
* sh: Add stsavestr(), like savestr() but allocates using stalloc().jilles2015-02-154-12/+16
|
* sh: Add simple tests for globbing/splitting command substitution.jilles2015-02-153-0/+9
|
* Refactor pkill-j_test to reflect the relevant changes done to pgrep-j_testngie2015-02-141-75/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | r278742: Simplify jail_name_to_jid and try to be more fault tolerant when scanning for the jail ID (poll up to 10 times for the jail IDs to become available) If the scan fails, the code will fall through and fail as it does with Jenkins today r278636: Parameterize out the amount of sleep done in each test Set the value in each test to a different amount to avoid potential side-effects with other instances of the test (or lingering processes) still being present on the system r278633: Refactor the tests 1. `id -u` -> 0 is now only checked once; the entire test script is now skipped if this assertion is violated 2. De-dent whitespace, based on 1. 3. Only setup the symlink for $sleep once at the top of the script, and tear it down once at the bottom of the script
* Simplify jail_name_to_jid and try to be more fault tolerant when scanning forngie2015-02-141-15/+14
| | | | | | | the jail ID (poll up to 10 times for the jail IDs to become available) If the scan fails, the code will fall through and fail as it does with Jenkins today
* Call wait to ensure that background processes have diedngie2015-02-131-0/+2
| | | | This is being done to establish parity with pgrep-j_test
* Parameterize out the amount of sleep done in each testngie2015-02-121-9/+12
| | | | | | Set the value in each test to a different amount to avoid potential side-effects with other instances of the test (or lingering processes) still being present on the system
* Refactor the testsngie2015-02-121-59/+48
| | | | | | | | 1. `id -u` -> 0 is now only checked once; the entire test script is now skipped if this assertion is violated 2. De-dent whitespace, based on 1. 3. Only setup the symlink for $sleep once at the top of the script, and tear it down once at the bottom of the script
* Add debugging output to help track down the recent Jenkins failuresngie2015-02-121-3/+3
|
* Prevent access to an uninitialized variablepfg2015-01-311-1/+1
| | | | | | | The "-h" option may access an uninitialized value. Prevent it by properly initializing the value. CID: 1006559
* sh: Abort a wait builtin on any trapped signal.jilles2015-01-312-5/+6
| | | | | | | | This is required by POSIX. PR: 197210 Reported by: ache MFC after: 2 weeks
* Fix overflow check for multiplication:se2015-01-271-4/+16
| | | | | | | | | | | | | - Add special test to detect the case of -1 * INTMAX_MIN - Protect against elimination of the test division by the optimizer Garrett Cooper noticed that the overflow checks were incomplete, and Bruce Evans suggested the use of the "volatile" qualifier to counter the effect of the undefined behaviour, when the prior multiplication caused overflow, and he also suggested improvements to the comments. Reviewed by: bde MFC after: 1 week
* cp,mv,touch: Set timestamps with nanosecond precision.jilles2015-01-242-10/+10
| | | | This uses utimensat().
* Add futimens and utimensat system calls.jilles2015-01-231-3/+4
| | | | | | | | | | | | | | The core kernel part is patch file utimes.2008.4.diff from pluknet@FreeBSD.org. I updated the code for API changes, added the manual page and added compatibility code for old kernels. There is also audit and Capsicum support. A new UTIME_* constant might allow setting birthtimes in future. Differential Revision: https://reviews.freebsd.org/D1426 Submitted by: pluknet (partially) Reviewed by: delphij, pluknet, rwatson Relnotes: yes
* Don't include newvers.sh into freebsd-version.ume2015-01-221-1/+1
|
* Integrate contrib/netbsd-tests/bin/expr into the build/kyua as bin/expr/testsngie2015-01-192-0/+22
| | | | | MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
* Add a ${CP} alias for copying files in the build.will2015-01-161-1/+1
| | | | | | | | | | | | | | Some users build FreeBSD as non-root in Perforce workspaces. By default, Perforce sets files read-only unless they're explicitly being edited. As a result, the -f argument must be used to cp in order to override the read-only flag when copying source files to object directories. Bare use of 'cp' should be avoided in the future. Update all current users of 'cp' in the src tree. Reviewed by: emaste MFC after: 1 week Sponsored by: Spectra Logic
* Install d_align.{in,out} for the :align testngie2015-01-051-0/+5
| | | | | X-MFC with: r276669 Pointyhat to: me
* Integrate bin/cat/tests from NetBSD into atf/kyuangie2015-01-042-0/+19
| | | | Sponsored by: EMC / Isilon Storage Division
* symlink(7): Note that stat(1) does not follow symlinks by default.jilles2014-12-291-9/+8
| | | | MFC after: 1 week
* sh: Move some code from onint() to onsig(), making onint() noreturn.jilles2014-12-214-21/+21
| | | | | As a result, the INTON macro which is used many times generates fewer bytes of code.
* sh: Remove EXP_REDIR.jilles2014-12-213-15/+8
| | | | | | | | | | EXP_REDIR was supposed to generate pathnames in redirection if exactly one file matches, as permitted but not required by POSIX in interactive mode. It is unlikely this will be implemented. No functional change is intended. MFC after: 1 week
* sh: Make sure output suitable as shell input is also printable.jilles2014-12-143-22/+76
| | | | | | | | | | | Commands like 'export -p', 'set' and 'trap', and tracing enabled via 'set -x' generate output suitable as shell input by adding quotes as necessary. If there are control characters other than newline or invalid UTF-8 sequences, use $'...' and \OOO to display them safely. The resulting output is not parsable by a strict POSIX.1-2008 shell but sh from FreeBSD 9.0 and newer and many other shells can parse it.
* Add facility to stop all userspace processes. The supposed use of thekib2014-12-131-1/+2
| | | | | | | | | | | | | | | | | | | | | feature is to quisce the system before suspend. Stop is implemented by reusing the thread_single(9) with the special mode SINGLE_ALLPROC. SINGLE_ALLPROC differs from the existing single-threading modes by allowing (requiring) caller to operate on other process. Interruptible sleeps for !TDF_SBDRY threads are suspended like SIGSTOP does it, instead of aborting the sleep, like SINGLE_NO_EXIT, to avoid spurious EINTRs on resume. Provide debugging sysctl debug.stop_all_proc, which causes total stop and suspends syncer, while waiting for variable reset for resume. It is used for debugging; should be removed after the real use of the interface is added. In collaboration with: pho Discussed with: avg Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
* Fix dependency on newvers.shdes2014-12-101-2/+1
| | | | | Noticed by: marck MFC after: 1 week
* sh: Remove special case for '=' in set -x; always quote it in outqstr().jilles2014-11-302-11/+2
| | | | | I plan to make set -x output always printable using $'...'; avoiding quoting words containing '=' is not worth the extra complexity.
* Convert bin/ to LIBADD, reduce overlinking allow to build all components asbapt2014-11-258-21/+9
| | | | static
* sh: Prepend "$0: " to error messages if there is no command name.jilles2014-11-222-0/+4
|
* sh: Use DQSYNTAX only while expanding, not SQSYNTAX.jilles2014-11-221-1/+1
| | | | | Quoting during expansion only cares about CCTL, which is the same for DQSYNTAX and SQSYNTAX.
* sh(1): Add/improve information about exit status of commands.jilles2014-11-141-10/+24
|
* sh(1): Mention portability issue with shifting zero positional parameters.jilles2014-11-071-2/+3
| | | | | | Per Austin Group issue #459, shifting zero positional parameters may or may not be considered an operand error (which causes the shell to exit in most cases).
* Document that df(1) supports libxo(3).marcel2014-11-071-1/+4
|
* Convert to use libxo.marcel2014-11-072-52/+76
| | | | | Obtained from: Phil Shafer <phil@juniper.net> Sponsored by: Juniper Networks, Inc.
* sh: Fix corruption of CTL* bytes in positional parameters in redirection.jilles2014-10-313-1/+28
| | | | | | | EXP_REDIR was not being checked for while expanding positional parameters in redirection, so CTL* bytes were not being prefixed where they should be. MFC after: 1 week
* Treat IFS separators in "$*" as quoted.jilles2014-10-284-5/+25
| | | | This makes a difference if IFS starts with *, ?, [ or a CTL* byte.
* bin/dd: revert 273734, as it fails on 32bit platformspi2014-10-275-46/+54
| | | | | | Revert: insufficient testing on 32bit platforms PR: 191263
* bin/dd: Fix incorrect casting of argumentspi2014-10-275-54/+46
| | | | | | | | | | | | | | | | | | dd(1) casts many of its numeric arguments from uintmax_t to intmax_t and back again to detect whether or not the original arguments were negative. This caused wrong behaviour in some boundary cases: $ dd if=/dev/zero of=/dev/null count=18446744073709551615 dd: count cannot be negative After the fix: $ dd if=/dev/zero of=/dev/null count=18446744073709551615 dd: count: Result too large PR: 191263 Submitted by: will@worrbase.com Approved by: cognet@
* sh: Make getopts memory-safe if with changing arguments.jilles2014-10-265-6/+39
| | | | | | | | | | | | POSIX does not permit to continuing a getopts loop with different arguments. For parsing the positional parameters, we handle this case by resetting the getopts state when the positional parameters are changed in any way (and the getopts state is local to a function). However, in the syntax getopts <optstring> <var> <arg...>, changes could lead to invalid memory access. In the syntax getopts <optstring> <var> <arg...>, store a copy of the arguments and continue to use them until getopts is reset.
* sh: Allow backslash-newline continuation in more places:jilles2014-10-1910-32/+156
| | | | | | | * directly after a $ * directly after ${ * between the characters of a multi-character operator token * within a parameter name
* sh: Add some tests for backslash-newline continuation.jilles2014-10-174-0/+30
|
* sh: Make parseredir() a proper function instead of an emulated nestedjilles2014-10-151-59/+58
| | | | function.
OpenPOWER on IntegriCloud