]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
2 months agolib/pager: Release resources on pager_open error
Tobias Stoeckmann [Wed, 4 Feb 2026 20:31:01 +0000 (21:31 +0100)] 
lib/pager: Release resources on pager_open error

If __setup_pager is unable to spawn a new process, close the duplicated
file descriptors on error path. Also, for the sake of completeness,
clear all other fields in pager_process as well.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agolib/pager: Clear potential stdout/stderr errors
Tobias Stoeckmann [Wed, 4 Feb 2026 19:42:59 +0000 (20:42 +0100)] 
lib/pager: Clear potential stdout/stderr errors

Clear stdout/stderr errors which might have occurred in communication
with pager. Since output is flushed and file descriptors replaced, the
information is meaningless.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agolib/pager: Flush outputs in pager_close
Tobias Stoeckmann [Wed, 4 Feb 2026 19:36:48 +0000 (20:36 +0100)] 
lib/pager: Flush outputs in pager_close

Flush all outputs before waiting for child. This allows even outputs
which do not end in a newline to be shown by pager.

More importantly, it avoids output to be printed into original file
descriptors which were meant for pager.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agolib/pager: Improve signal handling in pager_close
Tobias Stoeckmann [Wed, 4 Feb 2026 19:30:18 +0000 (20:30 +0100)] 
lib/pager: Improve signal handling in pager_close

During pager_close execution, incoming signals can have different
effects:

For one, waitpid might be called multiple times. In this case,
stdout/stderr are closed two times, leading to failing system calls.

Also, the original stdout/stderr can be closed by the signal handler
when waitpid succeeded already and dup2 calls were performed. The signal
handler erroneously tries to signal EOF to the child this way.

To fix these issues, only set a flag and perform wait_for_pager exactly
once. If one of these signals is received during the operation, call
_exit to imitate the signal handling behavior as good as possible.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agodmesg: Fix short memory allocation with 32 bit
Tobias Stoeckmann [Wed, 4 Feb 2026 17:01:30 +0000 (18:01 +0100)] 
dmesg: Fix short memory allocation with 32 bit

The buffer size can be specified as 32 bit unsigned int with command
line argument. In read_syslog_buffer, the allocation is increased by 8
bytes. This means that an unsigned integer overflow could occur, leading
to less amount of memory allocated than expected.

Please note that this does not lead to a security issue, just an incomplete
message.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agodmesg: Add release_buffer function
Tobias Stoeckmann [Wed, 4 Feb 2026 18:15:21 +0000 (19:15 +0100)] 
dmesg: Add release_buffer function

The buffer handling is properly split into three functions now:

- prepare_buffer
- print_buffer
- release_buffer

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agodmesg: Split preparing and printing of buffer
Tobias Stoeckmann [Wed, 4 Feb 2026 18:01:13 +0000 (19:01 +0100)] 
dmesg: Split preparing and printing of buffer

Have a strict separation between preparing the buffer and printing
content of buffer. This will help in further changes to more efficiently
prepare output, i.e. pager setup.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agoMerge branch 'pager_exit' of https://github.com/stoeckmann/util-linux
Karel Zak [Wed, 4 Feb 2026 09:50:18 +0000 (10:50 +0100)] 
Merge branch 'pager_exit' of https://github.com/stoeckmann/util-linux

* 'pager_exit' of https://github.com/stoeckmann/util-linux:
  lib/pager: Call _exit in signal handler, not raise

2 months agoMerge branch 'pager_path' of https://github.com/stoeckmann/util-linux
Karel Zak [Wed, 4 Feb 2026 09:49:59 +0000 (10:49 +0100)] 
Merge branch 'pager_path' of https://github.com/stoeckmann/util-linux

* 'pager_path' of https://github.com/stoeckmann/util-linux:
  lib/pager: Do not resolve directories with PATH

2 months agoMerge branch 'pager_sigchld' of https://github.com/stoeckmann/util-linux
Karel Zak [Wed, 4 Feb 2026 09:49:11 +0000 (10:49 +0100)] 
Merge branch 'pager_sigchld' of https://github.com/stoeckmann/util-linux

* 'pager_sigchld' of https://github.com/stoeckmann/util-linux:
  lib/pager: Set SIGCHLD to default handling

2 months agoMerge branch 'dmesg_oob' of https://github.com/stoeckmann/util-linux
Karel Zak [Wed, 4 Feb 2026 09:48:48 +0000 (10:48 +0100)] 
Merge branch 'dmesg_oob' of https://github.com/stoeckmann/util-linux

* 'dmesg_oob' of https://github.com/stoeckmann/util-linux:
  dmesg: Check if file is too large
  dmesg: Only check for newline if input exists
  dmesg: Check input length before calling strtol

2 months agoMerge branch 'zfs-unaligned-sparc' of https://github.com/ixhamza/util-linux
Karel Zak [Wed, 4 Feb 2026 09:42:38 +0000 (10:42 +0100)] 
Merge branch 'zfs-unaligned-sparc' of https://github.com/ixhamza/util-linux

* 'zfs-unaligned-sparc' of https://github.com/ixhamza/util-linux:
  libblkid: zfs: fix unaligned memory access on SPARC

2 months agoMerge branch 'check_test_coverage' of https://github.com/cgoesche/util-linux-fork
Karel Zak [Wed, 4 Feb 2026 08:53:51 +0000 (09:53 +0100)] 
Merge branch 'check_test_coverage' of https://github.com/cgoesche/util-linux-fork

* 'check_test_coverage' of https://github.com/cgoesche/util-linux-fork:
  tests: search for all executable scripts in test subdirs
  build-sys: add a target for tools/testcoverage.sh
  tools: (get-options.sh) refine regex for unsupported programs to avoid false positives
  tools: expand relative paths provided by $top_srcdir for robustness
  tools: helper script to generate a test coverage report
  tools: (get-options.sh) ensure functionality for out-of-tree builds

2 months agolsfd: fill SOCK.NETNS even when sock_diag netlink can't report sockets
Masatake YAMATO [Sat, 29 Nov 2025 22:28:33 +0000 (07:28 +0900)] 
lsfd: fill SOCK.NETNS even when sock_diag netlink can't report sockets

lsfd could not fill SOCK.NETNS when socket netns information was not
available via sock_diag netlink. Although TCP sockets support sock_diag,
unbound/unconnected TCP sockets are not reported there, so SOCK.NETNS
remained empty for them.

lsfd already obtained socket netns information via ioctl(SIOCGSKNS) in
load_fdsk_xinfo(), called from collect_file_symlink(). That information
was only used to enumerate network namespaces on the target system and
was not associated with socket objects. Use it to fill SOCK.NETNS.

Move the netns lookup to sock_class->inspect_target_fd. The new helper
get_netns_from_socket() retrieves the netns inode via ioctl(SIOCGSKNS),
and sock_inspect_target_fd() stores it in sock->netns_inode. Then
sock_fill_column() uses sock->netns_inode for SOCK.NETNS when present.

* lsfd-cmd/sock.h (struct sock::netns_inode): new member
* lsfd-cmd/lsfd.c (collect_file_symlink): stop calling load_fdsk_xinfo()
* lsfd-cmd/sock-xinfo.c (load_fdsk_xinfo_cb): remove
* lsfd-cmd/sock.c: add get_netns_from_socket(), sock_inspect_target_fd()
and wire inspect_target_fd in sock_class; use netns_inode in
sock_fill_column() for SOCK.NETNS
* tests/ts/lsfd/mkfds-tcp-bare: add test case

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 months agoMerge branch 'master' of https://github.com/echoechoin/util-linux
Karel Zak [Wed, 4 Feb 2026 08:38:59 +0000 (09:38 +0100)] 
Merge branch 'master' of https://github.com/echoechoin/util-linux

* 'master' of https://github.com/echoechoin/util-linux:
  hexdump: add fetch_more_extents to retrieve all file extents
  hexdump: add FIEMAP-based sparse file optimization

2 months agotests: (test_mkfds:netns) conditionally report EPERM when ioctl(SIOCGSKNS) fails
Masatake YAMATO [Tue, 3 Feb 2026 21:45:43 +0000 (06:45 +0900)] 
tests: (test_mkfds:netns) conditionally report EPERM when ioctl(SIOCGSKNS) fails

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 months agotests: (test_mkfd::tcp-bare) new factory creating an unbound/unconnected TCP socket
Masatake YAMATO [Sun, 1 Feb 2026 18:00:07 +0000 (03:00 +0900)] 
tests: (test_mkfd::tcp-bare) new factory creating an unbound/unconnected TCP socket

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 months agolsfd: add inspect_target_fd method to file_class
Masatake YAMATO [Mon, 1 Dec 2025 21:19:27 +0000 (06:19 +0900)] 
lsfd: add inspect_target_fd method to file_class

lsfd has mainly used the following information sources:
* stat(2) of readlink(/proc/$pid/fd/$fd),
* values in /proc/$pid/fdinfo/$fd, and
* netlink diag.

The new method adds a new information source, file descriptors
imported from the target process. lsfd uses pidfd_getfd(2) to import
the specified fd from the target process.

In the inspect_target_fd method, the imported file descriptor can be
used freely. For example, you can call ioctl(2) on it to obtain extra
information.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 months agotests: search for all executable scripts in test subdirs
Christian Goeschel Ndjomouo [Thu, 29 Jan 2026 06:47:22 +0000 (01:47 -0500)] 
tests: search for all executable scripts in test subdirs

Instead of looking for scripts that contain ts_init()
look for all executable scripts as some of them contain
helper functions with commands and long options.

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agobuild-sys: add a target for tools/testcoverage.sh
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 00:13:48 +0000 (19:13 -0500)] 
build-sys: add a target for tools/testcoverage.sh

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotools: (get-options.sh) refine regex for unsupported programs to avoid false positives
Christian Goeschel Ndjomouo [Sun, 18 Jan 2026 20:15:38 +0000 (15:15 -0500)] 
tools: (get-options.sh) refine regex for unsupported programs to avoid false positives

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotools: expand relative paths provided by $top_srcdir for robustness
Christian Goeschel Ndjomouo [Thu, 29 Jan 2026 02:42:43 +0000 (21:42 -0500)] 
tools: expand relative paths provided by $top_srcdir for robustness

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotools: helper script to generate a test coverage report
Christian Goeschel Ndjomouo [Sun, 18 Jan 2026 17:27:23 +0000 (12:27 -0500)] 
tools: helper script to generate a test coverage report

This script uses a heuristic approach to determine an approx.
test coverage of all util-linux tools. It does this by simply
looking at all the test scripts for a given tool and compares
the long options seen in them with all available ones for the
concerned tool. It also reports if a tool is either missing a
test subdirectory in tests/ts or doesn't have any test script
at all.

This script is not necessarily intended to be ran for build
tests but rather for code quality checks and to help util-linux
developers to get a better overview of their testing infrastructure
and plan accordingly for improvements.

It will potentially also help in keeping the tools stable and
detect regressions more efficiently.

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agohexdump: add fetch_more_extents to retrieve all file extents
WanBingjiang [Tue, 3 Feb 2026 01:49:47 +0000 (09:49 +0800)] 
hexdump: add fetch_more_extents to retrieve all file extents

Add fetch_more_extents() so FIEMAP can fetch extents in batches beyond
the initial fixed batch, instead of being limited to FIEMAP_EXTENTS_BATCH
extents only.

2 months agolib/pager: Call _exit in signal handler, not raise
Tobias Stoeckmann [Mon, 2 Feb 2026 20:21:07 +0000 (21:21 +0100)] 
lib/pager: Call _exit in signal handler, not raise

The signals are registered without SA_RESETHAND, which means that the
same signal handler is called over and over again.

This just works because eventually, the waitpid call will fail, leading
to a suppressed error message (because stderr is already closed) and
then an _exit(EXIT_FAILURE) call.

Just call _exit(EXIT_FAILURE) directly to avoid unneeded and failing
system calls.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agolib/pager: Do not resolve directories with PATH
Tobias Stoeckmann [Mon, 2 Feb 2026 19:23:45 +0000 (20:23 +0100)] 
lib/pager: Do not resolve directories with PATH

If PAGER contains any slash in program part, avoid resolving it with
PATH environment variable. Even if it is found there (in a
subdirectory), sh -c won't execute it.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agolib/pager: Set SIGCHLD to default handling
Tobias Stoeckmann [Mon, 2 Feb 2026 19:07:35 +0000 (20:07 +0100)] 
lib/pager: Set SIGCHLD to default handling

If SIGCHLD is ignored, then waitpid might return an error if child
process is already terminated, since zombie process generation would be
blocked.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agodmesg: Check if file is too large
Tobias Stoeckmann [Mon, 2 Feb 2026 18:47:01 +0000 (19:47 +0100)] 
dmesg: Check if file is too large

32 bit systems might encounter a file which is larger than 2 GB. The
current code would silently truncate the input.

Exit with a proper error message instead.

Add the equal check to silence compiler warnings on 64 bit systems.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agodmesg: Only check for newline if input exists
Tobias Stoeckmann [Mon, 2 Feb 2026 18:28:32 +0000 (19:28 +0100)] 
dmesg: Only check for newline if input exists

If a memory mapped file does not end with a newline, do not check for
its existence. Accessing *end would lead to an out of boundary read.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agodmesg: Check input length before calling strtol
Tobias Stoeckmann [Mon, 2 Feb 2026 18:25:56 +0000 (19:25 +0100)] 
dmesg: Check input length before calling strtol

The dmesg input can be a memory mapped file, yet strtol is used to
parse numbers (facility, level, and syslog timestamp).

Make sure that a terminating character exists to stop strtol before
reaching end.

While at it, actually check if terminating character is the one we
were looking for.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 months agolsfd: (refactor) make call_with_foreign_fd reusable
Masatake YAMATO [Sat, 29 Nov 2025 19:53:24 +0000 (04:53 +0900)] 
lsfd: (refactor) make call_with_foreign_fd reusable

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 months agolsfd: make pidfd for the target process available while collecting fds
Masatake YAMATO [Sun, 1 Feb 2026 16:28:17 +0000 (01:28 +0900)] 
lsfd: make pidfd for the target process available while collecting fds

This is a preparation change for adding inspect_target_fd method to
file_class.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 months agolsfd: (comment) update the description of sock_xinfo::netns_inode
Masatake YAMATO [Mon, 2 Feb 2026 17:13:47 +0000 (02:13 +0900)] 
lsfd: (comment) update the description of sock_xinfo::netns_inode

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 months agolibblkid: zfs: fix unaligned memory access on SPARC
Ameer Hamza [Mon, 2 Feb 2026 16:16:50 +0000 (21:16 +0500)] 
libblkid: zfs: fix unaligned memory access on SPARC

SPARC requires aligned memory access for uint32_t values. The ZFS code
was directly dereferencing uint32_t pointers that could be unaligned due
to XDR encoding, causing SIGBUS crashes. Introduce copy_be32_to_cpu()
helper using memcpy to safely read from potentially unaligned memory.

Addresses: https://github.com/util-linux/util-linux/issues/4010

Signed-off-by: Ameer Hamza <ahamza@ixsystems.com>
2 months agolsfd: (cosmetic) delete an empty line
Masatake YAMATO [Sun, 25 Jan 2026 23:00:27 +0000 (08:00 +0900)] 
lsfd: (cosmetic) delete an empty line

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 months agotools: (get-options.sh) ensure functionality for out-of-tree builds
Christian Goeschel Ndjomouo [Thu, 29 Jan 2026 02:19:33 +0000 (21:19 -0500)] 
tools: (get-options.sh) ensure functionality for out-of-tree builds

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agoMerge PR #3953: waitpid pidfd inode format support
Karel Zak [Mon, 2 Feb 2026 12:54:05 +0000 (13:54 +0100)] 
Merge PR #3953: waitpid pidfd inode format support

Resolved conflicts due to test directory reorganization.
The waitpid test files were already moved to tests/expected/waitpid/
in a previous commit.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agoMerge branch 'PR/chfn-version-help' of https://github.com/karelzak/util-linux-work
Karel Zak [Mon, 2 Feb 2026 12:48:41 +0000 (13:48 +0100)] 
Merge branch 'PR/chfn-version-help' of https://github.com/karelzak/util-linux-work

* 'PR/chfn-version-help' of https://github.com/karelzak/util-linux-work:
  chfn: allow --help and --version without login.defs restrictions

2 months agoMerge branch 'tests_convert_to_long_opts' of https://github.com/cgoesche/util-linux...
Karel Zak [Mon, 2 Feb 2026 12:46:44 +0000 (13:46 +0100)] 
Merge branch 'tests_convert_to_long_opts' of https://github.com/cgoesche/util-linux-fork

* 'tests_convert_to_long_opts' of https://github.com/cgoesche/util-linux-fork: (26 commits)
  tests: (waitpid) use long options to improve test coverage report
  tests: use long options globally in test scripts
  tests: (setarch) use long options to improve test coverage report
  tests: (script) use long options to improve test coverage report
  tests: (rev) use long options to improve test coverage report
  tests: (rename) use long options to improve test coverage report
  tests: (mount) use long options to improve test coverage report
  tests: (more) use long options to improve test coverage report
  tests: (lsns) use long options to improve test coverage report
  tests: (lsmem) use long options to improve test coverage report
  tests: (lscpu) use long options to improve test coverage report
  tests: (lsclocks) use long options to improve test coverage report
  tests: (losetup) use long options to improve test coverage report
  tests: (logger) use long options to improve test coverage report
  tests: (ipcs) use long options to improve test coverage report
  tests: (ionice) use long options to improve test coverage report
  tests: (hexdump) use long options to improve test coverage report
  tests: (getopt) use long options to improve test coverage report
  tests: (findmnt) use long options to improve test coverage report
  tests: (fdisk) use long options to improve test coverage report
  ...

2 months agoMerge branch 'issue/3980/hexdump' of https://github.com/echoechoin/util-linux
Karel Zak [Mon, 2 Feb 2026 12:38:18 +0000 (13:38 +0100)] 
Merge branch 'issue/3980/hexdump' of https://github.com/echoechoin/util-linux

* 'issue/3980/hexdump' of https://github.com/echoechoin/util-linux:
  hexdump: fixes Heap-buffer-overflow in rewrite_rules

2 months agoMerge branch 'lib_strutils_incomplete_null_term_check' of https://github.com/cgoesche...
Karel Zak [Mon, 2 Feb 2026 12:33:51 +0000 (13:33 +0100)] 
Merge branch 'lib_strutils_incomplete_null_term_check' of https://github.com/cgoesche/util-linux-fork

* 'lib_strutils_incomplete_null_term_check' of https://github.com/cgoesche/util-linux-fork:
  lib: (strutils.c) fix unchecked lookahead in ul_parse_size()

2 months agoMerge branch 'lsfd--ASSOC-pidfs' of https://github.com/masatake/util-linux
Karel Zak [Mon, 2 Feb 2026 12:28:12 +0000 (13:28 +0100)] 
Merge branch 'lsfd--ASSOC-pidfs' of https://github.com/masatake/util-linux

* 'lsfd--ASSOC-pidfs' of https://github.com/masatake/util-linux:
  lsfd: add new association "pidfs"

2 months agoMerge branch 'mount_manpage_grammar_mistake' of https://github.com/cgoesche/util...
Karel Zak [Mon, 2 Feb 2026 12:22:25 +0000 (13:22 +0100)] 
Merge branch 'mount_manpage_grammar_mistake' of https://github.com/cgoesche/util-linux-fork

* 'mount_manpage_grammar_mistake' of https://github.com/cgoesche/util-linux-fork:
  mount: (manpage) fix minor grammar mistakes

2 months agoMerge branch 'nsenter_manpage_improve' of https://github.com/cgoesche/util-linux...
Karel Zak [Mon, 2 Feb 2026 12:21:46 +0000 (13:21 +0100)] 
Merge branch 'nsenter_manpage_improve' of https://github.com/cgoesche/util-linux-fork

* 'nsenter_manpage_improve' of https://github.com/cgoesche/util-linux-fork:
  nsenter: (manpage) fix minor grammar mistake

2 months agoMerge branch 'column_man_page' of https://github.com/echoechoin/util-linux
Karel Zak [Mon, 2 Feb 2026 12:20:52 +0000 (13:20 +0100)] 
Merge branch 'column_man_page' of https://github.com/echoechoin/util-linux

* 'column_man_page' of https://github.com/echoechoin/util-linux:
  column doc: add missing attrubutes
  column doc: fix incorrect attribute: hidden

2 months agoMerge branch 'getino_man_page_improvements' of https://github.com/cgoesche/util-linux...
Karel Zak [Mon, 2 Feb 2026 12:18:33 +0000 (13:18 +0100)] 
Merge branch 'getino_man_page_improvements' of https://github.com/cgoesche/util-linux-fork

* 'getino_man_page_improvements' of https://github.com/cgoesche/util-linux-fork:
  getino: (manpage) improve grammar and wording

2 months agoMerge branch 'more_column_tests' of https://github.com/cgoesche/util-linux-fork
Karel Zak [Mon, 2 Feb 2026 12:11:11 +0000 (13:11 +0100)] 
Merge branch 'more_column_tests' of https://github.com/cgoesche/util-linux-fork

* 'more_column_tests' of https://github.com/cgoesche/util-linux-fork:
  tests: (column) add more tests

2 months agohexdump: fixes Heap-buffer-overflow in rewrite_rules
WanBingjiang [Mon, 2 Feb 2026 06:55:11 +0000 (14:55 +0800)] 
hexdump: fixes Heap-buffer-overflow in rewrite_rules

2 months agolib: (strutils.c) fix unchecked lookahead in ul_parse_size()
Christian Goeschel Ndjomouo [Mon, 2 Feb 2026 00:15:41 +0000 (19:15 -0500)] 
lib: (strutils.c) fix unchecked lookahead in ul_parse_size()

If the numeric value provided to ul_parse_size() via @str
is a decimal with fractions only containing zeros, the logic
fails to identify the end of the string and goes to the label
'check_suffix' and will do an unchecked lookahead (*p + 1)
that will result in an out-of-bounds read.

This is because the logic only checks for null-termination
when a fraction has been parsed, i.e. a fraction not only
containing zeros.

To fix the issue, we implicitly check for null-termination
when we have finished parsing the fraction.

Reported-by: Yashashree Gund <yash_gund@live.com>
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: (waitpid) add tests for the pidfd inode format support
Christian Goeschel Ndjomouo [Tue, 27 Jan 2026 00:33:00 +0000 (19:33 -0500)] 
tests: (waitpid) add tests for the pidfd inode format support

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: (waitpid) move waitpid tests to a dedicated subdir
Christian Goeschel Ndjomouo [Tue, 27 Jan 2026 00:28:41 +0000 (19:28 -0500)] 
tests: (waitpid) move waitpid tests to a dedicated subdir

Moving tests for waitpid(1) in tests/ts/misc to its own
subdirectory, namely tests/ts/waitpid, makes it possible
to add more extensive tests without cluttering tests/ts/misc
and makes the directory structure more coherent.

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agowaitpid: (manpage) document the support for the "PID:inode" addressing format
Christian Goeschel Ndjomouo [Wed, 14 Jan 2026 01:37:26 +0000 (20:37 -0500)] 
waitpid: (manpage) document the support for the "PID:inode" addressing format

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agowaitpid: close fd after removal from epoll interest list
Christian Goeschel Ndjomouo [Mon, 12 Jan 2026 18:53:36 +0000 (13:53 -0500)] 
waitpid: close fd after removal from epoll interest list

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agowaitpid: support 'PID:inode' process addressing format
Christian Goeschel Ndjomouo [Wed, 14 Jan 2026 00:42:09 +0000 (19:42 -0500)] 
waitpid: support 'PID:inode' process addressing format

Adding support for the 'PID:inode' format to address a
process ensures that waitpid(1) safely polls the status
of the expected process in a race-free manner. Worthy of
note is that with the addition of the getino(1) command
the aforementioned task becomes trivially simple.

Example:
        waitpid $(getino -p 123456)

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agowaitpid: refactor to improve maintainability
Christian Goeschel Ndjomouo [Wed, 14 Jan 2026 00:02:47 +0000 (19:02 -0500)] 
waitpid: refactor to improve maintainability

This refactor introduces 'struct waitpid_control' which is
used to control the program state, e.g. option flags, to
create context for internal routines that can adapt their
execution flow accordingly. It has as goal to make the code
easier to understand and reduces the scope of variables.

It also adds 'struct process_info' which stores information
on a process, specified by the PID passed on the command line,
such as the PID, process file descriptor and pidfd inode number.

An array of process_info is used to store information on all
specified PIDs on the command line and is used to create the
event poll list that is integral to the waitpid(1) logic.

This refactor lays the ground work to introduce support for
the 'PID:inode' process addressing format.

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agolib: (pidfd-utils) provide a more liberal variant of ul_get_valid_pidfd_or_err()
Christian Goeschel Ndjomouo [Sat, 10 Jan 2026 01:53:00 +0000 (20:53 -0500)] 
lib: (pidfd-utils) provide a more liberal variant of ul_get_valid_pidfd_or_err()

The new function ul_get_valid_pidfd() behaves less opinionated
in an error case and instead of terminating the calling process
it returns an error.

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agolsfd: add new association "pidfs"
Masatake YAMATO [Fri, 30 Jan 2026 20:27:02 +0000 (05:27 +0900)] 
lsfd: add new association "pidfs"

This new association is inspired by the getino command.

Output example:

  $ ./lsfd --pid=1 -Q '(ASSOC == "pidfs")'
  COMMAND PID USER ASSOC  XMODE  TYPE       SOURCE MNTID INODE NAME
  systemd   1 root pidfs ------ pidfd anon_inodefs     5     2 pid=1 comm=systemd nspid=1

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 months agonsenter: (manpage) fix minor grammar mistake
Christian Goeschel Ndjomouo [Fri, 30 Jan 2026 18:28:02 +0000 (13:28 -0500)] 
nsenter: (manpage) fix minor grammar mistake

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agomount: (manpage) fix minor grammar mistakes
Christian Goeschel Ndjomouo [Fri, 30 Jan 2026 18:34:17 +0000 (13:34 -0500)] 
mount: (manpage) fix minor grammar mistakes

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agocolumn doc: add missing attrubutes
WanBingjiang [Fri, 30 Jan 2026 13:32:06 +0000 (21:32 +0800)] 
column doc: add missing attrubutes

2 months agocolumn doc: fix incorrect attribute: hidden
WanBingjiang [Fri, 30 Jan 2026 13:22:28 +0000 (21:22 +0800)] 
column doc: fix incorrect attribute: hidden

2 months agohexdump: add FIEMAP-based sparse file optimization
WanBingjiang [Fri, 30 Jan 2026 05:48:24 +0000 (13:48 +0800)] 
hexdump: add FIEMAP-based sparse file optimization

Use Linux FIEMAP ioctl to detect sparse file holes and skip reading
them. This significantly improves performance when dumping large
sparse files by avoiding unnecessary disk I/O for hole regions.

Key changes:
- Add fiemap, in_sparse_hole, and region_end fields to struct hexdump
- Use check_hole() with cached region boundaries to minimize syscalls
- Only skip holes when vflag==DUP to preserve correct "*" output
- Distinguish real sparse holes from duplicate data in regular files

2 months agogetino: (manpage) improve grammar and wording
Christian Goeschel Ndjomouo [Fri, 30 Jan 2026 02:45:10 +0000 (21:45 -0500)] 
getino: (manpage) improve grammar and wording

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: (waitpid) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Thu, 29 Jan 2026 05:58:16 +0000 (00:58 -0500)] 
tests: (waitpid) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: use long options globally in test scripts
Christian Goeschel Ndjomouo [Thu, 29 Jan 2026 05:03:29 +0000 (00:03 -0500)] 
tests: use long options globally in test scripts

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: (setarch) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Fri, 23 Jan 2026 20:36:35 +0000 (15:36 -0500)] 
tests: (setarch) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: (script) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Fri, 23 Jan 2026 20:31:41 +0000 (15:31 -0500)] 
tests: (script) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: (rev) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Fri, 23 Jan 2026 20:27:25 +0000 (15:27 -0500)] 
tests: (rev) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: (rename) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Fri, 23 Jan 2026 20:26:40 +0000 (15:26 -0500)] 
tests: (rename) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: (mount) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Fri, 23 Jan 2026 20:02:41 +0000 (15:02 -0500)] 
tests: (mount) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: (more) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Fri, 23 Jan 2026 19:43:16 +0000 (14:43 -0500)] 
tests: (more) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: (lsns) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Fri, 23 Jan 2026 19:12:33 +0000 (14:12 -0500)] 
tests: (lsns) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: (lsmem) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 03:36:51 +0000 (22:36 -0500)] 
tests: (lsmem) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: (lscpu) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 03:25:53 +0000 (22:25 -0500)] 
tests: (lscpu) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: (lsclocks) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 03:24:29 +0000 (22:24 -0500)] 
tests: (lsclocks) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: (losetup) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 03:22:36 +0000 (22:22 -0500)] 
tests: (losetup) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: (logger) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 03:17:18 +0000 (22:17 -0500)] 
tests: (logger) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: (ipcs) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 03:11:42 +0000 (22:11 -0500)] 
tests: (ipcs) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: (ionice) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 03:02:30 +0000 (22:02 -0500)] 
tests: (ionice) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: (hexdump) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 02:55:29 +0000 (21:55 -0500)] 
tests: (hexdump) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: (getopt) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 02:51:22 +0000 (21:51 -0500)] 
tests: (getopt) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: (findmnt) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 02:46:24 +0000 (21:46 -0500)] 
tests: (findmnt) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: (fdisk) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 02:41:17 +0000 (21:41 -0500)] 
tests: (fdisk) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: (fallocate) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 02:34:37 +0000 (21:34 -0500)] 
tests: (fallocate) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: (enosys) use long options instead, to improve test coverage report
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 02:23:41 +0000 (21:23 -0500)] 
tests: (enosys) use long options instead, to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: (chfn) test all long options
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 01:08:57 +0000 (20:08 -0500)] 
tests: (chfn) test all long options

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: (cal) use more long options to improve test coverage accuracy
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 00:48:12 +0000 (19:48 -0500)] 
tests: (cal) use more long options to improve test coverage accuracy

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: (blkid) use more long options to improve test coverage accuracy
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 00:36:23 +0000 (19:36 -0500)] 
tests: (blkid) use more long options to improve test coverage accuracy

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: (blkdiscard) use long options to improve test coverage accuracy
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 00:23:06 +0000 (19:23 -0500)] 
tests: (blkdiscard) use long options to improve test coverage accuracy

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: (column) add more tests
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 01:52:29 +0000 (20:52 -0500)] 
tests: (column) add more tests

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: (chrt) fix various shellcheck warnings
Christian Goeschel Ndjomouo [Thu, 29 Jan 2026 13:00:29 +0000 (08:00 -0500)] 
tests: (chrt) fix various shellcheck warnings

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: (flock) fix shellcheck warning
Christian Goeschel Ndjomouo [Thu, 29 Jan 2026 12:57:52 +0000 (07:57 -0500)] 
tests: (flock) fix shellcheck warning

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: (uuidd) fix various shellcheck warnings
Christian Goeschel Ndjomouo [Thu, 29 Jan 2026 12:55:48 +0000 (07:55 -0500)] 
tests: (uuidd) fix various shellcheck warnings

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: move schedutils tool test scripts to dedicated subdirs
Christian Goeschel Ndjomouo [Thu, 29 Jan 2026 06:16:26 +0000 (01:16 -0500)] 
tests: move schedutils tool test scripts to dedicated subdirs

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: move uuid* tool test scripts to dedicated subdirectories
Christian Goeschel Ndjomouo [Thu, 29 Jan 2026 05:53:02 +0000 (00:53 -0500)] 
tests: move uuid* tool test scripts to dedicated subdirectories

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agotests: move test scripts from tests/ts/misc to dedicated subdir
Christian Goeschel Ndjomouo [Sun, 18 Jan 2026 17:22:36 +0000 (12:22 -0500)] 
tests: move test scripts from tests/ts/misc to dedicated subdir

This patch moves the test scripts in tests/ts/misc to subdirs
in tests/ts for each util-linux tool. It keeps the directory
structure consistent and allows to extend testing for each tool
individually. It also lays the groundwork for the test coverage
report helper script tools/testcoverage.sh.

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agochfn: allow --help and --version without login.defs restrictions
Karel Zak [Thu, 29 Jan 2026 11:50:16 +0000 (12:50 +0100)] 
chfn: allow --help and --version without login.defs restrictions

Parse command line arguments twice: first pass handles --help and
--version before restrictions are applied, second pass enforces
login.defs CHFN_RESTRICT settings for field options.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agotests: (chfn) ensure that invalid input is detected correctly
Christian Goeschel Ndjomouo [Thu, 15 Jan 2026 05:06:41 +0000 (00:06 -0500)] 
tests: (chfn) ensure that invalid input is detected correctly

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agochfn: improve man page
Christian Goeschel Ndjomouo [Fri, 16 Jan 2026 03:20:27 +0000 (22:20 -0500)] 
chfn: improve man page

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 months agochfn: make comment more accurate
Christian Goeschel Ndjomouo [Thu, 15 Jan 2026 23:32:50 +0000 (18:32 -0500)] 
chfn: make comment more accurate

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>