Karel Zak [Tue, 30 Jun 2026 10:49:26 +0000 (12:49 +0200)]
libsmartcols: reject large interval repetition bounds in filter regex
ERE interval expressions like {,32232} cause glibc regcomp() to
allocate gigabytes for the NFA, triggering OOM even on tiny inputs.
The existing consecutive-quantifier and nested-group checks do not
catch this pattern.
Scan numbers inside {...} and reject any bound exceeding
SCOLS_FILTER_MAX_REPCNT (1024). Document the new limit in
scols-filter(5).
Addresses: https://oss-fuzz.com/testcase-detail/6017673394454528 Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 30 Jun 2026 08:37:06 +0000 (10:37 +0200)]
Merge branch 'PR/libmount-utab-uniqid' of https://github.com/karelzak/util-linux-work
* 'PR/libmount-utab-uniqid' of https://github.com/karelzak/util-linux-work:
tests: (mount) strip UNIQID= from utab in special test
libmount: merge utab into listmount-based tables
libmount: use uniq_id for target mount verification
libmount: add mnt_fs_fetch_ids() and populate uniq_id for utab
libmount: fix missing space after UNIQID= in utab
libmount: copy uniq_id in mnt_copy_fs()
Chris Webb [Mon, 29 Jun 2026 15:37:27 +0000 (15:37 +0000)]
unshare: Fix --map-auto regression
Commit 07935158 fixed an unshare --user bug which wasted a UID/GID when
--map-auto was used with --map-root-user. This bug meant that, for example,
a user with a single extra UID and GID delegated to them in /etc/subuid
and /etc/subgid would not get that user or group mapped at all if they
attempted unshare -r --map-auto.
Two years later, commit b64b769b added unshare --map-subids to identity-map
subuids and subgids into a user namespace, but incorrectly removed a
load-bearing 'else if' in passing, and reintroduced the original bug.
Ironically, map->inner != -1 for an identity mapping, so the 'if' vs
'else if' change has no effect on the --map-subids option; it only breaks
--map-auto.
Karel Zak [Mon, 29 Jun 2026 11:58:35 +0000 (13:58 +0200)]
docs: remove obsolete mount.txt, update AUTHORS
Move mount/umount original authors (Doug Quale, H.J. Lu,
Rick Sladkey, Stephen Tweedie) to the AUTHORS file. Remove
the obsolete Documentation/mount.txt with its pre-libmount
developer notes.
Karel Zak [Mon, 29 Jun 2026 11:56:25 +0000 (13:56 +0200)]
docs: integrate release-schedule.txt into HOWTO-CONTRIBUTING.md
Move the release schedule and RC cadence information into the
HOWTO-CONTRIBUTING.md file. Drop the "Release criteria" section
as tests should always pass regardless of release status.
Karel Zak [Mon, 29 Jun 2026 11:54:10 +0000 (13:54 +0200)]
docs: replace howto-*.txt with HOWTO-*.md and add AGENTS.md
Replace the eight Documentation/howto-*.txt files with four consolidated
markdown documents:
HOWTO-BUILDING.md - compilation and build system internals
HOWTO-CONTRIBUTING.md - contribution guidelines and PR workflow
HOWTO-HACKING.md - usage functions, man pages, debugging
HOWTO-TESTING.md - test framework, env variables, fuzz targets
Add AGENTS.md to the project root with AI-specific coding guidance
(code style pitfalls, return conventions, memory management, commit
message format) and links to the new documentation files.
Rename 00-about-docs.txt to 00-about-docs.md with updated references.
Karel Zak [Thu, 25 Jun 2026 12:52:21 +0000 (14:52 +0200)]
libmount: merge utab into listmount-based tables
Extract utab merge logic from __mnt_table_parse_mountinfo() into a
shared mnt_table_merge_utab() function and call it at the end of
mnt_table_fetch_listmount(). This makes userspace mount options
(x-systemd.*, user=, etc.) available when the mount table is obtained
via listmount/statmount syscalls.
The merge sets user_optstr directly (instead of the combined optstr)
to avoid conflicts with lazy statmount() which populates kernel
options on demand.
Add mnt_table_disable_useropts() public API to allow callers to skip
utab merging when only kernel-side data is needed.
Use the new API in findmnt --kernel=listmount to keep backward
compatible behavior (kernel-only data); users who want userspace
options can use --mtab.
Karel Zak [Thu, 25 Jun 2026 10:32:46 +0000 (12:32 +0200)]
libmount: use uniq_id for target mount verification
Prefer the unique mount ID (STATX_MNT_ID_UNIQUE) over the old mount ID
when verifying that a mount landed on the expected target in
mnt_context_reopen_target_fd(). Fall back to the old ID when uniq_id is
not available.
Karel Zak [Thu, 25 Jun 2026 10:32:31 +0000 (12:32 +0200)]
libmount: add mnt_fs_fetch_ids() and populate uniq_id for utab
Add mnt_fs_fetch_ids() helper that fetches mount IDs from the kernel
via statx(). It prefers STATX_MNT_ID_UNIQUE and falls back to the old
STATX_MNT_ID on older kernels. Accepts an optional fd argument; when
fd < 0 it falls back to path-based lookup via fs->target.
Use it in hook_create_mount() (new mount API) with fd_tree for robust
fd-based ID, and in hook_mount() (legacy mount(2)) after
reopen_target_fd with fd_target when available.
This ensures utab entries contain UNIQID, which is needed for reliable
utab merging with listmount-based tables.
Karel Zak [Thu, 25 Jun 2026 10:17:13 +0000 (12:17 +0200)]
libmount: fix missing space after UNIQID= in utab
The fprintf format for UNIQID= was missing a trailing space separator,
causing the field to run into the next field (e.g.,
"UNIQID=2147492389SRC=tmpfs").
Karel Zak [Thu, 25 Jun 2026 10:17:02 +0000 (12:17 +0200)]
libmount: copy uniq_id in mnt_copy_fs()
The mnt_copy_fs() function copies all filesystem entry fields but
missed uniq_id, causing the unique mount ID to be lost when fs entries
are duplicated (e.g., for utab updates).
WanBingjiang [Thu, 25 Jun 2026 11:08:53 +0000 (19:08 +0800)]
hexdump: stop after stdout write errors
Stop the display loop once stdout reports an error. Otherwise hexdump keeps formatting and writing after the output stream has already failed, which can loop for a long time on errors such as ENOSPC.
Save the errno from the first stdout error before cleanup can overwrite it. Report that saved error from hexdump itself and bypass close_stdout_atexit, as ferror() only preserves the stream error state and does not recover the original errno.
Add a regression test that writes hexdump output to /dev/full and checks that the command fails with the ENOSPC write error.
Karel Zak [Thu, 25 Jun 2026 13:11:19 +0000 (15:11 +0200)]
bitops: avoid macro redefinition on macOS
Newer macOS SDKs provide htobe16/htole16/be16toh/etc. via
<sys/endian.h>. Skip our OSSwap-based definitions when that
header is available to avoid -Wmacro-redefined errors.
Previously, cpu_enable() and cpu_configure() compared the number
of fails with ctx->maxcpus and if equal it returned -1, which
culminated over to an exit code of 1 (failure). Otherwise, if
there were fails but less than ctx->maxcpus the fucntions return
code 1 would result in an exit code 64 indicating partial success.
Since ctx->maxcpus describes the maximum number of CPUs supported
by the kernel, in practice, this failure mode isn't really useful
as it means that a user would need to fail the configuration of
every possible CPU. This is why chcpu(8) almost always returns 64.
It is better to store the actual amount of requested CPUs and then
compare the amount of fails to it and provide more meaningful exit
codes.
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
Karel Zak [Wed, 24 Jun 2026 11:29:16 +0000 (13:29 +0200)]
hwclock, rtcwake: hint about uninitialized RTC on EINVAL
Some RTC drivers (e.g., rtc-nxp-bbnsm) return EINVAL from
RTC_RD_TIME when the hardware time counter has never been
initialized. Print a hint so users know the likely cause rather
than just seeing "Invalid argument".
Karel Zak [Wed, 24 Jun 2026 11:22:12 +0000 (13:22 +0200)]
cfdisk: handle SIGHUP to avoid busy-loop on terminal loss
When the controlling terminal disappears (e.g., a web terminal
session is closed), the kernel sends SIGHUP. Without handling it,
cfdisk's getch() returns ERR in a tight loop, causing 100% CPU
usage indefinitely.
Register SIGHUP with the existing sig_handler_die() so that all
loops exit via the existing sig_die checks.
Karel Zak [Wed, 24 Jun 2026 09:56:34 +0000 (11:56 +0200)]
meson: add compile test for scandirat()
The link-only has_function() check is not sufficient on macOS where
scandirat() may exist in the SDK but is gated behind availability
annotations (e.g. macOS 26.4+). When the deployment target is older,
clang emits -Wunguarded-availability-new which -Werror turns into a
build failure.
Add a compile+link verification after the bulk function check to
detect this and disable HAVE_SCANDIRAT when the function is not
actually usable.
lijian [Wed, 24 Jun 2026 09:26:41 +0000 (11:26 +0200)]
fdisk: clean up dead code in resize_partition()
Remove unused variables 'pa', 'next', 'tb' and their corresponding
fdisk_unref_partition()/fdisk_unref_table() calls in the cleanup
path -- all three are initialized to NULL and never reassigned.
[kzak@redhat.com: - fix identification, remove also 'tb']
Signed-off-by: lijian <lijian01@kylinos.cn> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 23 Jun 2026 14:21:39 +0000 (16:21 +0200)]
libsmartcols: reject pathological regex patterns in filter
Consecutive ERE quantifiers (e.g. a++, a**) and nested group
repetitions (e.g. (a+)+) cause glibc regcomp() to allocate gigabytes
for the NFA, triggering OOM on small inputs.
Reject such patterns in filter_compile_param() before they reach
regcomp(), and limit regex pattern size to SCOLS_FILTER_MAX_REGSZ (256
bytes). Document all filter expression limits in scols-filter(5).
Addresses: https://github.com/util-linux/util-linux/pull/4436 Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 23 Jun 2026 09:52:30 +0000 (11:52 +0200)]
libsmartcols: harden filter parser against fuzzer issues
Reject non-param nodes in filter_compile_param() to prevent
type confusion when the parser passes an expression node as
a regex operand (heap-use-after-free / heap-buffer-overflow).
Limit filter expression size to SCOLS_FILTER_MAX_EXPRSZ to prevent
pathological inputs from causing unbounded memory growth in the parser
(OOM).
Addresses: https://github.com/util-linux/util-linux/pull/4430 Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 23 Jun 2026 09:07:30 +0000 (11:07 +0200)]
libsmartcols: fix memory leak in filter reset
When parsing fails, filter params allocated during parsing but never
incorporated into the AST tree remain on the fltr->params list. The
reset_filter() only freed the tree via fltr->root, leaving orphaned
params leaked.
Add filter_free_params() to drain any remaining params from the list
during filter reset.
Addresses: https://github.com/util-linux/util-linux/pull/4430 Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Mon, 22 Jun 2026 08:41:51 +0000 (10:41 +0200)]
libsmartcols: fix SEGV in filter_compile_param()
The val union in filter_param can hold different types (str, num, fnum,
boolean). When a non-string param (e.g. a number) is used as a regex
operand, the numeric value gets reinterpreted as a pointer through
val.str. A small number like 2 becomes pointer 0x2, which passes the
existing NULL check but crashes in regcomp().
Add a type check to reject non-string params before accessing val.str.
Addresses: https://github.com/util-linux/util-linux/pull/4430 Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Mon, 22 Jun 2026 09:43:39 +0000 (11:43 +0200)]
fincore: move sys/syscall.h include where it's needed
Move the sys/syscall.h include inside the #ifndef HAVE_CACHESTAT block,
since it's only needed for the fallback SYS_cachestat definition. Also
clean up indentation of nested #ifdefs.
Matt Van Horn [Mon, 22 Jun 2026 08:58:11 +0000 (01:58 -0700)]
agetty: handle systems without a shell or /bin/login
When the login program (default /bin/login, or the one set with
--login-program) is missing or not executable, logging in is impossible.
Previously agetty still displayed the issue file and prompted for a
username, producing a confusing dead end.
Before prompting, check whether the login program is executable with
access(X_OK). If it is not, print a short banner ("This system does not
permit logins." by default, configurable with --nologin-message) and
wait for the user to press Enter, then re-check so an administrator who
installs the login program at runtime can proceed without a reboot. The
normal prompt flow is unaffected when the login program exists.
Add --nologin-message to override the banner text and document the new
behavior in agetty.8.adoc.
Karel Zak [Mon, 22 Jun 2026 08:25:12 +0000 (10:25 +0200)]
libfdisk: fix OOM on GPT with huge partition entries array
Add sanity checks to gpt_read_entries() to prevent out-of-memory when
reading a crafted GPT header with an absurdly large npartition_entries
value. The entries array size is now limited by:
- GPT_NPARTITIONS_MAX hard cap (~4MiB)
- first_usable_lba, since entries must fit before the first usable sector
Also reorder validation in gpt_read_header() to perform all cheap
header-only checks (my_lba, LBA sanity) before attempting to allocate
and read the entries array.
Addresses: https://github.com/util-linux/util-linux/issues/4432 Signed-off-by: Karel Zak <kzak@redhat.com>
Xi Ruoyao [Sat, 20 Jun 2026 18:02:41 +0000 (02:02 +0800)]
fincore: include sys/syscall.h if available
Without sys/syscall.h, we fall back to the hand-brew logic for
SYS_cachestat. The hand-brew code has a special case for Alpha, but
there are more cases where cachestat has a different syscall number, for
example MIPS.
rawrmonster17 [Fri, 19 Jun 2026 05:17:45 +0000 (00:17 -0500)]
lscpu: fix NULL+offset dereference in cpuinfo_parse_cache()
strstr() returns NULL when the needle is absent. In two places the
return value had a constant offset added before the NULL guard:
p = strstr(data, "scope=") + 6;
if (!p ...) /* dead: p is (char*)6 if absent */
p = strstr(data, "type=") + 5;
if (!p || !*p) /* same: p is (char*)5 if absent */
When the field is missing from the cpuinfo cache line, p becomes a
low non-NULL address (CWE-476 / CWE-823). The !p guard is dead, so
strncmp() or the *p dereference immediately faults.
Fix by moving the arithmetic after the NULL check, matching the
correct pattern already used for "level=", "size=", "line_size=", and
"associativity=" in the same function.
aizu-m [Thu, 18 Jun 2026 07:59:31 +0000 (13:29 +0530)]
lscpu: fix out-of-bounds read in parse_dmi_table
parse_dmi_table() walks the SMBIOS structures from the firmware DMI
table. The loop only checks that the 4-byte header fits (data + 4 <=
buf + len) and that h.length >= 4. It then reads the type 0/1/4 fields
at fixed offsets up to data[0x28] and hands the string-number bytes to
dmi_string(), which walks the structure's string set. So a truncated
final structure, where h.length, a field offset or the string set runs
past the end of the table, is read out of bounds; the bytes end up in
the CPU model/vendor strings lscpu prints. The table comes from
/sys/firmware/dmi/tables, or from /dev/mem when probing a hypervisor.
Gate each field read on h.length and stop once a structure (formatted
area plus its string set) no longer fits in the buffer, the way
dmidecode bounds these reads.
dongshengyuan [Thu, 11 Jun 2026 05:22:04 +0000 (13:22 +0800)]
fsck: refactor is_irrotational_disk() to use ul_path_readf_s32()
Replace the open-coded snprintf + fopen + fscanf + fclose pattern
with ul_new_path() + ul_path_readf_s32() + ul_unref_path() from lib/path.c.
Suggested-by: Karel Zak <kzak@redhat.com> Signed-off-by: dongshengyuan <dongshengyuan@uniontech.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Karel Zak [Wed, 17 Jun 2026 09:18:18 +0000 (11:18 +0200)]
libfdisk: fix memory leak in read_pte() error path
Don't assign the sector buffer to the partition table entry until
read_sector() succeeds. On failure, free the buffer immediately
instead of leaving it in a partially initialized pte.
Addresses: https://github.com/util-linux/util-linux/pull/4423 Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Wed, 27 May 2026 10:38:16 +0000 (12:38 +0200)]
libmount: add mount ID verification and man page TOCTOU note
Verify mount ID after re-opening the target fd to ensure the mount
landed on the expected target. The expected ID is set from fd_tree
in hook_create_mount() (new mount API only).
Add WARNING to mount.8 about the inherent TOCTOU limitation of the
legacy mount(2) syscall for non-superuser mounts.
Karel Zak [Wed, 27 May 2026 10:21:02 +0000 (12:21 +0200)]
libmount: use fd_target in hook_idmap for move_mount()
Use the pinned fd_target with MOVE_MOUNT_T_EMPTY_PATH for restricted
users instead of string-based move_mount(). Re-open the target fd
after mount to point to the mounted filesystem root.
Karel Zak [Wed, 27 May 2026 10:20:06 +0000 (12:20 +0200)]
libmount: restrict X-mount.subdir for non-root to Linux >= 6.15
The old-kernel subdir path uses namespace unsharing and string-based
move_mount() which is unsafe for restricted users (TOCTOU). The safe
detached subdir open requires Linux >= 6.15.
Karel Zak [Tue, 16 Jun 2026 09:15:19 +0000 (11:15 +0200)]
libmount: use fd-based fchownat/chmod in hook_owner
Replace path-based lchown()/chmod() with fd-based operations in the
X-mount.{owner,group,mode} post-mount hook.
For restricted users the fd_target is pinned in prepare_target() and
re-opened after mount in hook_attach_target() to point to the mounted
filesystem root. For root a local O_PATH fd is opened. Ownership is
changed via fchownat(fd, "", ..., AT_EMPTY_PATH), mode via
/proc/self/fd/N.
This prevents TOCTOU attacks where an ancestor directory is swapped
between mount and the chmod/chown operations.
CVE-2026-53612
Reported-by: Xinyao Hu <ctf_0x01@foxmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 16 Jun 2026 08:58:32 +0000 (10:58 +0200)]
libmount: fix SUID bypass via LIBMOUNT_FORCE_MOUNT2 and legacy mount path
Use safe_getenv() for LIBMOUNT_FORCE_MOUNT2 to ignore the variable
in SUID context, consistent with LIBMOUNT_FSTAB and other sensitive
environment variables.
Additionally, refuse multi-step mount(2) sequences (bind+remount and
propagation) for restricted (non-root) users in the legacy mount path.
The two-step approach has a window between syscalls where security
flags (nosuid, noexec, ...) are not yet applied. The new mount API
handles this atomically.
CVE-2026-53614
Reported-by: Xinyao Hu <ctf_0x01@foxmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Thu, 7 May 2026 10:50:48 +0000 (12:50 +0200)]
libblkid: fix use-after-free in nested partition probing
The partitions list stores partitions in a contiguous array grown by
reallocarray(). When the array is reallocated to a new address, all
existing blkid_partition pointers (tab->parent, ls->next_parent, local
parent variables in nested probers) become dangling.
Fix this by changing the storage from an array of structs to an array
of pointers, where each partition is individually allocated via
calloc(). This makes all blkid_partition pointers stable across
reallocations -- only the pointer array itself may move, which is
harmless since no code caches pointers into the pointer array.
This eliminates the need for callers to re-fetch parent pointers after
every blkid_partlist_add_partition() call.
Reported-by: Thai Duong <thaidn@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Zephyr Li [Tue, 16 Jun 2026 07:56:48 +0000 (15:56 +0800)]
lscpu: riscv: preserve ISA extension order
The Linux RISC-V UABI defines the canonical ISA string order in /proc/cpuinfo. Do not sort multi-letter extensions alphabetically in lscpu; keep the kernel-provided order and only replace separators for display.
Karel Zak [Tue, 16 Jun 2026 07:24:40 +0000 (09:24 +0200)]
tests: handle ENOSYS in multiplexing syscall tests
On ppc64le, __NR_select is defined at compile time, so test_mkfds -W
lists "select" as available. However, the kernel returns ENOSYS at
runtime. The helper process prints its PID, then calls select() which
fails immediately with ENOSYS. This creates a race where the bash
script's kill -0 liveness check can succeed while the process is
still dying, causing lsfd to run against a dead process and produce
wrong output.
Exit with EXIT_ENOSYS (23) instead of EXIT_FAILURE when the
multiplexer syscall returns ENOSYS. This applies to both
DEFUN_WAIT_EVENT_SELECT and DEFUN_WAIT_EVENT_POLL macros.
In the bash test, check the wait exit code for 23 after the coproc
finishes and skip the subtest cleanly.
Karel Zak [Mon, 15 Jun 2026 11:15:01 +0000 (13:15 +0200)]
libmount: detect fanotify queue overflow in monitor
When the fanotify event queue overflows under sustained mount churn,
the kernel sends a FAN_Q_OVERFLOW event. The fanotify_next_fs() function
did not check for this, causing it to access invalid memory (the
overflow event carries no fanotify_event_info_mnt payload) and silently
drop the overflow notification. The consumer never learned that events
were lost, so its mount-unit view could permanently diverge from the
kernel.
Detect FAN_Q_OVERFLOW, discard the remaining buffered events (they are
unreliable after an overflow), and return -EOVERFLOW so the caller can
perform a full rescan.
Karel Zak [Mon, 15 Jun 2026 10:35:01 +0000 (12:35 +0200)]
Merge branch 'master' of https://github.com/ZephyrLi-pro/util-linux-c
* 'master' of https://github.com/ZephyrLi-pro/util-linux-c:
lscpu: add RISC-V MMU column support
lscpu: show RISC-V MMU mode
lscpu: free cputype ISA string
Karel Zak [Mon, 15 Jun 2026 09:54:11 +0000 (11:54 +0200)]
docs: setpriv: improve EXAMPLES section
Clarify that setpriv is not a 1:1 replacement for su/runuser/sudo,
add --inh-caps=-all to the basic example, and provide additional
examples for environment reset and restrictive privilege dropping.
Fixes: https://github.com/util-linux/util-linux/issues/4402 Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Mon, 15 Jun 2026 09:36:10 +0000 (11:36 +0200)]
mkswap: use fd-based operations to avoid TOCTOU in open_device()
Replace path-based stat()+chmod() with open() first, then fstat()
and fchmod() on the file descriptor. This eliminates the race window
between checking and modifying the file.
Also skip fchmod() when permissions are already 0600.
aizu-m [Sun, 14 Jun 2026 07:43:26 +0000 (13:13 +0530)]
lslogins: bound lastlog2 tty/host copy to destination size
get_lastlog2() copies the TTY and host strings read from the lastlog2
database into heap buffers of sizeof(ut_line)+1 and sizeof(ut_host)+1
bytes, but passed strlen(value)+1 as the mem2strcpy() limit. mem2strcpy()
zero-fills and copies that many bytes regardless of the destination, so a
database value longer than the field overflows the buffer. Cap the limit
to the destination field size, matching the wtmp and plain-lastlog paths
in the same function.
When nsenter is executed with closed stdin, one pid_fd will be 0,
which is a valid file descriptor. But with current code namespace switch
is skipped, leading to incorrect results.
Fixes: f18be0ca5aa7 ("nsenter: use pidfd to enter target namespaces") Signed-off-by: Vladimir Riabchun <vladimir.riabchun@virtuozzo.com>
aizu-m [Wed, 10 Jun 2026 12:44:30 +0000 (18:14 +0530)]
fsck.minix: bound namelen guessed in get_dirsize
get_dirsize() guesses the directory name length from the on-disk root
directory: it doubles a candidate size from 16 up to 512 looking for the
".." entry and sets namelen = size - 2. A crafted image whose first ".."
match lands at offset 514 yields namelen 510, well past MINIX_NAME_MAX
(255). check_file() then does xstrncpy(name_list[name_depth], name,
namelen) into rows of only MINIX_NAME_MAX + 1 bytes, writing out of
bounds past name_list.
Stop the scan once size - 2 would exceed MINIX_NAME_MAX so the guessed
namelen stays within the buffers, falling back to the magic-derived
default.
Karel Zak [Wed, 10 Jun 2026 11:06:26 +0000 (13:06 +0200)]
asciidoctor: fix encoding error for non-ASCII translations
File.read without an explicit encoding uses Ruby's default external
encoding, which depends on the system locale. On systems where it
resolves to US-ASCII (e.g. some Debian configurations), reading
translated man page files with non-ASCII content (such as Arabic)
fails with "source is either binary or contains invalid Unicode data".
Specify encoding: 'UTF-8' explicitly so the string is correctly
tagged regardless of locale.
Fixes: https://github.com/util-linux/util-linux/issues/4409 Signed-off-by: Karel Zak <kzak@redhat.com>