summaryrefslogtreecommitdiffstats
path: root/usr.bin
Commit message (Collapse)AuthorAgeFilesLines
* whois(1): Fix potential double-close and logic mistakescem2016-05-111-3/+9
| | | | | | | | | | | | | | Close the fd the poll error was detected on, rather than the last opened fd, to fix the double-close. Use -1 to make it explict which int variables no longer own socket file descriptors. Actually shrink, rather than grow, the poll timeout to match comment. Reported by: Coverity CID: 1304860, 1305616 Sponsored by: EMC / Isilon Storage Division
* whois(1): Pull out async multiple host connection code into a routinecem2016-05-111-12/+22
| | | | | | | | | | This logic was added to the whois() function in r281959, but could easily be its own routine. In this case, I think the abstraction makes both functions easier to reason about. This precedes some Coverity-suggested cleanup. Sponsored by: EMC / Isilon Storage Division
* Fix buffer overrun in gcore(1) NT_PRPSINFOcem2016-05-111-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. Reported by: Coverity CIDs: 1011302, 1011378 Sponsored by: EMC / Isilon Storage Division
* sdiff(1): Fix potential NULL deref in cleanup pathcem2016-05-101-1/+2
| | | | | | | | | In the presence of the --diff-pid argument, it is possible for 'diffpipe' to be NULL. Only fclose() it if it was initialized. Reported by: Coverity CID: 1355183 Sponsored by: EMC / Isilon Storage Division
* sed.1: Correction for the case insensitive case.pfg2016-05-101-2/+2
| | | | | | | | Use the capital I instead of the lowercase. Submitted by: Mikhail T. PR: 195929 MFC after: 2 weeks
* Rename getline with get_line to avoid collision with getline(3)bapt2016-05-101-5/+5
| | | | | When getline(3) in 2009 was added a _WITH_GETLINE guard has also been added. This rename is made in preparation for the removal of this guard
* Rename getline with get_line to avoid collision with getline(3)bapt2016-05-102-8/+8
| | | | | When getline(3) in 2009 was added a _WITH_GETLINE guard has also been added. This rename is made in preparation for the removal of this guard
* Rename getline with get_line to avoid collision with getline(3)bapt2016-05-107-18/+18
| | | | | | | When getline(3) in 2009 was added a _WITH_GETLINE guard has also been added. This rename is made in preparation for the removal of this guard Obtained from: NetBSD
* Revert r299279:pfg2016-05-101-1/+6
| | | | | | | | | | | | | | | | | Simplify redundant malloc'ing in sed -e. It is causing havoc in the ports tree: ===> Configuring for wxsvg-1.5.7 sed: 1: "/gcc_dir=\\`/s/gcc /$CC /": bad flag in substitute command: '/' *** Error code 1 ===> Patching for vips-8.3.1 sed: 1: "1s|^#![[:space:]]*/usr/ ...": bad flag in substitute command: 's' *** Error code 1 PR: 195929 Reported by: danilo
* DIRDEPS_BUILD: Run the staged bootstrap-tools version of build-tools.bdrewery2016-05-092-2/+2
| | | | | | This avoids running target binaries. Sponsored by: EMC / Isilon Storage Division
* Rationalize license numberingbapt2016-05-092-2/+2
|
* Some style(9) fixesbapt2016-05-091-11/+7
| | | | | | No functional changes Obtained from: OpenBSD
* Add myself (woodsb02) to the calendar.freebsd filewoodsb022016-05-091-0/+1
| | | | | Approved by: adamw (mentor) Differential Revision: https://reviews.freebsd.org/D6276
* Simplify redundant malloc'ing in sed -e.pfg2016-05-091-6/+1
| | | | | | | | | | | | | | When encountering an -e argument, sed currently mallocs a string to COPY the optarg -- with '\n' appended. The appendage does not seem necessary -- indeed, the same call to add_compunit processing the sole command (given without -e) passes the *argv verbatim: without making a copy, and without appending newline. This matches what is done in other BSDs. Submitted by: Mikhail T. PR: 195929 MFC after: 2 weeks
* install: Add some tests.jilles2016-05-083-0/+349
|
* Only one program is build in usr.bin/sdiff use the right includebapt2016-05-071-1/+1
|
* Revert r299218 VISUAL is actually a perfecly valid env to specify an editorbapt2016-05-072-3/+20
|
* Only use EDITOR as a variable to specify which text editor to usebapt2016-05-072-20/+3
|
* Directly call the editor if needed instead of spawning /bin/shbapt2016-05-071-8/+4
|
* Replace fparseln(3) with getline(3)bapt2016-05-072-9/+11
| | | | It removes a dependency on libutil.
* sed: rewrite the main loop.pfg2016-05-071-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) MFC after: 3 weeks
* Add the "-r" flag to iscsictl(8).trasz2016-05-062-4/+25
| | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Document the "Protocol" field of iscsi.conf(5).trasz2016-05-061-1/+9
| | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installedngie2016-05-0485-1098/+860
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | after r298107 Summary of changes: - Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that namespacing is kept with FILES appropriately, and that this shouldn't need to be repeated if the namespace changes -- only the definition of PACKAGE needs to be changed - Allow PACKAGE to be overridden by callers instead of forcing it to always be `tests`. In the event we get to the point where things can be split up enough in the base system, it would make more sense to group the tests with the blocks they're a part of, e.g. byacc with byacc-tests, etc - Remove PACKAGE definitions where possible, i.e. where FILES wasn't used previously. - Remove unnecessary TESTSPACKAGE definitions; this has been elided into bsd.tests.mk - Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES; ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk. - Fix installation of files under data/ subdirectories in lib/libc/tests/hash and lib/libc/tests/net/getaddrinfo - Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup) Document the proposed changes in share/examples/tests/tests/... via examples so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of replacing FILES. share/mk/bsd.README didn't seem like the appropriate method of communicating that info. MFC after: never probably X-MFC with: r298107 PR: 209114 Relnotes: yes Tested with: buildworld, installworld, checkworld; buildworld, packageworld Sponsored by: EMC / Isilon Storage Division
* DIRDEPS_BUILD: Update dependencies.bdrewery2016-05-041-0/+1
| | | | Sponsored by: EMC / Isilon Storage Division
* Print the fchmodat mode in human readable fashionbapt2016-05-031-0/+1
| | | | MFC after: 1 week
* fgetc returns an int not a char.bz2016-05-021-2/+1
| | | | | Found by: powerpc builds failing due to comparing with EOF raised: "comparison is always false due to limited range of data type"
* usr.bin: minor spelling fixes on comments.pfg2016-05-016-6/+6
| | | | No functional change.
* localedef(1): minor spelling fixes on comments.pfg2016-05-014-4/+4
| | | | No functional change.
* Remove useless calls to basename().ed2016-05-011-3/+2
| | | | | | | | | | | | | | There are a couple of places in the source three where we call basename() on constant strings. This is bad, because the prototype standardized by POSIX allows the implementation to use its argument as a storage buffer. This change eliminates some of these unportable calls to basename() in cases where it was only added for cosmetical reasons, namely to trim argv[0]. There's nothing wrong with setting argv[0] to the full path. Reviewed by: jilles Differential Revision: https://reviews.freebsd.org/D6093
* When checking for binary file, check if ch is not EOF only ch actually gotbapt2016-04-301-1/+3
| | | | | | a value assigned Reported by: pfg
* Update from subversion 1.9.2 to 1.9.4.dim2016-04-302-4/+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. Relnotes: yes MFC after: 2 weeks
* import sdiff(1) from GSoC 2012bapt2016-04-2936-0/+3357
| | | | | | | | | | | | | | | | | | | | | | | | | | | Import sdiff(1) from the diff version written by Raymond Lai, improved during GSoC 2012 by Jesse Hagewood. Compared to the version done in during that summer of code: - Remove the zlib frontend: zsdiff - Compatible output (column size and separators) with GNU sdiff Compared to GNU sdiff in ports: - The only difference is padding using spaces vs tabs Compared to OpenBSD and NetBSD import: - Implement missing options (including long options) from GNU sdiff - Improved support for the edition mode (signal handling) - Output visually compatible with GNU sdiff: size of columns While here import regression tests from NetBSD adapted to fit the output as expected by GNU sdiff Reviewed by: emaste (in part) Obtained from: OpenBSD, NetBSD, GSoC 2012 Relnotes: yes Differential Revision: https://reviews.freebsd.org/D5981 Differential Revision: https://reviews.freebsd.org/D6032 (diff with NetBSD version) Differential Revision: https://reviews.freebsd.org/D6033 (diff with OpenBSD version)
* Fix including Kyuafile in packaged base system.gjb2016-04-291-1/+2
| | | | | | | | | | | | Fix a related typo while here. Note, this change results in the Kyuafile inclusion in the runtime package, which needs to be fixed, however addresses the PR as far as I can tell in my tests. PR: 209114 Submitted by: ngie Sponsored by: The FreeBSD Foundation
* Small typo.pfg2016-04-281-1/+1
|
* Use MIN() macro from sys/param.h.araujo2016-04-271-1/+1
| | | | MFC after: 2 weeks.
* Use MIN() macro from sys/param.h.araujo2016-04-271-1/+1
| | | | MFC after: 2 weeks.
* Use macro MIN() from sys/param.h.araujo2016-04-271-1/+1
| | | | MFC after: 2 weeks.
* Use MIN() macro from sys/param.h.araujo2016-04-271-2/+2
| | | | MFC after: 2 weeks.
* Use MIN() instead of MAX() as the previous syntax was wrote in a weird andaraujo2016-04-261-1/+1
| | | | | | | confused way: "prec > 9 ? 9 : prec". Submitted by: pfg, ngie and luke <luke.tw@gmail.com> MFC after: 2 weeks.
* Example RIPE whois query with options and spaces.fanf2016-04-251-6/+26
| | | | | Since it is used in the example, mention the -- option in the synopsis even though it is a universal standard, and tweak to fit it on one line.
* Try to make gcc builds happy again by removing a redundant declaration.bz2016-04-251-1/+0
|
* Adjust a type from r267490.pfg2016-04-241-1/+1
| | | | | Independent of the maximum length, the return type for strnlen(3) is always size_t.
* patch(1): avoid signed integer overflow when debugging.pfg2016-04-241-2/+2
| | | | | | | | Integer i is used to index p_end of type LINENUM (actually long). Match the types. MFC after: 5 days
* GC duplicate define.sobomax2016-04-231-2/+0
|
* Improve performance in a few key areas:sobomax2016-04-2321-192/+1037
| | | | | | | | | | | | | | | | | | | | o Split the compression across several worker threads. By default, "several" matches number of CPUs, capped at 24 for sanity when running on a very big hardwares. Provide option to set that number manually; o Fix bug inherited from the mkulzma (R.I.P) which degraded already slow LZMA compression even further by calling function to release compression state after processing each block. It is neither documented as required nor actually required by the LZMA library. This caused spree of system calls to release memory and then map it again for every block. LZMA compression is more than 2x faster after this change alone; o Record time it takes to do compression and report throughput achieved. o Add simple first-level 256 entry hash table for de-dup code, so it's not becoming a bottleneck at big files.
* Use roundup2() macro from sys/param.h.araujo2016-04-221-1/+1
| | | | MFC after: 2 weeks.
* Use MIN() macro from sys/param.h.araujo2016-04-221-1/+1
| | | | MFC after: 2 weeks.
* Use macro MAX() from sys/param.h.araujo2016-04-221-1/+1
| | | | MFC after: 2 weeks.
* Use macro MAX() from sys/param.h.araujo2016-04-221-1/+1
| | | | MFC after: 2 weeks.
OpenPOWER on IntegriCloud