aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
Commit message (Collapse)AuthorAgeFilesLines
* dtc: update to upstream 227d6a3Ed Maste2017-04-178-63/+287
| | | | | | | | | | | - Report missing includes at the correct location. - Add initial support for the -@ option emitting a symbol table. - Add support for running tests with and without -@ - Add support for generating __fixups__ and __local_fixups__ - Attach the to-string transform to the node path. Notes: svn path=/head/; revision=317060
* dtc: remove unused (since r306806) string.hhEd Maste2017-04-171-164/+0
| | | | Notes: svn path=/head/; revision=317058
* bsdgrep: fix zero-length matches without the -o flagEd Maste2017-04-171-3/+3
| | | | | | | | | | | | | | r316477 broke zero-length matches when not using the -o flag, by skipping over them entirely. Add a regression test so that it doesn't break again in the future. Submitted by: Kyle Evans <kevans91 at ksu.edu> Reviewed by: cem emaste ngie Differential Revision: https://reviews.freebsd.org/D10333 Notes: svn path=/head/; revision=317052
* bsdgrep: remove output separators between overlapping segmentsEd Maste2017-04-171-6/+27
| | | | | | | | | | | | | | | | | | Make bsdgrep more sensitive to context overlaps. If it's printing context that either overlaps or is immediately adjacent to another bit of context, don't print a separator. - Non-overlapping segments no longer have two separators between them - Overlapping segments no longer have separators between them with overlapping sections repeated Submitted by: Kyle Evans <kevans91 at ksu.edu> Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D10105 Notes: svn path=/head/; revision=317051
* bsdgrep: for -r, use the working directory if none specifiedEd Maste2017-04-174-2/+61
| | | | | | | | | | | | | | This is more sensible than the previous behaviour of grepping stdin, and matches newer GNU grep behaviour. PR: 216307 Submitted by: Kyle Evans <kevans91 at ksu.edu> Reviewed by: cem, emaste, ngie Relnotes: Yes Differential Revision: https://reviews.freebsd.org/ Notes: svn path=/head/; revision=317050
* bsdgrep: add -z/--null-data supportEd Maste2017-04-175-10/+21
| | | | | | | | | | | | | | -z treats input and output data as sequences of lines terminated by a zero byte instead of a newline. This brings it more in line with GNU grep and brings us closer to passing the current tests with BSD grep. Submitted by: Kyle Evans <kevans91 at ksu.edu> Reviewed by: cem Relnotes: Yes Differential Revision: https://reviews.freebsd.org/D10101 Notes: svn path=/head/; revision=317049
* Fix userland tools that don't check the format of routing socketPatrick Kelsey2017-04-161-2/+3
| | | | | | | | | | | | | | | | | | | messages before accessing message fields that may not be present, removing dead/duplicate/misleading code along the way. Document the message format for each routing socket message in route.h. Fix a bug in usr.bin/netstat introduced in r287351 that resulted in pointer computation with essentially random 16-bit offsets and dereferencing of the results. Reviewed by: ae MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D10330 Notes: svn path=/head/; revision=317035
* Install the zstdgrep shell wrapperBaptiste Daroussin2017-04-151-0/+1
| | | | Notes: svn path=/head/; revision=316985
* rename zstless into zstdless to be consistent with other zstdcommandsBaptiste Daroussin2017-04-151-1/+1
| | | | Notes: svn path=/head/; revision=316984
* Add forgotten links for zstdcat and unzstdBaptiste Daroussin2017-04-151-0/+4
| | | | Notes: svn path=/head/; revision=316983
* Add a zstdless equivalent to zless, bzless xzlessBaptiste Daroussin2017-04-152-1/+5
| | | | Notes: svn path=/head/; revision=316979
* Import zstandard 1.1.4 in baseBaptiste Daroussin2017-04-152-1/+23
| | | | | | | | | | zstandard is a new compression library/tool which is very fast at compression/decompression For now import as a private library Notes: svn path=/head/; revision=316978
* Clean up headers declarationBaptiste Daroussin2017-04-153-6/+1
| | | | Notes: svn path=/head/; revision=316959
* Update to bmake 20170413Simon J. Gerraty2017-04-151-2/+2
|\ | | | | | | Notes: svn path=/head/; revision=316949
* | banner(6): Squash a harmless coverity warningConrad Meyer2017-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The destination buffer is sized as the sum of program argument lengths, so it has plenty of room for *argv. Appease Coverity by using strlcpy instead of strcpy. Similar to a nearby cleanup performed in r316500. No functional change. Reported by: Coverity (CWE-120) CID: 1006703 Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316797
* | add a stub --speed-large-files for compatibility with GNU diffBaptiste Daroussin2017-04-082-1/+10
| | | | | | | | | | | | | | | | There is no intention to implement it, but lots of scripts/tools using diff(1) passes GNU diff option Notes: svn path=/head/; revision=316639
* | Remove a useless loop over the long options before passing through someBaptiste Daroussin2017-04-081-2/+0
| | | | | | | | | | | | | | options to diff(1) Notes: svn path=/head/; revision=316638
* | When passingthrough from sdiff to diff the -H/--speed-large-filesBaptiste Daroussin2017-04-082-4/+6
| | | | | | | | | | | | | | | | options rename it to the long version as GNU diff only support the long version of the option not the short version Notes: svn path=/head/; revision=316637
* | usr.bin/netstat: strcpy -> strlcpyAlan Somers2017-04-071-2/+2
| | | | | | | | | | | | | | | | | | | | Reported by: Coverity CID: 1006741, 1006744 MFC after: 3 weeks Sponsored by: Spectra Logic Corp Notes: svn path=/head/; revision=316610
* | bsdgrep: Handle special case of single-byte NUL patternEd Maste2017-04-051-1/+5
| | | | | | | | | | | | | | | | | | | | PR: 202022 Submitted by: Kyle Evans <kevans91 at ksu.edu> MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D10102 Notes: svn path=/head/; revision=316542
* | bsdgrep: create additional tests for coverage on recent fixesEd Maste2017-04-051-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create additional tests to cover regressions that were discovered by PRs linked to reviews D10098, D10102, and D10104. It is worth noting that neither bsdgrep(1) nor gnugrep(1) in the base system currently pass all of these tests, and gnugrep(1) not quite being up to snuff was also noted in at least one of the PRs. PR: 175314 202022 195763 180990 197555 197531 181263 209116 Submitted by: Kyle Evans <kevans91@ksu.edu> Reviewed by: cem, ngie, emaste MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D10112 Notes: svn path=/head/; revision=316536
* | Remove a duplicate fclose() that snuck into r316501Alan Somers2017-04-051-1/+0
| | | | | | | | | | | | | | | | | | | | | | Reported by: Coverity CID: 1373338 MFC after: 20 days X-MFC-With: 316501 Sponsored by: Spectra Logic Corp Notes: svn path=/head/; revision=316523
* | Fix file descriptor and memory leaks in pr(1)Alan Somers2017-04-048-46/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, hook NetBSD's pr test into the build, and add three more test cases. Reported by: Coverity, Valgrind CID: 271650 271651 271652 271653 271654 271655 271656 271656 CID: 271657 271658 271659 1006939 1006940 1006941 1006942 1009098 Reviewed by: ngie MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9137 Notes: svn path=/head/; revision=316501
* | strcpy => strlcpy, strcat => strlcatAlan Somers2017-04-044-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | Reported by: Coverity CID: 1006703 978863 1006745 1347163 Reviewed by: cem MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D10192 Notes: svn path=/head/; revision=316500
* | bsdgrep(1): Fix errors with invalid expressionsConrad Meyer2017-04-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Invalid expressions with an ultimate compiled pattern length of 0 (e.g., "grep -E {") were not taken into account and caused a segfault while trying to fill in the good suffix table. Submitted by: Kyle Evans <kevans91 at ksu.edu> Reviewed by: me Differential Revision: https://reviews.freebsd.org/D10113 Notes: svn path=/head/; revision=316495
* | bsdgrep(1): Rip out "xmalloc" bitsConrad Meyer2017-04-046-463/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | xmalloc was a debug malloc implementation, but the x{malloc,calloc,free} functions default to calling the malloc(3) equivalents. Instead of relying on this malloc shim, we can devise better ways to debug malloc issues that aren't misleading upon initial inspection. (I.e., using jemalloc's various built-in debugging capabilities.) Submitted by: Kyle Evans <kevans91 at ksu.edu> Reviewed by: emaste, cem Differential Revision: https://reviews.freebsd.org/D10269 Notes: svn path=/head/; revision=316492
* | bsdgrep: revert color changes from r316477Ed Maste2017-04-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | r316477 changed the color output to match exactly the in-tree GNU grep, but introduces unnecessary escape sequences. Submitted by: Kyle Evans <kevans91 at ksu.edu> Reported by: ache MFC after: 1 month MFC with: r316477 Notes: svn path=/head/; revision=316491
* | bsdgrep: Initialize vars to avoid a false positive GCC warningEd Maste2017-04-041-0/+3
| | | | | | | | | | | | | | | | | | Reported by: lwhsu MFC after: 1 month MFC with: r316477 Notes: svn path=/head/; revision=316489
* | bsdgrep(1): create rgrep linkConrad Meyer2017-04-042-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Create a convenience rgrep link for bsdgrep(1) that observes 'grep -r' behavior. A follow-up to r316473. Submitted by: Kyle Evans <kevans91 at ksu.edu> Reviewed by: emaste (earlier version), cem Differential Revision: https://reviews.freebsd.org/D10109 Notes: svn path=/head/; revision=316484
* | bsdgrep: fix matching behaviourEd Maste2017-04-031-17/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Set REG_NOTBOL if we've already matched beginning of line and we're examining later parts - For each pattern we examine, apply it to the remaining bits of the line rather than (potentially) smaller subsets - Check for REG_NOSUB after we've looked at all patterns initially matching the line - Keep track of the last match we made to later determine if we're simply not matching any longer or if we need to proceed another byte because we hit a zero-length match - Match the earliest and longest bit of each line before moving the beginning of what we match to further in the line, past the end of the longest match; this generally matches how gnugrep(1) seems to behave, and seems like pretty good behavior to me - Finally, bail out of printing any matches if we were set to print all (empty pattern) but -o (output matches) was set PR: 195763, 180990, 197555, 197531, 181263, 209116 Submitted by: "Kyle Evans" <kevans91@ksu.edu> Reviewed by: cem MFC after: 1 month Relnotes: Yes Differential Revision: https://reviews.freebsd.org/D10104 Notes: svn path=/head/; revision=316477
* | bsdgrep: treat rgrep as grep -rEd Maste2017-04-031-0/+3
| | | | | | | | | | | | | | Submitted by: Kyle Evans <kevans91@ksu.edu> Notes: svn path=/head/; revision=316473
* | Revert debugging that was accidently committed in r316314Allan Jude2017-03-311-8/+1
| | | | | | | | Notes: svn path=/head/; revision=316315
* | fix top(1) ZFS compressed ARC supportAllan Jude2017-03-312-4/+12
| | | | | | | | | | | | | | | | | | | | | | top(1) read the wrong amount of data from sysctl, uint64_t instead of boolean_t, resulting in the stats not showing in many cases. X-MFC-With: r315435 Sponsored by: ScaleEngine Inc. Notes: svn path=/head/; revision=316314
* | Add support for capturing 'struct ptrace_lwpinfo' for signalsTycho Nightingale2017-03-306-4/+129
| | | | | | | | | | | | | | | | | | | | | | | | resulting in a process dumping core in the corefile. Also extend procstat to view select members of 'struct ptrace_lwpinfo' from the contents of the note. Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316286
* | Add some useful examples to the sed man page.Brad Davis2017-03-271-1/+31
| | | | | | | | | | | | | | | | | | Reviewed by: wblock, bcr MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D9958 Notes: svn path=/head/; revision=316030
* | diff: Show nanoseconds in -u/-c header line.Jilles Tjoelker2017-03-264-15/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Show nanoseconds in the -u/-c header line. The present portability conditionals cannot handle the POSIX standard st_mtim, so remove them and unconditionally use st_mtim. PR: 218018 Reported by: jbeich Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D10145 Notes: svn path=/head/; revision=316002
* | Provide proper contemporary function prototypes for many of the functionsRobert Watson2017-03-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | implemented in top(1), rather than relying on K&R prototypes, which can cause problems on targets where there are multiple incompatible calling conventions and the compiler requires argument information to select the correct one. (There's a bit more to do here, since it looks like top(1) also sometimes provides prototypes for various curses functions rather than relying on the header file...) Sponsored by: DARPA, AFRL MFC after: 1 week Notes: svn path=/head/; revision=315990
* | diff: Fix mtime of file1 in -u/-c header line.Jilles Tjoelker2017-03-264-4/+22
| | | | | | | | | | | | | | | | | | PR: 218018 Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D10140 Notes: svn path=/head/; revision=315985
* | MFV r315875:Martin Matuska2017-03-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sync libarchive with vendor. Vendor changes (FreeBSD-related): - store extended attributes with extattr_set_link() if no fd is provided - add extended attribute tests to libarchive and bsdtar - fix tar's test_option_acls - support the UF_HIDDEN file flag X-MFC with: 315636 Notes: svn path=/head/; revision=315876
* | diff(1): document remaining long optionsEnji Cooper2017-03-231-15/+85
| | | | | | | | | | | | | | | | | | | | While here, try and tie together some of the short options with their long option equivalents, where possible. Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=315779
* | Rename tests from <foo> to <foo>_test to match the FreeBSD test suiteEnji Cooper2017-03-2312-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | naming scheme usr.bin/diff/diff_test was renamed to usr.bin/diff/netbsd_diff_test to avoid collisions with the renamed FreeBSD test. MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=315776
* | Use MIN macros from sys/param.hBaptiste Daroussin2017-03-221-1/+1
| | | | | | | | Notes: svn path=/head/; revision=315747
* | Use strndup(3) instead of malloc + memcpyBaptiste Daroussin2017-03-221-3/+2
| | | | | | | | Notes: svn path=/head/; revision=315746
* | Use MAX and MIN macros from sys/param.hBaptiste Daroussin2017-03-221-12/+9
| | | | | | | | Notes: svn path=/head/; revision=315743
* | diff(1): fix SYNOPSIS section noting non-existent option, --no-ignore-caseEnji Cooper2017-03-221-6/+6
| | | | | | | | | | | | | | | | | | | | `--no-ignore-case` should be `--no-ignore-file-name-case` per code for compatibility with [g]diff(1). Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=315726
* | Shut up gcc.Gleb Smirnoff2017-03-211-1/+1
| | | | | | | | Notes: svn path=/head/; revision=315671
* | Hide struct inpcb, struct tcpcb from the userland.Gleb Smirnoff2017-03-215-214/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a painful change, but it is needed. On the one hand, we avoid modifying them, and this slows down some ideas, on the other hand we still eventually modify them and tools like netstat(1) never work on next version of FreeBSD. We maintain a ton of spares in them, and we already got some ifdef hell at the end of tcpcb. Details: - Hide struct inpcb, struct tcpcb under _KERNEL || _WANT_FOO. - Make struct xinpcb, struct xtcpcb pure API structures, not including kernel structures inpcb and tcpcb inside. Export into these structures the fields from inpcb and tcpcb that are known to be used, and put there a ton of spare space. - Make kernel and userland utilities compilable after these changes. - Bump __FreeBSD_version. Reviewed by: rrs, gnn Differential Revision: D10018 Notes: svn path=/head/; revision=315662
* | Cache tzdata when running under capsicumBaptiste Daroussin2017-03-201-0/+1
| | | | | | | | | | | | | | | | PR: 217957 Reported by: tobik@ Notes: svn path=/head/; revision=315649
* | Port the getaddrinfo(1) utility from NetBSDEric van Gyzen2017-03-205-0/+597
| | | | | | | | | | | | | | | | | | | | | | | | | | Submitted by: Lohith Bellad <lohithbsd@gmail.com> Reviewed by: hiren (earlier rev), ae Obtained from: NetBSD MFC after: 1 week Relnotes: yes Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D9365 Notes: svn path=/head/; revision=315640
* | MFV r315633, 315635:Martin Matuska2017-03-203-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sync libarchive with vendor Vendor changes/bugfixes (FreeBSD-related): PR 867 (bsdcpio): show numeric uid/gid when names are not found PR 870 (seekable zip): accept files with valid ZIP64 EOCD headers PR 880 (pax): Fix handling of "size" pax header keyword PR 887 (crypto): Discard 3072 bytes instead of 1024 of first keystream OSS-Fuzz issue 806 (mtree): rework mtree_atol10 integer parser Break ACL read/write code into platform-specific source files Unbreak static dependency on libbz2 MFC after: 1 week Notes: svn path=/head/; revision=315636