Commit Graph

8693 Commits

Author SHA1 Message Date
Sean Bruno
2d0730b243 Assuming that the intent (from the white space) is that the fprintf()
be executed in the if() conditional.  If its not supposed to be printed
inside the conditional, then the braces should be removed and the extra
tabs on the fprintf() should be removed.

Noted by cross compilation with gcc-mips.
2018-06-24 21:19:08 +00:00
Eitan Adler
71c6c44d8d dhclient: build with WARNS=6
- add static in a number of places
- initialize __progname rather than rely on magical extern values
- use nitems() instead of manually spelling it out
- unshadow 'idi'
- teach 'error' that it is '__dead2'
- add missing 'break'
2018-06-24 13:23:27 +00:00
Eitan Adler
aa571745a6 Makefiles: remove outdated comments 2018-06-24 09:39:40 +00:00
Eitan Adler
4b3dd106e6 newfs: clean up warnings
- remove param: unused since r95357.
- correct definition of usage
- add explicit fallthrough notice. The existing one doesn't work with
our selection of "implicit-fallthrough" strictness.

This results in WARNS=6 building on amd64, but not other arches
2018-06-24 05:40:42 +00:00
Kristof Provost
150182e309 pf: Support "return" statements in passing rules when they fail.
Normally pf rules are expected to do one of two things: pass the traffic or
block it. Blocking can be silent - "drop", or loud - "return", "return-rst",
"return-icmp". Yet there is a 3rd category of traffic passing through pf:
Packets matching a "pass" rule but when applying the rule fails. This happens
when redirection table is empty or when src node or state creation fails. Such
rules always fail silently without notifying the sender.

Allow users to configure this behaviour too, so that pf returns an error packet
in these cases.

PR:		226850
Submitted by:	Kajetan Staszkiewicz <vegeta tuxpowered.net>
MFC after:	1 week
Sponsored by:	InnoGames GmbH
2018-06-22 21:59:30 +00:00
Xin LI
b7d6282aae Don't bail out when we find primary and secondary bootblocks miscompare.
We do not have code to fix this situation, and the mismatch does not
prevent the kernel driver from consuming the file system, and some factory
formatted SD cards seem to have a garbage backup block.

This makes the code match to its comments (replacing pfatal with pwarn).

Inspired by:	NetBSD r1.13
Inspired by:	b47b16353f
MFC after:	2 weeks
2018-06-22 16:18:19 +00:00
Stephen J. Kiernan
ce16585796 This application (veriexecctl) handles reading a fingerprints file
containing paths, fingerprints, and optional option flags which in turn
get pushed into the MAC/veriexec meta-data store via the veriexec device.

The format of the fingerprints file is as follows:
path type fingerprint options

The type of fingerprint supported depends on what MAC/veriexec fingerprint
modules have been loaded into the system. The veriexecctl application is
able to determine which ones are available by consulting the
security.mac.veriexec.algorithms sysctl.

The following options are currently supported in MAC/veriexec and by the
veriexecctl application:

indirect
  If this option is set then the executable cannot be invoked directly, it
  can only be used as an interpreter in shell scripts.
file
  Indicates that the fingerprint is associated with a file, not an
  executable. Files have their fingerprints verified during open(2) and are
  automatically made read only. This option may be used to verify shared
  libraries have not been tampered with.
no_ptrace
  If this option is set then the executable cannot be traced with the
  ptrace(2) process tracing and debugging call.
trusted
  If this option is set then the executable is allowed to write to the
  mem(4) devices. By default, when verified execution is enforced, no
  process is allowed to write to the mem(4) devices.

The options are not case sensitive.

Reviewed by:	jtl, wblock
Obtained from:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D8575
2018-06-20 01:08:54 +00:00
Mariusz Zaborski
7672a0148f Convert cap_enter() < 0 && errno != ENOSYS to caph_enter() < 0.
No functional change intended.
2018-06-19 23:43:14 +00:00
Ed Maste
76db6c8773 gpart: add EFI alias for MBR partition scheme
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D15870
2018-06-17 20:10:48 +00:00
Eitan Adler
9fdff46b42 gvinum: revert WARNS change in Makefile
Architectures that passed on a local build universe, failed on
tinderbox. Revert the number change for now while I investigate.
2018-06-17 01:39:22 +00:00
Eitan Adler
5d9573acf2 ddb: unbreak ppc
usr/src/powerpc.powerpcspe/tmp/usr/include/strings.h:62:
warning: shadowed declaration is here
2018-06-17 00:00:24 +00:00
Eitan Adler
37e18df37d quotacheck: build with WARNS=3
WARNS++

Tested with amd64, arm64, i386, mips
2018-06-16 23:47:59 +00:00
Eitan Adler
e567c750ff gvinum: build with WARNS=6
This also removes an unused and uninitialized variable.

Tested with amd64, arm64, i386, mips
2018-06-16 23:45:59 +00:00
Eitan Adler
b33abb34b8 ddb: build with WARNS=6
Tested with amd64, arm64, i386, mips
2018-06-16 23:44:18 +00:00
Xin LI
0531ab7253 Added option to cluster-align the start of the root directory.
Obtained from:	Android
Obtained from:	052f275621
Obtained from:	8218b6aae9
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D15672
2018-06-15 06:03:40 +00:00
John Baldwin
44a230cd92 Exit with an error if a linker hints file can't be found.
Continuing with a NULL hints variable just triggers a segfault later on.
The other error cases in this function all exit for an error rather than
warning.

Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D15579
2018-06-14 22:31:30 +00:00
Warner Losh
f0f8a1af01 NVME support is only for x86 and powerpc64.
Implement MK_NVME now that the expression for where NVMe is
complicated. Default it to "yes" for x86 and powerpc64 and
no everywhere else. Use it in camcontrol to define WITH_NVME
for those platforms where we support nvme.

This should fix the newly introduced nvme files to camcontrol
which were building everywhere.

Pointy Hat To: imp
Sponsored by: Netflix
2018-06-14 01:15:19 +00:00
Warner Losh
6ee13c54da Make camcontrol identify work with nda devices
Both ATA and NVME have an identify command. They are completely
different, but to the user they are the same. Leverage nvmecontrol's
print_controller code to provide that functionality to camcontrol
identify. Query the path to see what kind of protocol it supports, and
send the most appropriate command down. Refactor nvme_print_dev a
little to make it easy to get the nvme cdata.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D15371
2018-06-13 22:00:08 +00:00
Warner Losh
e505b7eced Make it possible to use print_controller from another program
Rename print_controller to nvme_print_controller. Put it in its
own file for easy inclusion. Move util.c to be nc_util.c to not
conflict with camcontrol. add nvecontrol_ext.h to define shared
interfaces.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D15371
2018-06-13 22:00:02 +00:00
Eitan Adler
3330a6d984 dumpon(8): improve the examples a bit
While here, remove extraneous extraneous Pp

Reviewed by:	jhb (older version)
2018-06-13 09:28:47 +00:00
Li-Wen Hsu
22e6ecf367 Follow r333233, add fat32lba description to gpart(8)
Reviewed by:	emaste
MFC after:	3 days
X-MFC with:	r333233
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D15767
2018-06-12 01:50:58 +00:00
Warner Losh
37d6a8f458 Revert size limits.
The size limits came from a flawed understanding of dump records.
The real issue was that dump was bogusly interpreting c_count
sometimes. r334978 fixes that.
2018-06-11 20:38:30 +00:00
Warner Losh
b9c7cba522 Fix a bug in the counting of blks.
We shouldn't count the bytes set in c_addr for TS_CLRI and TS_BITS
nodes. Those block overload c_count to communicate how many blocks
follow, not now many c_addr spaces are used. Dump would dump core
(now) because memory layout moved around and we'd access elements past
the end to make a count.

Reviewed by: kib@
2018-06-11 20:38:26 +00:00
Warner Losh
e26ce92b55 Don't initialize c_count. We don't need to. 2018-06-11 19:35:41 +00:00
Warner Losh
a86534e007 Minor style polishing.
Declare c_count and initialize it with other ints.

Reported by: mjg@
2018-06-11 19:32:49 +00:00
Warner Losh
94e18833a8 Document the newly enforced 524288 inode restriction. 2018-06-11 19:32:45 +00:00
Warner Losh
2d518c6518 Add asserts to prevent overflows of c_addr.
Add some asserts that prevents the overflows of c_addr. This can't
happen, absent bugs. However, certain large filesystems can cause
problems. These have been prevented by r334968, but a solution
is needed. These asserts will help assure that solution is correct.

PR: 228807
Reviewed by: db
2018-06-11 19:32:36 +00:00
Diane Bruce
803fec5fdf Large file systems with inodes > 512K have been silently overflowing
c_addr in spcl. So check before we start dumping otherwise we can
end up with a corrupted dump.

PR:		228807
Submitted by:	db
Reviewed by:	imp
Approved by:	imp
2018-06-11 19:12:50 +00:00
Kirk McKusick
db9cb3e823 Ensure proper initialization of superblock.
Submitted by: Diane Bruce
2018-06-07 20:49:01 +00:00
Justin Hibbits
8244d89ce3 Build nvmecontrol on powerpc64
The nvme driver is compiled for powerpc64 already, and the one fix required
to build nvmecontrol on powerpc64 was fixed in r334754.
2018-06-07 04:03:19 +00:00
Justin Hibbits
2bac48c266 Print Maximum Data Transfer Size as a long rather than int
PowerPC has PAGE_SIZE as a long, not an int.  This causes the compiler to throw
a format mismatch warning on this print.  To work around the difference, print
it as a long instead of an int, and force the argument to a long.

Reviewed By: imp
Differential Revision: https://reviews.freebsd.org/D15653
2018-06-07 04:02:09 +00:00
Kristof Provost
fa1d4439f9 pf: Return non-zero from 'status' if pf is not enabled
In the pf rc.d script the output of `/etc/rc.d/pf status` or `/etc/rc.d/pf
onestatus` always provided an exit status of zero. This made it fiddly to
programmatically determine if pf was running or not.

Return a non-zero status if the pf module is not loaded, extend pfctl to have
an option to return an error status if pf is not enabled.

PR:		228632
Submitted by:	James Park-Watt <jimmypw AT gmail.com>
MFC after:	1 week
2018-06-06 19:36:37 +00:00
Conrad Meyer
f93497fe64 dhclient(8): allow to supersede interface-mtu option
In some cases broken DHCP servers might send invalid MTU value, so allow to
use 'supersede' in dhclient.conf to override this. When superseded value is
0, MTU value is not updated at all.

PR:		206721
Submitted by:	novel@
Reported by:	<jimp AT pfsense.org>
MFC after:	37 minutes (if you care about 11, please MFC to 11.2)
Relnotes:	yes (potentially surprising behavior change w/ broken dhcpd mtu)
Differential Revision:	https://reviews.freebsd.org/D15484
2018-05-31 19:36:24 +00:00
Sean Bruno
21a8e0b1d5 dumpon(8)
- fix the WITHOUT_CRYPTO buildworld case.  Its rare, but some of us do
  build this way.

Sponsored by:	Limelight Networks
2018-05-29 21:52:13 +00:00
Mark Johnston
fe1ba25039 The extension for zstd-compressed files is ".zst".
Reported by:	manu
2018-05-29 16:04:53 +00:00
Eitan Adler
73d1ecdc98 kldstat: align "Size" to the right
This change also makes alignment and spacing an explicit number rather
than a bunch of spaces.

Reviewed by:	mmacy
Requested by:	Yuri Pankov <yuripv@yuripv.net>
2018-05-26 05:15:07 +00:00
Matt Macy
3741a56c31 devd: drop WARNS back down to 3 until 6 actually works with GCC 2018-05-24 01:12:06 +00:00
Eitan Adler
f405a1bea1 devd: Move variable declaration to header
Reminder by:	imp
2018-05-23 13:48:16 +00:00
Eitan Adler
d14732d366 kldstat: align size to the right
This makes it easier to compare numbers directly.

PR:		215747
Submitted by:	"Alexander von Gernler" <grunk@pestilenz.org>
2018-05-23 12:10:16 +00:00
Eitan Adler
aa677d07a1 md5: perform compare case-insenstive
md5 generates a md5 hash lowercase, but it might be provided in
uppercase. Allow this.

PR:		205598
Reported by:	ohauer
MFC After:	2 weeks
2018-05-23 11:45:46 +00:00
Eitan Adler
6d6e62dcc3 dumpon: point to better kernel debug symbols.
The objdir is temporary, and the current example points to GENERIC.
Instead point to the installed location of the debug symbols that are
supposed to match the kernel you are using.

PR:		223993
Submitted by:	Trond.Endrestol@ximalas.info
2018-05-23 10:45:32 +00:00
Eitan Adler
695a3b29ff devd: Unbreak build
I'm not quite sure why this wasn't caught before. Most likely due to
some generated file not being properly cleaned.

Fix build by just hiding the warnings that `-i` was supposed to fix.

Tested with clang, gcc9, gcc7
2018-05-23 10:03:09 +00:00
Eitan Adler
e8d9a1edb3 devd: allow build to complete using g++ 2018-05-23 07:44:50 +00:00
Eitan Adler
0bc60783da devd: compile at WARNS=6
Verified with "make universe TARGETS='amd64 arm arm64 i386 sparc64'"
2018-05-23 07:39:05 +00:00
Eitan Adler
958160f3ec devd: correct two warnings
- catching a polymorphic type by value
- "output between 16 and 95 bytes into a destination of size 80"
2018-05-23 07:39:02 +00:00
Andrey V. Elsukov
7a07dfbc7c Make the name of option that toggles IFCAP_HWRXTSTMP capability to
match the name of this capability. It was added recently and is not merged
to stable branch, so I hope it is not too late to change the name.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D15475
2018-05-18 12:12:24 +00:00
Ed Maste
408c1ff8f4 Clarify that boot_mute / boot -m mutes kernel console only
Perhaps RB_MUTE could mute user startup (rc) output as well, but right
now it mutes only kernel console output, so make the documentation match
reality.

PR:		228193
Sponsored by:	The FreeBSD Foundation
2018-05-16 02:15:18 +00:00
Ed Maste
c44e7d2f2f gpart.8: list all options in table form for each command
Previously gpart's man page listed some command options in prose, and
some in table form, which made it more difficult to use as a reference.

Reviewed by:	bcr
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D15135
2018-05-11 12:58:36 +00:00
Ed Maste
6c967db174 gpart.8: sort suboptions per mdoc(7)
Alphabetical order, uppercase before lowercase for each letter and with
no regard to whether an option takes an argument.

Sponsored by:	The FreeBSD Foundation
2018-05-11 12:57:25 +00:00
Andrey V. Elsukov
51d5442fef Fix the printing of rule comments.
Change uint8_t type of opcode argument to int in the print_opcode()
function. Use negative value to print the rest of opcodes, because
zero value is O_NOP, and it can't be uses for this purpose.

Reported by:	lev
MFC after:	1 week
2018-05-10 12:25:01 +00:00