summaryrefslogtreecommitdiffstats
path: root/usr.bin
Commit message (Collapse)AuthorAgeFilesLines
* sed: rewrite the main loop.pfg2016-05-241-49/+43
| | | | | | | | | | Rewrite the main loop of the "sed s/..." command, shortening it by ten lines and simplifying it by removing the switch statement implementing /g, /1, and /2 separately and repetitively. This will be needed to bring a fix from OpenBSD later. Obtained from: OpenBSD (schwarze CVS Rev. 1.18)
* MFV r299377:pfg2016-05-241-2/+2
| | | | | | | | sed.1: Correction for the case insensitive case. Use the capital I instead of the lowercase. Submitted by: Mikhail T.
* MFC r300005truckman2016-05-231-3/+3
| | | | | | | | | swprintf() and apparently wcsftime() want the their output buffer size specified in terms of the the number of wide characters and not sizeof(buffer). Reported by: Coverity CID: 1007605, 1007606
* MFC r299971truckman2016-05-231-1/+1
| | | | | | | | Fix off by one error that overflowed the rep_len array when doing the final NUL termination. Reported by: Coverity CID: 1007617
* MFC r299952truckman2016-05-231-1/+1
| | | | | | | Increase size of argv[] array to avoid running off the end. Reported by: Coverity CID: 1193819
* MFC r299591truckman2016-05-201-2/+2
| | | | | | | | | | Always return either a dynamically allocated string or NULL from expand(). Never return the name parameter, which could be a the buf[] buffer which is allocated on the stack by getdeadletter() and which would then be used after getdeadletter() has returned. Reported by: Coverity CID: 1199383
* MFC r299577, r299578, r299589truckman2016-05-201-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | r299577 | truckman | 2016-05-12 16:14:31 -0700 (Thu, 12 May 2016) | 15 lines Avoid Coverity NUL termination warning about strncpy() by using memcpy() instead. It's probably a bit more optimal in this case anyway. [1] The program logic leading up to the creation of the strncpy/memcpy destination buffer is a bit hairy. Add a call to assert() to make it clear what is happening here and detect any potential buffer overruns in the future. Check a couple syscall error returns. Ignore the EEXIST error from link() to preserve existing behavior. [2] [3] r299578 | truckman | 2016-05-12 16:37:58 -0700 (Thu, 12 May 2016) | 2 lines If fchdir() fails, call err() instead of warn(). r299589 | truckman | 2016-05-12 22:49:02 -0700 (Thu, 12 May 2016) | 4 lines Instead of ignoring the EEXIST from link(), unconditionally unlink the terget before calling link(). This should prevent links to an old copy of the file from being retained. Reported by: Coverity CID: 1009659 [1], 1009349 [2], 1009350 [3]
* MFC r299525truckman2016-05-201-3/+3
| | | | | | | | | Use strlcpy() instead of strncpy() when copying date and subj to ensure that these are properly NUL terminated since they are passed to printf(). Reported by: Coverity CID: 974770
* MFC r299524truckman2016-05-201-1/+1
| | | | | | | | | | | | | Use strlcpy() instead of strncpy() when copying the encoding value to ensure that the destination is NUL terminated. Length truncation of one more character should not be an issue since encoding values that long are not supported by libc. The destination string is treated as a NUL terminated string, but it is only passed to strcmp() for comparison to a set of shorter, fixed length strings, so this is not a serious problem. Reported by: Coverity CID: 974769
* MFC r275385 (by bapt):dim2016-05-1422-50/+217
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sync the svn template with the one from ports MFC r289180 (by peter): Update from svn-1.8.14 to 1.9.2. Formal release notes are available: https://subversion.apache.org/docs/release-notes/1.9.html Of particular note, the client checkout format has *not* changed so upgrades should *not* be required. When reading a repository (file:// or running as a local server), an improved fsfs version 7 is available with significant performance improvements. An optional upgrade is possible to use the new features. Without the upgrade, this is fully read/write compatible with the version 6 fsfs as in svn-1.8. MFC r298845: Update from subversion 1.9.2 to 1.9.4. This contains only bug fixes, no new features. The repository format is also unchanged from 1.9.2. Full list of changes between 1.9.4 and earlier versions: https://svn.apache.org/repos/asf/subversion/tags/1.9.4/CHANGES Note that the two security issues fixed in 1.9.4 (CVE-2016-2167 and CVE-2016-2168) do not affect the version of Subversion in the FreeBSD base system, since neither SASL nor Apache modules are enabled. MFC r298996: Re-sync the FreeBSD-specific Subversion template with the one from ports. Relnotes: yes
* MFC r298530:pfg2016-04-291-2/+2
| | | | | | | patch(1): avoid signed integer overflow when debugging. Integer i is used to index p_end of type LINENUM (actually long). Match the types.
* MFC: 298112bapt2016-04-231-6/+3
| | | | | | Directly set the O_CLOEXEC flags via the open(2) attributes Sponsored by: Essen Hackathon
* MFC 295930:jhb2016-04-216-72/+60
| | | | | | | | | | | | | Add support for displaying thread IDs to truss(1). - Consolidate duplicate code for printing the metadata at the start of each line into a shared function. - Add an -H option which will log the thread ID of the relevant thread for each event. While here, remove some extraneous calls to clock_gettime() in print_syscall() and print_syscall_ret(). The caller of print_syscall_ret() always updates the current thread's "after" time before it is called.
* MFC 295677,295678:jhb2016-04-213-24/+26
| | | | | | | Fetch the current thread and it's syscall state from the trussinfo object instead of passing some of that state as arguments to print_syscall() and print_syscallret(). This just makes the calls of these functions shorter and easier to read.
* MFC 297678: Enhance uuencode with a -r option to produce raw output.gahr2016-04-142-5/+17
| | | | | | | | | | This matches with uudecode's -r option to decode raw data without initial and final framing lines. $ echo Test | uuencode -mr - | uudecode -mr Test Approved by: cognet
* MFC r297476:brooks2016-04-131-2/+3
| | | | | | | Add a cross reference to ktrace(2). Obtained from: CheriBSD (9cb420d6b7f04c1b7d2006180b80932e5d3fe50e) Sponsored by: DARPA, AFRL
* MFC r278817: touch: Fix some subtle bugs related to NULL times fallback:jilles2016-04-101-28/+11
| | | | | | | | | | * Do not subvert vfs.timestamp_precision by reading the time and passing that to utimensat(). Instead, pass UTIME_NOW. A fallback to a NULL times pointer is no longer used. * Do not ignore -a/-m if the user has write access but does not own the file. Leave timestamps unchanged using UTIME_OMIT and do not fall back to a NULL times pointer (which would set both timestamps) if that fails.
* MFC r277645: cp,mv,touch: Set timestamps with nanosecond precision.jilles2016-04-101-41/+38
| | | | This uses utimensat().
* MFC r296526:bdrewery2016-03-281-3/+9
| | | | | | | Record command exit status in the typescript file when running simple commands. Relnotes: yes
* MFC r296525:bdrewery2016-03-151-9/+1
| | | | Just exit in the child if execve(2) fails.
* MFC r296524:bdrewery2016-03-151-4/+10
| | | | | | Filemon: Attach from the child to avoid racing with the parent attach. Relnotes: yes
* MFC r295977:bdrewery2016-03-122-0/+2
| | | | | Properly fix these builds by adding NO_WMISSING_VARIABLE_DECLARATIONS from r249657.
* MFC r295675:pfg2016-03-081-1/+1
| | | | | | Fix "naive" use of ftell(3). Secure coding practices, FIO19-C.
* MFC:dwmalone2016-03-061-1/+1
| | | | | | | | | r295924: Make sure that hash-based db files fsync befor closing/syncing. r295925: We no longer need O_SYNC pwd_mkd r295465: We no longer need O_SYNC on services_mkdb r295800: We no longer need O_SYNC on cap_mkdb This should improve the performance of building db files.
* MFC 295636,295637:jhb2016-02-242-1/+3
| | | | | | | | | | | | | | | | Fix issues with tracing Linux/i386 binaries. 295636: Sign extend the error value for failing Linux/i386 system calls. This restores the mapping of Linux errors to native FreeBSD errno values after the refactoring in r288424. 295637: Correct the ABI name for Linux/i386 binaries under FreeBSD/i386. This allows truss to work for these binaries again after r288424. Approved by: re (marius)
* MFC revisions 294861,294863dteske2016-02-012-5/+14
| | | | | | | r294861: Add `-k' for dpv(3) `keep_tite' config option r294863: Bump copyright Approved by: re (gjb)
* MFC r289797: dpv(1) merged to stable/10 before release/10.2.0dteske2016-01-271-3/+3
|
* MFC r294347asomers2016-01-261-7/+4
| | | | | | | | | Fix usr.bin.truncate.truncate_test.bad_truncate with ZFS /tmp. The bad_truncate test sets the uimmutable flag to produce an error in truncate, but that flag isn't supported by ZFS. If /tmp is on a ZFS filesystem, the test will fail. Change it to use readonly permissions and an unpriveleged user instead.
* MFH (r290742): don't index /var/db/freebsd-updatedes2016-01-262-2/+2
|
* MFC r289453:trasz2016-01-232-7/+89
| | | | | | | Add -w flag to iscsictl(8) utility, to make it wait for successfull session establishment. Scripting is kind of hard without it. Sponsored by: The FreeBSD Foundation
* MFC r288083, r288138: elfdump: report MIPS-specific ELF section typesemaste2016-01-201-0/+2
|
* MFC r293190: MFV r293125: less v481.delphij2016-01-181-0/+5
| | | | Relnotes: yes
* MFC r289873:tuexen2016-01-185-2/+385
| | | | | | Add support to systat to display SCTP statistics. MFC r289874: Bump date in man page.
* MFC r287281:tuexen2016-01-171-3/+1
| | | | | Report CLOSED as state for bound sockets for consistency with netstat and the way TCP is handled.
* MFC r287182:tuexen2016-01-172-7/+63
| | | | Add SCTP support.
* MFC r287179:tuexen2016-01-171-3/+2
| | | | Remove a variable which is set but never used.
* MFH (r287178): print status on first line, not last.des2016-01-171-11/+12
| | | | This revision has previously been (incorrectly) recorded as merged.
* MFC r285651:tuexen2016-01-171-2/+2
| | | | | | | Move assignments around to avoid a false-positive uninitialized variable warning which broke the sparc64 build. This is work from des@ and MFCing was discussed with him.
* MFC r285630:tuexen2016-01-172-8/+33
| | | | | | | Add a -s option which adds a column listing the connection state if applicable (currently only for TCP). This is work from des@ and MFCing was discussed with him.
* MFH (r280630): remove all traces of SSLv2 supportdes2016-01-162-21/+11
| | | | | | | | | | | MFH (r285141): remove unused variable MFH (r288217): correctly check return value from getaddrinfo(3) MFH (r289419): fix bugs in HTTPS tunnelling MFH (r289420): use fopen()'s "e" mode instead of fcntl for close-on-exec MFH (r291453, r291461): use .netrc for http servers and proxies MFH (r292330, r292332): reset bufpos to 0 after refilling in chunked mode PR: 194483 199801 193740 204771
* MFC r287284:tuexen2016-01-161-7/+16
| | | | Use the userland exported states and handle them completely.
* MFC r283430:dchagin2016-01-163-19/+51
| | | | Teach kdump to understand both linux emulation.
* Now that futimens() and utimensat() have been merged, add decoding forjhb2016-01-142-1/+37
| | | | | those system calls that was left out of the previous merge of r286381 in r290052.
* MFC r293312:garga2016-01-141-1/+1
| | | | | | | | | | | | | Make cap_mkdb and services_mkdb file operations sync Similar fix was done for passwd and group operations in r285050. When a temporary file is created and then renamed to replace official file there are no checks to make sure data was written to disk and if a power cycle happens at this time, system can end up with a 0 length file Approved by: bapt Sponsored by: Netgate Differential Revision: https://reviews.freebsd.org/D2982
* MFC r292950:dim2016-01-122-1/+7
| | | | | | Drop the clang patch which adds recognition of 'CC' suffixes as aliases for --driver-mode=g++, since this was never upstreamed. For backwards compatibility, add a wrapper shell script.
* MFC: r285552allanjude2016-01-127-10/+44
| | | | | | | | | | | | | | | | | | | Use strtonum(3) instead of atoi(3) MFC: r286289 Introduce -P0, creating as many concurrent processes as possible Relnotes: yes MFC: r286461 Fix regression in xargs -Px, add more regression tests MFC: r287004 MFC: r287005 Fix the racy xargs -P0 -n2 test added in r286289 PR: 199976 Submitted by: Nikolai Lifanov <lifanov@mail.lifanov.com>
* MFC r290408:trasz2016-01-111-1/+1
| | | | | | Make rctl(8) use more reasonable buffer size for retrieving the rules. Sponsored by: The FreeBSD Foundation
* MFC r290404:trasz2016-01-111-5/+5
| | | | | | Fix markup in rctl(8) - the 'rule' or 'filter' arguments are not optional. Sponsored by: The FreeBSD Foundation
* Unbreak stable/10 buildworlds on arm/arm, mips/mips, mips/mips64, mips/mipsel,ngie2016-01-101-41/+0
| | | | | | | | | | | | | | | mips/mipsn32, powerpc/powerpc, powerpc/powerpc64, sparc64/sparc64 with gcc after r293307 (some of the BURN_BRIDGES code) MFC after: 3 days Pointyhat to: markj Sponsored by: EMC / Isilon Storage Division MFC r279017: r279017 (by glebius): Burn bridges to FreeBSD 7.x IGMP stats.
* MFC r277610 (by jillies):dchagin2016-01-091-0/+1
| | | | Add futimens and utimensat system calls.
OpenPOWER on IntegriCloud