Commit Graph

14550 Commits

Author SHA1 Message Date
Michael Reifenberger
4bde63536c Patch systat -zarc to display cumulative rate and round down large numbers by SI units
PR:		237664
Submitted by:	ota@j.email.ne.jp
MFC after:	2 weeks
2020-05-11 20:34:52 +00:00
Ed Maste
4ac4a7f80b elfctl: update earliest FreeBSD revision to 12.2
elfctl has been merged to stable/12, and so will appear in FreeBSD 12.2

Reported by:	Dewayne Geraghty
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2020-05-05 21:50:52 +00:00
John Baldwin
16aabb761c Remove support for IPsec algorithms deprecated in r348205 and r360202.
Examples of depecrated algorithms in manual pages and sample configs
are updated where relevant.  I removed the one example of combining
ESP and AH (vs using a cipher and auth in ESP) as RFC 8221 says this
combination is NOT RECOMMENDED.

Specifically, this removes support for the following ciphers:
- des-cbc
- 3des-cbc
- blowfish-cbc
- cast128-cbc
- des-deriv
- des-32iv
- camellia-cbc

This also removes support for the following authentication algorithms:
- hmac-md5
- keyed-md5
- keyed-sha1
- hmac-ripemd160

Reviewed by:	cem, gnn (older verisons)
Relnotes:	yes
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D24342
2020-05-02 00:06:58 +00:00
Kyle Evans
67c907653e diff(1): don't reject specifying the same format multiple times
This may happen, for instance, if one happens to have an alias of diff to
diff -up and attempts to specify the amount of context on top of that.

Aliases like this may cause other problems, but if they're really not ever
generating non-unified diffs then we should at least not break that
use-case.

In addition, we'll now pick up a format mismatch if -p is specified with
!contextual && !unified && !unset.

Fix up a small trailing whitespace nit in the tests while we're here, and
add tests to make sure that we can double up all the formatting options.

Reported by:	jbeich
MFC after:	3 days
2020-04-28 14:33:33 +00:00
Ryan Moeller
f1cd4902bf sockstat: Attach to jail if in new vnet
Attach sockstat -j to the specified jail if the jail is in a new vnet.
Otherwise we do not see all sockets belonging to the jail.

Reviewed by:	jamie
Approved by:	mmacy (mentor)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D24413
2020-04-26 20:55:11 +00:00
Mateusz Piotrowski
beb71006e7 Fix invalid use of macros and two typos
It turns out that currently mandoc(1) is not handling Fl in Ss
correctly (maybe it never was). Let's just replace "Fl S \&Ss ..."
with "-S ...". After all, this subsection title is stylized anyway, so Fl
is not that helpful.

MFC after:	2 weeks
2020-04-24 22:02:22 +00:00
Kyle Evans
db9cccfbb1 diff(1): reject conflicting formatting options
This matches GNU diff(1) behavior and, more importantly, eliminates any
source of confusion if multiple formatting options are specified.

Note that the committed diff differs slightly from the submitted: I've
modified it so that we initialize diff_format to something that isn't an
accepted format option so that we can also reject --normal -c and -c
--normal, which would've otherwise been accepted because the default was
--normal. After option parsing we default it to D_NORMAL if it's still
unset.

PR:		243975
Submitted by:	fehmi noyan isi
MFC after:	1 week
2020-04-20 16:14:44 +00:00
Mateusz Piotrowski
93e0e298b9 Use the Ic macro for find(1) primaries consistently
MFC after:	3 days
2020-04-18 13:29:54 +00:00
Greg Lehey
96273f2488 Tidy up syntax and punctuation of some entries. 2020-04-17 23:14:51 +00:00
Brooks Davis
3780fcd950 Add procstat support for AT_ flags added in r359988.
This includes argc, argv, envc, envv, and ps_strings.

Reviewed by:	kib
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D24407
2020-04-15 20:25:38 +00:00
Hiroki Tagato
4afeb43d98 Add my birthday
Approved by:	ehaupt (mentor)
2020-04-15 10:20:18 +00:00
Li-Wen Hsu
1c04eb2853 Install expected output file of test missed in r359585
Sponsored by:	The FreeBSD Foundation
2020-04-13 14:35:07 +00:00
Alexander V. Chernikov
d303324bad Fix string format error missed in r359823. 2020-04-12 15:16:34 +00:00
Alexander V. Chernikov
a666325282 Introduce nexthop objects and new routing KPI.
This is the foundational change for the routing subsytem rearchitecture.
 More details and goals are available in https://reviews.freebsd.org/D24141 .

This patch introduces concept of nexthop objects and new nexthop-based
 routing KPI.

Nexthops are objects, containing all necessary information for performing
 the packet output decision. Output interface, mtu, flags, gw address goes
 there. For most of the cases, these objects will serve the same role as
 the struct rtentry is currently serving.
Typically there will be low tens of such objects for the router even with
 multiple BGP full-views, as these objects will be shared between routing
 entries. This allows to store more information in the nexthop.

New KPI:

struct nhop_object *fib4_lookup(uint32_t fibnum, struct in_addr dst,
  uint32_t scopeid, uint32_t flags, uint32_t flowid);
struct nhop_object *fib6_lookup(uint32_t fibnum, const struct in6_addr *dst6,
  uint32_t scopeid, uint32_t flags, uint32_t flowid);

These 2 function are intended to replace all all flavours of
 <in_|in6_>rtalloc[1]<_ign><_fib>, mpath functions  and the previous
 fib[46]-generation functions.

Upon successful lookup, they return nexthop object which is guaranteed to
 exist within current NET_EPOCH. If longer lifetime is desired, one can
 specify NHR_REF as a flag and get a referenced version of the nexthop.
 Reference semantic closely resembles rtentry one, allowing sed-style conversion.

Additionally, another 2 functions are introduced to support uRPF functionality
 inside variety of our firewalls. Their primary goal is to hide the multipath
 implementation details inside the routing subsystem, greatly simplifying
 firewalls implementation:

int fib4_lookup_urpf(uint32_t fibnum, struct in_addr dst, uint32_t scopeid,
  uint32_t flags, const struct ifnet *src_if);
int fib6_lookup_urpf(uint32_t fibnum, const struct in6_addr *dst6, uint32_t scopeid,
  uint32_t flags, const struct ifnet *src_if);

All functions have a separate scopeid argument, paving way to eliminating IPv6 scope
 embedding and allowing to support IPv4 link-locals in the future.

Structure changes:
 * rtentry gets new 'rt_nhop' pointer, slightly growing the overall size.
 * rib_head gets new 'rnh_preadd' callback pointer, slightly growing overall sz.

Old KPI:
During the transition state old and new KPI will coexists. As there are another 4-5
 decent-sized conversion patches, it will probably take a couple of weeks.
To support both KPIs, fields not required by the new KPI (most of rtentry) has to be
 kept, resulting in the temporary size increase.
Once conversion is finished, rtentry will notably shrink.

More details:
* architectural overview: https://reviews.freebsd.org/D24141
* list of the next changes: https://reviews.freebsd.org/D24232

Reviewed by:	ae,glebius(initial version)
Differential Revision:	https://reviews.freebsd.org/D24232
2020-04-12 14:30:00 +00:00
Eugene Grosbein
75acbb2226 wc(1): document SIGINFO handling in the manual page.
MFC after:	3 days
2020-04-11 08:16:35 +00:00
Mariusz Zaborski
d86cc38525 logger: temporarily disable Capsicum when a host is provided
We don't have a way to send a UDP package.

PR:		245314
Reported by:	dch
Discussed with:	emaste
2020-04-08 18:43:00 +00:00
Maxim Sobolev
a8b8edb25e Normalize deployment tools usage and definitions by putting into one place
instead of sprinkling them out over many disjoint files. This is a follow-up
to achieve the same goal in an incomplete rev.348521.

Approved by:	imp
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D20520
2020-04-07 02:46:22 +00:00
Kyle Evans
a86ddfe8c7 mail/gprof/tip: tap with the ugly stick
The ugly stick here is this bit in the respective headers:

#ifndef EXTERN
#define EXTERN extern
#endif

with a follow-up #define EXTERN in a single .c file to push all of their
definitions into one spot. A pass should be made over these three later to
push these definitions into the correct files instead, but this will suffice
for now and at a more leisurely pace.

MFC after:	3 days
2020-04-06 23:28:24 +00:00
Kyle Evans
02bde5cf13 indent: fix the -fno-common build
Spread the globals far and wide, hopefully to the files that make the most
sense.

-fno-common will become the default in GCC10/LLVM11.

MFC after:	3 days
2020-04-06 23:20:20 +00:00
Yoshihiro Takahashi
ba2c1f62af Remove extra spaces for the load average of machines that are down.
PR:		245296
Submitted by:	martin _at_ lispworks.com
MFC after:	1 week
2020-04-04 12:07:36 +00:00
Ed Maste
652a974885 lldb: build and enable lua script bindings
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D24266
2020-04-03 16:54:13 +00:00
Brooks Davis
317111316d Install a kyua.conf based on the one in devel/kyua.
The kyua.conf from examples doesn't match the expected config and
contains a lot of undesirable entries such as setting the architecture
to amd64 explicitly.

Reported by:	arichardson (missing config)
Reviewed by:	emaste
Obtained from:	CheriBSD
Differential Revision:	https://reviews.freebsd.org/D24267
2020-04-03 15:47:15 +00:00
Mark Johnston
fb979f0db2 Fix up r359594: -m takes an argument.
PR:		244153
Reported by:	0mp
MFC with:	r359594
2020-04-03 14:47:40 +00:00
Mark Johnston
ab82560638 xargs: Fix exit status expression when a child process fails to exec.
PR:		244327
Submitted by:	thomas.duffy.99@alumni.brown.edu
MFC after:	1 week
2020-04-03 14:03:58 +00:00
Mark Johnston
3035d538a4 Fix the description of the -m flag in top.1.
PR:		244153
Submitted by:	fehmi noyan isi <fnoyanisi@yahoo.com>
MFC after:	3 days
2020-04-03 13:35:44 +00:00
Oleksandr Tymoshenko
838f5ac1f9 Remove hardcoded US Election Day from calendar.usholiday
calendar(1) syntax is not capable of representing the rules for the
US Election Day. The hardcoded date was set in r15066 in 1996 and
hasn't changed since then.

PR:		173389
Reported by:	Steve Ames <steve@energistic.com>
MFC after:	1 week
2020-04-03 02:39:46 +00:00
Oleksandr Tymoshenko
c01c8cccf5 Fix calculation of the recurring weekdays
Both the result of the first_dayofweek_of_year and the target
weekday are zero-based (0 fo sunday) while the target month-day
or year-day is 1-based. Adjust logic accordingly.

Also add testcase for this PR to the kyua test suite

PR:		201062
Submitted by:	Richard Narron <comet.berkeley@gmail.com>
MFC after:	1 week
2020-04-03 01:17:43 +00:00
Edward Tomasz Napierala
4945a2641f Stop hardcoding WARNS in iscsictl(8).
MFC after:	2 weeks
Sponsored by:	DARPA
2020-04-01 15:08:53 +00:00
Brooks Davis
9fd4b8ffab Fix build with src on a noexec filesystem.
${SH} expands to nothing on src builds so this worked by accident.  Use
a bare "sh" instead.

PR:		245086
Reported by:	pkubaj
Sponsored by:	DARPA
2020-03-29 19:48:28 +00:00
Kyle Evans
8dddde9ebb locate: fix -fno-common build
Just a single variable declaration to extern and define elsewhere here,
myctype.

-fno-common will become a default in GCC10/LLVM11.

MFC after:	3 days
2020-03-29 19:16:14 +00:00
Greg Lehey
9a9b973561 Remove spurious transition from Julian to Gregorian for country
"Latin".

Arguably the entire -p option should be removed.  It shows only a few
countries, and it doesn't have any relationship with the rest of the
program.

PR:		244801
Submitted by:	grog@
Reported by:	Hamid Ali
2020-03-29 04:18:27 +00:00
Greg Lehey
358952cac0 Add STANDARDS section
PR:		239723
Submitted by:	Gordon Bergling
Reported by:	Gordon Bergling
2020-03-29 04:14:57 +00:00
Enji Cooper
09ae09a9eb Revert r359385-r359387
As noted by brooks/emaste, this is the wrong approach to take.
Revert the changes so brooks can apply a more proper change.

Requested by:	brooks, emaste
2020-03-29 02:40:03 +00:00
Kyle Evans
9a9f88cc11 systat: remove redundant definition of kd
kd is already properly declared in extern.h and defined in main.c, rendering
this definition useless. This fixes the -fno-common build.

MFC after:	3 days
2020-03-29 02:30:23 +00:00
Greg Lehey
4014b4a7a4 Add year to Boganda's death. 2020-03-28 22:44:08 +00:00
Enji Cooper
d7f6e63df9 The .PATH throbbing I added in r359385 is no longer required
MFC with:	r359385
2020-03-28 01:16:06 +00:00
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
Dimitry Andric
44e86fbdcf Merge ^/head r357662 through r357854. 2020-02-13 12:52:24 +00:00
Mateusz Piotrowski
469635f600 diff.1: Fix style & document -y as extension to POSIX
- Long options must be stylized with the Fl macro as well.

Reviewed by:	bapt
Approved by:	bcr (mentor)
Differential Revision:	https://reviews.freebsd.org/D23642
2020-02-12 20:06:41 +00:00
Martin Matuska
f976241773 MFV r357783:
Update libarchive to 3.4.2

Relevant vendor changes:
  PR #1289: atomic extraction support (bsdtar -x --safe-writes)
  PR #1308: big endian fix for UTF16 support in LHA reader
  PR #1326: reject RAR5 files that declare invalid header flags
  Issue #987: fix support 7z archive entries with Delta filter
  Issue #1317: fix compression output buffer handling in XAR writer
  Issue #1319: fix uname or gname longer than 32 characters in pax writer
  Issue #1325: fix use after free when archiving hardlinks in ISO9660 or XAR
  Use localtime_r() and gmtime_r() instead of localtime() and gmtime()

X-MFC-With:	r356212,r356365,r356416
MFC after:	1 week
2020-02-12 00:16:56 +00:00
Kyle Evans
020419b665 login.conf(5): update commented-out standard, too
MAIL now has a mail capability, instead, as of r357560.
2020-02-09 22:35:49 +00:00
Konstantin Belousov
24d57fa83e Add procstat(1) sigfastblock command to show process sigfastblock word address.
Tested by:	pho
Disscussed with:	cem, emaste, jilles
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D12773
2020-02-09 12:30:50 +00:00
Konstantin Belousov
944cf37bb5 Add AT_BSDFLAGS auxv entry.
The intent is to provide bsd-specific flags relevant to interpreter
and C runtime.  I did not want to reuse AT_FLAGS which is common ELF
auxv entry.

Use bsdflags to report kernel support for sigfastblock(2).  This
allows rtld and libthr to safely infer the syscall presence without
SIGSYS.  The tunable kern.elf{32,64}.sigfastblock blocks reporting.

Tested by:	pho
Disscussed with:	cem, emaste, jilles
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D12773
2020-02-09 12:10:37 +00:00
Ed Maste
5aa0576b33 Miscellaneous typo fixes
Submitted by:	Gordon Bergling <gbergling_gmail.com>
Differential Revision:	https://reviews.freebsd.org/D23453
2020-02-07 19:53:07 +00:00
Dimitry Andric
bc02c18c48 Merge ^/head r357408 through r357661. 2020-02-07 19:08:37 +00:00
Baptiste Daroussin
79208b1025 Fix most of the style warnings 2020-02-07 12:26:38 +00:00
Baptiste Daroussin
89fd163c4e Update diff(1) TODO removing what has been implemented 2020-02-07 10:18:01 +00:00
Baptiste Daroussin
64793e748c diff: implement -y (--side-by-side) along with -W and --suppress-common-lines
PR:		219933
Submitted by:	fehmi noyan isi <fnoyanisi@yahoo.com>
MFC after:	3 weeks
2020-02-07 10:17:13 +00:00
Warner Losh
dd99ab06f3 Remove elf2aout
Remove the long obsolete elf2aout utility. Should any ports need to
know when this left the tree, use 1300077 as the revision so we
avoid multiple bumps for the sparc64 removal.

Reviewed by: brooks@, emaste@
Differential Revision: https://reviews.freebsd.org/D23527
2020-02-06 17:52:16 +00:00
Warner Losh
d6cc6be78c Mark elf2aout as deprecated.
Only sparc64 used this, so we will be removing it from FreeBSD 13. Add
the usual deprecation notice in a MFC-able way.

Reviewed by: emaste, rgrimes
Differential Revision: https://reviews.freebsd.org/D23526
2020-02-06 17:52:11 +00:00
Warner Losh
6a027eda92 No need to have a special sparc64 list here.
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D23525
2020-02-06 17:52:07 +00:00
Kyle Evans
fbdf47586e wc(1): account for possibility of file == NULL
file could reasonably be NULL here if we we're using stdin. Albeit less
likely in normal usage, one could actually hit either of these warnings on
stdin.

ubmitted by:	sigsys@gmail.com
MFC after:	3 days
2020-02-05 14:00:27 +00:00
Kyle Evans
85c8521e67 env(1): grow -L user/class and -U user/class options
This allows one to set the environment of the specified user either from
login.conf alone (-L) or both login.conf and ~/.login_conf if present (-U).

This is a supporting feature to allow service(8) to pull in the environment
of the "daemon" class before invoking the rc script.

This is a part of D21481.

Submitted by:	Andrew Gierth < andrew_tao173.riddles.org.uk>
2020-02-05 04:29:55 +00:00
Kyle Evans
ed6f64ff8a login.conf(5): set a default PATH for the daemon class
This is a sensible default used by, e.g., cron(8), and useful if one wanted
to honor it.

This is a part of D21481.

Submitted by:	Andrew Gierth <andrew_tao173.riddles.org.uk>
2020-02-05 04:27:08 +00:00
Kyle Evans
acf2957e49 login.conf(5): split MAIL env var out into a "mail" capability
This allows it to be easily suppressed in, e.g., the "daemon" class where it
will not be properly expanded.

This is a part of D21481.

Submitted by:	Andrew Gierth <andrew_tao173.riddles.org.uk>
2020-02-05 04:17:14 +00:00
Poul-Henning Kamp
446d49d762 Minor cleanups to allow handing vast datasets.
Submitted by: dds
2020-02-03 20:46:31 +00:00
Mateusz Piotrowski
4a3b87e295 units(1): Refactor the manual page and update usage information
Changes to units.1:

- Change the description to a more descriptive "conversion calculator".
- Sort options.
- Split the description into sections to make it easier to navigate the
  manual page.
- Improve the description of various options.
- Document the default value of the output format.
- Use more mdoc macros for better readability.
- Document the behavior of the PATH environmental variable.
- Improve examples.
- Add sections: EXIT STATUS, DIAGNOSTICS, and HISTORY.
- Document that units(1) cannot convert negative values and it handles long
  unit lists poorly.
- Update the documentation of the -V flag to match the implementation.
  units(1) prints its version and the units data file instead of its
  version and usage information.

Changes to units.c:

- Update usage information.
- Sort longopts elements.

This commit does not attempts to change the current behavior of units(1).
What's left to do is probably defining a better versioning (at the moment
units(1) always reports "FreeBSD units" as its version) and changing the
behavior of the -V flag to only print version.

Reviewed by:	allanjude (earlier version), bcr
Approved by:	bcr (mentor)
Differential Revision:	https://reviews.freebsd.org/D18977
2020-02-03 15:22:46 +00:00
Dimitry Andric
05273b1faa Merge r357345 from the clang1000-import branch:
Disable new clang 10.0.0 warnings about misleading indentation in flex.

As this is contributed code with very messy indentation, which will
almost certainly never be upgraded, just disable the warning.

MFC after:	3 days
2020-01-31 19:06:49 +00:00
Dimitry Andric
533a4a6296 Disable new clang 10.0.0 warnings about misleading indentation in flex.
As this is contributed code with very messy indentation, which will
almost certainly never be upgraded, just disable the warning.

MFC after:	3 days
2020-01-31 19:02:53 +00:00
Dimitry Andric
bb1d0df511 Merge ^/head r357179 through r357269. 2020-01-29 21:09:36 +00:00
Dimitry Andric
ec573c57bd Merge r357267 from the clang1000-import branch:
Fix the following -Werror warning from clang 10.0.0 in tip:

usr.bin/tip/tip/tip.c:428:4: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
                        if (gch == EOF)
                        ^
usr.bin/tip/tip/tip.c:426:5: note: previous statement is here
                } else if (!cumode && gch == character(value(FORCE)))
                  ^

The intent was to have the EOF check grouped with the getchar() call
just above it.  This was accidentally introduced in r354624.

MFC after:	3 days
2020-01-29 21:07:46 +00:00
Dimitry Andric
d405040f05 Merge r357260 from the clang1000-import branch:
Fix the following -Werror warning from clang 10.0.0 in procstat:

usr.bin/procstat/procstat_sigs.c:79:3: error: misleading indentation; statement is not part of the previous 'else' [-Werror,-Wmisleading-indentation]
                xo_close_container(name);
                ^
usr.bin/procstat/procstat_sigs.c:77:4: note: previous statement is here
        } else
          ^

The intent was to group the xo_close_container() call to the previous
snprintf() call.

MFC after:	3 days
2020-01-29 21:06:22 +00:00
Dimitry Andric
f5c072fb4c Fix the following -Werror warning from clang 10.0.0 in tip:
usr.bin/tip/tip/tip.c:428:4: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
                        if (gch == EOF)
                        ^
usr.bin/tip/tip/tip.c:426:5: note: previous statement is here
                } else if (!cumode && gch == character(value(FORCE)))
                  ^

The intent was to have the EOF check grouped with the getchar() call
just above it.  This was accidentally introduced in r354624.

MFC after:	3 days
2020-01-29 20:56:31 +00:00
Alfredo Dal'Ava Junior
d8a85b4237 Add myself (alfredo) to committers-src.dot and calendar.freebsd
Approved by:	jhibbits (mentor)
2020-01-29 17:39:38 +00:00
Dimitry Andric
7bf1ff65fc Fix the following -Werror warning from clang 10.0.0 in procstat:
usr.bin/procstat/procstat_sigs.c:79:3: error: misleading indentation; statement is not part of the previous 'else' [-Werror,-Wmisleading-indentation]
                xo_close_container(name);
                ^
usr.bin/procstat/procstat_sigs.c:77:4: note: previous statement is here
        } else
          ^

The intent was to group the xo_close_container() call to the previous
snprintf() call.

MFC after:	3 days
2020-01-29 17:01:02 +00:00
Dimitry Andric
773bec0868 Merge ^/head r357119 through r357178. 2020-01-27 20:47:18 +00:00
Dimitry Andric
f46f1d2836 Update build glue for lldb (MK_LLDB=yes). Also update lldb's generated
Config.h, disable a few more parts in the code we don't use, and add a
pre-generated man page.
2020-01-27 16:52:44 +00:00
Dimitry Andric
56e766af41 Update build glue for lld (MK_LLD=yes). Also update invocation of
elf::link() in lld.cpp.
2020-01-26 21:55:17 +00:00
Dimitry Andric
b1ae91026f Update build glue for extra clang/llvm tools (MK_CLANG_EXTRAS=yes). 2020-01-26 20:57:29 +00:00
Phil Shafer
5c5819b2b6 Import libxo-1.4.0:
- Two changes to encoder options:
        encoder options may use plus or colon, but only one
        encoder names can be specified as "@name"
        This results in the syntax:

        df --libxo @csv:no-header:leafs=name.available-blocks /

    - If xo_set_program is called before xo_parse_args, honor the requested value
    - add xo_errorn* function; repair newline-adding-on-xo_error bug
    - test programs now use fixed name, since linux libtool prefixs "lt-"
    - Fix "horse butt" comment in source code
    - update test cases

PR:		242686
2020-01-25 21:16:45 +00:00
Dimitry Andric
38b6f45657 Adjust libllvmminimal and tblgen Makefiles so all the tblgen executables
build.
2020-01-25 16:46:39 +00:00
Conrad Meyer
92f7ba208c random(6): Fix off-by-one
After r355693, random(6) -f sometimes fail to output all the lines of the
input file.  This is because the range from which random indices are chosen
is too big, so occasionally the random selection doesn't correspond to any
line and nothing gets printed.

(Ed. note: Mea culpa.  Working on r355693, I was confused by the sometime
use of 1-indexing, sometimes 0-indexing in randomize_fd().)

Submitted by:	Ryan Moeller <ryan AT freqlabs.com>
X-MFC-With:	r355693
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D23199
2020-01-16 21:38:44 +00:00
Alex Richardson
a963845304 Allow bootstrapping mkimg on macOS/Linux
On these systems the (u)int64_t typedefs will not be implicitly defined by the
previous includes, so include <stdint.h> in the header that uses uint64_t.

Reviewed By:	brooks
Differential Revision: https://reviews.freebsd.org/D23202
2020-01-16 14:14:55 +00:00
Mark Johnston
7dddaa0979 Do not skip line-by-line comparison if -q and -I are specified.
This fixes a regression from r356695.

Submitted by:	kevans
Reported by:	Jenkins via lwhsu
MFC after:	6 days
2020-01-14 15:35:03 +00:00
Baptiste Daroussin
12d9c0dc55 When system calls indicate an error they return -1, not some arbitrary
value < 0.  errno is only updated in this case.

Obtained from:	OpenBSD
MFC after:	3 days
2020-01-14 08:22:28 +00:00
Baptiste Daroussin
f9eac42577 asprintf returns -1, not an arbitrary value < 0. Also upon error the
(very sloppy specification) leaves an undefined value in *ret, so it is
wrong to inspect it, the error condition is enough.

Obtained from:	OpenBSD
MFC after:	3 days
2020-01-14 08:18:04 +00:00
Baptiste Daroussin
a3337141a4 mkstemp returns -1
Obtained from:	OpenBSD
MFC after:	3 days
2020-01-14 08:16:15 +00:00
Mark Johnston
5248d3b1b2 Optimize diff -q.
Once we know whether the files differ, we don't need to do any further
work.

PR:		242828
Submitted by:	fehmi noyan isi <fnoyanisi@yahoo.com> (original version)
Reviewed by:	bapt, kevans
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D23152
2020-01-13 18:29:47 +00:00
Kristof Provost
467d94844e gprof: Enable riscv
Add a missing riscv.h header file, and fix the check for riscv (must test
MACHINE_CPUARCH, not MACHINE_ARCH, if we want to use 'riscv').

Sponsored by:	Axiado
2020-01-13 16:52:26 +00:00
Cy Schubert
5452c16c21 Sync with r356645. desiredvnodes is now maxvnodes. 2020-01-13 06:55:38 +00:00
Cy Schubert
a4b840be50 As of r356642 desiredvnodes is u_long. 2020-01-13 06:55:35 +00:00
Garance A Drosehn
526473251e Fix the way 'factor' behaves when using OpenSSL to match the description
of how it works when not compiled with OpenSSL.

Also, allow users to specify a hexadecimal number by using a prefix of
'0x'.  Before this, users could only specify a hexadecimal value if that
value included a hex digit ('a'-'f') in the value.

PR:		243136
Submitted by:	Steve Kargl
Reviewed by:	gad
MFC after:	3 weeks
2020-01-12 20:25:11 +00:00
Rick Macklem
80a1b8c5e3 Update the man page to reflect that "-M" and "-N" are deprecated and ignored.
r356242 updated nfsstat.c to report that the "-M" and "-N" options were
being ignored. These options have never had any meaning for the new NFS
code (which is now the only NFS code).
This patch updates the man page to reflect this.

This is a content change.
2019-12-31 22:25:06 +00:00
Rick Macklem
28a04da3d7 Get rid of old nfsstat options no longer used.
The "-M" and "-N" options for nfsstat were used by the old NFS code and
have never done anything for the new NFS code.
This patch replaces code that assigns values to variables that are never
used with printf()s noting the options are ignored.
This has the side effect that it gets rid of warnings w.r.t. these
variables being assigned but never used, that occur for some builds.

Noticed during integration of the NFSv4.2 code.
2019-12-31 22:19:33 +00:00
Rick Macklem
29001a810a Replace .h files included from old NFS directories with the new NFS ones.
Prior to this patch, nfsstat.c includes files from sys/nfs, sys/nfsclient
and sys/nfsserver. These .h files (particularily the ones in sys/nfsclient
and sys/nfsserver) are from the old NFS code and should eventually be
deprecated/removed.
This patch changes nfsstat.c to include files from the new/current NFS
code instead of the old ones in preparation for eventual removal.
2019-12-31 00:07:10 +00:00
Martin Matuska
79085fd3b9 MFV r356163,r356197:
Update libarchive to 3.4.1

Relevant vendor changes since last update:
  Issue #351: Refactor and implement private state logic for write filters
  PR #1252: RAR5 reader - verify window size for solid files (OSS-Fuzz 15482)
  PR #1255: zip writer - don't append unused NUL for directories
  PR #1260: Fix sparse file offset overflow on 32-bit systems
  PR #1263: UNICODE filename support for reading lha/lzh format
  Issue #1276: Bugfix and optimize archive_wstring_append_from_mbs()
  PR #1288: Add the "xattrhdr" option to pax write options
  PR #1295: 7z reader - fix reading archives with digests in PackInfo
  PR #1296: RAR5 reader - verify window size for multivolume archives
  PR #1297: ZIP reader - support LZMA_STREAM_END marker in 'lzma alone' files
  Issue #1298: Fix a heap-buffer-overflow in archive_string_append_from_wcs()
  OSS-Fuzz 19360, 19362: LHA reader - plug two memory leaks on error
  Fix possible off-by-one when dealing with readlink(2)

MFC after:	2 weeks
2019-12-31 00:05:06 +00:00
Edward Tomasz Napierala
dc04811c2c Move type casts into a single place. No functional changes.
MFC after:	2 weeks
2019-12-29 12:24:41 +00:00
Rick Macklem
e68a89359a Update the nfsstat man page to reflect r355992.
r355992 added listing of NFSv4.2 procedure and operation counts.
This patch updates the nfsstat.1 man page to reflect that change.

This is a content change.
2019-12-22 00:36:22 +00:00
Rick Macklem
309c8f7673 Update nfsstat to list the NFSv4.2 procedures and operations.
r355677 added NFSv4.2 support to the NFS client and server. It also updated
the nfsstats structure to keep counts for the new procedures (client) and
operations (server) added for NFSv4.2.
This patch updates the "-E" option of nfsstat so that it lists counts for
these new procedures and operations.
2019-12-22 00:12:22 +00:00
Philip Paeps
fc8ae86a8f top: display battery capacity remaining
Submitted by: Antranig Vartanian <antranigv@freebsd.am>
Reviewed by:  imp, philip
Differential Revision:        https://reviews.freebsd.org/D22871
2019-12-21 05:03:21 +00:00
Dimitry Andric
0b57cec536 Move all sources from the llvm project into contrib/llvm-project.
This uses the new layout of the upstream repository, which was recently
migrated to GitHub, and converted into a "monorepo".  That is, most of
the earlier separate sub-projects with their own branches and tags were
consolidated into one top-level directory, and are now branched and
tagged together.

Updating the vendor area to match this layout is next.
2019-12-20 19:53:05 +00:00
Baptiste Daroussin
94678ee678 Replace homemade getline(3) by actual getline(3) 2019-12-17 11:03:32 +00:00
Baptiste Daroussin
9520071f7e Use strtoimax.
Use existing strtoimax instead of reinventing it
2019-12-17 09:13:48 +00:00
Gleb Smirnoff
185c3d2b93 Convert routing statistics to VNET_PCPUSTAT.
Submitted by:	ocochard
Reviewed by:	melifaro, glebius
Differential Revision:	https://reviews.freebsd.org/D22834
2019-12-17 02:02:26 +00:00
Phil Shafer
2db46b45f4 Allow proper builds of libxo's CSV encoder:
- Move libxo.a build to subdirectory (lib/libxo/libxo/Makefile)
- Add .WAIT target to delay encoder build til after libxo
- Use FILES to install encoder library as csv.enc
- Update import script to put xo_config.h in new location
2019-12-16 22:05:03 +00:00
Ian Lepore
d937171727 Support --all-repeats in uniq(1) for compatibility with gnu coreutils.
This adds a new -D/--all-repeats option to uniq(1), which outputs each copy
of any repeated lines (as opposed to a single copy of a repeated line). You
can specify a separator option to output a blank line before or after each
group of repeated lines. This adds compatibility with the GNU coreutils
version of uniq(1).

This change also re-groups the -c, -d, -D, -u options in the usage display
and man page to indicate that they are mutally exclusive of each other. This
matches the posix/opengroup definition of uniq(1) command line args. Note
that this change does NOT actually enforce the mutual exclusion in the code,
for now, it simply documents that the arguments should be considered
exclusive with each other.

Differential Revision:	https://reviews.freebsd.org/D22262
2019-12-15 18:05:18 +00:00
Edward Tomasz Napierala
1e62ecedf2 Add -M option to nc(1), which makes it print the TCP connection
statistics obtained with stats(3) in JSON format to standard error.

Reviewed by:	allanjude, thj, cem (earlier version)
Tested by:	thj
MFC after:	2 weeks
Relnotes:	yes
Sponsored by:	Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D21324
2019-12-14 10:53:52 +00:00
Conrad Meyer
c7b8411cc9 random(6): produce random results
This program is trash and there's no reason to keep it in base.  But as long as
we're shipping a silly program named 'random', let's actually make it random.
2019-12-13 04:37:39 +00:00
Eitan Adler
a88611b67b [showmount] implement long options
add long options support to showmount. Where mappings exist use the GNU
names for said options.

Differential Revision:	https://reviews.freebsd.org/D22543
Reviewed by:		kevans (earlier version)
2019-12-12 05:11:53 +00:00
Simon J. Gerraty
2c9a9dfc18 Update Makefile.depend files
Update a bunch of Makefile.depend files as
a result of adding Makefile.depend.options files

Reviewed by:	 bdrewery
MFC after:	1 week
Sponsored by:   Juniper Networks
Differential Revision:  https://reviews.freebsd.org/D22494
2019-12-11 17:37:53 +00:00
Simon J. Gerraty
5ab1c5846f Add Makefile.depend.options
Leaf directories that have dependencies impacted
by options need a Makefile.depend.options file
to avoid churn in Makefile.depend

DIRDEPS for cases such as OPENSSL, TCP_WRAPPERS etc
can be set in local.dirdeps-options.mk
which can add to those set in Makefile.depend.options

See share/mk/dirdeps-options.mk

Reviewed by:	 bdrewery
MFC after:	1 week
Sponsored by:   Juniper Networks
Differential Revision:  https://reviews.freebsd.org/D22469
2019-12-11 17:37:37 +00:00