Commit Graph

16685 Commits

Author SHA1 Message Date
Warner Losh
9013a3a0de 'b' is short for --binary, it isn't 'a'.
PR: 213437
Submitted by: Ganael LAPLANCHE
2016-10-13 17:03:54 +00:00
Warner Losh
b2a7ac4802 Fix building on i386 and arm. But 'public domain' headers on the files
with no creative content. Include "lost" changes from git:
o Use /dev/efi instead of /dev/efidev
o Remove redundant NULL checks.

Submitted by: kib@, dim@, zbb@, emaste@
2016-10-13 06:56:23 +00:00
Ed Maste
4d6fa8848f Temporarily disconnect efivar to fix arm and i386 builds 2016-10-12 20:25:03 +00:00
Colin Percival
e7fd266eaf MFportsnap r264740: Use case insensitive match when parsing host(1) output.
Some DNS caches turn "FreeBSD.org" into "freebsd.org", which was causing
the printed SRV records to not match our regex.

PR:		170503
MFC after:	2 weeks
2016-10-12 20:24:33 +00:00
Warner Losh
4b844f8d99 Add efivar(1) to manipulate EFI variables. It uses a similar command
line interface to the Linux program, as well as adding a number of
useful features to make using it in shell scripts easier (since we
don't have a filesystem to fall back on interacting with).

Differential Revision: https://reviews.freebsd.org/D8128
Reviewed by: kib@, wblock@, Ganael Laplanche
2016-10-11 22:31:45 +00:00
Ed Maste
cb4fe258b4 chown: use NULL instead of 0 for null pointer 2016-10-10 14:21:21 +00:00
Eric van Gyzen
5bbdbbcda2 Additional cleanup of the arp(4) man page after r306652
Submitted by:	David A. Bright <david.a.bright@dell.com>
Requested by:	wblock
Reviewed by:	wblock
MFC after:	23 days
Sponsored by:	Dell EMC
Differential Revision:	https://reviews.freebsd.org/D8183
2016-10-07 22:17:25 +00:00
Stephen J. Kiernan
3ad36a25cf Just remove freeing memory in pmcstat_cleanup, since we only clean up
when we are exiting anyway.

Add NULL checks for all malloc and strdup returns.

Reviewed by:	gnn
Approved by:	sjg (mentor)
Obtained from:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D8002
2016-10-07 21:03:12 +00:00
Ed Maste
9a99954958 portsnap: use lam on the known good hash list
This change is equivalent to the approach committed in r306417, but if
sed has a bug it could be exploited by the untrusted tar file. Instead,
generate the expected tar content and compare that with find's output.

convert the expected hash list to the expected tar content filesystem
layout, and compare that with find's output.

Submitted by:	cperciva (in review D8052)
Reviewed by:	oshogbo
MFC after:	2 weeks
2016-10-07 20:01:59 +00:00
Ed Maste
71cc9a9f0e makefs: diff reduction with NetBSD
Obtained from:	NetBSD usr.sbin/makefs/cd9660.c 1.33
2016-10-07 19:12:15 +00:00
Jonathan T. Looney
3ac125068a Remove "long" variables from the TCP stack (not including the modular
congestion control framework).

Reviewed by:	gnn, lstewart (partial)
Sponsored by:	Juniper Networks, Netflix
Differential Revision:	(multiple)
Tested by:	Limelight, Netflix
2016-10-06 16:28:34 +00:00
Jung-uk Kim
493deb390b Merge ACPICA 20160930. 2016-10-04 20:27:15 +00:00
Eric van Gyzen
35ef77a2ef Update arp(4) to document the net.link.ether.inet.garp_rexmit_count sysctl.
Submitted by:	David A. Bright <david.a.bright@dell.com>
Requested by:	markj
Reviewed by:	markj, badger
MFC after:	4 weeks
X-MFC with:	r306577
Sponsored by:	Dell EMC
Differential Revision:	https://reviews.freebsd.org/D8136
2016-10-03 19:02:22 +00:00
Mark Johnston
5c3f6d4977 rtsold: Log messages about unexpected RAs at LOG_DEBUG.
Because rtsold listens for RAs on a raw socket, it may receive RAs from
interfaces that it does not manage. Such events can result in excessive
logging.

Submitted by:	Franco Fichtner <franco@opnsense.org>
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D8108
2016-10-02 00:56:21 +00:00
Baptiste Daroussin
734bfbc5b0 Use accept4 with O_NONBLOCK rather than accept + fcntl 2016-10-01 11:43:37 +00:00
Alexander Motin
efab8bfdb3 Fix sesutil fault operation.
Fault and ident bits are located in different control bytes, so previous
code was just doing nothing, writing into reserved bit.

MFC after:	1 week
2016-09-30 20:35:12 +00:00
Ed Maste
7c10d87b78 crunchgen: do not strip crunched binary (it will be done by install)
Reviewed by:	adrian, imp (earlier)
Differential Revision:	https://reviews.freebsd.org/D2003
2016-09-30 13:16:04 +00:00
Ed Maste
54786ab35e portsnap: only move expected snapshot contents from snap/ to files/
Previously it was possible to smuggle in addional files that would
be used by later portsnap runs. Now we only move those files expected
to be in the snapshot into files/ and require that there are no
unexpected files.

This was used by portsnap attacks 2, 3, and 4 in the "non-cryptanalytic
attacks against FreeBSD update components" anonymous gist.

Reported by:	anonymous gist
Reviewed by:	allanjude, delphij
MFC after:	ASAP
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D8052
2016-09-28 21:22:51 +00:00
Ed Maste
f987297fc9 Add a WITHOUT_DIALOG src.conf(5) knob
It also turns off dependencies (bsdinstall, bsdconfig, dpv, tzsetup).

Reviewed by:	dteske
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D7969
2016-09-27 18:08:38 +00:00
Oleksandr Tymoshenko
4f57f07e37 Add Elantech trackpad to the list of known models
PR:             205690
Submitted by:   Vladimir Kondratyev <wulf@cicgroup.ru>
MFC after:      1 week
2016-09-26 22:07:45 +00:00
Marcel Moolenaar
2b4da8aa20 When MAKEOBJDIRPREFIX points to a case-insensitive file system, the
build can break when different source files create the same target
files (case-insensitivity speaking).  This is the case for object
files compiled with -fpic and shared libraries. The former uses
an extension of ".So", and the latter an extension ".so".  Rename
shared object files from *.So to *.pico to match what NetBSD does.

See also r305855

MFC after:	1 month
Sponsored by:	Bracket Computing
Differential Revision:	https://reviews.freebsd.org/D7906
2016-09-24 15:11:27 +00:00
Edward Tomasz Napierala
af375c284d Small tweaks to the diskinfo(8) manual page, to make it more consistent
with others.

MFC after:	1 month
2016-09-22 07:55:07 +00:00
Edward Tomasz Napierala
b76ce4527b Add "diskinfo -i", a simple aio-based IOPS benchmark.
MFC after:	1 month
2016-09-22 07:33:43 +00:00
Edward Tomasz Napierala
f289d2a5ae Reduce code duplication by factoring out the delta_t() function.
No functional changes.

MFC after:	1 month
2016-09-21 18:07:25 +00:00
Ed Schouten
ecc288634a Fix misuse of the basename() and dirname() functions.
These functions are allowed to overwrite their input. Pull a copy of the
input parameter and call dirname() and basename() on that instead. Do
ensure that we reload the pathname value between calls.
2016-09-21 13:02:43 +00:00
Edward Tomasz Napierala
6307380ad1 Cosmetics - add missing newline.
MFC after:	1 month
2016-09-21 11:27:56 +00:00
Edward Tomasz Napierala
b99b3c1739 Make the "r/s" and "w/s" fields in "iostat -x" a little bit wider;
five chars is way too narrow for todays disks.

MFC after:	1 month
2016-09-21 11:22:19 +00:00
Edward Tomasz Napierala
5ac5a2b265 Make it possible for diskinfo(8) to operate on files. This is useful
with -t and upcoming -i.

MFC after:	1 month
2016-09-21 11:17:58 +00:00
Ruslan Bukin
d68da43b7b Disable extattr test on UFS1.
This test supports native extended attributes only (e.g. UFS2)

Reviewed by:	asomers, ngie
Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
Differential Revision:	https://reviews.freebsd.org/D7981
2016-09-21 10:58:58 +00:00
Ed Maste
bd24e9a105 uefisign: Remove backwards-compatibility sys/capability.h support
uefisign previously included sys/capability.h or sys/capsicum.h based
on __FreeBSD_version in order to facilitate development on the stable
branch. The Capsicum header is now installed as sys/capsicum.h in
stable/10 and FreeBSD 10.3, so there's no need for the backwards
compatibility support.

Reviewed by:	trasz
Sponsored by:	The FreeBSD Foundation
2016-09-19 16:07:32 +00:00
Baptiste Daroussin
073dd71287 In preparation for removal of GNU rcs, replace merge(1) usage with direct
diff3(1) usage
2016-09-18 14:48:28 +00:00
Jakub Wojciech Klama
13ee8dde04 Add virtio-console support to bhyve.
Adds virtio-console device support to bhyve, allowing to create
bidirectional character streams between host and guest.

Syntax:
-s <slotnum>,virtio-console,port1=/path/to/port1.sock,anotherport=...

Maximum of 16 ports per device can be created. Every port is named
and corresponds to an Unix domain socket created by bhyve. bhyve
accepts at most one connection per port at a time.

Limitations:
- due to lack of destructors of in bhyve, sockets on the filesystem
  must be cleaned up manually after bhyve exits
- there's no way to use "console port" feature, nor the console port
  resize as of now
- emergency write is advertised, but no-op as of now

Approved by:	trasz
MFC after:	1 month
Relnotes:	yes
Sponsored by:	iXsystems, Inc.
Differential Revision:	D7185
2016-09-17 13:48:01 +00:00
Pedro F. Giffuni
60e600c8fc fifolog(1): invert order of calloc(3) arguments.
The second argment to calloc(3) should be the size, make it so.

While here be a little bit more cautious in fifolog_reader_open()
to protect in the unlikely event of an overflowed allocation.

MFC after:	3 weeks
2016-09-14 16:34:52 +00:00
Edward Tomasz Napierala
275253770b Use proper argument order for calloc(3).
MFC after:	1 month
2016-09-14 11:20:58 +00:00
Cy Schubert
3dd30bd184 Switch from .CURDIR to the simpler, more legible SRCTOP.
Suggested by:	emaste
X-MFC-with:	upcoming amd upgrade
2016-09-14 01:47:01 +00:00
Warren Block
bb00e5490b Add another badly-needed simple example to the pw(8) man page. 2016-09-13 02:18:29 +00:00
Cy Schubert
8825d8e38d Fixup whitespace, repace space with a tab.
X-MFC-with:	Upcoming amd update.
2016-09-12 19:31:14 +00:00
Baptiste Daroussin
fafe86ce27 Directly set the O_NONBLOCK flags via open(2) 2016-09-11 18:58:44 +00:00
Ed Schouten
23e591f485 Properly patch up dirname()/basename() calls to not clobber ent->log.
It turns out that we had a couple of more calls to dirname()/basename()
in newsyslog(8) that assume the input isn't clobbered. This is bad,
because it apparently breaks log rotation now that the new dirname()
implementation has been merged.

Fix this by first copying the input and then calling
dirname()/basename(). While there, improve the naming of variables in
this function a bit.

Reported by:	Ryan Steinmetz, gjb
Reviewed by:	bdrewery, allanjude
Differential Revision:	https://reviews.freebsd.org/D7838
2016-09-09 07:10:50 +00:00
Eric van Gyzen
1a04446f08 etcupdate: preserve the metadata of the destination file
When using diff3 to perform a three-way merge, etcupdate lost the destination
file's metadata. The metadata from the temporary file were used instead.
This was unpleasant for rc.d scripts, which require execute permission.
Use "cat >" to overwrite the destination file's contents while preserving its
metadata.

Reviewed by:	bapt
Sponsored by:	Dell Technologies
Differential Revision:	https://reviews.freebsd.org/D7817
2016-09-08 15:53:49 +00:00
Andrew Turner
2b2b1f42b9 Teach acpidump how to parse ACPI 5.1 tables found on the development
ThunderX units in the netperf cluster.

Approved by:	jkim
Obtained from:	ABT Systems Ltd
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D7252
2016-09-06 10:13:49 +00:00
Xin LI
337b148e02 Ensure that we always open only files that is named by explicitly
using shell redirections instead of having gzip(1) to decide what
file to open.

Issue reported in the "non-cryptanalytic attacks against freebsd
update components" anonymous gist.

Reviewed by:	allanjude, emaste
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D7653
2016-09-06 08:52:00 +00:00
Wojciech Macek
e24e98d090 bsdinstall: add warning when unsupported partition is modified
Right now is possible to modify bootable partition type to
non-bootable type without getting warning from partedit.
Example: if you auto parition drive for arm64, you will
get freebsd-ufs as bootable partition; now you are able
to change bootable partition type to freebsd-zfs; there
will be no warning and the system will install but
will not be bootable afterwards.

After this fix, partedit will issue the same warning it
does when user attempts to create bootable partition of
not supported type, notyfing a user about incoming
problem and allowing to think the decision over before
commiting the schema.

This has been tested on amd64 and arm64.

Obtained from:         Semihalf
Submitted by:          Dominik Ermel <der@semihalf.com>
Sponsored by:          Cavium
Reviewed by:           nwhitehorn
Differential Revision: https://reviews.freebsd.org/D6879
2016-09-05 08:42:36 +00:00
Dag-Erling Smørgrav
e2d1500434 Upgrade to Unbound 1.5.9. 2016-09-04 12:17:57 +00:00
Bryan Drewery
92e4e43ea8 DIRDEPS_BUILD: Update dependencies after a 'make bootstrap-tools'.
MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2016-09-02 20:41:43 +00:00
Ed Maste
5e5d4b233a cron: use existing maximum username constant MAXLOGNAME
Previously cron had its own maximum username length limit, which was
smaller than the system's MAXLOGNAME. This could lead to crontab -u
updating the wrong user's crontab (if the name was truncated, and
matched another user).

PR:		212305
Reported by:	Andrii Kuzik
Reviewed by:	allanjude, jilles
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D7747
2016-09-02 03:15:54 +00:00
Bryan Drewery
5017231ad7 META_MODE/DIRDEPS_BUILD: Fix various issues with crunch builds.
- DIRDEPS_BUILD: Fix crunchgen builds losing their library dependencies
  on a nop-rebuild.
- META_MODE: Fix not rebuilding various crunch.mk targets if their .meta
  files warrant a rebuild.  They were lacking .meta files previously.
  This adds .NOMETA to the crunch objects being used since they are
  already built.  Bmake was forcing a rebuild on them since their
  .meta files were not in the expected place; there is no reason to
  rebuild them.

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-09-01 23:21:08 +00:00
Bryan Drewery
1eb4ec9c62 DIRDEPS_BUILD: Add some missing dirctories to the build.
Sponsored by:	EMC / Isilon Storage Division
2016-08-31 19:30:59 +00:00
Bryan Drewery
776d5e11e9 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	EMC / Isilon Storage Division
2016-08-31 19:30:46 +00:00
Marcelo Araujo
9287c0323d Invert calloc(3) argument order.
Reviewed by:	grehan, mav
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D7613
2016-08-30 12:40:12 +00:00
John Baldwin
e05ec081fe Implement 'devctl clear driver' to undo a previous 'devctl set driver'.
Add a new 'clear driver' command for devctl along with the accompanying
ioctl and devctl_clear_driver() library routine to reset a device to
use a wildcard devclass instead of a fixed devclass.  This can be used
to undo a previous 'set driver' command.  After the device's name has
been reset to permit wildcard names, it is reprobed so that it can
attach to newly-available (to it) device drivers.

MFC after:	1 month
Sponsored by:	Chelsio Communications
2016-08-29 22:48:36 +00:00
Dimitry Andric
7fcdc815d2 Avoid undefined behavior when calling va_start() in bnep_send_control(),
by making the 'type' parameter a plain unsigned.

MFC after:	3 days
2016-08-29 19:40:46 +00:00
Enji Cooper
771e2c7753 Expect sub testcases 2-4 in :tests_time_rotate to fail today due to changes
to newsyslog, etc made in the past month.

The issue is being root-caused as part of the bug noted below. This commit
will need to be partially reverted once the issue has been found/fixed

PR:		212160
Reported by:	Jenkins
Sponsored by:	EMC / Isilon Storage Division
2016-08-29 18:46:04 +00:00
Alex Kozlov
c650c2f355 Remove last remnants of acd(4), mcd(4), and scd(4) drivers.
Approved by:	jhb
2016-08-25 19:36:58 +00:00
Navdeep Parhar
97b84d344d Make the iSCSI parameter negotiation more flexible.
Decouple the send and receive limits on the amount of data in a single
iSCSI PDU.  MaxRecvDataSegmentLength is declarative, not negotiated, and
is direction-specific so there is no reason for both ends to limit
themselves to the same min(initiator, target) value in both directions.

Allow iSCSI drivers to report their send, receive, first burst, and max
burst limits explicitly instead of using hardcoded values or trying to
derive all of them from the receive limit (which was the only limit
reported by the drivers prior to this change).

Display the send and receive limits separately in the userspace iSCSI
utilities.

Reviewed by:	jpaetzel@ (earlier version), trasz@
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D7279
2016-08-25 05:22:53 +00:00
Cy Schubert
41a68a79bb Fixup man page formatting.
Submitted by:	Steve Kargl <sgk@troutmask.apl.washington.edu>
Discussed with:	bjk@
MFC after:	3 days
2016-08-24 02:41:24 +00:00
Marcelo Araujo
bf6911cd08 Use roundup2() from sys/param.h. 2016-08-23 13:43:43 +00:00
Marcelo Araujo
5ddd0f16c5 Fix calloc(3) argument order.
MFC after:	4 weeks.
2016-08-23 13:19:42 +00:00
Marcelo Araujo
f3ccb446d2 Fix calloc(3) argument order.
Reviewed by:	trasz
MFC after:	4 weeks.
Differential Revision:	https://reviews.freebsd.org/D7532
2016-08-22 15:01:39 +00:00
Edward Tomasz Napierala
370b58b9f8 Add the "-n" flag to cron(8), to prevent it from daemonizing.
This makes it possible to use it with external supervisors.
The "-n" flag name is compatible with Linux, NetBSD, and OpenBSD.

Reviewed by:	jilles, pfg, wblock
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D7581
2016-08-21 18:12:49 +00:00
John Baldwin
09b9789b28 Remove the wl(4) driver and wlconfig(8) utility.
The wl(4) driver supports pre-802.11 PCCard wireless adapters that
are slower than 802.11b.  They do not work with any of the 802.11
framework and the driver hasn't been reported to actually work in a
long time.

Relnotes:	yes
2016-08-19 22:27:14 +00:00
John Baldwin
c1c9764296 Remove the si(4) driver and sicontrol(8) for Specialix serial cards.
The si(4) driver supported multiport serial adapters for ISA, EISA, and
PCI buses.  This driver does not use bus_space, instead it depends on
direct use of the pointer returned by rman_get_virtual().  It is also
still locked by Giant and calls for patch testing to convert it to use
bus_space were unanswered.

Relnotes:	yes
2016-08-19 21:14:27 +00:00
Dag-Erling Smørgrav
47ead00d5b Ensure that the sector size is a multiple of 4096 to avoid creating
unaligned partitions when the actual sector size is hidden from us.

PR:		211361
MFC after:	3 days
2016-08-15 09:30:21 +00:00
Maxim Konovalov
30bebccae0 o Move tmpstr varibale initialization out of assert(3) call.
This fixes acpidump(8) compiled with "WITHOUT_ASSERT_DEBUG=yes" that
removes assert(3)'s from the code.

Submitted by:	Alexander Nedotsukov
2016-08-12 08:16:35 +00:00
Pedro F. Giffuni
616dac55ef ancontrol(8): replace comma with semicolon when pertinent.
Uses of commas instead of a semicolons can easily go undetected. The comma
can serve as a statement separator but this shouldn't be abused when
statements are meant to be standalone.

Detected with devel/coccinelle following a hint from DragonFlyBSD.

MFC after:	1 month
2016-08-09 19:46:05 +00:00
Steven Kreuzer
1d01cb0d72 Write kern.randompid to /etc/sysctl.conf
PR:		211471
Reported by:	survo@protonmail.com
Reviewed by:	robak@
Approved by:	allanjude@
MFC after:	3 days
Differential Revision:	 https://reviews.freebsd.org/D7440
2016-08-09 15:57:37 +00:00
Eric van Gyzen
a1566487db Fix some logic in PCIe HotPlug; display EI status
The interpretation of the Electromechanical Interlock Status was
inverted, so we disengaged the EI if a card was inserted.
Fix it to engage the EI if a card is inserted.

When displaying the slot capabilites/status with pciconf:

- We inverted the sense of the Power Controller Control bit,
  saying the power was off when it was really on (according to
  this bit).  Fix that.

- Display the status of the Electromechanical Interlock:
        EI(engaged)
        EI(disengaged)

Reviewed by:	jhb
MFC after:	3 days
Sponsored by:	Dell Inc.
Differential Revision:	https://reviews.freebsd.org/D7426
2016-08-05 23:23:48 +00:00
Baptiste Daroussin
f5e96fb5ed always install etcupdate
Now that etcupdate does not depend on rcs anymore there is no need to
conditionnally install it
2016-08-05 19:24:52 +00:00
Baptiste Daroussin
a7212e5721 etcupdate: directly use diff3(1) instead of merge(1)
During the last attempt to rmeove GNU rcs, 2 blockers were spotted:
We need an ident(1) and etcupdate(8) uses merge(1).

Now nothing should prevent to remove rcs from base

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D7401
2016-08-05 19:22:33 +00:00
Ed Maste
bfbeda91fe kgzip.8: note that it is deprecated and clarify BUGS section
kgzip is only useful on i386 and has a number of other limitations.
We're better served by officially deprecating it and encouraging users
to use loader(8) instead.

Reviewed by:	dteske, wblock
Differential Revision:	https://reviews.freebsd.org/D7098
2016-08-02 21:48:26 +00:00
Dimitry Andric
7212134272 Fix non-functional bsdinstall services dialog.
The most recent version of bsdinstall does not seem to respect any of
the checkboxes in the "Choose the services you would like to be started
at boot" dialog.  None of the chosen services end up in the rc.conf file
that is installed onto the target system.

This is caused by the bsdinstall/scripts/hardening script, which
implements the new hardening options dialog.  The script starts by
overwriting the previously written rc.conf.services file:

    echo -n > $BSDINSTALL_TMPETC/rc.conf.services

which is obviously incorrect.  It should clear out rc.conf.hardening
instead.

Reviewed by:	allanjude
PR:		211506
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D7387
2016-08-01 19:49:42 +00:00
Ed Schouten
9c24291370 Fix up setgrent(3) to have a POSIX-compliant prototype.
Just like with freelocale(3), I haven't been able to find any piece of
code that actually makes use of this function's return value, both in
base and in ports. The reason for this is that FreeBSD seems to be the
only operating system to have such a prototype. This is why I'm deciding
to not use symbol versioning for this.

It does seem that the pw(8) utility depends on the function's typing and
already had a switch in place to toggle between the FreeBSD and POSIX
variant of this function. Clean this up by always expecting the POSIX
variant.

There is also a single port that has a couple of local declarations of
setgrent(3) that need to be patched up. This is in the process of being
fixed.

PR:		211394 (exp-run)
2016-07-31 08:05:15 +00:00
Bjoern A. Zeeb
2f54da9134 Rename devname to udevname after including stdlib.h in r303445
as gcc trips over the devname(3) and reports 'shadows a global declaration'.

This should unbreak gcc based world builds.
2016-07-30 20:39:39 +00:00
Baptiste Daroussin
7556d9b06a Remove usage of _WITH_GETLINE from usr.sbin 2016-07-30 01:10:05 +00:00
Ed Schouten
f0d2919243 Clean up use of basename() and dirname().
Pull copies of the input pathname string before calling basename() and
dirname() to make this comply to POSIX. Free these copies at the end of
this function. While there, remove the duplication of the 's' ->
'logfname' string. There is no need for this.
2016-07-28 16:02:30 +00:00
Ed Schouten
544e9b30a9 Call basename() and dirname() in the POSIXly correct way.
Pull copies of the input string, as these functions are allowed to
modify them. Free the copies after creating the new pathname string.
2016-07-28 15:33:19 +00:00
Bryan Drewery
5dedd7976a Fix non-amd64 build from r292043 after reconnecting in r303410.
MFC after:	3 days
X-MFC-With:	r303410
Sponsored by:	EMC / Isilon Storage Division
2016-07-27 21:45:11 +00:00
Bryan Drewery
d849978d87 Reconnect pmcstudy, lost in r291021
Reported by:	pluknet
MFC after:	3 days
Sponsored by:	EMC / Isilon Storage Division
2016-07-27 20:28:28 +00:00
Peter Grehan
5a347e3bc3 - Change the fbuf "vga" parameter to "vga=on|io|off".
"io" is the default, and allows VGA i/o registers to be
   accessed. This is required by Win7/2k8 graphics guests that
   use a combination of BIOS int10 and UEFI.
   "off" disables all VGA i/o and mem accesses.
   "on" is not yet hooked up, but will enable full VGA rendering.

   OpenBSD/UEFI >= 5.9 graphics guests can be booted using "vga=off"

- Allow "rfb" to be used instead of "tcp" for the fbuf VNC
  description. "tcp" will be removed at a future point and is
  kept as an alias.

Discussed with:	Leon Dang
MFC after:	3 days
2016-07-27 00:03:29 +00:00
Peter Grehan
34b1e8a155 Catch another case where an XHCI interrupt was being
injected without state being set up.

This fixes a core dump when dropping to the UEFI prompt
with graphics enabled and moving the mouse around.

Discussed with:	Leon Dang
MFC after:	3 days
2016-07-26 23:40:25 +00:00
Baptiste Daroussin
1d981d8ef5 Do not try to delete the home of the user if is is not a directory for example
"/dev/null"

PR:		211195
Submitted by:	rday <ryan@ryanday.net>
Reported by:	eniorm <eniorm@gmail.com>
MFC after:	1 day
2016-07-23 10:19:10 +00:00
Bryan Drewery
bd4dcc3e5f Move chown tests to proper path
Sponsored by:	EMC / Isilon Storage Division
2016-07-23 05:49:18 +00:00
Navdeep Parhar
fd936afb97 ctld(8): Fix MaxBurstLength negotiation.
The target must reply with the selected value of MaxBurstSize instead of
just echoing back the initiator's offered value.

Reviewed by:	mav@
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D7278
2016-07-22 19:28:23 +00:00
Edward Tomasz Napierala
2b30a69dc0 Add documentation for "ctld -u", the UCL configuration file format.
Submitted by:	jceel@
Reviewed by:	wblock@
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D7222
2016-07-21 08:22:25 +00:00
John Baldwin
241cf416c9 Update crashinfo to work with newer gdb from ports.
If gdb from ports is installed, use it instead of the base system gdb
to extract variables from a kernel.  Note that base gdb and ports gdb
do not support the same options for invoking a single command in batch
mode, so a wrapper shell function is used.  In addition, prefer kgdb
from ports when generating a backtrace if present.

PR:		193335
Reviewed by:	emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D7218
2016-07-20 18:41:47 +00:00
Alan Somers
4e2d2c748c Fix camdd for host-aware and host-managed SMR disks.
This should've gone in as part of r300207

Reviewed by:	ken
MFC after:	3 days
Sponsored by:	Spectra Logic Corp
2016-07-20 15:00:05 +00:00
Ed Maste
881e506b36 makefs: sync NetBSD IDs with upstream for changes that we already have
May 22 21:51:39 2011 +0000 (christos):

    From Nathan Whitehorn (nwhitehorn at freebsd dot org):
    Add code to generate bootable ISOs on Powermac and CHRP systems.
    Synthesize some partition maps (APM and MBR, respectively) pointing
    to (a) the whole disk, and (b) relevant El Torito boot images that
    have been added by other code. These partition maps are a little
    bit funny looking, but they seem to work. FreeBSD has been using
    this successfully in their release generation on powerpc, as well
    as generating all non-SPARC install media. SPARC support could
    probably be added as an extension of this patch.

makefs.8 1.33

Tue Aug 23 17:09:11 2011 +0000 (christos):

    PR/45285: Martin Matuska: makefs does not properly convert ISO level 1 and 2
    filenames (buffer overflow)

    makefs does not properly verify the maximum filename length in the
    special "." case for both ISO level 1 and ISO level 2 filename
    conversion.  This creates broken images or causes a buffer overflow
    (ISO level 2).

    ISO level 1:
    If a filename contains only dots or up to 8 characters followed by
    dots the 8+3 limit check doesn't work.

    ISO level 2:
    If a filename contains a dot in the first 30 characters and a dot
    on the 30th character, the length limit check doesn't work and the
    buffer is overflowed.

    $ mkdir level1
    $ touch level1/12345............
    $ makefs -t cd9660 -o isolevel=1 test.iso level1

    $ mkdir level2
    $ touch level2/1234567890.2345678901234567.....34567890123456789012345
    $ makefs -t cd9660 -o isolevel=2 test.iso level2

cd9660.c 1.32

Sun Oct 9 21:33:43 2011 +0000 (christos):

    add support for setting the ufs label. (Nathan Whitehorn)

ffs.c 1.45
ffs.h 1.2
mkfs.c 1.22
makefs.8 1.37

Obtained from:	NetBSD
2016-07-19 18:40:54 +00:00
Ed Maste
298d081c1b makefs: reorder 'usage' alphabetically
From NetBSD, Mon Aug 15 14:45:01 2011 +0000 (wiz)

    Re-order `usage' alphabetically;
    rename option arguments in the manpage's `SYNOPSIS' section to
    match those from `usage' (not the other way around; the `usage'-line
    (and other parts of makefs.c) contain the correct names);
    minor punctuation improvements.

    From Snader_LB.

makefs.8 1.36
makefs.c 1.30

Obtained from:	NetBSD
2016-07-19 18:15:22 +00:00
Andrew Turner
f6469ce13a Add missing flags from acpidump. These are defined in the header, but not
printed. The HW_REDUCED flag is useful as it should be set on arm64 to
comply with the ARM Server Base Boot Requirements.

Obtained from:	ABT Systems Ltd
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-07-19 16:02:07 +00:00
Peter Grehan
d73abd4b09 Disallow interrupt requests on disabled endpoints.
Submitted by:	Leon Dang
MFC after:	3 days
2016-07-17 20:34:46 +00:00
Alexander Motin
6d6fccace2 Fix NCQ TRIM emulation.
When this code was written, there was no guests using it to test.
2016-07-17 14:13:47 +00:00
Allan Jude
1b63cafb63 A failed installation once restarted will often error out
If an encrypted install is attempted and fails for any reason, the disk
cannot be erased by the installer because the partition is in use by GELI

At the start of the installation process, all ZFS pools are exported and
all GELI instances are detached, to allow a restarted install to proceed

PR:		210814
Reported by:	jonathan
MFC after:	10 days
2016-07-16 19:35:04 +00:00
Allan Jude
4487af02ff Fix encrypted MBR install
The pools are exported and reimported in order to write the bootcode
This causes an error when the bootpool is later mounted by common code
The bootpool is now imported with the -N flag to prevent mounting

Reported by:	Michael Dexter
MFC after:	5 days
2016-07-16 18:28:44 +00:00
Alexander Motin
9c4dd8bdf0 Revert unwanted change leaked into r302932. 2016-07-16 09:44:31 +00:00
Alexander Motin
ee7230f4f7 Increase I82545_MAX_TXSEGS from 20 to 64 and add checks for it.
There seems no hard limit on number of segments per packet in the chip,
and 20 appeared insufficient.  Hope 64 will be enough, but if not -- add
check to report that and drop the packet instead of corrupting stack.
2016-07-16 09:08:33 +00:00
Bartek Rutkowski
0e3f233f51 Add new System Hardening menu and options to bsdinstall.
This patch add new 'hardening' file responsible for new bsdinstall
'System Hardening' menu allowing users to set some sane and carefully
picked system security options (like random process id's, hiding
other users/groups processes and others).

All options are OFF by default in this patch due to POLA principle
with intention to turn change some of them to ON by default in future.

Reviewed by:	adrian, allanjude, bdrewery, nwhitehorn
Approved by:	adrian, allanjude
MFC after:	7 days
2016-07-15 15:07:24 +00:00
Jamie Gritton
4c86c0fa98 Fix up the order in which jail creation processes are run, to preserve
the config file's order in the non-parallel-start case.

PR:		209112
MFC after:	3 days
2016-07-14 20:15:55 +00:00
Alexander Motin
1b4496d043 Make PCI interupts allocation static when using bootrom (UEFI).
This makes factual interrupt routing match one shipped with UEFI firmware.
With old firmware this make legacy interrupts work reliable for functions 0
of PCI slots 3-6.  Updated UEFI image fixes problem completely.
2016-07-14 17:16:10 +00:00
Allan Jude
d4e5caaf7d Make the new 'set date and time' dialog default to skip
X-MFC-With:	302790
Requested by:	nwhitehorn
2016-07-14 00:41:19 +00:00
Allan Jude
09c4000afe bsdinstall: Prompt user to set the date and time after selecting timezone
Not having the correct date and time makes many PKI based things not work

In 10 and 11, it can mean that Unbound, ntpd, and sshd won't start

Submitted by:	des (original patch)
MFC after:	7 days
2016-07-13 23:49:45 +00:00