100 Commits
Author SHA1 Message Date
Xin LI 7fe1d8abad MFV: zlib: Fix buffer overflow bug in non-blocking gzwrite.
MFC after:	3 days
DIfferential revision:	https://reviews.freebsd.org/D60695
2026-10-12 22:49:35 -07:00
Xin LI 3ceb5f150b termcap: add missing capabilities to the xterm-ghostty entry
The entry was imported from the termcap source that Ghostty generates
with infotocap during its build.  To fit within 1023 bytes, the
conversion dropped a number of capabilities, most notably all color
support, so termcap consumers such as ls -G and ncurses applications
treated Ghostty as a monochrome terminal.

Split the entry into xterm-ghostty and a ghostty+common fragment, and
restore the following from Ghostty's terminfo definition:

 - colors: Co, pa, AF, AB, op, oc, ut, AX
 - keys: End, keypad Enter, F10-F12, back tab, mouse prefix
 - attributes: italics (ZH/ZR), invisible (mk), acsc map (ac)
 - misc: cb, ch, cv, SA/RA, r1, bs, NP, 5i

AF and AB use the plain 256-color form, like xterm-256color, because
termcap cannot express the conditional used by the terminfo entry.

Fixes:		804f961c5c ("share/termcap: add xterm-ghostty entry")
MFC after:	1 week
2026-10-12 00:51:43 -07:00
Xin LI b4e2c9abaf libcasper: tolerate kernels without PD_NOWAITPID
Commit 1a296762b3 made libcasper pass PD_NOWAITPID to pdfork(2).
Kernels predating the flag (15.1 and earlier, since the flag first
ships in 15.2) reject it with EINVAL, which makes cap_init() and every
service fork fail when a newer world runs on an older kernel, for
example in a poudriere jail.

Add casper_pdfork(), which retries without the flag on EINVAL, and use
it at both pdfork(2) call sites.  The retry is safe because the kernel
validates pdfork flags before creating a child.  On such kernels the
zombie must still be reaped with waitpid(2), as before the flag was
introduced.

The fallback is compiled out once __FreeBSD_version reaches 1700000,
so it disappears from main when stable/16 branches while remaining in
the stable/15 and stable/16 branches that need it.

Reviewed by:	kib
MFC after:	3 days

Differential Revision: https://reviews.freebsd.org/D60401
2026-10-06 01:10:57 -07:00
Xin LI 7f7e9584cb Add release notes entry for less v710. 2026-09-19 11:48:28 -07:00
Xin LI 4523eebc6c MFV: less v710.
MFC after:	1 week
2026-09-19 11:20:29 -07:00
Xin LI 6a473ab490 Vendor import of less v710. 2026-09-18 20:21:21 -07:00
Xin LI 7ffc4ec486 MFV: xz 5.8.4.
MFC after:	3 days
2026-09-13 18:09:38 -07:00
Xin LI 9b26803758 Vendor import of xz 5.8.4 (trimmed) 2026-09-13 11:21:43 -07:00
Xin LI 8929675e11 libmagic: Add swap.c and magic.h to SRCS.
file 5.48 added swap.c and swap.h for byte-swapping operations, which are
required on hosts that lack <byteswap.h> or <sys/bswap.h> (e.g. macOS cross-building
or older FreeBSD bootstrap environments).

Also add magic.h to SRCS so object files depend on the generated header
before compiling, avoiding falling back to the host's /usr/include/magic.h
during parallel builds.

Reported by:    wosch
MFC after:      1 week
Fixes:          7af41682a9 ("MFV: file 5.48")
2026-09-05 16:57:30 -07:00
Xin LI 37aec55d0a fsck_msdosfs: add a test for reconnecting on volumes larger than 4 GiB
Build a 4.5 GiB FAT32 image whose LOST.DIR cluster sits exactly 4 GiB above
the single cluster of a PAYLOAD.BIN, so that truncating the offset of the
former to 32 bits yields the offset of the latter, then inject a lost cluster
chain and let fsck_msdosfs(8) reconnect it.

The test asserts both halves of the bug fixed in the previous commit: that
PAYLOAD.BIN's cluster is unchanged, and that a second pass no longer reports
the chain as lost, which it only stops doing once the directory entry reaches
the real LOST.DIR.

newfs_msdos(8) -C only calls ftruncate(2) and nothing outside the reserved
area, the FATs and a handful of clusters is ever written, so the image stays
sparse and costs about 2 MiB on disk.

The geometry is read back out of the BPB rather than assumed, so
newfs_msdos(8) stays free to lay the file system out differently; the test
fails with a clear message if the volume ever becomes too small to hold a
cluster a full 4 GiB beyond the data area.

MFC after:	1 week
2026-09-03 00:56:24 -07:00
Xin LI c4f458da44 fsck_msdosfs: add tests for the 32-bit boot block field decoding
Exercise each of the 32-bit BIOS Parameter Block and FSInfo fields that
readboot() decodes, using values whose most significant byte has its high
bit set.  Each case checks two things: that fsck_msdosfs(8) reports the
full unsigned 32-bit value back on stdout, and that nothing writes a
sanitizer runtime error to stderr.

The second check is what catches a byte-at-a-time decode.  Shifting such
a byte left by 24 is undefined, but every compiler we use wraps it into
the same bit pattern, so the decoded value alone cannot tell a correct
decode from an overflowing one.  In a WITH_UBSAN build bsd.sanitizer.mk
compiles with -fsanitize=undefined and -fsanitize-recover=undefined, so
the shift is reported on stderr and execution continues, which the test
can then assert on.  Against the byte-at-a-time decode these cases fail
in a WITH_UBSAN build and pass without it.

Note that the stderr check also fails on unrelated undefined behavior
that these images reach anywhere in fsck_msdosfs(8), which is intended.

MFC after:	1 week
2026-09-02 23:51:36 -07:00
Xin LI 7af41682a9 MFV: file 5.48
MFC after:	1 week
2026-09-02 21:30:33 -07:00
Xin LI bbaf254293 fsck_msdosfs: add tests for lost cluster chain repair accounting
Add an ATF test suite covering Phase 3 ("Checking for Lost Files")
error accounting.  Test images are created using newfs_msdos(8),
and lost cluster chains are injected directly into FAT copies at
offsets derived from the BPB.  The LOST.DIR directory required by
reconnect() is constructed similarly: a root directory entry with
ATTR_DIRECTORY set and its first cluster pointing to a zero-filled
cluster containing "." and ".." entries.

The lost_chain_cleared and corrupted_lost_chain_reconnected test
cases provide regression coverage for the preceding commit:
 - lost_chain_cleared verifies that clearing a lost chain (the fallback
   taken when LOST.DIR is absent) exits with status 0 rather than 8
   (unrecovered error).
 - corrupted_lost_chain_reconnected verifies that FAT modifications
   from a chain truncated by checkchain() prior to reconnection are
   written back to disk, requiring "Update FATs? yes" and ensuring a
   clean second pass.

Additionally, lost_chain_left_alone, lost_chain_preen, and
corrupted_lost_chain_left_alone cover scenarios that must continue to
report unrecovered errors: read-only mode (-n), which performs no
repairs and leaves the image byte-for-byte unchanged, and preen mode
(-p), which attempts reconnection but does not clear lost chains.

MFC after:      1 week
2026-09-02 19:16:22 -07:00
Xin LI 288b27192b Vendor import of file 5.48. 2026-08-15 18:02:11 -07:00
Xin LI fa0dc4f0f9 MFV: less v704.
MFC after:	3 days
2026-08-14 23:21:18 -07:00
Xin LI 156348af10 Vendor import of less v704. 2026-08-14 22:47:57 -07:00
Xin LI 4174cc2f69 release/Makefile.gce: migrate gsutil usages to gcloud CLI
Google Cloud recommends migrating from gsutil to gcloud storage CLI.
Update gce-do-upload target to use `gcloud storage buckets create` and
`gcloud storage cp` instead of `gsutil mb` and `gsutil cp` commands.

PR:		conf/297016
Reviewed by:	lwhsu
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D58464
2026-08-08 00:13:40 -07:00
Xin LI c85542b92a GCE: Apply public-image label on GCE images
Update the GCE image creation process to automatically apply the
'public-image=true' label when publishing new images. This aligns
with standard labeling expectations for images hosted in public
projects.

MFC after:	3 days
2026-06-09 19:33:12 -07:00
Xin LI f7c0bd206f 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:		e949ce9dc0
2026-06-04 21:48:19 -07:00
Xin LI e949ce9dc0 MFV: file 5.47.
MFC after:	3 days
2026-06-02 21:54:25 -07:00
Xin LI 79746c47b9 Vendor import of file 5.47. 2026-06-02 21:37:29 -07:00
Xin LI 8223661346 Revert "zstd: disable weak-symbol tracing hooks in the kernel"
This reverts commit de2ea5423c which is
no longer needed after 1dddb580f9 .

Tested by:	mmel
2026-05-06 01:27:55 -07:00
Xin LI 111a42d7d7 MFV: zstd: Remove entries listed in FREEBSD-Xlist 2026-04-08 21:48:39 -07:00
Xin LI a985740c21 Remove entries listed in FREEBSD-Xlist. 2026-04-08 21:48:08 -07:00
Xin LI c0d9a07101 MFV: zstd 1.5.7.
MFC after:	2 weeks
Relnotes:	yes
2026-04-08 14:22:45 -07:00
Xin LI 7e509d5085 Import zstd 1.5.7. 2026-04-07 21:01:57 -07:00
Xin LI f81c1f4339 MFV: xz 5.8.3.
Security:	CVE-2026-34743
MFC after:	3 days
2026-03-31 18:45:14 -07:00
Xin LI 788f701923 Vendor import of xz 5.8.3 (trimmed) 2026-03-31 18:35:39 -07:00
Xin LI 7aa1dba6b0 MFV: zlib 1.3.2.
Relnotes:	yes
MFC after:	2 weeks
2026-03-13 23:49:53 +00:00
Xin LI 280d433d4c Vendor import of zlib 1.3.2. 2026-03-13 23:48:36 +00:00
Xin LI 8dd28e13e4 libc/quad: fix missing closing #endif in Symbol.map
Without this lib32 libc.so.7 would be missing critical symbols,
including malloc / free and all syscall wrappers.
2026-03-06 00:22:06 -08:00
Xin LI e2abec625b MFV: less v692. 2026-02-20 21:33:50 -08:00
Xin LI 4be8b0bdec Vendor import of less v692. 2026-02-20 21:19:41 -08:00
Xin LI c408e7413b Vendor import of less v691. 2026-02-01 22:24:58 -08:00
Xin LI 4f7336a93c etcupdate: Do not ignore empty files.
PR:		bin/292773
Reviewed by:	markj
MFC after:	1 week

Differential Revision: https://reviews.freebsd.org/D54935
2026-02-04 19:44:26 -08:00
Xin LI dafba19e42 MFV less v691
Relnotes:	yes
MFC after:	2 weeks
2026-02-02 12:50:35 -08:00
Xin LI 53d6b23765 cron.8: clarify system crontab format
PR:		234504
MFC after:	1 week
2026-01-20 22:33:48 -08:00
Xin LI 12444a4da5 cron: Implement full PAM session lifecycle for user jobs
Extend PAM integration beyond account checks to include credential
establishment and session management, allowing PAM modules to configure
the execution environment for user cron jobs.

Previously, cron only called pam_acct_mgmt() to verify account validity
but immediately terminated the PAM handle before job execution. This
prevented PAM modules from establishing sessions, setting credentials
(e.g., Kerberos tickets), or exporting environment variables needed by
jobs.

The PAM handle now persists in the intermediate process throughout the
job execution, enabling proper session open/close pairing. Credentials
are established and sessions opened while still running as root, before
dropping privileges in the grandchild. PAM environment variables are
exported in the job process with user crontab variables taking precedence.

A session rule (pam_permit.so) is added to /etc/pam.d/cron to enable
session support without changing default behavior. Administrators can
replace this with other modules as needed.

System crontab entries continue to bypass all PAM operations.

PR:		bin/244844
Reviewed by:	des
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D54415
2026-01-20 18:47:16 -08:00
Xin LI 8e6843db9b libc: drop NO_FP_LIBC support
NO_FP_LIBC was added in 2004 to save space by disabling FP support in
*printf()/*scanf(). The size benefit is negligible on modern systems
and conflicts with assumptions made by current base utilities.

Remove the option and always build libc with floating-point support.

Reported by:	Oskar Holmlund <eovholmlund at gmail com>
MFC after:	2 weeks
2026-01-16 22:43:40 -08:00
Xin LI 8f41677ea4 copyright: Happy New Year 2026!
We are now one quarter into the 21st century.
2026-01-01 00:29:23 +00:00
Xin LI ae12432049 MFV 762f11d98d: xz 5.8.2.
MFC after:	7 days
2025-12-23 00:24:13 -08:00
Xin LI 762f11d98d Vendor import of xz 5.8.2 (trimmed) 2025-12-21 16:14:28 -08:00
Xin LI f9500e7579 shutdown(8): Document additional formats supported by the code.
MFC after:	1 week
2025-12-08 21:46:24 -08:00
Xin LI d5cb458b4b MFV: less v685.
MFC after:	3 days
2025-11-10 00:55:06 -08:00
Xin LI a1320769a9 Vendor import of less v685. 2025-11-10 00:42:45 -08:00
Xin LI 40d2161838 cron: Use reallocarray() to prevent integer overflow
Apply OpenBSD env.c,v 1.24 and 1.25, which replaces manual size
calculations with reallocarray() to prevent possible integer
overflow.

MFC after:	3 days
2025-11-02 21:59:46 -08:00
Xin LI 5863197933 libbz2: add pkg-config file (bzip2.pc)
Add generation of a bzip2.pc file for use with pkg-config and create
a basic template as bzip2.pc.in.

This allows other software to easily locate and link against libbz2
using standard pkg-config mechanisms instead of manual compiler and
linker flags.

The version number is extracted automatically from bzlib.h to keep
it consistent with the library sources.

Tested:	pkg-config --exists --print-errors "bzip2 >= 1.0.9" (fail, expected)
	pkg-config --exists --print-errors "bzip2 >= 1.0" (succeeded)
	pkg-config --libs bzip2 (-lbz2)
	pkg-config --cflags bzip2 ()

MFC after:	3 days
2025-10-09 22:35:54 -07:00
Xin LI a8fa7ccb47 Vendor import of expat 2.7.3. 2025-09-28 21:20:40 -07:00
Xin LI 14feafd16d Vendor import of expat 2.7.2. 2025-09-18 19:01:56 -07:00
Xin LI 8d485a8490 MFV: expat 2.7.3.
MFC after:	3 days
2025-09-28 21:28:12 -07:00
Xin LI 627b778d9e MFV: libexpat 2.7.2
MFC after:	3 days
2025-09-18 19:43:17 -07:00
Xin LI 39d668f1e0 newsyslog(8): Remove the -c command line option.
The -c command-line option, which allowed setting a global compression
method, is removed in favor of the <compress> directive in newsyslog.conf.

The motivation of this change is to eliminate a source of potential confusion.
Since newsyslog(8) is typically invoked by cron(8), having a command line
option that can override it could cause inconsistent behavior (specifying
in crontab would take precedence).

Suggested by:	karels
Differential Revision: https://reviews.freebsd.org/D43466
2025-09-01 23:44:12 -07:00
Xin LI 5853a9971a vmm: library version bump
PR:		misc/288780
Fixes:		a4197ea477
2025-08-11 00:44:05 -07:00
Xin LI 76bafc9069 MFV: less v679.
MFC after:	2 weeks
2025-07-20 10:33:52 -07:00
Xin LI 9006df9a94 Vendor import of less v679. 2025-07-20 10:26:39 -07:00
Xin LI 119fb2a288 sh(1): Do not interpret chdir to "" as equivalent to chdir with no argument
A script that does the following:

    cd "${dir}" || exit 1

would incorrectly remain in the current directory when `${dir}` is
an empty string under the current implementation. This behavior,
while historical, is potentially dangerous, as it is likely not
what the script author intended.

Change the command to treat an empty string as an error and emit a
diagnostic message to standard error, as required by
IEEE Std 1003.1-2024.

PR:		standards/287440
Test Plan:	kyua test bin/sh
Relnotes:	yes
Differential Revision: https://reviews.freebsd.org/D50974
2025-07-01 22:09:29 -07:00
Xin LI 252d6dde57 MFV: less v678.
MFC after:	2 weeks
2025-05-19 20:44:02 -07:00
Xin LI 48b0a08b87 Vendor import of less v678. 2025-05-18 22:51:42 -07:00
Xin LI 991ed10e39 Revert "newsyslog(8): Disable compression by default in newsyslog.conf."
This reverts commit 83507f9e6f.

Requested by:	olce
2025-05-07 20:43:01 -07:00
Xin LI 83507f9e6f newsyslog(8): Disable compression by default in newsyslog.conf.
Historically, newsyslog compressed rotated log files to save disk space.
This was helpful when storage was limited. However, with modern files
systems like ZFS providing built-in compression and with larger disks
now common, the benefits of additional log compression have diminished,
especially given the inconvenience of needing to decompress logs when
searching for specific patterns.

This change updates the default /etc/newsyslog.conf to specify:

	<compress> none

disabling compression for new installations or default setups.
It does not modify the behavior of the newsyslog utility itself; users
can still enable compression as needed via configuration.

MFC:		never
Reviewed by:	zlei, dvl, otis
Relnotes:	yes

Differential Revision: https://reviews.freebsd.org/D43169
2025-05-04 00:49:28 -07:00
Xin LI 128836d304 MFV: xz 5.8.1.
PR:		bin/286252
MFC after:	1 week
2025-05-04 00:06:22 -07:00
Xin LI d5931764df sys/modules/vmm: ${CFLAGS:N-flto} -> ${CFLAGS:N-flto*}
Fixes: 12a6257a96

Differential Revision: https://reviews.freebsd.org/D49940
2025-05-03 01:55:05 -07:00
Xin LI 12eff5f0d8 Vendor import of xz 5.8.1 (trimmed) 2025-05-03 01:54:10 -07:00
Xin LI 7f8f120439 libmagic: Unbreak for older FreeBSD releases.
byteswap.h is introduced in FreeBSD 13.2 but was not available in
earlier versions.  In order to support upgrading from an earlier
FreeBSD release we would need to tell the build system that fact.

PR:		bin/273736
Reported by:	philip
MFC after:	3 days
2025-01-07 20:42:16 -08:00
Xin LI b55baa8139 copyright: Happy New Year 2025 2025-01-01 00:04:28 +00:00
Xin LI 26743408e9 MFV: xz 5.6.3
MFC after:	2 weeks
2024-12-09 07:20:04 -08:00
Xin LI 956197bcea Vendor import of xz 5.6.3 (trimmed) 2024-12-09 00:42:41 -08:00
Xin LI c77c488926 MFV: less v668.
MFC after:	2 weeks
2024-12-08 21:22:12 -08:00
Xin LI 8c9fd10071 Vendor import of less v668. 2024-12-08 20:30:02 -08:00
Xin LI 908f215e80 MFV: expat 2.6.4.
MFC after:      2 weeks
2024-12-08 20:25:01 -08:00
Xin LI 7277ee2465 Vendor import of expat 2.6.4. 2024-12-08 11:17:41 -08:00
Xin LI ae316d1d1c MFV: file 5.46.
MFC after:	2 weeks
2024-12-08 11:08:17 -08:00
Xin LI 995a16e0c2 Vendor import of file 5.46. 2024-12-07 15:01:45 -08:00
Xin LI 3df1abdfd9 Revise qsort(3 reflect POSIX.1-2024 update.
Reviewed by:	emaste, trasz
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D47262
2024-10-25 00:31:50 -07:00
Xin LI 8a607939de Update leap-seconds to leap-seconds.3676924800
Obtained from:  ftp://ftp.boulder.nist.gov/pub/time/leap-seconds.3676924800
MFC after:      3 days
2024-06-18 19:10:33 -07:00
Xin LI 3b35e7ee8d MFV: xz 5.6.2.
MFC after:	4 weeks
2024-06-03 18:14:43 -07:00
Xin LI b599c3410c Vendor import of xz 5.6.2 (trimmed) 2024-06-02 22:49:22 -07:00
Xin LI 51c69c8682 amdsmn(4), amdtemp(4): add support for AMD Family 19h Models 10h-1Fh.
Tested on AMD Threadripper 7960X.

PR:		kern/278311
Tested by:	jbo
MFC after:	1 week
2024-04-14 00:52:08 -07:00
Xin LI 5ffb19ac36 Backport export of lzma_mt_block_size symbol.
This restores binary compatibility against liblzma 5.6.0 library.

PR:		278127
MFC after:	3 days
2024-04-04 23:39:33 -07:00
Xin LI 2f9cd13d6c Revert "MFV: xz 5.6.0"
This commit reverts 8db56defa7,
rolling back the vendor import of xz 5.6.0 and restoring the
package to version 5.4.5.

The revert was not directly due to the attack (CVE-2024-3094):
our import process have removed the test cases and build scripts
that would have enabled the attack. However, reverting would
help to reduce potential confusion and false positives from
security scanners that assess risk based solely on version
numbers.

Another commit will follow to restore binary compatibility with
the liblzma 5.6.0 library by making the previously private
symbol (lzma_mt_block_size) public.

PR:		278127
MFC after:	3 days
2024-04-04 23:39:23 -07:00
Xin LI 8db56defa7 MFV: xz 5.6.0.
MFC after:	2 weeks
2024-02-25 15:46:22 -08:00
Xin LI a7819ed7ad Vendor import of xz 5.6.0 (trimmed) 2024-02-25 11:07:28 -08:00
Xin LI aea57ebcb1 zlib: use more memory for a small deflate speedup.
The LIT_MEM option uses slightly more memory (for base gzip(1),
about 16kiB; according to the author, about 6% for default deflate
settings) for a small speedup.

The performance gain is more noticeable for input data with higher
entropy and less significant for data that is highly compressible,
such as source code and logs.

MFC after:	1 month
2024-02-19 15:01:04 -08:00
Xin LI 6255c67c3d MFV: zlib 1.3.1.
MFC after:	1 week
2024-02-17 22:12:51 -08:00
Xin LI f4695a3026 Vendor import of zlib 1.3.1. 2024-02-17 19:43:52 -08:00
Xin LI 4543ef5166 MFV: expat 2.6.0.
MFC after:	3 days
2024-02-17 14:04:14 -08:00
Xin LI 345cf360f8 Vendor import of expat 2.6.0 2024-02-17 13:54:42 -08:00
Xin LI 72dd306e44 releng-gce: Advertise the availability of UEFI support in GCE images.
The amd64 and arm64 images supported UEFI, mark it as so users can take
advantage of UEFI boot on GCE.  This is already done on FreeBSD
14.0-RELEASE but never codified into the release tools (and should).

PR:		conf/276532
Reviewed by:	lwhsu
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D43557
2024-01-26 19:09:39 -08:00
Xin LI e872a4013f releng-gce: Advertise the availability of gVNIC support in GCE images.
This marks FreeBSD GCE images as gVNIC capable by adding the
--guest-os-features=GVNIC flag at creation time as suggested in GCE
documentation[1].  This allows Generation 3 and newer GCE instances
to leverage advanced networking capabilities and performance
enhancements provided by gVNIC.  Users will benefit from these
improvements without needing to create custom images.

[1] https://cloud.google.com/compute/docs/networking/using-gvnic#create_a_vm_with_gvnic_support

Reviewed by:	cperciva
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D43411
2024-01-11 21:38:04 -08:00
Xin LI 2f036705f3 Document the two recent newsyslog(8) change (-c option and <compress>
configuration option).
2023-12-29 00:45:52 -08:00
Xin LI 61174ad88e newsyslog(8): Add support of specifying compression method in configuration file.
Administrators can now specify a global compression method directly
at the beginning of the newsyslog.conf file, for example:

	<compress> none

Relnotes:	yes
Reviewed by:	dvl
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D43174
2023-12-29 00:32:26 -08:00
Xin LI 906748d208 newsyslog(8): Add option to globally override compression method.
Historically, newsyslog compressed rotated log files to save disk space.
This was useful in the early days. However, with modern file systems like
ZFS offering native compression, and with the availability of larger hard
drives, the benefits of additional compression have become less significant.
This is particularly true considering the inconvenience of decompressing
log files when searching for specific patterns.

Additionally, the original implementation of compression methods was not
future-proof.  As a result, we have redefined the J, X, Y, Z flags to
signify "treat the file as compressible" rather than "compress the file
with that specific method."

A new command-line option, -c, has been introduced to allow overriding
these settings in a more future-proof way. The available choices are:

 * none			 - do not compress, regardless of flag.
 * legacy		 - historical behavior: J=bzip2, X=xz, Y=zstd, Z=gzip.
 * bzip2, xz, zstd, gzip - apply the specified compression method.

Currently, the default is set to 'legacy' to preserve historical behavior.
However, our intention is to change this default to 'none' in FreeBSD 15.0.

Additionally, this update changes the default settings for zstd to use
multithreading and long-range options, better aligning with its intended
use.

Inspired by D42961 .

Reviewed by:	debdrup (earlier version, mdoc(7))
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D43165
2023-12-22 22:46:33 -08:00
Xin LI 3b3195f676 periodic/daily/480.leapfile-ntpd: only attempt to refresh leap-seconds.list
when ntpd is enabled.

The leap-seconds.list is used exclusively by ntpd, therefore, do not bother
to perform the fetch when ntpd is not enabled.

PR:		conf/275419
Reviewed by:	cy, michaelo, imp
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D42875
2023-12-02 23:00:32 -08:00
Xin LI 832c63f5e0 Update leap-seconds to leap-seconds.3676924800
Obtained from:  ftp://ftp.boulder.nist.gov/pub/time/leap-seconds.3676924800
MFC after:	3 days
2023-11-25 17:13:23 -08:00
Xin LI ca6a6373bd MFV: xz 5.4.5
MFC after:	2 weeks
2023-11-25 17:02:59 -08:00
Xin LI 039b23c923 Vendor import of xz 5.4.5 (trimmed) 2023-11-25 16:53:12 -08:00
Xin LI 8f75390c66 file: Support testing multiple magic files.
This is based on upstream b74150490be904801378b2712fe0d532e1700124
but adapted to ATF.

Reviewed by: [email protected], markj, vangyzen
Differential Revision: https://reviews.freebsd.org/D42129
2023-10-09 10:44:42 -07:00
Xin LI 9047451891 Disable byteswap.h for now.
Ideally we should be testing __FreeBSD_version (1400079) and/or
BOOTSTRAPPING from an older version, but restore compatibility to
older FreeBSD versions and macOS while we find out a better way to
fix it.
2023-09-11 23:24:08 -07:00
Xin LI 898496ee09 MFV: file 5.45.
MFC after:	3 days
2023-09-10 12:21:16 -07:00
Xin LI 72d4668c77 Vendor import of file 5.45. 2023-09-09 21:50:07 -07:00