]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
6 weeks agoscript: fix backward compatibility for options after non-option args
Karel Zak [Tue, 7 Apr 2026 13:20:04 +0000 (15:20 +0200)] 
script: fix backward compatibility for options after non-option args

The commit 7268e79b added "+" to the getopt_long() options string to
support the "--" separator for specifying commands. The "+" prefix
makes getopt stop processing at the first non-option argument, which
breaks the traditional "script file -c command" usage.

Fix this by pre-scanning argv for "--" before getopt, separating the
command arguments, and removing the "+" prefix to restore GNU getopt
argument permutation.

Addresses: 7268e79bc5365034a6e5b38ac5d9bf635e2dafc2
Reported-by: Chris Hofstaedtler <zeha@debian.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
6 weeks agoMerge branch 'fix_grammar_in_su_manpage' of https://github.com/cgoesche/util-linux...
Karel Zak [Tue, 7 Apr 2026 14:49:59 +0000 (16:49 +0200)] 
Merge branch 'fix_grammar_in_su_manpage' of https://github.com/cgoesche/util-linux-fork

* 'fix_grammar_in_su_manpage' of https://github.com/cgoesche/util-linux-fork:
  su: fix grammar on man page

6 weeks agoinclude/statfs_magic.h: revert portable struct statfs headers
Karel Zak [Tue, 7 Apr 2026 14:45:55 +0000 (16:45 +0200)] 
include/statfs_magic.h: revert portable struct statfs headers

Revert changes from commits 1af964d935 and 5f66e252c1c2.

Adding sys/mount.h, sys/vfs.h, and related includes to statfs_magic.h
caused build failures on older systems (e.g., Ubuntu) due to a
collision between sys/mount.h and linux/fs.h -- both define MS_RDONLY,
the first as an enum and the second as a macro.

The previous fix (guarding sys/mount.h with !defined(MS_RDONLY)) was
insufficient because on some systems linux/fs.h itself chains into
sys/mount.h, making the guard unreachable.

The correct approach is to keep statfs_magic.h minimal (only magic
numbers and sys/statfs.h) and let callers include the necessary
struct statfs headers. Currently, all callers of statfs_magic.h are
Linux-only (libmount requires sys/vfs.h, hardlink's USE_REFLINK
requires HAVE_LINUX_FIEMAP_H), so the Darwin-specific sys/mount.h
include is unreachable anyway.

Sorry for the mess, and sorry I had not used a PR for this.

Fixes: 1af964d935 ("include/statfs_magic.h: add portable struct statfs headers for Darwin")
Fixes: 5f66e252c1 ("include/statfs_magic.h: avoid sys/mount.h and linux/fs.h collision")
Signed-off-by: Karel Zak <kzak@redhat.com>
6 weeks agoinclude/statfs_magic.h: avoid sys/mount.h and linux/fs.h collision
Karel Zak [Tue, 7 Apr 2026 13:34:13 +0000 (15:34 +0200)] 
include/statfs_magic.h: avoid sys/mount.h and linux/fs.h collision

Guard the sys/mount.h include with !defined(MS_RDONLY) to prevent
redefinition errors when linux/fs.h has already been included (e.g.,
in fstrim.c). This follows the same pattern used in libmount.h.in.

Fixes: 1af964d935 ("include/statfs_magic.h: add portable struct statfs headers for Darwin")
Signed-off-by: Karel Zak <kzak@redhat.com>
6 weeks agolibcommon: move pidfd-utils.c to Linux-only sources
Karel Zak [Tue, 7 Apr 2026 12:46:06 +0000 (14:46 +0200)] 
libcommon: move pidfd-utils.c to Linux-only sources

The pidfd-utils.c uses Linux-specific APIs (pidfd_open, statx, etc.)
and all its consumers are Linux-only tools. Move it under the LINUX
guard in both meson and autotools build systems.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 weeks agoinclude/statfs_magic.h: add portable struct statfs headers for Darwin
Morgan Jones [Mon, 6 Apr 2026 01:03:54 +0000 (18:03 -0700)] 
include/statfs_magic.h: add portable struct statfs headers for Darwin

Fixes the build on Darwin since struct statfs is in sys/mount.h
and sys/vfs.h doesn't even exist. Just conditionally include all the
headers.

[kzak@redhat.com: - removed lib/pidfd-utils.c change]

Signed-off-by: Karel Zak <kzak@redhat.com>
6 weeks agoMerge branch 'debug_readability' of https://github.com/stoeckmann/util-linux
Karel Zak [Tue, 7 Apr 2026 12:18:52 +0000 (14:18 +0200)] 
Merge branch 'debug_readability' of https://github.com/stoeckmann/util-linux

* 'debug_readability' of https://github.com/stoeckmann/util-linux:
  debug: Change debug masknames variable name
  debug: Link __UL_DBG_ macros together
  debug: Use macro definitions more often
  debug: Unify variable names
  debug: Unify debug mask output
  debug: Turn mask unsigned
  debug: Introduce UL_DEBUG_ALL

6 weeks agoMerge branch 'last_numbers' of https://github.com/stoeckmann/util-linux
Karel Zak [Tue, 7 Apr 2026 12:16:47 +0000 (14:16 +0200)] 
Merge branch 'last_numbers' of https://github.com/stoeckmann/util-linux

* 'last_numbers' of https://github.com/stoeckmann/util-linux:
  last: Use strtou32_or_err for -n arguments
  last: Improve max records parsing

6 weeks agoMerge branch 'lsclocks_missing_newline_in_usage' of https://github.com/cgoesche/util...
Karel Zak [Tue, 7 Apr 2026 12:15:31 +0000 (14:15 +0200)] 
Merge branch 'lsclocks_missing_newline_in_usage' of https://github.com/cgoesche/util-linux-fork

* 'lsclocks_missing_newline_in_usage' of https://github.com/cgoesche/util-linux-fork:
  lsclocks: add missing newline character in option description

6 weeks agoMerge branch 'fix-mkswap-file-perms' of https://github.com/jwueller/util-linux
Karel Zak [Tue, 7 Apr 2026 12:11:02 +0000 (14:11 +0200)] 
Merge branch 'fix-mkswap-file-perms' of https://github.com/jwueller/util-linux

* 'fix-mkswap-file-perms' of https://github.com/jwueller/util-linux:
  mkswap: Fix --file chmod(2) check when file exists

6 weeks agoMerge branch 'man_env' of https://github.com/stoeckmann/util-linux
Karel Zak [Tue, 7 Apr 2026 12:08:19 +0000 (14:08 +0200)] 
Merge branch 'man_env' of https://github.com/stoeckmann/util-linux

* 'man_env' of https://github.com/stoeckmann/util-linux:
  man: Document debug environment variables
  lscpu(man): Move options into correct section
  lsblk(man): Add COLORS section
  man: Add libsmartcols environment variables

6 weeks agoMerge branch 'chrt_elaborate_on_sched_ext_policy' of https://github.com/cgoesche...
Karel Zak [Tue, 7 Apr 2026 11:49:32 +0000 (13:49 +0200)] 
Merge branch 'chrt_elaborate_on_sched_ext_policy' of https://github.com/cgoesche/util-linux-fork

* 'chrt_elaborate_on_sched_ext_policy' of https://github.com/cgoesche/util-linux-fork:
  chrt: (man) explain which kernel config options are needed for SCHED_EXT

6 weeks agowrite, mesg: add S_ISCHR() check for terminal device paths
Karel Zak [Tue, 7 Apr 2026 11:49:02 +0000 (13:49 +0200)] 
write, mesg: add S_ISCHR() check for terminal device paths

Verify that the target path is a character device before proceeding.
This hardens both utilities against symlink-to-regular-file attacks
as a defense-in-depth measure.

Note that the TOCTOU race condition between stat() and freopen()/open()
is only theoretical -- on modern Linux systems /dev/pts/ is a
kernel-managed devpts filesystem where unprivileged users cannot create
or replace entries, and the setgid tty privilege only grants write
access to terminal devices, not to arbitrary files.

6 weeks agoMerge branch 'matching_formatters' of https://github.com/stoeckmann/util-linux
Karel Zak [Tue, 7 Apr 2026 10:41:15 +0000 (12:41 +0200)] 
Merge branch 'matching_formatters' of https://github.com/stoeckmann/util-linux

* 'matching_formatters' of https://github.com/stoeckmann/util-linux:
  Use correct formatters for given data types

6 weeks agoMerge branch 'code_typos' of https://github.com/stoeckmann/util-linux
Karel Zak [Tue, 7 Apr 2026 10:32:58 +0000 (12:32 +0200)] 
Merge branch 'code_typos' of https://github.com/stoeckmann/util-linux

* 'code_typos' of https://github.com/stoeckmann/util-linux:
  su: Remove obsolete code comment
  Fix grammar and typos in code comments

6 weeks agoMerge branch 'pager_sigpipe' of https://github.com/stoeckmann/util-linux
Karel Zak [Tue, 7 Apr 2026 10:30:23 +0000 (12:30 +0200)] 
Merge branch 'pager_sigpipe' of https://github.com/stoeckmann/util-linux

* 'pager_sigpipe' of https://github.com/stoeckmann/util-linux:
  lib/pager: Fix SIGPIPE handling

6 weeks agoMerge branch 'err_fullstop' of https://github.com/stoeckmann/util-linux
Karel Zak [Tue, 7 Apr 2026 10:27:34 +0000 (12:27 +0200)] 
Merge branch 'err_fullstop' of https://github.com/stoeckmann/util-linux

* 'err_fullstop' of https://github.com/stoeckmann/util-linux:
  Fix spacing in err messages
  Remove ending punctation from err messages

6 weeks agodebug: Change debug masknames variable name
Tobias Stoeckmann [Fri, 3 Apr 2026 10:31:44 +0000 (12:31 +0200)] 
debug: Change debug masknames variable name

The concatenation for the mask itself is lib_debug_mask, so do the same
for masknames, i.e. add debug into its name.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
6 weeks agodebug: Link __UL_DBG_ macros together
Tobias Stoeckmann [Fri, 3 Apr 2026 09:08:36 +0000 (11:08 +0200)] 
debug: Link __UL_DBG_ macros together

__UL_DBG_CALL can be used by __UL_DBG_OBJ which can be used by __UL_DBG,
which puts the flag check into a single line without duplications.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
6 weeks agodebug: Use macro definitions more often
Tobias Stoeckmann [Fri, 3 Apr 2026 08:52:06 +0000 (10:52 +0200)] 
debug: Use macro definitions more often

Improve readability by using macro definitions instead of explicitly
concatenating variable names in various places.

While at it, fixed formatting.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
6 weeks agodebug: Unify variable names
Tobias Stoeckmann [Fri, 3 Apr 2026 08:48:11 +0000 (10:48 +0200)] 
debug: Unify variable names

If variables mean the same thing, they should have also the same name.
Improves readability.

Add a single comment for the whole header file which specifies what
these identifiers mean.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
6 weeks agodebug: Unify debug mask output
Tobias Stoeckmann [Fri, 3 Apr 2026 08:35:38 +0000 (10:35 +0200)] 
debug: Unify debug mask output

Always format with 0x08x to also cover internal flags. These would be
printed anyway, but now it's always properly formatted.

Keep 0x06x in ul_debug_print_masks since these flags are never supposed
to have any private bits (above UL_DEBUG_ALL) set.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
6 weeks agoMerge branch 'getgrp_range' of https://github.com/stoeckmann/util-linux
Karel Zak [Tue, 7 Apr 2026 10:01:49 +0000 (12:01 +0200)] 
Merge branch 'getgrp_range' of https://github.com/stoeckmann/util-linux

* 'getgrp_range' of https://github.com/stoeckmann/util-linux:
  pwdutils: Set errno with out of range UIDs/GIDs

6 weeks agodebug: Turn mask unsigned
Tobias Stoeckmann [Fri, 3 Apr 2026 08:16:48 +0000 (10:16 +0200)] 
debug: Turn mask unsigned

The debug mask is a bitmask, so use an unsigned type. This also matches
the string formatters, since x/X expect an unsigned data type.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
6 weeks agoMerge branch 'unshare_indentation' of https://github.com/stoeckmann/util-linux
Karel Zak [Tue, 7 Apr 2026 08:53:51 +0000 (10:53 +0200)] 
Merge branch 'unshare_indentation' of https://github.com/stoeckmann/util-linux

* 'unshare_indentation' of https://github.com/stoeckmann/util-linux:
  unshare: Fix code indentation

6 weeks agoMerge branch 'fix_incomplete_filename_comp_umount' of https://github.com/cgoesche...
Karel Zak [Tue, 7 Apr 2026 08:47:30 +0000 (10:47 +0200)] 
Merge branch 'fix_incomplete_filename_comp_umount' of https://github.com/cgoesche/util-linux-fork

* 'fix_incomplete_filename_comp_umount' of https://github.com/cgoesche/util-linux-fork:
  bash-completion: complete relative path for filenames as well

6 weeks agoman: Document debug environment variables
Tobias Stoeckmann [Thu, 2 Apr 2026 15:31:03 +0000 (17:31 +0200)] 
man: Document debug environment variables

Document all debug environment variables affecting the tool. These
variables have an effect if the debug init function is called.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
6 weeks agomkswap: Fix --file chmod(2) check when file exists
Johannes Wüller [Sat, 4 Apr 2026 18:03:06 +0000 (20:03 +0200)] 
mkswap: Fix --file chmod(2) check when file exists

The documentation claims that `--size` will resize the `--file`, but
it ends up failing like this:

    # mkswap --file /swapfile --size 4G
    Setting up swapspace version 1, size = 4 GiB (4294963200 bytes)
    no label, UUID=1523588e-412a-4f25-8fac-aeaf638101aa
    # mkswap --file /swapfile --size 4G
    mkswap: cannot set permissions on swap file /swapfile: Success

There seems to have been a typo in the chmod(2) return value comparison.
It checked for `< 9` rather than `< 0`, which would usually indicate
failure. After the fix:

    # mkswap --file /swapfile --size 4G
    Setting up swapspace version 1, size = 4 GiB (4294963200 bytes)
    no label, UUID=6be7c450-761c-442d-8d9a-3e8cd93506b5
    # mkswap --file /swapfile --size 4G
    mkswap: /swapfile: warning: wiping old swap signature.
    Setting up swapspace version 1, size = 4 GiB (4294963200 bytes)
    no label, UUID=617a793e-84b1-471d-96c5-c099f8b157db

The operation no longer fails, as validated by the added test.

7 weeks agochrt: (man) explain which kernel config options are needed for SCHED_EXT
Christian Goeschel Ndjomouo [Sun, 5 Apr 2026 19:14:07 +0000 (15:14 -0400)] 
chrt: (man) explain which kernel config options are needed for SCHED_EXT

On systems running kernel version 6.12+ it is still possible
that the syscall to set SCHED_EXT fails with EINVAL, this can
happen when certain kernel configuration options have not been
set. The list of required options can be found here:
https://docs.kernel.org/scheduler/sched-ext.html#switching-to-and-from-sched-ext

Let's document this in the man page to give users a heads up.

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
7 weeks agolast: Use strtou32_or_err for -n arguments
Tobias Stoeckmann [Sat, 4 Apr 2026 16:07:09 +0000 (18:07 +0200)] 
last: Use strtou32_or_err for -n arguments

The maximum amount of records is an unsigned int. Use the correct parser
function.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
7 weeks agolast: Improve max records parsing
Tobias Stoeckmann [Sat, 4 Apr 2026 16:04:49 +0000 (18:04 +0200)] 
last: Improve max records parsing

The maximum amount of records to print can be specified in two different
ways: Either with -n/--limit or by specifying the number as argument,
i.e. -number.

The current parser does not check for possible overflow with -number
arguments and mixes -number arguments with -n arguments.

Properly split these two notations and use strtou32_or_err for overflow
checks.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
7 weeks agosu: fix grammar on man page
Christian Goeschel Ndjomouo [Sat, 4 Apr 2026 12:05:12 +0000 (08:05 -0400)] 
su: fix grammar on man page

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
7 weeks agosu: Remove obsolete code comment
Tobias Stoeckmann [Fri, 3 Apr 2026 07:48:55 +0000 (09:48 +0200)] 
su: Remove obsolete code comment

This su implementation always depends on PAM.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
7 weeks agoFix grammar and typos in code comments
Tobias Stoeckmann [Fri, 3 Apr 2026 07:48:33 +0000 (09:48 +0200)] 
Fix grammar and typos in code comments

No functional change.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
7 weeks agoUse correct formatters for given data types
Tobias Stoeckmann [Fri, 3 Apr 2026 15:48:09 +0000 (17:48 +0200)] 
Use correct formatters for given data types

Use required formatters for given data types (signedness).

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
7 weeks agolib/pager: Fix SIGPIPE handling
Tobias Stoeckmann [Sat, 4 Apr 2026 08:07:53 +0000 (10:07 +0200)] 
lib/pager: Fix SIGPIPE handling

Reset the child pid only after comparison with waitpid result.
Currently, this leads to returning -1 or 1, which ultimately leads
to exit code 1 in case of a SIGPIPE. This is the behavior as of 2.41,
which means that no regression between releases occurred. Yet, fix it
nonetheless.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
7 weeks agopwdutils: Set errno with out of range UIDs/GIDs
Tobias Stoeckmann [Fri, 3 Apr 2026 13:58:40 +0000 (15:58 +0200)] 
pwdutils: Set errno with out of range UIDs/GIDs

If a UID/GID is larger than its respective data type allows (but smaller
than uint64_t), then tools like newgrp erroneously assume that the user
or group simply does not exist.

Set errno to indicate that the supplied UID/GID is out of range instead.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
7 weeks agodebug: Introduce UL_DEBUG_ALL
Tobias Stoeckmann [Fri, 3 Apr 2026 08:12:18 +0000 (10:12 +0200)] 
debug: Introduce UL_DEBUG_ALL

Use a common macro definition for all *_DEBUG_ALL definitions. Sometimes
they slightly differ, yet they always mean the same thing.

Unifying these definitions also helps when parsing the mask, since "all"
would be set to 0xFFFF in debug code if not overwritten by debug mask
names.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
7 weeks agounshare: Fix code indentation
Tobias Stoeckmann [Fri, 3 Apr 2026 07:35:20 +0000 (09:35 +0200)] 
unshare: Fix code indentation

Adjust indentation to clarify where these if and else blocks belong.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
7 weeks agoFix spacing in err messages
Tobias Stoeckmann [Fri, 3 Apr 2026 07:29:25 +0000 (09:29 +0200)] 
Fix spacing in err messages

If strings are concatenated in source code, keep extra spacing in mind.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
7 weeks agoRemove ending punctation from err messages
Tobias Stoeckmann [Thu, 2 Apr 2026 21:09:37 +0000 (23:09 +0200)] 
Remove ending punctation from err messages

Since err() appends more data separated by a colon, do not add a
fullstop to error message.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
7 weeks agolsclocks: add missing newline character in option description
Christian Goeschel Ndjomouo [Fri, 3 Apr 2026 02:07:52 +0000 (22:07 -0400)] 
lsclocks: add missing newline character in option description

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
7 weeks agobash-completion: complete relative path for filenames as well
Christian Goeschel Ndjomouo [Thu, 2 Apr 2026 19:49:45 +0000 (15:49 -0400)] 
bash-completion: complete relative path for filenames as well

Commit 1a76e3e only helped with the completion of directory
names for relative paths. Let us complete filenames too for
completeness (no pun intended).

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
7 weeks agolscpu(man): Move options into correct section
Tobias Stoeckmann [Thu, 2 Apr 2026 15:29:17 +0000 (17:29 +0200)] 
lscpu(man): Move options into correct section

Link help-version.adoc into OPTIONS section instead of ENVIRONMENT.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
7 weeks agolsblk(man): Add COLORS section
Tobias Stoeckmann [Thu, 2 Apr 2026 15:27:23 +0000 (17:27 +0200)] 
lsblk(man): Add COLORS section

Since lsblk supports colors, link in COLORS description.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
7 weeks agoman: Add libsmartcols environment variables
Tobias Stoeckmann [Thu, 2 Apr 2026 15:23:32 +0000 (17:23 +0200)] 
man: Add libsmartcols environment variables

Link env-smartcols.adoc into manual pages of tools linked with
libsmartcols. Most tools have this documentation already, but some lack
it.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
7 weeks agopo: merge changes
Karel Zak [Wed, 1 Apr 2026 11:24:58 +0000 (13:24 +0200)] 
po: merge changes

7 weeks agopo: update uk.po (from translationproject.org)
Yuri Chornoivan [Wed, 1 Apr 2026 11:24:48 +0000 (13:24 +0200)] 
po: update uk.po (from translationproject.org)

7 weeks agopo: update ro.po (from translationproject.org)
Remus-Gabriel Chelu [Wed, 1 Apr 2026 11:24:48 +0000 (13:24 +0200)] 
po: update ro.po (from translationproject.org)

7 weeks agopo: update pt.po (from translationproject.org)
Pedro Albuquerque [Wed, 1 Apr 2026 11:24:48 +0000 (13:24 +0200)] 
po: update pt.po (from translationproject.org)

7 weeks agopo: update ko.po (from translationproject.org)
Seong-ho Cho [Wed, 1 Apr 2026 11:24:48 +0000 (13:24 +0200)] 
po: update ko.po (from translationproject.org)

7 weeks agopo: update fr.po (from translationproject.org)
Frédéric Marchal [Wed, 1 Apr 2026 11:24:48 +0000 (13:24 +0200)] 
po: update fr.po (from translationproject.org)

7 weeks agopo: update de.po (from translationproject.org)
Mario Blättermann [Wed, 1 Apr 2026 11:24:48 +0000 (13:24 +0200)] 
po: update de.po (from translationproject.org)

7 weeks agopo: update ar.po (from translationproject.org)
Zayed Al-Saidi [Wed, 1 Apr 2026 11:24:48 +0000 (13:24 +0200)] 
po: update ar.po (from translationproject.org)

7 weeks agopo-man: merge changes
Karel Zak [Wed, 1 Apr 2026 11:24:45 +0000 (13:24 +0200)] 
po-man: merge changes

7 weeks agopo-man: update ro.po (from translationproject.org)
Remus-Gabriel Chelu [Wed, 1 Apr 2026 11:24:32 +0000 (13:24 +0200)] 
po-man: update ro.po (from translationproject.org)

7 weeks agopo-man: update de.po (from translationproject.org)
Mario Blättermann [Wed, 1 Apr 2026 11:24:32 +0000 (13:24 +0200)] 
po-man: update de.po (from translationproject.org)

7 weeks agopo-man: update ar.po (from translationproject.org)
Zayed Al-Saidi [Wed, 1 Apr 2026 11:24:32 +0000 (13:24 +0200)] 
po-man: update ar.po (from translationproject.org)

7 weeks agodocs: update v2.42-ReleaseNotes
Karel Zak [Wed, 1 Apr 2026 10:47:40 +0000 (12:47 +0200)] 
docs: update v2.42-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit 039b4343caeaf2e06f37ec52cfd288479d7b200c)

7 weeks agotools: git-version-next filter tags by stable branch version
Karel Zak [Wed, 1 Apr 2026 10:13:17 +0000 (12:13 +0200)] 
tools: git-version-next filter tags by stable branch version

Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit ab7a9dc172b27191ed27eabcec7f099215d2e8a6)

7 weeks agolibfdisk: dos: validate EBR link within extended partition bounds
Karel Zak [Wed, 25 Mar 2026 10:54:42 +0000 (11:54 +0100)] 
libfdisk: dos: validate EBR link within extended partition bounds

The read_extended() function follows EBR chain links without checking
that the target offset falls within the master extended partition.
A malformed EBR link can point outside the extended area.

Add a bounds check before read_pte() to stop the chain walk when the
next EBR offset is outside [ext_start, ext_end]. This is self-defense
during parsing; it does not restrict what the user can create.

Signed-off-by: Karel Zak <kzak@redhat.com>
7 weeks agolibblkid: dos: validate EBR data and links within extended partition
Karel Zak [Wed, 25 Mar 2026 10:54:28 +0000 (11:54 +0100)] 
libblkid: dos: validate EBR data and links within extended partition

The parse_dos_extended() function processes EBR (Extended Boot Record)
chains, but does not properly validate that partitions and links stay
within the master extended partition area [ex_start, ex_start+ex_size).

For EBR data partitions at index 0 and 1, there are no bounds checks
at all, unlike entries at index 2 and 3. This allows a crafted disk
image to register partitions at arbitrary sectors via uint32_t overflow
in the abs_start calculation (cur_start + start wraps to a small value).

Fix by:
 - using 64-bit arithmetic for the abs_start calculation to avoid
   uint32_t wraparound
 - applying the extended partition area bounds check to all EBR data
   entries, not just index >= 2
 - validating EBR link targets stay within the extended area and
   advance forward (preventing backward links that could loop)

Reported-by: Michele Piccinni <piccinni.michele@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
7 weeks agoloopdev: add LOOPDEV_FL_NOFOLLOW to prevent symlink attacks
Karel Zak [Thu, 19 Feb 2026 12:59:46 +0000 (13:59 +0100)] 
loopdev: add LOOPDEV_FL_NOFOLLOW to prevent symlink attacks

Add a new LOOPDEV_FL_NOFOLLOW flag for loop device context that
prevents symlink following in both path canonicalization and file open.

When set:
- loopcxt_set_backing_file() uses strdup() instead of
  ul_canonicalize_path() (which calls realpath() and follows symlinks)
- loopcxt_setup_device() adds O_NOFOLLOW to open() flags

The flag is set for non-root (restricted) mount operations in
libmount's loop device hook. This prevents a TOCTOU race condition
where an attacker could replace the backing file (specified in
/etc/fstab) with a symlink to an arbitrary root-owned file between
path resolution and open().

Vulnerable Code Flow:

  mount /mnt/point (non-root, SUID)
    mount.c: sanitize_paths() on user args (mountpoint only)
    mnt_context_mount()
      mnt_context_prepare_mount()
        mnt_context_apply_fstab()           <-- source path from fstab
        hooks run at MNT_STAGE_PREP_SOURCE
          hook_loopdev.c: setup_loopdev()
            backing_file = fstab source path ("/home/user/disk.img")
            loopcxt_set_backing_file()       <-- calls realpath() as ROOT
              ul_canonicalize_path()         <-- follows symlinks!
            loopcxt_setup_device()
              open(lc->filename, O_RDWR|O_CLOEXEC)  <-- no O_NOFOLLOW

Two vulnerabilities in the path:

1) loopcxt_set_backing_file() calls ul_canonicalize_path() which uses
   realpath() -- this follows symlinks as euid=0. If the attacker swaps
   the file to a symlink before this call, lc->filename becomes the
   resolved target path (e.g., /root/secret.img).

2) loopcxt_setup_device() opens lc->filename without O_NOFOLLOW. Even
   if canonicalization happened correctly, the file can be swapped to a
   symlink between canonicalize and open.

Addresses: https://github.com/util-linux/util-linux/security/advisories/GHSA-qq4x-vfq4-9h9g
Signed-off-by: Karel Zak <kzak@redhat.com>
7 weeks agodebug: Remove ul_debugobj
Tobias Stoeckmann [Mon, 23 Mar 2026 12:17:31 +0000 (13:17 +0100)] 
debug: Remove ul_debugobj

Merge its functionality into ul_debug_prefix and use proper macros in
tools which still call it directly. This adjusts output, but makes it
actually more readable.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
7 weeks agodebug: Introduce __UL_DBG_OBJ
Tobias Stoeckmann [Fri, 20 Mar 2026 09:39:06 +0000 (10:39 +0100)] 
debug: Introduce __UL_DBG_OBJ

Merges debugobj.h into debug.c and increases flexibility in output:
Just like __UL_DBG any debug output function can be supplied.
Throughout the code, this is always ul_debug by today.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
7 weeks agolsblk: Remove extra whitespace in debug message
Tobias Stoeckmann [Fri, 20 Mar 2026 10:51:58 +0000 (11:51 +0100)] 
lsblk: Remove extra whitespace in debug message

The ul_debugobj function already takes care of initial whitespace.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
7 weeks agoMerge branch 'less-header-support' of https://github.com/kurok/util-linux
Karel Zak [Tue, 31 Mar 2026 10:10:28 +0000 (12:10 +0200)] 
Merge branch 'less-header-support' of https://github.com/kurok/util-linux

* 'less-header-support' of https://github.com/kurok/util-linux:
  libsmartcols: move scols_table_calculate to SMARTCOLS_2.43 symbol version
  libsmartcols: document scols_table_calculate() constraints
  libsmartcols: fix Since tag for scols_table_calculate()
  build: link test_pager against lib_common in meson too
  build: link test_pager against libcommon
  pager: use ul_strfconcat() instead of fixed-size buffer
  pager: support --header 0,M for column-only freezing
  pager: address review feedback for less --header support
  libsmartcols: add scols_table_calculate to docs sections
  libsmartcols: add scols_table_calculate(), pager: add less --header support

7 weeks agolibsmartcols: move scols_table_calculate to SMARTCOLS_2.43 symbol version
YuriyRyabikov [Tue, 31 Mar 2026 09:48:41 +0000 (10:48 +0100)] 
libsmartcols: move scols_table_calculate to SMARTCOLS_2.43 symbol version

The function ships in v2.43, so it needs its own symbol version
section rather than being grouped with the 2.42 symbols.

7 weeks agolibsmartcols: document scols_table_calculate() constraints
YuriyRyabikov [Tue, 31 Mar 2026 09:30:32 +0000 (10:30 +0100)] 
libsmartcols: document scols_table_calculate() constraints

Clarify that the table must not be modified after calculate, and
that the calculation is consumed by the next scols_print_table()
call only.

7 weeks agolibsmartcols: fix Since tag for scols_table_calculate()
YuriyRyabikov [Tue, 31 Mar 2026 09:20:34 +0000 (10:20 +0100)] 
libsmartcols: fix Since tag for scols_table_calculate()

Update version annotation from 2.42 to 2.43 as this API will
ship in the 2.43 release cycle.

7 weeks agoMerge branch 'newgrp_group_id_support' of https://github.com/cgoesche/util-linux...
Karel Zak [Tue, 31 Mar 2026 08:31:44 +0000 (10:31 +0200)] 
Merge branch 'newgrp_group_id_support' of https://github.com/cgoesche/util-linux-fork

* 'newgrp_group_id_support' of https://github.com/cgoesche/util-linux-fork:
  newgrp: allow to specify a group with the GID

7 weeks agoMerge branch 'prlimit_pidino_support' of https://github.com/cgoesche/util-linux-fork
Karel Zak [Tue, 31 Mar 2026 08:27:57 +0000 (10:27 +0200)] 
Merge branch 'prlimit_pidino_support' of https://github.com/cgoesche/util-linux-fork

* 'prlimit_pidino_support' of https://github.com/cgoesche/util-linux-fork:
  tests: (prlimit) add pid:ino address format test
  prlimit: support 'PID:inode' process address format

7 weeks agoblkpr: fix a typo ("sp:ec" => "spec"), and drop an overemphatic comma
Benno Schulenberg [Mon, 30 Mar 2026 14:25:51 +0000 (16:25 +0200)] 
blkpr: fix a typo ("sp:ec" => "spec"), and drop an overemphatic comma

The typo was introduced in commit a2752fe270, three months ago.

(The comma is not in same sentence in the next string either.)

Reported-by: Pedro Albuquerque <pmra@protonmail.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
7 weeks agoMerge branch 'islocal_fix_code_style' of https://github.com/cgoesche/util-linux-fork
Karel Zak [Tue, 31 Mar 2026 08:20:58 +0000 (10:20 +0200)] 
Merge branch 'islocal_fix_code_style' of https://github.com/cgoesche/util-linux-fork

* 'islocal_fix_code_style' of https://github.com/cgoesche/util-linux-fork:
  islocal: use less ambiguous variable name
  islocal: improve coding style

7 weeks agoMerge branch 'fincore-test-fix-tmpfs-detection' of https://github.com/lRespublica...
Karel Zak [Tue, 31 Mar 2026 08:19:31 +0000 (10:19 +0200)] 
Merge branch 'fincore-test-fix-tmpfs-detection' of https://github.com/lRespublica/util-linux

* 'fincore-test-fix-tmpfs-detection' of https://github.com/lRespublica/util-linux:
  fincore: (tests) fix tmpfs detection for out-of-tree builds

7 weeks agoMerge branch 'lslogins_use_list_cols_macro' of https://github.com/cgoesche/util-linux...
Karel Zak [Tue, 31 Mar 2026 08:17:58 +0000 (10:17 +0200)] 
Merge branch 'lslogins_use_list_cols_macro' of https://github.com/cgoesche/util-linux-fork

* 'lslogins_use_list_cols_macro' of https://github.com/cgoesche/util-linux-fork:
  lslogins: use the USAGE_LIST_COLUMNS_OPTION macro

7 weeks agofincore: (tests) fix tmpfs detection for out-of-tree builds
Leonid Znamenok [Mon, 30 Mar 2026 20:33:46 +0000 (00:33 +0400)] 
fincore: (tests) fix tmpfs detection for out-of-tree builds

The tmpfs check used $PWD which points to the source directory, not
to the output directory where test files are actually created. When
tests are run with --builddir on tmpfs (e.g. /tmp), the check fails
to detect it and the test produces wrong results because O_DIRECT
has no effect on tmpfs.

Use $TS_OUTDIR instead, which is the actual directory where dd
creates test files and fincore inspects them.

7 weeks agolslogins: use the USAGE_LIST_COLUMNS_OPTION macro
Christian Goeschel Ndjomouo [Mon, 30 Mar 2026 18:18:41 +0000 (14:18 -0400)] 
lslogins: use the USAGE_LIST_COLUMNS_OPTION macro

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
7 weeks agolibuser: fix misleading error message
Christian Goeschel Ndjomouo [Mon, 30 Mar 2026 17:44:13 +0000 (13:44 -0400)] 
libuser: fix misleading error message

When setting the effective user fails the code prints a
misleading error message stating that 'group' privileges
could not be dropped, but it should state 'user' instead.

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
7 weeks agonewgrp: allow to specify a group with the GID
Christian Goeschel Ndjomouo [Sun, 29 Mar 2026 22:18:40 +0000 (18:18 -0400)] 
newgrp: allow to specify a group with the GID

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
7 weeks agoMerge branch 'improve/getino_known_failed' of https://github.com/echoechoin/util...
Karel Zak [Mon, 30 Mar 2026 12:50:44 +0000 (14:50 +0200)] 
Merge branch 'improve/getino_known_failed' of https://github.com/echoechoin/util-linux

* 'improve/getino_known_failed' of https://github.com/echoechoin/util-linux:
  tests: improve lsfd test

7 weeks agoMerge branch 'improve/wrong_message' of https://github.com/echoechoin/util-linux
Karel Zak [Mon, 30 Mar 2026 12:48:07 +0000 (14:48 +0200)] 
Merge branch 'improve/wrong_message' of https://github.com/echoechoin/util-linux

* 'improve/wrong_message' of https://github.com/echoechoin/util-linux:
  liblastlog2: fix error message in write_entry

7 weeks agotests: (prlimit) add pid:ino address format test
Christian Goeschel Ndjomouo [Sun, 29 Mar 2026 19:34:40 +0000 (15:34 -0400)] 
tests: (prlimit) add pid:ino address format test

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
7 weeks agoprlimit: support 'PID:inode' process address format
Christian Goeschel Ndjomouo [Sun, 29 Mar 2026 18:55:17 +0000 (14:55 -0400)] 
prlimit: support 'PID:inode' process address format

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
7 weeks agoislocal: use less ambiguous variable name
Christian Goeschel Ndjomouo [Sun, 29 Mar 2026 18:00:36 +0000 (14:00 -0400)] 
islocal: use less ambiguous variable name

The variable name 'match' naturally implies a binary
state e.g. true or false and is not appropriate for
the indexing of a string literal, it is better to
avoid this ambiguity and use a name that properly
conveys its purpose, in this case 'idx' is a better
choice.

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
7 weeks agoislocal: improve coding style
Christian Goeschel Ndjomouo [Sun, 29 Mar 2026 17:35:35 +0000 (13:35 -0400)] 
islocal: improve coding style

This patch improves the coding style in various places for
better readability, semantic clarity and alignment with
common best practices.

Changes include the transposition of a variable assignment
in a conditional statement to its own line for better
readability, the removal of defensive programming techniques
like 'yoda conditions' where constants are specified on the
left of variables, which reduce natural readability and are
not necessary as erroneous variable assignments will be
indicated by the compiler anyways. Lastly, the 'u' suffix is
extraneous for variable assignments to 'match' as it is a size_t.

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
7 weeks agotests: improve lsfd test
WanBingjiang [Mon, 30 Mar 2026 09:27:42 +0000 (17:27 +0800)] 
tests: improve lsfd test

The assoc-pidfs use the getino command. Set "TS_KNOWN_FAIL" if
the condition are not met.

Signed-off-by: WanBingjiang <wanbingjiang@webray.com.cn>
7 weeks agoliblastlog2: fix error message in write_entry
WanBingjiang [Mon, 30 Mar 2026 06:32:44 +0000 (14:32 +0800)] 
liblastlog2: fix error message in write_entry

Replace misleading "Delete statement failed" with "Failed to write
entry" since write_entry uses REPLACE INTO for both insert and update.

Signed-off-by: WanBingjiang <wanbingjiang@webray.com.cn>
8 weeks agomeson: Remove unused variable
Tobias Stoeckmann [Fri, 27 Mar 2026 19:43:08 +0000 (20:43 +0100)] 
meson: Remove unused variable

The variable "name" within manadocs loop is unused. Remove it.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
8 weeks agosu: Declare force_pty only with USE_PTY
Tobias Stoeckmann [Wed, 25 Mar 2026 16:44:47 +0000 (17:44 +0100)] 
su: Declare force_pty only with USE_PTY

This makes it easier to review that force_pty is only used (or actually
useable) if USE_PTY is defined.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
8 weeks agolibmount: improve mnt_fs_get_id/uniq_id documentation
Karel Zak [Wed, 25 Mar 2026 12:46:09 +0000 (13:46 +0100)] 
libmount: improve mnt_fs_get_id/uniq_id documentation

Clarify when mount IDs are available depending on how the mount table
was populated (mountinfo parsing vs listmount/statmount).  Document
that mnt_fs_get_uniq_id() returns 0 for mountinfo-parsed tables and
point users to mnt_id_from_path() as the statx-based alternative.

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

8 weeks agoMerge branch 'su_sig_race' of https://github.com/stoeckmann/util-linux
Karel Zak [Wed, 25 Mar 2026 11:08:56 +0000 (12:08 +0100)] 
Merge branch 'su_sig_race' of https://github.com/stoeckmann/util-linux

* 'su_sig_race' of https://github.com/stoeckmann/util-linux:
  su: Fix signal race during shutdown

2 months agoinclude/c.h: fix inverted #ifdef for sys/auxv.h
Karel Zak [Wed, 25 Mar 2026 09:51:33 +0000 (10:51 +0100)] 
include/c.h: fix inverted #ifdef for sys/auxv.h

The #ifndef was inverted, causing sys/auxv.h to be included when it
is NOT available. Fix to #ifdef.

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

2 months agotools: git-version-next fix -devel tag and rename variables
Karel Zak [Tue, 24 Mar 2026 10:28:40 +0000 (11:28 +0100)] 
tools: git-version-next fix -devel tag and rename variables

Fix UL_LAST_FINAL_RELEASE to not match -devel tags by using a
positive match for final release formats (vX.Y or vX.Y.Z) instead
of only excluding -rc suffixes.

Rename variables to use consistent UL_RELEASE_ prefix:
 - UL_LAST_RELEASE       -> UL_RELEASE_LAST
 - UL_LAST_FINAL_RELEASE -> UL_RELEASE_LAST_STABLE
 - UL_LAST_XY_RELEASE    -> UL_RELEASE_LAST_XY
 - UL_NEXT_RELEASE       -> UL_RELEASE_NEXT
 - UL_NEXT_FINAL_RELEASE -> UL_RELEASE_NEXT_STABLE

Add UL_RELEASE_NEXT_XY (vX.Y of the next release) for use in
download URLs and announcements.

2 months agoMerge branch 'PR/unshare-uid-parse-fix' of https://github.com/karelzak/util-linux...
Karel Zak [Tue, 24 Mar 2026 09:32:48 +0000 (10:32 +0100)] 
Merge branch 'PR/unshare-uid-parse-fix' of https://github.com/karelzak/util-linux-work

* 'PR/unshare-uid-parse-fix' of https://github.com/karelzak/util-linux-work:
  pwdutils: extend ul_getuserpw_str() and ul_getgrp_str() to return ID

2 months agolibblkid: fix stale comment in version.c
Karel Zak [Tue, 24 Mar 2026 09:23:01 +0000 (10:23 +0100)] 
libblkid: fix stale comment in version.c

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agomeson: remove unused HAVE_LIBFDISK and HAVE_LIBSMARTCOLS defines
Karel Zak [Thu, 19 Mar 2026 20:06:30 +0000 (21:06 +0100)] 
meson: remove unused HAVE_LIBFDISK and HAVE_LIBSMARTCOLS defines

These config.h defines are never used in source code or anywhere
else in the project.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agoliblastlog2: generate lastlog2.h from template
Karel Zak [Thu, 19 Mar 2026 19:53:41 +0000 (20:53 +0100)] 
liblastlog2: generate lastlog2.h from template

Convert lastlog2.h to lastlog2.h.in and add LIBLASTLOG2_VERSION,
LIBLASTLOG2_MAJOR_VERSION, LIBLASTLOG2_MINOR_VERSION, and
LIBLASTLOG2_PATCH_VERSION defines to follow the same pattern as
libmount, libfdisk, libsmartcols, and libblkid.

Update both autotools (configure.ac, Makemodule.am) and meson
(liblastlog2/meson.build) to generate the header.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agolibblkid: add LIBBLKID_VERSION to blkid.h, remove redundant config.h versions
Karel Zak [Thu, 19 Mar 2026 13:20:40 +0000 (14:20 +0100)] 
libblkid: add LIBBLKID_VERSION to blkid.h, remove redundant config.h versions

Add LIBBLKID_VERSION, LIBBLKID_MAJOR_VERSION, LIBBLKID_MINOR_VERSION,
and LIBBLKID_PATCH_VERSION to blkid.h.in to follow the same pattern as
libmount, libfdisk, and libsmartcols. Keep BLKID_VERSION and BLKID_DATE
as backward-compatible aliases.

Remove redundant AC_DEFINE for library version strings from configure.ac
(LIBMOUNT_VERSION, LIBSMARTCOLS_VERSION, LIBFDISK_VERSION,
LIBLASTLOG2_VERSION). These were duplicated in config.h when the library
public headers already define them via .h.in templates.

Remove LIBBLKID_VERSION and LIBBLKID_DATE from meson config.h for the
same reason.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agomeson: add hwclock-gplv3 option
Karel Zak [Thu, 19 Mar 2026 12:44:16 +0000 (13:44 +0100)] 
meson: add hwclock-gplv3 option

Add the missing hwclock-gplv3 option (default: true) to match
autotools --disable-hwclock-gplv3. Without the USE_HWCLOCK_GPLv3_DATETIME
define, meson builds used the minimalistic GPLv2 date parser even though
the GPLv3 parse-date.y was always compiled and linked.

Signed-off-by: Karel Zak <kzak@redhat.com>