Commit graph

20424 commits

Author SHA1 Message Date
Alexander Motin 3aebcb9ecb iostat: Restore lost spaces after tout
MFC after:	2 weeks
2023-11-15 23:45:22 -05:00
Alexander Motin d282baddb0 Add interface NVME to devstat
This allows to list only NVMe devices in systat, iostat, vmstat, etc.
Previously those were counted as OTHER.
2023-11-15 23:03:40 -05:00
John Baldwin fd9ae9ac04 pkg: Allocate a suitably-sized string for the local ABI
Previously the local ABI string was written to an on-stack buffer and
the pointer to that buffer was saved in a global before the function
returned.  This had two issues: c[ABI].val pointed to a
no-longer-valid on-stack buffer after config_init returned, and the
string could potentially be truncated.  Fix both of those by changing
pkg_get_myabi to return a pointer to a string allocated by asprintf.

Note that the allocated string is left in the global config array
until it is implicitly freed on process exit.

Reported by:	GCC 13 -Wdangling-pointer
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D42623
2023-11-15 16:53:53 -08:00
John Baldwin cc61bf9ecc snmp_wlan: Fix a couple of type mismatches in function prototypes
Reported by:	GCC 13 via -Wenum-int-mismatch
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D42582
2023-11-14 18:36:03 -08:00
John Baldwin 5fc8ed9313 makefs: Quiet a -Wdangling-pointer warning in cd9660_generate_path_table
This function temporarily stores a pointer to an on-stack variable (a
TAILQ_HEAD of a temporary list) into a global variable (*n).

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D42581
2023-11-14 18:35:44 -08:00
John Baldwin c06962057b makefs cd9660: Unexpand a few TAILQ macros
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D42580
2023-11-14 18:35:27 -08:00
Mark Johnston 4e288572b8 bhyve: Fix the GDB_LOG build
MFC after:	1 week
Fixes:	7d9ef309bd ("libvmmapi: Add a struct vcpu and use it in most APIs.")
2023-11-11 12:15:30 -05:00
Alexander Motin 105c7c4b8d iostat: Tune formatting for higher disk speeds
MFC after:	2 weeks
2023-11-10 18:35:38 -05:00
Kyle Evans 8f2848eafa crunchgen: fix "keep" for an ELF world, break it out
"keep" currently adds a leading underscore, which hasn't been useful or
accurate since a.out days.  Preserve the symbol name as it's given
rather than mangle it to match ELF-style symbol names.

This was partially fixed back in
6cd35234a0 ("Assume ELF-style symbol names now.") for crunchgen, but
the keeplist wasn't changed to match it.

While we're here, break it out to bsd.crunchgen.mk for later use in
bsdbox.

Reviewed by:	adrian, imp
Differential Revision:	https://reviews.freebsd.org/D42499
2023-11-09 22:33:58 -06:00
Mark Johnston 7e5002e3d6 makefs/zfs: Add a regression test which checks file access permissions
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2023-11-08 07:18:58 -05:00
Mark Johnston 50565cf514 makefs/zfs: Don't set ZFS_NO_EXECS_DENIED in file flags
This flag was leftover from testing and should have been removed.

PR:		274938
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2023-11-08 07:04:12 -05:00
Dag-Erling Smørgrav f7d16a627e certctl: Convert line endings before inspecting files.
This ensures that certificate files or bundles with DOS or Mac line
endings are recognized as such and handled identically to those with
Unix line endings.

PR:		274952
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D42490
2023-11-07 20:53:09 +01:00
Mark Johnston 3e356fb885 crashinfo: Get local variable values in the gdb backtrace
This should make crash reports a bit more useful without having to ask
for additional information.

Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42465
2023-11-06 14:59:10 -05:00
Elyes Haouas e5f905c72a yppush: Remove return statement at the end of void functions
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
2023-11-06 15:07:10 -04:00
Elyes Haouas 29ca151586 rpcbind: Remove return statement at the end of void functions
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
2023-11-06 15:07:10 -04:00
Elyes Haouas 6e90567dde rpc.ypxfrd: Remove return statement at the end of void functions
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
2023-11-06 15:07:10 -04:00
Elyes Haouas b5ebd8bb4e ypserv: Remove return statement at the end of void functions
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
2023-11-06 15:07:10 -04:00
Elyes Haouas e9e666f7de keyserv: Remove return statement at the end of void functions
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
2023-11-06 15:07:10 -04:00
Elyes Haouas be5a2c70b1 rtadvd: Remove return statement at the end of void functions
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
2023-11-06 15:07:10 -04:00
Ed Maste 13a9745746 crashinfo: remove unused /usr/bin/gdb support
We have not had gdb 6.1 in the base system for some time; there is no
need to check for it.

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34478
2023-11-04 21:45:15 -04:00
Dan Mcgregor 7c5146da12 mountd: Add support for spaces in exported directories
The previous code would correctly parse strings including quotation
marks (") or backslash (/), but the tests when creating the export
includes them in the final string. This prevents exporting paths
with embedded spaces, for example "/exports/with space". Trying
results in log lines resembling:

mountd[1337]: bad exports list line '/exports/with\ space':
    /exports/with\ space: lstat() failed: No such file or directory.

Turns out that when creating its exports list, zfs escapes strings
in a format compatible with vis(3). Since I expect that zfs sharenfs
is the dominating use case for generating an exports list, use
strunvis(3) to parse the export path. The result is lines like the
following allowing spaces:

/exports/with\040space -network 192.168.0 -mask 255.255.255.0

A man page update will be done as a separate commit.

MFC after:	1 month
Reviewed by:	rmacklem
Differential Revision:	https://reviews.freebsd.org/D42432
2023-11-04 15:07:56 -07:00
Ed Maste 5f4c09dd85 Track upstream project rename in contrib/blocklistd
Upstream is now https://github.com/zoulasc/blocklist/.  Rename the
contrib directory and update Makefiles to match, in advance of the next
vendor branch update.

Sponsored by:	The FreeBSD Foundation
2023-11-03 16:53:04 -04:00
Alexander Motin 7bca09e2bb mpsutil: Add higher PCIe speeds.
There are already PCIe Gen4 HBAs, reported improperly.

MFC after:	1 week
2023-11-03 11:49:59 -04:00
Dan McGregor d7f9a421df bhyve(8): fix manpage formatting
In commit 67c26eb2a5 a stray ".El" was introduced, breaking
formatting of options.

Reviewed by:	corvink, markj
Fixes:		67c26eb2a5 ("bhyve: add cmdline option for TPM emulation")
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D42434
2023-11-02 10:50:10 -04:00
Warner Losh 1fc478fb48 bhyve: ps2 implement command 0xf6
Implement PS2 Keyboard command 0xf6, which is "SET DEFAULTS". This is
the same as 0xf5 (DISABLE KEYBOARD), but without disabling the keyboard
(since that resets all the defaults as a side effect). Normally, we
clear the fifo when we re-enable the keyboard. However, since this
leaves the keyboard enabled, clear the fifo as part of this command and
send an ack.

Linux's keyboard driver sends this command on reboot. Other commands
enable / reset the kebyoard, so it doesn't matter too much this isn't
implemented for booting, eg ubuntu.

Sponsored by:		Netflix
Reviewed by:		corvink, markj
Differential Revision:	https://reviews.freebsd.org/D42384
2023-10-31 14:52:22 -06:00
Brooks Davis 6f7c45056f tzsetup: make UTC the first (default) region
Many sysadmins prefer to configure their systems to UTC and it's a
reasonable default when installing, making it easier to get a usable
system by just hitting <return> repeatidly.

Renumber UTC to 0 to preserve the finger memory of those selecting a
region by shortcut.

Reviewed by:	jrtc27, emaste
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D42383
2023-10-30 23:35:21 +00:00
Stephen J. Kiernan 5e3190f700 dirdeps: Update Makefile.depend* files with empty contents
Some Makefile.depend* files were committed with no contents or empty
DIRDEPS list, but they should have DIRDEPS with some contents.
2023-10-29 17:01:04 -04:00
Warner Losh 731f91c077 efibootmgr: -C isn't implemented
-C isn't implemented, so just errx out until it is. It's not listed in
the man page, but is parsed for compatibility with the Linux
efibootmgr(8) command.

Sponsored by:		Netflix
2023-10-26 22:01:16 -06:00
Warner Losh 98d2608a2a efibootmgr: support '-b bootXXXX' as an alias for '-b XXXX'
Sponsored by:		Netflix
2023-10-26 22:01:16 -06:00
Gleb Smirnoff f407a72a50 bhyve: fix arguments to ioctl(VMIO_SIOCSIFFLAGS)
ioctl(2)'s with integer argument shall pass command argument by value,
not by pointer.  The ioctl(2) manual page is not very clear about that.
See sys/kern/sys_generic.c:sys_ioctl() near IOC_VOID.

Reviewed by:		markj
Differential Revision:	https://reviews.freebsd.org/D42366
Fixes:			fd8b9c73a5
2023-10-26 02:59:21 -07:00
Rick Macklem 82ea0132c8 gssd: Add support for the new upcall required by commit 428879dc91
Commit 428879dc91 adds a requirement for a new upcall for the
gssd(8).  This patch adds that upcall.

Unfortunately, the old gssd.c would not build against the new
patched gssd.x.

This patch will fix the build.

MFC after:	1 month
2023-10-23 14:41:26 -07:00
R. Christian McDonald 934a24e55a ndp: improve -c and -d handling in ndp_netlink
This patch restores/fixes some of the behavior present in pre-netlink ndp(8).

 1. Deleting a local address now correctly returns EPERM (instead of
    ENOENT)
 2. ndp -c no longer dumps the entire table while complaining about
    local addresses
 3. Return exit code when deleting entry (e.g. trying ndp -d on a local
    address is an error)

Reviewed by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D42316
2023-10-23 22:58:29 +02:00
Mitchell Horne bcde15f5f8 ofwdump(8): cross-reference openfirm(4)
This utility relies on the openfirm(4) pseudo-device.

Sponsored by:	The FreeBSD Foundation
2023-10-23 14:56:29 -03:00
Mark Johnston ef067b5799 makefs/zfs: Update dd_used_breakdown after writing the MOS
Fixes:	96092bf910 ("makefs/zfs: Fill out dd_used_breakdown fields in DSL directories")
Sponsored by:	The FreeBSD Foundation
2023-10-23 12:29:20 -04:00
Mark Johnston 9f9d18d61e makefs/zfs: Add a regression test which checks the 'used*' properties
PR:		274613
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2023-10-23 11:15:00 -04:00
Mark Johnston 96092bf910 makefs/zfs: Fill out dd_used_breakdown fields in DSL directories
This is required for the "used", "usedds" and "usedchild" dataset
properties to be displayed.

PR:		274613
Reported by:	Mike Tancsa <mike@sentex.net>
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2023-10-23 11:12:14 -04:00
Alfonso S. Siciliano c36b3dbc99
bsdconfig: Restore bsddialog
Readd bsddialog(1) to bsdconfig(8).

This can be considered an increment not a replacement: `$DIALOG=dialog'
restores dialog(1), no change for Xdialog(1). An exception is if an
error occurs, bsddialog(1) replaces dialog.
2023-10-23 16:11:54 +02:00
Alfonso S. Siciliano 0f8b2ba6c6
bsdconfig: Revert bsddialog support
This commit reverts "bsdconfig(8): add bsddialog(1) support"
30e9abf2fc because it is not intended for
the current bsddialog 1.0 version.
2023-10-23 15:59:31 +02:00
Devin Teske 608da65de9 bsdconfig: Add `network' keyword
Configuring a FreeBSD laptop, my fingers kept wanting to type
`bsdconfig network' and I could not figure out why this was not working.
Took me a second to realize that the shortcut was `bsdconfig networking'
for where I wanted to go.

Reviewed by:	jhb
Approved by:	jhb
Differential Revision:	https://reviews.freebsd.org/D42242
2023-10-22 11:45:36 -07:00
Brooks Davis def6ee77db certctl.8: document LOCALBASE
Document the LOCALBASE variable and that it's set to user.localbase by
default.  Update path defaults that depend on it.

Reviewed by:	bcr
Differential Revision:	https://reviews.freebsd.org/D40529
2023-10-20 20:52:10 +01:00
Dag-Erling Smørgrav 87945a0829 certctl: Fix recent regressions.
- If an untrusted certificate is also found in the list of trusted
  certificate, issue a warning and skip it, but don't fail.
- Split on -+BEGIN CERTIFICATE-+ instead of "Certificate:" since
  that's what we're really looking for.

Also fix a long-standing bug: .crl files are not certificates, so we
should not include them when searching for certificates.

Reported by:	madpilot, netchild, tijl
Reviewed by:	netchild, allanjude
Differential Revision:	https://reviews.freebsd.org/D42276
2023-10-20 12:29:40 +02:00
Alfonso S. Siciliano e44751530e
bsdinstall hostname: Restore bsdconfig API
Restore bsdconfig API to handle hostname dialog because bsddialog 1.0
matches all features required by bsdconfig(1). Implicitly this commit
restores also Xdialog(1) for this script.

This commit reverts:
 - "bsdinstall hostname: Replace dialog with bsddialog"
   6368dcb292
 - "bsdinstall(8) hostname: Update for bsddialog 0.3"
   5f3ec44e7e.

The script continues to use bsddialog(1) by default via $DIALOG in
bsdconfig(1).
2023-10-19 12:59:49 +02:00
Ed Maste 3d44241546 freebsd-update: allow user to break out of conflict resolution loop
When a conflict marker is found during update allow the user to confirm
they want it to remain in the file.

Suggested by:	Tim Hogard
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Fixes: ceb5f28ba5 ("freebsd-update: re-edit files if merge confli...")
Differential Revision: https://reviews.freebsd.org/D38896
2023-10-18 12:17:33 -04:00
Ed Maste 6b27e1f2ea freebsd-update: for rollback, first create directories
rollback_files() tried to install files before creating the directories
for those files.  In some cases this is due to special handling to
install certain classes of files earlier than others.

Just create all directories up front when performing rollback.

PR:		273950
Reviewed by:	dim
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D42020
2023-10-18 10:52:59 -04:00
Ed Maste c0f5244316 freebsd-update: handle directories changing to files
Further to f6d37c9ca1 ("freebsd-update: handle file -> directory on
upgrade"), handle the reverse case of a directory changing to a file.
We may not encounter this case on upgradess (before freebsd-update is
retired) but it is needed to support rollback.

PR:		273950
Reviewed by:	dim
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41945
2023-10-18 10:48:58 -04:00
Fernando Apesteguía b9cf989234 bsdinstall: Fail nicely in jail target
If the directory is empty we fail with a message regarding mkdir in which
the empty directory can't be seen because it is not quoted.

Show a nice message so the user knows what is going on.

Reviewed by:		bapt@
Differential Revision:	https://reviews.freebsd.org/D42252
2023-10-18 09:46:05 +02:00
R. Christian McDonald 2bb78b46e0 ndp: fix timestamp display output
The current xo_format string is incorrect. This restores the display
format prior to libxo-ification work while also explicitly marking
tv_sec and tv_usec as encoded output only.

MFC after:	1 week
Reviewed by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D42269
2023-10-17 19:01:38 +02:00
Vitaliy Gusev 7de582874e bhyve: Remove init_snapshot() and initialize static vars
vCPU threads are starting before init_snapshot() is called. That can lead
to corruption of vcpu_lock userspace mutex (snapshot.c) and then VM hangs
in acquiring that mutex.

init_snapshot() initializes only static variables (mutex, cv) and that
code can be optimized and removed.

Fixes:		9a9a248964 ("bhyve: init checkput before caph_enter")
Reviewed by:	markj
MFC after:	1 week
Sponsored by:	vStack
2023-10-17 14:26:51 -04:00
Konstantin Belousov 56c44bd92e automount(8): when flushing autofs, specify fsid
Which should avoid situation where flushed filesystem is not autofs,
because it was mounted over autofs mp.

Reported and tested by:	Andrew "RhodiumToad" Gierth <andrew@tao11.riddles.org.uk>
PR:	272446
Reviewed by:	mjg
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D42023
2023-10-17 19:40:50 +03:00
Andrew Gierth 21b8e363c4 automount: check for mounted-over autofs instances on flush
PR:	272446
Reviewed by:	kib
MFC after:	1 week
Differential revision: https://reviews.freebsd.org/D40961
2023-10-17 19:40:45 +03:00