Commit Graph

12556 Commits

Author SHA1 Message Date
Ed Maste
6c6e388929 sdiff: improve errx string
errx() appends a newline so \n is superfluous. Also switch to lower case
with no period for consistency with other errx strings.
2016-09-15 02:48:56 +00:00
Ed Maste
6d9f0e4d70 bspatch: use #define for header size instead of magic number
Reviewed by:	allanjude, kib
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D7861
2016-09-15 01:58:12 +00:00
Ed Maste
b1ca2de9e9 login: clean up errx strings
errx() prefixes the error string with argv[0] so including "login: "
in the string is redundant. Also remove a superfluous newline.

Sponsored by:	The FreeBSD Foundation
2016-09-15 01:55:18 +00:00
Ed Maste
9b61efccf7 vtfontcvt: remove superfluous newlines in errx messages 2016-09-14 18:22:12 +00:00
Pedro F. Giffuni
be4391a2d5 localedef(1): make better use of calloc(3) arguments.
The first argument of calloc(3) should be an ordinal type, and the
second a size: split a multiplication to make better use of calloc(3)
and detect overflows.

Do some other re-ordering and style fixes while here.

MFC after:	3 weeks
2016-09-14 16:47:17 +00:00
Ed Maste
04708d25e0 bspatch: remove superfluous newlines from errx strings 2016-09-12 14:28:38 +00:00
Simon J. Gerraty
95e3ed2cdb Update to bmake-20170818
This version has some new knobs for dealing with troublesome targets
in meta mode.
2016-09-09 01:09:39 +00:00
Gabor Kovesdan
a6be469014 - Fix typo
PR:		211245
Submitted by:	Christoph Schonweiler <public2016@hauptsignal.at>
MFC after:	5 days
2016-09-08 14:50:23 +00:00
Ed Maste
e3d9ae4c56 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.

Reviewed by:	allanjude, cem, kib
Obtained from:	anonymous gist
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D7619
2016-09-06 19:00:37 +00:00
Dag-Erling Smørgrav
b6924c9309 Add a toggle to display the approximate amount of swap used by each
process.  We don't *quite* pull that number out of our backside, as
the actual number is difficult to determine without modifying the VM
system to report it, but it's still useful to get an idea of what's
going on when a machine unexpectedly starts swapping.

MFC after:	1 week
2016-09-05 08:27:04 +00:00
Hajimu UMEMOTO
2279a9a428 When -n is specified, don't make bogus DNS queries. Instead,
when -n is specified more than once, hostnames stored in utmp
are attempted to resolve to display them as network addresses.

PR:		212272
2016-09-02 18:28:14 +00:00
Marcelo Araujo
4c22fda976 - Invert calloc(3) argument order.
MFC after:	4 weeks
2016-09-01 15:23:33 +00:00
Ed Maste
d74808dd1a users: don't build when we don't have a C++ toolchain
(On RISC-V MK_CXX is in BROKEN_OPTIONS, so users remains skipped there.)

Reviewed by:	bdrewery
Differential Revision:	https://reviews.freebsd.org/D7725
2016-08-31 21:12:50 +00:00
Bryan Drewery
1eb4ec9c62 DIRDEPS_BUILD: Add some missing dirctories to the build.
Sponsored by:	EMC / Isilon Storage Division
2016-08-31 19:30:59 +00:00
Bryan Drewery
776d5e11e9 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	EMC / Isilon Storage Division
2016-08-31 19:30:46 +00:00
Dimitry Andric
c43262580d 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 after:	1 week
2016-08-30 19:02:15 +00:00
Bruce Evans
de618daaf0 Fix build without INET6 and with gcc. A function definition was ifdefed
for INET6, but its protototype was not, and gcc detects the error.
2016-08-27 11:06:06 +00:00
Xin LI
64093e14eb Use printable ASCII instead of octal representation.
MFC after:	2 weeks
2016-08-27 00:56:37 +00:00
Ed Maste
06ce2764a5 bspatch: remove output file in the case of error
Reviewed by:	oshogbo
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D7644
2016-08-25 21:33:39 +00:00
Enji Cooper
8905590ba9 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".

MFC after:	1 week
Relnotes:	yes
Reviewed by:	wollman
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D7618
2016-08-25 17:07:43 +00:00
Allan Jude
76723b39ca 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.

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
2016-08-25 15:08:33 +00:00
Navdeep Parhar
97b84d344d Make the iSCSI parameter negotiation more flexible.
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
2016-08-25 05:22:53 +00:00
Enji Cooper
bb323b9e7b 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.

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division
2016-08-23 19:41:49 +00:00
Enji Cooper
de7b37e618 Add MIN_HOLE_SIZE pathconf(2) support to getconf
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
2016-08-23 19:28:01 +00:00
Enji Cooper
11b0c200fb Clean up trailing whitespace
MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division
2016-08-23 19:15:01 +00:00
Ed Maste
ce437beff1 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.

Reviewed by:	oshogbo
No objection:	cperciva
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D7610
2016-08-23 17:42:03 +00:00
Pedro F. Giffuni
bf140447ba indent(1): have the memset invocation somewhat more canonical.
While correct, the previous invocation was somewhat more error prone.

Pointed out by:	delphij, bde
2016-08-23 15:49:31 +00:00
Pedro F. Giffuni
38359266c5 indent(1): remove dead assignments.
Taken from:	Piotr Sephaniak
2016-08-23 15:46:20 +00:00
Pedro F. Giffuni
8e7c1235ce indent(1): Fix off-by-one in control flow leading dead code.
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
2016-08-23 02:07:08 +00:00
Pedro F. Giffuni
16c2e36059 indent(1): add some comments to quiet down Coverity.
Hopefully adding comments should help explain the code to both static
checkers and humans.

CID:	976543, 976544, 976545
Obtained from:	Piotr Stephaniak
2016-08-23 01:58:02 +00:00
Pedro F. Giffuni
f3c23ec321 indent(1): Fix memory leaks pointed out by clang-analyzer.
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
2016-08-23 01:40:45 +00:00
Ed Schouten
a5c3c5b14f Import the new automatically generated system call table for CloudABI.
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
2016-08-19 17:49:35 +00:00
Andrey A. Chernov
4e78ecd2c9 Fix TAB replaced with spaces in prev. commit. 2016-08-18 10:18:11 +00:00
Michael Tuexen
5ad497eead Fix the output for scope statistics.
MFC after: 3 days
2016-08-17 16:56:20 +00:00
Michael Tuexen
e0694d2f0a Use names for SCTP and UDPLite when reporting the input histogram.
MFC after: 3 days
2016-08-17 14:44:47 +00:00
Marcelo Araujo
4b61b26b28 Use nitems() from sys/param.h.
MFC after:	2 weeks.
2016-08-16 15:53:05 +00:00
Marcelo Araujo
4c59a8860a Use nitems() from sys/param.h.
MFC after:	2 weeks.
2016-08-16 15:52:10 +00:00
Sofian Brabez
80a2905883 tty: Use proper definition of exit status code and stdin macro
Reviewed by:	bapt, bdrewery
Differential Revision:	https://reviews.freebsd.org/D6828
2016-08-16 14:15:09 +00:00
Rick Macklem
684d18c9ae Fix r304026 so that it builds for gcc.
Reported by:	np
Tested by:	np
MFC after:	1 month
2016-08-16 00:48:13 +00:00
Mark Johnston
da974ed4ab nfsstat depends on libdevstat as of r304058.
X-MFC-With:	r304058
2016-08-14 00:24:00 +00:00
Greg Lehey
7430368a0e Correct date ov VJ day (1945-08-15, about 03:00 UTC). 2016-08-13 23:35:20 +00:00
Rick Macklem
50f3f9f909 Update the man page to descibe the "-d" option added by r304058.
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
2016-08-13 20:21:32 +00:00
Rick Macklem
693957f886 Update nfsstat.c to use the new kernel nfsstat structure and
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
2016-08-13 20:14:44 +00:00
Konstantin Belousov
6bdee22607 Remove unused prototypes.
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2016-08-12 07:52:13 +00:00
John Baldwin
c357102c5b Remove files unused after pulling system call names from libsysdecode. 2016-08-11 05:18:09 +00:00
Bryan Drewery
cca89ee385 Fix sorting in r303934.
Reported by:	jhb
X-MFC-With:	r303934
MFC after:	3 days
Sponsored by:	EMC / Isilon Storage Division
2016-08-10 21:59:59 +00:00
Bryan Drewery
6178f8e8a6 Use proper argument length for rmdir(2) for r303934.
Reported by:	kib
X-MFC-With:	r303934
MFC after:	3 days
Sponsored by:	EMC / Isilon Storage Division
2016-08-10 18:45:26 +00:00
Bryan Drewery
c870956d72 Support rmdir(2).
MFC after:	3 days
Sponsored by:	EMC / Isilon Storage Division
2016-08-10 18:19:17 +00:00
Bryan Drewery
c8a8570cdb Squelch a false-positive Clang static analyzer warning.
MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2016-08-10 18:19:14 +00:00
Bryan Drewery
4a4768d948 Fix -b failure not restoring flags on the destination file.
MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2016-08-10 18:19:11 +00:00