Commit Graph

17298 Commits

Author SHA1 Message Date
Bryan Drewery
07676084ec DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-05-09 01:48:23 +00:00
Bryan Drewery
6106a50ee6 DIRDEPS_BUILD: Connect new directories.
Sponsored by:	Dell EMC Isilon
2017-05-09 01:48:14 +00:00
Enji Cooper
ca7f276c93 Restore sectorsize global to unbreak makefs after r317744
This also unbreaks the fstyp tests.

Reported by:	Alastair Hogge <agh@fastmail.fm>, Jenkins
Sponsored by:	Dell EMC Isilon
2017-05-08 18:42:38 +00:00
Ed Maste
c5a0915477 makefs: further size_t warning cleanup (missing from r317944)
Sponsored by:	The FreeBSD Foundation
2017-05-08 16:57:33 +00:00
Ed Maste
243a297a95 makefs: cast snprintf return value to size_t to clear warning
Sponsored by:	The FreeBSD Foundation
2017-05-08 16:34:39 +00:00
Ed Maste
856d87c5af makefs: use size_t as appropriate to clean up warnings
Sponsored by:	The FreeBSD Foundation
2017-05-08 13:09:27 +00:00
Scott Long
e8262ee824 Show more fields in the IOCFact message 2017-05-05 17:01:54 +00:00
Edward Tomasz Napierala
d4acedbc64 Revert r317804; apparently I forgot the auto_master syntax.
MFC after:	2 weeks
2017-05-04 19:55:32 +00:00
Edward Tomasz Napierala
1638f1d3e4 Make automount(8) error out when the map name is missing.
MFC after:	2 weeks
2017-05-04 19:41:19 +00:00
Gleb Smirnoff
5c3ec67603 Improve documentation of fbuf device.
Submitted by:	novel
Reviewed by:	grehan, bcr
Differential Revision:	https://reviews.freebsd.org/D10014
2017-05-03 21:44:04 +00:00
Poul-Henning Kamp
67c9f60e86 Flush stdout before yes/no confirmations, to force question
through pipes/tee(1)/whatever
2017-05-03 20:41:26 +00:00
Ed Maste
9e96f90b50 makefs: clean up warnings
- make functions and variables static where appropriate
- use const char * where appropriate
- remove unused variables

Sponsored by:	The FreeBSD Foundation
2017-05-03 14:57:04 +00:00
Ed Maste
15fc093acc makefs: make buf generic
it has nothing to do with ffs and will eventually be moved.
gc sectorsize.

NetBSD versions:
ffs.c		1.58
ffs/buf.c	1.14 1.18
ffs/buf.h	1.8

Obtained from:	NetBSD
Sponsored by:	The FreeBSD Foundation
2017-05-03 14:21:18 +00:00
Marcelo Araujo
63128851f3 Use nitems() from sys/param.h.
Reviewed by:	ngie
MFC after:	2 weeks.
Differential Revision:	https://reviews.freebsd.org/D9942
2017-05-03 14:03:46 +00:00
Marcelo Araujo
049e195404 Free the memory allocated to trackbuf before exiting, it might fix a potential
memory leak.

Submitted by:	trix@juniper.net
MFC after:	2 weeks.
Differential Revision:	https://reviews.freebsd.org/D9856
2017-05-03 13:57:31 +00:00
Ed Maste
e651540a68 makefs: remove unused cd9660_defaults_set global
Sponsored by:	The FreeBSD Foundation
2017-05-01 00:53:07 +00:00
Pedro F. Giffuni
2b223a01ef mixer(8): Prevent possible sscanf() overflow.
Fix %s buffer sizes in sscanf().

Obtained from:	DragonflyBSD (git dab952e2)
MFC after:	5 days
2017-04-29 19:12:44 +00:00
Maxim Konovalov
7c415819be o Clean the whole array of IPv4 addresses not just a local part.
PR:		218923
Submitted by:	Daniel McRobb
2017-04-28 09:17:16 +00:00
Gleb Smirnoff
6c87a2c0ee Document raw framebuffer device and XHCI device configurations. 2017-04-28 05:43:27 +00:00
Gleb Smirnoff
bc5d44ec53 - For security reasons by default listen on localhost address,
not on wildcard. [1]
- Move the default port assignment from pci_fbuf.c to rfb.c,
  to avoid polluting pci_fbuf.c with network things.

Suggested by:	grehan
2017-04-28 05:32:26 +00:00
Gleb Smirnoff
3909a600a5 When no "rfb" configuration specified bind to the default VNC
port instead of binding to a random one.
2017-04-28 05:13:27 +00:00
Gleb Smirnoff
60bfcbd605 Make comments match the code. No functional change. 2017-04-28 05:09:51 +00:00
Brooks Davis
0607c830b3 More ATM and NATM removal
Submitted by:	ak
Reviewed by:	ngie
Differential Revision:	https://reviews.freebsd.org/D10511
2017-04-27 16:05:12 +00:00
Takanori Watanabe
4aa92fe2f3 Make cached Bluetooth LE host advertise information visible from userland.
Differential Revision:	https://reviews.freebsd.org/D10362
2017-04-27 15:03:24 +00:00
Gleb Smirnoff
007e172d64 We need CAP_MMAP_RW on memfd, since init_msix_table() may call mmap(). 2017-04-27 05:48:52 +00:00
Edward Tomasz Napierala
56226f9c30 Make fstyp(8) recognize exFAT even without the -u option.
While it's not directly mountable with mount(8), it's something that's
mountable - differently from GELI or zpools.

MFC after:	2 weeks
2017-04-26 19:34:41 +00:00
John Baldwin
73ad3fb536 Add a new GDB_LIBEXEC option to install gdb and kgdb to /usr/libexec.
When this option is enabled, only gdb and kgdb are installed to
/usr/libexec for use by crashinfo(8). Other bits of GDB such as
gdbserver and gdbtui are not installed. For this option to be
effective, GDB must be enabled.

Rework r317094 to re-enable GDB on all platforms but enable
GDB_LIBEXEC on platforms for which the GDB in ports is a superset of
functionality.

Reviewed by:	emaste, kib
Suggested by:	kib
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D10449
2017-04-25 18:08:56 +00:00
Brooks Davis
5477372324 Use the approved syntax to build no man pages.
MFC after:	1 week
Sponsored by:	DARPA, AFRL
2017-04-24 21:55:59 +00:00
Brooks Davis
a7dc31283a Remove the NATM framework including the en(4), fatm(4), hatm(4), and
patm(4) devices.

Maintaining an address family and framework has real costs when we make
infrastructure improvements.  In the case of NATM we support no devices
manufactured in the last 20 years and some will not even work in modern
motherboards (some newer devices that patm(4) could be updated to
support apparently exist, but we do not currently have support).

With this change, support remains for some netgraph modules that don't
require NATM support code. It is unclear if all these should remain,
though ng_atmllc certainly stands alone.

Note well: FreeBSD 11 supports NATM and will continue to do so until at
least September 30, 2021.  Improvements to the code in FreeBSD 11 are
certainly welcome.

Reviewed by:	philip
Approved by:	harti
2017-04-24 21:21:49 +00:00
Rick Macklem
c1c63967cb Fix the default uid/gid values in nfsuserd.c
This patch sets the default uid/gid values for "nobody" and "nogroup"
to the values in the password and group databases. Normally nfsuserd(8)
will override these with whatever is in the password/group databases,
so these values are only used when the databases entries aren't available.
It would be nice to use the definitions in sys/conf.h, but those are
in the _KERNEL section of the file.

Reported by:	tez@pkgsrc.org
Submitted by:	tez@pkgsrc.org
MFC after:	2 weeks
2017-04-23 23:09:02 +00:00
Pedro F. Giffuni
780154cbaf pmcstat(8); unsign some allocation variables and use reallocarray(3).
Use unsigned values in some internal variables that will be used during
allocation. The variables are used in reduced scope and have no chance of
becoming negative.

Provide bounds checking through reallocarray(3).

MFC after:	2 weeks
2017-04-22 16:02:40 +00:00
Rick Macklem
97662c7c33 Get rid of bogus statement in the nfsuserd.8 man page.
The nfsuserd.8 man page stated that a usertimeout of 0 would disable
the cache timeout. This was simply not true, so this patch deletes
the sentence.

This is a content change.

PR:		217406
MFC after:	2 weeks
2017-04-21 20:53:51 +00:00
Enji Cooper
609b7b269d Add a knob, WITH*_RPCBIND_WARMSTART_SUPPORT, to allow the end-user to build
rpcbind(8) with/without warmstart support.

The knob defaults to off to preserve POLA for the feature.

See rpcbind(8) for more details about the warmstart feature.

MFC after:	7 weeks
Relnotes:	yes
Sponsored by:	Dell EMC Isilon
2017-04-19 20:45:46 +00:00
Enji Cooper
ebb27fd055 Fix indentation per style.Makefile(5)
MFC after:	7 weeks
Sponsored by:	Dell EMC Isilon
2017-04-19 20:27:13 +00:00
Enji Cooper
bffe25839c rpcbind(8): post-humously document -w (warmstart) support added in r74462
warmstart support saves portmap/rpcbind(8) registration state on exit and
restores the saved registration state on restart.

MFC after:	7 weeks
Sponsored by:	Dell EMC Isilon
2017-04-19 20:23:27 +00:00
Enji Cooper
7e84e1cb45 rpcbind(8): add a description for /var/run/rpcbind.sock under the FILES section
MFC after:	7 weeks
Sponsored by:	Dell EMC Isilon
2017-04-19 20:04:45 +00:00
Enji Cooper
218d5aa052 rpcbind(8): wordsmith -h description and mention -W in the SYNOPSIS section
-W was already documented in the OPTIONS section.

MFC after:	7 weeks
Reported by:	igor (-h wordsmith'ing)
Sponsored by:	Dell EMC Isilon
2017-04-19 18:01:53 +00:00
Enji Cooper
fadafdfa69 Print out the signal number on exit in terminate(..) if WARMSTART is compiled
into rpcbind.

The signal number can provide helpful diagnostic info.

MFC after:	1 week
Obtained from:	Isilon OneFS
Sponsored by:	Dell EMC Isilon
2017-04-19 17:51:32 +00:00
Patrick Kelsey
2f8c6c0a58 Fix userland tools that don't check the format of routing socket
messages before accessing message fields that may not be present,
removing dead/duplicate/misleading code along the way.

Document the message format for each routing socket message in
route.h.

Fix a bug in usr.bin/netstat introduced in r287351 that resulted in
pointer computation with essentially random 16-bit offsets and
dereferencing of the results.

Reviewed by:	ae
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D10330
2017-04-16 19:17:10 +00:00
Baptiste Daroussin
1af6dc18b9 Add a new Y flag to newsyslog.conf
This makes newsyslog use zstandard to compress log files.

Given Z is already taken for gzip and zstandard compression level stands in
between gzip and xz (which has the X flag) chosing Y sounds ok :)
2017-04-15 20:37:34 +00:00
Maxim Sobolev
023653459a Fix another logic bug that came out of recent syslogd refactoring and exposed by
the r316874: don't call shutdown(2) on all sockets, but only net ones, which seems
to be the behaviour existed before that refactoring. Also don't call listen(2)
in datagram sockets and fix misplaced debug messages while I am here.

Reported by: peter
2017-04-15 18:20:11 +00:00
Maxim Sobolev
b98582b146 Since shutdown(2) on datagram socket is no longer a NOP after rev 316874
don't bother to select/recv on that socket. This prevents syslogd(8)
from spinning endlessly when started with the -s option (default).

Reported by:	peter
2017-04-15 02:24:22 +00:00
Conrad Meyer
6c546e77b6 bsdinstall(8): Sprinkle a snprintf to fixed size buffer
Use a snprintf to write an environment variable to a fixed-size buffer to
avoid stack overflow.

Reported by:	Coverity (CWE-120)
CID:		1238926
Sponsored by:	Dell EMC Isilon
2017-04-14 00:36:45 +00:00
Conrad Meyer
9c363a12fb ctm: Fix some trivial argv buffer overruns
It may not do the right thing with these obviously wrong inputs, but at
least it won't smash the stack.

Reported by:	Coverity (CWE-120)
CIDs:		1006697, 1006698
Sponsored by:	Dell EMC Isilon
2017-04-13 22:59:17 +00:00
Alexander Motin
9215e501b9 Do not register in CTL portal groups without portals.
From config synthax point of view such portal groups are not incorrect,
but they are useless since can not receive any connection.  And since
CTL port resource is very limited, it is good to save it.

MFC after:	2 weeks
2017-04-10 10:38:12 +00:00
Alexander Kabaev
e64aaeac2a Use int to receive the return value of getopt function.
getopt returns int and not char, so assigning the value to
char is not ideal, especially on platforms with unsigned
chars.
2017-04-07 22:58:31 +00:00
Sevan Janiyan
ea566940e1 Remove the last vestiges of FDC_DEBUG & FD_DEBUG
FDC_DEBUG is not referenced in any c or header files but traces of it
still remain in other files.

PR:		105608
Reported by:	Eugene Grosbein <ports AT grosbein DOT net>
Reviewed by:	imp
Approved by:	bcr (mentor)
MFC after:	7 days
Differential Revision:	https://reviews.freebsd.org/D10303
2017-04-07 16:14:25 +00:00
Ed Maste
37ca9f42fd makefs: Sync with NetBSD (fix unused variable warnings)
NetBSD revs:
cd9660.c		1.45
cd9660/cd9660_write.c	1.17

Obtained from:	NetBSD
2017-04-07 02:31:55 +00:00
Brooks Davis
08069ae688 Point out that -F probably does not do what the user expects.
Users attempting to create images from mtree METALOG files created by
installworld often use -F when they should be passing the METALOG file
in place of a directory. This is often produces difficult to debug
error reports.

Reviewed by:	emaste
MFC after:	1 week
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D10038
2017-04-06 23:35:10 +00:00
Renato Botelho
a2ac74c148 Introduce libxo support to arp(8)
Reviewed by:	wblock, gnn, allanjude, phil
Approved by:	allanjude
MFC after:	1 week
Sponsored by:	Rubicon Communications (Netgate)
Differential Revision:	https://reviews.freebsd.org/D9563
2017-04-06 22:50:28 +00:00
Ed Maste
5f5598b130 makefs: use emalloc and friends
The emalloc set of error-checking memory allocation routines were added
to libnetbsd in r316572. Use them in makefs to reduce differences with
NetBSD.

NetBSD revs:
cd9660.c			1.39
ffs.c				1.56
makefs.c			1.42
walk.c				1.27
cd9660/cd9660_archimedes.c	1.2
cd9660/cd9660_eltorito.c	1.20
cd9660/cd9660_write.c		1.16
cd9660/iso9660_rrip.c		1.12
ffs/buf.c			1.17
ffs/mkfs.c			1.26

Obtained from:	NetBSD
2017-04-06 16:18:42 +00:00
Ed Maste
07e89ad740 makefs: zero memory
NetBSD revs:
ffs/buf.c	1.14

Obtained from:	NetBSD
2017-04-06 00:07:11 +00:00
Enji Cooper
ba8c8a0ca2 Don't assume NAME_MAX is 255
Query the filesystem limit via getconf(3) instead

MFC after:	2 months
Sponsored by:	Dell EMC Isilon
2017-04-04 21:36:13 +00:00
Enji Cooper
d2d2a79c1a Clean up more trailing whitespace in the licensing tort that
happened to be spaces, not tabs

MFC after:	2 months
Sponsored by:	Dell EMC Isilon
2017-04-04 21:30:24 +00:00
Enji Cooper
9bf377826e Clean up trailing whitespace
MFC after:	2 months
Sponsored by:	Dell EMC Isilon
2017-04-04 21:29:37 +00:00
Bruce Evans
6be33b8301 Fix a missing const in my previous commit which broke the build at
normal WARNS.

Reported by:	lwhsu
2017-04-03 15:11:28 +00:00
Bruce Evans
b60e1b8142 Show high (blinking foreground/bright background) background colors. Format
output and source better for this.  Format output for 40 columns if there
are less than 80 columns.
2017-04-03 13:06:28 +00:00
Bruce Evans
8f92a81b81 Remove the global variable 'info' and fix associated bugs and style bugs.
This variable was used 4 times in 1 function and all uses were wrong.
The 4 uses were in he test_frame() (show) function, to try to restore
4 colors, 2 unnecessarily and these 2 now broken.  This was wrong
because it is the previous colors that must be restored, but the global
holds the original colors.  Excessive setting of colors at the end
restored the previous colors correctly in most cases, but I removed
this a couple of revisions ago.

Originally, this variable had 1 correct use, to test for being on a vty
as a side effect of initializing it.  This is now down in init(), and
init() also leaves a better-named global with the same contents.

Fix this by reading the current console info into a local variable in
test_frame(), as is done for several other functions.  Fix style bugs
in this reading for all callers:
- extra blank lines
- all error messages different.  The first one now in init() is not as
  specific as the old one, but it is after a different specific one for
  another ioctl and is unlikely to be reached when the first ioctl
  succeeds.  Ones after the first are to repeat the ioctl, so are even
  more likely to be reached.  The correctness of full removal of the
  old global depends on the error handling for failure to initialize
  it being unreachable.
- err() instead of warn() for failure in load_font().  This is almost
  unreachable, and it makes no sense to continue after undoing previous
  changes with revert().
- unreachable return after err() for failure in dump_screen().

Undo large renaming of local variables from the good name 'info' to the
bad name _info, which was done to protect the buggy global's bad name
from -Wshadow warnings.
2017-04-03 10:47:01 +00:00
Bruce Evans
2b881cf4c6 Save errno across revert().
Change 25 uses of errc() to err().  2 of these were correct.  23 used
errno for the arg so were just a verbose spelling of err().  5 of these
were just style bugs, and 18 depended on revert() saving errno.

1 warn() also depended on revert() saving errno.

Remove 2 warnx()'s that duplicate the message from a later errx().
These used to be before returns, and should have reported errno in
some cases.  errno is also not reported for for openguess() failures.

Only "restore" the video mode in revert() if the mode was just set
(necessarily partially).  Setting the mode to its current setting
doesn't "restore" it, but resets it, with the least harmful change
being to clear the screen.  revert() is called even for some harmless
syntax errors and usually did nothing except reset the mode.  Now it
usually does nothing.  The only things that it tries to restore apart
from the mode are the active vty number, the screen map, 2 colors that
only need to be restored (only after a mode change) to fix kernel bugs,
and 3 colors that can't be restored due to kernel bugs.  (This is
mostly for sc, since vt doesn't support mode changes.)

revert() is not called for syntax and setting errors after [mode], so
the mode reset is only done for failures to set raster mode after
setting graphics mode.  normal colors can only be set after [mode],
and that is why reverting them should be unnecessary.
2017-04-03 09:21:00 +00:00
Bruce Evans
1b8c842e06 Fix some parsing and error handling bugs.
r146736 added an undocumented syntax and many bugs handling it.  The
documented syntax is "... [mode] [fg [bg]] [show]", where it is critical
for reducing ambiguity and keeping things simple that the mode is
parsed first.  r146736 added buggy support for "... [mode] [fg [bg]]
[show] [mode] [fg [bg]]".  One error was that after for failing to set
a partially-supported graphics mode, argv[optind] remains pointing to
the mode so doesn't match the first [fg [bg]], so the setting is
attempted again, with slightly worse error handling.

Fix this by removing it (support for the trailing '[mode] [fg [bg]]')
and cleaning up.  The cleanups are mostly to remove convolutions and
bugs that didn't work to handle the ambiguous syntax '[fg [bg]] [fg [bg]]'
when [mode] and [show] are not present.  Globals were set to allow
repeating the color settings at the end.  The functions that set the
colors earlier were misnamed from set* to get*.  All that they "got" is
is settings from argv.  They applied the settings to the kernel and
the globals.

Fix restoration of colors in revert() by restoring 2 after the mode
change.  Colors should not need to be restored, but a bug in scteken
clobbers them on any mode change, including ones for restoration.  Don't
move the restoration of the other 3.  Teken doesn't clobber them on
mode changes because it doesn't support them at all (sc still supports
the border color, but only using a non-teken ioctl).

Add restoration of colors after a successful mode change to work around
the scteken bug there too.  The bug was previously masked by the general
setting of colors at the end.

Fix a longstanding parsing/error handling bug by exiting almost immediately
after matching the [mode] arg but failing to set the mode.  Just revert
if necessary.  Don't return to continue parsing but do it wrong.  This
bug caused spamming the output with a usage() message and exiting with
status 1 whenever [mode] is not present bug [fg [bg]] or [show].  The
exit code 1 was actualy an ambiguous internal code for failure to match
[mode] or failure to set [mode].  This 1 was obfuscated by spelling it
EXIT_FAILURE, but actual exit codes spell EXIT_FAILURE as 1.  Remove
another global which could have been used to disambiguate this but was
only used to micro-optimize the (unnecessary except for other bugs)
setting of colors at the end.
2017-04-03 06:52:02 +00:00
Alexander Motin
ec46b9208d Fix variable for sizeof() in previous commit.
MFC after:	2 weeks
2017-04-02 20:57:59 +00:00
Alexander Motin
4e183a48fe Add Log directory and SATA NCQ Send and Receive Log.
Those are used at least by Linux guests to detect queued TRIM support.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2017-04-02 20:39:51 +00:00
Bruce Evans
12dd1cd388 Remove checks that background (bg) colors are not bright and buggy
attempts to keep them that way.  The bg brightness bit is interpreted
as blinking in some modes, but it would barely be useful to disallow
setting it when it would give blinking in code which knew when that
is.  The old code mostly knew this wrong, and added handling errors.
It is in fact impossible to know, since future mode switches may
change the meaning of the bit many times on the screen and in history.

Old versions of vidcontrol disallowed bg color numbers >= 8 in all
cases.  This is very VGA/syscons-centric.  Syscons uses the VGA defaults
of blinking fg instead of bright bg in text mode and bright bg in
graphics mode.  On VGA, this is very easy to toggle at any time, and
vt blows away the VGA text mode default at boot time.

r146736 changed this to try to allow bg color numbers in graphics mode
only.  This is even more VGA/syscons-centric, and there are many bugs
in this, and many nearby bugs in the parser.  These are increased or
decreased by differences and bugs in vt and teken.

Perhaps the most obvious bug was that almost any vidcontrol command
which changes any color or the mode causes an error if the initial fg
color is bright.  E.g., in syscons text mode, after "vidcontrol
lightwhite" to make the fg bright, another "vidcontrol lightwhite" is
rejected and buggy fixup code changes the fg to white.  This is because
the bright fg color creates a bright bg color for the phantom reverse
video attribute, so was rejected.  (The reverse video attribute is
phantom because teken ignores the user's setting of it and simply
reverses the fg attributes to create the bg attributes.  Sometimes
some layer masks off the brightness/blinking bit, but not here.)

Perhaps the next most obvious one was that "vidcontrol lightgreen
lightblue" was misparsed as 2 settings of the fg instead of 1 setting
of the fg and 1 invalid setting of the bg.  This is because the
parser supports an undocumented syntax with many parsing bugs (an
ambiguity gives this one).

I recently fix bugs in teken that broke setting of bright fg's and
bg's in the normal way.  This gave more settings of then, so the old
bugs showed up more often.
2017-04-02 16:39:39 +00:00
Roman Bogorodskiy
0ee3a4b4ae Minor style improvements in bhyve.8
Replace "as of now" with "at present". As the change is a really minor one,
don't bump .Dd.

Suggested by:	wblock
Approved by:	wblock (implicit)
2017-04-01 15:01:10 +00:00
Alan Somers
86571b9c01 Consolidate random sleeps in periodic scripts
Multiple periodic scripts sleep for a random amount of time in order to
mitigate the thundering herd problem. This is bad, because the sum of
multiple uniformly distributed random variables approaches a normal
distribution, so the problem isn't mitigated as effectively as it would be
with a single sleep.

This change creates a single configurable anticongestion sleep. periodic
will only sleep if at least one script requires it, and it will never sleep
more than once per invocation. It also won't sleep if periodic was run
interactively, fixing an unrelated longstanding bug.

PR:		217055
PR:		210188
Reviewed by:	cy
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D10211
2017-04-01 04:42:35 +00:00
Enji Cooper
653e7d6396 Split iscsi(4) ctl frontend off of ctl(4) as cfiscsi(4)
The goal of this work is to remove the explicit dependency for ctl(4)
on iscsi(4), so end-users without iscsi(4) support in the kernel can
use ctl(4) for its other functions.

This allows those without iscsi(4) support built into the kernel to use
ctl(4) as a test mechanism. As a sidenote, this was possible around the
10.0-RELEASE period, but made impossible for end-users without iscsi(4)
between 10.0-RELEASE and 11.0-RELEASE.

Automatically load cfiscsi(4) from ctladm(8) and ctld(8) for backwards
compatibility with previously releases. The automatic loading feature is
compiled into the beforementioned tools if MK_ISCSI == yes when building
world.

Add a manpage for cfiscsi(4) and refer to it in ctl(4).

Differential Revision:	D10099
MFC after:	2 months
Relnotes:	yes
Reviewed by:	mav, trasz
Sponsored by:	Dell EMC Isilon
2017-03-30 04:56:27 +00:00
Conrad Meyer
34a1b5b258 rrenumd(8): Fix a trivial Coverity warning
Coverity warns that it is invalid to access following struct members by
accessing the current struct member pointer plus one.  Assuming the
compilers aren't abusing this kind of UB yet, this cleanup isn't a
functional change.

Reported by:	Coverity
CID:		1368713
Sponsored by:	Dell EMC Isilon
2017-03-29 21:04:39 +00:00
Ed Maste
cfa6282553 makefs: sync with NetBSD
This is a collection of minor changes as diff reduction against NetBSD.

NetBSD revs:
cd9660.c		1.39
cd9660.h		1.19
makefs.c		1.34

Obtained from:	NetBSD
Sponsored by:	The FreeBSD Foundation
2017-03-29 20:49:41 +00:00
Ed Maste
10d64b7788 makefs: free specfile structure once it has been applied
NetBSD revs:
walk.c		1.21

Obtained from:	NetBSD
Sponsored by:	The FreeBSD Foundation
2017-03-29 15:45:19 +00:00
Ed Maste
6c5f7c4725 makefs: sort roundup with the other off_t members in fsinfo_t
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2017-03-27 20:24:18 +00:00
Enji Cooper
ced3474819 ctldadm: sort #includes per style(9)
- Only include sys/types.h or sys/param.h, not both.
- Sort alphabetically.

MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-03-27 19:01:34 +00:00
Enji Cooper
9118b1b092 ctld: sort #includes per style(9)
- Only include sys/types.h or sys/param.h, not both.
- Sort alphabetically.

MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-03-27 18:59:49 +00:00
Enji Cooper
f040054c54 Allow WARNS to be overridden by the end-user
MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-03-27 18:40:20 +00:00
Brad Davis
f43b687262 Check to see if the kernel has cd9660 before running tests that require it
Approved by:	ngie
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D10096
2017-03-27 15:20:31 +00:00
Jamie Gritton
6bd211bb87 Same as r316022 (Fix hexadecimal escape codes in jail.conf(5)),
but do it right this time.

Reported by:	Kyle Evans <Kyle Evans>
MFC after:	3 days
2017-03-27 13:37:40 +00:00
Jamie Gritton
acf8ec5684 Fix hexadecimal escape codes in jail.conf(5).
PR:		218154
Submitted by:	Masahiro Konishi <mkonishi@sea.plala.or.jp>
MFC after:	3 days
2017-03-27 13:27:39 +00:00
Robert Watson
5e386598a6 Merge OpenBSM 1.2-alpha5 from vendor branch to FreeBSD -CURRENT:
- Add a new "qsize" parameter in audit_control and the getacqsize(3) API to
  query it, allowing to set the kernel's maximum audit queue length.
- Add support to push a mapping between audit event names and event numbers
  into the kernel (where supported) using new A_GETEVENT and A_SETEVENT
  auditon(2) operations.
- Add audit event identifiers for a number of new (and not-so-new) FreeBSD
  system calls including those for asynchronous I/O, thread management, SCTP,
  jails, multi-FIB support, and misc. POSIX interfaces such as
  posix_fallocate(2) and posix_fadvise(2).
- On operating systems supporting Capsicum, auditreduce(1) and praudit(1) now
  run sandboxed.
- Empty "flags" and "naflags" fields are now permitted in audit_control(5).

Many thanks to Christian Brueffer for producing the OpenBSM release and
importing/tagging it in the vendor branch.  This release will allow improved
auditing of a range of new FreeBSD functionality, as well as non-traditional
events (e.g., fine-grained I/O auditing) not required by the Orange Book or
Common Criteria.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, AFRL
MFC after:	3 weeks
2017-03-26 21:14:49 +00:00
Sevan Janiyan
56e4d8d5f6 ftp.microsoft.com is dead and the document was not archived, point to the full
protocol spec document instead.
Fix spelling mistake flagged by igor.
Rephrase bad sentence flagged by igor.

Approved by:	bcr (mentor)
MFC after:	5 days
Differential Revision:	 https://reviews.freebsd.org/D10111
2017-03-25 21:33:48 +00:00
Baptiste Daroussin
d1005f6a13 Add a regression test for r31512 fix
PR:		217934
MFC after:	1 week
2017-03-25 10:47:58 +00:00
Eugene Grosbein
92bb425e4e Properly initialise with content of pw.conf(5) that was mistakenly ignored.
Also, respect "defaultgroup" if specified there.

PR:		217934
Reported by:	Victor Sudakov <vas@mpeks.tomsk.su>
Reviewed by:	bapt
Approved by:	bapt, vsevolod (mentor)
MFC after:	1 week
2017-03-24 16:18:57 +00:00
Xin LI
f0574f5cf6 MFV r315791: ntp 4.2.8p10. 2017-03-23 22:06:06 +00:00
Enji Cooper
458cbf0ae6 Rename tests from <foo> to <foo>_test to match the FreeBSD test suite
naming scheme

usr.bin/diff/diff_test was renamed to usr.bin/diff/netbsd_diff_test
to avoid collisions with the renamed FreeBSD test.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-03-23 03:28:24 +00:00
Enji Cooper
84eb6b9887 ctm: fix memory leaks in Pass1(..)
Call `Delete(..)` (a free(3) wrapper) on `name` when bailing from the
function.

Submitted by:	Tom Rix <trix@juniper.net>
Reviewed by:	ngie
Differential Revision:	D10097
Sponsored by:	Dell EMC Isilon, Juniper
2017-03-22 17:28:53 +00:00
Peter Grehan
b9c1cdd190 This fixes a typo in bhyve's USB mouse emulation.
There is no behavioral difference, as it's just swapping
out the name of two identically-valued constants.

Submitted by:	Vicki Pfau (vi AT endrift.com)
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D9597
2017-03-22 16:53:03 +00:00
Gleb Smirnoff
cc65eb4e79 Hide struct inpcb, struct tcpcb from the userland.
This is a painful change, but it is needed.  On the one hand, we avoid
modifying them, and this slows down some ideas, on the other hand we still
eventually modify them and tools like netstat(1) never work on next version of
FreeBSD.  We maintain a ton of spares in them, and we already got some ifdef
hell at the end of tcpcb.

Details:
- Hide struct inpcb, struct tcpcb under _KERNEL || _WANT_FOO.
- Make struct xinpcb, struct xtcpcb pure API structures, not including
  kernel structures inpcb and tcpcb inside.  Export into these structures
  the fields from inpcb and tcpcb that are known to be used, and put there
  a ton of spare space.
- Make kernel and userland utilities compilable after these changes.
- Bump __FreeBSD_version.

Reviewed by:	rrs, gnn
Differential Revision:	D10018
2017-03-21 06:39:49 +00:00
Garance A Drosehn
e550d65c85 Fixes to chkprintcap:
- Check the return from a call to malloc() in skim_printcap(), and
  return a NULL if that fails.
- Fix a small memory leak in main() that happens if skim_printcap()
  returns an error, including the new error-return of NULL.

Submitted by:	Tom Rix <trix@juniper.net>
Reviewed by:	pfg, ngie
MFC after:	4 weeks
Sponsored by:	Dell EMC Isilon, Juniper
Differential Revision:	D9954, D9982
2017-03-20 22:36:28 +00:00
Hiroki Sato
d31d87b0a7 Simplify a pipe for signal handling. 2017-03-20 17:57:24 +00:00
Hiroki Sato
f7f99edf3f Fix a regression which prevented an IPv6 address in a -b option from
working.

PR:	217939
Differential Revision:	https://reviews.freebsd.org/D10064
2017-03-20 17:46:33 +00:00
Enji Cooper
b79299b5e7 syslogd: try to print out a more helpful message in socksetup(..) if/when
getaddrinfo fails

If the asprintf call fails, fall back to the old code (as a last ditch effort
to provide the end-user with helpful output).

Sponsored by:	Dell EMC Isilon
2017-03-20 06:12:55 +00:00
Enji Cooper
9c2aa0a0a3 syslogd: fix dprintf in socksetup(..)
- Make the explanation more complete
- Correct a minor grammar nit with verb tense.
- Don't emit the message if `pe->pe_name` is NULL (it doesn't
  have much value).

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-03-20 05:12:27 +00:00
Enji Cooper
4863f2fc55 syslogd: don't leak f on failure in cfline(..)
Free `f` if an unknown priority or facility is parsed with the function.

MFC after:	1 week
Reported by:	Coverity
CID:		1368068
Sponsored by:	Dell EMC Isilon
2017-03-20 04:25:40 +00:00
Edward Tomasz Napierala
4bcdaf7651 Improve formatting.
MFC after:	2 weeks
2017-03-19 16:17:42 +00:00
Bartek Rutkowski
2434a0528a Revert changes introduced in r314036 on demand by jhb and bapt.
Approved by:	bapt, jhb
2017-03-17 11:45:46 +00:00
Enji Cooper
a393b6c82f syslogd: fix memory leaks in main(..) and allowaddr(..)
- main(..): free memory assigned to fdsr before calling die(..).
- allowaddr(..): free memory assigned to ap before returning from the
  function early. Add a `err` goto label to reduce freeaddrinfo/free(ap)
  logic duplication.

MFC after:	1 week
X-MFC notes:	some of this is dependent on refactoring not MFCed
Reported by:	clang static analyzer, Coverity
CID:		1367750 (ap leakage in allowaddr(..))
Submitted by:	Tom Rix <trix@juniper.net>
Reviewed by:	ngie
Sponsored by:	Dell EMC Isilon, Juniper
Differential Revision:	D10004
2017-03-15 18:15:30 +00:00
Ed Maste
870952f562 makefs: improve error messages
- remove \n
- use __func__
- err adds the error string itself

NetBSD revs:
cd9660.c	1.48 1.49
ffs/buf.c	1.21
ffs/mkfs.c	1.27

Obtained from:	NetBSD
2017-03-15 18:14:54 +00:00
Ed Maste
538ab9e64e makefs: don't print pointers in debugging messages
NetBSD revisions:
ffs/buf.c	1.14

Obtained from:	NetBSD
2017-03-15 17:26:19 +00:00
Ed Maste
babca35cb2 makefs: use 'm' for cd9660 allow-multidot, per NetBSD
NetBSD revisions:
cd9660.c	1.55

Obtained from:	NetBSD
2017-03-15 16:16:30 +00:00
Ed Maste
776c68249b makefs: sync option parsing with NetBSD
- add support for parsing different types; not just int
- homogenize option parsing
- fix single letter parsing
- remove duplicated code

NetBSD revisions:
cd9660.c        1.36 1.37 1.38 1.41 1.42 1.43
ffs.c           1.50 1.51 1.52 1.53 1.56 1.57
makefs.c        1.36 1.37 1.38 1.39 1.40 1.42 1.43 1.44 1.46
makefs.h        1.28 1.29 1.31 1.32

Obtained from:	NetBSD
Sponsored by:	The FreeBSD Foundation
2017-03-15 13:34:51 +00:00
Ed Maste
f490b9b3bf makefs: sync -T timestamp with NetBSD
NetBSD revision:
makefs.c	1.51

Obtained from:	NetBSD
2017-03-14 18:08:32 +00:00
Ed Maste
f7d3963023 makefs: remove unused variable
NetBSD revisions:
mkfs.c 1.32

Obtained from:	NetBSD
2017-03-14 16:40:18 +00:00
Pedro F. Giffuni
85f104954a ypbind(8): let calloc(3) do the multiplying. 2017-03-13 20:51:00 +00:00
Pedro F. Giffuni
4b6fa244b2 mpsutil(8): let calloc(3) do the multiplying. 2017-03-13 20:49:31 +00:00
Pedro F. Giffuni
87959e27fd nscd(8): let calloc(3) do the multiplying.
MFC after:	1 week
2017-03-13 20:34:53 +00:00
Scott Long
286ab2b514 Add constants and descriptions for some new PCI class definitions 2017-03-13 07:45:15 +00:00
Marcelo Araujo
21a973f499 Use nitems() from sys/param.h.
Reviewed by:	ngie
Differential Revision:	https://reviews.freebsd.org/D9943
2017-03-12 03:43:28 +00:00
Marcelo Araujo
56eeadd845 Use nitems() from sys/param.h.
MFC after:	3 weeks.
2017-03-11 04:03:13 +00:00
Marcelo Araujo
5116725078 Use nitems() from sys/param.h.
Reviewed by:	np
MFC after:	3 weeks.
Differential Revision:	https://reviews.freebsd.org/D9945
2017-03-11 04:01:35 +00:00
Marcelo Araujo
793128cc2c Use nitems() from sys/param.h
Reviewed by:	jhb
MFC after:	3 weeks.
Differential Revision:	https://reviews.freebsd.org/D9941
2017-03-11 04:00:27 +00:00
Alan Somers
58fbd700fa Increase WARNS for pw tests
ATF tests have a default WARNS of 0, unlike other usermode programs.

Reviewed by:  ngie, julian
MFC after:    3 weeks
Sponsored by: Spectra Logic Corporation
Differential Revision:        https://reviews.freebsd.org/D9933
2017-03-11 00:11:20 +00:00
Marcelo Araujo
c86932b61b Use nitems() from sys/param.h.
Reviewed by:	ngie
MFC after:	3 weeks.
Differential Revision:	https://reviews.freebsd.org/D9940
2017-03-10 06:25:54 +00:00
Marcelo Araujo
a0fb90916a Use nitems() from sys/param.h.
Reviewed by:	asomers
MFC after:	3 weeks.
Differential Revision:	https://reviews.freebsd.org/D9944
2017-03-10 04:24:21 +00:00
Alan Somers
f5c4d58f4a Fix harmless mismerge from r286964
MFC after:	3 days
Sponsored by:	Spectra Logic Corp
2017-03-09 16:22:21 +00:00
Cy Schubert
6a1588c0a4 Configure leap-second smearing (always).
Leap-second smearing is an experimental option that may be specified in
ntp.conf(5) and the -x option on the command line to spread the effect
of a leap-second over an interval as specified by the leapsmearinterval
config file statement. Recommended values are between 7200 (2 hours) and
86400 (24 hours).

It is advised that leap-second smearing not be used for public NTP
servers (https://www.meinbergglobal.com/download/burnicki/Leap\
%20Second%20Smearing%20With%20NTP.pdf). It is also advised that NTP
clients not use a mix of NTP servers using leap-second smearing with
NTP servers not using leap-second smearing as that could cause
undefined client behaviour.

Leap-second smearing was committed to ports net/ntp and net/ntp-devel
by r426825 on 2016-11-22.

Suggested by:	des
MFC after:	4 weeks
2017-03-09 05:29:24 +00:00
Warner Losh
2bcbcb593d efidp manipulates UEFI Device Paths in various ways. At the moment, it
formats and parses UEFI standard Device Paths. In the future it will
also translate between FreeBSD driver names and UEFI Device Paths.

Sponsored by: Netflix
2017-03-09 00:33:38 +00:00
Warner Losh
2f2f5c6728 Finish implementing -d/--device/--device-path flag to print variable
as if it were a device path.

Remove language about a=b syntax on the command line. This will not be
implemented due to its limited usefulness. UEFI variables are binary
blobs, on the whole, and a simple work around exists for
strings. Clarify that the new value of the variable is taken from
stdin. Update manual with history.

Sponsored by: Netflix
2017-03-09 00:31:36 +00:00
Cy Schubert
3779ab7a36 Remove extraneous arguments and options, which don't make sense for
a file documented in volume 5.

MFC after:	3 days
2017-03-08 07:02:39 +00:00
Pedro F. Giffuni
4fd444b072 lpr(1): small bounds check with reallocarray(3).
While here plug a memory leak upon error and postpose a multiplication
until after reallocation has succeded.

Hinted partially by:	OpenBSD
Reviewed by:		gad
MFC after:		2 weeks
2017-03-07 19:30:22 +00:00
Rodney W. Grimes
ce9f2d31b3 Convert absolute links to relative links.
Style.Makefile(9) has been ignored to produce minimal diffs.

Approved by:	grehan (mentor)
MFC after:	1 week
2017-03-07 05:10:38 +00:00
Enji Cooper
ed8251f888 mergemaster: fix description of -p
-p only handles updating /etc/master.passwd and /etc/group . No more,
no less.

Also, mergemaster (and no other portions of the vanilla FreeBSD build
process) should be messing with __MAKECONF or SRCCONF as part of the
installworld or distribution process. Don't insinuate that mergemaster
does that as it's a false claim.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-03-07 04:13:22 +00:00
Enji Cooper
59daefd7eb Fix some trivial manlint warnings
Sentences should begin on new lines, per manlint.

Bump .Dd for the change

MFC after:	1 month
Reviewed by:	bcr
Reported by:	make manlint
Sponsored by:	Dell EMC Isilon
2017-03-06 19:33:15 +00:00
Cy Schubert
dae3dadc43 Fix mismerge of r280849.
Reported by:	des
MFC after:	3 days
2017-03-06 07:11:23 +00:00
Rodney W. Grimes
793cc4b409 Change /etc/rmt symlink from absolute to relative path,
correcting the mistake made in r6499

Approved by:	grehan
MFC after:	1 week
2017-03-05 04:09:18 +00:00
Enji Cooper
81a687a7ff Fix build after r314656
Some of the changes I introduced to use .ALLSRC were correct in spirit,
but incorrect in reality -- in particular, ../Makefile.inc hadn't been
pulled in via bsd.init.mk (via bsd.lib.mk, bsd.prog.mk), so the value
of .ALLSRC (evaluated immediately) was empty. .include bsd.init.mk
explicitly so we can be certain that the values used as dependencies in
the targets are defined when the target recipe has been evaluated.

Reminder: thou shalt separate out separate functional changes before
          committing them.

(YUGE) Pointyhat to:	ngie
In collaboration with:	bdrewery
MFC after:	1 month
Reported by:	Jenkins, cy, ler, O. Hartmann, Michael Butler
Sponsored by:	Dell EMC Isilon
2017-03-04 20:35:34 +00:00
Enji Cooper
64a0982bee usr.sbin: normalize paths using SRCTOP-relative paths or :H when possible
This simplifies make logic/output

MFC after:	1 month
Sponsored by:	Dell EMC Isilon
2017-03-04 11:38:03 +00:00
Enji Cooper
6dbd2714db Correct nuance of -a :service -> "*" in r314563, r314585
My attempt to correct the sender/receiver behavior was incorrect.
The source port of the sender for forwarded datagrams is filtered
with -a, and my change in r314585 didn't clarify that point at all.

Wording is based on suggestion by hrs.

MFC after:	28 days
X-MFC with:	r314563, r314585
Reported by:	hrs
In collaboration with:	hrs, rgrimes
Sponsored by:	Dell EMC Isilon
2017-03-04 06:19:41 +00:00
Warner Losh
f2d626ab0e If the guid specified can't be decoded as a GUID, try looking it up in
the known guid to name table.

Sponsored by: Netflix
2017-03-03 20:23:18 +00:00
Warner Losh
9e4a51a860 Implement -d / --device-path to print the ascii representation of a variable that contains a UEFI device path.
Sponsored by: Netflix
2017-03-03 20:23:14 +00:00
Warner Losh
1644567051 Implement --guid/-g to print the known GUIDs as human readable. The
list of known GUIDs can be found with --list-guids.

Sponsored by: Netflix
2017-03-03 20:23:10 +00:00
Warner Losh
4a110fbfa7 Actually implement efivar -L
Sponsored by: Netflix
2017-03-03 20:23:05 +00:00
Warner Losh
902af7c6f5 Print just the variables when we're not printing the values.
Sponsored by: Netflix
2017-03-03 20:23:01 +00:00
Jung-uk Kim
0d84335f99 Merge ACPICA 20170303. 2017-03-03 18:56:15 +00:00
Enji Cooper
3dd94b6769 Correct verb change for service => * after r314563
`*` means that packets will be received from a remote peer on any port.
Since the point of interest is the syslogd instance (not the remote peer),
the appropriate verb is "received", not "sent".

MFC after:	1 month
X-MFC with:	r314563
Sponsored by:	Dell EMC Isilon
2017-03-03 06:13:59 +00:00
Navdeep Parhar
54912308c8 Add cxgbetool(8) to the base system.
Move cxgbetool from tools/tools to usr.sbin. Compile and install it on
platforms where cxgbe(4) is built by default.  Knobs (WITH_CXGBETOOL and
WITHOUT_CXGBETOOL) have been added so that the user can override the
default setting.

Reviewed by:	ngie@, gnn@, bdrewery@
MFC after:	1 month
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D9854
2017-03-03 03:11:58 +00:00
Enji Cooper
bc4536df9d Wordsmith syslogd(8)
- Clarify -p/-S options by using appropriate subject-verb modifiers
  (verb and modifiers suggested that the subject should have been
  singular).
- Simplify/correct -a description:
-- Be more terse when describing IPv4 (the "usual dotted notation"
   isn't necessarily well understood by the reader). Being blunt and
   saying "IPv4 address" with an optional netmask is.
-- prefixlen is the appropriate terminology for IPv6.
-- mask/prefixlen is optional, not required (as noted later on in the
   section).
-- split up IPv4/IPv6 use so to clarify both forms.
-- Fix wordiness when describing the optional "service" specifier.
- -T: Use "cannot" instead of "can't" [*].

Bump .Dd for the changes.

MFC after:	1 month
Reported by:	igor [*]
Reviewed by:	hrs
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D9855
2017-03-02 18:07:19 +00:00
Enji Cooper
0023765382 Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
This simplifies pathing in make/displayed output.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-03-02 05:04:45 +00:00
Ed Maste
8c71aecd10 makefs: remove clause 3 & 4 from Manuel Bouyer license
ffs_bswap.c 1.34
ufs_bswap.h 1.34

Obtained from:	NetBSD
Sponsored by:	The FreeBSD Foundation
2017-03-02 04:11:18 +00:00
Ed Maste
50c088a006 makefs: remove archaic __P prototypes from ufs_bswap.h
This reduces differences with NetBSD

Sponsored by:	The FreeBSD Foundation
2017-03-02 04:08:14 +00:00
Enji Cooper
568123e100 Use :H to manipulate .CURDIR-relative paths instead of ../
This simplifies make output

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-03-01 05:21:21 +00:00
Enji Cooper
982a915f13 Simplify idioms in Makefiles further
- Use SRCTOP-relative paths instead of .CURDIR-relative ones where possible
- Use :H to manipulate .CURDIR in areas instead of ..-relative paths.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-03-01 05:19:35 +00:00
Enji Cooper
7fec199b3b Simplify idioms in usr.sbin/lpr Makefiles
Use :H instead of .CURDIR-relative pathing to simplify make output, etc.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-03-01 05:14:45 +00:00
Enji Cooper
af6a5351a1 Simplify/improve idioms in usr.sbin/ntp Makefiles
- Use SRCTOP-relative paths to other directories instead of
  .CURDIR-relative ones. This simplifies pathing in make/displayed output.
- Also, use :H where possible/sensical to manipulate .CURDIR-relative
  paths
- Remove superfluous bsd.own.mk .includes which are already handled via
  src.opts.mk .includes

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-03-01 04:54:06 +00:00
Enji Cooper
62f32e06bc Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
This simplifies pathing in make/displayed output.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-03-01 04:41:59 +00:00
Enji Cooper
40a54564e4 Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
Also, use :H where possible/sensical to manipulate .CURDIR-relative paths

This simplifies pathing in make/displayed output.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-03-01 04:35:21 +00:00
Enji Cooper
7b8810a816 Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
This simplifies pathing in make/displayed output.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-03-01 04:24:56 +00:00
Enji Cooper
c3f658c181 Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
This simplifies pathing in make/displayed output.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-03-01 04:24:24 +00:00
Enji Cooper
eca186c4c2 Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
This simplifies pathing in make/displayed output.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-03-01 04:23:53 +00:00
Enji Cooper
33bfdd500b Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
The SRCTOP conversion simplifies pathing in make/displayed output.

Also, while here, change a hardcoded path to ${RPCDIR}/ypxfrd.x in
the make targets with ${.ALLSRC} .

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-03-01 04:22:23 +00:00
Enji Cooper
1de134e528 Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
This simplifies pathing in make/displayed output.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-03-01 04:19:04 +00:00
Enji Cooper
5855f96f80 Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
This simplifies pathing in make/displayed output.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-03-01 04:18:28 +00:00
Enji Cooper
e8d2762fd3 Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
This simplifies pathing in make/displayed output.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-03-01 04:17:59 +00:00
Enji Cooper
949eda893b Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
This simplifies pathing in make/displayed output.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-03-01 04:17:18 +00:00
Enji Cooper
1a32a8fe6c Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
The SRCTOP conversion simplifies pathing in make/displayed output.

Also, while here, change a hardcoded path to ${RPCDIR}/ypupdate_prot.x in
the make targets with ${.ALLSRC} .

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-03-01 04:16:40 +00:00
Enji Cooper
e938182bf5 Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
This simplifies pathing in make/displayed output.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-03-01 04:14:41 +00:00
Enji Cooper
4841dac7c3 Use .ALLSRC instead of RPCSRC
This is a trivial simplification in the Makefile, meant to serve as
a good example for what to do with rules like this.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-03-01 04:13:31 +00:00
Enji Cooper
f826cc0107 Use .ALLSRC instead of RPCSRC
This is a trivial simplification in the Makefile, meant to serve as
a good example for what to do with rules like this.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-03-01 04:12:24 +00:00
Enji Cooper
398e13d120 Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-03-01 04:02:36 +00:00
Enji Cooper
0372faed69 Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-03-01 04:00:17 +00:00
Enji Cooper
026cf50356 Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
The SRCTOP conversion simplifies pathing in make/displayed output.

Also, while here, change a hardcoded path to ar5523.bin.uu in the make target
with ${.ALLSRC} .

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-03-01 03:59:18 +00:00
Warner Losh
fbbd9655e5 Renumber copyright clause 4
Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by:	Jan Schaumann <jschauma@stevens.edu>
Pull Request:	https://github.com/freebsd/freebsd/pull/96
2017-02-28 23:42:47 +00:00
Gleb Smirnoff
efe3b0de14 Remove SVR4 (System V Release 4) binary compatibility support.
UNIX System V Release 4 is operating system released in 1988. It ceased
to exist in early 2000-s.
2017-02-28 05:14:42 +00:00
Roman Bogorodskiy
5121b6ccec bhyve: document virtio-console in the manpage
Reviewed by:	bcr, wblock, jceel
Approved by:	grehan
Differential Revision:	https://reviews.freebsd.org/D9564
2017-02-27 15:37:38 +00:00
Enji Cooper
15f0eea574 Parameterize out the length of struct filed->f_lasttime as MAXDATELEN
This removes the hardcoded value for the field (16) and the equivalent
hardcoded lengths in logmsg(..).

This change is being done to help stage future work to add RFC5424/RFC5434
support to syslogd(8).

Obtained from:	Isilon OneFS (dcd33d13da) (as part of a larger change)
Submitted by:	John Bauman <john.bauman@isilon.com>
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-02-25 00:12:29 +00:00
Warner Losh
35a419a2cb Exit when we can't print a variable.
Exit after printing a message on stderr when we can't get a
message. This is slightly different than linux, but keeps shell
scripts from thinking the value of the variable is the error message
and so is a net win.

Sponsored by: Netflix
2017-02-25 00:09:26 +00:00
Enji Cooper
8fe70bb8f2 Use SRCTOP instead of .CURDIR relative paths with ".."
This simplifies pathing in make/displayed output

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-02-24 21:35:59 +00:00
Pedro F. Giffuni
3472d84e17 rtadvd(8): double assignment.
Remove doubtful initialization since the value will be overwritten
immediately afterwards.

Found with: coccinelle (da.cocci)
2017-02-23 15:10:46 +00:00
Pedro F. Giffuni
95c10b8fa0 camdd(8): double assignment.
Why do a calculation twice when you can do it just once.

Found with: coccinelle (da.cocci)
2017-02-23 15:05:01 +00:00
Ed Maste
1631d42aa6 makefs: eliminate global cd9660 structure
For diff reduction with NetBSD

NetBSD file versions:
cd9660.c 1.39
cd9660.h 1.19
cd9660/cd9660_debug.c 1.12
cd9660/cd9660_eltorito.c 1.20
cd9660/cd9660_write.c 1.16
cd9660/iso9660_rrip.c 1.12
cd9660/iso9660_rrip.h 1.6

Reviewed by:	ngie
Obtained from:	NetBSD
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D9627
2017-02-23 02:28:08 +00:00
Bartek Rutkowski
4bf41040fd Enable bsdinstall hardening options by default.
As discussed previously, in order to introduce new OS hardening
defaults, we've added them to bsdinstall in 'off by default' mode.
It has been there for a while, so the next step is to change them
to 'on by defaul' mode, so that in future we could simply enable
them in base OS.

Reviewed by:	brd
Approved by:	adrian
Differential Revision:	https://reviews.freebsd.org/D9641
2017-02-21 09:37:33 +00:00
Mariusz Zaborski
7b13366373 Capsicumize traceroute.
PR:		 193973
Submitted by:	 Mikhail <mp39590@gmail.com>
Reviewed by:	 pjd, bapt, emaste, AllanJude
Differential Revision:	https://reviews.freebsd.org/D9303
2017-02-20 23:48:50 +00:00
Bartek Rutkowski
955255728c Add 0-8 as shortcuts for jumping to menu items in the hardening menu.
Submitted by:	skreuzer
Reviewed by:	allanjude, robak
Approved by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D6826
2017-02-16 19:58:02 +00:00
Ed Maste
39cbdda0d1 makefs: use a macro to simplify per-fs function declarations
makefs.h 1.28

Obtained from:	NetBSD
2017-02-16 03:12:47 +00:00
Ed Maste
1dc349ab95 prefix UFS symbols with UFS_ to reduce namespace pollution
Specifically:
  ROOTINO -> UFS_ROOTINO
  WINO -> UFS_WINO
  NXADDR -> UFS_NXADDR
  NDADDR -> UFS_NDADDR
  NIADDR -> UFS_NIADDR
  MAXSYMLINKLEN_UFS[12] -> UFS[12]_MAXSYMLINKLEN (for consistency)

Also prefix ext2's and nandfs's NDADDR and NIADDR with EXT2_ and NANDFS_

Reviewed by:	kib, mckusick
Obtained from:	NetBSD
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D9536
2017-02-15 19:50:26 +00:00
Renato Botelho
937f8ddf10 Fix style(9)
Reviewed by:	allanjude, vangyzen
Approved by:	allanjude
MFC after:	1 week
Sponsored by:	Rubicon Communications (Netgate)
Differential Revision:	https://reviews.freebsd.org/D9510
2017-02-14 18:11:16 +00:00
Ed Maste
111142bcf1 bhyve: whitespace fix for r313727
Reported by:	jhb
2017-02-14 16:49:32 +00:00
Bartek Rutkowski
00ef17befe Capsicum support for bhyve(8).
Adds Capsicum sandboxing to bhyve.

Submitted by:	Pawel Biernacki <pawel.biernacki@gmail.com>
Reviewed by:	grehan, oshogbo
Approved by:	emaste, grehan
Sponsored by:	Mysterious Code Ltd.
Differential Revision:	https://reviews.freebsd.org/D8290
2017-02-14 13:35:59 +00:00
Xin LI
ada6f083b9 MFV r313676: libpcap 1.8.1
MFC after:	1 month
2017-02-13 08:23:39 +00:00
Conrad Meyer
ae9dddfc09 pciconf(8): Replace an assert with errx
The condition can be hit with simple user input, so it isn't an invariant.
Just error out.

PR:		217003
Reported by:	Vladislav V. Prodan <admin at support.od.ua>
Sponsored by:	Dell EMC Isilon
2017-02-11 18:04:43 +00:00
Ed Maste
78b11a5903 makefs: make the buffer functions look exactly like the kernel ones
From NetBSD christos Sat Jan 26 00:19:39 2013 +0000

make the buffer functions look exactly like the kernel ones and add other
cruft to make the kernel files compile.

ffs.c 1.54
ffs/buf.c 1.13
ffs/buf.h 1.3
ffs/ffs_alloc.c 1.21
ffs/ffs_balloc.c 1.15

Reviewed by:	marcel, ngie
Obtained from:	NetBSD
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D8404
2017-02-11 02:33:48 +00:00
Ed Maste
b6c03f2122 kldxref: bump MAXSEGS to 3
ld.bfd generates two PT_LOAD segments, but certain linkers or linker
configurations generate three PT_LOAD segments (one additional for
RELRO).

PR:		216975
Reported by:	Shawn Webb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2017-02-10 19:17:10 +00:00
Ed Maste
d65b2f7ed6 kldxref: s/sections/segments/ in warning message
The message refers to program header segments, not sections.

PR:		216975
2017-02-10 19:11:33 +00:00
Renato Botelho
7814b3b8a1 Cleanup on usr.sbin/arp/arp.c
* 'blackhole' and 'reject' are mutually exclusive, replace printf() by errx()
  when both are selected.
* 'trail' option is no longer supported since first import of arp from 4.4BSD.
  XXX message was added 13 years ago in r128192. I believe it's time to remove
  it.
* Use warnx() to print some informative messages instead of printf()
* Replace strncmp() by strcmp() when validating parameters and exit when invalid
  parameter is found

Reviewed by:	allanjude, vangyzen, cem
Approved by:	allanjude
MFC after:	1 week
Sponsored by:	Rubicon Communications (Netgate)
Differential Revision:	https://reviews.freebsd.org/D9504
2017-02-09 19:58:12 +00:00
Renato Botelho
04ae8c6400 Fix style(9)
Reviewed by:	vangyzen, allanjude, cem
Approved by:	allanjude
MFC after:	1 week
Sponsored by:	Rubicon Communications (Netgate)
Differential Revision:	https://reviews.freebsd.org/D9494
2017-02-08 20:21:29 +00:00
Renato Botelho
371ce0ebc2 bsdinstall: Make sure chroot filesystems are umounted after use
* DISTDIR_IS_UNIONFS is set every time BSDINSTALL_DISTDIR is mounted inside
  BSDINSTALL_CHROOT. Use this flag to decide if it needs to be umounted
* BSDINSTALL_CHROOT/dev is mounted when 'bsdinstall mount' is called, there is
  no need to mount it again when user goes to shell after installation

Reviewed by:	allanjude
Obtained from:	pfSense
MFC after:	1 week
Sponsored by:	Rubicon Communications (Netgate)
Differential Revision:	https://reviews.freebsd.org/D8573
2017-02-08 17:03:52 +00:00
Ravi Pokala
0ee82391df Fix indentation (only line in file w/ 8-space indent rather than hard-tab).
MFH:		1 week
2017-02-08 00:02:54 +00:00
Enji Cooper
916aa57754 Sort sys/ #includes some more
MFC after:	1 week
X-MFC with:	r313358
Sponsored by:	Dell EMC Isilon
2017-02-07 01:28:55 +00:00
Enji Cooper
688e4de4e7 Sort sys/ #includes and zap an unnecessary trailing space nearby
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-02-07 00:47:33 +00:00
Enji Cooper
72e282471c Use a flexible array for TypeNames instead of hardcoding the array length
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-02-07 00:42:55 +00:00
Enji Cooper
bc64f428ad Fix typos in comments (returing -> returning)
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-02-07 00:09:48 +00:00
Warren Block
b9b36cc00f Replace Cyrillic characters with Latin (normal) ones.
PR:		216534
Submitted by:	eborisch+FreeBSD@gmail.com
MFC after:	1 week
Sponsored by:	iXsystems
2017-02-03 16:21:30 +00:00
Gleb Smirnoff
3057e051be Reduce diff to upstream using HAVE_CAPSICUM instead of __FreeBSD__. It'll also
make it easier to upstream HAVE_CASPER patch.
2017-02-02 19:56:41 +00:00
Gleb Smirnoff
8b3245fb4e Fix build with WITHOUT_INET6.
Submitted by:	Alex Deiter <alex.deiter gmail.com>
2017-02-02 04:53:33 +00:00
Gleb Smirnoff
3340d77368 Update tcpdump to 4.9.0.
It fixes many buffer overflow in different protocol parsers, but none of
them are critical, even in absense of Capsicum.

Security:	CVE-2016-7922, CVE-2016-7923, CVE-2016-7924, CVE-2016-7925
Security:	CVE-2016-7926, CVE-2016-7927, CVE-2016-7928, CVE-2016-7929
Security:	CVE-2016-7930, CVE-2016-7931, CVE-2016-7932, CVE-2016-7933
Security:	CVE-2016-7934, CVE-2016-7935, CVE-2016-7936, CVE-2016-7937
Security:	CVE-2016-7938, CVE-2016-7939, CVE-2016-7940, CVE-2016-7973
Security:	CVE-2016-7974, CVE-2016-7975, CVE-2016-7983, CVE-2016-7984
Security:	CVE-2016-7985, CVE-2016-7986, CVE-2016-7992, CVE-2016-7993
Security:	CVE-2016-8574, CVE-2016-8575, CVE-2017-5202, CVE-2017-5203
Security:	CVE-2017-5204, CVE-2017-5205, CVE-2017-5341, CVE-2017-5342
Security:	CVE-2017-5482, CVE-2017-5483, CVE-2017-5484, CVE-2017-5485
Security:	CVE-2017-5486
2017-02-01 20:26:42 +00:00
Andriy Voskoboinyk
2bbd06fc33 Garbage collect IFT_IEEE80211 (but leave the define for possible reuse)
This interface type ("a parent interface of wlanX") is not used since
r287197

Reviewed by:	adrian, glebius
Differential Revision:	https://reviews.freebsd.org/D9308
2017-01-28 17:08:40 +00:00
Baptiste Daroussin
b4b4b5304b Revert crap accidentally committed 2017-01-28 16:31:23 +00:00
Baptiste Daroussin
814aaaa7da Revert r312923 a better approach will be taken later 2017-01-28 16:30:14 +00:00
Hiroki Sato
2f1c643658 Fix a bug which caused not to create AF_LOCAL sockets when family
is specified.

Spotted by:	Alex Deiter
2017-01-28 13:09:18 +00:00
Yoshihiro Takahashi
2b375b4edd Remove pc98 support completely.
I thank all developers and contributors for pc98.

Relnotes:	yes
2017-01-28 02:22:15 +00:00
Alexander Motin
e7037673ca Make CTL ramdisk backend a real RAM disk.
If "capacity" LU option is set, ramdisk backend now implements featured
thin provisioned disk, storing data in malloc(9) allocated memory blocks
of pblocksize bytes (default PAGE_SIZE or 4KB).  Additionally ~0.2% of LU
size is used for indirection tree (bigger pblocksize reduce the overhead).
Backend supports all unmap and anchor operations.  If configured capacity
is overflowed, proper error conditions are reported.

If "capacity" LU option is not set, the backend operates mostly the same
as before without allocating real storage: writes go to nowhere, reads
return zeroes, reporting that all LBAs are unmapped.

This backend is still mostly oriented on testing and benchmarking (it is
still a volatile RAM disk), but now it should allow to run real FS tests,
not only simple dumb dd.

MFC after:	2 weeks
2017-01-24 12:13:41 +00:00
Sevan Janiyan
4d0e06e6e6 Extend manual to cover more commands and options.
PR:		203406
Submitted by:	Fehmi Noyan Isi (fnoyanisi AT yahoo DOT com)
Approved by:	wblock (mentor)
MFC after:	5 days
Differential Revision:	 https://reviews.freebsd.org/D8691
2017-01-24 08:56:54 +00:00
Baptiste Daroussin
b11244e721 Really restore the old behaviour for pw usermod -m
It again reinstall missing skel files without overwriting changed one
Add a regression test about it

Reported by:	ae
MFC after:	3 days
2017-01-22 20:03:18 +00:00
Baptiste Daroussin
6789e5acf2 Readd a feature lost in pw(8) refactoring
pw usermod foo -m

It used to be able to (re)create the home directory if it didn't exists

PR:		216224
Reported by:	ae
MFC after:	3 days
2017-01-22 18:55:01 +00:00
Alan Somers
5b1696c73f Fix misc Coverity defects in camdd(8)
CID 1341620	Fix a small memory leak
CID 1341630	Though this is technically a false positive, rearrange the
		code for clarity.
CID 1341635	Eliminate dead code
CID 1368663	Fix a double mutex unlock in the error path

Also:
* Use sig_atomic_t for variables accessed from signal handlers
* Don't conditionalize free(3) on its argument being non-null

Reported by:	Coverity
CID:		1341620 1341630 1341635 1368663
Reviewed by:	ken
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D9237
2017-01-20 21:40:04 +00:00
Alexander Motin
04108b8b21 Fix build with ICL_KERNEL_PROXY.
MFC after:	2 weeks
2017-01-20 17:43:36 +00:00
Alexander Motin
625571de20 Remove ISCSI_MAX_DATA_SEGMENT_LENGTH, using negotiated value.
MFC after:	2 weeks
2017-01-20 17:14:10 +00:00
Enji Cooper
489b7fc0a4 Add smilint target to subdir targets so "make smilint" here will run
the smilint target in subdirs

While here, convert a path that's .CURDIR relative to SRCTOP

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-01-17 03:44:45 +00:00
Enji Cooper
0acfb04bce Remove ad hoc smilint targets made standard in bsd.snmpmod.mk in r312328
MFC after:	1 week
X-MFC with:	r312328
Sponsored by:	Dell EMC Isilon
2017-01-17 03:41:23 +00:00
Conrad Meyer
db4fcadf52 "Buses" is the preferred plural of "bus"
Replace archaic "busses" with modern form "buses."

Intentionally excluded:
* Old/random drivers I didn't recognize
  * Old hardware in general
* Use of "busses" in code as identifiers

No functional change.

http://grammarist.com/spelling/buses-busses/

PR:		216099
Reported by:	bltsrc at mail.ru
Sponsored by:	Dell EMC Isilon
2017-01-15 17:54:01 +00:00
Alexander Motin
a15fbc904a Alike to r312190 decouple iSCSI connection limits from defaults.
Connection parameters should remain at defaults until negotiated.

While there, remove sythetic limits, applied if kernel provided none.
iscsid has no own limitations, no configuration and no any idea what
values are good.  Assume kernel knows what it requests.
2017-01-14 20:41:44 +00:00
Alexander Motin
7aceb7fcd4 Fix wrong way assignment in r312190. 2017-01-14 19:58:51 +00:00
Alexander Motin
59c6e3a58f Decouple iSCSI connection limits from defaults.
If initiator does not negotiate some parameter, it expects one to get
default value, not some unknown remote hardware limit.  On the side side,
if some parameter is negotiated, its default value from RFC should not
be used for anything.
2017-01-14 18:04:12 +00:00
Enji Cooper
484b700751 Fix up r312105
- Only #include tcpd.h when LIBWRAP is true to avoid header include errors
- Only define whichaf when LIBWRAP is true to avoid -Wunused warning and
  to avoid issues with structs being defined that should only be defined
  when tcpd.h is included.

MFC after:	2 weeks
X-MFC with:	r312105
Pointyhat to:	ngie
Reported by:	gcc tinderbox
Sponsored by:	Dell EMC Isilon
2017-01-14 10:20:38 +00:00
Enji Cooper
63eca8f1dd Conditionalize libwrap support into inetd based on MK_TCP_WRAPPERS
This will allow inetd to stand by itself without libwrap.

MFC after:	2 weeks
Relnotes:	yes
Reviewed by:	hrs (earlier version)
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D9056
2017-01-14 01:37:03 +00:00
Conrad Meyer
4a6ace7328 Fix broken fstyp exfat testcase
Introduced in r312010.

It helps to read the documentation before trying to test something.
2017-01-14 01:08:04 +00:00
Conrad Meyer
b632b00087 fstyp.8: Move initial exFAT blurb to the -u section
Didn't notice the second list in r312003.

Reported by:	trasz@
2017-01-13 16:46:01 +00:00
Hiroki Sato
373eea194d Purge varargs.h in favor of stdarg.h. 2017-01-13 08:01:27 +00:00
Hiroki Sato
1296e1b0b7 - Add static for functions and variables with internal linkage.
- Quiet down -Wcast-align warnings.
- Remove dead code.

There is no functionality change.
2017-01-13 06:22:49 +00:00
Enji Cooper
ef7ff3e308 Use dfr-01-xfat.img.bz2, not dfr-01-xfat.dd.bz2 (the latter
case was the full disk image from the website, which was never
checked in to svn)

Regardless, the testcase still fails

PR:		214908
Sponsored by:	Dell EMC Isilon
2017-01-13 04:04:48 +00:00
Enji Cooper
6f81c4d9bb Add testcase for exFAT that currently fails
Disk image obtained from:
http://www.cfreds.nist.gov/dfr-images/dfr-01-xfat.dd.bz2 -- was ripped off the
first GPT partition and verified to be a FAT-like partition with file(1)/hexdump.

This testcase currently fails

PR:		214908
Sponsored by:	Dell EMC Isilon
2017-01-13 04:02:09 +00:00
Enji Cooper
cebf8a2ca7 Add license preamble for r286964; credit to asomers
While here, clean up trailing whitespace

MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-01-13 03:42:51 +00:00
Conrad Meyer
e266075649 fstyp(8): Detect exFAT filesystems
Simply detect the exFAT filesystem name in the Volume Boot Record
(superblock).

PR:		214908
Reported by:	<vermaden at interia.pl>
2017-01-13 02:12:58 +00:00
Hiroki Sato
c10340d440 - Fix dereference of NULL pointer which could cause a crash [1]
- Fix memory leak due to lack of freeaddrinfo() [2]

CID:	1018281 [1]
CID:	1225057 [2]
MFC after:	3 days
2017-01-12 18:44:58 +00:00
Alan Somers
c6e3715fbc Fix uninitialized variable CIDs in route6d
The variables in question are actually return arguments, but it's still good
form to initialize them.

Reported by:	Coverity
CID:		979679 979680
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
2017-01-12 16:22:28 +00:00
Conrad Meyer
ca7d74d467 pciconf(8): Reallow trailing colon in selectors
Reallow device selectors to have a trailing colon, as documented in the
manual page.  This was broken along with some unrelated cleanups in
r295806.

PR:		215979
Reported by:	David Boyd <David.Boyd49 at twc.com>
Sponsored by:	Dell EMC Isilon
2017-01-12 00:34:37 +00:00
Hiroki Sato
b4d60f9802 Add more #ifdef INET and INET6. 2017-01-11 07:21:59 +00:00
Bjoern A. Zeeb
4a6768e64c Teach crunchide about EM_S390 to make bootstrapping from future
releases easier unless someone will fix the PR properly.

MFC after:	3 days
PR:		215940
2017-01-10 14:40:30 +00:00
Dimitry Andric
3ac0e4769e Avoid taking the address of a packed struct member in mfiutil
Fix a clang 4.0.0 warning about taking the address of a packed member of
struct mfi_evt in mfiutil:

    usr.sbin/mfiutil/mfi_evt.c:583:30: error: taking address of packed
    member 'members' of class or structure 'mfi_evt' may result in an
    unaligned pointer value [-Werror,-Waddress-of-packed-member]
                            if (parse_locale(optarg, &filter.members.locale) < 0) {
                                                      ^~~~~~~~~~~~~~~~~~~~~

Use a local variable instead, and copy that into the struct.

Reviewed by:	jhb
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D9069
2017-01-09 19:39:35 +00:00
Enji Cooper
e9fcca6a8e Add a REVISION section to track changes for the BEGEMOT-NETGRAPH MIB file
This change also documents the modification harti made to a handful of
objects in r122758 (the max OCTET STRING width was increased from 15 to
31 octets)

MFC after:	1 week
2017-01-09 06:36:17 +00:00
Enji Cooper
0dc92aeeb0 Add a REVISION section to track changes for the BEGEMOT-ATM-FREEBSD-MIB MIB file
There haven't been any changes to the MIB definition, so the REVISION
remains static at the version it was imported at

MFC after:	1 week
2017-01-09 06:19:20 +00:00
Enji Cooper
3fab006f0b Add a REVISION section to track changes for the hostres module
There haven't been any changes to the MIB definition, so the REVISION remains
static at the version it was imported at

MFC after:	1 week
2017-01-09 03:18:19 +00:00
Enji Cooper
6fec23edd3 Improve the smilint target in the hostres and mibII modules
- Mark the smilint target .PHONY so it's always executed when requested
- Leverage .PATH for BMIBS instead of spelling the path out longhand
  for them

MFC after:	1 week
2017-01-09 03:14:04 +00:00
Enji Cooper
306324d7f2 Use SRCTOP instead of spelling out the full path with .CURDIR
This helps condense the output for CFLAGS and .PATH

MFC after:	3 days
2017-01-09 03:08:21 +00:00
Enji Cooper
074a0dcceb Use nitems(mib) instead of hardcoding mib's length
MFC after:	3 days
2017-01-09 00:38:19 +00:00
Enji Cooper
240ecb400f Sort #includes
MFC after:	3 days
2017-01-09 00:37:09 +00:00
Enji Cooper
b3b69d9980 Clean up trailing whitespace
MFC after:	3 days
2017-01-09 00:33:27 +00:00
Enji Cooper
cc94da1bea Style(9) fixes
- Sort sys/ #includes
- Use nitems instead of hardcoding the length of `mib`

MFC after:	3 days
2017-01-09 00:25:33 +00:00
Peter Grehan
26e6e3e65d Use correct PCI device id for virtio-rng.
This prevented the device from attaching with a
Windows guest (most other guests use the device type
for matching)

PR:	212711
Submitted by:	jbeich
MFC after:	3 days
2017-01-08 20:58:58 +00:00
Peter Grehan
6e616e4f4b Make sure the 'Always-one' bit is always set to one,
in the first byte of the 3-byte mouse data report.
Plan9/9front requires this.

Switch over to using #defines for the data report bits.

Verified no regression on Win10/Fedora-live.

Reported and tested by: Trent Thompson (trentnthompson at gmail com)
MFC after:	1 week
2017-01-08 20:29:35 +00:00
Conrad Meyer
bb577bb699 chown/chgrp: Add SIGINFO handler
PR:		191884
Submitted by:	Dan McGregor <dan.mcgregor at usask.ca>
Reviewed by:	mjg@ (earlier version)
2017-01-08 06:58:42 +00:00
Warren Block
5589c6def0 Show that the crunchgen configuration file name is not optional.
PR:		215087
Submitted by:	Iblis Lin <iblis@hs.ntnu.edu.tw>
MFC after:	1 week
Sponsored by:	iXsystems
2017-01-06 18:04:34 +00:00
Konstantin Belousov
1c32456953 Use type-independent formats for printing nlink_t and ino_t.
Extracted from:	ino64 work by gleb, mckusick
Discussed with:	mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2017-01-06 16:59:33 +00:00
Enji Cooper
c02129e1cc Conditionalize wrap(3) use based on MK_TCP_WRAPPERS instead of
always building support into amd(8).

MFC after:	2 weeks
2017-01-06 04:22:25 +00:00
Enji Cooper
2486c641e7 Conditionalize wrap(3) use based on MK_TCP_WRAPPERS instead of
always building support into sendmail.

MFC after:	2 weeks
2017-01-06 04:16:03 +00:00
Enji Cooper
74410f9362 Conditionalize wrap(3) use based on MK_TCP_WRAPPERS instead of
always building support into rpcbind.

MFC after:	2 weeks
2017-01-06 04:13:08 +00:00
Enji Cooper
35c0323c64 Conditionalize wrap(3) use based on MK_TCP_WRAPPERS instead of
always building support into ypserv.

MFC after:	2 weeks
2017-01-06 04:10:33 +00:00
Jung-uk Kim
284829482e Merge ACPICA 20161222. 2017-01-05 21:28:25 +00:00
Enji Cooper
18d124d977 OS_getSystemUptime: use nitems for calculating the number of elements
in a sysctl mib instead of hardcoding the number 2

MFC after:	3 days
2017-01-05 09:28:38 +00:00
Hiroki Sato
1232b86014 Fix build when WITHOUT_INET6 is defined. 2017-01-05 03:25:16 +00:00
Enji Cooper
640b69be3a style cleanup
- bridge_pf_dump: use nitems instead of spelling it out longhand
- bridge_do_pfctl: sort variables by alignment for type

MFC after:	1 week
2017-01-04 17:54:44 +00:00
Enji Cooper
9577c300d8 bridge_do_pfctl: allocate mib_name dynamically using asprintf
This is being done to reduce wasted space, simplify complexity in
the code, and to quell a Coverity warning about buffer overruns.
warning about buffer overruns.

MFC after:	1 week
Reported by:	Coverity
CID:		1006736
2017-01-04 17:50:52 +00:00
Enji Cooper
758268dcae bridge_get_pfval: use nitems instead of spelling it out longhand
MFC after:	3 days
2017-01-04 17:38:18 +00:00