FreeBSD/src f7c0bd2usr.bin/file/tests Makefile

file: normalize .result files to ensure trailing newline on install

Some upstream result files introduced in file 5.47 (e.g., bgcode.result)
lack a trailing newline, causing the contrib_file_tests ATF test to
fail with "cmp: EOF on bgcode.result".  Generate normalized copies
of the expected results and install those instead.

MFC after:      3 days
Fixes:          e949ce9dc0e6fff26e83904f1008b76d36ba0a37
DeltaFile
+12-1usr.bin/file/tests/Makefile
+12-11 files

FreeBSD/src ad52456usr.bin/limits limits.c

limits: Fix pipebuf resource type

* pipebuf is a size but is listed as a count

PR:             295623
MFC after:      1 week
Fixes:          f54f41403d14 ("usr.bin/limits: support RLIMIT_PIPEBUF")
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D57456
DeltaFile
+1-1usr.bin/limits/limits.c
+1-11 files

FreeBSD/src a85e390usr.sbin/etcupdate etcupdate.sh

etcupdate: Make diff -l actually work

While here, remove unnecessary blank lines.

MFC after:      1 week
Fixes:          6d65c91b9a47 ("etcupdate: fix arguments order of diff command")
Reviewed by:    Boris Lytochkin <lytboris at gmail.com>
Differential Revision:  https://reviews.freebsd.org/D57330
DeltaFile
+4-14usr.sbin/etcupdate/etcupdate.sh
+4-141 files

FreeBSD/src 823d00bcontrib/telnet/libtelnet getent.c, include stdlib.h

libc: Constify the getcap API

MFC after:      1 week
Inspired by:    NetBSD
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D57252
DeltaFile
+10-8lib/libc/gen/getcap.c
+4-4lib/libc/gen/getcap.3
+1-6libexec/getty/subr.c
+3-3include/stdlib.h
+3-3usr.bin/cap_mkdb/cap_mkdb.c
+3-3contrib/telnet/libtelnet/getent.c
+24-275 files not shown
+31-3411 files

FreeBSD/src ba0d22elib/libarchive Makefile.inc

libarchive: Fix typo in sed command

MFC after:      1 week
Fixes:          eb3a0a74a069 ("libarchive: Clean up the build configuration")
Reported by:    Shawn Webb <shawn.webb at hardenedbsd.org>
DeltaFile
+1-1lib/libarchive/Makefile.inc
+1-11 files

FreeBSD/src ea4886fsys/fs/nfs nfs_commonkrpc.c

nfs_commonkrpc.c: Improve handling of NFSv4.1/4.2 recovery

Commit 4d80d4913e79 fixed a long standing bug in the recovery
code.  However. glebius@ reported seeing multiple
recovery cycles with this patch during an NFSv4.1/4.2
server reboot.

This commit should minimize the risk of multiple
recovery cycles.

PR:     294925
Reported by:    Jov <amutu at amutu.com>
MFC after:      2 weeks
Fixes:  4d80d4913e79 ("nfs: Fix argument typo to avoid a crash")
DeltaFile
+8-5sys/fs/nfs/nfs_commonkrpc.c
+8-51 files

FreeBSD/src 22c1f5dlibexec/nuageinit nuageinit.7 nuageinit

nuageinit: complete SSH support with ssh_deletekeys and disable_root

Add missing SSH cloud-config options from cloud-init spec:

- ssh_deletekeys: remove existing SSH host keys on first boot so
  new ones are generated automatically by sshd(8).
  Implemented as delete_ssh_host_keys() in nuage.lua using lfs.dir()
  with a directory existence guard via lfs.attributes().

- disable_root: set PermitRootLogin to 'no' (or a custom value via
  disable_root_opts) in /etc/ssh/sshd_config.

- disable_root_opts: optional string or array to override the
  PermitRootLogin value used when disable_root is true. Only the
  first array element is used.
DeltaFile
+32-0libexec/nuageinit/nuageinit.7
+24-0libexec/nuageinit/nuageinit
+14-0libexec/nuageinit/nuage.lua
+70-03 files

FreeBSD/src ea0932dlibexec/nuageinit nuage.lua

nuageinit: refactor goto abuse in chpasswd()

Replace goto next/list pattern with proper elseif/else control
structure. The goto-based flow was fragile and hard to follow;
the elseif chain makes the validation logic explicit and linear.
DeltaFile
+11-17libexec/nuageinit/nuage.lua
+11-171 files

FreeBSD/src 0ba9b7blibexec/nuageinit nuage.lua, libexec/nuageinit/tests update_sshd_config.lua

nuageinit: fix update_sshd_config crash when file does not exist

Previously update_sshd_config() would assert-fail if sshd_config did
not exist. Now it creates a new file with the given key/value.

Also replace the fragile simultaneous r+ + temp file approach with
a cleaner read-then-write pattern: read all lines into memory, modify
as needed, then write to a temp file and rename. All assert() calls
replaced with proper error handling via warnmsg().

Add test case for missing file creation.
DeltaFile
+31-12libexec/nuageinit/nuage.lua
+7-0libexec/nuageinit/tests/update_sshd_config.lua
+38-122 files

FreeBSD/src cf5722elibexec/nuageinit nuage.lua

nuageinit: fix TOCTOU in addsshkey, adddoas, addsudo

Replace check-then-create patterns with direct creation:

- addsshkey: check what exists before creation, use mkdir_p() for
  .ssh directory, handle errors with warnmsg() instead of assert().
  Apply chmod/chown only on newly created files/directories.

- adddoas: same pattern for doas.conf and the etc directory.

- addsudo: same pattern for the sudoers file and sudoers.d directory.

All three functions now use warnmsg() for error handling instead of
returning nil,err or using assert().
DeltaFile
+52-40libexec/nuageinit/nuage.lua
+52-401 files

FreeBSD/src fdff892libexec/nuageinit nuage.lua

nuageinit: fix non-standard f:close(cmd) and remove dead precmd

- f:close(cmd) -> f:close() in adduser() and exec_change_password():
  the 'cmd' argument is not standard Lua and is silently ignored.
- Remove dead 'precmd' variable in adduser().
DeltaFile
+3-4libexec/nuageinit/nuage.lua
+3-41 files

FreeBSD/src 852504alibexec/nuageinit nuage.lua

nuageinit: remove dead checkgroup(), inline check in purge_group()

Call getgroups() once instead of N times per call. Inline the
membership check directly, removing the now-unused checkgroup()
helper function.
DeltaFile
+9-13libexec/nuageinit/nuage.lua
+9-131 files

FreeBSD/src 46d1758libexec/nuageinit nuage.lua, libexec/nuageinit/tests sethostname.lua nuage.sh

nuageinit: add hostname validation (RFC 952/1123) to sethostname()

Validate hostnames before writing them:
- Reject empty hostnames
- Reject hostnames longer than 253 characters
- Reject hostnames with invalid characters
- Reject hostnames starting or ending with dot/hyphen
- Reject labels longer than 63 characters
- Reject labels starting or ending with hyphen

Expand the sethostname test to cover all rejection cases.
Update nuage.sh sethostname_body to ignore stderr (warnings).
DeltaFile
+68-0libexec/nuageinit/tests/sethostname.lua
+27-0libexec/nuageinit/nuage.lua
+1-1libexec/nuageinit/tests/nuage.sh
+96-13 files

FreeBSD/src 57807f3libexec/nuageinit nuage.lua

nuageinit: add nil/empty guard to decode_base64()

Return an empty string when input is nil or zero-length instead
of processing it through the decoding loop.
DeltaFile
+3-0libexec/nuageinit/nuage.lua
+3-01 files

FreeBSD/src 453968clib/libsys open.2, sys/kern uipc_usrreq.c

uipc_usrreq: revert addition of EMPTYPATH for bindat(2)

The caller wants the parent vnode, which cannot be provided for emptypath
lookups.

Reported and reviewed by:       markj
Fixes:  12c590a9abd7 ("bindat(2)/connectat(2): allow implicit EMPTYPATH for unix domain sockets")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57448
DeltaFile
+2-3sys/kern/uipc_usrreq.c
+1-3lib/libsys/open.2
+3-62 files

FreeBSD/src 9459465libexec/nuageinit/tests nuageinit.sh

nuageinit: add config2_network DNS services test
DeltaFile
+47-0libexec/nuageinit/tests/nuageinit.sh
+47-01 files

FreeBSD/src 5f58d92libexec/nuageinit/tests dirname.lua

nuageinit: add dirname edge case tests
DeltaFile
+23-0libexec/nuageinit/tests/dirname.lua
+23-01 files

FreeBSD/src b551429sys/compat/linuxkpi/common/include/linux dma-mapping.h

linuxkpi: Add dma_unmap_page_attrs

This will be used by amdgpu as of Linux 6.13.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
DeltaFile
+7-0sys/compat/linuxkpi/common/include/linux/dma-mapping.h
+7-01 files

FreeBSD/src b813e46libexec/nuageinit nuage.lua

nuageinit: fix dirname('/') returning nil instead of '/'
DeltaFile
+3-0libexec/nuageinit/nuage.lua
+3-01 files

FreeBSD/src fa3f69flib/msun Makefile

libmsun: Fix incorrect MLINK for sincosl(3)

PR:             295704
MFC after:      1 week
DeltaFile
+1-1lib/msun/Makefile
+1-11 files

FreeBSD/src 8bbe1d5. ObsoleteFiles.inc

ObsoleteFiles: Add some ancient locale symlinks

These were dropped in 2021 but were never listed in ObsoleteFiles.inc,
so systems that have been upgraded from source since before that date
(or from 13.x) may still have them.

PR:             295668
MFC after:      1 week
Fixes:          0a36787e4c1f ("locales: separate unicode from other locales")
Reviewed by:    bapt
Differential Revision:  https://reviews.freebsd.org/D57331

(cherry picked from commit 1cef7e9eb0822c606fc34f975efd14b6daeff756)
DeltaFile
+7-0ObsoleteFiles.inc
+7-01 files

FreeBSD/src 34fc5cclib/libutil login_class.c

login_class: Fix kqueues, pipebuf resource types

* kqueues is a count but is listed as a size

* pipebuf is a size but is listed as a count

PR:             295623
MFC after:      1 week
Fixes:          a4c04958f526 ("libutil: support RLIMIT_PIPEBUF")
Fixes:          85a0ddfd0b26 ("Add a resource limit for the total...")
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D57333

(cherry picked from commit b5dce0ae4f78251f56ffcb6c6a58b9e6c20380e0)
DeltaFile
+2-2lib/libutil/login_class.c
+2-21 files

FreeBSD/src c435622bin/sh miscbltin.c

sh: Fix pipebuf limit

Since the factor is not 1, we need to provide a unit.

MFC after:      1 week
Fixes:          5d92f20c7d31 ("bin/sh: support RLIMIT_PIPEBUF")
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D57352

(cherry picked from commit dfd2273d27627313f944650840381e878077e825)
DeltaFile
+1-1bin/sh/miscbltin.c
+1-11 files

FreeBSD/src 78381cdlib/libutil login.conf.5

login.conf(5): Add missing resource limits

While here, reorder the table.

PR:             295618
MFC after:      1 week
Reviewed by:    olce
Differential Revision:  https://reviews.freebsd.org/D57258

(cherry picked from commit e9346d1d1383e8c1dced50a3aceb28edd5a4a5e2)
DeltaFile
+6-5lib/libutil/login.conf.5
+6-51 files

FreeBSD/src d3c855flib/libc/gen fts.3

fts: Improve the description of FTS_NOSTAT

Note that we still need to stat directories and the roots.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D57325

(cherry picked from commit dce6aff90b13f30fcb4c1fa263868607ccda8041)
DeltaFile
+8-1lib/libc/gen/fts.3
+8-11 files

FreeBSD/src 7546f06. ObsoleteFiles.inc

ObsoleteFiles: Add some ancient locale symlinks

These were dropped in 2021 but were never listed in ObsoleteFiles.inc,
so systems that have been upgraded from source since before that date
(or from 13.x) may still have them.

PR:             295668
MFC after:      1 week
Fixes:          0a36787e4c1f ("locales: separate unicode from other locales")
Reviewed by:    bapt
Differential Revision:  https://reviews.freebsd.org/D57331

(cherry picked from commit 1cef7e9eb0822c606fc34f975efd14b6daeff756)
DeltaFile
+7-0ObsoleteFiles.inc
+7-01 files

FreeBSD/src e8abb10lib/libutil login.conf.5

login.conf(5): Add missing resource limits

While here, reorder the table.

PR:             295618
MFC after:      1 week
Reviewed by:    olce
Differential Revision:  https://reviews.freebsd.org/D57258

(cherry picked from commit e9346d1d1383e8c1dced50a3aceb28edd5a4a5e2)
DeltaFile
+6-5lib/libutil/login.conf.5
+6-51 files

FreeBSD/src 7ad1006bin/sh miscbltin.c

sh: Fix pipebuf limit

Since the factor is not 1, we need to provide a unit.

MFC after:      1 week
Fixes:          5d92f20c7d31 ("bin/sh: support RLIMIT_PIPEBUF")
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D57352

(cherry picked from commit dfd2273d27627313f944650840381e878077e825)
DeltaFile
+1-1bin/sh/miscbltin.c
+1-11 files

FreeBSD/src b1cec2blib/libc/tests/gen fts_options_test.c

fts: Add some depth to the options test

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D57323

(cherry picked from commit 7ec549870f2adeb0e896885220d4af6b47c4c9ba)
DeltaFile
+74-0lib/libc/tests/gen/fts_options_test.c
+74-01 files

FreeBSD/src 2a0e9a9lib/libutil login_class.c

login_class: Fix kqueues, pipebuf resource types

* kqueues is a count but is listed as a size

* pipebuf is a size but is listed as a count

PR:             295623
MFC after:      1 week
Fixes:          a4c04958f526 ("libutil: support RLIMIT_PIPEBUF")
Fixes:          85a0ddfd0b26 ("Add a resource limit for the total...")
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D57333

(cherry picked from commit b5dce0ae4f78251f56ffcb6c6a58b9e6c20380e0)
DeltaFile
+2-2lib/libutil/login_class.c
+2-21 files