]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
4 days agoMerge branch 'setpriv_econf' of https://github.com/stoeckmann/util-linux master
Karel Zak [Thu, 16 Apr 2026 13:06:35 +0000 (15:06 +0200)] 
Merge branch 'setpriv_econf' of https://github.com/stoeckmann/util-linux

* 'setpriv_econf' of https://github.com/stoeckmann/util-linux:
  autotools: Fix setpriv build with econf

4 days agoinclude/fileutils: fix preprocessor indentation
Karel Zak [Thu, 16 Apr 2026 13:02:12 +0000 (15:02 +0200)] 
include/fileutils: fix preprocessor indentation

Signed-off-by: Karel Zak <kzak@redhat.com>
4 days agoMerge branch 'copyfilerange_syscall_fallback' of https://github.com/cgoesche/util...
Karel Zak [Thu, 16 Apr 2026 12:59:33 +0000 (14:59 +0200)] 
Merge branch 'copyfilerange_syscall_fallback' of https://github.com/cgoesche/util-linux-fork

* 'copyfilerange_syscall_fallback' of https://github.com/cgoesche/util-linux-fork:
  build: (copyfilerange) include syscall header check for fallback
  style: (misc-utils/copyfilerange.c) fix indentation
  include: (fileutils.h) add fallback for the copy_file_range syscall

4 days agoMerge branch 'blkid_usages_option_test' of https://github.com/cgoesche/util-linux...
Karel Zak [Thu, 16 Apr 2026 12:55:42 +0000 (14:55 +0200)] 
Merge branch 'blkid_usages_option_test' of https://github.com/cgoesche/util-linux-fork

* 'blkid_usages_option_test' of https://github.com/cgoesche/util-linux-fork:
  tests: fix grammar in functions.sh
  tests: (blkid) add test for --usages

4 days agoMerge branch 'fix_flock_shell_regression' of https://github.com/cgoesche/util-linux...
Karel Zak [Thu, 16 Apr 2026 12:28:31 +0000 (14:28 +0200)] 
Merge branch 'fix_flock_shell_regression' of https://github.com/cgoesche/util-linux-fork

* 'fix_flock_shell_regression' of https://github.com/cgoesche/util-linux-fork:
  flock: re-enable the initial shell selection logic

4 days agoflock: re-enable the initial shell selection logic
Christian Goeschel Ndjomouo [Thu, 16 Apr 2026 04:18:59 +0000 (00:18 -0400)] 
flock: re-enable the initial shell selection logic

Commit 6651ae5 added /etc/passwd to the list of shells
to choose from before falling back to _PATH_BSHELL.
This introduced a regression as some tools dont expect
this behavior and assume that unsetting SHELLS is enough.

To re-establish the old behavior we can pass the UL_SHELL_NOPWD
flag to the ul_default_shell() helper to ignore shells in
/etc/passwd.

Addresses: #4242
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
5 days agobuild: (copyfilerange) include syscall header check for fallback
Christian Goeschel Ndjomouo [Wed, 15 Apr 2026 12:17:40 +0000 (08:17 -0400)] 
build: (copyfilerange) include syscall header check for fallback

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
5 days agostyle: (misc-utils/copyfilerange.c) fix indentation
Christian Goeschel Ndjomouo [Thu, 9 Apr 2026 15:10:53 +0000 (11:10 -0400)] 
style: (misc-utils/copyfilerange.c) fix indentation

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
5 days agoinclude: (fileutils.h) add fallback for the copy_file_range syscall
Christian Goeschel Ndjomouo [Thu, 9 Apr 2026 15:08:41 +0000 (11:08 -0400)] 
include: (fileutils.h) add fallback for the copy_file_range syscall

Closes: #4212
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
5 days agoMerge branch 'PR/irqtop-slang-vw_printw' of https://github.com/karelzak/util-linux...
Karel Zak [Wed, 15 Apr 2026 11:53:09 +0000 (13:53 +0200)] 
Merge branch 'PR/irqtop-slang-vw_printw' of https://github.com/karelzak/util-linux-work

* 'PR/irqtop-slang-vw_printw' of https://github.com/karelzak/util-linux-work:
  irqtop: use irqtop_puts() for pre-formatted table data
  irqtop: add vw_printw() fallback for slang builds

5 days agoMerge branch 'strutils_strtobool_missing_values' of https://github.com/cgoesche/util...
Karel Zak [Wed, 15 Apr 2026 11:52:09 +0000 (13:52 +0200)] 
Merge branch 'strutils_strtobool_missing_values' of https://github.com/cgoesche/util-linux-fork

* 'strutils_strtobool_missing_values' of https://github.com/cgoesche/util-linux-fork:
  lib: (strutils.c) add missing string values for boolean <false>

5 days agoMerge branch 'PR/lib-nls-fix' of https://github.com/karelzak/util-linux-work
Karel Zak [Wed, 15 Apr 2026 11:51:16 +0000 (13:51 +0200)] 
Merge branch 'PR/lib-nls-fix' of https://github.com/karelzak/util-linux-work

* 'PR/lib-nls-fix' of https://github.com/karelzak/util-linux-work:
  lib/pidutils, lib/pidfd-utils: use _() instead of N_() in err() calls

5 days agoMerge branch 'PR/lsblk-multidevice-mounts' of https://github.com/karelzak/util-linux...
Karel Zak [Wed, 15 Apr 2026 11:50:51 +0000 (13:50 +0200)] 
Merge branch 'PR/lsblk-multidevice-mounts' of https://github.com/karelzak/util-linux-work

* 'PR/lsblk-multidevice-mounts' of https://github.com/karelzak/util-linux-work:
  lsblk: show mountpoints for all multi-device filesystem members

5 days agoautotools: Fix setpriv build with econf
Tobias Stoeckmann [Thu, 9 Apr 2026 20:34:39 +0000 (22:34 +0200)] 
autotools: Fix setpriv build with econf

Link setpriv with libeconf if used due to its usage in lib/logindefs.c.

Closes: #4217
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
5 days agoMerge branch 'randutils' of https://github.com/stoeckmann/util-linux
Karel Zak [Wed, 15 Apr 2026 11:32:52 +0000 (13:32 +0200)] 
Merge branch 'randutils' of https://github.com/stoeckmann/util-linux

* 'randutils' of https://github.com/stoeckmann/util-linux:
  randutils: Move comment to correct place
  randutils: Keep track of randomness source
  randutils: Reduce function and macro visibility
  randutils: Remove unused rand_get_number

5 days agoMerge branch 'pri_translation' of https://github.com/stoeckmann/util-linux
Karel Zak [Wed, 15 Apr 2026 11:31:10 +0000 (13:31 +0200)] 
Merge branch 'pri_translation' of https://github.com/stoeckmann/util-linux

* 'pri_translation' of https://github.com/stoeckmann/util-linux:
  Avoid PRI specifiers in translated messages

5 days agolib/pwdutils: fix compiler warning [-Werror=maybe-uninitialized]
Karel Zak [Wed, 15 Apr 2026 11:27:06 +0000 (13:27 +0200)] 
lib/pwdutils: fix compiler warning [-Werror=maybe-uninitialized]

Signed-off-by: Karel Zak <kzak@redhat.com>
5 days agoAvoid PRI specifiers in translated messages
Tobias Stoeckmann [Sun, 12 Apr 2026 12:16:03 +0000 (14:16 +0200)] 
Avoid PRI specifiers in translated messages

Cast to intmax_t/uintmax_t and use their specifiers in translated
message to keep message IDs stable as pointed out by Thomas Weißschuh.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
5 days agoMerge branch 'printf-integers' of https://github.com/t-8ch/util-linux
Karel Zak [Wed, 15 Apr 2026 11:07:05 +0000 (13:07 +0200)] 
Merge branch 'printf-integers' of https://github.com/t-8ch/util-linux

* 'printf-integers' of https://github.com/t-8ch/util-linux:
  fdisk: use the correct format specifiers for integer types
  lib/procfs: return uint64_t from procfs_process_get_stat_nth()
  chrt: pass correct integer types to printf
  hardlink: avoid format string error for dev_t
  strutils: fix printf formats

5 days agoMerge branch 'kill_decode_test_known_fail' of https://github.com/cgoesche/util-linux...
Karel Zak [Wed, 15 Apr 2026 11:01:36 +0000 (13:01 +0200)] 
Merge branch 'kill_decode_test_known_fail' of https://github.com/cgoesche/util-linux-fork

* 'kill_decode_test_known_fail' of https://github.com/cgoesche/util-linux-fork:
  tests: (kill/decode) mark test as known-fail for inconsistent s390x/QEMU instances

5 days agoMerge branch 'getline_eof' of https://github.com/stoeckmann/util-linux
Karel Zak [Wed, 15 Apr 2026 10:49:37 +0000 (12:49 +0200)] 
Merge branch 'getline_eof' of https://github.com/stoeckmann/util-linux

* 'getline_eof' of https://github.com/stoeckmann/util-linux:
  irqtop/lsirq: Handle EOF in get_irqinfo
  newgrp: Correctly handle getline error

5 days agoMerge branch 'optarg' of https://github.com/stoeckmann/util-linux
Karel Zak [Wed, 15 Apr 2026 10:45:07 +0000 (12:45 +0200)] 
Merge branch 'optarg' of https://github.com/stoeckmann/util-linux

* 'optarg' of https://github.com/stoeckmann/util-linux:
  lsirq: Skip optarg duplication
  chmem: Skip optarg duplication
  getopt: Skip optarg duplication
  copyfilerange: Skip optarg duplication
  blkid: Fix memory leaks
  login: Skip optarg duplication
  lib/cpuset: Skip optarg duplication
  last: Skip optarg duplication

5 days agoMerge branch 'ci/meson' of https://github.com/t-8ch/util-linux
Karel Zak [Wed, 15 Apr 2026 10:37:38 +0000 (12:37 +0200)] 
Merge branch 'ci/meson' of https://github.com/t-8ch/util-linux

* 'ci/meson' of https://github.com/t-8ch/util-linux:
  ci: drop dependency from meson to autotools jobs
  ci: run CHECK phase for meson
  ci: run 'make checkusage' only for autotools build
  meson: build test_scols_termreduce

5 days agoMerge branch 'meson/statx' of https://github.com/t-8ch/util-linux
Karel Zak [Wed, 15 Apr 2026 10:20:37 +0000 (12:20 +0200)] 
Merge branch 'meson/statx' of https://github.com/t-8ch/util-linux

* 'meson/statx' of https://github.com/t-8ch/util-linux:
  meson: test for statx::stx_mnt_id in sys/stat.h

5 days agoMerge branch 'fix_tests_run_sh_script' of https://github.com/cgoesche/util-linux...
Karel Zak [Wed, 15 Apr 2026 10:18:54 +0000 (12:18 +0200)] 
Merge branch 'fix_tests_run_sh_script' of https://github.com/cgoesche/util-linux-fork

* 'fix_tests_run_sh_script' of https://github.com/cgoesche/util-linux-fork:
  tests: (run.sh) remove unused variable
  tests: (run.sh) fix coding style
  tests: (run.sh) remove extraneous case pattern

5 days agorandutils: Move comment to correct place
Tobias Stoeckmann [Sat, 28 Mar 2026 15:39:58 +0000 (16:39 +0100)] 
randutils: Move comment to correct place

The comment is only valid if compiled with getrandom support.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
5 days agorandutils: Keep track of randomness source
Tobias Stoeckmann [Sat, 28 Mar 2026 15:37:15 +0000 (16:37 +0100)] 
randutils: Keep track of randomness source

The mcookie utility wants to report the source of randomness, but even
prints getrandom if it failed to retrieve data through it.

Fix this modifying the return data type of ul_random_get_bytes. Instead
of returning a boolean, the actual source is returned. This avoids any
potential TOCTOU or erroneous output.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
5 days agoMerge branch 'blkid_no_part_details_test' of https://github.com/cgoesche/util-linux...
Karel Zak [Wed, 15 Apr 2026 10:13:17 +0000 (12:13 +0200)] 
Merge branch 'blkid_no_part_details_test' of https://github.com/cgoesche/util-linux-fork

* 'blkid_no_part_details_test' of https://github.com/cgoesche/util-linux-fork:
  tests: (blkid) add --no-part-details tests

5 days agoMerge branch 'last_precision' of https://github.com/stoeckmann/util-linux
Karel Zak [Wed, 15 Apr 2026 10:10:07 +0000 (12:10 +0200)] 
Merge branch 'last_precision' of https://github.com/stoeckmann/util-linux

* 'last_precision' of https://github.com/stoeckmann/util-linux:
  last: Use int for string precision modifier

5 days agorandutils: Reduce function and macro visibility
Tobias Stoeckmann [Sat, 28 Mar 2026 15:24:00 +0000 (16:24 +0100)] 
randutils: Reduce function and macro visibility

srand and rand are no longer used in the tree. In fact, all randomness
used in tree goes through ul_random_get_bytes.

Reduce macro and function visibility to randutils.c where they are still
used.

While at it, update comment.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
5 days agorandutils: Remove unused rand_get_number
Tobias Stoeckmann [Sat, 28 Mar 2026 15:20:50 +0000 (16:20 +0100)] 
randutils: Remove unused rand_get_number

The function is not used anymore.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
5 days agosetarch: fix bold markup for proc_pid_personality in SEE ALSO
Karel Zak [Wed, 15 Apr 2026 10:01:55 +0000 (12:01 +0200)] 
setarch: fix bold markup for proc_pid_personality in SEE ALSO

Signed-off-by: Karel Zak <kzak@redhat.com>
5 days agoMerge branch 'man_see_also' of https://github.com/stoeckmann/util-linux
Karel Zak [Wed, 15 Apr 2026 09:51:22 +0000 (11:51 +0200)] 
Merge branch 'man_see_also' of https://github.com/stoeckmann/util-linux

* 'man_see_also' of https://github.com/stoeckmann/util-linux:
  man: Unify SEE ALSO sections

5 days agoMerge branch 'autoconf_copyfilerange' of https://github.com/stoeckmann/util-linux
Karel Zak [Wed, 15 Apr 2026 09:47:09 +0000 (11:47 +0200)] 
Merge branch 'autoconf_copyfilerange' of https://github.com/stoeckmann/util-linux

* 'autoconf_copyfilerange' of https://github.com/stoeckmann/util-linux:
  build: Fix --disable-copyfilerange

5 days agoMerge branch 'improve_kill_manpage_pidino' of https://github.com/cgoesche/util-linux...
Karel Zak [Wed, 15 Apr 2026 09:46:35 +0000 (11:46 +0200)] 
Merge branch 'improve_kill_manpage_pidino' of https://github.com/cgoesche/util-linux-fork

* 'improve_kill_manpage_pidino' of https://github.com/cgoesche/util-linux-fork:
  kill: (man) improve PID:inode description

5 days agoMerge branch 'fix/issue_2838' of https://github.com/lRespublica/util-linux
Karel Zak [Wed, 15 Apr 2026 09:25:36 +0000 (11:25 +0200)] 
Merge branch 'fix/issue_2838' of https://github.com/lRespublica/util-linux

* 'fix/issue_2838' of https://github.com/lRespublica/util-linux:
  fdisk: fix trailing whitespace in user reply from readline completion

5 days agoMerge branch 'newgrp_less_confusing_error_message' of https://github.com/cgoesche...
Karel Zak [Wed, 15 Apr 2026 09:09:59 +0000 (11:09 +0200)] 
Merge branch 'newgrp_less_confusing_error_message' of https://github.com/cgoesche/util-linux-fork

* 'newgrp_less_confusing_error_message' of https://github.com/cgoesche/util-linux-fork:
  treewide: use err() instead of errx() where ul_get{userpw,grp}_str() fails
  lib: (pwdutils.c) improve error return protocol for callers

5 days agoMerge branch 'unshare_clear_environ' of https://github.com/cgoesche/util-linux-fork
Karel Zak [Wed, 15 Apr 2026 08:41:57 +0000 (10:41 +0200)] 
Merge branch 'unshare_clear_environ' of https://github.com/cgoesche/util-linux-fork

* 'unshare_clear_environ' of https://github.com/cgoesche/util-linux-fork:
  nsenter: use clearenv() only when it is available
  tests: (unshare) add --clear-env option tests
  tests: (test_strerror.c) use ARRAY_SIZE for better readability/portability
  tests: (test_strerror.c) add EPERM errno support
  bash-completion: (unshare) add --clear-env option
  unshare: (manpage) fix minor typos
  unshare: new option to prevent environment variable inheritance

# Conflicts:
# tests/helpers/test_strerror.c

7 days agotests: (kill/decode) mark test as known-fail for inconsistent s390x/QEMU instances
Christian Goeschel Ndjomouo [Mon, 13 Apr 2026 00:24:25 +0000 (20:24 -0400)] 
tests: (kill/decode) mark test as known-fail for inconsistent s390x/QEMU instances

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
8 days agoirqtop/lsirq: Handle EOF in get_irqinfo
Tobias Stoeckmann [Sun, 12 Apr 2026 11:22:13 +0000 (13:22 +0200)] 
irqtop/lsirq: Handle EOF in get_irqinfo

If an empty file is passed to get_irqinfo, getline fails without setting
errno because EOF is not an error condition, even though -1 is returned.

Suppress error message but keep the regular error handling.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
8 days agonewgrp: Correctly handle getline error
Tobias Stoeckmann [Sun, 12 Apr 2026 11:20:35 +0000 (13:20 +0200)] 
newgrp: Correctly handle getline error

If getline fails, errno might be overridden by isatty, leading a wrong
error message.

Also, getline returns -1 on EOF. In which case errno is not set. Use a
custom error message and still handle this as an error condition.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
8 days agolsirq: Skip optarg duplication
Tobias Stoeckmann [Sat, 11 Apr 2026 18:53:10 +0000 (20:53 +0200)] 
lsirq: Skip optarg duplication

The -i argument specfies an input filename. Skip the duplication,
which fixes memory leaks and reduces binary size.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
8 days agochmem: Skip optarg duplication
Tobias Stoeckmann [Sat, 11 Apr 2026 18:52:28 +0000 (20:52 +0200)] 
chmem: Skip optarg duplication

The -z argument is only used for parsing without any modification of the
input string. Skip the duplication to fix memory leaks if -z is supplied
multiple times.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
8 days agogetopt: Skip optarg duplication
Tobias Stoeckmann [Sat, 11 Apr 2026 18:51:41 +0000 (20:51 +0200)] 
getopt: Skip optarg duplication

The -n argument leaks memory if supplied multiple times. Simplify memory
management and reduce binary size.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
8 days agocopyfilerange: Skip optarg duplication
Tobias Stoeckmann [Sat, 11 Apr 2026 18:49:58 +0000 (20:49 +0200)] 
copyfilerange: Skip optarg duplication

The -r arguments are collected in range_files array, which contains
strings which are used for opening files and error messages. Remove
duplication which simplifies memory handling and reduces binary size.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
8 days agoblkid: Fix memory leaks
Tobias Stoeckmann [Sat, 11 Apr 2026 18:48:08 +0000 (20:48 +0200)] 
blkid: Fix memory leaks

If -L and -U arguments are supplied, optarg string duplication leaks
memory.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
8 days agologin: Skip optarg duplication
Tobias Stoeckmann [Sat, 11 Apr 2026 18:38:56 +0000 (20:38 +0200)] 
login: Skip optarg duplication

Supplying -s multiple times leaks memory. The given optarg is
eventually set in a struct passwd and line 1657 is the only alternative
that sets a constant string, i.e. the data is neither freed nor
modified.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
8 days agolib/cpuset: Skip optarg duplication
Tobias Stoeckmann [Sat, 11 Apr 2026 18:38:02 +0000 (20:38 +0200)] 
lib/cpuset: Skip optarg duplication

Fix potential memory leaks and clarify that content of these strings
is never modified. Won't happen since this is test code, but adjust it
for completeness.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
8 days agofdisk: use the correct format specifiers for integer types
Thomas Weißschuh [Sun, 12 Apr 2026 06:03:15 +0000 (08:03 +0200)] 
fdisk: use the correct format specifiers for integer types

libfdisk and its tools don't always use the correct format specifiers.

Make sure that translated strings always use %ju, to keep the message
IDs stables.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
8 days agolast: Skip optarg duplication
Tobias Stoeckmann [Sat, 11 Apr 2026 18:35:56 +0000 (20:35 +0200)] 
last: Skip optarg duplication

The -f arguments are collected in files array, which contains strings
which are used for opening files and error messages. Remove duplication
which simplifies memory handling and reduces binary size.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
8 days agolib/procfs: return uint64_t from procfs_process_get_stat_nth()
Thomas Weißschuh [Sun, 12 Apr 2026 06:08:26 +0000 (08:08 +0200)] 
lib/procfs: return uint64_t from procfs_process_get_stat_nth()

This functions uses ul_strtoul64() to parse the number. As indicated by
the name that can only handle uint64_t values. Passing it a pointer to
uintmax_t can produce a compiler warning.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
8 days agochrt: pass correct integer types to printf
Thomas Weißschuh [Sun, 12 Apr 2026 06:10:26 +0000 (08:10 +0200)] 
chrt: pass correct integer types to printf

The printf format %ju expects an 'uintmax_t'. Cast the values to make
sure the correct type is passed.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
8 days agohardlink: avoid format string error for dev_t
Thomas Weißschuh [Sun, 12 Apr 2026 06:09:24 +0000 (08:09 +0200)] 
hardlink: avoid format string error for dev_t

The real integer type of dev_t is unspecified.
Cast the value to make sure it matches the format specifier.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
8 days agostrutils: fix printf formats
Thomas Weißschuh [Sun, 12 Apr 2026 06:08:37 +0000 (08:08 +0200)] 
strutils: fix printf formats

Use the correct printf format placeholders for uint64_t and int64_t.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
8 days agoci: drop dependency from meson to autotools jobs
Thomas Weißschuh [Sun, 12 Apr 2026 06:31:03 +0000 (08:31 +0200)] 
ci: drop dependency from meson to autotools jobs

Meson is now a first-class support build system.
Run the CI for it right away.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
8 days agoci: run CHECK phase for meson
Thomas Weißschuh [Sun, 12 Apr 2026 06:26:24 +0000 (08:26 +0200)] 
ci: run CHECK phase for meson

Make sure that the code also works when built with meson.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
8 days agoci: run 'make checkusage' only for autotools build
Thomas Weißschuh [Sun, 12 Apr 2026 06:01:43 +0000 (08:01 +0200)] 
ci: run 'make checkusage' only for autotools build

The CHECK phase may be built during a meson build,
but 'make checkusage' requires an autotools build.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
8 days agomeson: build test_scols_termreduce
Thomas Weißschuh [Sun, 12 Apr 2026 06:04:38 +0000 (08:04 +0200)] 
meson: build test_scols_termreduce

Build the test helper for the libsmartcols tests.
The helper expects libsmartcols.h to be in "$builddir/libsmartcols/src",
so make sure meson also places it there.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
10 days agomeson: test for statx::stx_mnt_id in sys/stat.h
Thomas Weißschuh [Fri, 10 Apr 2026 16:04:58 +0000 (18:04 +0200)] 
meson: test for statx::stx_mnt_id in sys/stat.h

Both the check for the general availability of 'struct statx' and the
code actual code use sys/stat.h and not linux/stat.h.

The test for stx_mnt_id also needs to test in sys/stat.h as otherwise
the detection result is wrong.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
10 days agotests: (run.sh) remove unused variable
Christian Goeschel Ndjomouo [Fri, 10 Apr 2026 03:48:35 +0000 (23:48 -0400)] 
tests: (run.sh) remove unused variable

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
10 days agotests: (run.sh) fix coding style
Christian Goeschel Ndjomouo [Fri, 10 Apr 2026 03:40:29 +0000 (23:40 -0400)] 
tests: (run.sh) fix coding style

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
10 days agotests: (run.sh) remove extraneous case pattern
Christian Goeschel Ndjomouo [Fri, 10 Apr 2026 03:20:40 +0000 (23:20 -0400)] 
tests: (run.sh) remove extraneous case pattern

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
10 days agotests: (blkid) add --no-part-details tests
Christian Goeschel Ndjomouo [Thu, 9 Apr 2026 23:55:45 +0000 (19:55 -0400)] 
tests: (blkid) add --no-part-details tests

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
10 days agolast: Use int for string precision modifier
Tobias Stoeckmann [Thu, 9 Apr 2026 19:23:05 +0000 (21:23 +0200)] 
last: Use int for string precision modifier

The %.*s modifier requires an int as precision argument, not an unsigned
int. Instead of just turning the domain_len and name_len fields into
int, this refactoring makes it easier to verify that only two fixed
values are ever used and avoids many int/size_t casts:

Since fullnames_mode field already specifies which values domain_len and
name_len will take, these fields can be turned into local variables.

No special checks required when parsing 'w' argument.

Setting domain_len and name_len as close as possible to their usages as
%.*s modifier arguments shows that the relevant if-else-blocks are always
evaluated and only allow two values.

This leads to smaller binary size because less instructions are needed
(e.g. these variables do not need pointer dereferences anymore).
In total, around 160 bytes on x86_64 are saved.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
10 days agoman: Unify SEE ALSO sections
Tobias Stoeckmann [Thu, 9 Apr 2026 19:54:46 +0000 (21:54 +0200)] 
man: Unify SEE ALSO sections

- Manual pages are separated by comma
- Sections are not bold
- One entry per line

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
11 days agokill: (man) improve PID:inode description
Christian Goeschel Ndjomouo [Thu, 9 Apr 2026 16:18:38 +0000 (12:18 -0400)] 
kill: (man) improve PID:inode description

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
11 days agobuild: Fix --disable-copyfilerange
Tobias Stoeckmann [Thu, 9 Apr 2026 15:23:41 +0000 (17:23 +0200)] 
build: Fix --disable-copyfilerange

The --disable-copyfilerange flag is overridden by BUILD_INIT, because
it's given a second argument.

Remove it to make copyfilerange an option tool (built by default) as
intended.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
11 days agotreewide: use err() instead of errx() where ul_get{userpw,grp}_str() fails
Christian Goeschel Ndjomouo [Wed, 8 Apr 2026 05:20:53 +0000 (01:20 -0400)] 
treewide: use err() instead of errx() where ul_get{userpw,grp}_str() fails

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
11 days agolib: (pwdutils.c) improve error return protocol for callers
Christian Goeschel Ndjomouo [Wed, 8 Apr 2026 04:47:49 +0000 (00:47 -0400)] 
lib: (pwdutils.c) improve error return protocol for callers

In some cases libc does not properly set errno when no passwd
or group entry was found by getpwnam or getgrnam like functions.
This becomes an issue when callers have to provide coherent error
messages with err(). Therefore, let us improve the errno protocol
in internal wrapper functions for the above mentioned and set errno
 when libc does not.

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
11 days agofdisk: fix trailing whitespace in user reply from readline completion
Leonid Znamenok [Thu, 9 Apr 2026 12:39:40 +0000 (16:39 +0400)] 
fdisk: fix trailing whitespace in user reply from readline completion

Readline appends a space after tab-completed filenames, which becomes
part of the string returned by get_user_reply(). This causes "No such
file or directory" when loading a script file via the 'I' command.

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

11 days agoMerge branch 'fix_kill_name_to_number_test' of https://github.com/cgoesche/util-linux...
Karel Zak [Thu, 9 Apr 2026 13:14:01 +0000 (15:14 +0200)] 
Merge branch 'fix_kill_name_to_number_test' of https://github.com/cgoesche/util-linux-fork

* 'fix_kill_name_to_number_test' of https://github.com/cgoesche/util-linux-fork:
  tests: skip SIGRTMAX check on s390x/QEMU

11 days agolib/pidutils, lib/pidfd-utils: use _() instead of N_() in err() calls
Karel Zak [Thu, 9 Apr 2026 13:08:30 +0000 (15:08 +0200)] 
lib/pidutils, lib/pidfd-utils: use _() instead of N_() in err() calls

N_() only marks a string for translation extraction but does not
translate at runtime. Use _() to ensure the error messages are
actually translated when displayed.

Signed-off-by: Karel Zak <kzak@redhat.com>
11 days agoMerge branch 'allow_negative_pids' of https://github.com/cgoesche/util-linux-fork
Karel Zak [Thu, 9 Apr 2026 12:58:25 +0000 (14:58 +0200)] 
Merge branch 'allow_negative_pids' of https://github.com/cgoesche/util-linux-fork

* 'allow_negative_pids' of https://github.com/cgoesche/util-linux-fork:
  tests: add helper program and test for lib/pidutils.c
  lib: (pidutils.c) allow zero and negative numbers for PIDs

11 days agoMerge branch 'man_env_style' of https://github.com/stoeckmann/util-linux
Karel Zak [Thu, 9 Apr 2026 12:52:06 +0000 (14:52 +0200)] 
Merge branch 'man_env_style' of https://github.com/stoeckmann/util-linux

* 'man_env_style' of https://github.com/stoeckmann/util-linux:
  lscpu(man): Split ENVIRONMENT descriptions
  terminal-colors.d(man): Clarify debug output
  man: Fix ENVIRONMENT bold text style
  man: Avoid conditional ENVIRONMENT descriptions
  man: End sentences with fullstop
  man: Adjust ENVIRONMENT grammar
  man: Start ENVIRONMENT sentences with capital letter
  man: Drop ENVIRONMENT intro text
  swaplabel(man): Fix indentation
  man: Sort ENVIRONMENT variables alphabetically
  mkfs.cramfs(man): Add ENVIRONMENT section
  mkfs.bfs(man): Add ENVIRONMENT section
  lslocks(man): Merge environment sections

11 days agoMerge branch 'fix-luks-probe' of https://github.com/silentcreek/util-linux
Karel Zak [Thu, 9 Apr 2026 12:50:56 +0000 (14:50 +0200)] 
Merge branch 'fix-luks-probe' of https://github.com/silentcreek/util-linux

* 'fix-luks-probe' of https://github.com/silentcreek/util-linux:
  libblkid: Ignore secondary LUKS2 header in blkid_do_safeprobe()

11 days agoMerge branch 'pam_resources' of https://github.com/stoeckmann/util-linux
Karel Zak [Thu, 9 Apr 2026 12:49:17 +0000 (14:49 +0200)] 
Merge branch 'pam_resources' of https://github.com/stoeckmann/util-linux

* 'pam_resources' of https://github.com/stoeckmann/util-linux:
  login-utils/auth: Drop pam_setcred
  su: Clean up PAM resources on all error paths
  login: Clean up PAM resources on error path

11 days agotests: fix grammar in functions.sh
Christian Goeschel Ndjomouo [Thu, 9 Apr 2026 12:10:21 +0000 (08:10 -0400)] 
tests: fix grammar in functions.sh

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
11 days agotests: (blkid) add test for --usages
Christian Goeschel Ndjomouo [Tue, 7 Apr 2026 00:28:16 +0000 (20:28 -0400)] 
tests: (blkid) add test for --usages

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
11 days agolsblk: show mountpoints for all multi-device filesystem members
Karel Zak [Thu, 9 Apr 2026 12:30:39 +0000 (14:30 +0200)] 
lsblk: show mountpoints for all multi-device filesystem members

/proc/self/mountinfo lists only one member device per mount, so other
devices in multi-device filesystems appear unmounted. Add a group cache
that discovers multi-device groups and propagates mount entries to all
members.

For btrfs, device groups are enumerated from /sys/fs/btrfs/<uuid>/devices/.
For ZFS, pool names are collected from mountinfo (fstype=zfs) and devices
are matched via blkid properties (fstype=zfs_member, label=poolname).

Mount entries are cached in the group during scan, so the per-device
lookup is a simple iteration of cached entries without re-scanning
mountinfo.

Addresses: https://github.com/util-linux/util-linux/issues/4145
Addresses: https://github.com/util-linux/util-linux/pull/4198
Signed-off-by: Karel Zak <kzak@redhat.com>
11 days agoMerge branch 'libblkid_s_formatter' of https://github.com/stoeckmann/util-linux
Karel Zak [Thu, 9 Apr 2026 09:49:45 +0000 (11:49 +0200)] 
Merge branch 'libblkid_s_formatter' of https://github.com/stoeckmann/util-linux

* 'libblkid_s_formatter' of https://github.com/stoeckmann/util-linux:
  libblkid: Fix typo in probe_zfs
  libblkid: Fix type access in zfs_extract_guid_name
  libblkid: Fix debug OOB read in zfs_process_value
  libblkid: Fix parse_dev debug output
  libblkid: Simplify blkid_probe_log_csum_mismatch

11 days agoMerge branch 'asciidoc' of https://github.com/stoeckmann/util-linux
Karel Zak [Thu, 9 Apr 2026 09:39:18 +0000 (11:39 +0200)] 
Merge branch 'asciidoc' of https://github.com/stoeckmann/util-linux

* 'asciidoc' of https://github.com/stoeckmann/util-linux:
  po-man/po4a: Add missing manual pages
  fsck.minix(man): Fix asciidoctor table

11 days agoMerge branch 'fix/issue_4125' of https://github.com/lord2y/util-linux
Karel Zak [Thu, 9 Apr 2026 09:35:38 +0000 (11:35 +0200)] 
Merge branch 'fix/issue_4125' of https://github.com/lord2y/util-linux

* 'fix/issue_4125' of https://github.com/lord2y/util-linux:
  eject: tolerate ILLEGAL REQUEST on ALLOW_MEDIUM_REMOVAL

11 days agoMerge branch 'agetty_syslog' of https://github.com/stoeckmann/util-linux
Karel Zak [Thu, 9 Apr 2026 09:23:07 +0000 (11:23 +0200)] 
Merge branch 'agetty_syslog' of https://github.com/stoeckmann/util-linux

* 'agetty_syslog' of https://github.com/stoeckmann/util-linux:
  agetty: Always use syslog

11 days agolscpu(man): Split ENVIRONMENT descriptions
Tobias Stoeckmann [Tue, 7 Apr 2026 17:32:20 +0000 (19:32 +0200)] 
lscpu(man): Split ENVIRONMENT descriptions

Keep environment variable descriptions independent from each other.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
11 days agoterminal-colors.d(man): Clarify debug output
Tobias Stoeckmann [Tue, 7 Apr 2026 17:31:09 +0000 (19:31 +0200)] 
terminal-colors.d(man): Clarify debug output

Specify which debug output exactly is printed.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
11 days agoman: Fix ENVIRONMENT bold text style
Tobias Stoeckmann [Tue, 7 Apr 2026 16:55:18 +0000 (18:55 +0200)] 
man: Fix ENVIRONMENT bold text style

Turn environment variables bold but not their values. Also do not use
bold text in description for debug variables.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
11 days agoman: Avoid conditional ENVIRONMENT descriptions
Tobias Stoeckmann [Tue, 7 Apr 2026 16:49:21 +0000 (18:49 +0200)] 
man: Avoid conditional ENVIRONMENT descriptions

Describe what the variable does directly to avoid conditional
statements.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
11 days agoman: End sentences with fullstop
Tobias Stoeckmann [Tue, 7 Apr 2026 16:50:48 +0000 (18:50 +0200)] 
man: End sentences with fullstop

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
11 days agoman: Adjust ENVIRONMENT grammar
Tobias Stoeckmann [Tue, 7 Apr 2026 16:33:36 +0000 (18:33 +0200)] 
man: Adjust ENVIRONMENT grammar

Avoid third person and describe what you can do with the variable
instead. Matches OPTIONS section sentences.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
11 days agoman: Start ENVIRONMENT sentences with capital letter
Tobias Stoeckmann [Tue, 7 Apr 2026 16:27:07 +0000 (18:27 +0200)] 
man: Start ENVIRONMENT sentences with capital letter

This merges writing style with other sections, e.g. OPTIONS. Also, some
sentences already complied to this.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
11 days agoMerge branch 'fix-musl-at-handle-fid' of https://github.com/Gskartwii/util-linux
Karel Zak [Thu, 9 Apr 2026 08:45:52 +0000 (10:45 +0200)] 
Merge branch 'fix-musl-at-handle-fid' of https://github.com/Gskartwii/util-linux

* 'fix-musl-at-handle-fid' of https://github.com/Gskartwii/util-linux:
  nsenter: Fix AT_HANDLE_FID on musl

11 days agoirqtop: use irqtop_puts() for pre-formatted table data
Karel Zak [Thu, 9 Apr 2026 08:39:52 +0000 (10:39 +0200)] 
irqtop: use irqtop_puts() for pre-formatted table data

Avoid unnecessary printf formatting when outputting pre-formatted
table strings. The new irqtop_puts() writes data directly via
fputs/waddstr without extra buffer allocation, appending a specified
number of trailing newlines.

This also reduces the buffer size requirements for the vw_printw()
slang fallback, which is now only used for the short header line.

Signed-off-by: Karel Zak <kzak@redhat.com>
11 days agoirqtop: add vw_printw() fallback for slang builds
Karel Zak [Thu, 9 Apr 2026 08:16:30 +0000 (10:16 +0200)] 
irqtop: add vw_printw() fallback for slang builds

The vw_printw() function and OK macro are ncurses-specific and not
available in slang's curses compatibility layer. This causes build
failures when configuring with --with-slang.

Add configure/meson checks for vw_printw() availability and provide
a portable fallback implementation using vsnprintf() and waddstr()
when the function is not available.

Addresses: https://github.com/util-linux/util-linux/issues/4177
Signed-off-by: Karel Zak <kzak@redhat.com>
11 days agoeject: tolerate ILLEGAL REQUEST on ALLOW_MEDIUM_REMOVAL
Alessandro Ratti [Wed, 8 Apr 2026 16:25:07 +0000 (18:25 +0200)] 
eject: tolerate ILLEGAL REQUEST on ALLOW_MEDIUM_REMOVAL

Some USB devices using the UAS driver do not support the SCSI
ALLOW_MEDIUM_REMOVAL command and return ILLEGAL REQUEST (sense
key 0x05). Previously, eject_scsi() treated any non-zero
driver_status as fatal, aborting before attempting START_STOP.

Now, when the device reports DRIVER_SENSE with sense key ILLEGAL
REQUEST, we continue to the START_STOP eject commands instead
of bailing out.

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

Signed-off-by: Alessandro Ratti <alessandro@0x65c.net>
11 days agolibblkid: Fix typo in probe_zfs
Tobias Stoeckmann [Wed, 8 Apr 2026 19:57:46 +0000 (21:57 +0200)] 
libblkid: Fix typo in probe_zfs

It should be swap_endian, not swab_endian.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
11 days agolibblkid: Fix type access in zfs_extract_guid_name
Tobias Stoeckmann [Wed, 8 Apr 2026 19:56:03 +0000 (21:56 +0200)] 
libblkid: Fix type access in zfs_extract_guid_name

Check if enough space is left for a 32 bit value before parsing it. This
is not a technical out of boundary issue, because due to alignment,
enough bytes are available.

Yet, perform a proper logic check here.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
11 days agolibblkid: Fix debug OOB read in zfs_process_value
Tobias Stoeckmann [Wed, 8 Apr 2026 19:53:12 +0000 (21:53 +0200)] 
libblkid: Fix debug OOB read in zfs_process_value

It is possible to trigger an out of boundary read in zfs_process_value
if debugging is activated.

The debug message erroneously uses %*s (field width) instead of %.*s
(precision), which might lead to string output going past the boundary
of memory mapped buffer.

Fix this with proper casting: The value is always smaller than
VDEV_PHYS_SIZE (112 KB) at this stage, easily fitting into int.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
11 days agolibblkid: Fix parse_dev debug output
Tobias Stoeckmann [Wed, 8 Apr 2026 19:48:13 +0000 (21:48 +0200)] 
libblkid: Fix parse_dev debug output

A parse_dev debug line erroneously uses %*s instead of %.*s. While this
does not lead to out of boundary access because the line is properly
NUL-escaped by fgets, the output is incorrect.

Simply replace the ending char with NUL for debug, since the line is
modified a few lines below anyway. This offers more safety for
refactoring in the future if fgets is ever replaced with getline,
possibly leading to lines longer than INT_MAX.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
11 days agolibblkid: Simplify blkid_probe_log_csum_mismatch
Tobias Stoeckmann [Wed, 8 Apr 2026 19:39:32 +0000 (21:39 +0200)] 
libblkid: Simplify blkid_probe_log_csum_mismatch

The function blkid_probe_log_csum_mismatch is only used for debugging
purposes. Simplify the code to avoid any form of modifier for %s.

Right now, %*s is incorrect because it specifies the field width, not
the precision. This could theoretically lead to issues, but since this
function is always called with sizes of 8 or 32, it is safe.

Just make sure that the strings are always NUL-terminated, even if size
is 0 or larger than 256.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
11 days agopo-man/po4a: Add missing manual pages
Tobias Stoeckmann [Wed, 8 Apr 2026 19:25:55 +0000 (21:25 +0200)] 
po-man/po4a: Add missing manual pages

Two manual pages recently linked into the build lacked translation
entries, leading to asciidoctor warnings. Fix these by adding them:

```
unconfigured in /home/runner/work/util-linux/util-linux/po-man/po4a.cfg: ../liblastlog2/man/ll2_new_context.3.adoc
unconfigured in /home/runner/work/util-linux/util-linux/po-man/po4a.cfg: ../liblastlog2/man/ll2_unref_context.3.adoc
```

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>