Karel Zak [Mon, 12 Jan 2026 12:21:32 +0000 (13:21 +0100)]
Merge branch 'lslocks--Q' of https://github.com/masatake/util-linux
* 'lslocks--Q' of https://github.com/masatake/util-linux:
tests: (lslocks) test -Q,--filter option
tests: (test_mkfds::nop) new factory just printing pid
lslocks: special-case PID for filtering (skip −1)
lslocks: make SIZE filterable by normalizing to bytes
lslocks: implement Q, --filter option
lslocks: factor out code getting and setting the data from add_scols_line
lslocks: (refactor) move proc_locks to struct lslocks
lslocks: (refactor) move pid_locks in main to struct lslocks
lslocks: (refactor) move "tab" file static variable to struct lslocks
lslocks: (refactor) add struct lslocks representing the global context
lslocks: (refactor) use global bytes in get_json_type_for_column()
lslocks: (refactor) add a helper function refining value returned from get_lock
lslocks: (refactor) don't use redundant callback functions
lslocks: (refactor) specify list_head as type instead of abusing void*
lslocks: (refactor) use separate function to initialize libscols_table
lslocks: (refactor) remove an unused local variable
lslocks: (refactor) use narrow variable scoping for loop counters
lslocks: (comment) fix grammar
Karel Zak [Mon, 12 Jan 2026 12:21:17 +0000 (13:21 +0100)]
Merge branch 'PR/fallocate-report-holes' of https://github.com/karelzak/util-linux-work
* 'PR/fallocate-report-holes' of https://github.com/karelzak/util-linux-work:
tests: convert fallocate to use subtests
fallocate: refactor --report-holes and --dig-holes output
fallocate: add --report-holes
The existing code tries to only print content of non-empty files, but
does not check the target of an encountered symbolic link, which could
be even something else, e.g. a fifo. Add the missing check to the
motddir_filter function.
Even though alarm(0) is called, another process could still send a
SIGALRM signal to the login process, which could trigger a use after
free for a tiny amount of time.
Not able to reproduce without adding a proper sleep.
The util-linux project preferred coding style is based on the kernel
coding-style (https://docs.kernel.org/process/coding-style.html),
which explains that opening braces should be on a line on their own
after the function signature. Therefore, let us adapt functions that
violate this convention.
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
Karel Zak [Thu, 8 Jan 2026 12:35:43 +0000 (13:35 +0100)]
Merge branch 'feat/new_tool_getpidino' of https://github.com/cgoesche/util-linux-fork
* 'feat/new_tool_getpidino' of https://github.com/cgoesche/util-linux-fork:
lib: (pidfd-utils) minor correction in the ul_get_valid_pidfd_or_err() description
tests: add getino tests
bash-completion: add getino completions
getino: new tool to print the unique pidfd or namespace inode number
Alessandro Ratti [Sun, 28 Dec 2025 18:12:08 +0000 (19:12 +0100)]
tests: add regression test for repeated termreduce printing
Add a regression test that verifies repeated printing of the same
libsmartcols table produces identical output when termreduce is used.
Before the fix, the effective output width would shrink on each print,
resulting in progressively truncated output. The test guards against
future regressions by ensuring printing remains stable across
invocations.
Add a small test helper program that creates a libsmartcols table,
applies scols_table_reduce_termwidth(), and prints the table multiple
times within the same process.
The helper is used by regression tests to detect unintended cumulative
width reduction across repeated printing.
Alessandro Ratti [Sun, 28 Dec 2025 18:07:55 +0000 (19:07 +0100)]
libsmartcols: avoid cumulative width reduction during printing
__scols_initialize_printing() applied scols_table_reduce_termwidth()
by mutating table->termwidth via scols_table_set_termwidth().
When printing is performed repeatedly on the same table (e.g. in
interactive applications), this causes the effective output width
to shrink on each invocation, eventually truncating output.
Introduce an internally computed effective output width and stop
modifying termwidth during printing. All layout calculations are
updated to use the derived width instead, making the printing path
idempotent.
No functional change is expected for single-shot printing.
Addresses: https://github.com/util-linux/util-linux/issues/3895 Suggested-by: Karel Zak <kzak@redhat.com> Signed-off-by: Alessandro Ratti <alessandro@0x65c.net>
ci: add usage message consistency check to CI CODECHECK phase
Add 'make checkmanpage' to the GitHub CI CODECHECK phase.
This ensures that all programs have a corresponding manpage
and that said manpage have a description for each long option
defined in the respective program's source code.
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
tools: verify the consistency of manpages for all programs
The tools/checkmanpage.sh script ensures that all programs
have a corresponding manpage as well as the integrity of
all described long options in the manpage based on the
respective programs source code.
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
libblkid: (bcachefs) add members_v2 parsing support
Since bcachefs 1.25, in many cases bcachefs does not write members_v1 field
in the superblock, leading to UUID_SUB and FSSIZE tags missing in blkid output.
Fix this by parsing the new extendable members_v2 superblock field too.
Karel Zak [Tue, 6 Jan 2026 11:27:58 +0000 (12:27 +0100)]
Merge branch 'setpwnam' of https://github.com/stoeckmann/util-linux
* 'setpwnam' of https://github.com/stoeckmann/util-linux:
setpwnam: use getline instead of fgets
setpwnam: only unlock when actually locked
setpwnam: check if /etc/passwd was fully read
Karel Zak [Mon, 5 Jan 2026 11:34:58 +0000 (12:34 +0100)]
Merge branch 'add_annotate_opt_lscpu' of https://github.com/cgoesche/util-linux-fork
* 'add_annotate_opt_lscpu' of https://github.com/cgoesche/util-linux-fork:
lscpu: add --annotate info to man page
bash-completion: (lscpu) add --annotate option
lscpu: add column header annotations for -C and -e
Karel Zak [Mon, 5 Jan 2026 11:32:13 +0000 (12:32 +0100)]
Merge branch 'fix_readprofile_mapfile_option' of https://github.com/cgoesche/util-linux-fork
* 'fix_readprofile_mapfile_option' of https://github.com/cgoesche/util-linux-fork:
readprofile: (manpage) fix incorrect file name in --mapfile description
Karel Zak [Mon, 5 Jan 2026 11:29:36 +0000 (12:29 +0100)]
Merge branch 'fix/check_long_opts_integrity_usage' of https://github.com/cgoesche/util-linux-fork
* 'fix/check_long_opts_integrity_usage' of https://github.com/cgoesche/util-linux-fork:
readprofile: fix memory leak related to boot_uname_r_str() in usage()
lslogins: ignore special long options in CI CHECK
setpriv: fix usage message inconsistency
newgrp: provide --command info in output message
logger: ignore libsystemd-dependent long opt in CI CHECK
ci: add usage message consistency check to CI CHECK phase
su-common: ignore runuser(1) specific long option in CI CHECK
nologin: ignore well-known shell command-line options in CI CHECK
unshare: fix inconsistency in usage message
flock: resolve consistency issue in the usage message
nsenter: ignore SELinux-specific long option in CI CHECK
namei: ignore SELinux-specific long option in CI CHECK
lsclocks: fix inconsistency in usage message
hwclock: mark non-standard long options to ignore in CI CHECK
tools: (get-options.sh) skip programs that do not use <struct option>
tools: (get-options.sh) ignore long opt definitions marked with IGNORECHECK=yes
tools: (checkusage.sh) verify the completeness of listed long options
ci: add usage message consistency check to CI CHECK phase
Add 'make checkusage' to the GitHub CI CHECK phase.
This ensures that all program's usage messages list all
long options defined in their respective source code.
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
Kiran Rangoon [Mon, 29 Dec 2025 03:51:00 +0000 (22:51 -0500)]
tests: correct UUID timestamp test expectations
Update expected timestamps for additional test UUIDs to match actual
output. These test cases provide coverage for various timestamp ranges
including pre-epoch, historical, and far-future dates.
Signed-off-by: Kiran Rangoon <kiranrangoon0@gmail.com> Reviewed-by: Thomas Weißschuh <thomas@t-8ch.de>
Kiran Rangoon [Mon, 29 Dec 2025 03:50:59 +0000 (22:50 -0500)]
libuuid: fix timestamp overflow for pre-1970 dates
Use int64_t arithmetic to correctly handle timestamps before Unix epoch.
This fixes the overflow that was causing UUID timestamps from 1582 to
appear as far-future dates. Update test expectations accordingly.
Signed-off-by: Kiran Rangoon <kiranrangoon0@gmail.com> Reviewed-by: Thomas Weißschuh <thomas@t-8ch.de>
Masatake YAMATO [Mon, 29 Dec 2025 07:22:24 +0000 (16:22 +0900)]
lslocks: special-case PID for filtering (skip −1)
The PID column may be printed as −1 for locks that are not tied to a
process or are inaccessible to lslocks (e.g., permission constraints).
The libsmartcols filter engine does not support negative integers, so
PID = −1 cannot be compared reliably.
Attach the PID as cell userdata only when PID >= 0, and use that value
for filter evaluation. Rows with PID = −1 are thus excluded from PID
comparisons.
Masatake YAMATO [Mon, 15 Dec 2025 21:41:59 +0000 (06:41 +0900)]
lslocks: make SIZE filterable by normalizing to bytes
The SIZE column may be printed in raw bytes or human-readable
units (KB/MB, etc.), which makes number-based comparison impossible.
Normalize SIZE to a byte value and store it in the cell via
libsmartcols `scols_cell_set_userdata`. When evaluating filter
expressions, use the stored byte value instead of the printed SIZE.
This enables consistent numeric comparisons (e.g., -Q 'SIZE > 1M')
regardless of the output format.
Masatake YAMATO [Mon, 15 Dec 2025 20:15:30 +0000 (05:15 +0900)]
lslocks: (refactor) use global bytes in get_json_type_for_column()
`get_json_type_for_column()` used to take `representing_in_bytes`, but
every caller passed the global `bytes`. The parameter added no value
and split the ownership of the setting. Drop the parameter and read
the global `bytes` instead.
This aligns lslocks with lsblk and prepares for adding `-Q/--filter`.
lsblk also reads global `bytes` defined in lsblk.c