summaryrefslogtreecommitdiffstats
path: root/usr.bin
Commit message (Collapse)AuthorAgeFilesLines
* 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
* MFC r309232-309234:delphij2016-12-122-14/+2
| | | | | | | | r309232: Fix an obvious typo. r309233: Eliminate variables that are computed, assigned but never used. r309234: pages and psize are always assigned, so there is no need to initialize them as zero.
* MFC r309184:delphij2016-12-101-22/+21
| | | | style(9) indent changes, no actual code change.
* MFC r298183,r304226:ngie2016-12-031-3/+3
| | | | | | | | | | | | | r298183 (by araujo): Use NULL for pointers. strrchr(3) will return NULL if the character does not appears in the string. r304226 (by araujo): Use nitems() from sys/param.h.
* MFC r308340vangyzen2016-11-301-1/+2
| | | | | | | | ncal: fix a reference to an out-of-scope stack buffer PR: 214237 Submitted by: Jonathan de Boyne Pollard Sponsored by: Dell EMC
* MFC r308824vangyzen2016-11-301-2/+32
| | | | | | | | | | locale: fix display of "grouping" and "mon_grouping" values The "grouping" and "mon_grouping" values are arrays of one-byte integers, not arrays of ASCII characters. Display them in a format similar to GNU and MacOS. Sponsored by: Dell EMC
* MFC r308808, r308809: Lookup locale when print all keywords as well.ume2016-11-261-1/+2
|
* MFC r297207:trasz2016-11-042-6/+37
| | | | | | | | | Make the autofs(5) -hosts map more robust, primarily to make it correctly handle NFS shares containing whitespace. This also adds the -E parameter to showmount(8). PR: 207596 Differential Revision: https://reviews.freebsd.org/D5649
* MFC r307861:mm2016-10-313-3/+3
| | | | | | | Update libarchive to 3.2.2 Most of the post-3.2.1 fixes have already been merged. This update contains just the version bump and some fixes to the test framework.
* MFC 303002: Include process IDs in core dumps.jhb2016-10-281-0/+1
| | | | | | | | | When threads were added to the kernel, the pr_pid member of the NT_PRSTATUS note was repurposed to store LWP IDs instead of process IDs. However, the process ID was no longer recorded in core dumps. This change adds a pr_pid field to prpsinfo (NT_PRSINFO). Rather than bumping the prpsinfo version number, note parsers can use the note's payload size to determine if pr_pid is present.
* MFC r307520: elfdump: correct DT_AUXILIARY / DT_USED / DT_FILTER definitionsemaste2016-10-241-3/+3
| | | | | | r109332 introduced these three as DT_SUNW_*. Update to the correct names already used elsewhere in FreeBSD and the Sun "Linker and Libraries Guide"
* Spelling, title.grog2016-10-221-1/+1
|
* MFC r306560, r306561:pfg2016-10-091-4/+3
| | | | | | | | | patch(1): make some macros look boolean. Minor cleanup inspired by a new patch(1) variant in schily tools. For reference: https://sourceforge.net/p/schillix-on/
* MFC 302859: Include command line arguments in core dump process info.jhb2016-10-061-1/+15
| | | | | Fill in pr_psargs in the NT_PRSINFO ELF core dump note with command line arguments.
* MFC 299458: Fix buffer overrun in gcore(1) NT_PRPSINFOjhb2016-10-061-2/+2
| | | | | | | | | Use size of destination buffer, rather than a constant that may or may not correspond to the source buffer, to restrict the length of copied strings. In particular, pr_fname has 16+1 characters but MAXCOMLEN is 18+1. Use strlcpy instead of strncpy to ensure the result is nul-terminated. This seems to be what is expected of these fields.
* MFC r274925: misc mdoc fixes.pluknet2016-09-271-16/+14
|
* MFC r306131asomers2016-09-261-1/+1
| | | | Update mkimg(1) author's contact info
* MFC bspatch Capsicumization and improvementsemaste2016-09-221-75/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r304691: bspatch: apply style(9) Make style changes (and trivial refactoring of open calls) now in order to reduce noise in diffs for future capsicum changes. r304807 (allanjude): Capsicumize bspatch Move all of the fopen() and open() calls to the top of main() Restrict each FD to least privilege (read/seek only, write only, etc) cap_enter(), and make all except the output FD read/seek only. r304821: bspatch: remove output file in the case of error r305486: bspatch: add sanity checks on sizes to avoid integer overflow Note that this introduces an explicit 2GB limit, but this was already implicit in variable and function argument types. This is based on the "non-cryptanalytic attacks against freebsd update components" anonymous gist. Further refinement is planned. r305737: bspatch: remove superfluous newlines from errx strings r305822: bspatch: use #define for header size instead of magic number r306026: bspatch: Remove backwards-compatibility sys/capability.h support bspatch previously included sys/capability.h or sys/capsicum.h based on __FreeBSD_version, as FreeBSD is the upstream for bsdiff and we may see this file incorporated into other third-party software. The Capsicum header is now installed as sys/capsicum.h in stable/10 and FreeBSD 10.3, so we can just use sys/capsicum.h and simplify the logic.
* MFC r264823 (ed): Make usage printing more consistent with other tools.emaste2016-09-222-4/+22
| | | | | | | | | - Introduce a separate usage() function. - Don't use argv[0]. Directly name the application, as we do elsewhere. - Don't prepend the application name. - Don't print two newlines. Also apply the unnecessary semicolon cleanup from r298089
* MFC r305077:dim2016-09-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Squelch clang 3.9.0 warnings about BASE (which is 32768) being converted to -32768 when it is used as an argument to mp_itom(), in both libtelnet and newkey. This code has been wrong since r26238 (!), so after almost 20 years it is rather useless to try to correct it. MFC r305086: Fix warnings in telnet about invalid constant conversions, e.g.: contrib/telnet/telnet/commands.c:2914:13: error: implicit conversion from 'int' to 'char' changes value from 137 to -119 [-Werror,-Wconstant-conversion] *lsrp++ = IPOPT_SSRR; ~ ^~~~~~~~~~ /usr/include/netinet/ip.h:152:21: note: expanded from macro 'IPOPT_SSRR' #define IPOPT_SSRR 137 /* strict source route */ ^~~ contrib/telnet/telnet/commands.c:2916:13: error: implicit conversion from 'int' to 'char' changes value from 131 to -125 [-Werror,-Wconstant-conversion] *lsrp++ = IPOPT_LSRR; ~ ^~~~~~~~~~ /usr/include/netinet/ip.h:148:21: note: expanded from macro 'IPOPT_LSRR' #define IPOPT_LSRR 131 /* loose source route */ ^~~ Use unsigned char buffers instead.
* MFstable/11 r304951:ngie2016-09-021-1/+0
| | | | | | | | | | | | | | MFC r303804: Fix building usr.bin/tar/tests with PIE symbol building enabled by removing CFLAGS+= -static `CFLAGS+= -static` was a carryover from pre-r289195 with usr.bin/tar/test/Makefile that should have been specified in LDFLAGS There doesn't seem to be an apparent need for static compilation of the test binaries. Obtained-from: opBSD (418a491eed20d2603ddd1f1bd92c2c0d95094002)
* MFstable/11 r304949,r305226:ngie2016-09-012-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r304949: MFC r303830,r304693,r304694,r304698: r303830: Remove vestigal references to __alpha__ Replace alpha reference in getconf(1) with amd64 [*] PR: 211300 [*] r304693: Clean up trailing whitespace r304694: Add `MIN_HOLE_SIZE` pathconf(2) support to getconf This allows shell programs to programmatically determine whether or not a filesystem supports sparse files r304698: Add support for _PC_ACL_NFS4 as TRUSTEDBSD_ACL_NFS4 The TRUSTEDBSD prefix was chosen for consistency with the other related `_PC_ACL*` prefixed variables. r305226: MFC r304809: Add non-TRUSTEDBSD prefixed knobs for the _PC_ACL* and {CAP,INF,MAC}_PRESENT knobs It's not necessarily intuitive that the variables to query contain TRUSTEDBSD in the prefix. Add non-TRUSTEDBSD prefixed knobs for querying things like "_PC_ACL_NFS4". Relnotes: yes
* MFC r303929,r303930,r303931,r303932,r303933:bdrewery2016-08-191-8/+39
| | | | | | | | | | | | | r303929: Fix -S with -b not atomically updating the destination file. r303930: Support -v for -l. r303931: Fix -S with -l not being atomic. r303932: Fix -b failure not restoring flags on the destination file. r303933: Squelch a false-positive Clang static analyzer warning.
* MFstable/11 r304208:ngie2016-08-162-3/+3
| | | | | | | | | | MFC r303830: Remove vestigal references to __alpha__ Replace alpha reference in getconf(1) with amd64 [*] PR: 211300 [*]
* MFC r303934,r303937,r303942:bdrewery2016-08-151-0/+2
| | | | | | | | | r303934: Support rmdir(2). r303937: Use proper argument length for rmdir(2) for r303934. r303942: Fix sorting in r303934.
* MFC r270132 (by gabor):dim2016-08-093-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Do not look for more matching lines if -L is specified Submitted by: eadler (based on) MFC r296799 (by ian): Fix a bug in bsdgrep that caused the program to hang in a tight loop for some combinations of command line options and search patterns. The code was examining regexec flags looking for a regcomp flag value. The fix is to look in the struct field where the decoded regcomp flag was stored when the regex was compiled. With this fix, it's possible to build WITHOUT_GNU_GREP_COMPAT and WITH_BSDGREP and have a usable GPL-free grep (which of course lacks gnugrep extensions). It now passes the kyua tests except for one test that requires the -z/--null-data gnu extension, and one test involving outputting context lines across multiple files which appears to sometimes output an extra delimiter line ("--") between matches (a rather obscure failure of a rather obscure feature, so bsdgrep should be generally usable now). MFC r303676: Fix a segfault in bsdgrep when parsing the invalid extended regexps "?" or "+" (these are invalid, because there is no preceding operand). When bsdgrep attempts to emulate GNU grep in discarding and ignoring the invalid ? or + operators, some later logic in tre_compile_fast() goes beyond the end of the buffer, leading to a crash. Fix this by bailing out, and reporting a bad pattern instead. Reported by: Steve Kargl
* MFC r288306mr2016-08-027-3/+262
| | | | Add support to systat to display zfs arc cache status/info
* Direct commit of adapted r303581.ache2016-07-312-2/+2
| | | | Fix date.
* MFC r302911:pfg2016-07-252-2/+6
| | | | | | mail(1): Avoid closing negative file descriptors. CID: 1008105, 1008106
* Fix bspatch heap overflow vulnerability.delphij2016-07-251-0/+4
| | | | | | Obtained from: Chromium Reported by: Lu Tung-Pin Security: FreeBSD-SA-16:25.bspatch
* MFC r301974: ar: enable reproducible output by default when invoked as 'ar -s'emaste2016-07-252-3/+9
| | | | | | | | | ar output is already deterministic by default for ar -q and ar -r, and when invoked as ranlib. Make ar -s equivalent to ranlib and enable deterministic output by default in that case too. PR: 210330 Sponsored by: The FreeBSD Foundation
* MFC r302542:delphij2016-07-251-2/+2
| | | | Use _PATH_DEVNULL instead of hardcoding.
* MFC: r302827ache2016-07-221-3/+4
| | | | | Optimize [Cc]flag case: don't repeatedly add the last character of string2 to squeeze cset when string2 reach its EOS state.
* MFC: r302826ache2016-07-221-0/+4
| | | | Document incomplete support of [=equiv=] and collation for ranges.
* MFC: merge in all new features and improvements into mkuzip(8) from current,sobomax2016-07-2022-113/+1658
| | | | | | | | | | | | | | which includes: o LZMA compression; o block de-duplication; o performance improvements; o multi-thread support. This includes the following revisions: r295943,r296626,r296628,r296810,r298504,r298505,r298577 Suggested by: emaste
* MFC r302770:kib2016-07-201-0/+25
| | | | Trace timeval parameters to the getitimer(2) and setitimer(2) syscalls.
OpenPOWER on IntegriCloud