Commit graph

9697 commits

Author SHA1 Message Date
Kirk McKusick fe7121ec5b Update fsck(8) to ignore failures from a check program for a filesystem
when the fstab(5) entry for the filesystem has the "failok" attribute.

PR:           246201
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D33424

(cherry picked from commit c72372c693)
2022-01-02 14:12:14 -08:00
Konstantin Belousov ed21083462 swapon(8): adapt to the new swapoff(2) interface
(cherry picked from commit b49b6e0f95)
2021-12-20 02:29:11 +02:00
Konstantin Belousov 79f9a41be0 swapoff(8): add -f flag
(cherry picked from commit 1aa249c935)
2021-12-20 02:29:11 +02:00
Elyes HAOUAS 2b788e4a71 sbin/mount_fusefs/mount_fusefs.8: Fix typos
"expicitly" --> "explicitly"
"uknown" --> "unknown"

Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>

Pull Request:	https://github.com/freebsd/freebsd-src/pull/552

(cherry picked from commit c8a45820e0)
2021-12-14 14:48:35 -07:00
Kristof Provost 3836400a78 pfsync: fix incorrect enabling of defer mode
When we exposed the PFSYNCF_OK flag to userspace in 5f5bf88949 we
unintentionally caused defer mode to always be enabled.
The ioctl check only looked for nonzero, not for the PFSYNCF_DEFER flag.

Fix this check and ensure ifconfig sets the flag.

Reviewed by:	glebius
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D33244

(cherry picked from commit 73fd0eaf59)
2021-12-13 14:49:27 +01:00
Ed Maste 0f0d52fd6a sbin: build ping if at least one of INET & INET6 is enabled
It does not build (and serves no purpose) if neither is true (i.e.,
building WITHOUT_INET and WITHOUT_INET6).  Also add an explicit error
in ping to make this case clear.

PR:		260082
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit a4ef9e58bc)

OptionalObsoleteFiles: remove ping with INET & INET6 disabled

Reported by:	kevans
Fixes:		a4ef9e58bc ("sbin: build ping if at least one of...")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 0179739a00)
2021-12-12 20:28:58 -05:00
Alan Somers c775b6ebab ping: fix parsing of options including '4' and '6'
ping uses a two-pass option parser.  The first pass determines whether
ipv4 or ipv6 is desired, and the second parses the rest of the options.
But the first pass wrongly detects a '4' or '6' in an option's value as
a request to use ipv6 or ipv6 respectively, for example in an invocation
like "ping -c6 1.2.3.4".

Fix this confusion by including all options in the first round of
parsing, but ignoring those unrelated to ipv4/ipv6 selection.

PR:		258048
Reported by:	ghuckriede@blackberry.com
Submitted by:	ghuckriede@blackberry.com
MFC after:	2 weeks
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D32344

(cherry picked from commit 9ce201f2ee)
2021-12-12 20:27:12 -05:00
Mike Karels 4dbba5ab60 ifconfig: warn if setting an Internet address without mask
Add a postproc function for af_inet, and add interface flags as a
parameter.  Check there if setting an address without a mask unless
the interface is loopback or point-to-point, where mask is not really
meaningful; warn if so.  This will hopefully be an error in the future.

(cherry picked from commit d8237b9555)
2021-12-10 10:24:51 -06:00
Ed Maste 42f1df6099 gvinum: add deprecation notice
Vinum is a Logical Volume Manager that was introduced in FreeBSD 3.0,
and for FreeBSD 5 was ported to geom(4) as gvinum. gvinum has had no
specific development at least as far back as 2010, and has a number of
known bugs which are unlikely to be resolved.

Add a deprecation notice to raise awareness but state that vinum "may
not be" available in FreeBSD 14.  Either it will be removed and the
notice will be updated to "is not" available, or someone will step up
to fix issues and maintain it and we will remove the notice.

Reviewed by:	imp (earlier version)
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D29424

(cherry picked from commit b218441ac0)
2021-12-03 10:16:23 -05:00
Mark Johnston 6c5409c5d6 natd: Remove uneeded in_cksum.h includes
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 517373f723)
2021-12-01 07:42:13 -05:00
Konstantin Belousov 0619dbdfde ldconfig(8): check for no-args command line after options are parsed
(cherry picked from commit 3ede04c78c)
2021-12-01 03:07:19 +02:00
Konstantin Belousov a2a905f4d0 ldconfig: use libexec/rtld-elf/rtld_paths.h
(cherry picked from commit af91158706)
2021-12-01 03:07:19 +02:00
Konstantin Belousov 46e032b0b1 ldconfig(8): nostd/-s does nothing
(cherry picked from commit b828161d12)
2021-12-01 03:07:19 +02:00
Konstantin Belousov 00558493b7 ldconfig: start of cleanup
(cherry picked from commit 3f2c6f5598)
2021-12-01 03:07:19 +02:00
Konstantin Belousov 998529e594 ldconfig: remove a comment which is another remnant of a.out support
(cherry picked from commit 83511ce5c4)
2021-12-01 03:07:18 +02:00
Kristof Provost cfe9b890d5 pf: Introduce ridentifier
Allow users to set a number on rules which will be exposed as part of
the pflog header.
The intent behind this is to allow users to correlate rules across
updates (remember that pf rules continue to exist and match existing
states, even if they're removed from the active ruleset) and pflog.

Obtained from:	pfSense
MFC after:	3 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D32750

(cherry picked from commit 76c5eecc34)
2021-11-26 04:39:05 +01:00
Zhenlei Huang eaab06d53d devfs.rules: Correctly unhide pf in vnet jails
Revision 9e9be081d8 introduced a new devfs rule devfsrules_jail_vnet. It
includes rule devfsrules_jail which include other rules. Unfortunately
devfs could not recursively parse the action include and thus
devfsrules_jail_vnet will expose all nodes.

PR:		255660
Reviewed by:	kp
Obtained from:	Gijs Peskens <gijs@peskens.net>
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D32814

(cherry picked from commit 7acd322ebe)
2021-11-24 17:45:51 +01:00
Kirk McKusick 8b495114ea Allow GEOM utilities to specify a -v option.
Follow up for 3c8192eb8267

(cherry picked from commit e38717c128)
2021-11-23 15:04:33 -08:00
Kirk McKusick 0fdc76eaab Allow GEOM utilities to specify a -v option.
(cherry picked from commit 68bff4a07e)
2021-11-23 15:04:33 -08:00
Ed Maste cf09094e39 growfs: do not error if filesystem is already requested size
For some cloud/virtualization use cases it can be convenient to grow the
filesystem on boot any time the disk/partition happens to be larger, but
not fail if it remains the same size.

Continue to emit a message if we have no action to take, but exit with
status 0 if the size remains the same.

Reviewed by:	trasz
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32856

(cherry picked from commit 3f9acedb02)
2021-11-21 19:30:18 -05:00
Andriy Gapon 128a6d31f2 camcontrol: dump received data for MMC command even if it is unknown
For example, EXT_CSD can be read like this:
    # camcontrol mmcsdcmd 2:0:0 -c 8 -a 0 -f 0x35 -l 512
    CMD 8 arg 0 flags 35
    MMCIO: error 0, 00000900 00000000 00000000 00000000
    No command-specific decoder for CMD 8
    0000   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  |................|
    0010   39 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  |9...............|
    ...
    0100   00 00 00 00 00 00 00 00 01 08 00 01 02 02 00 00  |................|
    ...
    01e0   00 00 00 00 00 00 00 00 00 81 c7 00 00 01 03 07  |................|
    01f0   05 00 03 01 3f 3f 01 01 01 00 00 00 00 00 00 00  |....??..........|

(cherry picked from commit c01a46d4ac)
2021-11-21 12:00:42 +02:00
Warner Losh 706f4f705b vt: fix git mismerge
I made a mistaking in merging the final commits for the devctl changes. This
adds the 'hushed' variable and has the correct dates for the manuals.

Pointy hat to: imp

(cherry picked from commit 80f21bb039)
2021-11-18 22:10:07 -07:00
Warner Losh 1076b8d267 vt: fix typo
Notifcation -> Notification

(cherry picked from commit cc48eb70d1)
2021-11-18 22:10:07 -07:00
Warner Losh a82d7aeb3f vt: Add devctl message for bells
Generate VT events when the bell beeps. When coupled with disabling the
bell,this allows custom bells to be rung when we'd otherwise beep.

Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D32656

(cherry picked from commit 4ac3d08a96)
2021-11-18 21:52:22 -07:00
Ed Maste 8032812ac2 Update old iSCSI initiator man pages for removal from 14 and later
The old initiator was removed from main in 48cb3fee25 in advance of
FreeBSD 14.
2021-10-26 16:23:41 -04:00
Felix Johnson dcb7229460 camcontrol(8): Clean up references to removed symbols
Patch the manpage to remove references to devq_openings and devq_queued.
Document the allocated tag that has been added in the same commit. The
relevant code change was committed as r271588
(959ec2581b) by mav@.

PR:		223651
Reported by:	Bertrand Petit <bsdpr@phoe.frmug.org>

(cherry picked from commit d4cf7dc0df)
2021-10-25 11:58:27 -04:00
Kirk McKusick 010e3bc772 Avoid lost buffers in fsck_ffs.
Sponsored by: Netflix

(cherry picked from commit 4313e2ae44)
2021-10-23 21:24:08 -07:00
Gleb Smirnoff fba1554683 Mark sppp(4) as gone in FreeBSD 14. 2021-10-22 11:27:00 -07:00
Kristof Provost 35237559a6 pfctl: delay label macro expansion until after rule optimisation
We used to expand the $nr macro in labels into the rule number prior to
the optimisation step. This would occasionally produce incorrect rule
numbers in the labels.

Delay all macro expansion until after the optimisation step to ensure
that we expand the correct values.

MFC after:	1 week
Reported by:	Özkan KIRIK <ozkan.kirik@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D32488

(cherry picked from commit 09c7f23869)
2021-10-22 09:34:25 +02:00
Kristof Provost e089cda88b pfctl: Remove unused variable
MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 90dedf0fef)
2021-10-22 09:32:24 +02:00
Felix Johnson d8359af5b6 devd(8): Note default config file search locations
PR:		197003
Reported by:	Harald Schmalzbauer <bugzilla.freebsd@omnilan.de>

(cherry picked from commit bad324ace4)
2021-10-21 23:59:17 -04:00
Kristof Provost c5a340e864 pfctl: userspace adaptive syncookies configration
Hook up the userspace bits to configure syncookies in adaptive mode.

MFC after:	1 week
Sponsored by:	Modirum MDPay
Differential Revision:	https://reviews.freebsd.org/D32136

(cherry picked from commit 5062afff9d)
2021-10-06 10:46:54 +02:00
Kirk McKusick c926cf71d4 Eliminate an unnecessary rerun request in fsck_ffs.
(cherry picked from commit b31c5a2532)
2021-09-29 22:52:04 -07:00
Kristof Provost 34055dacee ipfw: Introduce dnctl
Introduce a link to the ipfw command, dnctl, for dummynet configuration.
dnctl only handles dummynet configuration, and is part of the effort to
support dummynet in pf.

/sbin/ipfw continues to accept pipe, queue and sched commands, but these can
now also be issued via the new dnctl command.

Reviewed by:	donner
MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D30465

(cherry picked from commit 0b95680e07)
2021-09-14 22:00:24 +02:00
Kristof Provost c298e0a0c2 pfctl: print counters in decimal
795d78a467 pfctl: Don't use PRIu64 mistakenly changed these to be
printed as hexadecimal numbers.

Reported by:	Florian Smeets
MFC after:	4 days
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 846a6e8f9a)
2021-09-08 09:28:29 +02:00
Kristof Provost 0c976ab9c0 pfctl: Don't use PRIu64
Rather than PRIu64 we can just treat the data as uintmax_t, and use %jx
instead.

MFC after:	1 week
Suggested by:	kib
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 795d78a467)
2021-09-08 09:28:25 +02:00
Mark Johnston 9c82ba2473 mdconfig: Add a regression test for mediasize rounding
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit ed59446b47)
2021-09-07 09:36:18 -04:00
Dimitry Andric a80a3afc3b Fix -Wformat errors in pfctl on 32-bit architectures
Use PRIu64 to printf(3) uint64_t quantities, otherwise this will result
in "error: format specifies type 'unsigned long' but the argument has
type 'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat]" on 32-bit
architectures.

Fixes:		80078d9d38
MFC after:	1 week

(cherry picked from commit 5b8f07b12f)
2021-09-06 15:42:53 +02:00
Kristof Provost 7c544989af pfctl: use libpfctl to retrieve pf status
Rather than call DIOCGETSTATUS ourselves use the new libpfctl functions.

MFC after:	1 week
Sponsored by:	Modirum MDPay
Differential Revision:	https://reviews.freebsd.org/D31697

(cherry picked from commit 80078d9d38)
2021-09-06 10:06:36 +02:00
Gordon Bergling aa9d47d9de Fix a common typo in man pages and src comments
- s/desciptor/descriptor/

(cherry picked from commit b1603638e3)
2021-09-02 08:13:48 +02:00
Kristof Provost d4c7ab9b1d pfctl: build fix
Fix the build issue introduced in e59eff9ad3 (pfctl: fix killing states by ID)

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 9ce320820e)
2021-08-31 09:47:47 +02:00
Kristof Provost b8110a4d73 pfctl: fix killing states by ID
Since the conversion to the new DIOCKILLSTATESNV the kernel no longer
exists the id and creatorid to be big-endian.
As a result killing states by id (i.e. `pfctl -k id -k 12345`) no longer
worked.

Reported by:	Özkan KIRIK
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit e59eff9ad3)
2021-08-31 09:47:20 +02:00
Luiz Otavio O Souza 09e25aff54 ipfw: use unsigned int for dummynet bandwidth
This allows the maximum value of 4294967295 (~4Gb/s) instead of previous
value of 2147483647 (~2Gb/s).

Reviewed by:	np, scottl
Obtained from:	pfSense
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31582

(cherry picked from commit 20ffd88ed5)
2021-08-26 14:05:26 +02:00
Franco Fichtner 75df39760c dhclient: remove patching of static values in BPF programs
Reviewed by:	markj

(cherry picked from commit 5851803f4b)
2021-08-26 07:46:11 -04:00
Franco Fichtner 3bcf919c4e dhclient: skip_to_semi() consumes semicolon already
When invalid statement is found the next statement is skipped even if it
is valid.

Reviewed by:	markj

(cherry picked from commit a313b5240a)
2021-08-26 07:46:01 -04:00
Kyle Evans 9ee8e86c0d init: execute /etc/rc.final after all user processes have terminated
This can be useful for, e.g., unmounting filesystems that were needed
for shutdown.

Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
X-NetApp-PR:	#63

(cherry picked from commit 4d15976919)
2021-08-26 01:42:00 -05:00
Fabian Kurtz 8751bff1a7 dhclient: support supersede statement for option 54
PR:		217978
Reported by:	Franco Fichtner <franco@opnsense.org>
Reviewed by:	markj
Obtained from:	OPNsense
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31503

(cherry picked from commit 0a539a0f00)
2021-08-25 16:54:05 -07:00
Gordon Tetlow 0729ba2f49 Fix remote code execution in ggatec(8).
Approved by:    so
Security:       SA-21:14.ggatec
Security:       CVE-2021-29630

(cherry picked from commit 515216929c40169cc72b62466ff9238682661613)
2021-08-24 10:50:50 -07:00
Gordon Bergling df82424970 md5(1): Fix a typo in the manual page
- s/compatibilty/compatibility/

(cherry picked from commit 0d71cea832)
2021-08-19 09:29:01 +02:00
Emmanuel Vadot e6a32ddf3f pkgbase: Add nfsiod to the FreeBSD-nfs package
Missed in 081fb64492

(cherry picked from commit e06b8f1128)
2021-08-16 18:15:47 +02:00