diff --git a/cddl/usr.sbin/zfsd/zfsd.8 b/cddl/usr.sbin/zfsd/zfsd.8 index d6b0e1d4bd22..d668e0e8ee9e 100644 --- a/cddl/usr.sbin/zfsd/zfsd.8 +++ b/cddl/usr.sbin/zfsd/zfsd.8 @@ -154,7 +154,6 @@ will log interesting events and its actions to syslog with facility .Em daemon and identity .Op zfsd . -.El .Sh FILES .Bl -tag -width a -compact .It Pa /var/db/zfsd/cases diff --git a/contrib/capsicum-test/capsicum-freebsd.h b/contrib/capsicum-test/capsicum-freebsd.h index 96ceb9b6d5f1..da7bb38f073b 100644 --- a/contrib/capsicum-test/capsicum-freebsd.h +++ b/contrib/capsicum-test/capsicum-freebsd.h @@ -59,10 +59,9 @@ typedef unsigned long cap_ioctl_t; // Too many links #define E_TOO_MANY_LINKS EMLINK -// TODO(FreeBSD): uncomment if/when FreeBSD propagates rights on accept. -// FreeBSD does not generate a capability from accept(cap_fd,...). -// https://bugs.freebsd.org/201052 -// #define CAP_FROM_ACCEPT +// As of commit 85b0f9de11c3 ("capsicum: propagate rights on accept(2)") +// FreeBSD generates a capability from accept(cap_fd,...). +#define CAP_FROM_ACCEPT // TODO(FreeBSD): uncomment if/when FreeBSD propagates rights on sctp_peeloff. // FreeBSD does not generate a capability from sctp_peeloff(cap_fd,...). // https://bugs.freebsd.org/201052 diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 67dc71fbfda4..8cac5e8d55e2 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -1097,6 +1097,8 @@ .. du .. + env + .. factor .. file diff --git a/lib/libc/gen/exec.3 b/lib/libc/gen/exec.3 index ce289ebf502a..41ab18fa89ef 100644 --- a/lib/libc/gen/exec.3 +++ b/lib/libc/gen/exec.3 @@ -49,7 +49,6 @@ .Fn execlp "const char *file" "const char *arg" ... NULL .Ft int .Fn execle "const char *path" "const char *arg" ... NULL "char *const envp[]" -.Fc .Ft int .Fn exect "const char *path" "char *const argv[]" "char *const envp[]" .Ft int diff --git a/lib/libc/gen/makecontext.3 b/lib/libc/gen/makecontext.3 index bcf836979962..198c541d40a6 100644 --- a/lib/libc/gen/makecontext.3 +++ b/lib/libc/gen/makecontext.3 @@ -152,6 +152,7 @@ via .Fn makecontext ; portable applications should not rely on the implementation detail that it may be possible to pass pointer arguments to functions. +.Ef .Sh HISTORY The .Fn makecontext diff --git a/lib/libc/posix1e/acl_cmp_np.3 b/lib/libc/posix1e/acl_cmp_np.3 index a8dca4959d2e..5e47df833d0d 100644 --- a/lib/libc/posix1e/acl_cmp_np.3 +++ b/lib/libc/posix1e/acl_cmp_np.3 @@ -63,6 +63,7 @@ to the corresponding value: .Bl -tag -width Er .It Bq Er EINVAL Either first or second argument does not point to a valid ACL. +.El .Sh SEE ALSO .Xr acl 3 , .Xr posix1e 3 diff --git a/lib/libc/posix1e/acl_extended_file_np.3 b/lib/libc/posix1e/acl_extended_file_np.3 index 26572be9d2b3..4673e9c3e417 100644 --- a/lib/libc/posix1e/acl_extended_file_np.3 +++ b/lib/libc/posix1e/acl_extended_file_np.3 @@ -75,6 +75,7 @@ to the corresponding value: .Bl -tag -width Er .It Bq Er EACCES Search permission is denied for a component of the path prefix. +.El .Sh SEE ALSO .Xr extattr_get_file 2 , .Xr posix1e 3 diff --git a/lib/libcasper/services/cap_grp/cap_grp.3 b/lib/libcasper/services/cap_grp/cap_grp.3 index 9647b1936b0c..578d8edffbfa 100644 --- a/lib/libcasper/services/cap_grp/cap_grp.3 +++ b/lib/libcasper/services/cap_grp/cap_grp.3 @@ -59,7 +59,7 @@ .Fn cap_getgrgid_r "cap_channel_t *chan" "gid_t gid" "struct group *grp" "char *buffer" "size_t bufsize" "struct group **result" .Ft int .Fn cap_setgroupent "cap_channel_t *chan" "int stayopen" -.Ft int +.Ft int .Fn cap_setgrent "cap_channel_t *chan" .Ft void .Fn cap_endgrent "cap_channel_t *chan" diff --git a/lib/libpathconv/abs2rel.3 b/lib/libpathconv/abs2rel.3 index 634f294800e4..9240ef1662e2 100644 --- a/lib/libpathconv/abs2rel.3 +++ b/lib/libpathconv/abs2rel.3 @@ -93,6 +93,7 @@ The .Fa size argument is greater than zero but smaller than the length of the pathname plus 1. +.El .Sh SEE ALSO .Xr rel2abs 3 .Sh AUTHORS diff --git a/lib/libpathconv/rel2abs.3 b/lib/libpathconv/rel2abs.3 index f889f427450d..1f607fd739e1 100644 --- a/lib/libpathconv/rel2abs.3 +++ b/lib/libpathconv/rel2abs.3 @@ -90,6 +90,7 @@ argument is zero. The .Fa size argument is greater than zero but smaller than the length of the pathname plus 1 +.El .Sh SEE ALSO .Xr abs2rel 3 .Sh AUTHORS diff --git a/sbin/init/init.8 b/sbin/init/init.8 index 4f988438cd35..8f6e78b79d7b 100644 --- a/sbin/init/init.8 +++ b/sbin/init/init.8 @@ -396,6 +396,7 @@ back to the default, so that the .Pa /etc/rc script is executed with the standard shell .Pa /bin/sh . +.El .Sh FILES .Bl -tag -width /var/log/init.log -compact .It Pa /dev/console diff --git a/sbin/pflowctl/pflowctl.8 b/sbin/pflowctl/pflowctl.8 index 8c4142f31396..407947613f6f 100644 --- a/sbin/pflowctl/pflowctl.8 +++ b/sbin/pflowctl/pflowctl.8 @@ -83,6 +83,7 @@ and 10.0.0.2:1234 as destination: .Bd -literal -offset indent # pflowctl -s pflow0 src 10.0.0.1 dst 10.0.0.2:1234 .Ed +.El .Sh SEE ALSO .Xr netintro 4 , .Xr pf 4 , diff --git a/share/man/man4/ahc.4 b/share/man/man4/ahc.4 index 8bc689cb8395..38712c1f08b6 100644 --- a/share/man/man4/ahc.4 +++ b/share/man/man4/ahc.4 @@ -155,7 +155,6 @@ units 0, 2, and 5. A value of 0x8a enables it for units 1, 3, and 7. .Pp Note that controllers can be dynamically configured through a device hint documented below. -.El .Ed .Sh BOOT OPTIONS The following options are switchable by setting values in diff --git a/share/man/man4/ahd.4 b/share/man/man4/ahd.4 index d7404662a06b..c173a8cef619 100644 --- a/share/man/man4/ahd.4 +++ b/share/man/man4/ahd.4 @@ -107,7 +107,6 @@ disconnection, and the host adapter's .Tn SCSI ID. -.El .Sh CONFIGURATION OPTIONS To statically configure one or more controllers to assume the target role: .Pp @@ -120,6 +119,7 @@ units 0, 2, and 5. A value of 0x8a enables it for units 1, 3, and 7. Note that controllers can be dynamically configured through a device hint documented below. +.Ed .Sh BOOT OPTIONS The following options are switchable by setting values in .Pa /boot/device.hints . diff --git a/share/man/man4/gve.4 b/share/man/man4/gve.4 index 95c125507bd5..a674d6b64803 100644 --- a/share/man/man4/gve.4 +++ b/share/man/man4/gve.4 @@ -127,7 +127,6 @@ Tx queue-specific allocation failures: .It "Failed to alloc desc ring for tx ring %d" .It "Failed to vmap fifo, qpl_id = %d" .El -.El .Pp The following messages are recorded when the interface detach fails: .Bl -diag @@ -200,7 +199,6 @@ does not support the transmission of VLAN-tagged packets. All VLAN-tagged traffic is dropped. .Sh SUPPORT Please email gvnic-drivers@google.com with the specifics of the issue encountered. -.El .Sh SEE ALSO .Xr ifconfig 8 , .Xr netstat 8 diff --git a/share/man/man4/iwlwififw.4 b/share/man/man4/iwlwififw.4 index a377f6b51f78..debd0cda36b5 100644 --- a/share/man/man4/iwlwififw.4 +++ b/share/man/man4/iwlwififw.4 @@ -46,10 +46,10 @@ driver. .Bl -column -compact "Vendor" "Device" "Subv. " "Subd. " "Firmware-Prefix" .It Ar Name .It Ar Vendor Ta Ar Device Ta Ar Subv. Ta Ar Subd. Ta Ar Firmware-Prefix -.% --------------------------------------------------------------------- -.% This list is manually generated from a sysctl and post-processing. -.% Edits will be overwritten on next update. -.% --------------------------------------------------------------------- +.\" --------------------------------------------------------------------- +.\" This list is manually generated from a sysctl and post-processing. +.\" Edits will be overwritten on next update. +.\" --------------------------------------------------------------------- .It "" .It Intel(R) Dual Band Wireless AC 7260 .It 0x8086 Ta 0x08b1 Ta any Ta 0x4070 Ta iwlwifi-7260 @@ -1340,7 +1340,7 @@ driver. .It "" .It Intel(R) TBD Sc device .It 0x8086 Ta any Ta any Ta any Ta (null) -.% --------------------------------------------------------------------- +.\" --------------------------------------------------------------------- .El .Pp .Em Note: diff --git a/share/man/man4/mem.4 b/share/man/man4/mem.4 index 68969d281532..595cb8a60e5f 100644 --- a/share/man/man4/mem.4 +++ b/share/man/man4/mem.4 @@ -198,7 +198,6 @@ should be set to to update an existing or establish a new range, or to .Dv MEMRANGE_SET_REMOVE to remove a range. -.El .Ss Live Kernel Dumps .Pp The diff --git a/share/man/man4/splash.4 b/share/man/man4/splash.4 index b001663c4fa5..8de18434c52f 100644 --- a/share/man/man4/splash.4 +++ b/share/man/man4/splash.4 @@ -253,6 +253,7 @@ and include the following lines: .Bd -literal -offset indent splash="/boot/images/freebsd-logo-rev.png" boot_mute="YES" +.Ed .\".Sh DIAGNOSTICS .Sh SEE ALSO .Xr vidcontrol 1 , diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index 9626e3ef79fd..2897efffd780 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -5008,7 +5008,7 @@ variable is set to .Dq Li YES , this particular service is started in a service jail named -.Va svcj- Ns Ar name Ac . +.Va svcj- Ns Ar name . The .Va svcj_all_enable @@ -5039,7 +5039,6 @@ but can be enabled via setting .Va sshd_svcj to .Dq Li YES . -.El .Sh FILES .Bl -tag -width "/etc/defaults/rc.conf" -compact .It Pa /etc/defaults/rc.conf diff --git a/share/misc/bsd-family-tree b/share/misc/bsd-family-tree index 0849e883e2c3..7cc017c6d47d 100644 --- a/share/misc/bsd-family-tree +++ b/share/misc/bsd-family-tree @@ -456,14 +456,17 @@ FreeBSD 5.2 | | | | | | | | | | | | | | | FreeBSD | | NetBSD | | | | | 13.3 | | 9.4 | | | - | | | | | | | - | | | *--NetBSD | | | - | | | | 10.0 | | | - | | | | | | | - | | | | | OpenBSD 7.5 | - | | | | NetBSD | | - | FreeBSD | | 8.3 | | - | 14.1 | | | | + | | | | | | | | + | | | | *--NetBSD | | | + | | | | | 10.0 | | | + | | | | | | | | + | | | | | | OpenBSD 7.5 | + | | | | | NetBSD | | + | | | | | 8.3 | | + | FreeBSD | | | | | + | 14.1 | | | | | + | FreeBSD | | | | + | 13.4 | | OpenBSD 7.6 | | | | | | FreeBSD 15 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | @@ -899,6 +902,8 @@ OpenBSD 7.5 2024-04-05 [OBD] NetBSD 9.4 2024-04-20 [NBD] NetBSD 8.3 2024-05-04 [NBD] FreeBSD 14.1 2024-06-04 [FBD] +FreeBSD 13.4 2024-09-17 [FBD] +OpenBSD 7.6 2024-10-08 [OBD] Bibliography ------------------------ diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 67a9c2119ab8..1f0b364dbde2 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -2097,7 +2097,7 @@ _vm_domain_allocate(struct vm_domain *vmd, int req_class, int npages) * Attempt to reserve the pages. Fail if we're below the limit. */ limit += npages; - old = vmd->vmd_free_count; + old = atomic_load_int(&vmd->vmd_free_count); do { if (old < limit) return (0); @@ -4239,7 +4239,7 @@ vm_page_wire_mapped(vm_page_t m) { u_int old; - old = m->ref_count; + old = atomic_load_int(&m->ref_count); do { KASSERT(old > 0, ("vm_page_wire_mapped: wiring unreferenced page %p", m)); @@ -4273,12 +4273,15 @@ vm_page_unwire_managed(vm_page_t m, uint8_t nqueue, bool noreuse) * Use a release store when updating the reference count to * synchronize with vm_page_free_prep(). */ - old = m->ref_count; + old = atomic_load_int(&m->ref_count); do { + u_int count; + KASSERT(VPRC_WIRE_COUNT(old) > 0, ("vm_page_unwire: wire count underflow for page %p", m)); - if (old > VPRC_OBJREF + 1) { + count = old & ~VPRC_BLOCKED; + if (count > VPRC_OBJREF + 1) { /* * The page has at least one other wiring reference. An * earlier iteration of this loop may have called @@ -4287,7 +4290,7 @@ vm_page_unwire_managed(vm_page_t m, uint8_t nqueue, bool noreuse) */ if ((vm_page_astate_load(m).flags & PGA_DEQUEUE) == 0) vm_page_aflag_set(m, PGA_DEQUEUE); - } else if (old == VPRC_OBJREF + 1) { + } else if (count == VPRC_OBJREF + 1) { /* * This is the last wiring. Clear PGA_DEQUEUE and * update the page's queue state to reflect the @@ -4296,7 +4299,7 @@ vm_page_unwire_managed(vm_page_t m, uint8_t nqueue, bool noreuse) * clear leftover queue state. */ vm_page_release_toq(m, nqueue, noreuse); - } else if (old == 1) { + } else if (count == 1) { vm_page_aflag_clear(m, PGA_DEQUEUE); } } while (!atomic_fcmpset_rel_int(&m->ref_count, &old, old - 1)); @@ -4568,10 +4571,12 @@ vm_page_try_blocked_op(vm_page_t m, void (*op)(vm_page_t)) ("vm_page_try_blocked_op: page %p is not busy", m)); VM_OBJECT_ASSERT_LOCKED(m->object); - old = m->ref_count; + old = atomic_load_int(&m->ref_count); do { KASSERT(old != 0, ("vm_page_try_blocked_op: page %p has no references", m)); + KASSERT((old & VPRC_BLOCKED) == 0, + ("vm_page_try_blocked_op: page %p blocks wirings", m)); if (VPRC_WIRE_COUNT(old) != 0) return (false); } while (!atomic_fcmpset_int(&m->ref_count, &old, old | VPRC_BLOCKED)); diff --git a/usr.bin/env/Makefile b/usr.bin/env/Makefile index 81f18e58f80e..f284770af5bb 100644 --- a/usr.bin/env/Makefile +++ b/usr.bin/env/Makefile @@ -1,7 +1,12 @@ +.include + PACKAGE= runtime PROG= env SRCS= env.c envopts.c LIBADD= util +HAS_TESTS= +SUBDIR.${MK_TESTS}= tests + .include diff --git a/usr.bin/env/env.1 b/usr.bin/env/env.1 index 2b98ef40d053..5581d3838a7b 100644 --- a/usr.bin/env/env.1 +++ b/usr.bin/env/env.1 @@ -28,7 +28,7 @@ .\" SUCH DAMAGE. .\" From FreeBSD: src/usr.bin/printenv/printenv.1,v 1.17 2002/11/26 17:33:35 ru Exp .\" -.Dd March 3, 2021 +.Dd October 7, 2024 .Dt ENV 1 .Os .Sh NAME @@ -171,6 +171,19 @@ Both and .Ar utility may not be specified together. +.Pp +The +.Nm +utility does not handle values of +.Ar utility +which have an equals sign +.Pq Ql = +in their name, for obvious reasons. +This can easily be worked around by interposing the +.Xr command 1 +utility, which simply executes its arguments; see +.Sx EXAMPLES +below. .\" .Ss Details of -S (split-string) processing The processing of the @@ -469,6 +482,11 @@ and options: .Pp .Dl "#!/usr/bin/env -S-P/usr/local/bin:/usr/bin:${PATH} perl" +.Pp +To execute a utility with an equal sign in its name: +.Bd -literal -offset indent +env name=value ... command foo=bar arg ... +.Ed .Sh COMPATIBILITY The .Nm @@ -514,14 +532,6 @@ options were added in .Sh BUGS The .Nm -utility does not handle values of -.Ar utility -which have an equals sign -.Pq Ql = -in their name, for obvious reasons. -.Pp -The -.Nm utility does not take multibyte characters into account when processing the .Fl S diff --git a/usr.bin/env/tests/Makefile b/usr.bin/env/tests/Makefile new file mode 100644 index 000000000000..3d2f77b34b67 --- /dev/null +++ b/usr.bin/env/tests/Makefile @@ -0,0 +1,6 @@ +PACKAGE= tests + +ATF_TESTS_SH= env_test +BINDIR= ${TESTSDIR} + +.include diff --git a/usr.bin/env/tests/env_test.sh b/usr.bin/env/tests/env_test.sh new file mode 100644 index 000000000000..da238caaf7fa --- /dev/null +++ b/usr.bin/env/tests/env_test.sh @@ -0,0 +1,120 @@ +# +# Copyright (c) 2024 Klara, Inc. +# +# SPDX-License-Identifier: BSD-2-Clause +# + +magic_words="Squeamish $$ Ossifrage" + +atf_test_case basic +basic_head() +{ + atf_set "descr" "Basic test case" +} +basic_body() +{ + atf_check -o match:"^magic_words=${magic_words}\$" \ + env magic_words="${magic_words}" + export MAGIC_WORDS="${magic_words}" + atf_check -o match:"^MAGIC_WORDS=${magic_words}\$" \ + env + unset MAGIC_WORDS +} + +atf_test_case unset +unset_head() +{ + atf_set "descr" "Unset a variable" +} +unset_body() +{ + export MAGIC_WORDS="${magic_words}" + atf_check -o not-match:"^MAGIC_WORDS=" \ + env -u MAGIC_WORDS + unset MAGIC_WORDS +} + +atf_test_case empty +empty_head() +{ + atf_set "descr" "Empty environment" +} +empty_body() +{ + atf_check env -i +} + +atf_test_case true +true_head() +{ + atf_set "descr" "Run true" +} +true_body() +{ + atf_check env true +} + +atf_test_case false +false_head() +{ + atf_set "descr" "Run false" +} +false_body() +{ + atf_check -s exit:1 env false +} + +atf_test_case false +false_head() +{ + atf_set "descr" "Run false" +} +false_body() +{ + atf_check -s exit:1 env false +} + +atf_test_case altpath +altpath_head() +{ + atf_set "descr" "Use alternate path" +} +altpath_body() +{ + echo "echo ${magic_words}" >magic_words + chmod 0755 magic_words + atf_check -s exit:127 -e match:"No such file" \ + env magic_words + atf_check -o inline:"${magic_words}\n" \ + env -P "${PWD}" magic_words +} + +atf_test_case equal +equal_head() +{ + atf_set "descr" "Command name contains equal sign" +} +equal_body() +{ + echo "echo ${magic_words}" >"magic=words" + chmod 0755 "magic=words" + atf_check -o match:"^${PWD}/magic=words$" \ + env "${PWD}/magic=words" + atf_check -o match:"^magic=words$" \ + env -P "${PATH}:${PWD}" "magic=words" + atf_check -o inline:"${magic_words}\n" \ + env command "${PWD}/magic=words" + atf_check -o inline:"${magic_words}\n" \ + env PATH="${PATH}:${PWD}" command "magic=words" +} + +atf_init_test_cases() +{ + atf_add_test_case basic + atf_add_test_case unset + atf_add_test_case empty + atf_add_test_case true + atf_add_test_case false + atf_add_test_case altpath + atf_add_test_case equal +} diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 6c725537f97a..5d7462a73c5e 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -640,7 +640,6 @@ Emulate a TPM device. The argument .Ar path needs to point to a valid TPM device path, i.e. .Pa /dev/tpm0 . -.El .Pp Supported options for .Ar type : diff --git a/usr.sbin/pnfsdskill/pnfsdskill.8 b/usr.sbin/pnfsdskill/pnfsdskill.8 index a08492fdb966..97919bd65a83 100644 --- a/usr.sbin/pnfsdskill/pnfsdskill.8 +++ b/usr.sbin/pnfsdskill/pnfsdskill.8 @@ -62,7 +62,6 @@ by the MDS or reported to the MDS by a client. .Pp The pNFS service should continue to run normally so long as the number of operational DSs is at least as many as the level of mirroring. -.El .Sh SEE ALSO .Xr nfsv4 4 , .Xr pnfs 4 ,