Commit Graph

14441 Commits

Author SHA1 Message Date
Conrad Meyer
0877992e6b Revert r354847 for now
It was broken.

PR:		242095
Reported by:	lwhsu
2019-11-20 19:07:22 +00:00
Alex Richardson
52918a7b1b Allow boostrapping xinstall on Linux
Linux does not have st_flags so we have to avoid using it there.

Reviewed By:	emaste, imp
Differential Revision: https://reviews.freebsd.org/D22446
2019-11-20 17:24:49 +00:00
Conrad Meyer
82e14014a3 unifdef(1): Improve worst-case bound on symbol resolution
Use RB_TREE to make some algorithms O(lg N) and O(N lg N) instead of O(N)
and O(N^2).  Because N is typically small and the former linear array also has
great constant factors (as a property of CPU caching), this doesn't provide
material benefit most or all of the time.

While here, remove arbitrarily limit on number of macros understood.
2019-11-19 04:30:23 +00:00
Conrad Meyer
3cbfa41a57 unifdef(1): Kill totally useless header
No functional change.
2019-11-19 03:15:06 +00:00
Mark Johnston
738b2d5ceb Add a "B" suffix to memory quantities in top(1) output.
Otherwise small quantities look nonsensical.  For instance, when
swapping in a single page we would print "4096 In".

Fix code indentation while here.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2019-11-18 20:55:01 +00:00
Conrad Meyer
470182bb6e Link in NetBSD's unifdef(1) tests
Skip one, is it currently fails.
2019-11-18 04:03:11 +00:00
Justin Hibbits
6a51741fc7 gcore: Don't add VSX notes on powerpcspe
powerpcspe does not support VSX at all, but gets the 'VMX' notes for free,
providing the SPE registers.
2019-11-16 18:24:28 +00:00
Brooks Davis
051ed84f28 libcompat: Correct rtld MLINKS
Don't install duplicate ld-elf.so.1.1 and ld.so.1 links in rtld-elf32.
Do install lib-elf32.so.1.1 and ldd32.1 links.

Reported by:	madpilot
2019-11-12 22:31:59 +00:00
Bjoern A. Zeeb
4df8c94283 netstat: igmp stats, error on unexpected information, not only warn
The igmp stats tend to print two lines of warning for an unexpected
version and length.  Despite an invalid version and struct size it
continues to try to do something with the data.  Do not try to parse
the remainder of the struct and error on warning.

Note the underlying issue of the data not being available properly
is still there and needs to be fixed seperately.

Reported by:	test cases, lwhsu
MFC after:	3 weeks
2019-11-12 13:57:17 +00:00
Mike Karels
7483fbadf4 Fix netstat -gs with ip_mroute module and/or vnet
The code for "netstat -gs -f inet" failed if the kernel namelist did not
include the _mrtstat symbol. However, that symbol is not in a standard
kernel even with the ip_mroute module loaded, where the functionality is
available. It is also not in a kernel with MROUTING but also VIMAGE, as
there can be multiple sets of stats. However, when running the command
on a live system, the symbol is not used; a sysctl is used. Go ahead
and try the sysctl in any case, and complain that IPv4 MROUTING is not
present only if the sysctl fails with ENOENT. Also fail if _mrtstat is
not defined when running on a core file; netstat doesn't know about vnets,
so can only work if MROUTING was included, and VIMAGE was not.

Reviewed by:	bz
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D22311
2019-11-12 01:03:08 +00:00
Eric van Gyzen
552117964a tip/cu: check for EOF on input on the local side
If cu reads an EOF on the input side, it goes into a tight loop
sending a garbage byte to the remote.  With this change, it exits
gracefully, along with its child.

MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2019-11-11 17:41:52 +00:00
Edward Tomasz Napierala
75ad2fd059 Humanize more columns in the vmstat(8) output and adjust widths.
The few columns that are not humanized are usually 0.  This makes
the output mostly aligned.

Reviewed by:	allanjude
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D22185
2019-11-08 11:09:50 +00:00
Brooks Davis
a4330302f2 libcompat: build 32-bit rtld and ldd as part of "everything"
Alter bsd.compat.mk to set MACHINE and MACHINE_ARCH when included
directly so MD paths in Makefiles work. In the process centralize
setting them in LIBCOMPATWMAKEENV.

Alter .PATH and CFLAGS settings in work when the Makefile is included.

While here only support LIB32 on supported platforms rather than always
enabling it and requiring users of MK_LIB32 to filter based
TARGET/MACHINE_ARCH.

The net effect of this change is to make Makefile.libcompat only build
compatability libraries.

Changes relative to r354449:

Correct detection of the compiler type when bsd.compat.mk is used
outside Makefile.libcompat.  Previously it always matched the clang
case.

Set LDFLAGS including the linker emulation for mips where -m32 seems to
be insufficent.

Reviewed by:	imp, kib (origional version in r354449)
Obtained from:	CheriBSD (conceptually)
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D22251
2019-11-07 22:58:10 +00:00
Brooks Davis
ccad77fe1e Revert r354449: libcompat: build 32-bit rtld and ldd as part of "everything"
Additional testing is required..
2019-11-07 19:22:51 +00:00
Phil Shafer
67322d1642 Import libxo-1.3.1:
- handle argv[0] without '/'
- add test case for argv[0] without '/'
2019-11-07 18:06:44 +00:00
Joseph Mingrone
5e5ceb11cb Add -0 option to ENV(1)
With the -0 option added to ENV(1), some ports will no longer require genv
from sysutils/coreutils.

Reviewed by:	kevans (prior version), swills
Approved by:	bcr (manpages), imp
Differential Revision:	https://reviews.freebsd.org/D22230
2019-11-07 17:14:59 +00:00
Brooks Davis
36712a9497 libcompat: build 32-bit rtld and ldd as part of "everything"
Alter bsd.compat.mk to set MACHINE and MACHINE_ARCH when included
directly so MD paths in Makefiles work. In the process centralize
setting them in LIBCOMPATWMAKEENV.

Alter .PATH and CFLAGS settings in work when the Makefile is included.

While here only support LIB32 on supported platforms rather than always
enabling it and requiring users of MK_LIB32 to filter based
TARGET/MACHINE_ARCH.

The net effect of this change is to make Makefile.libcompat only build
compatability libraries.

Reviewed by:	imp, kib
Obtained from:	CheriBSD (conceptually)
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D22251
2019-11-07 17:10:33 +00:00
Phil Shafer
76afb20c58 Import libxo-1.3.0:
- move from "oxtradoc" to RST/Sphinx documentation
- new "csv" encoder, which allows path and leaf lists
- address warnings from PVS-Stdio tool
- add "xolint" detected errors to the documentation
2019-11-07 03:57:04 +00:00
Mark Johnston
7ef518c05a fileargs_init() sets errno on failure.
Sponsored by:	The FreeBSD Foundation
2019-11-06 01:42:30 +00:00
Kyle Evans
50dacbf6c2 patch(1): give /dev/null patches special treatment
We have a bad habit of duplicating contents of files that are sourced from
/dev/null and applied more than once... take the more sane (in most ways)
GNU route and complain if the file exists and offer reversal options.

This still falls short a little bit as selecting "don't reverse, apply
anyway" will still give you duplicated file contents. There's probably other
issues as well, but awareness is the first step to happiness.

MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D21535
2019-11-04 03:07:01 +00:00
Brooks Davis
cc86d14a47 truss: centralize pointer-constructing casts.
In nearly all cases, the caller has a uintptr_t compatible argument so
this eliminates a large number of casts.

Add a print_pointer function to centralize printing pointers.

Reviewed by:	jhb
Obtained from:	CheriBSD
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D22212
2019-10-31 22:29:13 +00:00
Edward Tomasz Napierala
5a84f74f5b Fix column title alignment.
MFC after:	2 weeks
2019-10-29 20:28:02 +00:00
Jeremie Le Hen
6f42902de3 Grammar fix.
Reported by:	imp
Differential Revision:	https://reviews.freebsd.org/D21880
2019-10-28 21:48:20 +00:00
Emmanuel Vadot
c571e05c2c dtc: Allow multiple dts-v1 tag
Some dts are including dtsi that also contain a /dts-v1/ tag at the
top. GNU DTC doesn't seems to have a problem with that so fix our
dtc to behave the same.

Reviewed by:	kevans
MFC after:	1 week
2019-10-26 17:10:27 +00:00
Warner Losh
dd376a963c exit requires stdlib.h to be included to use.
FreeBSD 10.3 requires this, and dtc is a bootstrap tool so it needs to compile
there.
2019-10-23 19:23:31 +00:00
Greg Lehey
67fd12c006 Correct spelling, apply appropriate respect. 2019-10-23 01:11:25 +00:00
Jeremie Le Hen
91ad311be0 Add the fstat -s option to display socket information.
Reviewed by:	jilles
MFC after:	1 week
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D21880
2019-10-19 19:52:19 +00:00
Jeremie Le Hen
ce0372d7e1 Remove IS_INADDR_ANY().
Requested by rgrimes@ in
https://lists.freebsd.org/pipermail/svn-src-head/2019-October/129784.html
2019-10-19 19:38:53 +00:00
Poul-Henning Kamp
9febfb7904 Improve the way we calculate variance to reduce the rounding errors
when variance is small relative to data points.

Now [0, 1, 2] shows same standard deviation as [10000000000000, ...1, ...2]

Also:  Various nitpickery from my own tree.
2019-10-18 07:55:01 +00:00
Dimitry Andric
fd9d16bddb Ensure lld respects the WITH/WITHOUT_SHARED_TOOLCHAIN option
Traditionally, toolchain components such as cc, as, and ld have been
built as static executables.  The WITH_SHARED_TOOLCHAIN option from
src.conf(5) is meant to link these as regular executables, e.g. using
shared libraries.

The build of ld.lld did not yet check this option.  Fix the Makefile so
it will do so now.

Reported by:	Mike Cui <cuicui@gmail.com>
PR:		241257
MFC after:	3 days
2019-10-16 17:11:18 +00:00
Brooks Davis
7c8b268a12 rpcgen: make compiler arglist allocation dynamic
Limit argmax to an absurdly large value prevent overflow (no overflow
possible on FreeBSD due to ARG_MAX).

In CheriBSD we exceed the 19 non-NULL arguments in the static array.  Add
a simple size doubling allocator and increase the default to 32.

GC remnants of support for fixed arguments.

Reviewed by:	archardson (prior version), James Clarke (prior version)
MFC after:	1 week
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D21971
2019-10-15 16:05:17 +00:00
Oleksii Samorukov
861e74ac19 Add myself (samm) to calendar.freebsd
Approved by:    araujo (mentor), krion (mentor)
Differential Revision:  https://reviews.freebsd.org/D21985
2019-10-13 18:03:23 +00:00
Justin Hibbits
942aefd567 gcore: Add powerpc64 32-bit gcore support
Summary: Add the necessary bits for taking 32-bit gcore coredumps on powerpc64.

Reviewed by:	luporl
Differential Revision:	https://reviews.freebsd.org/D21954
2019-10-11 14:17:31 +00:00
Justin Hibbits
26517dcf60 gcore: Add aarch64 32-bit core support
Summary: Add trivial 32-bit arm cores on aarch64 support for gcore.  This
doesn't handle fpregs.

Reviewed by:	#arm, andrew
Sponsored by:	Juniper Networks, Inc
Differential Revision:	https://reviews.freebsd.org/D21947
2019-10-11 14:15:50 +00:00
Jeremie Le Hen
eadfb49fe1 Add a missing macro for the previous commit (IS_INADDR_ANY()). 2019-10-09 20:05:14 +00:00
Jeremie Le Hen
b9eabd15fd Use inet_ntop(3) instead of inet_ntoa(3) for AF_INET socket details.
This also makes the code closer to the one used for AF_INET6.
2019-10-09 20:01:23 +00:00
Dimitry Andric
9122aeeaa6 Merge ^/head r353316 through r353350. 2019-10-09 16:40:22 +00:00
Brooks Davis
f189761366 Fix various -Wpointer-compare warnings
This warning (comparing a pointer against a zero character literal
rather than NULL) has existed since GCC 7.1.0, and was recently added to
Clang trunk.

Almost all of these are harmless, except for fwcontrol's str2node, which
needs to both guard against dereferencing a NULL pointer (though in
practice it appears none of the callers will ever pass one in), as well
as ensure it doesn't parse the empty string as node 0 due to strtol's
awkward interface.

Submitted by:	James Clarke <jtrc27@jrtc27.com>
Obtained from:	CheriBSD
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D21914
2019-10-08 21:14:09 +00:00
Dimitry Andric
8b3bc70a2b Merge ^/head r352764 through r353315. 2019-10-08 18:17:02 +00:00
Alan Somers
123d18b5c7 tftp: fix two minor Coverity CIDs
Reported by:	Coverity
CID 1394842: file descriptor leak in an error path
CID 1007603: single byte array overflow
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D21695
2019-10-03 20:22:25 +00:00
John Baldwin
fbf0f3106c Restore description of packets dropped due to full reassembly queue.
r265408 renamed tcps_rcvmemdrop to tcps_rcvreassfull and gave it a more
specific description.  r279122 (libxo-ification) reverted that change.
This commit brings it back, but with a small tweak to the description.

MFC after:	2 weeks
2019-10-03 18:24:41 +00:00
John Baldwin
214b76700c Fix a typo in a comment. 2019-10-03 18:12:34 +00:00
Kyle Evans
4f68b172e1 clang: use -mxgot for 32-bit mips
Various bits in usr.bin/clang/* will fail to compile without -mxgot due to
truncated relocations. -mxgot entails a speed penalty, but I suspect we
don't care as much about compiler performance in 32-bit mips land.

Reviewed by:	arichardson
Differential Revision:	https://reviews.freebsd.org/D21698
2019-10-02 17:15:38 +00:00
Alexander Kabaev
bcd34af473 Revert r352953: Convert pnmatch to single element array in regexec calls
Requested by: cem
2019-10-02 16:08:01 +00:00
Alexander Kabaev
c5672dd7b9 Convert pnmatch to single element array in regexec calls
The regexec function is declared as taking an array of regmatch_t
elements, and passing in the pointer to singleton element, while
correct, triggers a Coverity warning. Convert the singleton into
an array of one to silence the warning.

Reported by:	Coverity
Coverity CID:	1009732, 1009733
MFC after:	2 weeks
2019-10-02 06:15:30 +00:00
Mark Johnston
052ad61b7e Capsicumize nm(1).
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D21107
2019-09-30 17:27:59 +00:00
Dimitry Andric
fc4ac32fa7 Allow entering fractional delays in top(1) interactive mode.
This uses the same logic as with the -s option, first validating the
entered value, then storing the result in a struct timeval.

MFC after:	3 days
X-MFC-With:	r352818
2019-09-27 20:53:31 +00:00
Dimitry Andric
a6f721ece8 Make fractional delays for top(1) work for interactive mode.
In r334906, the -s option was changed to allow fractional times, but
this only functioned correctly for batch mode.  In interactive mode, any
delay below 1.0 would get floored to zero.  This would put top(1) into a
tight loop, which could be difficult to interrupt.

Fix this by storing the -s option value (after validation) into a struct
timeval, and using that struct consistently for delaying with select(2).

Next up is to allow interactive entry of a fractional delay value.

MFC after:	3 days
2019-09-27 20:20:21 +00:00
Dimitry Andric
1a444441d8 Correct the final argument name in the top(1) manpage.
The description talks about 'number', while the final argument was
'count'.  Since 'count' is already used for the count of displays,
change the final argument name to 'number'.

MFC after:	3 days
2019-09-27 17:11:21 +00:00
Dimitry Andric
668ee10168 Merge ^/head r352587 through r352763. 2019-09-26 18:25:54 +00:00
David Bright
9afb12bab4 Add an shm_rename syscall
Add an atomic shm rename operation, similar in spirit to a file
rename. Atomically unlink an shm from a source path and link it to a
destination path. If an existing shm is linked at the destination
path, unlink it as part of the same atomic operation. The caller needs
the same permissions as shm_unlink to the shm being renamed, and the
same permissions for the shm at the destination which is being
unlinked, if it exists. If those fail, EACCES is returned, as with the
other shm_* syscalls.

truss support is included; audit support will come later.

This commit includes only the implementation; the sysent-generated
bits will come in a follow-on commit.

Submitted by:	Matthew Bryan <matthew.bryan@isilon.com>
Reviewed by:	jilles (earlier revision)
Reviewed by:	brueffer (manpages, earlier revision)
Relnotes:	yes
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D21423
2019-09-26 15:32:28 +00:00
Ed Maste
20bd59416d bspatch: add integer overflow checks
Introduce a new add_off_t static function that exits with an error
message if there's an overflow, otherwise returns their sum.  Use this
when adding values obtained from the input patch.

Reviewed by:	delphij, allanjude (earlier)
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D7897
2019-09-26 13:27:25 +00:00
Kyle Evans
a9ac5e1424 sysent: regenerate after r352705
This also implements it, fixes kdump, and removes no longer needed bits from
lib/libc/sys/shm_open.c for the interim.
2019-09-25 18:09:19 +00:00
Kyle Evans
38325e2ab8 bsdgrep(1): various fixes of empty pattern/exit code/-c behavior
When an empty pattern is encountered in the pattern list, I had previously
broken bsdgrep to count that as a "match all" and ignore any other patterns
in the list. This commit rectifies that mistake, among others:

- The -v flag semantics were not quite right; lines matched should have been
  counted differently based on whether the -v flag was set or not. procline
  now definitively returns whether it's matched or not, and interpreting
  that result has been kicked up a level.
- Empty patterns with the -x flag was broken similarly to empty patterns
  with the -w flag. The former is a whole-line match and should be more
  strict, only matching blank lines. No -x and no -w will will match the
  empty string at the beginning of each line.
- The exit code with -L was broken, w.r.t. modern grep. Modern grap will
  exit(0) if any file that didn't match was output, so our interpretation
  was simply backwards. The new interpretation makes sense to me.

Tests updated and added to try and catch some of this.

This misbehavior was found by autoconf while fixing ports found in PR 229925
expecting either a more sane or a more GNU-like sed.

MFC after:	1 week
2019-09-25 17:14:43 +00:00
Dimitry Andric
f05b9584fa Merge ^/head r352537 through r352586. 2019-09-21 21:02:57 +00:00
Mateusz Piotrowski
a811237df2 jot.1: Explain default argument values more precisely
The way jot(1) defaults missing arguments doesn't match the behaviour
described in the manpage, which states that with fewer than 3 arguments
missing values are supplied from left to right.

In fact, with one or two arguments, the last (s which is step size or seed)
defaults to 1 (or -1 if begin and end specify a descending range), and then
omitted arguments are set to default starting with the leftmost until three
arguments are available.

This is why `jot 2 1000` prints 1000 and 1001 instead of 1000 and 100.

PR:		135475
Submitted by:	Jonathan McKeown <j.mckeown@ru.ac.za>
Approved by:	doc (bcr)
Differential Revision:	https://reviews.freebsd.org/D21736
Event:		EuroBSDcon 2019
2019-09-21 15:01:11 +00:00
Hiroki Sato
ecc2b89f96 Impove wording and move descriptions about
locale to LC_CTYPE in the ENVIRONMENT section.
2019-09-21 00:44:37 +00:00
Hiroki Sato
740a5434e9 Add a workaround for servers which respond RPC_PROGNOTREGISTERED
to a clnt_create() call even when it is actually a program
version mismatch.

Normally the server is supposed to return RPC_PROGVERSMISMATCH
when it supports the specified program but not support
the specified version.  Some filers return RPC_PROGNOTREGISTERED
to RQUOTA v2 calls and FreeBSD does not retry with the old
v1 calls.  This change fixes this failure scenario.

Submitted by:	Jian-Bo Liao
PR:		236179
2019-09-21 00:17:40 +00:00
Daichi GOTO
b1de37fadd top(1): support multibyte characters in command names (ARGV array)
depending on locale.

 - add setlocale()
 - remove printable() function
 - add VIS_OCTAL and VIS_SAFE to the flag of strvisx() to display
   non-printable characters that do not use C-style backslash sequences
   in three digit octal sequence, or remove it

This change allows multibyte characters to be displayed according to
locale. If it is recognized as a non-display character according to the
locale, it is displayed in three digit octal sequence.

Reference:
https://www.mail-archive.com/svn-src-all@freebsd.org/msg165751.html
https://www.mail-archive.com/svn-src-all@freebsd.org/msg165766.html
https://www.mail-archive.com/svn-src-all@freebsd.org/msg165833.html
https://www.mail-archive.com/svn-src-all@freebsd.org/msg165846.html
https://www.mail-archive.com/svn-src-all@freebsd.org/msg165891.html

Submitted by: hrs
Differential Revision: https://reviews.freebsd.org/D16204
2019-09-20 17:37:23 +00:00
Dimitry Andric
0f80acb965 Merge ^/head r352436 through r352536. 2019-09-19 19:26:12 +00:00
Konstantin Belousov
43ce0d902c truss: decode sysctl names.
Submitted by:	Pawel Biernacki
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D21688
2019-09-18 16:15:05 +00:00
Dimitry Andric
419f843fff Merge ^/head r352319 through r352435. 2019-09-17 06:08:15 +00:00
Dmitri Goutnik
26a9d16680 Add myself (dmgk) to calendar.freebsd
Approved by:	tz (mentor)
Differential Revision:	https://reviews.freebsd.org/D21675
2019-09-16 20:43:20 +00:00
Dimitry Andric
61c1328eb0 Merge ^/head r352105 through r352307. 2019-09-13 21:15:01 +00:00
Baptiste Daroussin
17f3442729 Remove remnant from the pre LIBADD era 2019-09-13 14:51:00 +00:00
Yuri Pankov
eb6dbc2271 locale: initialize variables to make gcc happy
Reported by:	jenkins
2019-09-11 16:00:03 +00:00
Yuri Pankov
de96322b74 locale: more output fixes
- make abday, day, abmon, mon, am_pm output quoting match linux
- workaround localeconv() issue for mon_grouping and grouping (PR172215)
- for other values not available in default locale, output -1 instead of
  127 (CHAR_MAX) as returned by localeconv()

With these changes, output of `locale` and `locale -k` for all keywords
specified by POSIX exactly matches the linux one.

PR:		237752
Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D21599
2019-09-11 15:39:28 +00:00
Yuri Pankov
42249ef234 locale: handle day, abday, mon, abmon, am_pm keywords
All of these are defined as mandatory by POSIX.

While here, mark all non-standard ones as FreeBSD-only as
other systems (at least, GNU/Linux and illumos) do not handle
them, so we should not encourage their use.

PR:		237752
Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D21490
2019-09-10 15:09:46 +00:00
Baptiste Daroussin
c844ab6717 Remove mklocale(1) and colldef(1) which are deprecated since FreeBSD 11
In FreeBSD 11 along with the rework on the collation, mklocale(1) and colldef(1)
has been replaced by localedef(1) (a note has been added to the manpage to state
it).
mklocale(1) and colldef(1) has been kept around to be able to build older
versions of FreeBSD. None of the version requiring those tools are supported
anymore so it is time to remove them from base
2019-09-10 07:54:49 +00:00
Gleb Smirnoff
e67975d331 Fix 'calendar -a' in several ways.
o Do not run any iconv() processing in -a. The locale of root user is not
  what is desired by most of the users who receive their calendar mail.
  Just assume that users store their calendars in a format that is readable
  to them. This fixes regression from r344340.
o fork() and setusercontext(LOGIN_SETALL) for every user. This makes LANG
  set inside a calendar file mostly excessive, as we will pick up user's
  login class LANG.
o This also executes complex function cal() that parses user owned files
  with appropriate user privileges.
  Previously it was run with privileges dropped only temporary for execution
  of cal(), and fully dropped only before invoking sendmail (see r22473).

Reviewed by:	bapt (older version of patch)
2019-09-10 04:21:48 +00:00
Gleb Smirnoff
1e01d2dcac Remove pointless playing with LC_TIME, which should have been done in r205821. 2019-09-10 04:01:41 +00:00
Dimitry Andric
f993ed2fbd Merge ^/head r351732 through r352104. 2019-09-09 19:58:46 +00:00
Baptiste Daroussin
c57596e1ae m4: import from OpenBSD
By deraadt@

mkstemp() returns -1 on failure

Obtained from:	OpenBSD
2019-09-09 15:37:40 +00:00
Baptiste Daroussin
db531a5d18 m4: import from OpenBSD
patch by espie@

replace sloppy parsing of numeric values with strtonum (incr, decr, divert)

still use integers, so use the natural bounds for these.

POSIX says m4 should error when these use non numeric values, and now they
do.

okay millert@

Obtained from:	OpenBSD
2019-09-09 15:35:34 +00:00
Baptiste Daroussin
e0f4e0415e m4: import patch from OpenBSD
by espie@
ifelse is special, fix argv parsing to avoid segfault

problem noticed by Matthew Green (netbsd), slightly different fix
so that argc counting makes more sense.

we might want to warn on wrong number of parameters later, but this is
somewhat inconsistent depending on the builtin right now.

okay millert@

Obtained from:	OpenBSD
2019-09-09 15:28:22 +00:00
Baptiste Daroussin
fdb905e20f m4: import patch from OpenBSD
Use waitpid()/EINTR idiom for the specific pid, rather than generic wait()

Patch by: deraadt@

Obtained from:	OpenBSD
2019-09-09 15:24:48 +00:00
Baptiste Daroussin
d031bd192e Import from OpenBSD a patch which eliminates the link with -ly or -ly
patch by ibara@

Obtained from:	OpenBSD
2019-09-09 15:20:19 +00:00
Baptiste Daroussin
c560b67c5c Import from OpenBSD: -E flag
Add -E flag (make warnings fatal), following the behavior of GNU m4 1.4.9+

Help and direction millert@ espie@ anton@ deraadt@

ok espie@

Obtained from:	OpenBSD
2019-09-09 15:18:04 +00:00
Kyle Evans
89b5571e0b patch(1): fix the file removal test, strengthen it a bit
To remain compatible with GNU patch, we should ensure that once we're
removing empty files after a reversed /dev/null patch we don't remove files
that have been modified. GNU patch leaves these intact and just reverses the
hunk that created the file, effectively implying --remove-empty-files for
reversed /dev/null patches.
2019-09-05 15:35:57 +00:00
Emmanuel Vadot
a7b5a3d486 pkgbase: Put a lot of binaries and lib in FreeBSD-runtime
All of them are needed to be able to boot to single user and be able
to repair a existing FreeBSD installation so put them directly into
FreeBSD-runtime.

Reviewed by:    bapt, gjb
Differential Revision:  https://reviews.freebsd.org/D21503
2019-09-05 14:13:08 +00:00
Kyle Evans
b27524973c patch(1): add some basic tests
Summary:
- basic: test application of patches created by diff -u at the
  beginning/middle/end of file, which have differing amounts of context
  before and after chunks being added
- limited_ctx: stems from PR 74127 in which a rogue line was getting added
  when the patch should have been rejected. Similar behavior was
  reproducible with larger contexts near the beginning/end of a file. See
  r326084 for details
- file_creation: patch sourced from /dev/null should create the file
- file_nodupe: said patch sourced from /dev/null shouldn't dupe the contents
  when re-applied (personal vendetta, WIP, see comment)
- file_removal: this follows from nodupe; the reverse of a patch sourced
  from /dev/null is most naturally deleting the file, as is expected based
  on GNU patch behavior (WIP)
2019-09-05 03:16:14 +00:00
Jilles Tjoelker
ddc0daea20 procstat/tests: Fix flakiness by waiting for program to start
Some of the procstat tests start a program "while1" and examine the process
using procstat, but did not wait properly for it to start (kill -0 will
succeed immediately after the child process has been created).

Instead, have "while1" write something when it starts, and use a fifo to
wait for that.

PR:		233587, 233588
Reviewed by:	ngie
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D21519
2019-09-04 16:25:41 +00:00
Sevan Janiyan
08509077b3 Adjust history, info source from v1's manuals
https://www.bell-labs.com/usr/dmr/www/1stEdman.html

MFC after:	5 days
2019-09-04 13:44:46 +00:00
Konstantin Belousov
c22994e3ad Add stackgap control mode to proccontrol(1).
PR:	239894
Reviewed by:	alc
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D21352
2019-09-03 18:58:48 +00:00
Kyle Evans
aef64c62c2 bsdgrep(1): add some basic tests for some GNU Extension support
These will be expanded later as I come up with good test cases; for now,
these seem to be enough to trigger bugs in base gnugrep and expose missing
features in bsdgrep.
2019-09-03 18:32:29 +00:00
Dimitry Andric
c5c3ba6b43 Merge ^/head r351317 through r351731. 2019-09-03 05:58:43 +00:00
Mark Johnston
c993b95329 Fix an off-by-one bug in the CPU and domain ID parser.
The "size" parameter is the size of the corresponding bit set, so the
maximum CPU or domain index is size - 1.

MFC after:	1 week
2019-09-01 21:20:31 +00:00
Ed Maste
597d9b4008 ar: use more correct size_t type for loop index
Submitted by:	cem
MFC after:	1 week
2019-09-01 16:51:25 +00:00
Jason Helfman
7d5b071384 - address missing whitespace for indent
PR:		239727
Submitted by:	gbergling@gmail.com
Reviewed by:	0mp@
MFC after:	1 week
2019-08-29 23:23:12 +00:00
Mike Karels
ae3353515b Fix address annotation in xml output from w
The libxo xml feature of adding an annotation with the "original"
address from the utmpx file if it is different than the final "from"
field was broken by r351379. This was pointed out by the gcc error
that save_p might be used uninitialized. Save the original address
as needed in each entry, don't just use the last one from the previous
loop.

Reviewed by:	marcel@
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D21390
2019-08-29 02:44:18 +00:00
Mark Johnston
69ac7c7671 Install all bzip2.1 MLINKs from the same place.
Reported by:	antoine
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2019-08-28 21:01:51 +00:00
Dimitry Andric
a32f82c2c1 Update build glue for a build of clang plus lldb (enabled via MK_LLDB). 2019-08-26 21:00:14 +00:00
Dimitry Andric
560bf0c7df Add lldb-tblgen tool. 2019-08-26 20:57:45 +00:00
Edward Tomasz Napierala
90a7bed401 Make it clear what the userland traces are in the ktrace(1) man page.
MFC after:	2 weeks
2019-08-26 10:18:19 +00:00
Eugene Grosbein
f424ec1b80 last(1): fix style after r351459
Reported by:	cem
MFC after:	2 weeks
X-MFC-With:	351459
2019-08-25 01:05:01 +00:00
Dimitry Andric
390be9fc05 Update build glue for a build of clang plus lld (enabled via MK_LLD). 2019-08-24 22:07:38 +00:00
Dimitry Andric
24b8043ea5 Update build glue for a build of clang plus the extra tools (enabled via
MK_CLANG_EXTRAS).
2019-08-24 19:21:11 +00:00
Eugene Grosbein
0ca58ca151 last(1): correction after r351413
Make that change no-op for C/POSIX locale just like for UTF-8
that it superset of US-ASCII.

MFC after:	2 weeks
X-MFC-With:	r351413
2019-08-24 15:50:13 +00:00
Dimitry Andric
4014a71fd2 Update build glue for a minimal build of the clang executable. 2019-08-23 22:17:36 +00:00
Ed Maste
40adef9e59 vtfontcvt: simplify rshift_row
We don't need to specify the buffer size in both bytes and bits.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2019-08-23 16:03:23 +00:00
Eugene Grosbein
8e67c427b5 last(1): unbreak for 8-bit locales
Ouput format of last(1) is broken for non UTF-8 locales
since it got libxo(3) support. It uses strftime(3) that produces
non UTF-8 strings passed to xo_emit(3) with wrong %s format -
it should be %hs in this case, so xo_emit(3) produces empty output.

This change is basically no-op when locale is of UTF-8 type,
f.e. en_GB.UTF-8 or ru_RU.UTF-8 or sr_RS.UTF-8@latin.
It fixes output for other locales.

MFC after:	2 weeks
2019-08-23 01:25:38 +00:00
Bjoern A. Zeeb
fada51254f w: initialize save_p to silence 'may be used uninitilized'
After r351379 save_p may be used uninitialized.  Set it to NULL before
first assignment so that a later NULL check will work correctly.

Reported by:		CI system for gcc platforms
MFC after:		1 week
X-MFC with:		351379 (karels)
2019-08-22 07:52:06 +00:00
Mike Karels
ec9801de1e Change w(1) to compute FROM (host) field size dynamically
It's nice to be able to display a full IPv6 host address if
needed, but it's also nice to display more than 3 characters of a command
line. Compute the needed size for the FROM column in an earlier pass,
and determine the maximum, then print what fits for the command.

Reviewed by:	marcel@ (markm@ previous revision)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D21211
2019-08-22 03:28:31 +00:00
Bjoern A. Zeeb
6d7adebad5 gprof: disable building of a.out components
On arm64, riscv, and s390x disable building of aout components.
This allows gprof to build on these architectures which never supported
the legacy a.out binary format.

Obtained from:		s390x branch
MFC after:		3 months
2019-08-21 10:54:52 +00:00
Hans Petter Selasky
5c1d971003 Include item position in report descriptor dump in usbhidctl(1).
Submitted by:	Kevin Zheng <kevinz5000@gmail.com>
PR:		239918
MFC after:	1 week
2019-08-17 08:29:22 +00:00
Kirk McKusick
48622bc539 Add missing comma in calendar.freebsd 2019-08-15 18:46:27 +00:00
Conrad Meyer
eefd8f96fb geom_uzip(4), mkuzip(8): Add Zstd image mode
The Zstd format bumps the CLOOP major number to 4 to avoid incompatibility
with older systems.  Support in geom_uzip(4) is conditional on the ZSTDIO
kernel option, which is enabled in amd64 GENERIC, but not all in-tree
configurations.

mkuzip(8) was modified slightly to always initialize the nblocks + 1'th
offset in the CLOOP file format.  Previously, it was only initialized in the
case where the final compressed block happened to be unaligned w.r.t.
DEV_BSIZE.  The "Fake" last+1 block change in r298619 means that the final
compressed block's 'blen' was never correct unless the compressed uzip image
happened to be BSIZE-aligned.  This happened in about 1 out of every 512
cases.  The zlib and lzma decompressors are probably tolerant of extra trash
following the frame they were told to decode, but Zstd complains that the
input size is incorrect.

Correspondingly, geom_uzip(4) was modified slightly to avoid trashing the
nblocks + 1'th offset when it is known to be initialized to a good value.
This corrects the calculated final real cluster compressed length to match
that printed by mkuzip(8).

mkuzip(8) was refactored somewhat to reduce code duplication and increase
ease of adding other compression formats.

  * Input block size validation was pulled out of individual compression
    init routines into main().

  * Init routines now validate a user-provided compression level or select
    an algorithm-specific default, if none was provided.

  * A new interface for calculating the maximal compressed size of an
    incompressible input block was added for each driver.  The generic code
    uses it to validate against MAXPHYS as well as to allocate compression
    result buffers in the generic code.

  * Algorithm selection is now driven by a table lookup, to increase ease of
    adding other formats in the future.

mkuzip(8) gained the ability to explicitly specify a compression level with
'-C'.  The prior defaults -- 9 for zlib and 6 for lzma -- are maintained.
The new zstd default is 9, to match zlib.

Rather than select lzma or zlib with '-L' or its absense, respectively, a
new argument '-A <algorithm>' is provided to select 'zlib', 'lzma', or
'zstd'.  '-L' is considered deprecated, but will probably never be removed.

All of the new features were documented in mkuzip.8; the page was also
cleaned up slightly.

Relnotes:	yes
2019-08-13 23:32:56 +00:00
Mateusz Piotrowski
9236a881f6 install.1: Add missing arguments to option descriptions
While here:
- Remove deprecated Tn macros.
- Do not use macros with the -width option.

Reviewed by:	bcr
Approved by:	doc (bcr)
Differential Revision:	https://reviews.freebsd.org/D21173
2019-08-12 10:57:56 +00:00
Mark Johnston
bbb4c4d8bb Flesh out the STANDARDS and AUTHORS sections in the du(1) man page.
PR:		239722
Submitted by:	Gordon Bergling <gbergling@gmail.com>
MFC after:	3 days
2019-08-08 21:16:15 +00:00
Mark Johnston
ced9ddb250 Update RFC references in the whois(1) man page.
PR:		239720
Submitted by:	Gordon Bergling <gbergling@gmail.com>
MFC after:	3 days
2019-08-08 21:15:02 +00:00
Gleb Smirnoff
29bf090e15 resource.h is sufficient here, no need for resoursevar.h. 2019-08-07 18:32:01 +00:00
John Baldwin
67b3fe8ecf Tidy up the list of auth and encryption algorithms for IPsec stats.
- Use keyed-md5 and keyed_sha1 instead of md5 and sha1 to match
  the names accepted by setkey and to also avoid confusion since
  these are not "plain" MD5 or SHA1.
- Remove always-true #ifdef's to make the source a bit easier to
  read.
- Add missing mappings for tcp-md5, camellia-cbc, and aes-gmac.

MFC after:	2 weeks
Sponsored by:	Chelsio Communications
2019-08-07 00:53:27 +00:00
Jeff Roberson
c168508655 Add two new kernel options to control memory locality on NUMA hardware.
- UMA_XDOMAIN enables an additional per-cpu bucket for freed memory that
   was freed on a different domain from where it was allocated.  This is
   only used for UMA_ZONE_NUMA (first-touch) zones.
 - UMA_FIRSTTOUCH sets the default UMA policy to be first-touch for all
   zones.  This tries to maintain locality for kernel memory.

Reviewed by:	gallatin, alc, kib
Tested by:	pho, gallatin
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D20929
2019-08-06 21:50:34 +00:00
Mark Johnston
60f2e2e702 Add bzip2recover.1.
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2019-08-02 22:09:56 +00:00
Bjoern A. Zeeb
57a44fcd34 IPv6 cleanup: netstat
Rename the variable for the in6_addr from in6p to ia6 to follow the
convention generally used in FreeBSD.

No functional changes.

MFC after:		3 months
Sponsored by:		Netflix
2019-08-01 20:36:25 +00:00
Mark Johnston
1033464925 Capsicumize size(1).
Reviewed by:	oshogbo
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D21105
2019-08-01 18:57:37 +00:00
Mark Johnston
802c2095b5 Capsicumize readelf(1).
Reviewed by:	oshogbo
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D21108
2019-08-01 18:57:08 +00:00
Jilles Tjoelker
2bf7d924ff printf(1): Note that \c only works in %b strings
PR:		238313
Reported by:	Andras Farkas
MFC after:	1 week
2019-07-29 20:43:07 +00:00
Rick Macklem
b5965b56e8 Fix printing of Server Re-Failed and Server Faults.
nfsstat -s prints bogus large numbers for the Server Re-Failed and Server
Faults fields. This was introduced by r328588.
Although I know nothing about libxo, these lines aren't titles and this
patch seems to fix the problem, so I am committing it for rea@ who emailed
it to me.
It also deleted the trailing ':' from the title lines, since those were not
in the pre-r328588 output.

If there is a more correct fix, someone conversant with libxo will need
to do so.

Submitted by:	rea
MFC after:	2 weeks
2019-07-28 21:44:01 +00:00
Conrad Meyer
2826da432c motd: Generate from template to /var/run
Update login(1), its manual pages, similar utilities, and motd.5 to refer to
the new location.

Suggested by:	delphij@ (re: r349256)
Reviewed by:	bcr (manpages), delphij
Differential Revision:	https://reviews.freebsd.org/D20721
2019-07-20 20:56:31 +00:00
Warner Losh
fddfaafd65 Remove RELEASE_CRUNCH here
If someone wants to subset, they can set MK_ICONV=no. We no longer use it for
the release.
2019-07-19 20:04:31 +00:00
Emmanuel Vadot
be6a4fc664 pkgbase: Add a FreeBSD-dpv package
Move the dpv related files from FreeBSD-runtime to a new package named
FreeBSD-dpv
The only consumer is bsdinstall which is already in it's own package.

Reviewed by:	bapt, gjb
Differential Revision:	https://reviews.freebsd.org/D20960
2019-07-19 15:10:53 +00:00
Emmanuel Vadot
9553ea80a8 pkgbase: Add a FreeBSD-bluetooth package
Move the bluetooth related files from FreeBSD-runtime to a new package named
FreeBSD-bluetooth
The FreeBSD runtime is only intended to have everything for a working
FreeBSD installation and bluetooth isn't needed for that.

Reviewed by:	bapt, gjb
Differential Revision:	https://reviews.freebsd.org/D20959
2019-07-19 15:10:03 +00:00
Xin LI
9344e4d738 errno.h is no longer needed as of r340239 so remove it.
No MFC planned as that revision was not merged.
2019-07-18 07:37:26 +00:00
Xin LI
c93b6e5fa2 Remove support for FreeBSD 10.x.
MFC after:	1 month
2019-07-18 07:26:30 +00:00
John Baldwin
caa449b635 Use PT_GET_SC_ARGS and PT_GET_SC_RET in truss.
This removes all of the architecture-specific functions from truss.

A per-ABI structure is still needed to map syscall numbers to names
and FreeBSD errno values to ABI error values as well as hold syscall
counters.  However, the linker set of ABI structures is now replaced
with a simple table mapping ABI names to structures.  This approach
permits sharing the same ABI structure among separate names such as
i386 a.out and ELF binaries as well as ELF v1 vs ELF v2 for powerpc64.

A few differences are visible due to using PT_GET_SC_RET to fetch the
error value of a system call.  Note that ktrace/kdump have had the
"new" behaviors for a long time already:
- System calls that return with EJUSTRETURN or ERESTART will now be
  noticed and logged as such.  Previously sigreturn (which uses
  EJUSTRETURN) would report whatever random value was in the register
  holding errno from the previous system call for example.  Now it
  reports EJUSTRETURN.
- System calls that return errno as their error value such as
  posix_fallocate() and posix_fadvise() now report non-zero return
  values as errors instead of success with a non-zero return value.

Reviewed by:	kib
MFC after:	1 month
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D20963
2019-07-16 22:59:15 +00:00
Warner Losh
01b0122954 Remove all the RELEASE_CRUNCH instances that partially disable IPSEC
We remove IPSEC only in parts of the tree, and not others. RELEASE_CRUNCH to
disable it has not kept up with all its uses. Remove it. Should there be a real
need to disable IPSEC, one that hasn't shown up in the base system to date,
it can be re-added behind a WITHOUT_IPSEC build option.
2019-07-15 14:19:39 +00:00
Tijl Coosemans
8fb2c7ac84 Fix layout. -C needs to be styled as a flag here, not as a new list item.
MFC after:	2 weeks
2019-07-12 21:19:47 +00:00
Warner Losh
5603490248 There is no SMALLER define anymore here
Stop defining SMALLER. Since we replaced cpio with libarchive version,
there's no options to make it smaller. Also, the comment about the
FreeBSD installer is obsolete. Remove them both.
2019-07-12 05:19:06 +00:00
Vincenzo Maffione
edc4cf21a5 update calendar.freebsd
MFC after:	1 week
2019-07-09 22:11:15 +00:00
Konstantin Belousov
469220742e Add implicit PROT_MAX() knob to proccontrol(1).
Reviewed by:	emaste, markj (previous version)
Discussed with:	brooks
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D20795
2019-07-02 19:12:02 +00:00
Xin LI
b7780dbe98 MFV r349535: less v551.
MFC after:	2 weeks
Relnotes:	yes
2019-06-29 18:41:40 +00:00
Konstantin Belousov
fab66680b3 Mention proccontrol(1) -m kpti.
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2019-06-28 18:03:13 +00:00
Ed Maste
fb9a985516 Expose the kernel's build-ID through uname -b
After r348611 the kernel's build-ID is available via sysctl.  Add a -b flag
to uname to report it.

Submitted by:	Ali Mashtizadeh <ali_mashtizadeh.com>
Reviewed by:	markj, imp
Relnotes:	Yes
Event:		Waterloo Hackathon 2019
Differential Revision:	https://reviews.freebsd.org/D20511
2019-06-27 20:34:50 +00:00
Marko Zec
8d048f68d4 Croatian calendar: update / fix names, dates, group national public
holidays, sort by date.

MFC after:	3 days
2019-06-25 14:50:03 +00:00
Warner Losh
912a01b36d Replay r349333 by emaste accidentally reverted by r349352
vtfontcvt: improve .bdf validation

Previously if we had a FONTBOUNDINGBOX or DWIDTH entry that had missing
or invalid values and and failed sscanf, we would proceeded with
partially initialized bounding box / device width variables.

Reported by:	afl (FONTBOUNDINGBOX)
MFC with:	r349100
Sponsored by:	The FreeBSD Foundation
2019-06-25 06:13:56 +00:00
Warner Losh
f5a95d9a07 Remove NAND and NANDFS support
NANDFS has been broken for years. Remove it. The NAND drivers that
remain are for ancient parts that are no longer relevant. They are
polled, have terrible performance and just for ancient arm
hardware. NAND parts have evolved significantly from this early work
and little to none of it would be relevant should someone need to
update to support raw nand. This code has been off by default for
years and has violated the vnode protocol leading to panics since it
was committed.

Numerous posts to arch@ and other locations have found no actual users
for this software.

Relnotes:	Yes
No Objection From: arch@
Differential Revision: https://reviews.freebsd.org/D20745
2019-06-25 04:50:09 +00:00
Ed Maste
2771ab3322 vtfontcvt: improve .bdf validation
Previously if we had a FONTBOUNDINGBOX or DWIDTH entry that had missing
or invalid values and and failed sscanf, we would proceeded with
partially initialized bounding box / device width variables.

Reported by:	afl (FONTBOUNDINGBOX)
MFC with:	r349100
Sponsored by:	The FreeBSD Foundation
2019-06-24 17:25:14 +00:00
Allan Jude
2984a71677 top(1): Don't show the swap line when there are no swap devices
Submitted by:	antranigv@freebsd.am
Reviewed by:	bapt
MFC after:	1 month
Sponsored by:	Klara Systems
Differential Revision:	https://reviews.freebsd.org/D18928
2019-06-20 15:44:43 +00:00
Ed Maste
97634938d0 vtfontcvt: correct typo in hex parsing update
PR:		205707
Submitted by:	Dmitry Wagin
MFC with:	349100
Event:		Berlin Devsummit 2019
2019-06-16 15:14:49 +00:00
Ed Maste
08584e2c48 vtfontcvt: improve .bdf validation
Previously if we had a BBX entry that had invalid values (e.g. bounding
box outside of font bounding box) and failed sscanf (e.g., because it
had fewer than four values) we skipped the BBX value validation and then
triggered an assertion failure.

Reported by:	afl
MFC with:	r349100
Event:		Berlin Devsummit 2019
Sponsored by:	The FreeBSD Foundation
2019-06-16 13:51:45 +00:00
Ed Maste
fd0e3f7c98 vtfontcvt: improve .bdf verification
Previously we would crash if the BBX y-offset was outside of the font
bounding box.

Reported by:	afl
MFC with:	r349100
Event:		Berlin Devsummit 2019
Sponsored by:	The FreeBSD Foundation
2019-06-16 13:35:53 +00:00
Ed Maste
0f17b429d0 vtfontcvt: initialize another variable to quiet GCC warning
I believe this case could be triggered by a broken .bdf font.

PR:		205707
Reported by:	ci.freebsd.org
MFC with:	349100
Event:		Berlin Devsummit 2019
Sponsored by:	The FreeBSD Foundation
2019-06-16 12:26:46 +00:00
Ed Maste
ff31ddeb11 vtfontcvt: initialize bbwbytes to avoid GCC 4.2.1 uninitialized warning
PR:		205707
MFC with:	349100
Event:		Berlin Devsummit 2019
Sponsored by:	The FreeBSD Foundation
2019-06-16 10:43:18 +00:00
Ed Maste
3bd2e9a54e vtfontcvt: improve BDF and hex font parsing
Support larger font sizes.

PR:		205707
Submitted by:	Dmitry Wagin (original version)
MFC after:	2 weeks
Event:		Berlin Devsummit 2019
Differential Revision:	https://reviews.freebsd.org/D20650
2019-06-16 09:17:26 +00:00
Bryan Drewery
c63c5ab001 Fix .depend files to work for build tools.
This is somewhat of a follow-up to r335746.

MFC after:	2 weeks
Sponsored by:	DellEMC
2019-06-15 17:08:13 +00:00
Ed Maste
cfe607d5bf vtfontcvt: add comments in add_glyph
During review for PR 205707.

Event:		Berlin Devsummit 2019
2019-06-15 09:15:58 +00:00
Greg Lehey
4efd690068 Edvard Hagerup Grieg parses as given name, mother's maiden name, surname 2019-06-14 23:53:19 +00:00
Martin Matuska
fae5c36e4c MFV r348971,r348977:
Sync libarchive with vendor.

Relevant vendor changes:
  - check_symlinks_fsobj() without chdir() and fchdir()
  - bsdtar.1 manpage fixes
  - patches from OpenBSD to libarchive_fe/passphrase.c
  - version bumped to 3.4.0

MFC after:	2 weeks
2019-06-12 13:34:12 +00:00
Mitchell Horne
8a250c7568 procstat: Recognize HWCAP and HWCAP2 with auxv command
The two most recent additions to the elf auxiliary vector are
HWCAP and HWCAP2 which describe platform specific cpu capabilities.

Make procstat recognize these fields so that they aren't displayed
as UNKNOWN.

Reviewed by:	trociny, markj
Approved by:	markj (mentor)
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D20582
2019-06-11 00:59:46 +00:00
Mariusz Zaborski
c851fce6d7 tail: fix the checks if the file was rotated
The freopen(3) was replaced with fileargs_open(3) and fclose(3).
In the following function, we skip if the stream is standard in, so it is
safe to do so.
This also requires us to change the logic first to open the file and then
check its status. The stat(2) is disallowed in capability mode.

This commit unbrakes the -F option.
The bug was introduced in the r348708.

Reported by:	pho
Tested by:	pho
2019-06-09 22:55:21 +00:00
Mariusz Zaborski
2fe0bee4bb tail: style nits 2019-06-09 11:21:29 +00:00
Ed Maste
a9de4100e6 vtfontcvt: allow out-of-order glyphs
PR:		205707
Reported by:	mi
MFC after:	2 weeks
Event:		Vienna Hackathon 2019
Sponsored by:	The FreeBSD Foundation
2019-06-08 08:25:43 +00:00
Gleb Popov
bc04586c21 Add myself (arrowd) to calendar.freebsd.
Approved by:	bapt
2019-06-06 08:43:23 +00:00
Mateusz Piotrowski
93465d7349 Add my birthday to calendar
Requested by:	mckusick
2019-06-06 08:12:49 +00:00
Mariusz Zaborski
d32f14190b tail: disable capsicum in rescue mode
All rescue application are not capsicumized.

Reported by:	jenkins
2019-06-05 22:55:00 +00:00
Mariusz Zaborski
9190144fbf tail: fix style nit introduced in the r348708 2019-06-05 22:47:37 +00:00
Mariusz Zaborski
b4d2c3385c tail: capsicumize
Submitted by:	Nik Sultana <sultana@seas.upenn.edu>
Differential Revision:	https://reviews.freebsd.org/D20393
2019-06-05 22:40:49 +00:00
Piotr Kubaj
25082bd7d2 Add my birthday entry. 2019-06-05 16:01:05 +00:00
Ed Maste
24dd375e25 vtfontcvt: exit on error if the input font has too many glyphs
The kernel has a limit of 131072 glyphs in a font; add the same check to
vtfontcvt so that we won't create a font file that the kernel will not
load.

PR:		205707
Submitted by:	Dmitry Wagin
MFC after:	2 weeks
2019-06-05 15:23:48 +00:00
D Scott Phillips
3ea05df092 Add myself to committers-src.dot and calendar.freebsd
Approved by:	jhb (mentor)
2019-06-05 04:01:31 +00:00
Koichiro Iwao
83b187575b Add self to calendar, per mckusick's request 2019-06-05 03:40:34 +00:00
Adriaan de Groot
f88c56bce1 Add self to calendar, per Kirk's request 2019-06-04 21:54:34 +00:00
Vincenzo Maffione
e5f89a8c84 Add myself to committers-src.dot and calendar.freebsd
Reviewed by:	mckusick
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D20518
2019-06-04 19:59:43 +00:00
Ed Maste
7e65018aa6 vtfontcvt: zero memory allocated by xmalloc
PR:		205707
Submitted by:	Dmitry Wagin
2019-06-04 19:39:06 +00:00
Doug Moore
b4fa9d0366 Add birthday entry. 2019-06-04 19:16:05 +00:00
Sean Eric Fagan
f1ce120379 Add my birthday entry, per Kirk's request 2019-06-04 19:06:33 +00:00
Ed Maste
4c42647e13 vtfontcvt: include width and height in verbose info
PR:		205707
Submitted by:	Dmitry Wagin
2019-06-04 18:55:02 +00:00
Ed Maste
2810d2385c vtfontcvt: rework height/width setting
Introduce VFNT_MAXDIMENSION to replace bare 128, add set_height, and
consistently use set_height and set_width.

PR:		205707
Submitted by:	Dmitry Wagin
2019-06-04 18:49:49 +00:00
Ed Maste
d7bcf73630 vtfontcvt: unwrap a line per style(9)
PR:		205707
Submitted by:	Dmitry Wagin
2019-06-04 18:31:52 +00:00
Ed Maste
3c7951c78b vtfontcvt: use VFNT_MAP_{NORMAL|BOL}_RH symbolic constants
PR:		205707
Reported by:	Dmitry Wagin
MFC after:	1 month
2019-06-04 18:26:42 +00:00
Ed Maste
9c954a4843 build llvm-ar and llvm-nm with Clang (promote out of CLANG_EXTRAS)
To facilitate experimentation with LTO we require an ar that supports
LLVM IR, and to a lesser degree also an nm.  As a first step always
install llvm-ar and llvm-nm.

Sponsored by:	The FreeBSD Foundation
2019-06-04 13:00:49 +00:00
Maxim Sobolev
5ec57af4b2 Fix several places where tool name has been hardcoded:
install -> ${INSTALL}
    mtree -> ${MTREE_CMD}
    services_mkdb -> ${SERVICES_MKDB_CMD}
    cap_mkdb -> ${CAP_MKDB_CMD}
    pwd_mkdb -> ${PWD_MKDB_CMD}
    kldxref -> ${KLDXREF_CMD}

If you do custom FreeBSD builds you may want to override those
in some cases.

Sponsored by:	Sippy Software, Inc.
2019-06-02 23:38:19 +00:00
Warner Losh
e9b659753c This should have been committed in r348511 with the awk update.
It was in my tree, the build worked, but I committed from contrib/one-true-awk
rather than the top level, so was omitted.
2019-06-02 16:44:50 +00:00
Kyle Evans
71259635f7 llvm-symbolizer: Move out of CLANG_EXTRAS, into CLANG
ASAN reports become a lot more useful with llvm-symbolizer in $PATH, and the
build is not much more time-consuming. The added benefit is that the
resulting reports will actually include symbol information; without, thread
trace information includes a bunch of addresses that immediately resolve to
an inline function in
^/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common.h and take a
little more effort to examine.

Reviewed by:	emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D20484
2019-06-02 04:04:21 +00:00
Kyle Evans
25385eb325 grep: Move lone 'r'grep case into the adjacent switch
This 'r' case should have belonged to the switch in the first place, but
I had somehow missed the switch when initially adding the rgrep link. The
zgrep script later came along and faithfully left this case standing alone,
so we will now go ahead and join it.

Nearby comment also adjusted a tad bit for wording and style.

Reported by:	Daniel Ebdrup
MFC after:	3 days
2019-06-02 02:38:44 +00:00
Brandon Bergren
03f92fe9e0 Add myself to committers-src.dot and calendar.freebsd
Approved by:	jhibbits (mentor)
2019-06-02 00:08:24 +00:00
Konstantin Belousov
a3e3f1b870 Minor tweaks to the layout.
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2019-05-30 16:02:40 +00:00
Konstantin Belousov
bbc08c6116 Remove "All rights reserved." from FF copyright.
Requested by:	rgrimes
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2019-05-29 14:26:35 +00:00
Konstantin Belousov
21db5fcc9d Add posixshmcontrol(1) page.
Reviewed by:	emaste
With input by:	danfe
Sponsored by:	The FreeBSD Foundation (kib)
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D20430
2019-05-29 13:51:18 +00:00
Konstantin Belousov
537aac3c09 Use int for the getopt() result.
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2019-05-23 15:00:15 +00:00
Konstantin Belousov
5f4592e46f Add posixshmcontrol(1), an utility to manipulate posix shared memory segments.
See usage for the command line structure.  Man page will come shortly.

Reviewed by:	jilles, tmunro
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D20258
2019-05-23 14:33:01 +00:00
Emmanuel Vadot
d3bb120822 pkgbase: Really move login.access
Messed up with git->svn r348102
2019-05-22 07:41:58 +00:00
Emmanuel Vadot
a8b94f3d79 pkgbase: Move login.access to usb.bin/login
Also remove the etc-examples target as we don't have any files
to handle here.

Reviewed by:	bapt
2019-05-22 07:23:03 +00:00
Martin Matuska
52c2bb7516 MFV r347989:
Sync libarchive with vendor.

Relevant vendor changes:
  Issue #795: XAR - do not try to add xattrs without an allocated name
  PR #812: non-recursive option for extract and list
  PR #958: support reading metadata from compressed files
  PR #999: add --exclude-vcs option to bsdtar
  Issue #1062: treat empty archives with a GNU volume header as valid
  PR #1074: Handle ZIP files with trailing 0s in the extra fields
            (Android APK archives)
  PR #1109: Ignore padding in Zip extra field data (Android APK archives)
  PR #1167: fix problems related to unreadable directories
  Issue #1168: fix handling of strtol() and strtoul()
  PR #1172: RAR5 - fix invalid window buffer read in E8E9 filter
  PR #1174: ZIP reader - fix of MSZIP signature parsing
  PR #1175: gzip filter - fix reading files larger than 4GB from memory
  PR #1177: gzip filter - fix memory leak with repeated header reads
  PR #1180: ZIP reader - add support for Info-ZIP Unicode Path Extra Field
  PR #1181: RAR5 - fix merge_block() recursion
            (OSS-Fuzz 12999, 13029, 13144, 13478, 13490)
  PR #1183: fix memory leak when decompressing ZIP files with LZMA
  PR #1184: fix RAR5 OSS-Fuzz issues 12466, 14490, 14491, 12817
    OSS-Fuzz 12466: RAR5 - fix buffer overflow when parsing huffman tables
    OSS-Fuzz 14490, 14491: RAR5 - fix bad shift-left operations
    OSS-Fuzz 12817: RAR5 - handle a case with truncated huffman tables
  PR #1186: RAR5 - fix invalid type used for dictionary size mask
            (OSS-Fuzz 14537)
  PR #1187: RAR5 - fix integer overflow (OSS-Fuzz 14555)
  PR #1190: RAR5 - RAR5 don't try to unpack entries marked as directories
            (OSS-Fuzz 14574)
  PR #1196: RAR5 - fix a potential SIGSEGV on 32-bit builds
  OSS-Fuzz 2582: RAR - fix use after free if there is an invalid entry
  OSS-Fuzz 14331: RAR5 - fix maximum owner name length
  OSS-Fuzz 13965: RAR5 - use unsigned int for volume number + range check

  Additional RAR5 reader changes:
    - support symlinks, hardlinks, file owner, file group, versioned files
    - change ARCHIVE_FORMAT_RAR_V5 to 0x100000
    - set correct mode for readonly directories
    - support readonly, hidden and system Windows file attributes

MFC after:	2 weeks
2019-05-20 12:57:39 +00:00
Mark Johnston
54a3a11421 Provide separate accounting for user-wired pages.
Historically we have not distinguished between kernel wirings and user
wirings for accounting purposes.  User wirings (via mlock(2)) were
subject to a global limit on the number of wired pages, so if large
swaths of physical memory were wired by the kernel, as happens with
the ZFS ARC among other things, the limit could be exceeded, causing
user wirings to fail.

The change adds a new counter, v_user_wire_count, which counts the
number of virtual pages wired by user processes via mlock(2) and
mlockall(2).  Only user-wired pages are subject to the system-wide
limit which helps provide some safety against deadlocks.  In
particular, while sources of kernel wirings typically support some
backpressure mechanism, there is no way to reclaim user-wired pages
shorting of killing the wiring process.  The limit is exported as
vm.max_user_wired, renamed from vm.max_wired, and changed from u_int
to u_long.

The choice to count virtual user-wired pages rather than physical
pages was done for simplicity.  There are mechanisms that can cause
user-wired mappings to be destroyed while maintaining a wiring of
the backing physical page; these make it difficult to accurately
track user wirings at the physical page layer.

The change also closes some holes which allowed user wirings to succeed
even when they would cause the system limit to be exceeded.  For
instance, mmap() may now fail with ENOMEM in a process that has called
mlockall(MCL_FUTURE) if the new mapping would cause the user wiring
limit to be exceeded.

Note that bhyve -S is subject to the user wiring limit, which defaults
to 1/3 of physical RAM.  Users that wish to exceed the limit must tune
vm.max_user_wired.

Reviewed by:	kib, ngie (mlock() test changes)
Tested by:	pho (earlier version)
MFC after:	45 days
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D19908
2019-05-13 16:38:48 +00:00
Leandro Lupori
8edae83905 Fix build issue with clang 8.0.1
The algorithm header is needed to use std::remove_if
2019-05-10 17:05:40 +00:00
Xin LI
c9083b850a Move contrib/zlib to sys/contrib/zlib so that we can use it in kernel.
This is a prerequisite of unifying kernel zlib instances.

Submitted by:	Yoshihiro Ota <ota at j.email.ne.jp>
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D20191
2019-05-08 08:43:15 +00:00
Phil Shafer
5e203a9ddb Import libxo-1.0.4:
- Avoid NULL deref in xo_xml_leader_len (replacing local fix in rS345967)
- update copyright dates
- update test cases
- fix uncommitted version change

Submitted by:	phil
MFC after:	2 weeks
2019-05-06 20:20:21 +00:00
Edward Tomasz Napierala
98ce554a3d Unbreak the tests after r347002.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-05-01 19:35:45 +00:00
Edward Tomasz Napierala
f35f34b153 Add 'Birth' to 'stat -x' output. Current Linux stat(1)
also includes that.

Reviewed by:	cem
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D20130
2019-05-01 18:56:22 +00:00
Ed Maste
1dffcf9f2d ar: shuffle symbol offsets during conversion for 32-bit ar archives
During processing we maintain symbol offsets in the 64-bit s_so array,
and when writing the archive convert to 32-bit if no offsets are greater
than 4GB.  However, this was somewhat inefficient as we looped over the
array twice: first, converting to big endian and second, writing each
32-bit value one at a time (and incorrectly so on big-endian platforms).

Instead, when writing a 32-bit archive shuffle convert symbol data to
big endian (as required by the ar format) and shuffle to the beginning
of the allocation at the same time.

Also correct emission of the symbol count on big endian platforms.

Further changes are planned, but this should fix powerpc64.

Reported by:	jhibbits, mlinimon
Reviewed by:	jhibbits, Gerald Aryeetey (earlier)
Tested by:	jhibbits
MFC after:	10 days
MFC with:	r346079
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D20007
2019-04-22 19:55:47 +00:00
Enji Cooper
1109b77451 Rework CXXSTD setting via r345708
This change allows the user to once again override the C++ standard, restoring
high-level pre-r345708 behavior.

This also unbreaks building lib/ofed/libibnetdisc/Makefile with a non-C++11
capable compiler, e.g., g++ 4.2.1, as the library supported being built with
older C++ standards.

MFC after:	2 weeks
MFC with:	r345708
Reviewed by:	emaste
Reported by:	jbeich
Differential Revision: https://reviews.freebsd.org/D19895 (as part of a larger change)
2019-04-22 18:38:54 +00:00
Enji Cooper
da5069e1f7 Update the spelling of my name
Previous spellings of my name (NGie, Ngie) weren't my legal spelling. Use Enji
instead for clarity.

While here, remove "All Rights Reserved" from copyrights I "own".

MFC after:	1 week
2019-04-22 17:52:46 +00:00
Ed Maste
687c09042f ar: use array notation to access s_so
This is somewhat more readable than pointer arithmetic.  Also remove an
unnecessary cast while here.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2019-04-22 17:29:26 +00:00
Ed Maste
e5228a95c6 ar: test for writing 64-bit format only if symbol count is nonzero
This is a minor simplification; if we do not have any symbols the empty
symbol table can be in 32-bit format.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2019-04-22 17:25:00 +00:00
Kyle Evans
7251c2d8bc dtc(1): Pull in fix for segfault-upon-error condition
Specifically, parse errors within a node would lead to a segfault due to
an unconditional dereference after emitting the error.

Obtained from:	https://github.com/davidchisnall/dtc/commit/e5ecf9319fd3f
MFC after:	3 days
2019-04-21 01:58:42 +00:00
Tom Jones
2946a9415c Add stat counter for ipv6 atomic fragments
Add a stat counter to track ipv6 atomic fragments. Atomic fragments can be
generated in response to invalid path MTU values, but are also a potential
attack vector and considered harmful (see RFC6946 and RFC8021).

While here add tracking of the atomic fragment counter to netstat and systat.

Reviewed by:    tuexen, jtl, bz
Approved by:    jtl (mentor), bz (mentor)
Event:  Aberdeen hackathon 2019
Differential Revision:  https://reviews.freebsd.org/D17511
2019-04-19 17:06:43 +00:00
Conrad Meyer
2b9c00cb6b Update to Zstandard 1.4.0
The full release notes can be found on Github:

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

Relnotes:	yes
2019-04-19 02:54:13 +00:00
Ed Maste
d76eef3430 cap_fileargs: chase r346315, update fileargs_init in consumers
Reported by:	ci.freebsd.org (8 times so far)
MFC after:	3 weeks
MFC with:	r346315
Sponsored by:	The FreeBSD Foundation
2019-04-17 16:18:14 +00:00