summaryrefslogtreecommitdiff
path: root/usr.bin
Commit message (Collapse)AuthorAgeFilesLines
* bsdgrep: use safer sizeof() constructEd Maste2017-05-261-2/+2
| | | | | | | Submitted by: Kyle Evans <kevans91@ksu.edu> Notes: svn path=/head/; revision=318916
* bsdgrep: correct assumptions to prepare for chunkingEd Maste2017-05-263-6/+6
| | | | | | | | | | | | Correct a couple of minor BSD grep assumptions that are valid for line processing but not future chunk-based processing. Submitted by: Kyle Evans <kevans91@ksu.edu> Reviewed by: bapt, cem Differential Revision: https://reviews.freebsd.org/D10824 Notes: svn path=/head/; revision=318914
* Update the diff3 manpage to reflect the fact the version in freebsd doesBaptiste Daroussin2017-05-251-21/+1
| | | | | | | not use temporary files nor uses a /usr/libexec/diff3prog Notes: svn path=/head/; revision=318892
* For now comment tests for arguments which are not in par with GNU diff3 yetBaptiste Daroussin2017-05-251-5/+5
| | | | Notes: svn path=/head/; revision=318890
* Remove the MAX_CHECK macro, it was initially used to test if a file was aBaptiste Daroussin2017-05-251-2/+0
| | | | | | | | | | text file or not. The check is not done by diff3 but by diff (the argument -a is directly passed to diff(1)) Notes: svn path=/head/; revision=318889
* Import working progress BSD diff3Baptiste Daroussin2017-05-2517-0/+1171
| | | | | | | | | | | | | | | | | | import bsd diff3 from OpenBSD. Differences with OpenBSD: - lots of warning fixed - no shell wrapper with diff3 actually living in libexec - capsicumized Keep it disconnected as it is not yet good enough to replace GNU diff The motivation to import it now it to allow other people to jump in and also to have an open development on it Obtained from: OpenBSD Notes: svn path=/head/; revision=318888
* Improve the decoding of the third argument of the socket() call.Michael Tuexen2017-05-251-2/+9
| | | | | | | | | | Decoding of the third argument depends on the first one. For doing this, add a corresponding function to libsysdecode. Thanks to jhb@ for suggesting this. Notes: svn path=/head/; revision=318879
* Commit the 64-bit inode project.Konstantin Belousov2017-05-233-36/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend the ino_t, dev_t, nlink_t types to 64-bit ints. Modify struct dirent layout to add d_off, increase the size of d_fileno to 64-bits, increase the size of d_namlen to 16-bits, and change the required alignment. Increase struct statfs f_mntfromname[] and f_mntonname[] array length MNAMELEN to 1024. ABI breakage is mitigated by providing compatibility using versioned symbols, ingenious use of the existing padding in structures, and by employing other tricks. Unfortunately, not everything can be fixed, especially outside the base system. For instance, third-party APIs which pass struct stat around are broken in backward and forward incompatible ways. Kinfo sysctl MIBs ABI is changed in backward-compatible way, but there is no general mechanism to handle other sysctl MIBS which return structures where the layout has changed. It was considered that the breakage is either in the management interfaces, where we usually allow ABI slip, or is not important. Struct xvnode changed layout, no compat shims are provided. For struct xtty, dev_t tty device member was reduced to uint32_t. It was decided that keeping ABI compat in this case is more useful than reporting 64-bit dev_t, for the sake of pstat. Update note: strictly follow the instructions in UPDATING. Build and install the new kernel with COMPAT_FREEBSD11 option enabled, then reboot, and only then install new world. Credits: The 64-bit inode project, also known as ino64, started life many years ago as a project by Gleb Kurtsou (gleb). Kirk McKusick (mckusick) then picked up and updated the patch, and acted as a flag-waver. Feedback, suggestions, and discussions were carried by Ed Maste (emaste), John Baldwin (jhb), Jilles Tjoelker (jilles), and Rick Macklem (rmacklem). Kris Moore (kris) performed an initial ports investigation followed by an exp-run by Antoine Brodin (antoine). Essential and all-embracing testing was done by Peter Holm (pho). The heavy lifting of coordinating all these efforts and bringing the project to completion were done by Konstantin Belousov (kib). Sponsored by: The FreeBSD Foundation (emaste, kib) Differential revision: https://reviews.freebsd.org/D10439 Notes: svn path=/head/; revision=318736
* Let vmstat -o recognize OBJT_MGTDEVICE objects.Mark Johnston2017-05-231-0/+3
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=318713
* Make catman(1) use mandoc(1) by defaultBaptiste Daroussin2017-05-212-5/+26
| | | | | | | | catman(1) checks if mandoc(1) do support the manpage before trying to generate the catpage and falls back on nroff, using the same mechanism as man(1). Notes: svn path=/head/; revision=318600
* compress: Allow uncompress -c with multiple pathnames, as required by POSIX.Jilles Tjoelker2017-05-212-1/+23
| | | | | | | | | | | | | | Per POSIX, allow passing multiple pathnames to uncompress -c, concatenating the uncompressed data. Passing multiple pathnames to compress -c remains disallowed, since the result cannot be decompressed. PR: 219387 Reported by: Jörg Schilling Notes: svn path=/head/; revision=318592
* compress: Add basic tests.Jilles Tjoelker2017-05-213-0/+187
| | | | Notes: svn path=/head/; revision=318591
* bsdgrep: Correct per-line line metadata printingEd Maste2017-05-203-10/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Metadata printing with -b, -H, or -n flags suffered from a few flaws: 1) -b/offset printing was broken when used in conjunction with -o 2) With -o, bsdgrep did not print metadata for every match/line, just the first match of a line 3) There were no tests for this Address these issues by outputting this data per-match if the -o flag is specified, and prior to outputting any matches if -o but not --color, since --color alone will not generate a new line of output for every iteration over the matches. To correct -b output, fudge the line offset as we're printing matches. While here, make sure we're using grep_printline in -A context. Context printing should *never* look at the parsing context, just the line. The tests included do not pass with gnugrep in base due to it exhibiting similar quirky behavior that bsdgrep previously exhibited. Submitted by: Kyle Evans <kevans91@ksu.edu> Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D10580 Notes: svn path=/head/; revision=318574
* bsdgrep: emit more than MAX_LINE_MATCHES per lineEd Maste2017-05-201-7/+23
| | | | | | | | | | | | | | | | | | | | | | | | We should not set an arbitrary cap on the number of matches on a line, and in any case MAX_LINE_MATCHES of 32 is much too low. Instead, if we match more than MAX_LINE_MATCHES, keep processing and matching from the last match until all are found. For the regression test, we produce 4096 matches (larger than we expect we'll ever set MAX_LINE_MATCHES) and make sure we actually get 4096 lines of output with the -o flag. We'll also make sure that every distinct line is getting its own line number to detect line metadata not being printed as appropriate along the way. PR: 218811 Submitted by: Kyle Evans <kevans91@ksu.edu> Reported by: jbeich Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D10577 Notes: svn path=/head/; revision=318571
* bsdgrep: fix segfault with --mmapEd Maste2017-05-201-11/+11
| | | | | | | | | | | | | | r313948 partially fixed --mmap behavior but was incomplete. This commit generally reverts it and does it the more correct way- by just consuming the rest of the buffer and moving on. PR: 219402 Submitted by: Kyle Evans <kevans91@ksu.edu> Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D10820 Notes: svn path=/head/; revision=318565
* Language fixes.Edward Tomasz Napierala2017-05-181-2/+2
| | | | | | | | Submitted by: wblock MFC after: 2 weeks Notes: svn path=/head/; revision=318481
* indent(1): Support binary integer literals.Piotr Pawel Stefaniak2017-05-184-4/+58
| | | | | | | | | | | | | | | | | | This was done by Romain Tartière for PR123553. I initially thought that it would break code like this: #define b00101010 -1 if (0 b00101010) ... by joining 0 and b00101010 together. However, the real problem with that patch was that once it saw a 0, it assumed that the number was base 2, 8 or 16, ignoring base 10 floating point numbers. I fixed that. I didn't copy the diagnostic part of the original patch as it seems out of scope of implementing binary integer literals formatting. PR: 123553 Submitted by: romain (original version) Approved by: pfg (mentor) Notes: svn path=/head/; revision=318471
* Explain the new fields in top(1) related to ZFS compressed ARCAllan Jude2017-05-181-4/+17
| | | | | | | | | Reviewed by: bcr X-MFC-with: 316314 Differential Revision: https://reviews.freebsd.org/D10781 Notes: svn path=/head/; revision=318448
* Revert local changes to find_progenv accidentally committed in r318436Enji Cooper2017-05-181-8/+1
| | | | | | | | | MFC after: 2 weeks MFC with: r318436 Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=318437
* usr.bin/getconf: add some initial testsEnji Cooper2017-05-185-1/+204
| | | | | | | | | | | | | | | | | | | | Items tested via this commit are: - Some basic POSIX constants. - Some valid programming environments with -v. - Some invalid programming environments via -v. NOTE: this test makes assumptions about ILP32/LP32 vs LP64 that are currently not true on all architectures to avoid hardcoding some architectures in the tests. I'm working on improving getconf(1) to be more sane about handling ILP32/LP32 vs LP64. Future commits are coming soon to address this. MFC after: 2 weeks Tested with: amd64, i386 Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=318436
* Make the `.gperf.c` suffix rule depend on fake-gperf.awkEnji Cooper2017-05-181-2/+3
| | | | | | | | | | Parameterize out fake-gperf.awk to avoid duplicating the path MFC after: 2 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=318434
* Import libxo-0.7.2; add xo_options.7.Phil Shafer2017-05-161-0/+1
| | | | | | | | | Submitted by: phil Reviewed by: sjg Approved by: sjg (mentor) Notes: svn path=/head/; revision=318364
* Start writing up some basic feature tests for procstatEnji Cooper2017-05-154-0/+195
| | | | | | | | | | | | | | | | | | | These tests query a running process for information related to the -b, -c, -e, and -f flags; the -f testcase is largely stubbed out, pending additional work to determine a good, deterministic descriptor. Core file test support is coming soon--it requires a bit more effort due to the fact that: - coredumps can be disabled (kern.coredump=0). - corefiles can be put in different directories than the current directory, or be named something other than `<prog>.core` (`kern.corefile`). MFC after: 2 months Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=318325
* uniq: allow -c to be used with -d or -uEd Maste2017-05-152-20/+9
| | | | | | | | | | | | | | | | | | | | | | | | | Bring in some bits from NetBSD and lift the restriction in uniq(1) that -c cannot be used with the -d and -u options. This restriction seems unnecessary and is supported at least by GNU, OpenBSD, and NetBSD. Lift the restriction and simplify the show() logic a little bit to maintain functionality when -c is provided with -d/-u. Also with this change, -d and -u are now actually a mutually exclusive, albeit valid, combination. Given that they both indicate opposite behavior, uniq(1) will no longer output anything if both -d and -u are supplied. This is in line with NetBSD as well as GNU. Adjust the man page and usage() to reflect that -c is its own standalone option. PR: 200553 Submitted by: Kyle Evans <kevans91@ksu.edu> Reviewed by: cem, emaste MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D10694 Notes: svn path=/head/; revision=318316
* bsdgrep: don't allow negative -A / -B / -CEd Maste2017-05-154-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, when given a negative -A/-B/-C argument bsdgrep would overflow the respective context flag(s) and exhibited surprising behavior. Fix this by removing unsignedness of Aflag/Bflag and erroring out if we're given a value < 0. Also adjust the type used to track 'tail' context in procfile() so that it accurately reflects the Aflag value rather than overflowing and losing trailing context. This also fixes an inconsistency previously existing between -n and -C "n" behavior. They are now both limited to LLONG_MAX, to be consistent. Add some test cases to make sure grep errors out properly for both negative context values as well as non-numeric context values rather than giving bogus matches. Submitted by: Kyle Evans <kevans91@ksu.edu> Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D10675 Notes: svn path=/head/; revision=318302
* getconf: use nitems(..) to compute NWORDS instead of hardcodingEnji Cooper2017-05-141-1/+2
| | | | | | | | | | the equivalent macro MFC after: 1 month Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=318280
* Mark errf _Noreturn, and mark errf and warn __printflikeEnji Cooper2017-05-143-11/+12
| | | | | | | | | | | | | | | | | | | The _Noreturn attribute was added to placate Coverity and other static analysis tools. The __printflike attribute was added to catch issues with the calls related to printf(3) abuse. - Modify the code to facilitate the __printflike attribute addition. - Convert errf calls in to_mb(..) and to_mb_string(..) to warn(..) so the calls will return instead of exiting, as the code suggests it should. Differential Revision: D10704 MFC after: 1 month Reviewed by: pfg Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=318278
* style(9): sort headersEnji Cooper2017-05-131-2/+2
| | | | | | | | MFC after: 3 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=318257
* Add LTO-8 density codes.Kenneth D. Merry2017-05-111-1/+2
| | | | | | | | | | | | | | | lib/libmt/mtlib.c: Add the LTO-8 density code to the density table in libmt. usr.bin/mt/mt.1: Add the LTO-8 density code, tracks, bpmm, and bpi to the density table in the mt(1) man page. MFC after: 3 days Sponsored by: Spectra Logic Notes: svn path=/head/; revision=318185
* procstat(1): also reference icmp(4) and sctp(4)Enji Cooper2017-05-111-0/+2
| | | | | | | | | | | This was missed in the previous commit by accident. MFC after: 3 weeks MFC with: r318178 Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=318179
* procstat(1): document all possible `PRO` (network protocol) valuesEnji Cooper2017-05-111-1/+59
| | | | | | | | | | | Reference the appropriate section 4 manpages for networking protocols. MFC after: 3 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=318178
* procstat(1): clarify the Signal Disposition sectionEnji Cooper2017-05-111-3/+6
| | | | | | | | | | | | | | | | - Fix a typo (SIGIGN -> SIG_IGN). Use .Dv when referencing SIG_IGN. - Use semi-colons as soft breaks when separating sentences for the FLAGS section. - Tweak wording for C slightly to flow better and to be a bit more technically correct (signals with handlers installed will be caught by the target program). - Reference signal(3) in the SEE ALSO section. MFC after: 3 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=318175
* procstat(1): fix a typo (it's -> its)Enji Cooper2017-05-111-2/+2
| | | | | | | | MFC after: 3 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=318174
* Merge bmake-20170510Simon J. Gerraty2017-05-101-2/+2
|\ | | | | | | | | | | | | No-op change other than version update. Notes: svn path=/head/; revision=318163
* | Don't depend on assert(3) getting evaluatedAlan Somers2017-05-101-3/+3
| | | | | | | | | | | | | | | | | | | | Reported by: imp MFC after: 3 weeks X-MFC-With: 318141, 318143 Sponsored by: Spectra Logic Corp Notes: svn path=/head/; revision=318144
* | strcpy => strlcpyAlan Somers2017-05-101-1/+2
| | | | | | | | | | | | | | | | | | | | Reported by: Coverity CID: 1352771 MFC after: 3 weeks Sponsored by: Spectra Logic Corp Notes: svn path=/head/; revision=318141
* | Revert to pre-r318116 wording to not give the false impressionEdward Tomasz Napierala2017-05-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | that setting the kernels' idea of terminal size is somehow an alternative to environment variables. Reported by: kib MFC after: 2 weeks Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=318138
* | mkimg: Add -C argument to specify maximum capacityEmmanuel Vadot2017-05-102-16/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a -C option to specify a maximum capacity for the final image file. It is useful to control the size of the generated image for sdcard or when we will add dynamic size partition. Add --capacity which is a shorthand to define min and max capacity at the same time. Reviewed by: bapt, marcel, wblock (manpages) Sponsored by: Gandi.net Differential Revision: https://reviews.freebsd.org/D10509 Notes: svn path=/head/; revision=318137
* | Random updates to resizewin(1) man page.Edward Tomasz Napierala2017-05-091-16/+24
| | | | | | | | | | | | | | | | | | Reviewed by: cem, Daniel O'Connor <darius@dons.net.au> MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D10640 Notes: svn path=/head/; revision=318116
* | DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-05-0910-2/+8
| | | | | | | | | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=318000
* | DIRDEPS_BUILD: Connect new directories.Bryan Drewery2017-05-092-0/+40
| | | | | | | | | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=317999
* | csplit(1): Fix extraneous output in edge caseConrad Meyer2017-05-084-1/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | When the input to csplit contains fewer lines than the number of matches specified, extra output was mistakenly included in some output files. Fix the bug and add a simple ATF regression test. PR: 219024 Submitted by: J.R. Oldroyd <fbsd at opal.com> Notes: svn path=/head/; revision=317942
* | Add myself (dbaio) as a new ports committerDanilo G. Baio2017-05-081-0/+1
| | | | | | | | | | | | | | | | Approved by: garga (mentor) Differential Revision: https://reviews.freebsd.org/D10633 Notes: svn path=/head/; revision=317939
* | Sort variable declarations; no functional changes.Edward Tomasz Napierala2017-05-081-2/+2
| | | | | | | | | | | | | | | | MFC after: 2 weeks Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=317935
* | Add resizewin -z. It makes resizewin not do anything if the terminalEdward Tomasz Napierala2017-05-082-3/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | size is already set to something other than zero. It's supposed to be called from eg /etc/profile - it's not neccessary to query terminal size when logging in over the network, because the protocol used already takes care of this, but it's neccessary when logging over a serial line. Reviewed by: cem, Daniel O'Connor <darius@dons.net.au> MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D10637 Notes: svn path=/head/; revision=317934
* | Use tcflush(3) instead of (nonstandard) TIOCFLUSH.Edward Tomasz Napierala2017-05-081-4/+3
| | | | | | | | | | | | | | | | | | Reported by: kib MFC after: 2 weeks Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=317933
* | Make resizewin(1) discard the terminal queues, to lower the chanceEdward Tomasz Napierala2017-05-071-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | for "unable to parse response" error which happens when youre typing too fast for the machine you're running it on. Reviewed by: cem, Daniel O'Connor <darius@dons.net.au> MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D10624 Notes: svn path=/head/; revision=317909
* | Rename a variable, hopefully fixing build after r317901.Edward Tomasz Napierala2017-05-071-9/+9
| | | | | | | | | | | | | | | | MFC after: 2 weeks Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=317905
* | Improve error reporting in resizewin(1).Edward Tomasz Napierala2017-05-071-4/+4
| | | | | | | | | | | | | | | | | | | | Reviewed by: cem (earlier version) MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D10624 Notes: svn path=/head/; revision=317901
* | Build zstandard with threading enabledBaptiste Daroussin2017-05-061-1/+2
| | | | | | | | Notes: svn path=/head/; revision=317879