FreeBSD/src f0b1ca5sys/conf newvers.sh

15.0: Update to BETA4

Approved by:    re (implicit)
Sponsored by:   https://www.patreon.com/cperciva
DeltaFile
+1-1sys/conf/newvers.sh
+1-11 files

FreeBSD/src 8c478bblib/libc/stdlib realpath.3

realpath: Belatedly document POSIX conformance

We've been mostly POSIX-conforming since r236400 and fully since r240410,
which fixed a corner case where a missing non-leaf directory would be
reported as ENOTDIR instead of ENOENT.

Approved by:    re (cperciva)
Sponsored by:   Klara, Inc.
Fixes:          7877ed7ce33e ("Avoid mapping ENOENT to ENOTDIR for non-existent path components.")
Reviewed by:    ziaee, markj
Differential Revision:  https://reviews.freebsd.org/D53027

(cherry picked from commit 7c66667d45e95af59f59e41ef169119a974a6be1)
(cherry picked from commit 50d6a56a198c7c3961313a933f54eea94ffa4b5f)
DeltaFile
+6-6lib/libc/stdlib/realpath.3
+6-61 files

FreeBSD/src 38c42calib/libc/stdlib realpath.c, lib/libc/tests/gen realpath2_test.c

realpath: Report correct path on failure

If lstat() fails with EACCES or ENOTDIR, the path we need to return in
the caller-provided buffer is that of the parent directory (which is
either unreadable or not a directory; the latter can only happen in the
case of a race) rather than that of the child we attempted to stat.

Approved by:    re (cperciva)
Sponsored by:   Klara, Inc.
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D53025

(cherry picked from commit 1406de21e176d8700240ac9e473df007cd41eec1)
(cherry picked from commit 6c9b25246d4408eced73886d0b58feef7bff25c6)
DeltaFile
+12-2lib/libc/stdlib/realpath.c
+2-9lib/libc/tests/gen/realpath2_test.c
+14-112 files

FreeBSD/src 4dc6fd2lib/libc/tests/gen realpath2_test.c

realpath: Additional test cases

* Passing NULL should result in EINVAL
* Passing an empty path should result in ENOENT
* Failure with a non-null buffer should leave a partial result.  As
  pointed out in a comment in the test case, this reveals a discrepancy
  between the documentation and reality.

Approved by:    re (cperciva)
Sponsored by:   Klara, Inc.
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D53024

(cherry picked from commit f3386dfeb429faaa30a915a4a422a25e07c8bf39)
(cherry picked from commit 5debbcb6b7a5a25511e8d63142fbc5e8498a8f46)
DeltaFile
+101-12lib/libc/tests/gen/realpath2_test.c
+101-121 files

FreeBSD/src 201038ausr.sbin/quot quot.c

quot: Make nusers unsigned

Approved by:    re (cperciva)
Fixes:          195b00ec45e5 ("quot: Clean up")
Reviewed by:    rlibby
Differential Revision:  https://reviews.freebsd.org/D53224

(cherry picked from commit fa347930f89d4f9d1956573c3bd4b5987127bc12)
(cherry picked from commit 2427ae41b7cf11e75f9a80d6c274a09eeb9ae979)
DeltaFile
+13-14usr.sbin/quot/quot.c
+13-141 files

FreeBSD/src 1825be3etc/mtree BSD.tests.dist, usr.sbin/quot quot.c Makefile

quot: Add tests

To facilitate the task, we change the comparison function so that users
with equal filesystem usage are sorted by UID, and add an undocumented
option that prevents quot from replacing numerical UIDs with names.  We
also switch from getfsfile(3) to getmntpoint(3) so the first line is
identical regardless of whether we pass quot a mountpoint or a device.

Approved by:    re (cperciva)
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D53133

(cherry picked from commit aa870a1935bccb66e02c4c31630706768a3e7d74)
(cherry picked from commit b5f3f1a661ab69986c3379fa4c9c2b38785933db)
DeltaFile
+102-0usr.sbin/quot/tests/quot_test.sh
+13-6usr.sbin/quot/quot.c
+5-1usr.sbin/quot/Makefile
+4-0usr.sbin/quot/tests/Makefile
+2-0etc/mtree/BSD.tests.dist
+126-75 files

FreeBSD/src 08dda8cusr.sbin/quot quot.c quot.8

quot: Drop the -h option

There was probably a time, more than 30 years ago, when the actual
size of a file had to be calculated and this option saved time, but
all it does today is give incorrect results for no benefit.

Approved by:    re (cperciva)
Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D53132

(cherry picked from commit 8209311c51d34c81edec8d09778201cb6e67c6a5)
(cherry picked from commit c0d4bbcb8069bd64f6ad070c099ebcf7cfde3e72)
DeltaFile
+4-32usr.sbin/quot/quot.c
+1-5usr.sbin/quot/quot.8
+5-372 files

FreeBSD/src dedf740usr.sbin/quot quot.c

quot: Drop the COMPAT version

We've had this code for 30 years, but there has never been a way to
build it.  We have no idea if it still works, or if it ever worked.

Approved by:    re (cperciva)
Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D53131

(cherry picked from commit 0eaca4a24b97c02685532f86c121a4cf415942c5)
(cherry picked from commit 9a7b48fef15230740cdf7b69e40e6ceb2bd2318e)
DeltaFile
+0-54usr.sbin/quot/quot.c
+0-541 files

FreeBSD/src b0fdefbusr.sbin/quot quot.c quot.8

quot: Clean up

* Fix numerous style violations.
* Modernize somewhat.
* Don't bother examining errno after calling get_inode(), as it always
  exits on error.
* Fix confusing wording in the manual page.

The code remains somewhat idiosyncratic, e.g. in its insistance on
counting down rather than up in simple for loops, but in the absence
of comprehensive automated tests, the risk of introducing bugs exceeds
the benefit of rewriting these into more idiomatic forms.

Approved by:    re (cperciva)
Reviewed by:    obiwac
Differential Revision:  https://reviews.freebsd.org/D53130

(cherry picked from commit 195b00ec45e55c38da13d1bcd2d7eb6614abec59)
(cherry picked from commit 68911bf64eb5f6a99dd1fa7e2b6eaee1d27d8f1a)
DeltaFile
+103-124usr.sbin/quot/quot.c
+3-4usr.sbin/quot/quot.8
+0-2usr.sbin/quot/Makefile
+106-1303 files

FreeBSD/src 6038432usr.sbin/quot quot.c

quot: Fix benign buffer overflow

If it encounters an inode whose owner does not have a pw entry, quot
allocates a 7-byte buffer (8 in practice, since that is the minimum
allocation size) and uses it to store the numeric uid preceded by a
hash character.  This will overflow the allocated buffer if the UID
exceeds 6 decimal digits.  Avoid this by using asprintf() instead.

While here, simplify the common case as well using strdup().

Approved by:    re (cperciva)
Reported by:    Igor Gabriel Sousa e Souza <igor at bsdtrust.com>
MFC after:      3 days
Reviewed by:    obiwac, emaste
Differential Revision:  https://reviews.freebsd.org/D53129

(cherry picked from commit 5854d1cbab1073d78519e7ad9a6eb5726341d587)
(cherry picked from commit 3d680881f6ed2f55079aac26cf0ded307c282563)
DeltaFile
+2-6usr.sbin/quot/quot.c
+2-61 files

FreeBSD/src 8cf76cbusr.bin/w w.c

w: Trim whitespace and commas from time and uptime

When producing formatted output, trim leading whitespace and trailing
commas from the human-readable time and uptime before emitting them.
The text output remains unchanged.

Approved by:    re (cperciva)
PR:             290089
Fixes:          6e6febb54da9 ("w: Fix idle time in json output, add login/idle times to json output")
Reviewed by:    marius.h_lden.org
Differential Revision:  https://reviews.freebsd.org/D53167

(cherry picked from commit 4d5789532a940144c869d66505e756ce816f8a50)
(cherry picked from commit ca16a115a0fa4da67b153d0b90c9ec08adc9b2fb)
DeltaFile
+25-8usr.bin/w/w.c
+25-81 files

FreeBSD/src b763c11bin/pwait pwait.c pwait.1, bin/pwait/tests pwait_test.sh

pwait: Add an option to print remaining processes

* On startup, insert all valid PIDs into a tree.
* In our main loop, whenever a process terminates, remove its PID
  from the tree.
* On exit, if the -p flag was specified, print the remaining PIDs.

Approved by:    re (cperciva)
MFC after:      3 days
Reviewed by:    bcr, markj
Differential Revision:  https://reviews.freebsd.org/D53293

(cherry picked from commit 3d73146baeb933fe955c7496572b483a9f92914c)
(cherry picked from commit 955650f1814257070f8414b6b6e8f42496f26409)
DeltaFile
+65-33bin/pwait/pwait.c
+38-0bin/pwait/tests/pwait_test.sh
+4-2bin/pwait/pwait.1
+107-353 files

FreeBSD/src 936ef70bin/pwait pwait.c

pwait: Avoid calling getpid(2) for each proc.

Approved by:    re (cperciva)

(cherry picked from commit ab4abce6c2c2091a3b9ea1f38cbef94ee7a68090)
(cherry picked from commit 54d1d527c8edf1e6819af7aadae744095116a27d)
DeltaFile
+3-1bin/pwait/pwait.c
+3-11 files

FreeBSD/src ac84e69libexec/rc rc.subr

rc.subr: Fix slow shutdown issue

Instead of sleeping after pwait returns, use its new -p option to
obtain the list of processes that still have not terminated.

Approved by:    re (cperciva)
MFC after:      3 days
PR:             290357
Fixes:          5953e7c98427 ("rc.subr: Move the sleep in wait_for_pids")
Reviewed by:    0mp, markj
Differential Revision:  https://reviews.freebsd.org/D53294

(cherry picked from commit 22cff1f3e9d82b48aad440c52f883bfd4995359c)
(cherry picked from commit 7b375832c252430243810ca85d6cbf67820457d5)
DeltaFile
+8-21libexec/rc/rc.subr
+8-211 files

FreeBSD/src 02de2f3usr.bin/id id.c id.1

id: Add -d and -s options

These options may not be combined with any other options and print the
current or specified user's home directory and shell respectively.

Approved by:    re (cperciva)
Reviewed by:    imp, bcr
Differential Revision:  https://reviews.freebsd.org/D53301

(cherry picked from commit f41b1eb637f576634be0df9d657f46aa57afea59)
(cherry picked from commit eff786f23611582e518f038e4086a1306c019d23)
DeltaFile
+45-3usr.bin/id/id.c
+25-3usr.bin/id/id.1
+70-62 files

FreeBSD/src e392a6dusr.bin/id id.c

id: Clean up

No functional change intended.

Approved by:    re (cperciva)
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D53300

(cherry picked from commit 70b72ede982f3aebe03a2bf7a8245ee6bcde352c)
(cherry picked from commit 758e4565a9d61644a3a7e5dc517612df1617f231)
DeltaFile
+55-59usr.bin/id/id.c
+55-591 files

FreeBSD/src 65a3f9cusr.sbin/pkg Makefile

pkg: Die if make -V BRANCH fails

If build logic breaks such that we can't figure out which branch we're
on, we should error out rather than shipping a default (and probably
wrong) /etc/pkg/FreeBSD.conf

Approved by:    re (cperciva)
Reviewed by:    ivy
MFC after:      5 minutes
Suggested by:   ivy
Differential Revision:  https://reviews.freebsd.org/D53487

(cherry picked from commit 0837b2ebd570ea092353aa3c46e374f7a1533a1d)
(cherry picked from commit 1f528e32f5098c5aaca9bd2fb6473631c3831fbf)
DeltaFile
+1-0usr.sbin/pkg/Makefile
+1-01 files

FreeBSD/src c824a13release Makefile.vm

release: Only check no-root/no-qemu when building

Building VMs as non-root requires no-QEMU code paths (installing
packages from outside the VM image rather than inside it) and vice
versa; we have a check for broken combinations.

Unfortunately that check was breaking
make -C src/usr.sbin/pkg NO_ROOT=YES -V PKGCONFBRANCH
because that code reaches into src/release to determine the branch
name (which is then used to determine which /etc/pkg/FreeBSD.conf to
install).

Wrap the no-root/no-qemu check in an .if to only run when we've
asked for VM and/or CLOUD building to be enabled.

Approved by:    re (cperciva)
Reviewed by:    ivy
MFC after:      5 minutes
Sponsored by:   https://www.patreon.com/cperciva

    [4 lines not shown]
DeltaFile
+3-0release/Makefile.vm
+3-01 files

FreeBSD/src 660255bsys/conf files, sys/modules/dummynet Makefile

ipfw: Retire obsolete compat code

The current IPFW version 3 dates to 2010 (commit cc4d3c30ea28, "Bring in
the most recent version of ipfw and dummynet, developed").

The compat code for FreeBSD 8 and earlier has a number of issues and is
no longer needed, so remove it.

Approved by:    re (cperciva)
Reported by:    Ilja Van Sprundel <ivansprundel at ioactive.com>
Reviewed by:    ae, glebius
Relnotes:       Yes
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53343

(cherry picked from commit c59aab9a5b3970b3ccec744f759e6cb87e938dbe)
(cherry picked from commit 9657c50cdd7741404d99881fdd9243175086ede1)
DeltaFile
+0-858sys/netpfil/ipfw/ip_dn_glue.c
+27-69sys/netpfil/ipfw/ip_dummynet.c
+1-9sys/netpfil/ipfw/ip_dn_private.h
+0-4sys/netinet/raw_ip.c
+1-2sys/modules/dummynet/Makefile
+0-1sys/conf/files
+29-9436 files

FreeBSD/src 443258ausr.sbin/pmcstat pmcstat.c

pmcstat: Remove no-op -k option

Commit 53d0b9e438bc ("pmc: Provide full path to modules from kernel
linker") made pmcstat's -k option have no effect, but the option was
retained for backwards compatibility (while emitting a warning that
-k is not in FreeBSD 15).

Approved by:    re (cperciva)
Reviewed by:    jrtc27
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53397

(cherry picked from commit c6b156e360fc5b18ee20bae0fc0c4188c3aadea6)
(cherry picked from commit 958659dc9410f332ce0a028d2d5fdc82da8a03dd)
DeltaFile
+1-6usr.sbin/pmcstat/pmcstat.c
+1-61 files

FreeBSD/src fcf8720sbin/bsdlabel bsdlabel.8 bsdlabel.c

bsdlabel: Bump removal to FreeBSD 16.0.

It is deprecated but was not removed prior to 15.0.

Approved by:    re (cperciva)
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 9447a4078121fd1ce961fed33dd0099040d0dac9)
(cherry picked from commit be24d85ec78453b80effeb61dc8e5910a1caa3a8)
DeltaFile
+1-1sbin/bsdlabel/bsdlabel.8
+1-1sbin/bsdlabel/bsdlabel.c
+2-22 files

FreeBSD/src 6b2f2e0release Makefile.vm

release: Only check no-root/no-qemu when building

Building VMs as non-root requires no-QEMU code paths (installing
packages from outside the VM image rather than inside it) and vice
versa; we have a check for broken combinations.

Unfortunately that check was breaking
make -C src/usr.sbin/pkg NO_ROOT=YES -V PKGCONFBRANCH
because that code reaches into src/release to determine the branch
name (which is then used to determine which /etc/pkg/FreeBSD.conf to
install).

Wrap the no-root/no-qemu check in an .if to only run when we've
asked for VM and/or CLOUD building to be enabled.

Reviewed by:    ivy
MFC after:      5 minutes
Sponsored by:   https://www.patreon.com/cperciva
Differential Revision:  https://reviews.freebsd.org/D53486

    [2 lines not shown]
DeltaFile
+3-0release/Makefile.vm
+3-01 files

FreeBSD/src 1f528e3usr.sbin/pkg Makefile

pkg: Die if make -V BRANCH fails

If build logic breaks such that we can't figure out which branch we're
on, we should error out rather than shipping a default (and probably
wrong) /etc/pkg/FreeBSD.conf

Reviewed by:    ivy
MFC after:      5 minutes
Suggested by:   ivy
Differential Revision:  https://reviews.freebsd.org/D53487

(cherry picked from commit 0837b2ebd570ea092353aa3c46e374f7a1533a1d)
DeltaFile
+1-0usr.sbin/pkg/Makefile
+1-01 files

FreeBSD/src 0837b2eusr.sbin/pkg Makefile

pkg: Die if make -V BRANCH fails

If build logic breaks such that we can't figure out which branch we're
on, we should error out rather than shipping a default (and probably
wrong) /etc/pkg/FreeBSD.conf

Reviewed by:    ivy
MFC after:      5 minutes
Suggested by:   ivy
Differential Revision:  https://reviews.freebsd.org/D53487
DeltaFile
+1-0usr.sbin/pkg/Makefile
+1-01 files

FreeBSD/src b485322release Makefile.vm

release: Only check no-root/no-qemu when building

Building VMs as non-root requires no-QEMU code paths (installing
packages from outside the VM image rather than inside it) and vice
versa; we have a check for broken combinations.

Unfortunately that check was breaking
make -C src/usr.sbin/pkg NO_ROOT=YES -V PKGCONFBRANCH
because that code reaches into src/release to determine the branch
name (which is then used to determine which /etc/pkg/FreeBSD.conf to
install).

Wrap the no-root/no-qemu check in an .if to only run when we've
asked for VM and/or CLOUD building to be enabled.

Reviewed by:    ivy
MFC after:      5 minutes
Sponsored by:   https://www.patreon.com/cperciva
Differential Revision:  https://reviews.freebsd.org/D53486
DeltaFile
+3-0release/Makefile.vm
+3-01 files

FreeBSD/src 28345f0contrib/pjdfstest/tests/ftruncate 12.t, contrib/pjdfstest/tests/link 05.t 15.t

pjdfstest: Avoid needless use of expr

Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D53443
DeltaFile
+1-1contrib/pjdfstest/tests/ftruncate/12.t
+1-1contrib/pjdfstest/tests/link/05.t
+1-1contrib/pjdfstest/tests/link/15.t
+1-1contrib/pjdfstest/tests/mkdir/11.t
+1-1contrib/pjdfstest/tests/mkfifo/11.t
+1-1contrib/pjdfstest/tests/open/19.t
+6-62 files not shown
+8-88 files

FreeBSD/src 6c86379contrib/pjdfstest/tests/link 05.t

pjdfstest: Fix link count test

This UFS-only test verifies that attempting to create more links than
permitted by the file system returns EMLINK, but has been broken ever
since UFS_LINK_MAX was increased because a) it hardcodes the previous
value of UFS_LINK_MAX, and b) the new value requires more space than
the test allocates, so it ends up getting ENOSPC instead of EMLINK.

* Switch to retrieving {PC_LINK_MAX} at runtime.

* Stop the test when we reach {PC_LINK_MAX} links.  This ensures that
  we don't go on for hours if the actual limit turns out to be much
  higher than we anticipated (e.g. INT64_MAX on ZFS).

* Double the size of the test filesystem.

MFC after:      3 days
Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.

    [3 lines not shown]
DeltaFile
+5-4contrib/pjdfstest/tests/link/05.t
+5-41 files

FreeBSD/src 958659dusr.sbin/pmcstat pmcstat.c

pmcstat: Remove no-op -k option

Commit 53d0b9e438bc ("pmc: Provide full path to modules from kernel
linker") made pmcstat's -k option have no effect, but the option was
retained for backwards compatibility (while emitting a warning that
-k is not in FreeBSD 15).

Reviewed by:    jrtc27
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53397

(cherry picked from commit c6b156e360fc5b18ee20bae0fc0c4188c3aadea6)
DeltaFile
+1-6usr.sbin/pmcstat/pmcstat.c
+1-61 files

FreeBSD/src be24d85sbin/bsdlabel bsdlabel.8 bsdlabel.c

bsdlabel: Bump removal to FreeBSD 16.0.

It is deprecated but was not removed prior to 15.0.

Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 9447a4078121fd1ce961fed33dd0099040d0dac9)
DeltaFile
+1-1sbin/bsdlabel/bsdlabel.8
+1-1sbin/bsdlabel/bsdlabel.c
+2-22 files

FreeBSD/src 9657c50sys/conf files, sys/modules/dummynet Makefile

ipfw: Retire obsolete compat code

The current IPFW version 3 dates to 2010 (commit cc4d3c30ea28, "Bring in
the most recent version of ipfw and dummynet, developed").

The compat code for FreeBSD 8 and earlier has a number of issues and is
no longer needed, so remove it.

Reported by:    Ilja Van Sprundel <ivansprundel at ioactive.com>
Reviewed by:    ae, glebius
Relnotes:       Yes
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53343

(cherry picked from commit c59aab9a5b3970b3ccec744f759e6cb87e938dbe)
DeltaFile
+0-858sys/netpfil/ipfw/ip_dn_glue.c
+27-69sys/netpfil/ipfw/ip_dummynet.c
+1-9sys/netpfil/ipfw/ip_dn_private.h
+0-4sys/netinet/raw_ip.c
+1-2sys/modules/dummynet/Makefile
+0-1sys/conf/files
+29-9436 files