Commit Graph

18194 Commits

Author SHA1 Message Date
Martin Cracauer
aa255a10b0 Clarify NFSv4 /etc/exports semantics, with working example.
The existing wording has been confusing users for years.
2019-02-11 15:51:28 +00:00
Benedict Reuschling
60c81cf107 Add an example to pw.8 about how to add an existing user to a group.
Instead of using pw to modify group membership, users often edit
/etc/group by hand, which is discouraged.  Provide an example of
adding a user to the wheel group, which is a common use case.
I'm using a different user here as in the previous example as that
deleted the user (although the examples don't necessarily have to
be followed in order).

Reviewed by:	rgrimes,0mp
Approved by:	0mp
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D19123
2019-02-08 22:10:40 +00:00
David Bright
00c4df53b6 Fix several Coverity-detected issues in newsyslog.
- CID 1394815, CID 1305673: Dereference before null check - memory was
  allocated and the allocation checked for NULL with a call to errx()
  if it failed. Code below that was guaranteed that the pointer was
  non-NULL, but there was another check for NULL at the exit of the
  function (after the memory had already been referenced). Eliminate
  the useless NULL check.

- CID 1007454, CID 1007453: Resource leak - The result of a strdup()
  was stored in a global variable and not freed before program exit.

- CID 1007452: Resource leak - Storage intended to be allocated and
  returned to the caller was never freed. This was the result of a
  regression in the function signature introduced in r208648 (2010)
  (thanks for that find, @cem!). Fixed by altering the function
  signature and passing the allocated memory to the caller as
  intended. This also fixes PR158794.

- CID 1008620: Logically dead code in newsyslog.c - This was a direct
  result of CID 1007452. Since the memory allocated as described there
  was not returned to the caller, a subsequent check for the memory
  having been allocated was dead code. Returning the memory
  re-animates the code that is the subject of this CID.

- CID 1006131: Unused value - in parsing a configuration file, a
  pointer to the end of the last field was saved, but not used after
  that. Rewrite to use the pointer value. This could have been fixed
  by avoiding the assignment altogether, but this solutions more
  closely follows the pattern used in the preceding code.

PR:		158794
Reported by:	Coverity, Ken-ichi EZURA <k.ezura@gmail.com> (PR158794)
Reviewed by:	cem, markj
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2019-02-08 13:54:16 +00:00
Hans Petter Selasky
2d3a84f5b0 Improve Bluetooth device discovery support for Android and Microsoft devices.
Tested using the virtual_bt_speaker(8) tool from the virtual_oss(8)
project at github.com.

PR:			210089
MFC after:		1 week
Sponsored by:		Mellanox Technologies
2019-02-08 13:10:45 +00:00
Yuri Pankov
d70ad055e0 pwm.8: fix markup in synopsis, add -f description
Reviewed by:	bcr, manu
Differential revision:	https://reviews.freebsd.org/D18829
2019-02-06 04:00:37 +00:00
Warner Losh
d3f1313287 Remove All Rights Reserved
Remove the all rights reserved clause from my copyright, and make
other minor tweaks needed where that might have created ambiguity.
2019-02-05 21:37:34 +00:00
Warner Losh
52467047aa Regularize the Netflix copyright
Use recent best practices for Copyright form at the top of
the license:
1. Remove all the All Rights Reserved clauses on our stuff. Where we
   piggybacked others, use a separate line to make things clear.
2. Use "Netflix, Inc." everywhere.
3. Use a single line for the copyright for grep friendliness.
4. Use date ranges in all places for our stuff.

Approved by: Netflix Legal (who gave me the form), adrian@ (pmc files)
2019-02-04 21:28:25 +00:00
Alexander Motin
fe74eaab7c Check element type before setting LEDs.
With r319610, sesutil started twiddling the bits of every SES device.
Not everything is a disk slot, there are also fan controllers, temperature
sensors, even power supplies, among other things controlled by SES.

Add a type check to make sure we are only operating on device slot and array
device slot elements.  Other type elements will be skipped, but it would be
simple to add additional cases for controlling the ident LEDs of other
element types (which are not necessarily the same bits).

Rather than doing raw bit manipulation of an unstructured byte array using
unnamed numeric constants, leverage existing code abstractions.

Submitted by:	Ryan Moeller <ryan@freqlabs.com>
MFC after:	1 week
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D19052
2019-02-04 01:24:10 +00:00
Doug Rabson
2335240c66 Reduce log spam from rpc.statd
This only reports failed attempts to contact hosts on the first attempt.
2019-02-03 08:15:26 +00:00
Marcelo Araujo
4edc7f418a Revert r343634:
Mostly a cosmetic change to replace strlen with strnlen.

Requested by:	kib and imp
2019-02-01 03:09:11 +00:00
Marcelo Araujo
7722142ba8 Mostly a cosmetic change to replace strlen with strnlen.
Obtained from:	Project ACRN
MFC after:	2 weeks
2019-01-31 23:32:19 +00:00
Ed Maste
9c812c8d4e freebsd-update: regenerate man page database after update
These are currently not reproducible because they're built by the
makewhatis on the freebsd-update build host, not the one in the tree.
Regenerate after update, and later we can avoid including it in
freebsd-update data.

PR:		214545, 217389
Reviewed by:	delphij
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D10482
2019-01-30 19:19:14 +00:00
Andriy Voskoboinyk
602fa83239 ndiscvt(8): abort if no IDs were found during conversion.
Checked with Broadcom driver mentioned in PR 179285.

PR:		69268
Submitted by:	<darius@dons.net.au>
MFC after:	5 days
2019-01-30 12:32:47 +00:00
Hans Petter Selasky
21be80ae80 Add support for Audio Sink and Audio Source profiles to sdpd(8).
This allows user-space programs like virtual_oss(8) to act
as a Bluetooth speaker device.

MFC after:		1 week
Sponsored by:		Mellanox Technologies
2019-01-30 09:44:54 +00:00
Cy Schubert
7aef71382b Fix 32-bit buildworld broken by r343438. 2019-01-25 20:53:29 +00:00
Takanori Watanabe
877fc2e350 Use ACPI TPM2 table to probe tpmtis and tpmcrb device.
Differential Revision: https://reviews.freebsd.org/D18937
2019-01-25 16:16:10 +00:00
Enji Cooper
b882e02bc4 Fix a typo/wordsmith a description modified in r343407
r343407 accidentally introduced a typo (folling -> following). While
reading the change out loud, I realized that the original sentence was
wordy. almost sounding like a run-on sentence.

Improve the flow by splitting up the two thoughts into two distinct sentence
fragments.

PR:		194547, 208497
Reviewed by:	emaste
Approved by:	emaste (mentor)
MFC after:	1 month
MFC with:	r343407
Differential Revision: https://reviews.freebsd.org/D18947
2019-01-24 20:35:58 +00:00
Ed Maste
9e8c28fcc0 freebsd-update: Clarify unsupported upgrade message
PR:		204115
Submitted by:	Gerald Aryeetey <aryeeteygerald_rogers.com>
Reviewed by:	delphij
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D18916
2019-01-24 18:51:15 +00:00
Ed Maste
ed1b6cec4f freebsd-update: fix style from r343271 change
PR:		234771
Submitted by:	Gerald Aryeetey <aryeeteygerald_rogers.com>
MFC with:	r343271
Sponsored by:	The FreeBSD Foundation
2019-01-24 18:48:15 +00:00
Ed Maste
ae97aa98ea freebsd-update: Stop installing empty component sets
Submitted by:	Gerald Aryeetey <aryeeteygerald_rogers.com>
Reported by:	rgrimes
Reviewed by:	delphij
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D18927
2019-01-24 18:41:00 +00:00
Ed Maste
fc24ba59ee freebsd-update: open $PAGER only if necessary
PR:		194547, 208497
Submitted by:	Gerald Aryeetey <aryeeteygerald_rogers.com>
Reviewed by:	delphij
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2019-01-24 18:26:30 +00:00
Stefan Eßer
96329ce7e2 Silence Clang Scan warning about use of unitialized variable.
While the warning is a false positive, it is possible to clarify the code by
always initializing the variable. This does also allow to make the sending
of the "beep" control sequence depend on the validity of its parameters.

I have left the redundant assignment of 0 to the now initialized variables
in place since this makes the code simpler to understand and does not add
any run-time overhead (the compiler completely removes the "else if" test
and the assignments).

There was an embedded literal escape character in a string, which messes up
diplaying the source code on a terminal that interprets ANSI sequences. The
literal escape has been replaced by \e (non-standard, but supported by all
relevant compilers, and already used in other source files in base).

MFC after:	2 weeks
2019-01-23 10:05:27 +00:00
Stefan Eßer
5f81babdee Silence a CI warning regarding the use of strcpy().
While this is a false positive (a sufficiently large buffer has been
allocated in the line above), the use of strdup() simplifies and clarifies
the code.

MFC after:	2 weeks
2019-01-22 13:11:15 +00:00
Ed Maste
d308a8bf0f freebsd-update: Allow upgrade from pre-release builds
Update r343122 to include -ALPHA, -BETA and -RC releases as
upgrade-able via freebsd-update.

PR:		234771
Submitted by:	Gerald Aryeetey <aryeeteygerald_rogers.com>
Reported by:	delphij, des
Reviewed by:	delphij
MFC with:	r343122
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D18881
2019-01-21 19:21:11 +00:00
Ed Maste
9b6591109e freebsd-update: Update /etc/passwd after password db changes
Add -p to pwd_mkdb in order to ensure password db changes are also
included in /etc/passwd.

PR:		165954, 232921, 229487
Submitted by:	Gerald Aryeetey <aryeeteygerald_rogers.com>
Reviewed by:	jilles
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D18827
2019-01-21 19:04:37 +00:00
Ed Maste
b958d4b255 frebsd-update: fix --currently-running after r343122
PR:		234771
Submitted by:	Gerald Aryeetey <aryeeteygerald_rogers.com>
Reported by:	Brandon Schneider
MFC with:	r343122
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D18896
2019-01-21 18:41:57 +00:00
Dmitry Morozovsky
be659d72bb Clarify error messages a bit.
X-Found-With:	r343112
MFC after:	1 month
2019-01-18 23:00:52 +00:00
Ed Maste
c075542050 freebsd-update.8: mandoc -Tlint fixes
PR:		185389
Reported by:	bcr
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2019-01-18 18:22:47 +00:00
Ed Maste
cfd9be9c1f freebsd-update: Use BASEDIR when checking for src component
src could potentially be installed under the based dir
and not under the root or vice versa.

PR:		224048
Submitted by:	Gerald Aryeetey <aryeeteygerald_rogers.com>
Reviewed by:	delphij
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D18849
2019-01-18 17:41:45 +00:00
Ed Maste
0d5c5243af freebsd-update: Clarify unsupported release upgrade error message
Notify users that upgrading from -CURRENT or -STABLE is unsupported by
freebsd-update.

Also ensure --currently-running provides a correctly formatted release
(as done by -r).

PR:		234771
Submitted by:	Gerald Aryeetey <aryeeteygerald_rogers.com>
Reported by:	yuri
Reviewed by:	bcran
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D18803
2019-01-17 21:38:57 +00:00
Edward Tomasz Napierala
50d503b781 Workaround for nscd(8) failure with large entries.
It fixes a case where eg a 2KB group entry would take several seconds
to complete with cache enabled in nsswitch.conf.

MFC after:	2 weeks
Sponsored by:	Chalmers University of Technology
Differential Revision:	https://reviews.freebsd.org/D18392
2019-01-17 20:01:06 +00:00
Eugene Grosbein
2b5691ee44 Re-add new small tool trim(8) to delete contents for blocks
on devices using wear-leveling algorithms as a few weeks passed
after review and discussion of trim(8) ceased and
we still have no utility to perform the job.

Reviewed by:	hackers@
MFC after:	2 weeks
2019-01-17 18:07:59 +00:00
Eugene Grosbein
bd24e861b4 jail(8): stop crashing with SIGSEGV inside run_command() function
while processing not entirely correct jail.conf(5) file
having something like "ip4.addr = 127.0.0.1;" and no "ip4 = ...;"
so extrap variable stays NULL.

Reported by:	marck
MFC after:	1 month
2019-01-17 14:09:55 +00:00
Marcelo Araujo
73f6ccd9e7 Fix broken uart on Win2016 guest.
Obtained from:	Joyent (commit/2bf1a940afbd1382faff159e7c93c72779ca10f4)
MFC after:	3 weeks.
2019-01-16 03:46:27 +00:00
Marcelo Araujo
abfa3c39e7 Use capsicum_helpers(3) that allow us to simplify the code and its functions
will return success when the kernel is built without support of
the capability mode.

It is important to note, that I'm taking a more conservative approach
with these changes and it will be done in small steps.

Reviewed by:	jhb
MFC after:	6 weeks
Differential Revision:	https://reviews.freebsd.org/D18744
2019-01-16 00:39:23 +00:00
Lars Engels
e1bd727904 This new version of bluetooth-config.sh tries to follow the style of other
shell scripts in base, removes the bogus "copyleft", adds the BeerWare license
header and uses rc.subr(8) new 'enable' keyword for adding entries in
rc.conf(5).

Submitted by:	erdgeist <erdgeist@erdgeist.org>
Approved by:	bapt
MFC after:	2 weeks
2019-01-14 08:23:47 +00:00
Baptiste Daroussin
baf46d717b Fix duplication.
The patch adding the manpage was probably applied twice, so it resulted
in duplication of the manpage
2019-01-11 16:18:23 +00:00
Lars Engels
0fc0faf846 Add bluetooth-config script to simplify setting up bluetooth connections to
devices like mice, keyboards, bt-audio, ...

This script currently allows scanning for nearby devices, adds one to
/etc/bluetooth/hosts, adds an entry to hcsecd's conf and if it is a HID, add an
entry to bthidd's configs, as well.

Submitted by:	erdgeist <erdgeist@erdgeist.org>
Approved by:	bapt
MFC after:	2 weeks
Differential Revision:	D3778
Reviewers:	bapt, emax
2019-01-11 15:52:09 +00:00
Rodney W. Grimes
7d9545fcc0 Fix spelling of identifier
Approved by:	phk (mentor)
MFC after:	3 days
2019-01-11 14:21:59 +00:00
Konstantin Belousov
e4e0dad424 cpucontrol: check for the supposed firmware file type and skip
non-regular entry.

do_update() skips entries with DT_DIR type.  This does not eliminate
other entries that might exist in the directory.  More, since NFS
might fill d_type with DT_UNKNOWN, dot and dotdot entries are not
skipped, then mmap(2) call failed for them when update microcode files
are located on NFS.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2019-01-11 08:35:49 +00:00
Andriy Voskoboinyk
5c81ba5ade powerd(8): allow to force a method of battery state query
This change allows to determine power source via sysctl or /dev/apm
when devd(8) is running (used by default).

Based on patch from PR; other changes on top of it:
- '-f' (force) -> '-s' (source) parameter renaming;
- allow 'apm' -> 'devd' transition when '-s devd' is set
(if APM is enabled);
- man page update.

Checked on amd64 with -s devd / sysctl and apm
(an extra build with forced USE_APM define set was done)

PR:		125707
Submitted by:	Konstantin Stepanov <milezv@yandex.ru>
Reviewed by:	bcr, imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D18742
2019-01-06 02:39:03 +00:00
Mark Johnston
04e9edb544 Capsicumize rtsol(8) and rtsold(8).
These programs parse ND6 Router Advertisement messages; rtsold(8) has
required an SA, SA-14:20.rtsold, for a bug in this code.  Thus, they
are good candidates for sandboxing.

The approach taken is to run the main executable in capability mode
and use Casper services to provide functionality that cannot be
implemented within the sandbox.  In particular, several custom services
were required.

- A Casper service is used to send Router Solicitation messages on a
  raw ICMP6 socket.  Initially I took the approach of creating a
  socket for each interface upon startup, and connect(2)ing it to
  the all-routers multicast group for the interface.  This permits
  the use of sendmsg(2) in capability mode, but only works if the
  interface's link is up when rtsol(d) starts.  So, instead, the
  rtsold.sendmsg service is used to transmit RS messages on behalf
  of the main process.  One could alternately define a service
  which simply creates and connects a socket for each destination
  address, and returns the socket to the sandboxed process.  However,
  to implement rtsold's -m option we also need to read the ND6 default
  router list, and this cannot be done in capability mode.
- rtsold may execute resolvconf(8) in response to RDNSS and DNSSL
  options in received RA messages.  A Casper service is used to
  fork and exec resolvconf(8), and to reap the child process.
- A service is used to determine whether a given interface's
  link-local address is useable (i.e., not duplicated or undergoing
  DAD).  This information is supplied by getifaddrs(3), which reads
  a sysctl not available in capability mode.  The SIOCGIFCONF socket
  ioctl provides equivalent information and can be used in capability
  mode, but I decided against it for now because of some limitations
  of that interface.

In addition to these new services, cap_syslog(3) is used to send
messages to syslogd.

Reviewed by:	oshogbo
Tested by:	bz (previous versions)
MFC after:	2 months
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D17572
2019-01-05 16:05:39 +00:00
Chuck Tuffli
fbac7e0ba2 Fix bhyve's NVMe Completion Queue entry values
The function which processes Admin commands was not returning the
Command Specific value in Completion Queue Entry, Dword 0 (CDW0). This
effects commands such as Set Features, Number of Queues which returns
the number of queues supported by the device in CDW0. In this case, the
host will only create 1 queue pair (Number of Queues is zero based).
This also masked a bug in the queue counting logic.

Reviewed by: imp, araujo
Approved by: imp (mentor)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D18703
2019-01-04 15:03:35 +00:00
Chuck Tuffli
76e47b9420 Fix bhyve's NVMe queue bookkeeping
Many size / length parameters in NVMe are "0's based", meaning, a value
of 0x0 represents 1, 0x1 represents 2, etc.. While this leads to an
efficient encoding, it can lead to subtle bugs. With respect to queues,
these parameters include:
 - Maximum number of queue entries
 - Maximum number of queues
 - Number of Completion Queues
 - Number of Submission Queues

To be consistent, convert all 0's based values from the host to 1's
based value internally. Likewise, covert internal 1's based values to
0's based values when returned to the host. This fixes an off-by-one bug
when creating IO queues and simplifies some of the code. Note that this
bug is masked by another bug.

While in the neighborhood,
 - fix an erroneous queue ID check (checking CQ count when deleting SQ)
 - check for queue ID of 0x0 in a few places where this is illegal
 - clean up the Set Features, Number of Queues command and check for
   illegal values

Reviewed by: imp, araujo
Approved by: imp (mentor)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D18702
2019-01-04 15:03:30 +00:00
Rebecca Cran
70de14d82f Update the efibootmgr(8) man page to document changes to options. 2019-01-01 04:57:46 +00:00
Rebecca Cran
7e02f8b30a Use the --activate efibootmgr(8) flag when creating entries in bootconfig
Sponsored by:	Netflix
2018-12-31 00:26:35 +00:00
Rebecca Cran
5fa62a9335 Fix ESP generation when using a gmirror, and when booting from RO medium
When using a gmirror, entries in /dev can be removed. So instead of using
kern.disks, get the list of disks from "gpart status -sg" instead.

We assume that any 'efi' partition that can't be mounted as msdosfs should
be used as an ESP. However, the ESP on the CD/DVD can't be mounted read-write
and so was being treated as if unformatted. Try the mount as read-only
instead, to catch cases like this.

Relnotes: yes
Sponsored by: Netflix
Differential Revision:	https://reviews.freebsd.org/D18645
2018-12-31 00:20:58 +00:00
Rebecca Cran
9ed0802914 Change the way efibootmgr works by specifying bootnum via -b parameter
Instead of passing the bootnum to each different parameter, require users
to specify -b when running operations that need a bootnum.

This allows activation of a new boot entry at the same time it's created
by adding -a onto the command line.

Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D18648
2018-12-31 00:09:45 +00:00
Rebecca Cran
557a5ad425 Improve the efibootmgr(8) man page
Fix formatting, typos, and attempt to improve the wording.

Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D18646
2018-12-28 21:26:45 +00:00
Chris Rees
488ded9168 There is no way of escaping literal $ signs in auto_master(5), which
makes for difficulty with hidden Samba shares; shares with $ at the end
of their name.  This enables the use of ${DOLLAR} to work around this.

Reviewed by:		bcr (man page)
Approved by:		trasz
Differential Revision:	https://reviews.freebsd.org/D7048
2018-12-28 15:11:22 +00:00
Alexey Dokuchaev
2cb73efc0d Amend the `-i batt' option description and explain that the battery
is specified by its number (index), starting with zero.  Previously,
sometimes users would try to literally invoke `acpiconf -i batt' in
their console and become confused as to why this did not work.

Approved by:		bcr (manpages)
Differential Revision:	https://reviews.freebsd.org/D18659
2018-12-27 08:48:54 +00:00
Rebecca Cran
a2581e8021 Activate support for efibootmgr(8) -b --bootnum parameter
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D18647
2018-12-24 15:38:36 +00:00
Kyle Evans
ac0a7e2a3c config(8): Remove all instances of an option when opting out
Quick follow-up to r342362: options can appear multiple times now, so
clean up all of them as needed. For non-OPTIONS options, this has no effect
since they're already de-duplicated.

MFC after:	1 week
X-MFC-With:	r342362
2018-12-22 06:08:06 +00:00
Kyle Evans
993e5c4fd2 config(8): Allow duplicate options to be specified
config(8)'s option handling has been written to allow duplicate options; if
the value changes, then the latest value is used and an informative message
is printed to stderr like so:

/usr/src/sys/amd64/conf/TEST: option "VERBOSE_SYSINIT" redefined from 0 to 1

Currently, this is only a possibility for cpu types, MAXUSERS, and
MACHINE_ARCH. Anything else duplicated in a config file will use the first
value set and error about duplicated options on subsequent appearances,
which is arguably unfriendly since one could specify:

include GENERIC
nooptions VERBOSE_SYSINIT
options VERBOSE_SYSINIT

to redefine the value later anyways.

Reported by:	mmacy
MFC after:	1 week
2018-12-22 06:02:34 +00:00
Alexander Motin
1f03d0bae1 Fix passing wrong variables to nvlist_destroy() after r333446.
Reported by:	Alexander Fedorov (IT-Grad.ru)
MFC after:	5 days
2018-12-21 17:22:15 +00:00
Rebecca Cran
db8b561345 Rework UEFI ESP generation
Currently, the installer uses pre-created 800KB FAT12 filesystems that
it dd's onto the ESP partition.
This changeset improves that by having the installer generate a FAT32
filesystem directly onto the ESP using newfs_msdos and then copying
loader.efi into /EFI/freebsd.
For live installs it then runs efibootmgr to add a FreeBSD boot entry
in the BIOS.

Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D17947
2018-12-20 19:39:37 +00:00
Marcin Wojtas
c97ed06a4b Fix alignment issue in uefisign
The pe_certificate structure has to be aligned to 8 bytes. [1]
Since this is now checked in edk2, any binaries signed with
older version of this tool will fail verification.

References:
[1] https://docs.microsoft.com/en-us/windows/desktop/Debug/pe-format#the-attribute-certificate-table-image-only

Submitted by: Kornel Duleba <mindal@semihalf.com>
Reviewed by: trasz
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D18554
2018-12-19 22:47:37 +00:00
Mateusz Guzik
405c3050f1 Remove iBCS2, part1: userspace
iBCS2 was disconnected from the build in 2015 (see r291419)

bsdconfig parts submitted by dteske.

Reviewed by:	kib (previous version)
Sponsored by:	The FreeBSD Foundation
2018-12-19 21:56:54 +00:00
Eugene Grosbein
3398cc6839 periodic/weekly/340.noid: do not use sysrc(8) that depends
on bsdinstall(8) and may be non-functional
for system built WITHOUT_BSDINSTALL. (*)

Also, add a check for jails sharing whole tree with host (path=/)
and do not skip it.

Reported by:	Andre.Albsmeier@siemens.com (*)
MFC after:	1 week
2018-12-15 23:20:08 +00:00
George V. Neville-Neil
53fc043d41 Remove, the now very outdated, timed.
Submitted by:	Kyle Spiers ksspiers at gmail
Reviewed by:	bcr,brooks,bz,sbruno
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D18505
2018-12-15 21:34:40 +00:00
Stefan Eßer
385e98080c Remove CTM from 13-CURRENT after the release of FreeBSD-12.0.
The removal (and creation of a port) has been pre-announced in UPDATING
1 month ago. Packages are available for all supported FreeBSD vesions.

I did not think that another entry in UPDATING is required to note the
actual removal.

No MFC is planned - CTM shall be kept in base for all releases up to 12.x.

Reviewed by:	rgrimes
Approved by:	imp, bcr (manpages)
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D17935
2018-12-15 16:53:15 +00:00
Emmanuel Vadot
50a123aad8 pwm(8): Add percentage value support for duty cycle 2018-12-14 18:38:10 +00:00
Emmanuel Vadot
6a9997ed67 pwm: Convert period and duty to unsigned int
We don't need a 64 bits value to store nanoseconds

Discused with:	ian, jhibbits
2018-12-14 18:37:26 +00:00
Emmanuel Vadot
d9848bd254 pwm: Fix some arches by using %ju and casting to uintmax_t
Reported by:	ci.freebsd.org
2018-12-12 21:25:52 +00:00
Emmanuel Vadot
9312900f6d Add a pwm subsystem so we can configure pwm controller from kernel and userland.
The pwm subsystem consist of API for PWM controllers, pwmbus to register them
and a pwm(8) utility to talk to them from userland.

Reviewed by:	oshgobo (capsicum), bcr (manpage), 0mp (manpage)
Differential Revision:	https://reviews.freebsd.org/D17938
2018-12-12 20:56:56 +00:00
Cy Schubert
b2d7ecdd54 Set default ciphers.
Submitted by:	jkim@
2018-12-12 05:18:53 +00:00
Alexander Motin
49f8782283 Allow CTL device specification in bhyve virtio-scsi.
There was a large refactoring done in CTL to allow multiple ioctl frontend
ports (and respective devices) to be created, particularly for bhyve.
Unfortunately, respective part of bhyve functionality got lost somehow from
the original virtio-scsi commit.  This change allows wanted device path to
be specified in either of two ways:
 -s 6,virtio-scsi,/dev/cam/ctl1.1
 -s 6,virtio-scsi,dev=/dev/cam/ctl2.3
If neither is specified, the default /dev/cam/ctl device is used.

While there, remove per-queue CTL device opening, which makes no sense at
this point.

Reported by:	wg
Reviewed by:	araujo
MFC after:	3 days
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D18504
2018-12-11 20:47:00 +00:00
Cy Schubert
85732ac8bc MFV r341618:
Update wpa 2.6 --> 2.7.
2018-12-09 06:45:49 +00:00
Alexander Motin
6810fd0acf Make virtio-scsi pass SCSI Task Attributes to CTL.
MFC after:	1 week
Sponsored by:	iXsystems, Inc.
2018-12-07 20:55:29 +00:00
Alexander Motin
99fa47de81 Fix several iov handling bugs in bhyve virtio-scsi backend.
- buf_to_iov() does not use buflen parameter, allowing out of bound read.
 - buf_to_iov() leaks memory if seek argument > 0.
 - iov_to_buf() doesn't need to reallocate buffer for every segment.
 - there is no point to use size_t for iov counts, int is more then enough.
 - some iov function arguments can be constified.
 - pci_vtscsi_request_handle() used truncate_iov() incorrectly, allowing
   getting out of buffer and possibly corrupting data.
 - pci_vtscsi_controlq_notify() written returned status at wrong offset.
 - pci_vtscsi_controlq_notify() leaked one buffer per event.

Reported by:	wg
Reviewed by:	araujo
MFC after:	1 week
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D18465
2018-12-07 20:30:00 +00:00
Alexander Motin
9ce46e8107 Fill initid explicitly on requests.
Unfortunately ctl_scsi_zero_io() wipes that field, so it was always zero.
While there, targ_port is set by kernel, so user-space should not fill it.

MFC after:	1 week
2018-12-07 19:10:51 +00:00
Sean Eric Fagan
54ff4a6a05 Reduce number of DNS queries in mountd.
As reported by a FreeNAS user (see https://redmine.ixsystems.com/issues/55728),
mountd does more calls to getnameinfo() than it needs to; this changes it to
only call it for the RPC calls it needs the name information for.

Reported by:	Dave Flowers
Reviewed by:	imp, mav
Approved by:	mav (mentor)
MFC after:	2 weeks
Sponsored by:	iXsystems Inc
Differential Revision:	https://reviews.freebsd.org/D18430
2018-12-06 18:21:48 +00:00
Kirk McKusick
fb14e73cb4 Normally when an attempt is made to mount a UFS/FFS filesystem whose
superblock has a check-hash error, an error message noting the
superblock check-hash failure is printed and the mount fails. The
administrator then runs fsck to repair the filesystem and when
successful, the filesystem can once again be mounted.

This approach fails if the filesystem in question is a root filesystem
from which you are trying to boot. Here, the loader fails when trying
to access the filesystem to get the kernel to boot. So it is necessary
to allow the loader to ignore the superblock check-hash error and make
a best effort to read the kernel. The filesystem may be suffiently
corrupted that the read attempt fails, but there is no harm in trying
since the loader makes no attempt to write to the filesystem.

Once the kernel is loaded and starts to run, it attempts to mount its
root filesystem. Once again, failure means that it breaks to its prompt
to ask where to get its root filesystem. Unless you have an alternate
root filesystem, you are stuck.

Since the root filesystem is initially mounted read-only, it is
safe to make an attempt to mount the root filesystem with the failed
superblock check-hash. Thus, when asked to mount a root filesystem
with a failed superblock check-hash, the kernel prints a warning
message that the root filesystem superblock check-hash needs repair,
but notes that it is ignoring the error and proceeding. It does
mark the filesystem as needing an fsck which prevents it from being
enabled for writing until fsck has been run on it. The net effect
is that the reboot fails to single user, but at least at that point
the administrator has the tools at hand to fix the problem.

Reported by:    Rick Macklem (rmacklem@)
Discussed with: Warner Losh (imp@)
Sponsored by:   Netflix
2018-12-06 00:09:39 +00:00
Gordon Tetlow
39040a9ec4 Always treat firmware request and response sizes as unsigned.
This fixes an incomplete bounds check on the guest-supplied request
size where a very large request size could be interpreted as a negative
value and not be caught by the bounds check.

Submitted by:	jhb
Reported by:	Reno Robert
Approved by:	so
Security:	FreeBSD-SA-18:14.bhyve
Security:	CVE-2018-17160
2018-12-04 18:28:25 +00:00
Eugene Grosbein
e0d1669595 Remove trim(8) by multiple demands. 2018-12-01 03:20:10 +00:00
Eugene Grosbein
09057b2c5c trim(8): serveral style fixes
Submitted by:		imp
MFC after:		1 month
Differential Revision:	https://reviews.freebsd.org/D18380
2018-11-30 21:57:02 +00:00
Mariusz Zaborski
1489776d43 iscsi: simplify the capsicumization
Approved by:	trasz
Differential Revision:	https://reviews.freebsd.org/D17962
2018-11-30 19:40:16 +00:00
Mark Johnston
c2c3992b39 Fix age_old_log() after r337468.
We can no longer use sizeof() to get the path buffer's size.  Apply
a straightforward fix for now with the aim of MFCing soon.

PR:		233633
Submitted by:	Katsuyuki Miyoshi <katsu@miyoshi.matsuyama.ehime.jp>
MFC after:	3 days
2018-11-29 16:49:56 +00:00
Eugene Grosbein
26ebe6565d trim.8: fix contents after rename from trim.1
MFC after:	1 month
2018-11-29 16:13:46 +00:00
Eugene Grosbein
1012931de7 trim(8): fix Makefile after rename from trim(1).
MFC after:	1 month
2018-11-29 16:10:54 +00:00
Eugene Grosbein
f0f5e20b78 Rename trim.1 to trim.8 too.
MFC after:	1 month
2018-11-29 16:09:24 +00:00
Eugene Grosbein
fcd7ccb28c Move trim(1) from usr.bin to usr.sbin to become trim(8).
Requested by:	se
MFC after:	1 month
2018-11-29 16:08:16 +00:00
Jamie Gritton
b307954481 In hardened systems, where the security.bsd.unprivileged_proc_debug sysctl
node is set, allow setting security.bsd.unprivileged_proc_debug per-jail.
In part, this is needed to create jails in which the Address Sanitizer
(ASAN) fully works as ASAN utilizes libkvm to inspect the virtual address
space. Instead of having to allow unprivileged process debugging for the
entire system, allow setting it on a per-jail basis.

The sysctl node is still security.bsd.unprivileged_proc_debug and the
jail(8) param is allow.unprivileged_proc_debug. The sysctl code is now a
sysctl proc rather than a sysctl int. This allows us to determine setting
the flag for the corresponding jail (or prison0).

As part of the change, the dynamic allow.* API needed to be modified to
take into account pr_allow flags which may now be disabled in prison0.
This prevents conflicts with new pr_allow flags (like that of vmm(4)) that
are added (and removed) dynamically.

Also teach the jail creation KPI to allow differences for certain pr_allow
flags between the parent and child jail. This can happen when unprivileged
process debugging is disabled in the parent prison, but enabled in the
child.

Submitted by:	Shawn Webb <lattera at gmail.com>
Obtained from:	HardenedBSD (45b3625edba0f73b3e3890b1ec3d0d1e95fd47e1, deba0b5078cef0faae43cbdafed3035b16587afc, ab21eeb3b4c72f2500987c96ff603ccf3b6e7de8)
Relnotes:	yes
Sponsored by:	HardenedBSD and G2, Inc
Differential Revision:	https://reviews.freebsd.org/D18319
2018-11-27 17:51:50 +00:00
Dag-Erling Smørgrav
cdd2df880d Add a “skip_dsn” option to g_part's bootcode verb to prevent g_part_mbr
from setting the volume serial number.  This unbreaks older boot blocks
that don't support serial numbers, and allows boot0cfg to set the serial
number itself if requested by the user.

Submitted by:	lev@, yuripv@
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D17386
2018-11-27 14:58:19 +00:00
Mateusz Piotrowski
e36f62bda6 Cross-reference mergemaster(8) & etcupdate(8).
Suggested by:	Daniel Ebdrup
Reviewed by:	bcr
Approved by:	bcr (doc), krion (mentor, implicit), mat (mentor, implicit)
Differential Revision:	https://reviews.freebsd.org/D18350
2018-11-27 10:31:29 +00:00
Dag-Erling Smørgrav
6b93819730 Check that /etc/resolv.conf exists before trying to read it.
Fix whitespace nit introduced in previous commit.

MFC after:	1 week
2018-11-27 09:46:01 +00:00
Dag-Erling Smørgrav
e86caa0bd0 Style cleanup. 2018-11-27 09:41:47 +00:00
Marcelo Araujo
edce78c2c4 Define AHCI_PORT_IDENT and increase by 1 the VTBLK_BLK_ID_BYTES
to avoid buffer accessed out of bounds, also switch to snprintf(3).

PR:		200859
Submitted by:	Caglar <caglar@10ur.org>
Obtained from:	https://github.com/mist64/xhyve/pull/24
MFC after:	4 weeks
Sponsored by:	iXsystems Inc.
2018-11-20 22:21:19 +00:00
Sean Eric Fagan
93840fdef6 mountd has no way to configure the listen queue depth; rather than add a new
option, we pass -1 down to listen, which causes it to use the
kern.ipc.soacceptqueue sysctl.

Approved by:	mav
MFC after:	2 weeks
Sponsored by:	iXsystems Inc
2018-11-14 19:06:43 +00:00
Renato Botelho
66a12de518 Fix typo introduced in r340439 - s/ETN/ETC/
Reported by:	jhb, yuripv
Approved by:	eugen
MFC after:	3 days
X-MFC-With:	340439
Sponsored by:	Rubicon Communications, LLC (Netgate)
2018-11-14 18:38:27 +00:00
Renato Botelho
f7f458b592 Fix /etc/ntp permissions. According to mtree it must be 0700
Reviewed by:	imp
Approved by:	imp
MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC (Netgate)
Differential Revision:	https://reviews.freebsd.org/D17973
2018-11-14 16:19:15 +00:00
Stefan Eßer
1894626876 Prepare move of ctm from base to a port (misc/ctm) by:
- Adding a note to UPDATING
- Adding a note to the history section of the manpage ctm.1
- Adding a message printed to STDERR to the ctm program

This version is meant for release in FreeBSD-12.0 and should remain in
FreeBSD-12 over its life-time.

A follow-up commit will remove ctm from -CURRENT after the MFC to 12
has happened.

Approved by:	imp, rgrimes, bcr (man-page)
MFC after:	3 days
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D17969
2018-11-14 08:45:48 +00:00
Conrad Meyer
dee401e833 cpucontrol(8): De-duplicate common update logic
Every µcode-updater must open the cpucontrol devfs node RDWR, open a
firmware file, validate the FW file has a positive length, mmap it, etc.
De-duplicate that identical logic between every individual platform.

Also, constify references to the readonly-mapped firmware files while here.

Sponsored by:	Dell EMC Isilon
2018-11-14 00:21:49 +00:00
Eric van Gyzen
cf44d7bd57 Fix daily mailq script for Postfix and daily_show_success="NO"
Exit with a zero status when Postfix reports "Mail queue is empty" so this
section won't appear in the report at all when daily_show_success="NO".

MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2018-11-11 00:39:20 +00:00
Eugene Grosbein
bcfc8c2779 weekly/340.noid: suppress warning on non-existent jail.conf
MFC after:	1 month
2018-11-10 17:49:19 +00:00
Eugene Grosbein
f984e1f8e3 Sigh... Fix another breakage after r340322: spell "sysrc" correctly.
MFC after:	1 month
2018-11-10 14:35:12 +00:00
Eugene Grosbein
2f45576d88 Fix breakage after r340322: add missing "-n" to invocation of sysrc.
MFH:		1 month
2018-11-10 14:25:37 +00:00
Eugene Grosbein
ab478b0185 Prevent periodic/etc/weekly/340.noid from descending into root directories
of jails. Jails have their own user/group databases and this script
can produce multiple false warnings, not to mention significant extra
load in case of large jailed subtrees. Leave this check for jailed
invocations of the same script.

MFC after:	1 month
2018-11-10 14:21:26 +00:00
Eugene Grosbein
1e1a4743ba jail(8): introduce new command option -e to exhibit
a list of configured non-wildcard jails with their parameters,
no matter running or not.

The option -e takes separator argument that is used
to separate printed parameters. It will be used with following
additions to system periodic scripts to differentiate parts
of directory tree belonging jails as opposed to host's.

MFC after:	1 month
2018-11-10 12:03:57 +00:00
Ben Woods
9165316ff6 newsyslog.conf: Restrict included files in default config to [!.]*.conf
The new default config will only include files from the following
directories which end with '.conf' and do not beginning with a '.'
character:
- /etc/newsyslog.conf.d/
- /usr/local/etc/newsyslog.conf.d/

This matches the syslog.conf(5) functionality, and also prevents '.sample' or
'.pkgnew' files being included. This is important for ports which install files
in /usr/local/etc/newsyslog.conf.d/ and also for pkgbase.

Approved by:	eadler
Approved by:	bapt
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D17086
2018-11-10 10:46:38 +00:00
Ed Maste
b6274d1775 kldxref: use appropriate Elf_Off type for offsets
Submitted by:	Mitchell Horne <mhorne063@gmail.com>
Reviewed by:	kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D13957
2018-11-09 15:02:53 +00:00
Mateusz Piotrowski
a641e44515 Cross-reference nohup(1) and daemon(8).
Reviewed by:	bcr
Approved by:	krion (mentor, implicit), mat (mentor, implicit)
Differential Revision:	https://reviews.freebsd.org/D17920
2018-11-09 13:47:06 +00:00
Hans Petter Selasky
ba2c34f4f2 Put a size limit on the opensm.log and use bzip2(1).
Discussed with:		markj@
Sponsored by:		Mellanox Technologies
2018-11-08 17:00:05 +00:00
Hans Petter Selasky
fa895a749e Revert r340246.
Sponsored by:		Mellanox Technologies
2018-11-08 16:23:09 +00:00
Hans Petter Selasky
5e0e7e1846 Add /var/log/opensm.log to list of rotating log files.
MFC after:		3 days
Sponsored by:		Mellanox Technologies
2018-11-08 12:43:13 +00:00
Marcelo Araujo
0f6f91a8ce Comestic change to try to inline the memset with SSE/AVX instructions.
Also switch from int to size_t to keep portability.

Reviewed by:	brooks
Sponsored by:	iXsystems Inc.
Differential Revision:	https://reviews.freebsd.org/D17795
2018-11-07 06:29:01 +00:00
Marcelo Araujo
2c386b11f8 Revert my bogus attempt to silence coverity on r340045, it created
more bad side effects than good.

PR:		233038
Submitted by:	We Maag <jwmaag@gmail.com>
2018-11-07 04:20:29 +00:00
Kyle Evans
bc82609ae2 Move pmc* bits behind MK_PMC to fix WITHOUT_PMC build
No objection from:	mmacy
MFC after:	3 days
2018-11-05 00:20:58 +00:00
Mariusz Zaborski
377421df96 capsicum: use a new capsicum helpers in tools
Use caph_{rights,ioctls,fcntls}_limit to simplify the code.
2018-11-04 19:24:49 +00:00
Baptiste Daroussin
56b187fca8 nfsd: Factorize code
Factorize code by using struct sockaddr_storage to handle both ipv6 and ipv4

Discussed with:	rmacklem
Reviewed by:	manu
MFC after:	1 month
Sponsored by:	Gandi.net
Differential Revision:	https://reviews.freebsd.org/D13223
2018-11-04 06:39:01 +00:00
Bjoern A. Zeeb
a613be5677 Update the "flag" for draft-ietf-6man-ipv6only-flag.
Having the flag named "6" can possibly be a problem for configurations
where parsing strings and numbers can produce ambivalent results.
Rename the "6" flag to the "S"ix (or Silence-IPv4) flag.
2018-11-03 18:03:24 +00:00
Hans Petter Selasky
fc40159c18 Use correct type for IOCTL request argument.
This fixes signed IOCTL value warnings in uhsoctl().

MFC after:		1 week
Submitted by:		Marcin Cieslak <saper@saper.info>
Sponsored by:		Mellanox Technologies
2018-11-02 22:23:25 +00:00
Marcelo Araujo
be81239ddc Remove printf for debug purpose forgotten on r340046.
Reported by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
2018-11-02 13:48:06 +00:00
Marcelo Araujo
6f2d76643e Add support ps/2 scancodes for NumLock, ScrollLock and numerical keypad
keys.

PR:		213835
Submitted by:	Vasily Postnicov <ivan.zhmudo@gmail.com>
MFC after:	4 weeks
Relnotes:	Yes
Sponsored by:	iXsystems Inc.
2018-11-02 08:28:14 +00:00
Marcelo Araujo
250c472a8c Fix resource leak when using strdup(3).
Reported by:	Coverity
CID:		1357337
Sponsored by:	iXsystems Inc.
2018-11-02 08:03:19 +00:00
Marcelo Araujo
93670f79d7 Fix resource leak when using strdup(3).
Reported by:	Coverity
CID:		1357336
Sponsored by:	iXsystems Inc.
2018-11-02 08:01:42 +00:00
Marcelo Araujo
6c8dae3cba Fix resource leak, variable fd going out of scope.
Reported by:	Coverity
CID:		1204383
Sponsored by:	iXsystems Inc.
2018-11-02 07:59:28 +00:00
Marcelo Araujo
ea2c655dd9 Fix resource leak, variables cp, xopts and nopt going out of scope.
Reported by:	Coverity
CID:		1305412
Sponsored by:	iXsystems Inc.
2018-11-02 07:57:28 +00:00
Edward Tomasz Napierala
5ae9f69896 Unbreak nscd(8). Without this change the CMSG gets truncated.
Reviewed by:	des
MFC after:	2 weeks
Sponsored by:	Chalmers University of Technology
Differential Revision:	https://reviews.freebsd.org/D17452
2018-11-01 18:19:10 +00:00
Conrad Meyer
d6e1e31a0e freebsd-update: add a progress report for the "fetching files..."
After patching step is done.

PR:		232857
Submitted by:	mat@
MFC after:	a week
2018-10-31 17:37:54 +00:00
Bjoern A. Zeeb
201100c58b Initial implementation of draft-ietf-6man-ipv6only-flag.
This change defines the RA "6" (IPv6-Only) flag which routers
may advertise, kernel logic to check if all routers on a link
have the flag set and accordingly update a per-interface flag.

If all routers agree that it is an IPv6-only link, ether_output_frame(),
based on the interface flag, will filter out all ETHERTYPE_IP/ARP
frames, drop them, and return EAFNOSUPPORT to upper layers.

The change also updates ndp to show the "6" flag, ifconfig to
display the IPV6_ONLY nd6 flag if set, and rtadvd to allow
announcing the flag.

Further changes to tcpdump (contrib code) are availble and will
be upstreamed.

Tested the code (slightly earlier version) with 2 FreeBSD
IPv6 routers, a FreeBSD laptop on ethernet as well as wifi,
and with Win10 and OSX clients (which did not fall over with
the "6" flag set but not understood).

We may also want to (a) implement and RX filter, and (b) over
time enahnce user space to, say, stop dhclient from running
when the interface flag is set.  Also we might want to start
IPv6 before IPv4 in the future.

All the code is hidden under the EXPERIMENTAL option and not
compiled by default as the draft is a work-in-progress and
we cannot rely on the fact that IANA will assign the bits
as requested by the draft and hence they may change.

Dear 6man, you have running code.

Discussed with:	Bob Hinden, Brian E Carpenter
2018-10-30 20:08:48 +00:00
Edward Tomasz Napierala
323d76db47 Make "nscd -t" work.
Reviewed by:	des@
MFC after:	2 weeks
Sponsored by:	Chalmers University of Technology
Differential Revision:	https://reviews.freebsd.org/D17563
2018-10-30 15:39:33 +00:00
Devin Teske
1b41374f09 Sort i18n messages in bsdinstall zfsboot
No functional change.

Sponsored by:	Smule, Inc.
2018-10-28 22:09:18 +00:00
Devin Teske
97820530b1 Fix dialog autosizing to accomodate for hline
dialog will conditionally ignore the --hline option if not enough space
was available to accomodate for the text width. Traditionally the width
of the widget had to be 10 wider than the text. Recent updates to dialog
have changed the requirement to be at least 12 wider than the hline text
else the hline text is not rendered at the bottom of the widget.

Sponsored by:	Smule, Inc.
2018-10-28 19:29:07 +00:00
Devin Teske
2c9d329756 Adjust for 80-columns.
No functional change.

Sponsored by:	Smule, Inc.
2018-10-28 00:58:39 +00:00
Yuri Pankov
8d56c80545 Provide basic descriptions for VMX exit reason (from "Intel 64 and IA-32
Architectures Software Developer’s Manual Volume 3").  Add the document
to SEE ALSO in bhyve.8 (and pet manlint here a bit).

Reviewed by:	jhb, rgrimes, 0mp
Approved by:	kib (mentor)
Differential Revision:	https://reviews.freebsd.org/D17531
2018-10-27 21:24:28 +00:00
Eugene Grosbein
b25a469f94 rcorder(8): add support for /etc/rc.resume, so it calls "rcorder -k resume"
and runs scripts containing "KEYWORD: resume" with single "resume" argument.

Working example is the port sysutils/cpupdate that defines
extra_commands="resume" to reload CPU microcode cleared
by suspend/resume sequence.

This change does nothing for a system having no scripts with KEYWORD: resume.

MFC after:		1 month
Differential Revision:	https://reviews.freebsd.org/D15247
2018-10-27 17:21:13 +00:00
Navdeep Parhar
9edef078cc cxgbetool(8): Add a subaction (tcbrss <n>) that can be used with "pass"
action to distribute traffic using the half of the VI's RSS indirection
table.

The value specified should either be the start of the VI's RSS slice
(available at dev.<ifname>.<inst>.rss_base since r339700) or the
midpoint (rss_base + rss_size/2).  The traffic that hits the filter will
use the first or second half of the indirection table respectively.
The indirection table can be populated in different ways to achieve
different kinds of traffic/load distributions.  For example, r339749
allows a netmap interface to have half the rx queues in the first half
of the table and the rest in the other.

Sponsored by:	Chelsio Communications
2018-10-27 05:26:09 +00:00
Warner Losh
92f9212ba6 Fix pointer arithmetic botch.
Pointer subtraction to find size only works with char pointers.

Noticed by: jhb@
Sponsored by: Netflix, Inc
2018-10-26 23:44:39 +00:00
Warner Losh
46fabdaffc Require that we have at least a device path header before
trying to decode the next device path.

Sponsored by: Netflix, Inc
2018-10-26 22:49:25 +00:00
Warner Losh
e08bb1091c Implenent --fromfile to read variable values when printing variables
So

./efivar --fromfile Boot0001.bin --print --load-option

will take the value from Boot0001.bin file and then decode it as if it
were a load-option. This is useful for debugging handling of such
variables that may be hanging the boot for some people.

Sponsored by: Netflix, Inc
2018-10-26 22:13:40 +00:00
Devin Teske
bb22479803 Add blank line after each item in "ngctl ls -l"
The output of "ngctl ls -l" is hard to read. To make it easier, add a blank
line after each listed item much how traditional "ls -l" does when listing
the contents of multiple directories.

Sponsored by:	Smule, Inc.
2018-10-26 19:16:17 +00:00
Devin Teske
ee21b0efc8 Adjust bsdinstall zfsboot code to 80-columns and whitespace fixes
No functional changes.

Sponsored by:	Smule, Inc.
2018-10-26 05:25:22 +00:00
Devin Teske
f0c98fded6 Fix dialog autosizing in bsdinstall auto error messages
Sponsored by:	Smule, Inc.
2018-10-26 02:08:44 +00:00
Devin Teske
224df38669 Whitespace alignment in bsdinstall hostname
Aligning line-continuation characters to prevent mistakes.
This is also the prevalent style replication throughout.

Sponsored by:	Smule, Inc.
2018-10-26 01:57:32 +00:00
Devin Teske
be99b53818 Sort i18n strings in bsdinstall hostname
Sponsored by:	Smule, Inc.
2018-10-26 01:47:52 +00:00
Devin Teske
6fd587f9f9 Add improved error checking to bsdinstall hostname
Sponsored by:	Smule, Inc.
2018-10-26 01:06:03 +00:00
Devin Teske
05b1c42540 Fix dialog autosizing in bsdinstall hostname
Sponsored by:	Smule, Inc.
2018-10-26 00:08:27 +00:00
Devin Teske
fef4815e9a Remove vestigial DIALOG_ITEM_HELP value in bsdconfig dialog.subr
Sponsored by:	Smule, Inc.
2018-10-25 23:32:32 +00:00
Mark Johnston
2b2135b8b5 Minor style fixes around script execution.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-10-25 21:45:24 +00:00
Mark Johnston
af19302315 Clarify the description of the -u option.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-10-25 21:41:58 +00:00
Xin LI
afa89716f9 Now that the portsnap buildbox is generating the raw bits for INDEX-13,
add it to the set of INDEX files built by portsnap.

Switch to INDEX-13 for head/.
2018-10-25 08:05:53 +00:00
Warner Losh
61ac1e28cc add links to the saga of CTM
Submitted by: phk
2018-10-24 19:21:04 +00:00
Mark Johnston
04c07c31eb Always free dynamically allocated memory before returning.
CID:		1007418
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-10-24 16:46:26 +00:00
Bjoern A. Zeeb
8883128b8e Allow the bhyve VNC server to listen on IPv6 for incoming connections.
Alternatively to IPv4 address:port this will allow to listen on IPv6
link-local (incl. scope), a specific address, or ::.  Addresses have
to be given in RFC2732 format so that [::]:port parsing will work.

This patch also starts to introduce WITH_INET/INET6_SUPPORT to bhyve.

PR:			232018
Submitted by:		Dave Rush (northwoodlogic.free gmail.com) (original)
Reviewed by:		Dave Rush (updated verison)
MFC after:		3 days
2018-10-24 08:45:33 +00:00
Bjoern A. Zeeb
fb72b618c5 In bhyve's fbuf emulation improve the overall "usage" message and
for the vga option, rather than printing the entire option string,
only print vga (as we do for everything else).

MFC after:	3 days
2018-10-22 11:43:43 +00:00
Warner Losh
c1cdf6a42f Remove mse(4) from tree
Remove mse and all support for bus and inport devices from the tree.
Data from nycbug's dmesg database shows the last sighting of this
driver was in 4.10 on only one machine.

Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D17628
2018-10-22 02:34:10 +00:00
Yuri Pankov
ea7fdebe80 pw: fix the checks in boolean_str() after r326738. Add related test
cases for `pw useradd -D -w`.

PR:		231649
Reviewed by:	eugen
Approved by:	kib (mentor)
Differential Revision:	https://reviews.freebsd.org/D17299
2018-10-21 14:23:56 +00:00
Ed Maste
8e1887fa1a pwd_mkdb: retire -B and -L endianness options
Legacy v3 db support was retired in r333133, and it was v3 support that
required the -B and -L options.  The options were retained temporarily,
but now that stable/12 has branched they can be removed.

Sponsored by:	The FreeBSD Foundation
2018-10-21 00:48:38 +00:00
Mark Johnston
618703b57b Fix a dead store.
We would fail to clear DNS search list configuration if a router
stopped specifying the DNSSL RA option.  I suspect that the bug
was mostly harmless, as the RDNSS and DNSSL options are typically used
together and omitting the RDNSS option would have the same effect.

CID:		1006219
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-10-20 18:00:13 +00:00
Mark Johnston
d2f6957c1c Remove dead code.
No functional change intended.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-10-20 17:44:23 +00:00
Mark Johnston
3d7dd2d69a Staticize a couple of functions.
No functional change intended.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-10-20 17:43:27 +00:00
Mark Johnston
1a97dd3cc3 Remove some obsolete compatibility code.
No functional change intended.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2018-10-20 17:40:30 +00:00
Benedict Reuschling
6aca7aa44b A single comma was missing to separate the "see also" items in
last.1 and lastlogin.8. Add it back.

PR:		231187
Submitted by:	david.marec@davenulle.org
2018-10-20 17:22:04 +00:00
Tobias Kortkamp
b287b40c49 vidcontrol(1): Fix a typo in the description of -f
While here:
- Fix markup in -c
- Fix mandoc -Tlint and igor warnings

Reviewed by:	0mp, bjk
Approved by:	bjk
Differential Revision:	https://reviews.freebsd.org/D17428
2018-10-20 16:59:43 +00:00
Dag-Erling Smørgrav
d0d49703a5 Add support for DNS-over-TLS to the local_unbound service.
Approved by:	re (kib)
2018-10-18 15:35:13 +00:00
Jamie Gritton
4520f617c9 Fix typos from r339409.
Reported by:	maxim
Approved by:	re (gjb)
2018-10-18 15:02:57 +00:00
Jamie Gritton
b19d66fd5a Add a new jail permission, allow.read_msgbuf. When true, jailed processes
can see the dmesg buffer (this is the current behavior).  When false (the
new default), dmesg will be unavailable to jailed users, whether root or
not.

The security.bsd.unprivileged_read_msgbuf sysctl still works as before,
controlling system-wide whether non-root users can see the buffer.

PR:		211580
Submitted by:	bz
Approved by:	re@ (kib@)
MFC after:	3 days
2018-10-17 16:11:43 +00:00
Yuri Pankov
4835c3b1df pw: (file == NULL) check is always false in read_userconfig(), remove
it.  Drop the now unused _PATH_PW_CONF definition. [1]

While here, change the last remaining hardcoded "/etc" to _PATH_PWD.

Noted by:	glebius [1]
Reviewed by:	eugen
Approved by:	re (gjb), kib (mentor)
Differential Revision:	https://reviews.freebsd.org/D17575
2018-10-16 16:00:41 +00:00
Yuri Pankov
03da20c5fa pw: respect path specified using -V when writing pw.conf, and -C is not
explicitly specified.  -V path is already used to determine which file
to read default values from, so it's only logical to write them to the
same file.

PR:		231653
Reviewed by:	eugen, bapt
Approved by:	re (gjb), kib (mentor)
Differential Revision:	https://reviews.freebsd.org/D17566
2018-10-15 20:11:53 +00:00
Allan Jude
84cf7c1df7 Make mfiutil show progress print out the elapsed time estimate in a
more humanized way

PR:		225993
Submitted by:	Enji Cooper <yaneurabeya@gmail.com>
Reviewed by:	jhb (previous version)
Approved by:	re (rgrimes)
2018-10-13 02:21:23 +00:00
Dag-Erling Smørgrav
0ff59c3e99 Improved substitution logic for Unbound man pages.
Approved by:	re (kib)
2018-10-10 08:20:14 +00:00
Glen Barber
1da7787f71 Merge the remainder of the projects/openssl111 branch to head.
- Update OpenSSL to version 1.1.1.
- Update Kerberos/Heimdal API for OpenSSL 1.1.1 compatibility.
- Bump __FreeBSD_version.

Approved by:	re (kib)
Sponsored by:	The FreeBSD Foundation
2018-10-09 21:28:26 +00:00
Jung-uk Kim
6f1f1a6395 Update ACPICA to 20181003.
Approved by:	re (gjb)
2018-10-09 18:40:36 +00:00
Ed Maste
539a27e105 Switch ntp's embedded libevent to 2.1.18
For OpenSSL 1.1.1 compatibility.

In Makefile.inc1 add (to the existing similar cases) a hack to handle
dependencies across the migration.

Reviewed by:	jhb
Approved by:	re (gjb)
Sponsored by:	The FreeBSD Foundation.
Differential Revision:	https://reviews.freebsd.org/D17481
2018-10-09 18:35:45 +00:00
Glen Barber
7c32835287 MFH r338661 through r339253.
Sponsored by:	The FreeBSD Foundation
2018-10-09 14:27:55 +00:00
Glen Barber
2ba8b5b375 Fix the distribution path for -ALPHA builds, which are under
the snapshots directory, not releases.

Reported by:	David Marec david.marec _at_ davenulle _dot_ org
Approved by:	re (rgrimes)
Sponsored by:	The FreeBSD Foundation
2018-10-08 19:48:58 +00:00
Glen Barber
846803208a Fix a mismerge from head to projects/openssl111.
r339213 was cherry-picked back to head from the project branch, which
caused a conflict.  This commit properly records the mergeinfo from
head.

r339205 was missed, and r339214 is required for reintegration.

Sponsored by:	The FreeBSD Foundation
2018-10-08 19:39:05 +00:00
John Baldwin
1bcac4ba99 Add support for relocations in RISC-V kernel modules to kldxref.
Reviewed by:	br, markj
Approved by:	re (gjb)
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D17415
2018-10-08 19:15:58 +00:00
Edward Tomasz Napierala
c0936c90d3 Remove BUGS section from nscd.conf(5) man page. This was missed in r339194.
Approved by:	re (rgrimes)
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2018-10-06 17:40:14 +00:00
Glen Barber
01d4e2149e MFH r338661 through r339200.
Sponsored by:	The FreeBSD Foundation
2018-10-05 17:53:47 +00:00
Edward Tomasz Napierala
19fa5a5066 Remove the BUGS section of nscd(8) man page. According to bushman@'s
reponse quoted in PR, he no longer maintains it.

PR:		210590
Approved by:	re (kib)
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2018-10-05 12:08:32 +00:00
Mateusz Piotrowski
ace6712810 bsdinstall(8): Fix a typo.
Reported by:	Jose Luis Duran
Reviewed by:	bcr
Approved by:	re (gjb), krion (mentor, implicit), mat (mentor, implicit)
Differential Revision:	https://reviews.freebsd.org/D17409
2018-10-05 08:17:29 +00:00
Mateusz Piotrowski
5475ce6290 bsdinstall(8): Document ZFS installation scripting.
- Extend the bsdinstall(8) man page with ZFS installation scripting
  details. [1]
- Extend the bsdinstall(8) man page with the description of all the ZFS
  variables involved in a scripted installation of ZFS-based systems. [1]
- Extend the SCRIPTING section with an example for a ZFS-based scripted
  installation. [1]
- Create a new section explaining how ZFS datasets must be written into
  a variable to get them set on the final system. [1]

While here:
- Add Roberto to the copyrights for recognition as changes to the manual
  page are huge.
- Use "Dq" for default values.
- Use sysrc(8) instead of echo in examples.

Submitted by:	Roberto Fernandez Cueto <roberfern@gmail.com> [1]
Reviewed by:	dteske
Approved by:	re (gjb), krion (mentor, implicit), mat (mentor, implicit)
Differential Revision:	https://reviews.freebsd.org/D14169
2018-10-04 09:28:40 +00:00
Ruslan Bukin
e8e87febec Fix build with GCC 8.1.
GCC 8.1 failed to build LLVM's libc++ when -Wshadow is set,
so lower down WARNS flag to 3.

This is similar to dtc(1) which uses libc++ and sets WARNS to 3.

Approved by:	re (gjb)
Sponsored by:	DARPA, AFRL
2018-10-01 16:16:05 +00:00
Warner Losh
517a1827f7 Relax syntax requirements of source string
The original spec for the strings describing the PNP info didn't allow
spaces. Several times now people have broken the install by including
them. Relax the syntax to allow them after the ; which is where
people's muscle memory tends to put them.

Approved by: re@ (gjb)
2018-09-26 19:41:06 +00:00
Bryan Drewery
d51abd5fe1 Handle overflow of uid or gid in arguments for chown
chown incorrectly allows a uid or gid greater than UID_MAX/GID_MAX respectively.
Using such an argument rolls over to accounts such as root, operator, etc.

Approved by:	re (gjb)
Relnotes:	yes
Reviewed by:	cem, kib
Submitted by:	Don Morris <dgmorris@earthlink.net>
Sponsored by:	Dell EMC
Differential Revision:	https://reviews.freebsd.org/D15119
2018-09-26 18:40:57 +00:00
Matt Macy
7362ac9ca9 restore pmccontrol -L behavior on x86
When I updated counter definition handling for x86 I broke
'pmccontrol -L' listing counter names. This just changes
pmccontrol to call the library function on x86.

PR:	230984
Approved by:	re (kib@)
2018-09-24 19:06:09 +00:00
Ed Maste
9f9d314d11 Switch ntp's embedded libevent to 2.1.18
For OpenSSL 1.1.1 compatibility.

Sponsored by:	The FreeBSD Foundation.
2018-09-24 17:51:56 +00:00
Navdeep Parhar
1e16837679 cxgbetool(8): The VLAN tag provided in the action for a filter must be prefixed
with either '=' or '+'.  Fix the description of the parameter in the man page
while here.

Approved by:	re@ (kib@)
Sponsored by:	Chelsio Communications
2018-09-21 23:48:40 +00:00
Dag-Erling Smørgrav
c3afb29bb6 Add an installer option to disable destructive dtrace.
Submitted by:		Jörg Pernfuß <code.jpe@gmail.com>
Approved by:		re (kib)
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D12474
2018-09-21 09:27:32 +00:00
Mark Johnston
33a5ef3587 Fix variable name typo in the bsdinstall ttys hardening code.
Submitted by:	Jörg Pernfuß <code.jpe@gmail.com>
Reviewed by:	allanjude, dab, emaste
Approved by:	re (gjb)
Differential Revision:	https://reviews.freebsd.org/D12476
2018-09-20 16:37:50 +00:00
Brad Davis
80994f8119 Move hosts.lpd and printcap to usr.sbin/lpr/lpd/
This leverages CONFS to handle the install

Approved by:	re (blanket, pkgbase), bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D17238
2018-09-20 09:21:05 +00:00
Jung-uk Kim
6bd321e62b Make uefisign(8) buildable. 2018-09-19 07:10:28 +00:00
Jung-uk Kim
16e2656210 Make ppp(8) buildable. 2018-09-19 07:09:55 +00:00
Navdeep Parhar
93dcd0775f cxgbetool(8): Clarify the meaning of the "queue" parameter used to steer
traffic to a particular queue.

Submitted by:	Krishnamraju Eraparaju @ Chelsio
Approved by:	re@ (kib@)
2018-09-18 22:41:30 +00:00
Brad Davis
af734c7746 Move amd.map to usr.sbin/amd/amd/
This leverages CONFS to handle the install of the config file.

Approved by:	re (gjb), will (mentor)
Differential Revision:	https://reviews.freebsd.org/D17159
2018-09-18 00:32:10 +00:00
Matt Macy
3b9156971f re-enable pmcstat, pmccontrol, and pmcannotate for gcc4 builds
I had disabled building of the aforementioned targets due to warnings breaking
tinderbox. This silences the warning and restores them to the build.

Reported by:	jhibbits
Reviewed by:	jhibbits
Approved by:	re (gjb)
2018-09-14 01:11:10 +00:00
Ed Maste
26dfa867d2 cpucontrol: correct typo
There should be no 't' in processort_rev_id.

Approved by:	re (gjb)
Sponsored by:	The FreeBSD Foundation
2018-09-11 17:09:16 +00:00
Edward Tomasz Napierala
94df44ee6c Add u3g ppp.conf entry. It provides some starting point to making
use of u3g(4) dongles, and in many cases can work out of the box.

Reviewed by:	hselasky
Approved by:	re (gjb)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D16974
2018-09-11 17:05:26 +00:00
David E. O'Brien
ca8882cad6 Add MPLS LSP-echo (RFC8029, March 2017) port.
Reviewed by:	stevek
Approved by:	re(gjb)
Obtained from:	Juniper Networks
2018-09-06 18:34:11 +00:00
Brad Davis
2d7bc6b39b Move etc/crontab to usr.sbin/cron/cron/
Approved by:	re (gjb), will (mentor)
Differential Revision:	https://reviews.freebsd.org/D16786
2018-09-06 14:55:54 +00:00
Warner Losh
de6b4aa8c4 Make -a (to make the entry active) apply to creation of a new boot
variable.

Approved by: re@ (rgrimes)
PR: 231013
Differential Revision:  https://reviews.freebsd.org/D16977
2018-09-02 18:40:18 +00:00
Brad Davis
412e58bf47 Move defaults/periodic.conf back to a config file.
Ths prevents etcupdate and mergemaster from deleting it for now.

Approved by:	re (rgrimes), will (mentor)
Differential Revision:	https://reviews.freebsd.org/D16975
2018-09-02 15:53:56 +00:00
Kyle Evans
d3d381b2b1 userboot: handle guest interpreter mismatches more intelligently
The switch to lualoader creates a problem with userboot: the host is
inclined to build userboot with Lua, but the host userboot's interpreter
must match what's available on the guest. For almost all FreeBSD guests in
the wild, Lua is not yet available and a Lua-based userboot will fail.

This revision updates userboot protocol to version 5, which adds a
swap_interpreter callback to request a different interpreter, and tries to
determine the proper interpreter to be used based on how the guest
/boot/loader is compiled. This is still a bit of a guess, but it's likely
the best possible guess we can make in order to get it right. The
interpreter is now embedded in the resulting executable, so we can open
/boot/loader on the guest and hunt that down to derive the interpreter it
was built with.

Using -l with bhyveload will not allow an intepreter swap, even if the
loader specified happens to be a userboot with the wrong interpreter. We'll
simply complain about the mismatch and bail out.

For legacy guests without the interpreter marker, we assume they're 4th.
For new guests with the interpreter marker, we'll read it and swap over
to the proper interpreter if it doesn't match what the userboot we're using
was compiled with.

Both flavors of userboot are installed by default, userboot_4th.so and
userboot_lua.so. This fixes the build WITHOUT_FORTH as a coincidence, which
was broken by userboot being forced to 4th.

Reviewed by:	imp, jhb, araujo (earlier version)
Approved by:	re (gjb)
Differential Revision:	https://reviews.freebsd.org/D16945
2018-09-01 02:23:45 +00:00
Philip Paeps
427b88d77e Add libxo(3) support to lastlogin(8).
Reviewed by:	kp
Approved by:	re (gjb)
MFC after:	1 week
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D16919
2018-08-28 17:12:37 +00:00
Mark Johnston
670c1e4b1c Add missing endpwent() and endgrent() calls to nfsuserd(8).
PR:		230937
Submitted by:	Peter Eriksson <peter@ifm.liu.se>
Reviewed by:	rmacklem
Approved by:	re (gjb)
MFC after:	1 week
2018-08-28 15:18:14 +00:00
Brad Davis
00d5b07760 Fix the install location of hcsecd.conf
Submitted by:	vangyzen
Approved by:	re (marius)
2018-08-26 02:09:20 +00:00
Brad Davis
f1722afc8d Remove trailing slash in pathname so that valid METALOG is created in the
NO_ROOT case of make packages.

Submitted by:	Dan McGregor <dan.mcgregor@usask.ca>
Approved by:	re (rgrimes)
2018-08-25 20:19:16 +00:00
Allan Jude
aa2a0e0fc3 bsdinstall/zfsboot: Enable new UEFI+GELI support
After r336252 it is no longer necessary to have a separate bootpool when
booting from an encrypted disk with UEFI.

This change also switches the EFI System Partition contents from
the 800 KB boot1.efifat to a new 200 MB filesystem created with newfs_msdos
and uses loader.efi directly, instead of boot1.efi.

PR:		228916
Reviewed by:	dteske
MFC after:	1 month
Relnotes:	yes
Sponsored by:	Klara Systems
Differential Revision:	https://reviews.freebsd.org/D12315
2018-08-23 22:50:11 +00:00
Renato Botelho
7ae43b318f usr.sbin/ndp: Cleanup in preparation to add libxo support
* Constify rtpref_str declaration
* Remove unused h_errno declaration
* Use time_t type for expire
* Use strlcpy to set static "?" value to ifname
* Rename local variable 's' to stop shadowing global definition
* Close socket used in pfx_flush()
* Use local variables for sock() in setdefif() and getdefif()
* Increase WARNS to 3

Reviewed by:	allanjude, kevans
Approved by:	allanjude
Sponsored by:	Rubicon Communications, LLC (Netgate)
Differential Revision:	https://reviews.freebsd.org/D11118
2018-08-23 10:38:59 +00:00
Marcelo Araujo
1aa56353ad Add manpage entry for the new bhyve options -s "help" and -l "help".
Reported by:	0mp
Sponsored by:	iXsystems Inc.
2018-08-23 07:34:51 +00:00
Warner Losh
5fa2979791 Create devctl freeze/thaw.
This adds it to devctl, libdevctl, defines the two IOCTLs and
implements the kernel bits. causes any new drivers that are added via
kldload to be deferred until a 'thaw' comes in. These do not stack: it
is an error to freeze while frozen, or thaw while thawed.

Differential Revision: https://reviews.freebsd.org/D16735
2018-08-23 05:05:47 +00:00
Rick Macklem
9893bfe27f Fix the nfsuserd.8 man page for the changes made to support uid/gid
numbers in owner and owner_group strings.

This is a content change.
2018-08-23 00:05:13 +00:00
Brad Davis
376a4e3255 Move services to usr.sbin/services_mkdb/
This is pkgbase related as it switches to CONFS to properly tag this as a
config file.

Approved by:	will (mentor)
Differential Revision:	https://reviews.freebsd.org/D16848
2018-08-22 21:22:40 +00:00
Marcelo Araujo
657d21589e Add -s "help" and -l "help" to print a list of supported PCI and LPC devices.
For tools that uses bhyve such like libvirt, it is important to be able to
probe what features are supported by the given bhyve binary.

To give more context, libvirt probes bhyve's capabilities in a not very
effective way:
- Running 'bhyve -h' and parsing output.
- To detect devices, it runs 'bhyve -s 0,dev' for every each device and
  parses error output to identify if the device is supported or not.

PR:		2101111
Submitted by:	novel
MFC after:	2 weeks
Relnotes:	yes
Sponsored by:	iXsystems Inc.
2018-08-22 20:23:08 +00:00
Patrick Kelsey
249cc75fd1 Extended pf(4) ioctl interface and pfctl(8) to allow bandwidths of
2^32 bps or greater to be used.  Prior to this, bandwidth parameters
would simply wrap at the 2^32 boundary.  The computations in the HFSC
scheduler and token bucket regulator have been modified to operate
correctly up to at least 100 Gbps.  No other algorithms have been
examined or modified for correct operation above 2^32 bps (some may
have existing computation resolution or overflow issues at rates below
that threshold).  pfctl(8) will now limit non-HFSC bandwidth
parameters to 2^32 - 1 before passing them to the kernel.

The extensions to the pf(4) ioctl interface have been made in a
backwards-compatible way by versioning affected data structures,
supporting all versions in the kernel, and implementing macros that
will cause existing code that consumes that interface to use version 0
without source modifications.  If version 0 consumers of the interface
are used against a new kernel that has had bandwidth parameters of
2^32 or greater configured by updated tools, such bandwidth parameters
will be reported as 2^32 - 1 bps by those old consumers.

All in-tree consumers of the pf(4) interface have been updated.  To
update out-of-tree consumers to the latest version of the interface,
define PFIOC_USE_LATEST ahead of any includes and use the code of
pfctl(8) as a guide for the ioctls of interest.

PR:	211730
Reviewed by:	jmallett, kp, loos
MFC after:	2 weeks
Relnotes:	yes
Sponsored by:	RG Nets
Differential Revision:	https://reviews.freebsd.org/D16782
2018-08-22 19:38:48 +00:00
Rick Macklem
04499b28af Revert r320758, which was the man page update for r320757 just reverted.
This is a content change.

PR:		230752
2018-08-22 12:26:17 +00:00
Rick Macklem
7897d2a532 Revert r320757 since it can cause "excl->shared" panics.
PR#230752 shows a panic where an nfsd thread tries to do soconnect() on
the AF_LOCAL socket used by the nfsuserd while already holding an
exclusive lock on it. I am not 100% sure how this happens, but since an
AF_LOCAL socket is in the file system namespace it is conceivable that it
could lock it and then attempt an upcall to the nfsuserd.
However, reverting r320757 stops the nfsuserd from using an AF_LOCAL
socket, so it should avoid any such panic().
r320757 did fix a problem with running the nfsuserd when jails were
enabled, but that can be dealt with less elegantly by allowing the
use of an alternate address instead of 127.0.0.1.
The gssd daemon also uses an AF_LOCAL socket, but it will do upcalls
before the nfsd thread processes the RPC, so I think it should not
be suseptible to this problem.

PR:		230752
2018-08-22 12:20:10 +00:00
Alex Richardson
266fbc83fe Use unifdef -x1 instead of ignoring the shell exit code
This way the target fails if unifdef doesn't exist or doesn't modify the
file instead of just generating an empty .c file.
I found this while building without inherited $PATH (D16815)

Approved By:	jhb (mentor)
2018-08-22 11:56:51 +00:00
Chuck Tuffli
9544e6dcf1 Make NVMe compatible with the original API
The original NVMe API used bit-fields to represent fields in data
structures defined by the specification (e.g. the op-code in the command
data structure). The implementation targeted x86_64 processors and
defined the bit fields for little endian dwords (i.e. 32 bits).

This approach does not work as-is for big endian architectures and was
changed to use a combination of bit shifts and masks to support PowerPC.
Unfortunately, this changed the NVMe API and forces #ifdef's based on
the OS revision level in user space code.

This change reverts to something that looks like the original API, but
it uses bytes instead of bit-fields inside the packed command structure.
As a bonus, this works as-is for both big and little endian CPU
architectures.

Bump __FreeBSD_version to 1200081 due to API change

Reviewed by: imp, kbowling, smh, mav
Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D16404
2018-08-22 04:29:24 +00:00
Conrad Meyer
c657f9385b newsyslog(8): Reject configurations that specify setuid or executable logs
Prevent some classes of foot-shooting that may result in permissions
problems.

Reviewed by:	dab, delphij, vangyzen (earlier version)
Relnotes:	yes (behavior change)
Sponsored by:	Dell EMC Isilon
Differential Revision:	D16831
2018-08-21 23:12:46 +00:00
Marcelo Araujo
1465a1e1eb Fix resource leak when using strdup(3).
Reported by:	Coverity
CID:		1394929
Sponsored by:	iXsystems Inc.
2018-08-21 23:11:26 +00:00
Brad Davis
c8e7055577 Move all bluetooth related config files out of etc
This helps with pkgbase by switching to CONFS so they are properly tagged as
config files.

Approved by:	will (mentor)
Differential Revision:	https://reviews.freebsd.org/D16833
2018-08-21 19:28:53 +00:00
Brad Davis
64be79ef76 Move all syslogd related configs to usr.sbin/syslogd/
This helps with pkgbase as it switches these to use CONFS which properly tags
them as config files.

Approved by:	will (mentor)
Differential Revision:	https://reviews.freebsd.org/D16783
2018-08-21 17:01:47 +00:00
Marcelo Araujo
0b9079bf95 - Add CSV output to gstat via -C flag.
Add a -C option, similar to -B, that allows gstat to produce basic CSV output
with absolute timestamps (ISO 8601, nearly.) Multiple devices are handled by
way of a single-pivot CSV table with duplicated timestamps for each object
output.

Submitted by:	Nick Principe <nap__ixsystems.com>
Reviewed by:	myself, imp@, asomers (earlier verison), bcr (manpages)
Sponsored by:	iXsystems Inc.
Differential Revision:	https://reviews.freebsd.org/D16151
2018-08-21 11:22:49 +00:00
Xin LI
4e1ef62a36 MFV r338092: ntp 4.2.8p12.
Relnotes:	yes
2018-08-21 02:38:07 +00:00
Kyle Evans
4b09be036d config(8): Allow escape-quoted empty strings
For use with things like BOOT_TAG=\"\" -- there are valid reasons to allow
empty strings, especially as these are usually being passed through as
options. The same argument could perhaps be made for the unquoted
variant in things like MODULES_OVERRIDE="", but it's not immediately clear
that this is an issue so I've left it untouched.

MFC after:	3 days
2018-08-20 22:08:03 +00:00
Warner Losh
9b78aedb69 mergemaster: better defaults for SOURCEDIR
If we can't find a Makefile.inc1 in the specified / default SOURCEDIR, and
there's a Makefile.inc1 in the current directory, offer the user the choice
of using . for SOURCEDIR.

Differential Revsion: https://reviews.freebsd.org/D16709
2018-08-20 19:39:49 +00:00
Bjoern Heidotting
951de5548b In r324732 sysinstall was replaced by bsdinstall.
However, for post-install configuration, bsdinstall
is not of much use. Point the user to bsdconfig instead.

Reviewed by:	0mp, bcr
Approved by:	0mp, bcr
Differential Revision:	https://reviews.freebsd.org/D16751
2018-08-20 18:17:50 +00:00
Will Andrews
a4671335c5 iostat: update man page for r277566
The original commit added granularity to the transaction latency display
in the extended device stats mode, but didn't update the man page.

Reported by:	Miroslav Lachman <000.fbsd@quip.cz> via jmg
MFC after:	1 day
2018-08-20 13:42:22 +00:00
Marcelo Araujo
6b2c20cd98 NVMe spec version 1.3c says that "serial number" field must be 7-bit ASCII,
with unused bytes padded by space characters. Same for firmware number and
namespace number.

Discussed with:	imp@
Sponsored by:	iXsystems Inc.
2018-08-20 04:56:37 +00:00
Marcelo Araujo
b018ea0174 Users must set the number of queues from 1 to maximum 16 queues.
Sponsored by:	iXsystems Inc.
2018-08-20 04:50:11 +00:00
Marcelo Araujo
df90fce298 Fix double mutex lock.
Reported by:	Coverity
CID:		1394833
Discussed with:	Leon Dang
Sponsored by:	iXsystems Inc.
2018-08-20 04:44:29 +00:00
Eitan Adler
4750b59aca send-pr: wave goodbye
Entering into the world of 12.x we no longer need even the placeholder
for send-pr. It has not done anything for some time.

With Hat: bugmeister
2018-08-19 07:12:35 +00:00
Nick Hibma
f80b39d182 Add the possibility to mark packets urgent based on their length.
This allows preferring small (e.g. ACK) packets, in upload heavy
environments.

It was already possible to mark packets urgent based on destination
port. This option piggy backs on that feature.
2018-08-17 10:18:45 +00:00
Jamie Gritton
07ebf3dd69 security.jail.enforce_statfs is handled by jail_set(2), so handling it in
userspace jail(8) is redundant.

Differential Revision:	D14791
2018-08-16 18:30:49 +00:00
Marcelo Araujo
ec89307fb1 Fix a resource leak when using strdup(3) and also fix few style(9).
Reported by:	Coverity
CID:		1394929
MFC after:	1 week
Sponsored by:	iXsystems Inc.
2018-08-16 06:38:01 +00:00
Marcelo Araujo
3955e1c03a Remove duplicated code.
Reported by:	Coverity
CID:		1394893
MFC after:	1 week
Sponsored by:	iXsystems Inc.
2018-08-16 06:35:44 +00:00
Marcelo Araujo
9e59a2e8ce Add a comment explaining how the PSN works and why there is no need for
a null terminator. Also mark CID 1394825 as intentional.

Reported by:	Coverity
CID:		1394825
MFC after:	1 week
Sponsored by:	iXsystems Inc.
2018-08-16 06:31:54 +00:00
Marcelo Araujo
e30993c2a6 Increase the mask from 15 to 255 or otherwise NVME_FEAT_SOFTWARE_PROGRESS
will never be reached.

Discussed with:	Leon Dang and Darius Mihai <dariusmihaim@gmail.com>
MFC after:	1 week.
Sponsored by:	iXsystems Inc.
2018-08-16 06:20:25 +00:00
Jamie Gritton
92bceb9756 Don't let clobber jailparam values when checking for modification of
init-only parameters.

Compare string parameter values with strncmp, not memcmp.

PR:		230487
Reported by:	Jason Mader
MFC after:	3 days
2018-08-15 20:23:17 +00:00
Alexander Leidinger
f6c0e63bf7 - Add exec hook "exec.created". This is called when the jail is
created and before exec.start is called.			[1]
- Bump __FreeBSD_version.

This allows to attach ZFS datasets and various other things to be
done before any command/service/rc-script is started in the new
jail.

PR:			228066					[1]
Reviewed by:		jamie					[1]
Submitted by:		Stefan Grönke <stefan@gronke.net>	[1]
Differential Revision:	https://reviews.freebsd.org/D15330	[1]
2018-08-15 18:35:42 +00:00
Edward Tomasz Napierala
bd9325a169 Add the "autoro" flag to /media. This makes it attempt to mount
it read-only instead of just failing if the media is write-protected.

The /net doesn't seem to require the flag.

MFC after:	2 weeks
Relnotes:	yes
Sponsored by:	DARPA, AFRL
2018-08-14 13:52:08 +00:00
Jung-uk Kim
51f42bad71 Merge ACPICA 20180810. 2018-08-13 16:26:26 +00:00
Brad Davis
eecd09850d Move inetd.conf to usr.sbin/inetd/
This is pkgbase related as it uses CONFS to tag the file as a config file

Approved by:	AllanJude (mentor)
Sponsored by:	Essen Hackathon
Differential Revision:	https://reviews.freebsd.org/D16693
2018-08-12 13:29:40 +00:00
Brad Davis
31ef5c6891 Move all the newsyslog related configs to usr.sbin/newsyslog/
This is related to pkgbase and changes these to use CONFS so that these are
tagged as config files.

Approved by:	AllanJude (mentor)
Sponsored by:	Essen Hackathon
Differential Revision:	https://reviews.freebsd.org/D16694
2018-08-12 13:24:53 +00:00
Brad Davis
9488993b1d Move all NTP related files to usr.sbin/ntp/ntpd.
This helps with pkgbase by using CONFS to tag these as config files.

Approved by:	allanjude (mentor), ian, cy
Sponsored by:	Essen Hackathon
Differential Revision:	https://reviews.freebsd.org/D16661
2018-08-11 17:42:42 +00:00
Brad Davis
81ea85a884 Move all periodic related config and scripts to usr.sbin/periodic/
This makes pkgbase easier by tagging these as CONFS so they are properly
tagged as config files.

Approved by:	will (mentor)
Sponsored by:	Essen Hackathon
Differential Revision:	https://reviews.freebsd.org/D16553
2018-08-11 17:11:08 +00:00
Kevin Lo
40bb18ef11 Remove unused MAPDESCFILE. 2018-08-11 14:45:33 +00:00
Brad Davis
c2d948fa77 Move snmpd.config to usr.sbin/bsnmpd/bsnmpd/
This helps with pkgbase as this config file will now be tagged as a config
file

Approved by:	allanjude (mentor)
Sponsored by:	Essen Hackathon
Differential Revision:	https://reviews.freebsd.org/D16674
2018-08-11 13:47:28 +00:00
Brad Davis
9584f61992 Move OpenBSM to CONFS
This helps with pkgbase as these config files will be properly tagged as
config files.

Approved by:	allanjude (mentor), oshogbo
Differential Revision:	https://reviews.freebsd.org/D16679
2018-08-11 13:23:09 +00:00
Navdeep Parhar
6ba813531f cxgbetool(8): Userspace part of support for high priority filters on T6+.
MFC after:	1 week
Sponsored by:	Chelsio Communications
2018-08-09 14:21:27 +00:00
Xin LI
963aa85d2a In read_zones(), check if the file name actually fit in the buffer
and make sure it would terminate with nul with strlcpy().

Reviewed by:	imp (earlier revision)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D16595
2018-08-09 02:47:22 +00:00
Rick Macklem
b8ac5c5a01 Fix a typo plus add a couple of sentences to pnfsserver.4.
This is a content change.
2018-08-09 00:15:28 +00:00
Rick Macklem
928ab9c625 Fix the err() arguments for a nfssvc(8) failure.
argv has been incremented during argument handling, so elements of the
array are no longer valid. Change the err() arguments so only the
first string pointer in argv is used.
Found during code inspection.
2018-08-08 20:30:12 +00:00
Mark Johnston
c274f99ab3 Use the right variable when updating interface routes.
PR:		229807
Submitted by:	John Hay <jhay@meraka.org.za>
MFC after:	2 weeks
2018-08-08 20:15:40 +00:00
Alan Somers
47cc9ee1b1 Switch the default pager for most commands to less
Finally, a pager for the nineties.

MFC after:	Never
Relnotes:	Yes
Differential Revision:	https://reviews.freebsd.org/D13465
Poll:		https://reviews.freebsd.org/V7
2018-08-08 19:24:20 +00:00
Mark Johnston
28984f2552 Simplify compression code.
- Remove the compression suffix macros and move them directly into the
  compress_type array.
- Remove the hardcoded sizes on the suffix and compression args arrays.
- Simplify the compression args arrays at the expense of a __DECONST
  when calling execv().
- Rewrite do_zipwork.  The COMPRESS_* macros can directly index the
  compress_types array, so the outer loop is not needed. Convert
  fixed-length strings into asprintf or sbuf calls.

Submitted by:	Dan Nelson <dnelson_1901@yahoo.com>
Reviewed by:	gad
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D16518
2018-08-08 17:26:51 +00:00
Rick Macklem
9725268c01 Add a reference to pnfsserver.4 to the nfsd.8 man page.
This is a content change.
2018-08-05 20:36:48 +00:00