Commit Graph

14412 Commits

Author SHA1 Message Date
Enji Cooper
07ca59522d Check in the generated copies of the manpages
These manpages were meant to be templated once per `configure` run.

Given that we're not bound by as many constants, e.g., `--prefix` isn't
generally changing for kyua in the base system, having to generate the
manpages each build seems slightly less than optimal.

In the event that one's build environment doesn't define `$SH`, the build
will also fail until this change is introduced.

Instead of jumping through hoops dealing with shells or permissions, let's
just cut to the chase and check the generated copies into the sourcebase
under usr.bin/kyua .

MFC with:	r359260
Reported by:	Julian Stacey <jhs@berklix.com>
2020-03-28 01:08:20 +00:00
Mateusz Piotrowski
68fbe6f0b3 Do not use macros in -width
They do not expand.

MFC after:	1 day
2020-03-26 17:58:52 +00:00
Brooks Davis
daa006f84b Install expected kyua docs.
The "kyua about" command assumes these files exist causing tests
supplied devel/kyua to fail.

Fix a bug defining the default KYUA_DOCDIR so the installed files can be
found.

Reported by:	jenkins tests
Reviewed by:	lwhsu
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D24187
2020-03-26 17:34:17 +00:00
Brooks Davis
b0d29bc47d Import the kyua test framework.
Having kyua in the base system will simplify automated testing in CI and
eliminates bootstrapping issues on new platforms.

The build of kyua is controlled by WITH(OUT)_TESTS_SUPPORT.

Reviewed by:	emaste
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D24103
2020-03-23 19:01:23 +00:00
Mateusz Piotrowski
c0f2b64a89 Use -F instead of -f in tail(1) examples
There is an example in tail(1) manual page explaining how to use tail(1) to
track the contents of /var/log/messages. The example uses the -f flag to
follow the file. The problem with the -f flag is that it cannot handle the
situation where /var/log/messages is rotated. Hence, use -F instead in the
example.

Reviewed by:	asomers
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D24157
2020-03-22 21:51:50 +00:00
Mateusz Piotrowski
6ac25cd4ac Document that posixshmcontrol first appeared in 12.1
Also while here, I am addressing some linting issues.

PR:	243132
Submitted by:	Noah Altunian <nbaltunian gmail com>
Approved by:	bcr (mentor)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D24112
2020-03-18 15:02:09 +00:00
Ed Maste
5a2c0ab18b ldd: add aout deprecation notice
Reported by:	kib
2020-03-17 16:42:25 +00:00
Mateusz Piotrowski
3431172fa8 Tell the world how to convert gigabytes to bytes with units(1) easily
It turns out that units(1) is not as horrible to use in scripts
as I initially thought. When the --terse flag is combined
with an appropriate output format (set via --output-format),
units(1) is actually capable of producing very nice results.
For example:

    units -o %0.f -t '4 gigabytes' bytes

is is just going to print out the expected value of 4294967296.

There is no time to waste. People have to know about it.

I am adding an example for this at the top of the examples section
because this is what users are most likely looking for.

Approved by:	bcr (mentor)
Differential Revision:	https://reviews.freebsd.org/D24096
2020-03-17 10:02:59 +00:00
Pedro F. Giffuni
83735685d3 calendar(1): Updates and corrections for some calendar files.
These have an educational value and are, no doubt, an integral part of the fun
behind running the BSDs.

PR:		242909, 242918
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D23581
2020-03-15 00:49:06 +00:00
Xin LI
a0eb385c2e Remove unneeded checks for prelen.
In order to determine the type of a compressed file, we have to read
in the first four bytes which may also be important for decompression
purposes, to do that we would pass the buffer that we have already
read in, along with the size of it.

Rename header1 to fourbytes to make that explicit, and remove all
checks for prelen.

Reported by:	cem
Reviewed by:	cem
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D24034
2020-03-14 05:57:22 +00:00
Mariusz Zaborski
8838296e56 logger: capsicumize
Submitted by:	Tiger Gao <tig@freebsdfoundation.org>
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D23744
2020-03-12 19:55:51 +00:00
Ed Maste
b7a9e9d6b2 elfctl: remove memory leak
CID:		1420356
Reported by:	Coverity Scan
Sponsored by:	The FreeBSD Foundation
2020-03-11 13:51:01 +00:00
Dimitry Andric
16b9056593 Merge ^/head r358731 through r358831. 2020-03-10 07:04:05 +00:00
Dimitry Andric
da759cfa32 Remove -mlong-calls vhen building arm libraries and llvm.
Clang from 9.0.0 onwards already has the necessary relocation range
extenders, so this workaround is no longer needed (it produces longer
and slower code). Tested on real hardware, and in cross-compile
environment.

Submitted by:	mmel
2020-03-10 06:49:43 +00:00
Konstantin Belousov
a24ac0ce9b posixshmcontrol: add an undocumented alias 'list' for the 'ls' command.
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2020-03-09 23:08:24 +00:00
Dimitry Andric
2ac6b71f31 Merge ^/head r358712 through r358730. 2020-03-07 15:09:45 +00:00
Hiroki Sato
d726e6331b Fix an issue of net.inet.igmp.stats handler.
The header of (struct igmpstat) could be cleared by sysctl(3).
This can be reproduced by "netstat -s -z -p igmp".

PR:	244584
MFC after:	1 week
2020-03-07 08:41:10 +00:00
Dimitry Andric
e43d33d286 Merge ^/head r358466 through r358677. 2020-03-05 17:55:36 +00:00
Ed Maste
d06e23f9d9 Reserve WXNEEDED ELF feature control flag
This will be used to tag binaries that require W+X mappings, in advance
of the ability to prevent W^X in mmap/mprotect.

There is still some discussion about the flag's name, but the ABI won't
change even if the name does (as kib pointed out in the review).

Reviewed by:	csjp, kib
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D23909
2020-03-04 18:21:30 +00:00
Ed Maste
76cd520d45 elfctl: check read return value
CID:		1420212, 1420213
Reported by:	Coverity Scan
Sponsored by:	The FreeBSD Foundation
2020-03-04 16:57:23 +00:00
Ed Maste
87a920c065 elfctl: style(9): use C99 uintX_t types
Sponsored by:	The FreeBSD Foundation
2020-03-04 16:53:49 +00:00
Bjoern A. Zeeb
d2b8fd0da1 Add new ICMPv6 counters for Anti-DoS limits.
Add four new counters for ND6 related Anti-DoS measures.
We split these out into a separate upfront commit so that we only
change the struct size one time.  Implementations using them will
follow.

PR:		157410
Reviewed by:	melifaro
MFC after:	2 weeks
X-MFC:		cannot really MFC this without breaking netstat
Sponsored by:	Netflix (initially)
Differential Revision:	https://reviews.freebsd.org/D22711
2020-03-04 16:20:59 +00:00
Conrad Meyer
fd1efedc79 Add extremely useful calendar(1) application to FreeBSD
It does extremely useful things like execute sendmail and spew dubiously
accurate factoids.

From the feedback, it seems like it is an essential utility in a modern unix
and not at all a useless bikeshed.  How do those Linux people live without it?
Reverts r358561.
2020-03-03 00:20:08 +00:00
Conrad Meyer
3c565de33f Fix typo in r278616
FreeBSD isn't an encyclopedia.
2020-03-02 23:37:47 +00:00
John Baldwin
fdf929ff91 Add support for the TFTP windowsize option described in RFC 7440.
The windowsize option permits multiple blocks to be transmitted
before the receiver sends an ACK improving throughput for larger
files.

Reviewed by:	asomers
MFC after:	2 weeks
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D23836
2020-03-02 22:19:30 +00:00
Kyle Evans
8a9f144c9e hexdump: tests: take into account byte order
Hexdump test was failling on big endian systems when testing decimal, octal
and hexa outputs as the tests were designed on a little endian system. This
revision adds the two distinct flavors of output expected and determines at
runtime which to compare against.

Submitted by:	Renato Riolino <renato.riolino_eldorado.org.br>
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D23191
2020-03-02 18:40:34 +00:00
Ed Maste
ba6d70a065 elfctl: tiny style(9) cleanup, use bool where appropriate 2020-03-02 14:34:26 +00:00
Kyle Evans
fdafb99d81 elfctl: initialize features
GCC points out a couple levels down in convert_to_features that this may be
used uninitialized. Indeed, this is true- initialize it to NULL so that we
at least deref a null pointer.
2020-03-02 04:22:38 +00:00
Ed Maste
79bfb05b07 Move ELF feature note tool to usr.bin/elfctl
elfctl is a tool for modifying the NT_FREEBSD_FEATURE_CTL ELF note,
which contains a set of flags for enabling or disabling vulnerability
mitigations and other features.

Reviewed by:	csjp, kib
MFC after:	2 weeks
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D23910
2020-03-02 02:36:41 +00:00
Greg Lehey
017ca0de63 Remove comment about Blackthorn winds, apparently imported from 4.4BSD
Lite.  Nowadays it's trivial to find the explanation, such as at
https://www.deseret.com/2000/2/27/19493013/blackthorn-winds-make-bushes-bud.
It doesn't seem appropriate to replace it with an explanation.
2020-03-01 22:10:37 +00:00
Ed Maste
134b378392 retire in-tree GPL dtc devicetree compiler
Now that we no longer have GCC 4.2.1 in the tree and can assume FreeBSD
is being built with a C++11 compiler available, we can use BSDL dtc
unconditionally and retire the GPL dtc.

GPL dtc now has FreeBSD CI support via Cirrus-CI to help ensure it
continues to build/work on FreeBSD and is available in the ports tree
if needed.

The copy of (copyfree licensed) libfdt that we actually use is in
sys/contrib/libfdt so the extra copy under contrib/dtc/libfdt can be
removed along with the rest of the GPL dtc.

Reviewed by:	kevans, ian, imp, manu, theraven
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D23192
2020-02-29 17:10:54 +00:00
Dimitry Andric
91019ea7d4 Merge ^/head r358400 through r358465. 2020-02-29 15:08:14 +00:00
Ed Maste
57f804675e remove GCC 4.2.1 build infrastructure
As described in Warner's email message[1] to the FreeBSD-arch mailing
list we have reached GCC 4.2.1's retirement date.  At this time all
supported architectures either use in-tree Clang, or rely on external
toolchain (i.e., a contemporary GCC version from ports).

GCC 4.2.1 was released July 18, 2007 and was imported into FreeBSD later
that year, in r171825.  GCC has served us well, but version 4.2.1 is
obsolete and not used by default on any architecture in FreeBSD.  It
does not support modern C and does not support arm64 or RISC-V.

Thanks to everyone responsible for maintaining, updating, and testing
GCC in the FreeBSD base system over the years.

So long, and thanks for all the fish.

[1] https://lists.freebsd.org/pipermail/freebsd-arch/2020-January/019823.html

PR:		228919
Reviewed by:	brooks, imp
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D23124
2020-02-29 03:25:51 +00:00
Dimitry Andric
24a22d1d9c Merge r358179 through r358238.
PR:		244251
2020-02-22 09:58:11 +00:00
Rebecca Cran
1631f21745 dtc: remove unknown option printf, since getopt will print it
Since we don't set opterr to 0, getopt prints a message when it
encounters an unknown/invalid option. We therefore don't need to
print our own message in the default handler.

Reviewed by:	kevans, theraven
Differential Revision:	https://reviews.freebsd.org/D23662
2020-02-20 21:29:59 +00:00
Dimitry Andric
6c140a7281 Merge ^/head r358131 through r358178. 2020-02-20 19:07:29 +00:00
Mateusz Guzik
0573d0a9b8 vfs: add realpathat syscall
realpath(3) is used a lot e.g., by clang and is a major source of getcwd
and fstatat calls. This can be done more efficiently in the kernel.

This works by performing a regular lookup while saving the name and found
parent directory. If the terminal vnode is a directory we can resolve it using
usual means. Otherwise we can use the name saved by lookup and resolve the
parent.

See the review for sample syscall counts.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D23574
2020-02-20 16:58:19 +00:00
Dimitry Andric
43c7dd6b59 Merge ^/head r358075 through r358130. 2020-02-19 21:03:06 +00:00
Kyle Evans
733ba7eff6 truss: fix shm_open2 oversight (BinString -> Name)
BinString assumes a length in the next argument; Name is more appropriate
for the final argument.
2020-02-19 15:12:01 +00:00
Kyle Evans
c1b0c84747 kdump: decode shm_open2
This is the kdump counterpart of the truss support added in r358116, and
also a part of D23733. shm_open2 is the successor to shm_open.

Reviewed by:	kaktus
2020-02-19 14:55:59 +00:00
Kyle Evans
bcca34259c truss: decode shm_open2
shm_open2 is similar to shm_open, except it also takes shmflags and optional
name to label the anonymous region for, e.g., debugging purposes.

The appropriate support for decoding shmflags was added to libsysdecode in
r358115.

This is a part of D23733.

Reviewed by:	kaktus
2020-02-19 14:54:33 +00:00
Ed Maste
09d7d4ad9a whereis: remove gnu/libexec from source search paths
The last subdirectory of gnu/libexec was removed in r85742.
2020-02-19 14:40:53 +00:00
Kyle Evans
550bec4fde kdump: decode SHM_ANON as first arg to legacy shm_open(2)
The first argument to shm_open(2) as well as shm_open2(2) may be a path or
SHM_ANON. Decode SHM_ANON, at least- paths will show up as namei results in
kdump output, which may be sufficient; in those cases, we'll have printed an
address.

Future commits will add support for shm_open2() to libsysdecode/truss/kdump.

Reported by:	kaktus
MFC after:	3 days
2020-02-19 14:32:55 +00:00
Dimitry Andric
b33a8b3822 Merge ^/head r357966 through r357999. 2020-02-16 13:23:54 +00:00
Conrad Meyer
06257a71aa random(6): Re-add undocumented support for floating point denominators
And document it in the manual page.

PR:		244139
Submitted by:	Keith White <kwhite AT site.uottawa.ca> (earlier version)
2020-02-15 19:13:37 +00:00
Dimitry Andric
ef1c128c05 Merge ^/head r357921 through r357930. 2020-02-14 19:33:48 +00:00
Dimitry Andric
74dc6beb30 Merge ^/head r357855 through r357920. 2020-02-14 19:32:58 +00:00
Kyle Evans
d16c90f51c dtc: re-apply r353961, r354115
I missed in final review of r357923's diff that these ones hadn't yet been
sent upstream and inadvertently reverted them. =-( Re-apply now.
2020-02-14 18:50:03 +00:00
Kyle Evans
aac4229aac Pull in latest fixes from dtc, up to 0060471
This includes a small battery of /memreserve/ fixes to make sure dtc is
properly writing these regions into the output file and reading them back
out.

As of this update, dtc will now also assume common defaults for -I/-O if
only one is specified; namely, dts for one implies dtb for the other and
vice versa (Requested by: jhibbits, preserves GPL dtc behavior too).

MFC after:	1 week
2020-02-14 18:46:34 +00:00
Kyle Evans
43fbd65451 diff: fix segfault with --tabsize and no/malformed argument
--tabsize was previously listed as optional_argument, but didn't account for
the optionality of it in the argument handling. This is irrelevant -- the
manpage doesn't indicate that the argument is optional, and indeed there's
no clear interpretation of omitting the argument because there's no other
side effect of --tabsize.

The "malformed" argument part of the header on this message is simply
referring to usage like this:

% diff --tabsize 4 A B

With an optional_argument, the argument must be attached to the parameter
directly (e.g. --tabsize=4), so the argument is effectively NULL with the
above invocation as if no argument had been passed.

PR:		243974
Submitted by:	fehmi noyan isi <fnoyanisi yahoo com> (diff.c portion)
MFC after:	3 days
2020-02-13 20:23:55 +00:00