summaryrefslogtreecommitdiff
path: root/usr.bin
Commit message (Collapse)AuthorAgeFilesLines
* patch(1): Fix a few mandoc related issuesGordon Bergling2020-12-191-6/+6
| | | | | | | | | - no blank before trailing delimiter MFC after: 1 week Notes: svn path=/head/; revision=368807
* uname(1): Fix a typo in the man page dateGordon Bergling2020-12-191-1/+1
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=368806
* ident(1): Normalizing date formatGordon Bergling2020-12-191-1/+1
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=368805
* login(1): when exporting variables check the result of setenv(3)Pedro F. Giffuni2020-12-191-1/+4
| | | | | | | | | | | | | | | When exporting a variable we correctly check all the preconditions that could make setenv(3) fail. Checking the setenv(3) return value seems redundant, but given that login(1) is critical, it doesn't hurt to have a post-check. This change is based on the "Principles of Secure Coding" course by Matthew Bishop, PhD., which specifically discusses this code in FreeBSD. (This change redoes r368776 due to a silly mistake) Notes: svn path=/head/; revision=368778
* Revert r368776:Pedro F. Giffuni2020-12-191-4/+1
| | | | | | | | | | login(1): when exporting variables check the result of setenv(3) mismatch: the return value upon error is -1, so the code was not doing nothing. Notes: svn path=/head/; revision=368777
* login(1): when exporting variables check the result of setenv(3)Pedro F. Giffuni2020-12-191-1/+4
| | | | | | | | | | | | | | | When exporting a variable we correctly check all the preconditions that could make setenv(3) fail. Checking the setenv(3) return value seems redundant, but given that login(1) is critical, it doesn't hurt to have a post-check. This change is based on the "Principles of Secure Coding" course by Matthew Bishop, PhD., which specifically discusses this code in FreeBSD. Differential Revision: https://reviews.freebsd.org/D26966 Notes: svn path=/head/; revision=368776
* Add ELF flag to disable ASLR stack gap.Konstantin Belousov2020-12-181-0/+1
| | | | | | | | | | | | Also centralize and unify checks to enable ASLR stack gap in a new helper exec_stackgap(). PR: 239873 Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=368772
* kyua: Only install examples if requestedEmmanuel Vadot2020-12-171-1/+7
| | | | | | | | Reviewed by: brooks Differential Revision: https://reviews.freebsd.org/D27638 Notes: svn path=/head/; revision=368722
* Complete steps 5 and 9 from Committer's guideJuraj Lutter2020-12-161-0/+1
| | | | | | | | | Reviewed by: osa (mentor) Approved by: osa (mentor) Differential Revision: https://reviews.freebsd.org/D27632 Notes: svn path=/head/; revision=368701
* Fix WITHOUT_ICONV buildStefan Eßer2020-12-131-1/+1
| | | | | | | | | | | | Move the include of langinfo.h out of the WITH_ICONV condition block, since it is not dependent on ICONV. This was correct when nl_langinfo() had only been called in the WITH_ICONV case, but that is no longer the case. Submitted by: yuripv Notes: svn path=/head/; revision=368611
* Revert r368606Stefan Eßer2020-12-131-4/+0
| | | | | | | | | The issue will be fixed in a different way. Reported by: yuripv Notes: svn path=/head/; revision=368610
* Fix WITHOUT_ICONV buildStefan Eßer2020-12-131-0/+4
| | | | | | | | | | There was an unprotected use of nl_langinfo() to determine the order of day vs. month in the generated output. When building without ICONV support, the order will be: month, day. Notes: svn path=/head/; revision=368606
* xargs: compile yesexpr as EREYuri Pankov2020-12-121-1/+1
| | | | | | | | | | | | yesexpr is an extended regular expression for quite some time now, use appropriate flag when compiling it. PR: 238762 Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D27509 Notes: svn path=/head/; revision=368580
* Use getlocalbase() instead of compiled in LOCALBASE to locate calendarsStefan Eßer2020-12-122-3/+9
| | | | Notes: svn path=/head/; revision=368578
* lock(1): Add EXAMPLES sectionFernando Apesteguía2020-12-111-1/+6
| | | | | | | | | | | Add simple example showing the use of the flags: p, t, v Reviewed by: gbe@, yuripv@ Approved by: manpages (yuripv@) Differential Revision: https://reviews.freebsd.org/D27541 Notes: svn path=/head/; revision=368556
* Install 2 forgotten shell scripts required to run the testsStefan Eßer2020-12-111-0/+2
| | | | | | | | Submitted by: arichardson (Alexander Richardson) Differential Revision: https://reviews.freebsd.org/D27568 Notes: svn path=/head/; revision=368551
* Fix a grammar error on locate(1).Guangyuan Yang2020-12-111-4/+3
| | | | | | | | | | | While here, also fix a useless .Tn reported by mandoc. PR: 251746 MFC after: 1 week Sumbitted by: David Schlachter <fbsd-bugzilla@schlachter.ca> Notes: svn path=/head/; revision=368550
* Add the LTO-9 density code to libmt and the mt(1) man page.Kenneth D. Merry2020-12-101-1/+2
| | | | | | | | | | | | | | | | | | | | These values are taken directly from the density report from an IBM LTO-9 tape drive. (Using mt getdensity) A LTO-9 drive stores 18TB raw (45TB with compression) on an LTO-9 tape. lib/libmt/mtlib.c: Add the LTO-9 density code, and bpmm/bpi values. usr.bin/mt/mt.1: Add the LTO-9 density code, bpmm/bpi values and number of tracks. Bump the man page date. MFC after: 3 days Sponsored by: Spectra Logic Notes: svn path=/head/; revision=368525
* id(1): Add EXAMPLES sectionFernando Apesteguía2020-12-101-0/+36
| | | | | | | | | | | | Add some examples covering the flags: G, n, P, p, u Add reference to groups(1) Approved by: manpages (gbe@) Differential Revision: https://reviews.freebsd.org/D27539 Notes: svn path=/head/; revision=368520
* groups(1): Add EXAMPLEFernando Apesteguía2020-12-101-0/+6
| | | | | | | | | | Add a super simple example Approved by: manpages (gbe@) Differential Revision: https://reviews.freebsd.org/D27538 Notes: svn path=/head/; revision=368518
* truss: Add AIO syscalls.Thomas Munro2020-12-102-0/+172
| | | | | | | | | | | | Display the arguments of aio_read(2), aio_write(2), aio_suspend(2), aio_error(2), aio_return(2), aio_cancel(2), aio_fsync(2), aio_mlock(2), aio_waitcomplete(2) and lio_listio(2) in human-readable form. Reviewed by: asomers Differential Revision: https://reviews.freebsd.org/D27518 Notes: svn path=/head/; revision=368500
* grep: replace the internal queue with a ring bufferKyle Evans2020-12-093-52/+78
| | | | | | | | | | | | | We know up front how many items we can have in the queue (-B/Bflag), so pay the cost of those particular allocations early on. The reduced queue maintenance overhead seemed to yield about an ~8% improvement for my earlier `grep -C8 -r closefrom .` test. MFC after: 2 weeks Notes: svn path=/head/; revision=368483
* grep: tests: stop expecting a failure of gnuext w/ bsdgrepKyle Evans2020-12-091-3/+1
| | | | | | | | libregex now supports these and we no longer offer to not link against libregex. Notes: svn path=/head/; revision=368482
* kdump/truss: decode new _umtx_op flagsKyle Evans2020-12-092-7/+35
| | | | | | | | | | | | | | | | | | | | In both cases, print the flag bits first followed by the command. Output now looks something like this: (ktrace) _umtx_op(0x8605f7008,0xf<UMTX_OP_WAIT_UINT_PRIVATE>,0,0,0) _umtx_op(0x9fffdce8,0x80000003<UMTX_OP__32BIT|UMTX_OP_WAKE>,0x1,0,0) (truss) _umtx_op(0x7fffffffda50,UMTX_OP_WAKE,0x1,0x0,0x0) = 0 (0x0) _umtx_op(0x9fffdd08,UMTX_OP__32BIT|UMTX_OP_WAKE,0x1,0x0,0x0) = 0 (0x0) Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D27325 Notes: svn path=/head/; revision=368481
* fts_read: Handle error from a NULL return better.Bryan Drewery2020-12-083-3/+7
| | | | | | | | | | | | | | | | | | | | This is addressing cases such as fts_read(3) encountering an [EIO] from fchdir(2) when FTS_NOCHDIR is not set. That would otherwise be seen as a successful traversal in some of these cases while silently discarding expected work. As noted in r264201, fts_read() does not set errno to 0 on a successful EOF so it needs to be set before calling it. Otherwise we might see a random error from one of the iterations. gzip is ignoring most errors and could be improved separately. Reviewed by: vangyzen Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D27184 Notes: svn path=/head/; revision=368467
* bsdgrep: don't link against libregex for bootstrapKyle Evans2020-12-061-0/+2
| | | | | | | | | | | | | | | | | r368355 removed the GNU_GREP_COMPAT knob (off by default) and forgot that bsdgrep may be built/used for bootstrap on some systems. All base uses should strive to use only POSIX-compliant expressions anyways and we haven't had libregex by default here up to this point, so just don't do that if we're bootstrapping. Note that the resulting binary has the wrong `grep -V` information as it falsely claims to be GNU compatible, but it is only for bootstrap. Reported by: GitHub cross-builds via yuripv Notes: svn path=/head/; revision=368392
* Retire GNU_GREP_COMPAT knobKyle Evans2020-12-052-9/+1
| | | | | | | | | | | | | This was introduced and then disabled by default primarily to avoid dealing with bugs in libgnuregex. rS363823 switched to using libregex for it, so let's just rip the option out now so we can make sure we're getting tested with libregex via bsdgrep. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D27476 Notes: svn path=/head/; revision=368355
* MFV r368207:Martin Matuska2020-12-013-3/+3
| | | | | | | | | | | | | | | | | | | | | | Update libarchive to 3.5.0 Relevant vendor changes: Issue #1258: add archive_read_support_filter_by_code() PR #1347: mtree digest reader support Issue #1381: skip hardlinks pointing to itself on extraction PR #1387: fix writing of cpio archives with hardlinks without file type PR #1388: fix rdev field in cpio format for device nodes PR #1389: completed support for UTF-8 encoding conversion PR #1405: more formats in archive_read_support_format_by_code() PR #1408: fix uninitialized size in rar5_read_data PR #1409: system extended attribute support PR #1435: support for decompression of symbolic links in zipx archives Issue #1456: memory leak after unsuccessful archive_write_open_filename MFC after: 1 week Notes: svn path=/head/; revision=368234
* iconv(1): Add EXAMPLEFernando Apesteguía2020-11-291-0/+7
| | | | | | | | | | | Just a small example to show simple usage. Approved by: manpages (0mp@) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D27385 Notes: svn path=/head/; revision=368160
* Make generated C files depend on this MakefileStefan Eßer2020-11-271-4/+4
| | | | | | | | | | | | The contents of lib.c, lib2.c, bc_help.c, and dc_help.c depends on the parameters passed to strgen.sh in this Makefile. A change to the number of parameters of strgen.sh has been applied to the invocation of this command, but this did not cause a rebuild of the generated files. Reported by: Cy.Schubert@cschubert.com Notes: svn path=/head/; revision=368097
* Update Makefile for new version 3.2.0Stefan Eßer2020-11-261-6/+6
| | | | Notes: svn path=/head/; revision=368080
* Drop superfluous "of" from the systat example.Benedict Reuschling2020-11-251-1/+1
| | | | Notes: svn path=/head/; revision=368014
* Remove the cloned file descriptors for /dev/crypto.John Baldwin2020-11-252-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Crypto file descriptors were added in the original OCF import as a way to provide per-open data (specifically the list of symmetric sessions). However, this gives a bit of a confusing API where one has to open /dev/crypto and then invoke an ioctl to obtain a second file descriptor. This also does not match the API used with /dev/crypto on other BSDs or with Linux's /dev/crypto driver. Character devices have gained support for per-open data via cdevpriv since OCF was imported, so use cdevpriv to simplify the userland API by permitting ioctls directly on /dev/crypto descriptors. To provide backwards compatibility, CRIOGET now opens another /dev/crypto descriptor via kern_openat() rather than dup'ing the existing file descriptor. This preserves prior semantics in case CRIOGET is invoked multiple times on a single file descriptor. Reviewed by: markj Relnotes: yes Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D27302 Notes: svn path=/head/; revision=368005
* Improve number reading by rounding up to a next unit earlier for memory display.Michael Reifenberger2020-11-211-12/+12
| | | | | | | | Submitted by: ota@j.email.ne.jp Differential Revision: https://reviews.freebsd.org/D26503 Notes: svn path=/head/; revision=367922
* iscsi.conf(5): Fix a mandoc warningGordon Bergling2020-11-201-3/+3
| | | | | | | - new sentence, new line Notes: svn path=/head/; revision=367898
* bzgrep: make flag --no-filename workEugene Grosbein2020-11-201-4/+4
| | | | | | | | PR: 248813 MFC after: 1 week Notes: svn path=/head/; revision=367866
* Merge bmake-20201117Simon J. Gerraty2020-11-204-25/+68
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | o allow env var MAKE_OBJDIR_CHECK_WRITABLE=no to skip writable checks in InitObjdir. Explicit .OBJDIR target always allows read-only directory. o More code cleanup and refactoring. o More unit tests MFC after: 1 week Notes: svn path=/head/; revision=367863
* | fstat(1): Add EXAMPLES sectionFernando Apesteguía2020-11-191-3/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add examples covering -f, -m and -p flags. While here, extend the initial description paragraph to note that fstat(1) will report on all opened files, belonging to processes the user has access to. The current paragraph may lead to understand that you can get information on opened files from processes belonging to other users. Reviewed by: bjk@, danfe@, gbe@ Approved by: manpages (gbe@) Differential Revision: https://reviews.freebsd.org/D26949 Notes: svn path=/head/; revision=367851
* | grep(1): Add more EXAMPLESFernando Apesteguía2020-11-191-8/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add more EXAMPLES covering flags: -A, -B, -c, -f, -i, -H, -l, -q, -R, -w * While here, change existing wording to use the imperative (remove "To find") * Reword first example to be consistent with how grep(1) understand words (-w) Approved by: manpages (bcr@) Differential Revision: https://reviews.freebsd.org/D27264 Notes: svn path=/head/; revision=367850
* | Partially revert r367756 (chpass(1) synopsis changes)Mateusz Piotrowski2020-11-171-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let's have two entries in the synopsis: - chpass now lists options which can be used for non-NIS-specific functionalities. - ypchpass additionally lists the NIS-specific flags. Technically, it is an artificial distinction, as chpass and ypchpass behave identically. Nevertheless, it might help navigating the synopsis section. Reviewed by: imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D27251 Notes: svn path=/head/; revision=367769
* | Add an example for the -s flagMateusz Piotrowski2020-11-171-0/+6
| | | | | | | | | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=367759
* | Improve readability of the lists of optionsMateusz Piotrowski2020-11-171-20/+20
| | | | | | | | | | | | | | | | | | | | | | - Sort options alphabetically - Add missing arguments (e.g., "list" to -a) - Adjust the width of Bl MFC after: 1 week Notes: svn path=/head/; revision=367757
* | Clean up the synopsis section & fix mandoc warningsMateusz Piotrowski2020-11-171-12/+6
| | | | | | | | | | | | | | | | | | | | | | The synopsis section had two very similar entries. The flags documented by the first one were a strict subset of the second one. Let's just keep only the second entry for simplicity. MFC after: 1 week Notes: svn path=/head/; revision=367756
* | bsdiff: fix off-by-one errorMitchell Horne2020-11-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The program reads oldsize bytes from oldfile, and proceeds to initialize a suffix array of oldsize elements using divsufsort(). As per the function's API [1], array indices 0 through n-1 are initialized. Later, search() is called, but with index bounds [0, n]. Depending on the contents of the malloc'd buffer, accessing this uninitialized index at the end of can result in a segmentation fault. Fix this by passing oldsize-1 to search(), limiting the search bounds to [0, n-1]. This bug is a result of r303285, which introduced divsufsort() as an alternate suffix sorting function to the existing qsufsort(). It seems that qsufsort() did initialize the final empty element, meaning it could be safely accessed. This difference in the implementations was missed at the time. [1] https://github.com/y-256/libdivsufsort Discussed with: cperciva MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26911 Notes: svn path=/head/; revision=367734
* | Change the default locale to C.UTF-8Baptiste Daroussin2020-11-141-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | The C.UTF-8 locales is the same as the actual C locale except it does support the unicode character set. But the collation etc are still the same as the C locale one. Reviewed by: many Approved by: many Differential Revision: https://reviews.freebsd.org/D26973 Notes: svn path=/head/; revision=367690
* | Explicitly note in the EXAMPLES section that uname(3) contains more detailsMateusz Piotrowski2020-11-131-1/+4
| | | | | | | | | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=367640
* | Document in the synopsis that -0 cannot be used with the utility argumentMateusz Piotrowski2020-11-111-2/+7
| | | | | | | | Notes: svn path=/head/; revision=367592
* | vmstat: drop the HighUse field from malloc dumpMateusz Guzik2020-11-091-5/+4
| | | | | | | | | | | | | | | | | | | | It is hardwired to "-" since its introduction in 2005. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D27141 Notes: svn path=/head/; revision=367534
* | vmstat: remove spurious newlines when reporting zonesMateusz Guzik2020-11-091-2/+1
| | | | | | | | Notes: svn path=/head/; revision=367501
* | Add collation version support to querylocale(3).Thomas Munro2020-11-085-6/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide a way to ask for an opaque version string for a locale_t, so that potential changes in sort order can be detected. Similar to ICU's ucol_getVersion() and Windows' GetNLSVersionEx(), this API is intended to allow databases to detect when text order-based indexes might need to be rebuilt. The CLDR version is extracted from CLDR source data by the Makefile under tools/tools/locale, written into the machine-generated Makefile under shared/colldef, passed to localedef -V, and then written into LC_COLLATE file headers. The initial version is 34.0. tools/tools/locale was recently updated to pull down 35.0, but the output hasn't been committed under share/colldef yet, so that will provide the first observable change when it happens. Other versioning schemes are possible in future, because the format is unspecified. Reviewed by: bapt, 0mp, kib, yuripv (albeit a long time ago) Differential Revision: https://reviews.freebsd.org/D17166 Notes: svn path=/head/; revision=367476