summaryrefslogtreecommitdiffstats
path: root/bin
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | | | | | | | | | Cleanup some style(9) issues.bdrewery2015-06-082-42/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Whitespace. - Comments. - Wrap long lines. MFC after: 2 weeks X-MFC-with: r284105,r284106 Sponsored by: EMC / Isilon Storage Division
* | | | | | | | | | | | | | It has been long time that when doing 'ls -G /path/to/a/symlink', instead ofdelphij2015-06-081-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | using the color of symbolic link, the color is determined by the link target. This behavior was quite confusing. Looking at the file history, it looks like that r203665 intends to fix this but the issue was never actually fixed. Fix this by not setting FTS_COMFOLLOW when color is requested like what was done in r203665. MFC after: 2 weeks
* | | | | | | | | | | | | | Implement '-s' to copy as symlink, similar to the current -l link(2) handling.bdrewery2015-06-074-28/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is also implemented in at least GNU coreutils cp. While here also improve the '-l' handling to not open(2) the source file as it does not actually need the descriptor. Sponsored by: EMC / Isilon Storage Division
* | | | | | | | | | | | | | Cleanup some indentation issues.bdrewery2015-06-071-9/+8
| | | | | | | | | | | | | |
* | | | | | | | | | | | | | Change directory permissions in pre-order.pluknet2015-06-041-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In this order, it won't try to recurse into a directory for which it doesn't have permission, before changing that permission. This follows an existing behavior in other BSDs, linux, OS X. Obtained from: NetBSD
* | | | | | | | | | | | | | Remove unused variable, this variable fmtstr was introduced at revision r225868araujo2015-06-011-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and it is not used anymore after the convertion to use libxo at revision r283304. Differential Revision: D2678 Reviewed by: marcel
* | | | | | | | | | | | | | Document recent p_flag2 additions.pluknet2015-05-271-1/+4
| |_|_|_|_|_|_|_|_|_|_|_|/ |/| | | | | | | | | | | |
* | | | | | | | | | | | | Convert to use libxo. Document use of libxo as well.marcel2015-05-226-166/+253
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Obtained from: Phil Shafer <phil@juniper.net> Sponsored by: Juniper Networks, Inc.
* | | | | | | | | | | | | Eliminate unneeded includes.delphij2015-05-2112-17/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MFC after: 2 weeks
* | | | | | | | | | | | | date(1): Make -r behave like GNU's version when the option can not bedelphij2015-05-072-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | interpreted as a number, which checks the file's modification time and use that as the date/time value. This improves compatibility with GNU coreutils's version of time(1). MFC after: 2 weeks
* | | | | | | | | | | | | cp: Remove fts sorting.jilles2015-05-051-28/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In an attempt to improve performance, cp reordered directories first (although the comment says directories last). This is not effective with new UFS layout policies. The sorting reorders multiple arguments passed to cp, which may be undesirable. Additionally, the comparison function does not induce a total order. Per POSIX, this causes undefined behaviour in qsort(). NetBSD removed the sorting in 2009. On filesystems that return directory entries in hash/btree order, sorting by d_fileno before statting improves performance on large directories. However, this can only be implemented in fts(3). PR: 53475 Reviewed by: bde (in 2004) MFC after: 1 week
* | | | | | | | | | | | | Standardise chmod, chflags, chown and chgrp recursive symlink processingsmh2015-04-294-80/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | chmod, chflags, chgrp, chmod and chown now affect symlinks in -R mode as defined in symlink(7); previously symlinks were silently ignored. Differential Revision: https://reviews.freebsd.org/D2316 Reviewed by: jilles MFC after: 1 month Relnotes: yes Sponsored by: Multiplay
* | | | | | | | | | | | | Pet manlintbapt2015-04-261-1/+1
| | | | | | | | | | | | |
* | | | | | | | | | | | | Use mdoc(7) macros for curly bracesbapt2015-04-261-3/+3
| | | | | | | | | | | | |
* | | | | | | | | | | | | mdoc: escape Rebapt2015-04-261-1/+1
| | | | | | | | | | | | |
* | | | | | | | | | | | | sh: Pass along SIGINT from a child if job control is enabled, even when notjilles2015-04-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | interactive. I added the interactive check in r208881 to be safe, but in actual use (scripts in set -m mode) passing along SIGINT seems best. Discussed with: bdrewery
* | | | | | | | | | | | | ed(1): Fix [-Werror=logical-not-parentheses]eadler2015-04-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | /usr/src/bin/ed/glbl.c:64:36: error: logical not is only applied to theleft hand side of comparison [-Werror=logical-not-parentheses] Obtained from: Dragonfly (1fff89cbaeaa43af720a1f23d9c466b756dd8a58) MFC After: 1 month
* | | | | | | | | | | | | bin/ed: use correct type in multiplicationeadler2015-04-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The result is line_t** so the multiplication should be size * sizeof(line_t*) MFC After: 1 month
* | | | | | | | | | | | | sh: Fix the trap builtin to be POSIX-compliant for 'trap exit SIG' and 'trap ↵bdrewery2015-04-185-4/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | n n...'. The parser considered 'trap exit INT' to reset the default for both EXIT and INT. This beahvior is not POSIX compliant. This was avoided if a value was specified for 'exit', but then disallows exiting with the signal received. A possible workaround is using ' exit'. However POSIX does allow this type of behavior if the parameters are all integers. Fix the handling for this and clarify its support in the manpage since it is specifically allowed by POSIX. Differential Revision: https://reviews.freebsd.org/D2325 Reviewed by: jilles MFC after: 2 weeks
* | | | | | | | | | | | | Fix build after r281550 when WITHOUT_ICONV is defined.tijl2015-04-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reported by: adrian MFC after: 2 weeks
* | | | | | | | | | | | | Remove the const qualifier from iconv(3) to comply with POSIX:tijl2015-04-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | http://pubs.opengroup.org/onlinepubs/9699919799/functions/iconv.html Adjust all code that calls iconv. PR: 199099 Exp-run by: antoine MFC after: 2 weeks
* | | | | | | | | | | | | sh: Add more tests for exotic IFS splitting.jilles2015-03-313-0/+13
| | | | | | | | | | | | |
* | | | | | | | | | | | | cp,mv: Use futimens() instead of utimensat() if possible.jilles2015-03-232-2/+2
| | | | | | | | | | | | |
* | | | | | | | | | | | | Build expr with -fwrapv, since it relies on signed integer wrappingdim2015-03-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | having defined behavior. Reported by: rodrigc MFC after: 3 days
* | | | | | | | | | | | | Implement pax -O option to permit limiting a PAX archive to a single volume.eadler2015-03-185-16/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -O Force the archive to be one volume. If a volume ends prematurely, pax will not prompt for a new volume. PR: 198481 Submitted by: Sevan Janiyan Reviewed by: allanjude (doc)
* | | | | | | | | | | | | Use 24h timestamps in the ps(1) STARTED columnfeld2015-03-172-9/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous 12h AM/PM format was perplexing as it didn't follow the locale of the user and was a minor annoyance to FreeBSD users coming from Linux. Additionally, the man page was incorrect about the strftime format. There are three time formats that may be displayed in the STARTED column depending on the age of the process. Below is an example. For a process started at 14:30 on Monday 16 March 2015, the following formats may be used: 14:30 for process < 24h old (24h Timestamp) Mon14 for process > 24h, < 1 week old (Weekday Hour) 16Mar15 for process > 1 week old (Day Month Year) Differential Revision: https://reviews.freebsd.org/D1620 Reviewed by: brd Approved by: trasz
* | | | | | | | | | | | | 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
| | | | | | | | | | | | |
OpenPOWER on IntegriCloud