Commit Graph

14003 Commits

Author SHA1 Message Date
Justin Hibbits
61ef814f56 Fix top(1) long options handling
getopt_long(3) requires the long options be terminated by a NULL block.
Without the terminator, an invalid long option results in a segmentation
fault.

Reported by:	Brandon Bergren
MFC after:	1 week
2019-01-18 23:26:31 +00:00
Brooks Davis
e4478d7e46 Use a private definition of osockaddr rather then relying on type
namespace polution in sys/socket.h.

Also remove support for operation on 4.3BSD.

PR:		224529
Differential Revision:	https://reviews.freebsd.org/D14505
2019-01-18 21:30:06 +00:00
Oleksandr Tymoshenko
b63800ac8f Fix descriptor/memory leak in compress(1) code
This is mostly a style fix since the code in question is not called multiple
times and doesn't have cummulative effect.

PR:		204953
Submitted by:	David Binderman <dcb314@hotmail.com>
MFC after:	1 week
2019-01-18 00:26:25 +00:00
Mark Johnston
e6de40fa79 Fix handling of rights on stdio streams.
- Limit rights on stdio before opening input files.  Otherwise, open()
  may return one of the standard descriptors and we end up limiting
  rights such that we cannot read from one of the input files.
- Use caph_limit_stdio(), which suppresses EBADF, to ensure that
  we don't emit an error if one of the stdio streams is closed.
- Don't bother further limiting rights on stdin when stdin isn't going
  to be used.  Doing so correctly requires checking for a number of
  edge cases, and it doesn't provide any significant benefit.

PR:		234885
Reviewed by:	oshogbo
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D18860
2019-01-17 17:36:18 +00:00
Yoshihiro Takahashi
31afdd6f10 Fix indentation in ruptime command output for hosts in the "down" state.
PR:		234239
MFC after:	1 week
2019-01-12 12:57:32 +00:00
Yoshihiro Takahashi
1da80a2c75 Sync with OpenBSD.
bc.y: Rev 1.50
- write parse errors to stderr, prompted by Martijn Dekker
- we're only interactive if stdout en stderr are a tty as well as stdin

PR:		234430
Obtained from:	OpenBSD
MFC after:	1 week
2019-01-12 12:35:02 +00:00
Enji Cooper
7b97300547 Add Linux compatibility support for SC_NPROCESSORS_{CONF,ONLN} as _SC_NPROCESSORS_{CONF,ONLN}
The goal of this change is to make it easier to use getconf to query
the number of available processors.

Sadly it's unclear per POSIX, which form (with a preceding _ or
lacking it) is correct. I will bring this up on the Austin Group list so
this point is clarified for implementors that might rely on this getconf
variable in future POSIX spec versions.

This is something I noticed when trying to import GoogleTest to FreeBSD
as one of the CI scripts uses this variable on Linux.

MFC after:	2 weeks
Approved by:	emaste (mentor)
Differential Revision:	https://reviews.freebsd.org/D18640
2019-01-11 22:28:18 +00:00
Kyle Evans
26e3f9681b Fix bsdgrep manpage clobbering grep(1) with default build options
The default build should install bsdgrep(1) and grep(1), with the latter
being gnugrep(1). WITH_BSD_GREP flips this situation such that we have
gnugrep(1) and grep(1), with the latter being bsdgrep(1).

Changes to start installing the zgrep script out of usr.bin/grep
inadvertently altered the default build such that grep(1) was being
installed, and it was bsdgrep(1). Correct the typo.

Reported by:	bcran
MFC after:	3 days
2019-01-09 02:47:07 +00:00
Xin LI
197884df8a Correct documentation year.
MFC after:	2 weeks
2019-01-07 08:29:27 +00:00
Xin LI
5c4b64e66b Port NetBSD improvements:
- Add -l support for xz files
 - Add lzip support to gzip based on the example lzip decoder.

Obtained from:	NetBSD
MFC after:	2 weeks
Relnotes:	yes
2019-01-07 08:27:11 +00:00
Jilles Tjoelker
da61c776f3 getconf(1): Minor mdoc fix
MFC after:	1 week
2019-01-06 21:43:14 +00:00
Xin LI
4f4b31568a Remove unneeded assert.h (there is no assertion in this file).
MFC after:	2 weeks
2019-01-06 20:42:09 +00:00
Xin LI
4dbd43cd05 Remove unneeded headers.
MFC after:	1 month
2019-01-06 20:39:23 +00:00
Allan Jude
07372194c3 The lam(1) man page is unclear about the uppercase versions of the flags
PR:		229571
Submitted by:	Tim Chase <freebsd@tim.thechases.com>
2019-01-04 02:48:43 +00:00
Conrad Meyer
a0483764f3 Update to Zstandard 1.3.8
This merge brings in a couple new files, which needed to be attached to the
build; a new dependency on <limits.h>, which must be stubbed; and a name
change in the Context parameter constants, from ZSTD_p_foo to ZSTD_c_foo.

Significantly, it fixes a kernel build error with GCC where floating-point
functions were included in the kernel build, by hiding them under the same
compile-time #ifdef that already covered their invocation.  That issue was
introduced to FreeBSD in the 1.3.7 update and tracked upstream here:

  https://github.com/facebook/zstd/issues/1386

The full 1.3.8 release notes can be found on Github:

  https://github.com/facebook/zstd/releases/tag/v1.3.8

Relnotes:	yes
2018-12-29 21:18:01 +00:00
Ed Maste
ac8e938122 ar: detect and error out on 32-bit symbol table overflow
BSD ar currently does not support the /SYM64/ 64-bit symbol table, and
previously truncated to 32-bits, silently producing corrupted archives
larger than 4GB.

This is another overflow case in addtion to r342575.

PR:		234454
Reported by:	Aijaz Baig, imp
MFC after:	2 weeks
MFC with:	r342575
Sponsored by:	The FreeBSD Foundation
2018-12-28 22:47:55 +00:00
Ed Maste
699f180198 ar: detect and error out on 32-bit symbol table overflow
BSD ar currently does not support the /SYM64/ 64-bit symbol table, and
previously truncated to 32-bits, silently producing corrupted archives
larger than 4GB.

Note that this is only a partial fix; additional checks will come.

PR:		234454
Reported by:	Aijaz Baig, imp
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-12-28 17:00:12 +00:00
Mateusz Piotrowski
8ece0ee096 iscsictl.8: Add missing flag parameters
- Add missing parameters to flags in the description of available options.
- Remove spaces between alternative parameters and "|".
- Align descriptions of options to the longest option.
- Use em dash instead of a hyphen.

Reviewed by:	bcr
Approved by:	doc (bcr)
Approved by:	krion (mentor, implicit), mat (mentor, implicit)
Differential Revision:	https://reviews.freebsd.org/D18608
2018-12-27 14:44:01 +00:00
Simon J. Gerraty
dfd669ab38 Merge bmake-20181221 2018-12-23 01:05:52 +00:00
Shteryana Shopova
e1747016b9 Add myself to the calendar 2018-12-12 19:58:54 +00:00
Dimitry Andric
893405b45f Merge ^/head r341764 through r341812. 2018-12-11 06:47:04 +00:00
John Baldwin
c1745bf503 Validate the string size parameter passed to -s.
Use strtonum() to reject negative sizes instead of core dumping.

PR:		232206
Submitted by:	David Carlier <devnexen@gmail.com>
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D17537
2018-12-10 21:47:19 +00:00
Dimitry Andric
67350cb56a Merge ^/head r340918 through r341763. 2018-12-09 11:39:45 +00:00
John Baldwin
dab45de671 Rename riscv64-freebsd.c to riscv-freebsd.c.
This fixes truss when built as part of a riscv64sf world.  Additionally,
if FreeBSD ever supports RV32 RISC-V most of this file can be used as-is
just as a single file is used for all of the MIPS ABIs.

Sponsored by:	DARPA
2018-12-06 22:35:07 +00:00
Simon J. Gerraty
2eae894ca7 Update bmake to version 20180919
Cleanup of stats cache
and new :q modifier.
2018-12-06 20:56:19 +00:00
Li-Wen Hsu
037479ff5e Temporarily skip flakey test cases
PR:		233586, 233587, 233588
Approved by:	markj (mentor)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D18362
2018-12-06 09:22:35 +00:00
Konstantin Belousov
a66732de4f Print type designator 'D' for the KF_TYPE_DEV files.
No type-specific data is provided by the kernel.

Sponsored by:	Mellanox Technologies
MFC after:	1 week
2018-12-03 23:42:04 +00:00
Mark Johnston
e7a0ad24b0 Add missing display messages when toggling modes.
PR:		233667
Submitted by:	James Wright <james.wright@jigsawdesign.com>
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D18331
2018-11-30 18:02:59 +00:00
Eugene Grosbein
fcd7ccb28c Move trim(1) from usr.bin to usr.sbin to become trim(8).
Requested by:	se
MFC after:	1 month
2018-11-29 16:08:16 +00:00
Eugene Grosbein
98af779d05 trim(1): unbreak build after r341232 for platforms using gcc and not clang
MFC after:	1 month
2018-11-29 14:49:33 +00:00
Eugene Grosbein
bf64d87e6c Add new small tool trim(1) to delete contents for blocks on flash
based storage devices that use wear-leveling algorithms.

Reviewed by:	hackers@
MFC after:	1 month
2018-11-29 14:21:26 +00:00
Justin Hibbits
59dc8c79c6 Allow truss to operate on ELFv2 processes.
Summary:
Currently, truss doesn't work on ELFv2 processes due to not recognizing the ABI.

Since there's no special handling needed here, just adding a PROCABI struct for
it is sufficient to get it working.

Submitted by:	git_bdragon.rtk0.net
Differential Revision: https://reviews.freebsd.org/D18352
2018-11-29 03:57:06 +00:00
Ed Maste
2431a6854d llvm-objdump.1: remove more unintentional options
Some options come from static constructors in LLVM libraries and are
automatically added to llvm's usage output.  They're not really supposed
to be llvm-objdump options.

Reported by:	Fangrui Song in LLVM review D54864
Sponsored by:	The FreeBSD Foundation
2018-11-27 13:52:51 +00:00
Ed Maste
6b31818dee llvm-objdump.1: fix igor / mandoc -Tlint warnings
Accidentally omitted from r340972.
2018-11-26 15:12:58 +00:00
Ed Maste
7a1772ed42 llvm-objdump.1: remove invalid options
Some options appear in llvm-objdump's usage information as a side effect
of its option parsing implementation and are not actually llvm-objdump
options.  Reported in LLVM review https://reviews.llvm.org/D54864.

Reported by:	Fangrui Song
Sponsored by:	The FreeBSD Foundation
2018-11-26 14:45:58 +00:00
Ed Maste
801cfbaa3f llvm-objdump: initial man page
Based on llvm-objdump's online documentation and usage information.
This serves as a starting point; additional detail and cleanup still
required.

Also being submitted upstream in LLVM review D54864.  I expect to use
this bespoke copy while we have LLVM 6.0 or 7.0 in FreeBSD; when we
update to LLVM 8.0 it should be upstream and we will switch to it.

PR:		233437
Reviewed by:	bcr (man formatting)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D18309
2018-11-26 14:34:30 +00:00
Dimitry Andric
3d5db45595 Merge ^/head r340427 through r340868. 2018-11-24 14:46:06 +00:00
Thomas Munro
d1f84ec0a7 pom: Fix fencepost bugs.
Under some conditions pom would report "waning" and then "full", show
higher percentages than it should, and get confused by DST.  Fix.

Before:

  2018.01.30: The Moon is Waxing Gibbous (97% of Full)
  2018.01.31: The Moon is Waning Gibbous (100% of Full)
  2018.02.01: The Moon is Full
  2018.02.02: The Moon is Waning Gibbous (98% of Full)

After:

  2018.01.30: The Moon is Waxing Gibbous (96% of Full)
  2018.01.31: The Moon is Waxing Gibbous (99% of Full)
  2018.02.01: The Moon is Full
  2018.02.02: The Moon is Waning Gibbous (97% of Full)

PR:                    231705
Submitted by:          Andrew Gierth
Approved by:           allanjude (mentor)
MFC after:             2 weeks
Differential Revision: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231705
2018-11-20 00:06:53 +00:00
Benedict Reuschling
fd91f85934 Add a fortune describing how to upload a machine's dmesg information to the
NYCBUG database.

We want to encourage our users to upload their dmesgs so that the project can
get a better insight into what kind of hardware is run on. This helps in making
data-driven decisions about i.e., platform and driver support.

Note that dmesgs may contain sensitive information like hardware serial numbers,
hence uploading them without review is discouraged.

Reviewed by:		brooks, imp, allanjude
Approved by:		allanjude
MFC after:		5 days
Differential Revision:	https://reviews.freebsd.org/D17705
2018-11-19 20:45:49 +00:00
Mariusz Zaborski
ce57fd97fe brandelf: capsicumize it 2018-11-18 12:23:03 +00:00
Mariusz Zaborski
d72ba183ff brandelf: fix style nits
No functional change intended.

Reviewed by:	emaste, markj
Differential Revision:	https://reviews.freebsd.org/D17966
2018-11-18 12:03:12 +00:00
Dimitry Andric
6149ed01a1 Merge ^/head r340368 through r340426. 2018-11-14 06:46:44 +00:00
Mariusz Zaborski
509e73d483 s/caph_enter_capser/caph_enter_casper/g
Reported by:	npn
2018-11-12 18:43:51 +00:00
Mariusz Zaborski
8e4febf012 s/caph_enter_with_casper/caph_enter_casper/
Reported by:	npn
2018-11-12 18:34:55 +00:00
Mariusz Zaborski
c71292ea35 wc: We should sandbox wc only if Capers is available. 2018-11-12 18:01:36 +00:00
Mariusz Zaborski
3824f650f0 head: sandbox using capsicum
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D14409
2018-11-12 17:59:15 +00:00
Mariusz Zaborski
9e4c5144e6 wc: sandbox wc using capsicum
Reviewed by:	AllanJude, emaste
Differential Revision:	https://reviews.freebsd.org/D14409
2018-11-12 17:47:51 +00:00
Mariusz Zaborski
509111af21 head: fix style nits
No functional change intended.

Reviewed by:	emaste
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D14498
2018-11-12 16:44:26 +00:00
Dimitry Andric
9b5cb2f639 Merge ^/head r340235 through r340367. 2018-11-12 16:41:41 +00:00
Michael Tuexen
970bdbf5d7 Fix printing of 64-bit counters on 32-bit ppc platforms.
Several statistic counters are uint64_t values and are printed by systat
using %lu. This results in displaying wrong numbers. Use PRIu64 instead.
While there, print variables of size_t using %zd.

MFC after:i		3 days
Differential Revision:	https://reviews.freebsd.org/D17838
2018-11-12 13:26:13 +00:00