]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
3 months agobuild-sys: update release dates v2.43-devel
Karel Zak [Thu, 26 Feb 2026 10:53:42 +0000 (11:53 +0100)] 
build-sys: update release dates

Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agopo: merge changes
Karel Zak [Thu, 26 Feb 2026 10:47:41 +0000 (11:47 +0100)] 
po: merge changes

3 months agopo-man: merge changes
Karel Zak [Thu, 26 Feb 2026 10:47:27 +0000 (11:47 +0100)] 
po-man: merge changes

3 months agotools/git-tp-sync: fix po/ update
Karel Zak [Thu, 26 Feb 2026 10:46:51 +0000 (11:46 +0100)] 
tools/git-tp-sync: fix po/ update

Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agotools/checkconfig: strip C comments before macro extraction
Karel Zak [Thu, 26 Feb 2026 10:27:48 +0000 (11:27 +0100)] 
tools/checkconfig: strip C comments before macro extraction

Strip C/C++ comments (// line comments, single-line /* */ and
multi-line /* */ blocks) before extracting HAVE_ and ENABLE_ macros.
This avoids false positives from macros mentioned in comments, e.g.
"when HAVE_PIDFD_* ..." in include/pidfd-utils.h.

Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agoinclude/path: fix HAVE_STRUCT_STATX use
Karel Zak [Thu, 26 Feb 2026 10:20:18 +0000 (11:20 +0100)] 
include/path: fix HAVE_STRUCT_STATX use

Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agolib/procfs: remove duplicate statfs_magic.h include
Karel Zak [Thu, 26 Feb 2026 10:13:40 +0000 (11:13 +0100)] 
lib/procfs: remove duplicate statfs_magic.h include

Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agoinclude/mountutils: remove duplicate inttypes.h include
Karel Zak [Thu, 26 Feb 2026 10:11:28 +0000 (11:11 +0100)] 
include/mountutils: remove duplicate inttypes.h include

Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agotools: git-version-bump, accept X.Y-devel version on master branch
Karel Zak [Thu, 26 Feb 2026 09:39:08 +0000 (10:39 +0100)] 
tools: git-version-bump, accept X.Y-devel version on master branch

Allow "X.Y-devel" as a valid version format, restricted to the master
branch only. Release versions (X.Y, X.Y.Z, X.Y-rcN, X.Y.Z-rcN) still
require a stable/vX.Y branch.

Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agopo: update LINGUAS list
Karel Zak [Thu, 26 Feb 2026 09:18:50 +0000 (10:18 +0100)] 
po: update LINGUAS list

3 months agopo: add ar.po (from translationproject.org)
Zayed Al-Saidi [Thu, 26 Feb 2026 09:18:50 +0000 (10:18 +0100)] 
po: add ar.po (from translationproject.org)

3 months agopo: update uk.po (from translationproject.org)
Yuri Chornoivan [Thu, 26 Feb 2026 09:18:50 +0000 (10:18 +0100)] 
po: update uk.po (from translationproject.org)

3 months agopo: update sv.po (from translationproject.org)
Daniel Nylander [Thu, 26 Feb 2026 09:18:49 +0000 (10:18 +0100)] 
po: update sv.po (from translationproject.org)

3 months agopo: update sr.po (from translationproject.org)
Мирослав Николић [Thu, 26 Feb 2026 09:18:49 +0000 (10:18 +0100)] 
po: update sr.po (from translationproject.org)

3 months agopo: update ro.po (from translationproject.org)
Remus-Gabriel Chelu [Thu, 26 Feb 2026 09:18:49 +0000 (10:18 +0100)] 
po: update ro.po (from translationproject.org)

3 months agopo: update pt.po (from translationproject.org)
Pedro Albuquerque [Thu, 26 Feb 2026 09:18:49 +0000 (10:18 +0100)] 
po: update pt.po (from translationproject.org)

3 months agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Thu, 26 Feb 2026 09:18:49 +0000 (10:18 +0100)] 
po: update pl.po (from translationproject.org)

3 months agopo: update nl.po (from translationproject.org)
Benno Schulenberg [Thu, 26 Feb 2026 09:18:49 +0000 (10:18 +0100)] 
po: update nl.po (from translationproject.org)

3 months agopo: update ko.po (from translationproject.org)
Seong-ho Cho [Thu, 26 Feb 2026 09:18:49 +0000 (10:18 +0100)] 
po: update ko.po (from translationproject.org)

3 months agopo: update ja.po (from translationproject.org)
YOSHIDA Hideki [Thu, 26 Feb 2026 09:18:49 +0000 (10:18 +0100)] 
po: update ja.po (from translationproject.org)

3 months agopo: update hr.po (from translationproject.org)
Božidar Putanec [Thu, 26 Feb 2026 09:18:49 +0000 (10:18 +0100)] 
po: update hr.po (from translationproject.org)

3 months agopo: update fr.po (from translationproject.org)
Frédéric Marchal [Thu, 26 Feb 2026 09:18:49 +0000 (10:18 +0100)] 
po: update fr.po (from translationproject.org)

3 months agopo: update es.po (from translationproject.org)
Antonio Ceballos Roa [Thu, 26 Feb 2026 09:18:49 +0000 (10:18 +0100)] 
po: update es.po (from translationproject.org)

3 months agopo: update de.po (from translationproject.org)
Christian Kirbach [Thu, 26 Feb 2026 09:18:49 +0000 (10:18 +0100)] 
po: update de.po (from translationproject.org)

3 months agopo: update cs.po (from translationproject.org)
Petr Písař [Thu, 26 Feb 2026 09:18:49 +0000 (10:18 +0100)] 
po: update cs.po (from translationproject.org)

3 months agopo-man: merge changes
Karel Zak [Thu, 26 Feb 2026 09:18:47 +0000 (10:18 +0100)] 
po-man: merge changes

3 months agopo-man: add sv.po (from translationproject.org)
Daniel Nylander [Thu, 26 Feb 2026 09:18:05 +0000 (10:18 +0100)] 
po-man: add sv.po (from translationproject.org)

3 months agopo-man: add ar.po (from translationproject.org)
Zayed Al-Saidi [Thu, 26 Feb 2026 09:18:05 +0000 (10:18 +0100)] 
po-man: add ar.po (from translationproject.org)

3 months agopo-man: update uk.po (from translationproject.org)
Yuri Chornoivan [Thu, 26 Feb 2026 09:18:05 +0000 (10:18 +0100)] 
po-man: update uk.po (from translationproject.org)

3 months agopo-man: update sr.po (from translationproject.org)
Мирослав Николић [Thu, 26 Feb 2026 09:18:05 +0000 (10:18 +0100)] 
po-man: update sr.po (from translationproject.org)

3 months agopo-man: update ro.po (from translationproject.org)
Remus-Gabriel Chelu [Thu, 26 Feb 2026 09:18:05 +0000 (10:18 +0100)] 
po-man: update ro.po (from translationproject.org)

3 months agopo-man: update pl.po (from translationproject.org)
Michał Kułach [Thu, 26 Feb 2026 09:18:04 +0000 (10:18 +0100)] 
po-man: update pl.po (from translationproject.org)

3 months agopo-man: update es.po (from translationproject.org)
Antonio Ceballos Roa [Thu, 26 Feb 2026 09:18:04 +0000 (10:18 +0100)] 
po-man: update es.po (from translationproject.org)

3 months agopo-man: update de.po (from translationproject.org)
Mario Blättermann [Thu, 26 Feb 2026 09:18:04 +0000 (10:18 +0100)] 
po-man: update de.po (from translationproject.org)

3 months agoMerge remote-tracking branch 'github/dependabot/github_actions/actions/upload-artifact-6'
Karel Zak [Thu, 26 Feb 2026 09:03:33 +0000 (10:03 +0100)] 
Merge remote-tracking branch 'github/dependabot/github_actions/actions/upload-artifact-6'

3 months agoMerge remote-tracking branch 'github/dependabot/github_actions/actions/cache-5'
Karel Zak [Thu, 26 Feb 2026 09:03:01 +0000 (10:03 +0100)] 
Merge remote-tracking branch 'github/dependabot/github_actions/actions/cache-5'

3 months agoMerge branch 'PR/dmesg-kmsg-timestamp-bounds' of https://github.com/karelzak/util...
Karel Zak [Thu, 26 Feb 2026 08:52:22 +0000 (09:52 +0100)] 
Merge branch 'PR/dmesg-kmsg-timestamp-bounds' of https://github.com/karelzak/util-linux-work

* 'PR/dmesg-kmsg-timestamp-bounds' of https://github.com/karelzak/util-linux-work:
  dmesg: add bounds checking to parse_kmsg_timestamp()

3 months agoMerge branch 'PR/libblkid-superblocks-overflow' of https://github.com/karelzak/util...
Karel Zak [Thu, 26 Feb 2026 08:52:02 +0000 (09:52 +0100)] 
Merge branch 'PR/libblkid-superblocks-overflow' of https://github.com/karelzak/util-linux-work

* 'PR/libblkid-superblocks-overflow' of https://github.com/karelzak/util-linux-work:
  libblkid: fix integer overflows in HFS+ offset calculations
  libblkid: fix integer overflow in linux_raid checksum size
  libblkid: fix integer overflow in nvidia_raid size check

3 months agolib/fileeq: Handle large files on 32 bit correctly
Tobias Stoeckmann [Wed, 25 Feb 2026 17:05:57 +0000 (18:05 +0100)] 
lib/fileeq: Handle large files on 32 bit correctly

The size_t iterator in ul_fileeq could overflow on 32 bit systems with
large file support. If this happens, the intro array is erroneously
overwritten, which could lead to false positive matches later on.

The iterator is checked against a size_t limit in get_digest, which is a
safe operation on 32 and 64 bit architectures.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
3 months agohexdump: (man) document byte order dependency in multi-byte formats
Karel Zak [Wed, 25 Feb 2026 10:58:16 +0000 (11:58 +0100)] 
hexdump: (man) document byte order dependency in multi-byte formats

Addresses: https://github.com/util-linux/util-linux/issues/4072
Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agofdisk: (man) correct the markup + punctuation of two option descriptions
Benno Schulenberg [Tue, 24 Feb 2026 15:24:22 +0000 (16:24 +0100)] 
fdisk: (man) correct the markup + punctuation of two option descriptions

Do not colorize 'dos' and 'cylinders' as if they were placeholders --
they are literal example values.

Also, use a semicolon where a comma will not do.  And remove three
redundant blank lines.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
3 months agohexdump: sanitize fiemap ioctl output
Karel Zak [Wed, 25 Feb 2026 10:01:02 +0000 (11:01 +0100)] 
hexdump: sanitize fiemap ioctl output

Cap fm_mapped_extents to FIEMAP_EXTENTS_BATCH after each ioctl() call
to prevent potential out-of-bounds access if the kernel returns more
extents than requested.

Reported-by: Coverity Scan
Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agodmesg: add bounds checking to parse_kmsg_timestamp()
Karel Zak [Wed, 25 Feb 2026 09:47:09 +0000 (10:47 +0100)] 
dmesg: add bounds checking to parse_kmsg_timestamp()

Add 'end' pointer parameter to parse_kmsg_timestamp() to validate
buffer boundaries, consistent with parse_syslog_timestamp(),
parse_faclev(), parse_callerid(), and skip_item().

Also remove misleading "for debug messages" comment from the
null-termination in print_kmsg() -- the null-termination is required
for correctness.

Originally reported by Coverity (CID 501581, STRING_NULL). The
Coverity report itself is not valid (the buffer is properly
null-terminated before parsing), but the code was inconsistent --
parse_kmsg_timestamp() was the only parser without bounds checking.

Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agolibblkid: fix integer overflows in HFS+ offset calculations
Karel Zak [Wed, 25 Feb 2026 09:21:56 +0000 (10:21 +0100)] 
libblkid: fix integer overflows in HFS+ offset calculations

Two 32-bit multiplications using on-disk values can overflow:

 - leaf_node_head (uint32_t) * leaf_node_size (uint16_t) used to
   calculate leaf_block; overflow produces a wrong block number,
   causing reads from incorrect offsets.

 - embed_first_block (uint16_t) * alloc_block_size (uint32_t) used to
   calculate the embedded HFS+ volume offset; overflow truncates the
   result, again causing reads from wrong offsets.

Fix by widening leaf_block and off to uint64_t and casting
multiplication operands.  Bogus results from crafted images are then
safely rejected by blkid_probe_get_buffer() bounds checking and
the extent loop exhaustion.

Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agolibblkid: fix integer overflow in linux_raid checksum size
Karel Zak [Wed, 25 Feb 2026 09:14:43 +0000 (10:14 +0100)] 
libblkid: fix integer overflow in linux_raid checksum size

The checksum size calculation uses on-disk max_dev (uint32_t) multiplied
by sizeof(dev_roles[0]).  On 32-bit systems, this overflows size_t,
resulting in a truncated buffer and checksum computed over wrong data,
potentially allowing crafted images to bypass validation.

Fix by computing in uint64_t.  Note that blkid_probe_get_buffer() has
a hardcoded 8 MiB limit, so unreasonably large (but non-overflowed)
values are still safely rejected.

Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agolibblkid: fix integer overflow in nvidia_raid size check
Karel Zak [Wed, 25 Feb 2026 08:58:32 +0000 (09:58 +0100)] 
libblkid: fix integer overflow in nvidia_raid size check

The size validation `le32_to_cpu(nv->size) * 4 != NVIDIA_SUPERBLOCK_SIZE`
is subject to 32-bit unsigned integer overflow. A crafted value like
0x4000001E overflows when multiplied by 4, wrapping to 120 and passing
the check. The checksum loop then iterates ~1 billion times, reading
far beyond the 120-byte buffer.

Fix by comparing against the expected count directly without
multiplication. Also add a buffer size parameter to
nvraid_verify_checksum() as defense-in-depth against oversized reads.

Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agoMerge branch 'PR/libblkid-iso9660-false-positive' of https://github.com/karelzak...
Karel Zak [Wed, 25 Feb 2026 08:08:28 +0000 (09:08 +0100)] 
Merge branch 'PR/libblkid-iso9660-false-positive' of https://github.com/karelzak/util-linux-work

* 'PR/libblkid-iso9660-false-positive' of https://github.com/karelzak/util-linux-work:
  libblkid: iso9660: validate root directory to reduce false positives

3 months agoMerge branch 'PR/man-smartcols-env' of https://github.com/karelzak/util-linux-work
Karel Zak [Wed, 25 Feb 2026 08:08:00 +0000 (09:08 +0100)] 
Merge branch 'PR/man-smartcols-env' of https://github.com/karelzak/util-linux-work

* 'PR/man-smartcols-env' of https://github.com/karelzak/util-linux-work:
  man pages: consolidate libsmartcols environment variables

3 months agoblkzone: remove unnecessary brackets
Karel Zak [Wed, 25 Feb 2026 08:06:17 +0000 (09:06 +0100)] 
blkzone: remove unnecessary brackets

Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agoMerge branch 'wilfred/fixup-blkzone' of https://github.com/twilfredo/util-linux
Karel Zak [Wed, 25 Feb 2026 08:05:15 +0000 (09:05 +0100)] 
Merge branch 'wilfred/fixup-blkzone' of https://github.com/twilfredo/util-linux

* 'wilfred/fixup-blkzone' of https://github.com/twilfredo/util-linux:
  blkzone: add more checks when printing zone write_pointer

3 months agoMerge branch 'lsfd--socknetns-for-tuntap' of https://github.com/masatake/util-linux
Karel Zak [Wed, 25 Feb 2026 08:02:05 +0000 (09:02 +0100)] 
Merge branch 'lsfd--socknetns-for-tuntap' of https://github.com/masatake/util-linux

* 'lsfd--socknetns-for-tuntap' of https://github.com/masatake/util-linux:
  lsfd: fill SOCK.NETNS column for tuntap
  lsfd: load the information of the network namespace behind a tun device
  lsfd: (refactor) call ioctl(TUNGETDEVNETNS) from target_fd related methods
  lsfd: add stubs of target_fd related methods to cdev_class
  tests: (lsfd::*) revise the way to use "$?"
  tests: (lsns::*) revise the way to use "$?"

3 months agofsck.cramfs: fix off-by-one heap write in do_symlink()
Karel Zak [Wed, 25 Feb 2026 07:55:42 +0000 (08:55 +0100)] 
fsck.cramfs: fix off-by-one heap write in do_symlink()

In do_symlink(), the decompressed symlink target is NUL-terminated by
writing outbuffer[size] = 0. The outbuffer is allocated as blksize * 2
bytes, but uncompress_block() can return up to blksize * 2, so when
size == blksize * 2 the NUL write lands one byte past the heap
allocation. Allocating one extra byte ensures the NUL terminator stays
within bounds. The stream.avail_out value remains blksize * 2, so
decompression behavior is unchanged.

Reported-by: Pavel Kohout, Aisle Research, www.aisle.com
Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agolsfd: fill SOCK.NETNS column for tuntap
Masatake YAMATO [Wed, 4 Feb 2026 21:14:52 +0000 (06:14 +0900)] 
lsfd: fill SOCK.NETNS column for tuntap

There are two network namespaces associated with a file descriptor
opening /dev/net/tun.

One is the device network namespace (devnetns). A tun/tap file
descriptor is associated with a network device, and the devnetns
is the namespace in which that device exists. lsfd already provides
this information via the TUN.DEVNETNS column.

The other is the socket network namespace (socknetns). A tun/tap
file descriptor is also associated with a socket, and the socknetns
is the namespace in which that socket was created. lsfd already
has the SOCK.NETNS column for reporting this information, but it
was not filled for file descriptors opening /dev/net/tun.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
3 months agolsfd: load the information of the network namespace behind a tun device
Masatake YAMATO [Wed, 4 Feb 2026 20:50:24 +0000 (05:50 +0900)] 
lsfd: load the information of the network namespace behind a tun device

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
3 months agolsfd: (refactor) call ioctl(TUNGETDEVNETNS) from target_fd related methods
Masatake YAMATO [Wed, 4 Feb 2026 20:42:16 +0000 (05:42 +0900)] 
lsfd: (refactor) call ioctl(TUNGETDEVNETNS) from target_fd related methods

In the original code, the attach_xinfo method of the cdev_tun_ops
struct called the ioctl. The attach_xinfo method retrieved the fd
passing to the ioctl by calling call_with_foreign_fd utility function.

In the last commit, we added the target_fd related methods in
cdev_tun_ops struct. The caller side of the target_fd related methods
calls call_with_foreign_fd.

We can reduce the code calling call_with_foreign_fd by moving the code
calling ioctl from the attach_xinfo method to the target_fd related
methods.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
3 months agolsfd: add stubs of target_fd related methods to cdev_class
Masatake YAMATO [Wed, 4 Feb 2026 20:22:09 +0000 (05:22 +0900)] 
lsfd: add stubs of target_fd related methods to cdev_class

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
3 months agotests: (lsfd::*) revise the way to use "$?"
Masatake YAMATO [Tue, 24 Feb 2026 17:58:02 +0000 (02:58 +0900)] 
tests: (lsfd::*) revise the way to use "$?"

* Don't use $? for printing the result of if-conditions; use
  literals instead (0 or 1).

* Don' use $? for referring to the result of wait built-in; store the
  result to $RC just after the wait built-in invocation.

* Use ${PIPESTATUS[]} instead of $?.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
3 months agotests: (lsns::*) revise the way to use "$?"
Masatake YAMATO [Tue, 24 Feb 2026 18:16:40 +0000 (03:16 +0900)] 
tests: (lsns::*) revise the way to use "$?"

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
3 months agoman pages: consolidate libsmartcols environment variables
Karel Zak [Tue, 24 Feb 2026 08:54:12 +0000 (09:54 +0100)] 
man pages: consolidate libsmartcols environment variables

Introduce man-common/env-smartcols.adoc to describe all libsmartcols
environment variables (LIBSMARTCOLS_DEBUG, LIBSMARTCOLS_DEBUG_PADDING,
LIBSMARTCOLS_JSON) in one place.

Replace duplicated LIBSMARTCOLS_DEBUG descriptions in cfdisk, fdisk,
sfdisk, findmnt, lsblk, and column man pages with an include of the
new common file.

Addresses: https://github.com/util-linux/util-linux/issues/3971
Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agolibblkid: iso9660: validate root directory to reduce false positives
Karel Zak [Tue, 24 Feb 2026 11:41:39 +0000 (12:41 +0100)] 
libblkid: iso9660: validate root directory to reduce false positives

The CD001 magic signature at 32KB offset can match file data content
on other filesystems (e.g. an .iso file stored on XFS whose data
blocks happen to land at the device offset where blkid looks for the
ISO 9660 Primary Volume Descriptor). This causes blkid to report
ambivalent results for a device that has only one real filesystem.

Add validation of the root directory record from the PVD: read the
root directory extent and verify that the first entry is a valid "."
self-reference (file_id_len == 1, file_id == 0x00, extent location
pointing back to itself). This check reliably rejects false positive
CD001 signatures because the root directory LBA from the PVD points
to a different location on the device that contains unrelated data.

Addresses: https://github.com/util-linux/util-linux/issues/4031
Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agoMerge branch 'pager_async_sig' of https://github.com/stoeckmann/util-linux
Karel Zak [Tue, 24 Feb 2026 09:11:02 +0000 (10:11 +0100)] 
Merge branch 'pager_async_sig' of https://github.com/stoeckmann/util-linux

* 'pager_async_sig' of https://github.com/stoeckmann/util-linux:
  lib/pager: Remove unused code
  lib/pager: Use async-signal safe signal handler

3 months agojsonwrt: rename ul_json_format_t to enum ul_json_format
Karel Zak [Tue, 24 Feb 2026 09:06:16 +0000 (10:06 +0100)] 
jsonwrt: rename ul_json_format_t to enum ul_json_format

The _t suffix is reserved by POSIX. Use a plain enum tag instead.

Addresses: https://github.com/util-linux/util-linux/pull/4025
Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agoMerge branch 'feat/3971_compact_json_and_jsonl_support' of https://github.com/echoech...
Karel Zak [Tue, 24 Feb 2026 08:38:09 +0000 (09:38 +0100)] 
Merge branch 'feat/3971_compact_json_and_jsonl_support' of https://github.com/echoechoin/util-linux

* 'feat/3971_compact_json_and_jsonl_support' of https://github.com/echoechoin/util-linux:
  jsonwrt: simplify ul_jsonwrt_empty() and add comments for COMPACT format
  column: using switch-case replaces if-else
  column: add JSON compact format output subtest.
  column: add JSON LINES format output subtest.
  column: introduce LIBSMARTCOLS_JSON environment argument
  jsonwrt: support Compact JSON format output
  libsmartcols: support JSON Lines format output

3 months agoMerge branch 'pager_error' of https://github.com/stoeckmann/util-linux
Karel Zak [Tue, 24 Feb 2026 08:29:30 +0000 (09:29 +0100)] 
Merge branch 'pager_error' of https://github.com/stoeckmann/util-linux

* 'pager_error' of https://github.com/stoeckmann/util-linux:
  lib/pager: Handle dup errors

3 months agoMerge branch 'libblkid_fix_cache_garbage_collection' of https://github.com/cgoesche...
Karel Zak [Tue, 24 Feb 2026 08:13:15 +0000 (09:13 +0100)] 
Merge branch 'libblkid_fix_cache_garbage_collection' of https://github.com/cgoesche/util-linux-fork

* 'libblkid_fix_cache_garbage_collection' of https://github.com/cgoesche/util-linux-fork:
  blkid: add --garbage-collect test
  libblkid: remove empty loop devices from cache when garbage collecting

3 months agoblkzone: add more checks when printing zone write_pointer
Wilfred Mallawa [Mon, 23 Feb 2026 23:43:29 +0000 (09:43 +1000)] 
blkzone: add more checks when printing zone write_pointer

The zone write pointer is also invalid for READONLY and OFFLINE zones, so
handle such cases appropriately by not displaying a write pointer for
READONLY and OFFLINE zones.

Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
Fixes: b032247f48 ("blkzone: don't show wptr when zones are full")
3 months agolib/pager: Remove unused code
Tobias Stoeckmann [Mon, 23 Feb 2026 19:01:50 +0000 (20:01 +0100)] 
lib/pager: Remove unused code

The pager_process.pid check already happens before wait_for_pager is
called now.

Also, errno is not used anymore after the signal handler, so no need to
save it.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
3 months agolib/pager: Use async-signal safe signal handler
Tobias Stoeckmann [Mon, 23 Feb 2026 18:51:25 +0000 (19:51 +0100)] 
lib/pager: Use async-signal safe signal handler

Accessing pager_process.pid from within a signal handler is, by strict C
language interpretation, not signal safe.

Wait for all children (and thus for pager_process.pid as well) instead.
The current users dmesg and fdisk have no further children so this is a
good compromise here.

The signal handler is used for SIGINT, SIGHUP, SIGTERM, SIGQUIT. From a
terminal perspective, these are normally intercepted by the child, not
the parent.

Since wait_for_pager is never reached by a signal handler anymore, a
regular err() call is now possible. Just make sure that no exit function
handler could ever loop endlessly.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
3 months agolib/pager: Handle dup errors
Tobias Stoeckmann [Mon, 23 Feb 2026 18:57:34 +0000 (19:57 +0100)] 
lib/pager: Handle dup errors

If dup fails, e.g. due to open file descriptor limitations, gracefully
handle the situation and do not start the pager.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
3 months agoumount: add test for --graceful option
Christian Goeschel Ndjomouo [Fri, 20 Feb 2026 23:26:11 +0000 (18:26 -0500)] 
umount: add test for --graceful option

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
3 months agoumount: new --graceful option to exit successfully even if filesystem is unmounted
Christian Goeschel Ndjomouo [Fri, 20 Feb 2026 23:01:29 +0000 (18:01 -0500)] 
umount: new --graceful option to exit successfully even if filesystem is unmounted

This new option makes it so that umount(8) exits successfully even
if the filesystem has already been unmounted or has no directory
entry. The usefulness of this behavior becomes apparent in cases
where idempotency is important, that is the focus lies in the
destruction of the mountpoint only.

Closes: #2132
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
3 months agoMerge branch 'dmesg_sigpipe' of https://github.com/stoeckmann/util-linux
Karel Zak [Mon, 23 Feb 2026 13:20:13 +0000 (14:20 +0100)] 
Merge branch 'dmesg_sigpipe' of https://github.com/stoeckmann/util-linux

* 'dmesg_sigpipe' of https://github.com/stoeckmann/util-linux:
  lib/pager: Gracefully handle SIGPIPE errors
  dmesg: Gracefully handle EPIPE errors
  dmesg: Register pager_close as exit handler

3 months agoblkid: add --garbage-collect test
Christian Goeschel Ndjomouo [Sun, 22 Feb 2026 01:21:05 +0000 (20:21 -0500)] 
blkid: add --garbage-collect test

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
3 months agoMerge branch 'lsmem_show_zones_on_uncommon_phy_mem_layout' of https://github.com...
Karel Zak [Mon, 23 Feb 2026 13:06:57 +0000 (14:06 +0100)] 
Merge branch 'lsmem_show_zones_on_uncommon_phy_mem_layout' of https://github.com/cgoesche/util-linux-fork

* 'lsmem_show_zones_on_uncommon_phy_mem_layout' of https://github.com/cgoesche/util-linux-fork:
  lsmem: fix missing zone info when memory blocks start at an index other than 0

3 months agoMerge branch 'fileeq_typos' of https://github.com/stoeckmann/util-linux
Karel Zak [Mon, 23 Feb 2026 12:11:58 +0000 (13:11 +0100)] 
Merge branch 'fileeq_typos' of https://github.com/stoeckmann/util-linux

* 'fileeq_typos' of https://github.com/stoeckmann/util-linux:
  lib/fileeq: Fix typos

3 months agoMerge branch 'fileeq_debug' of https://github.com/stoeckmann/util-linux
Karel Zak [Mon, 23 Feb 2026 12:09:59 +0000 (13:09 +0100)] 
Merge branch 'fileeq_debug' of https://github.com/stoeckmann/util-linux

* 'fileeq_debug' of https://github.com/stoeckmann/util-linux:
  lib/fileeq: Extend debug message
  lib/fileeq: Fix formatters

3 months agoMerge branch 'hardlink_oob' of https://github.com/stoeckmann/util-linux
Karel Zak [Mon, 23 Feb 2026 12:07:58 +0000 (13:07 +0100)] 
Merge branch 'hardlink_oob' of https://github.com/stoeckmann/util-linux

* 'hardlink_oob' of https://github.com/stoeckmann/util-linux:
  lib/fileeq: Prevent OOB with short read files

3 months agolibblkid: remove empty loop devices from cache when garbage collecting
Christian Goeschel Ndjomouo [Sat, 21 Feb 2026 03:42:02 +0000 (22:42 -0500)] 
libblkid: remove empty loop devices from cache when garbage collecting

The cache garbage collection (blkid --garbage-collect) does not work for
entries of loop devices even when these have been detached. The previous
logic performed a simple stat() on the dev node path, however this is not
enough for loop devices as their nodes can remain present even if they
aren't backed by any file or other block device.

Therefore, it is more sane to verify if the loop device has a backing file
and if not, we remove it from the cache.

Closes: #4061
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
3 months agoMerge branch 'blkdiscard_add_more_longopts_tests' of https://github.com/cgoesche...
Karel Zak [Mon, 23 Feb 2026 10:40:48 +0000 (11:40 +0100)] 
Merge branch 'blkdiscard_add_more_longopts_tests' of https://github.com/cgoesche/util-linux-fork

* 'blkdiscard_add_more_longopts_tests' of https://github.com/cgoesche/util-linux-fork:
  blkdiscard: (tests) add more long option tests

3 months agoMerge branch 'choom_add_tests' of https://github.com/cgoesche/util-linux-fork
Karel Zak [Mon, 23 Feb 2026 10:06:51 +0000 (11:06 +0100)] 
Merge branch 'choom_add_tests' of https://github.com/cgoesche/util-linux-fork

* 'choom_add_tests' of https://github.com/cgoesche/util-linux-fork:
  choom: (testcoverage) add long options tests

3 months agoMerge branch 'blkid_add_more_long_opts_tests' of https://github.com/cgoesche/util...
Karel Zak [Mon, 23 Feb 2026 10:05:10 +0000 (11:05 +0100)] 
Merge branch 'blkid_add_more_long_opts_tests' of https://github.com/cgoesche/util-linux-fork

* 'blkid_add_more_long_opts_tests' of https://github.com/cgoesche/util-linux-fork:
  blkid: (testcoverage) add more long option tests

3 months agoMerge branch 'manpages-fix' of https://github.com/mariobl/util-linux
Karel Zak [Mon, 23 Feb 2026 10:03:13 +0000 (11:03 +0100)] 
Merge branch 'manpages-fix' of https://github.com/mariobl/util-linux

* 'manpages-fix' of https://github.com/mariobl/util-linux:
  Fix formatting in getino.1.adoc

3 months agologin: improve comments for signal handling in fork_session()
Karel Zak [Mon, 23 Feb 2026 10:00:20 +0000 (11:00 +0100)] 
login: improve comments for signal handling in fork_session()

Add more detailed comments explaining the signal blocking and
sigsuspend() pattern introduced by the previous commit. The key
insight is that sigsuspend() is the actual wait point where
SIGTERM/SIGHUP are forwarded to the child, while waitpid() with
WNOHANG only performs non-blocking checks for terminated children.

Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agojsonwrt: simplify ul_jsonwrt_empty() and add comments for COMPACT format
WanBingjiang [Mon, 23 Feb 2026 08:32:48 +0000 (16:32 +0800)] 
jsonwrt: simplify ul_jsonwrt_empty() and add comments for COMPACT format

Consolidate duplicated LINE/COMPACT branches in ul_jsonwrt_empty()
into a single else-branch, since they produce identical output.

Add comments explaining the indent depth checks in ul_jsonwrt_open()
and ul_jsonwrt_close() for COMPACT format.

3 months agocolumn: using switch-case replaces if-else
WanBingjiang [Thu, 5 Feb 2026 10:02:47 +0000 (18:02 +0800)] 
column: using switch-case replaces if-else

3 months agocolumn: add JSON compact format output subtest.
WanBingjiang [Thu, 5 Feb 2026 09:30:12 +0000 (17:30 +0800)] 
column: add JSON compact format output subtest.

3 months agocolumn: add JSON LINES format output subtest.
WanBingjiang [Thu, 5 Feb 2026 09:13:44 +0000 (17:13 +0800)] 
column: add JSON LINES format output subtest.

3 months agocolumn: introduce LIBSMARTCOLS_JSON environment argument
WanBingjiang [Thu, 5 Feb 2026 09:11:06 +0000 (17:11 +0800)] 
column: introduce LIBSMARTCOLS_JSON environment argument

3 months agojsonwrt: support Compact JSON format output
WanBingjiang [Thu, 5 Feb 2026 08:53:29 +0000 (16:53 +0800)] 
jsonwrt: support Compact JSON format output

3 months agolibsmartcols: support JSON Lines format output
WanBingjiang [Thu, 5 Feb 2026 09:02:39 +0000 (17:02 +0800)] 
libsmartcols: support JSON Lines format output

3 months agochoom: (testcoverage) add long options tests
Christian Goeschel Ndjomouo [Sun, 22 Feb 2026 03:04:38 +0000 (22:04 -0500)] 
choom: (testcoverage) add long options tests

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
3 months agoblkid: (testcoverage) add more long option tests
Christian Goeschel Ndjomouo [Sun, 22 Feb 2026 02:09:27 +0000 (21:09 -0500)] 
blkid: (testcoverage) add more long option tests

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
3 months agoblkdiscard: (tests) add more long option tests
Christian Goeschel Ndjomouo [Sat, 21 Feb 2026 01:34:50 +0000 (20:34 -0500)] 
blkdiscard: (tests) add more long option tests

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
3 months agoFix formatting in getino.1.adoc
Mario Blättermann [Fri, 20 Feb 2026 12:47:36 +0000 (13:47 +0100)] 
Fix formatting in getino.1.adoc

3 months agolsmem: fix missing zone info when memory blocks start at an index other than 0
Christian Goeschel Ndjomouo [Fri, 20 Feb 2026 00:02:09 +0000 (19:02 -0500)] 
lsmem: fix missing zone info when memory blocks start at an index other than 0

On systems that have an uncommon physical memory layout, e.g. where hotpluggable
memory blocks start at an offset greater than 0, we failed to set the 'have_zones'
control flag, which caused an omission of the ZONES information of the listed
individual memory block or a block range. This is because we explicitly tested for
/sys/devices/system/memory/memory0/valid_zones, however it is better to simply
look for any memory<n> directory entry and validate the existence of the valid_zones
attribute.

Closes: #4055
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
3 months agologin: Fix signal race in child handling
Tobias Stoeckmann [Thu, 19 Feb 2026 19:58:10 +0000 (20:58 +0100)] 
login: Fix signal race in child handling

Two cases exist in which login might send signals to a process which is
actually not a child process:

- If SIGCHLD is set to SIG_IGN by login's parent process (unlikely),
  then no zombie process exists. The kernel could already reuse the PID
  for another process just before login's signal_handler function sends
  a signal to its stored child PID -- which was already reused
- If wait succeeds, the PID can be reused by the kernel for another
  process. The registered signal_handlers could still use the stored
  child PID to send signals -- but erroneously to a wrong process

Fix these cases by blocking and unblocking SIGCHLD and signal_handler
triggering signals around the wait call. Set child_pid to 0 after wait
succeeded and before signal_handler signals are unblocked again.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
3 months agolib/pager: Gracefully handle SIGPIPE errors
Tobias Stoeckmann [Thu, 19 Feb 2026 17:16:32 +0000 (18:16 +0100)] 
lib/pager: Gracefully handle SIGPIPE errors

A user might prematurely close the pager before the parent wrote its
full output into the pipe. This triggers SIGPIPE, which would eventually
lead to an error return value.

The programs dmesg and fdisk can keep running just fine in these cases.
In fact, dmesg's source code was already prepared for EPIPE error return
values.

If the pager returns with a success return value, ignore SIGPIPE. If
there was an error within the pager, stop the parent as well.

With this, dmesg does not return an error anymore if the ring buffer was
not fully sent to the pager before it was closed.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
3 months agodmesg: Gracefully handle EPIPE errors
Tobias Stoeckmann [Thu, 19 Feb 2026 17:14:23 +0000 (18:14 +0100)] 
dmesg: Gracefully handle EPIPE errors

Just calling exit with a success return value in case of an EPIPE error
in safe_fwrite is not precise enough. If dmesg was called with "-c",
i.e. to print and then clear the ring buffer, a successful return value
should mean that the ring buffer is cleared as well.

Instead, continue operation on EPIPE error but stop any further regular
output.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
3 months agodmesg: Register pager_close as exit handler
Tobias Stoeckmann [Thu, 19 Feb 2026 17:13:25 +0000 (18:13 +0100)] 
dmesg: Register pager_close as exit handler

Make sure that pager is properly closed even in case of err/errx calls
while pager is running.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
3 months agoMerge branch 'pg_warn' of https://github.com/stoeckmann/util-linux
Karel Zak [Thu, 19 Feb 2026 12:18:26 +0000 (13:18 +0100)] 
Merge branch 'pg_warn' of https://github.com/stoeckmann/util-linux

* 'pg_warn' of https://github.com/stoeckmann/util-linux:
  pg: Fix compiler warning