aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
Commit message (Collapse)AuthorAgeFilesLines
* bspatch: remove output file in the case of errorEd Maste2016-08-251-5/+32
| | | | | | | | | Reviewed by: oshogbo Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7644 Notes: svn path=/head/; revision=304821
* Add non-TRUSTEDBSD prefixed knobs for the _PC_ACL* and {CAP,INF,MAC}_PRESENT ↵Enji Cooper2016-08-251-0/+6
| | | | | | | | | | | | | | | | | 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". MFC after: 1 week Relnotes: yes Reviewed by: wollman Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D7618 Notes: svn path=/head/; revision=304809
* Capsicumize bspatchAllan Jude2016-08-251-12/+52
| | | | | | | | | | | | | | | | | | 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. Reviewed by: emaste, ed, oshogbo, delphij Approved by: so MFC after: 3 days Relnotes: yes Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D7358 Notes: svn path=/head/; revision=304807
* Make the iSCSI parameter negotiation more flexible.Navdeep Parhar2016-08-251-25/+29
| | | | | | | | | | | | | | | | | | | | | | Decouple the send and receive limits on the amount of data in a single iSCSI PDU. MaxRecvDataSegmentLength is declarative, not negotiated, and is direction-specific so there is no reason for both ends to limit themselves to the same min(initiator, target) value in both directions. Allow iSCSI drivers to report their send, receive, first burst, and max burst limits explicitly instead of using hardcoded values or trying to derive all of them from the receive limit (which was the only limit reported by the drivers prior to this change). Display the send and receive limits separately in the userspace iSCSI utilities. Reviewed by: jpaetzel@ (earlier version), trasz@ Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D7279 Notes: svn path=/head/; revision=304787
* Add support for _PC_ACL_NFS4 as TRUSTEDBSD_ACL_NFS4Enji Cooper2016-08-231-0/+1
| | | | | | | | | | | The TRUSTEDBSD prefix was chosen for consistency with the other related `_PC_ACL*` prefixed variables. MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=304698
* Add `MIN_HOLE_SIZE` pathconf(2) support to getconfEnji Cooper2016-08-231-0/+1
| | | | | | | | | | | This allows shell programs to programmatically determine whether or not a filesystem supports sparse files MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=304694
* Clean up trailing whitespaceEnji Cooper2016-08-231-2/+2
| | | | | | | | MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=304693
* bspatch: apply style(9)Ed Maste2016-08-231-52/+60
| | | | | | | | | | | | | Make style changes (and trivial refactoring of open calls) now in order to reduce noise in diffs for future capsicum changes. Reviewed by: oshogbo No objection: cperciva Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7610 Notes: svn path=/head/; revision=304691
* indent(1): have the memset invocation somewhat more canonical.Pedro F. Giffuni2016-08-231-1/+1
| | | | | | | | | While correct, the previous invocation was somewhat more error prone. Pointed out by: delphij, bde Notes: svn path=/head/; revision=304686
* indent(1): remove dead assignments.Pedro F. Giffuni2016-08-232-2/+1
| | | | | | | Taken from: Piotr Sephaniak Notes: svn path=/head/; revision=304684
* indent(1): Fix off-by-one in control flow leading dead code.Pedro F. Giffuni2016-08-231-1/+1
| | | | | | | | | | | | | | | | | Coverity correctly reported that it's impossible for /comparison/ to be 0 here, because the only way for the for loop to end is by /comparison/ being < 0. Fortunately the consequences of this bug weren't severe; for duplicated entries in the typedef names file it would unnecessarily duplicate strings with strdup(), but pointers to those would replace existing ones. So this was a memory leak at worst. CID: 1361477 Obtained from: Piotr Stephaniak Notes: svn path=/head/; revision=304653
* indent(1): add some comments to quiet down Coverity.Pedro F. Giffuni2016-08-232-1/+3
| | | | | | | | | | | Hopefully adding comments should help explain the code to both static checkers and humans. CID: 976543, 976544, 976545 Obtained from: Piotr Stephaniak Notes: svn path=/head/; revision=304651
* indent(1): Fix memory leaks pointed out by clang-analyzer.Pedro F. Giffuni2016-08-232-15/+11
| | | | | | | | | | | | Shift the responsibility of allocating memory for the string duplicate from the caller (set_option, add_typedefs_from_file) to the callee (add_typename) as it has more knowledge about when the duplication actually needs to occur. Taken from: Piotr Stefaniak Notes: svn path=/head/; revision=304650
* Import the new automatically generated system call table for CloudABI.Ed Schouten2016-08-191-2/+0
| | | | | | | | | | | | | | | | | | Now that we've switched over to using the vDSO on CloudABI, it becomes a lot easier for us to phase out old features. System call numbering is no longer something that's part of the ABI. It's fully based on names. As long as the numbering used by the kernel and the vDSO is consistent (which it always is), it's all right. Let's put this to the test by removing a system call (thread_tcb_set()) that's already unused for quite some time now, but was only left intact to serve as a placeholder. Sync in the new system call table that uses alphabetic sorting of system calls. Obtained from: https://github.com/NuxiNL/cloudabi Notes: svn path=/head/; revision=304478
* Fix TAB replaced with spaces in prev. commit.Andrey A. Chernov2016-08-181-1/+1
| | | | Notes: svn path=/head/; revision=304374
* Fix the output for scope statistics.Michael Tuexen2016-08-171-2/+2
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=304295
* Use names for SCTP and UDPLite when reporting the input histogram.Michael Tuexen2016-08-171-2/+2
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=304292
* Use nitems() from sys/param.h.Marcelo Araujo2016-08-161-2/+2
| | | | | | | MFC after: 2 weeks. Notes: svn path=/head/; revision=304226
* Use nitems() from sys/param.h.Marcelo Araujo2016-08-161-3/+3
| | | | | | | MFC after: 2 weeks. Notes: svn path=/head/; revision=304225
* tty: Use proper definition of exit status code and stdin macroSofian Brabez2016-08-161-3/+4
| | | | | | | | Reviewed by: bapt, bdrewery Differential Revision: https://reviews.freebsd.org/D6828 Notes: svn path=/head/; revision=304220
* Fix r304026 so that it builds for gcc.Rick Macklem2016-08-161-1/+2
| | | | | | | | | Reported by: np Tested by: np MFC after: 1 month Notes: svn path=/head/; revision=304194
* nfsstat depends on libdevstat as of r304058.Mark Johnston2016-08-141-0/+2
| | | | | | | X-MFC-With: r304058 Notes: svn path=/head/; revision=304066
* Correct date ov VJ day (1945-08-15, about 03:00 UTC).Greg Lehey2016-08-131-1/+1
| | | | Notes: svn path=/head/; revision=304065
* Update the man page to descibe the "-d" option added by r304058.Rick Macklem2016-08-131-3/+26
| | | | | | | | | | | | | This is a content change. Submitted by: will (earlier version) Reviewed by: ken, wblock MFC after: 1 month Relnotes: yes Differential Revision: https://reviews.freebsd.org/D1626 Notes: svn path=/head/; revision=304059
* Update nfsstat.c to use the new kernel nfsstat structure andRick Macklem2016-08-131-268/+501
| | | | | | | | | | | | | | add the new "-d" flag from D1626. The man page will be updated in a subsequent commit. Submitted by: will (earlier version) Reviewed by: ken MFC after: 1 month Relnotes: yes Differential Revision: https://reviews.freebsd.org/D1626 Notes: svn path=/head/; revision=304058
* Remove unused prototypes.Konstantin Belousov2016-08-121-2/+0
| | | | | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=303990
* Remove files unused after pulling system call names from libsysdecode.John Baldwin2016-08-113-43/+0
| | | | Notes: svn path=/head/; revision=303946
* Fix sorting in r303934.Bryan Drewery2016-08-101-2/+2
| | | | | | | | | | Reported by: jhb X-MFC-With: r303934 MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=303942
* Use proper argument length for rmdir(2) for r303934.Bryan Drewery2016-08-101-2/+2
| | | | | | | | | | Reported by: kib X-MFC-With: r303934 MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=303937
* Support rmdir(2).Bryan Drewery2016-08-101-0/+2
| | | | | | | | MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=303934
* Squelch a false-positive Clang static analyzer warning.Bryan Drewery2016-08-101-0/+1
| | | | | | | | MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=303933
* Fix -b failure not restoring flags on the destination file.Bryan Drewery2016-08-101-2/+16
| | | | | | | | MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=303932
* Fix -S with -l not being atomic.Bryan Drewery2016-08-101-3/+0
| | | | | | | | | | | | | It was unlinking the target even though it uses rename(2) which already effectively does that. -S is intended to not unlink(2) the target first. MFC after: 1 week Reviewed by: jhb Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D7452 Notes: svn path=/head/; revision=303931
* Support -v for -l.Bryan Drewery2016-08-101-1/+14
| | | | | | | | MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=303930
* Fix -S with -b not atomically updating the destination file.Bryan Drewery2016-08-101-2/+8
| | | | | | | | | | | | | | | | | | | | | With both of these flags, the backup was created via rename(dest, backup) followed by rename(tmp, dest). This left the destination file missing for a moment which contradicts the point of -S. This fixes a race with installworld where PRECIOUSPROG and PRECIOUSLIB files (which use -S for installation) would briefly be missing. In the case of installing rtld with parallel installworld it could render an error due to not having rtld present to run install/cp in another process. Reported by: jhb Reviewed by: jhb MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D7451 Notes: svn path=/head/; revision=303929
* Trim out excessive / with -v when target directory ends with a trailing '/'.Bryan Drewery2016-08-101-1/+2
| | | | | | | | | | | This is a minor nit after r289391 made all installations to a directory always end in a trailing '/'. MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=303928
* Remove vestigal references to __alpha__Enji Cooper2016-08-082-3/+3
| | | | | | | | | | | | Replace alpha reference in getconf(1) with amd64 [*] MFC after: 1 week PR: 211300 [*] Submitted by: Sevan Janiyan <venture37@geeklan.co.uk> [*] Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=303830
* Fix building usr.bin/tar/tests with PIE symbol building enabled byEnji Cooper2016-08-061-1/+0
| | | | | | | | | | | | | | | | | | 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. Differential Revision: https://reviews.freebsd.org/D7430 MFC after: 1 week Obtained-from: opBSD (418a491eed20d2603ddd1f1bd92c2c0d95094002) Submitted by: op Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=303804
* sdiff: remove non finish/function codeBaptiste Daroussin2016-08-051-38/+27
| | | | | | | | | | 2 extra options not available neither on other BSD nor in GNU sdiff: --diff-pid and --pipe-fd were present in the SoC code, none were usable Just remove it Notes: svn path=/head/; revision=303783
* indent(1): Use bsearch() for looking up type keywords.Pedro F. Giffuni2016-08-044-77/+99
| | | | | | | | | | | Reference: https://github.com/pstef/freebsd_indent/commit/f3b8e6e57fd47364b2360b44011a2fad5d11adc7 Submitted by: Piotr Stefaniak Differential Revision: https://reviews.freebsd.org/D6966 Notes: svn path=/head/; revision=303746
* indent(1): add new -sac and -U options.Pedro F. Giffuni2016-08-035-6/+50
| | | | | | | | | | | | | | | | | | | | | | Add -sac (space after cast) and -nsac options. These control whether space character is put after a cast operator or not. Default is -nsac. Add -U option for providing a file containing list of types. This is needed for properly deciding which asterisks denote unary operation and which denote binary. These come from PostgreSQL. Reference: https://github.com/pstef/freebsd_indent/commit/84b00e3d46dfd6d955b2f481a1f3b275de9ad6d1 https://github.com/pstef/freebsd_indent/commit/49c52cf383fa2a246a1a22c6640a5a21b0f1fd90 Differential Revision: https://reviews.freebsd.org/D6966 (Partial) Submitted by: Piotr Stefaniak Notes: svn path=/head/; revision=303735
* indent(1): accept offsetof(3) as a keyword.Pedro F. Giffuni2016-08-033-32/+34
| | | | | | | | | | | Reference: https://github.com/pstef/freebsd_indent/commit/c470e5e2c974aa38450ca4762b93829f7a7bfa4d Differential Revision: https://reviews.freebsd.org/D6966 (Partial) Submitted by: Piotr Stefaniak Notes: svn path=/head/; revision=303718
* truss: fix uninitialized trussinfo->curthread in add_threads()/enter_syscallBaptiste Daroussin2016-08-021-1/+3
| | | | | | | | | | | | | | trussinfo->curthread must be initialized before calling enter_syscall(), it is used by t->proc->abi->fetch_args(). Without that truss is segfaulting and the attached program also crash. Submitted by: Nikita Kozlov (nikita@gandi.net) Reviewed by: jhb MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D7399 Notes: svn path=/head/; revision=303685
* Fix a segfault in bsdgrep when parsing the invalid extended regexps "?"Dimitry Andric2016-08-021-1/+1
| | | | | | | | | | | | | | | | 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 after: 1 week Notes: svn path=/head/; revision=303676
* sed(1): Revert r303047 "cleanup" and therefore r303572.Pedro F. Giffuni2016-08-027-177/+192
| | | | | | | | | | | | | | | While big, the change was meant to have no effect on behavior and instead so far we have found two regressions: one in the etcupdate tests and another one in the games/openttd port[1]. Revert to a known working state. We will likely have to split the patch in functional parts before bringing back the changes. PR: 195929 Reported by: danfe, madpilot [1] Notes: svn path=/head/; revision=303662
* indent: Avoid using values of pointers that refer to deallocated space.Pedro F. Giffuni2016-08-011-5/+10
| | | | | | | | | | | | | | | For now maintain the local style in this file. Reviewed by: jilles Reference: https://github.com/pstef/freebsd_indent/commit/9099a9f17bc5f579514a4c11111f5cf3df6624c6 Differential Revision: https://reviews.freebsd.org/D6966 (Partial) Submitted by: Piotr Stefaniak Notes: svn path=/head/; revision=303629
* indent(1): Use a dash in the license headers.Pedro F. Giffuni2016-08-019-9/+9
| | | | | | | | Use of the canonical dash avoids indent(1) from reformatting the license headers. Notes: svn path=/head/; revision=303625
* indent(1): Rearrange option parsing code to squelch clang's static analyzer.Pedro F. Giffuni2016-07-311-8/+6
| | | | | | | | | | | | | | | | | clang-analyzer complained that eqin() sets file-scoped pointer param_start to point into char buffer defined in scan_profile(), and once scan_profile() exits, param_start is a "dangling reference". param_start was never used afterwards, but it's cleaner to move it to set_option() which is the only branch where param_start is needed. Reference: https://github.com/pstef/freebsd_indent/commit/ab0e44e5da3ff0fa4b62e451e4bbc3ea1ec7f365 Differential Revision: https://reviews.freebsd.org/D6966 (Partial) Submitted by: Piotr Stefaniak Notes: svn path=/head/; revision=303601
* indent(1): replace function call to bzero with memset.Pedro F. Giffuni2016-07-311-1/+1
| | | | | | | | | | | Reference: https://github.com/pstef/freebsd_indent/commit/7422f42f80099c69d34833d7106035dc09230235 Differential Revision: https://reviews.freebsd.org/D6966 (Partial) Submitted by: Piotr Stefaniak Notes: svn path=/head/; revision=303600
* indent(1): Don't newline on cpp lines like #endif unless -bacc is on.Pedro F. Giffuni2016-07-311-23/+32
| | | | | | | | | | | Reference: https://github.com/pstef/freebsd_indent/commit/01f36f4141c71754b3a73a91886fb425bab0df3e Differential Revision: https://reviews.freebsd.org/D6966 (Partial) Submitted by: Piotr Stefaniak Notes: svn path=/head/; revision=303599