summaryrefslogtreecommitdiffstats
path: root/usr.bin
Commit message (Collapse)AuthorAgeFilesLines
* MFC r316610:asomers2017-05-301-2/+2
| | | | | | | | usr.bin/netstat: strcpy -> strlcpy Reported by: Coverity CID: 1006741, 1006744 Sponsored by: Spectra Logic Corp
* MFC r316501, r316523asomers2017-05-308-46/+171
| | | | | | | | | | | | | | | | | | | | | | r316501: Fix file descriptor and memory leaks in pr(1) 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 Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9137 r316523: Remove a duplicate fclose() that snuck into r316501 Reported by: Coverity CID: 1373338 X-MFC-With: 316501 Sponsored by: Spectra Logic Corp
* MFC r316500 (except the part to usr.bin/fortune)asomers2017-05-303-5/+5
| | | | | | | | | | strcpy => strlcpy, strcat => strlcat Reported by: Coverity CID: 1006703 978863 1006745 1347163 Reviewed by: cem Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D10192
* MFC r305613 (gabor):gjb2017-05-221-1/+1
| | | | | | | Fix typo. PR: 211245 Sponsored by: The FreeBSD Foundation
* MFC r313955 (emaste):gjb2017-05-221-0/+2
| | | | | | | | | | | bsdgrep: document ignored option -u MSDOS and Windows GNU grep uses -u to mean "print byte offsets as if running on an UNIX system." The option has no effect on systems that do not use CRLF line endings. PR: 171200 Sponsored by: The FreeBSD Foundation
* MFC r317160:ngie2017-05-221-2/+2
| | | | | | Clean up trailing whitespace No functional changes
* MFC r317658:bdrewery2017-05-151-0/+6
| | | | Redo r288270: Hookup mkcsmapper_static and mkesdb_static for 'make clean'
* MFC r318185:ken2017-05-151-1/+2
| | | | | | | | | | | | | Add LTO-8 density codes. 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. Sponsored by: Spectra Logic
* MFC 313407,313449: Copy ELF machine/flags from binaries to core dumps.jhb2017-05-111-8/+15
| | | | | | | | | | | | | | | | | 313407: Copy the e_machine and e_flags fields from the binary into an ELF core dump. In the kernel, cache the machine and flags fields from ELF header to use in the ELF header of a core dump. For gcore, the copy these fields over from the ELF header in the binary. This matters for platforms which encode ABI information in the flags field (such as o32 vs n32 on MIPS). 313449: Trim trailing whitespace (mostly introduced in r313407). Sponsored by: DARPA / AFRL
* MFC: r310712marius2017-05-103-11/+32
| | | | | | | | | | | - Use correct offsets into the keys set array. As the elements of this zero-length array are dynamically sized at run-time based on the use of hints, compilers can't be expected to figure out these offsets on their own. [1] - Fix incorrect comparison in cmp_nans(). [2] PR: 204571 [1], 202301 [2] Submitted by: David Binderman [2]
* MFC r303450:bdrewery2017-05-091-3/+8
| | | | Pull a copy of the input string before calling basename() and dirname().
* MFC r317848:ken2017-05-081-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add basic programmable early warning error injection to the sa(4) driver. This will help application developers simulate end of tape conditions. To inject an error in sa0: sysctl kern.cam.sa.0.inject_eom=1 This will return the next read or write request queued with 0 bytes written. Any subsequent writes or reads will go along as usual. This will also cause the early warning position flag to get set for the next position query. So, 'mt status' will show the BPEW (Beyond Programmable Early Warning) flag on the first query after an error injection. After that, the position flags will be as they are in the underlying tape drive. Also, update the sa(4) man page to describe tape parameters, which can be set via 'mt param'. sys/cam/scsi/scsi_sa.c: In saregister(), create the inject_eom sysctl variable. In sastart(), check to see whether inject_eom is set. If so, return the read or write with 0 bytes written to indicate EOM. Set the set_pews_status flag so that we fake PEWS status in the next position call for reads, and the next 3 calls for writes. This allows the user to see the BPEW flag one time via 'mt status'. In sagetpos(), check the set_pews_status flag and fake PEWS status and decrement the counter if it is set. share/man/man4/sa.4: Document the inject_eom sysctl variable. Document all of the parameters currently supported via 'mt param'. usr.bin/mt/mt.1: Point the user to the sa(4) man page for more details on supported parameters. Sponsored by: Spectra Logic
* MFC r317583:pfg2017-05-041-3/+3
| | | | | | Fix some cases where an index was used before its limits check. Obtained from: DragonFlyBSD (git 799ba435)
* MFC r312404, r312519, r313277:delphij2017-04-031-1/+1
| | | | | | | | Use S_ISREG instead of manual & (also it's better to compare the result from & and the pattern instead of just assuming it's one bit value). Pointed out by Tianjie Mao <tjmao tjmao com>.
* MFC r315636,315876,316095:mm2017-03-313-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Sync libarchive with vendor Vendor changes/bugfixes (FreeBSD-related): r315636: 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 r315876: 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 r316095: Constify variables in several places Unify platform ACL code in a single source file Fix unused variable if compiling on FreeBSD without NFSv4 ACL support
* MFC r315776:ngie2017-03-302-1/+1
| | | | | | | | Rename tests from <foo> to <foo>_test to match the FreeBSD test suite 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 r312692sevan2017-03-301-1/+2
| | | | | | | | | Improve wording when describing -mmin. PR: 215922 Submitted by: danielsh AT apache DOT org Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D9313
* MFC r281759sevan2017-03-301-1/+1
| | | | | | find.1: Add missing whitespace: Obtained from: Dragonfly (dee38d02d51cc8316f82b0263158d2546f2398bc)
* MFC r309552sevan2017-03-301-1/+21
| | | | | | | | | | | Fix error in the example section Adjust formatting highlighted by igor. PR: 214683 Submitted by: Anindya Mukherjee <anindya49 AT hotmail DOT com> Reviewed by: jilles Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D8591
* MFC r315212, r315213, r315214, r315215:pfg2017-03-201-3/+3
| | | | | | | | | mkimg(1): let calloc(3) do the multiplication. nscd(8): let calloc(3) do the multiplying. mpsutil(8): let calloc(3) do the multiplying. ypbind(8): let calloc(3) do the multiplying. MFC after: 1 week
* MFC r314571:mm2017-03-166-17/+20
| | | | | | | | | | | | | | | | Update libarchive to version 3.3.1 (and sync with latest vendor dist) Notable vendor changes: PR #501: improvements in ACL path handling PR #724: fix hang when reading malformed cpio files PR #864: fix out of bounds read with malformed GNU tar archives Documentation, style, test suite improvements and typo fixes. New options to bsdtar that enable or disable reading and/or writing of: Access Control Lists (--acls, --no-acls) Extended file flags (--fflags, --no-fflags) Extended attributes (--xattrs, --no-xattrs) Mac OS X metadata (Mac OS X only) (--mac-metadata, --no-mac-metadata)
* MFC r314321:pfg2017-03-123-43/+23
| | | | | | | | | | | dc(1): Merge minor changes from OpenBSD. Prefer setvbuf() to setlinebuf() for portability. Some style(9) and redundant tests for NULL. These are only meant to ease up merging newer changes. Obtained from: OpenBSD
* MFC r314592: Fix JSON output.mav2017-03-101-14/+17
|
* MFC r314450,r313439:ngie2017-03-073-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r314450: Add additional __FreeBSD_version guards around the hsearch_r testcases The reasoning for this is the same as r276046: to ease MFCing the tests to ^/stable/10 . This was accidentally missed in r313439 r313439 | ngie | 2017-02-08 01:46:15 -0800 (Wed, 08 Feb 2017) | 25 lines Merge content from ^/projects/netbsd-tests-upstream-01-2017 into ^/head The primary end-goal of this drop is ease future merges with NetBSD and collaborate further with the NetBSD project. The goal was (largely, not completely as some items are still oustanding in the NetBSD GNATS system) achieved by doing the following: - Pushing as many changes required to port contrib/netbsd-tests back to NetBSD as possible, then pull the upstream applied changes back in to FreeBSD. - Diff reduce with upstream where possible by: -- Improving libnetbsd header, etc compat glue. -- Using _SED variables to modify test scripts on the fly for items that could not be upstreamed to NetBSD. As a bonus for this work, this change also introduces testcases for uniq(1). Many thanks to Christos for working with me to get many of the changes back into the NetBSD project. In collaboration with: Christos Zoulas <christos@netbsd.org>
* MFC r313867,r313869,r313870,r314001:bdrewery2017-03-031-2/+13
| | | | | | | | | | | r313867: Add history and Authors section in the manpage r313869: Also add vsevolod@ in the authors r313870: Use full name for the month r314001: Make it more clear that -k sends SIGKILL, not the -s signal.
* MFC r314316:pfg2017-03-011-1/+1
| | | | | | | dc(1): Catch up with OpenBSD tag. OpenBSD rev 1.12 corresponds to our SVN r275162. Update the tag to make easier future updates. No functional change.
* MFC r311572, r311895, r311928, r311985, r312395, r312417asomers2017-02-287-77/+383
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r311572: Fix file descriptor leaks in cmp(1) Also, add a few test cases Reported by: Coverity CID: 271624 275338 Reviewed by: ngie MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9074 r311895: Fix memory leaks during "tail -r" of an irregular file * Rewrite r_buf to use standard tail queues instead of a hand-rolled circular linked list. Free dynamic allocations when done. * Remove an optimization for the case where the file is a multiple of 128KB in size and there is a scarcity of memory. * Add ATF tests for "tail -r" and its variants. Reported by: Valgrind Reviewed by: ngie MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9067 r311928: Fix build of usr.bin/tail with GCC Submitted by: pluknet Reported by: pluknet MFC after: 27 days X-MFC-with: 311895 Sponsored by: Spectra Logic Corp r311985: Fix uninitialized variable CIDs in route6d The variables in question are actually return arguments, but it's still good form to initialize them. Reported by: Coverity CID: 979679 979680 MFC after: 4 weeks Sponsored by: Spectra Logic Corp r312395: Fix several Coverity CIDs in devd CID 1362055, 1362054: File descriptor leaks during shutdown CID 1362013: Potential null-termination fail with long network device names CID 1362097: Uncaught exception during memory pressure CID 1362017, 1362016: Unchecked errors, possibly resulting in weird behavior if two devd instances start at the same time. CID 1362015: Unchecked error that will probably never fail Reported by: Coverity CID: 1362055 1362054 1362013 1362097 1362017 1362016 1362015 MFC after: 4 weeks Sponsored by: Spectra Logic Corp r312417: Fix build of devd with GCC 4.2 Reported by: olivier Pointy-hat-to: asomers MFC after: 27 days X-MFC-with: 312395 Sponsored by: Spectra Logic Corp
* MFC r313652:ngie2017-02-211-3/+3
| | | | | | Use SRCTOP instead of .CURDIR relative paths with ".." This simplifies pathing in make/displayed output
* MFC r313654:ngie2017-02-211-2/+2
| | | | | | | | | Use SRCTOP to refer to awk source in contrib/awk and remove unnecessary AWKSRC prefix for maketab.c The former simplifies pathing in make/displayed output, whereas the latter was just unnecessarily superfluous since .PATH referenced the path to maketab.c earlier on in the Makefile.
* MFC r313679:ngie2017-02-2112-70/+68
| | | | | | | Use SRCTOP/OBJTOP relative paths where possible; use :H manipulation in lieu of ../ elsewhere This simplifies pathing in make/displayed output
* MFC r313653:ngie2017-02-211-1/+1
| | | | | | Use SRCTOP instead of .CURDIR relative paths with ".." This simplifies pathing in make/displayed output
* MFC r313656:ngie2017-02-211-1/+1
| | | | Use SRCTOP to define .include with usr.bin/Makefile.inc
* MFC r312520:ngie2017-02-211-0/+4
| | | | | | | | | | Integrate contrib/netbsd-tests/usr.bin/sed/t_sed.sh into the FreeBSD test suite as usr.bin/sed/sed_test Don't expect :emptybackref to fail -- it succeeds on FreeBSD Expect :preserve_leading_ws_ia to fail -- it fails on ^/stable/10, but not on ^/stable/11 or ^/head
* MFC r295643:ngie2017-02-161-0/+3
| | | | | | r295643 (by bdrewery): Test directories can build in parallel fine.
* MFC r312523:ngie2017-02-112-0/+52
| | | | | | | Add some basic -s flag testcases for cut(1) The remaining functionality seems to be covered in one form or another via the NetBSD ATF testcase.
* MFC r289172,r290254:ngie2017-02-0924-76/+20
| | | | | | | | | | | | | | | | r289172: Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) and netbsd-tests.test.mk (r289151) - Eliminate explicit OBJTOP/SRCTOP setting - Convert all ad hoc NetBSD test integration over to netbsd-tests.test.mk - Remove unnecessary TESTSDIR setting - Use SRCTOP where possible for clarity r290254: Remove unused variable (SRCDIR)
* MFC r312663: When creating record file, use umask 077 instead of the default.delphij2017-02-061-1/+6
|
* MFC r312667:pfg2017-02-061-24/+28
| | | | | | | | | sort - Don't live-loop threads. Worker threads now use a pthread_cond_t to wait for work instead of burning the cpu up. Obtained from: DragonflyBSD (07774aea0ccf64a48fcfad8899e3bf7c8f18277a)
* MFC r312664: Always initialize 'c'.delphij2017-02-061-1/+1
|
* MFC r311160, r311210, r311288, r311292, r311298, r311340asomers2017-02-023-19/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r311160: misc minor fixes in mpr(4) sys/dev/mpr/mpr_sas.c * Fix a potential null pointer dereference (CID 1305731) * Check for overrun of the ccb_scsiio.cdb_io.cdb_bytes buffer (CID 1211934) sys/dev/mpr/mpr_sas_lsi.c * Nullify a dangling pointer in mprsas_get_sata_identify * Fix a memory leak in mprsas_SSU_to_SATA_devices (CID 1211935) Reported by: Coverity (partially) CID: 1305731 1211934 1211935 Reviewed by: slm MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D8880 r311210: Quell Coverity for diskinfo(8) * CID 1198994: Don't run the speed disk on a disk with no sectors * CID 1011442: Don't call close(2) if open(2) fails * CID 1011161: Use snprintf instead of sprintf * CID 1009825: Check the return value of lseek Reported by: Coverity CID: 1198994 1011442 1011161 1009825 MFC after: 4 weeks Sponsored by: Spectra Logic Corp r311288: Delete dead code in chat(8) It's always been dead, ever since first import in 1994. It's still dead in OpenBSD's version, too. Reported by: Coverity CID: 270586 MFC after: 4 weeks Sponsored by: Spectra Logic Corp r311292: Remove dead code in rpc_parse.c It's been dead ever since it was imported from TI-RPC in 1995. The dead code is still present in Illumos today, but was removed from NetBSD in 2006. Reported by: Coverity CID: 270097 Obtained from: NetBSD MFC after: 4 weeks Sponsored by: Spectra Logic Corp r311298: Remove dead code in dhclient(8) The offending code has been dead ever since the import from OpenBSD in r195805. OpenBSD later deleted that entire function. Reported by: Coverity CID: 500059 MFC after: 4 weeks Sponsored by: Spectra Logic Corp r311340: Misc Coverity fixes for tail(1) CID 1006402: Initialize stack variable CID 271580: Don't leak memory when ENOMEM. Reported by: Coverity CID: 271580 1006402 MFC after: 4 weeks Sponsored by: Spectra Logic Corp
* MFC r311804: Rewrite CTL statistics in more simple and scalable way.mav2017-01-262-237/+214
| | | | | | | | | | | | | Instead of collecting statistics for each combination of ports and logical units, that consumed ~45KB per LU with present number of ports, collect separate statistics for every port and every logical unit separately, that consume only 176 bytes per each single LU/port. This reduces struct ctl_lun size down to just 6KB. Also new IOCTL API/ABI does not hardcode number of LUs/ports, and should allow handling of very large quantities. Old API is still enabled in stable branches for compatibility reasons.
* MFC r311947, r311981:pfg2017-01-182-3/+9
| | | | | | | | | | | | | | rpcgen(1): Avoid unused variable warning on generated code. Avoid "unused variable 'i'" warnings in generated .c files by only emitting the "int i;" for non-opaque arrays. Opaque arrays use xdr_opaque() rather than iterating over the array. Obtained from: OpenBSD (CVS rev 1.28) rpcgen(1): Check getrlimit() return for generated code. Obtained from: NetBSD (CVS rev 1.27, 1.28)
* MFC r311275: Restructure libz.delphij2017-01-181-1/+1
|
* MFC r311769:smh2017-01-161-3/+3
| | | | | | Fix rstat: symbol not in namelist from netstat Sponsored by: Multiplay
* MFC r266773,r280680,r311710:ngie2017-01-131-7/+7
| | | | | | | | | | | | | | | | | r266773 (by jhb): Fix a couple of size_t != int warnings. r280680 (by kevlo): Print size_t's with %zu rather than "%zd. r311710: Style fixes - Delete trailing whitespace - Use nitems(mib) instead of hardcoding the mib length
* MFC 306564: Expose kernel-only errno values if _WANT_KERNEL_ERRNO is defined.jhb2017-01-091-4/+1
| | | | | | | | | | | The kernel uses a few negative errno values for internal conditions such as requesting a system call restart. Normally these errno values are not exposed to userland. However, kdump needs access to these values as some of then can be present in a ktrace system call return record. Previously kdump was defining _KERNEL to gain access to ehse values, but was then having to manually declare 'errno' (and doing it incorrectly). Now, kdump uses _WANT_KERNEL_ERRNO instead of _KERNEL and uses the system-provided declaration of errno.
* MFC 306563: Decode arguments to truncate and ftruncate.jhb2017-01-071-0/+6
| | | | | In particular, decode the off_t argument as a 64-bit argument to fix decoding for 32-bit processes.
* MFC 306562: Handle 64-bit system call arguments (off_t, id_t).jhb2017-01-061-7/+37
| | | | | | | | | | | | In particular, 64-bit system call arguments use up two register_t arguments for 32-bit processes. They must also be aligned on a 64-bit boundary on 32-bit powerpc processes. This fixes the decoding of lseek(), procctl(), and wait6() arguments for 32-bit processes (both native and via freebsd32). Note that the ktrace system call return record only returns a single register, so the return value of lseek is always truncated to the low 32-bits for 32-bit processes.
* MFC r309676vangyzen2016-12-156-21/+35
| | | | | | | | | | | | | Export the whole thread name in kinfo_proc kinfo_proc::ki_tdname is three characters shorter than thread::td_name. Add a ki_moretdname field for these three extra characters. Add the new field to kinfo_proc32, as well. Update all in-tree consumers to read the new field and assemble the full name, except for lldb's HostThreadFreeBSD.cpp, which I will handle separately. Bump __FreeBSD_version. Sponsored by: Dell EMC
* MFC r309364 r309367 r309624vangyzen2016-12-132-35/+35
| | | | | | | | | | | | | | | locale: fix buffer management Also, handle signed and unsigned chars, and more gracefully handle invalid input. locale: enable more warnings; fix them Do not set WARNS, so it gets the current default of 6. Fix the warnings by sprinkling static, const, or strdup. Make some constant data tables const. Fix whitespace. Sponsored by: Dell EMC
OpenPOWER on IntegriCloud