Karel Zak [Mon, 2 Jun 2025 12:03:32 +0000 (14:03 +0200)]
Merge branch 'PR/Benno-28May' of https://github.com/karelzak/util-linux-work
* 'PR/Benno-28May' of https://github.com/karelzak/util-linux-work:
textual: harmonize the wording of the error message for an invalid PID
colrm: make two error messages actually say that something is wrong
lib/strutils: call gettext() only when argument of --hyperlink is invalid
lib/colors: call gettext() only when the argument of --color is invalid
Auke Kok [Tue, 27 May 2025 19:34:43 +0000 (12:34 -0700)]
libblkid: Add scoutfs filesystem.
The scoutfs filesystem is maintained out-of-tree, but current enough
that we want to submit it for inclusion in libblkid - there's a few
users out there that would benefit from being able to have lsblk aid in
diagnosing and identifying.
For more information about scoutfs, visit the github page here:
https://github.com/versity/scoutfs
Test images are provided for both data and meta devices. These were
taken from validation samples.
The wiper is set to only wipe a minute part of the filesystem -
basically only the superblock. This is adequately destructive.
Matteo Croce [Fri, 23 May 2025 01:59:36 +0000 (03:59 +0200)]
add option to force cachestat() usage
When cachestat() is not available, mmap() and fincore() are used to get
cache statistics.
This fallback returns less data than cachestat, and potentially hides
read errors by reporting that the file is all mapped in memory:
$ fincore /usr/bin/java
fincore: failed to do cachestat: /usr/bin/java: Operation not permitted
RES PAGES SIZE FILE
208K 13 198,1K /usr/bin/java
$ echo $?
0
$ sudo fincore /usr/bin/java
RES PAGES SIZE FILE
0B 0 198,1K /usr/bin/java
Add a --cachestat argument which forces cachestat usage and fails if
it's not available:
$ fincore -C /usr/bin/java
fincore: failed to do cachestat: /usr/bin/java: Operation not permitted
$ echo $?
1
Also, on huge files the fallback is very slow and memory consuming,
so this flag can be user to avoid doing it by mistake.
lib/colors: call gettext() only when the argument of --color is invalid
Instead of calling gettext() before starting to interpret the argument
of option -L/--color, call it only when it's needed: when the argument
is not recognized.
Karel Zak [Thu, 29 May 2025 10:02:53 +0000 (12:02 +0200)]
Merge branch 'PR/Benno-23May' of https://github.com/karelzak/util-linux-work
* 'PR/Benno-23May' of https://github.com/karelzak/util-linux-work:
hardlink: (man,usage) sort the options mostly alphabetically
hardlink: (usage) improve the descriptions of three options
hardlink: (usage) remove mistaken period from two option descriptions
hexdump: (man) put a list item on a single line, to avoid a warning
Karel Zak [Thu, 29 May 2025 10:02:29 +0000 (12:02 +0200)]
Merge branch 'PR/libmount-verity-deinit' of https://github.com/karelzak/util-linux-work
* 'PR/libmount-verity-deinit' of https://github.com/karelzak/util-linux-work:
libmount: (verity) use messages API for important errors
libmount: (verity) use messages API for dlopen errors
libmount: (verity) fix compiler warning
libmount: (verity) fix deinitialization
hardlink: (usage) improve the descriptions of three options
The first description was too wordy for a --help text, the second
was vague and seemed to imply that it should be combined with the
preceding option, and the third failed to mention that it doesn't
actually link anything.
(Note: the choice for -m for --maximize and -M for --minimize is
unfortunate, as most people would guess the opposite, especially
since -s is used for --minimum-size and -S for --maximum-size.)
hexdump: (man) put a list item on a single line, to avoid a warning
Asciidoctor annoyingly warned for every translation that
unindented content was added to a list item. Avoid this
by not breaking the list item into two lines.
Karel Zak [Mon, 26 May 2025 15:58:48 +0000 (17:58 +0200)]
libmount: (verity) fix compiler warning
libmount/src/hook_veritydev.c: In function 'setup_veritydev':
libmount/src/hook_veritydev.c:457:13: warning: '%s' directive argument is null [-Wformat-overflow=]
Karel Zak [Mon, 26 May 2025 09:32:25 +0000 (11:32 +0200)]
Merge branch 'PR/AT_SECURE' of https://github.com/karelzak/util-linux-work
* 'PR/AT_SECURE' of https://github.com/karelzak/util-linux-work:
treewide: improve getauxval(AT_SECURE) usage
lib/env, ...: use getauxval(AT_SECURE) for SUID check
Karel Zak [Thu, 22 May 2025 08:01:03 +0000 (10:01 +0200)]
lsblk: use ID_PART_ENTRY_SCHEME as fallback for PTTYPE
The udev database typically inherits the ID_PART_TABLE_TYPE property
from the entire disk device to its partitions. However, in some cases,
this property may be missing. Fortunately, blkid/udev also provides
ID_PART_ENTRY_SCHEME for all partitions.
Fixes: https://github.com/util-linux/util-linux/issues/3570 Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Wed, 21 May 2025 09:05:38 +0000 (11:05 +0200)]
Merge branch 'login_fix' of https://github.com/echoechoin/util-linux
* 'login_fix' of https://github.com/echoechoin/util-linux:
login: (adoc) add a description about LOGIN_SHELL_FALLBACK
login: using an avaiable shell while logging in.
Karel Zak [Mon, 19 May 2025 10:13:20 +0000 (12:13 +0200)]
Merge branch 'master' of https://github.com/shashank-mahadasyam/util-linux
* 'master' of https://github.com/shashank-mahadasyam/util-linux:
bash-completion: (chrt) add completion for -e/--ext
chrt: (man) add SCHED_EXT
tests: add chrt SCHED_EXT test
chrt: add support for SCHED_EXT
Karel Zak [Mon, 19 May 2025 09:39:14 +0000 (11:39 +0200)]
Merge branch 'PR/add_ul_prefix' of https://github.com/karelzak/util-linux-work
* 'PR/add_ul_prefix' of https://github.com/karelzak/util-linux-work:
treewide: add ul_ to parse_timestamp() function name
treewide: add ul_ to parse_switch() function name
treewide: add ul_ to parse_size() function name
treewide: add ul_ to parse_range() function name
Stanislav Brabec [Fri, 16 May 2025 01:10:14 +0000 (03:10 +0200)]
libblkid: Fix crash while parsing config with libeconf
As the whole econf_file structure is freed by econf_free(file) at the end
of blkid_read_config(), econf_file structure cannot be defined as static
and initialized only once. The econf_free() is not robust enough and keeps
a pointer to the garbage after the first call of blkid_read_config(). And
if /etc/blkid.conf does not exist, it is called second time.
Shashank Balaji [Fri, 16 May 2025 17:03:43 +0000 (02:03 +0900)]
bash-completion: (chrt) add completion for -e/--ext
chrt's -e/--ext corresponds to the SCHED_EXT scheduling policy,
which, for the purposes of bash completion, behaves just like
--other, --idle, and --batch
Karel Zak [Tue, 13 May 2025 06:09:37 +0000 (08:09 +0200)]
Merge branch 'PR/PATH-consolidate' of https://github.com/karelzak/util-linux-work
* 'PR/PATH-consolidate' of https://github.com/karelzak/util-linux-work:
setpriv: follow /etc/login.defs for PATH
su: use logindefs_setenv_path()
login: use logindefs_setenv_path()
logindefs: Add function to set PATH
Karel Zak [Tue, 13 May 2025 06:09:16 +0000 (08:09 +0200)]
Merge branch 'PR/login-su-TERM' of https://github.com/karelzak/util-linux-work
* 'PR/login-su-TERM' of https://github.com/karelzak/util-linux-work:
setpriv: protect COLORTERM and NO_COLOR env. variables
su: protect COLORTERM and NO_COLOR env. variables
login: protect COLORTERM and NO_COLOR env. variables
Max Kellermann [Sat, 10 May 2025 20:26:50 +0000 (22:26 +0200)]
lib/env, ...: use getauxval(AT_SECURE) for SUID check
Comparing effective and real uid/gid is not a proper way to check for
SUID execution:
1. this does not consider file capabilities
2. this check breaks when NO_NEW_PRIVS is used as the Linux kernel
resets effective ids during execve(); this means the check is
false, but the process still has raised capabilities
For more details about the NO_NEW_PRIVS problem, check this post and
the surrounding thread:
Karel Zak [Mon, 5 May 2025 11:10:05 +0000 (13:10 +0200)]
Merge branch 'PR/parse_switch' of https://github.com/karelzak/util-linux-work
* 'PR/parse_switch' of https://github.com/karelzak/util-linux-work:
fix and add parse_switch() test
strutils: move an error message to where it is used, and improve it
irqtop: use standard 'always/never' arguments instead of 'enable/disable'
Karel Zak [Mon, 5 May 2025 11:06:47 +0000 (13:06 +0200)]
Merge branch 'PR/Benno-29Apr' of https://github.com/karelzak/util-linux-work
* 'PR/Benno-29Apr' of https://github.com/karelzak/util-linux-work:
po-man: add hyperlink.adoc to po4a.cfg
docs,usage: harmonize description of --hyperlink, and add 2 missing ones
pipesz: report default size in --help, instead of referring the user
lsfd: improve grammar, and use angular brackets around placeholder word
uuidd: put an option and its description in a single message
pipesz: (man) improve the markup and some wordings
irqtop: make the wording of an error message identical to that of another
unshare: make the wording of a message identical to that of three others
Karel Zak [Mon, 5 May 2025 11:06:23 +0000 (13:06 +0200)]
Merge branch 'PR/hardlink-logging' of https://github.com/karelzak/util-linux-work
* 'PR/hardlink-logging' of https://github.com/karelzak/util-linux-work:
hardlink: define more function as inline
hardlink: fix performance regression (inefficient signal evaluation)
hardlink: Use macro for verbose output
strutils: move an error message to where it is used, and improve it
Calling gettext() is somewhat costly: it has to find the given message
among the more than five thousand messages in util-linux's repertoire.
So, call gettext() only when the message actually gets printed.
Besides, allowing to customize the error message for parse_switch() was
a nice gesture, but it's unneeded: a fixed error message is good enough.
Also, "argument error" was rather vague, as it doesn't say _what_ the
error is. Better say "unsupported argument".
irqtop: use standard 'always/never' arguments instead of 'enable/disable'
Most other util-linux tools that accept the option argument "auto"
additionally accept "always" and "never", not "enable" / "disable".
So, make option --cpu-stat accept those standard words (besides the
deviant ones), and adjust the documentation to use the standard words.
Furthermore, make --cpu-stat accept also "on", "off", "yes", "no",
"1", and "0", to allow the user to use shorter words. The per-CPU
stats can now be suppressed with a succinct: `irqtop -c0`.
CC: Zhenwei Pi <pizhenwei@bytedance.com> Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
lsfd: improve grammar, and use angular brackets around placeholder word
Also, use <list> (the standard way to indicate multiple arguments) as
argument of --pid, and don't use "<when>" when the possible arguments
differ from "always", "never", "auto".
In addition, improve some wording and markup in the man page.
Karel Zak [Tue, 29 Apr 2025 10:29:32 +0000 (12:29 +0200)]
hardlink: fix performance regression (inefficient signal evaluation)
During work on better verbose output, I found a regression between
v2.40 and v2.41 (and v2.42). In the new version, hardlink is 3-4 times
slower.
The problem is in the function where we verify signals. It calls the
function signal() even though no signal is delivered. It's called in
code loops where hardlink scans files, making it a performance-sensitive
area.
Another significant performance improvement is using an inline function
for handle_interrupt().
This simple patch improves hardlink performance by 10 times.
Fixes: http://github.com/util-linux/util-linux/commit/1453200e22dd4ec858be027653c167225f2fb358 Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 29 Apr 2025 09:49:23 +0000 (11:49 +0200)]
hardlink: Use macro for verbose output
Now that jlog() is a function, all gettext() arguments are evaluated
in all cases, including when output is unnecessary due to --quiet or
low verbose mode.
Fixes: https://github.com/util-linux/util-linux/issues/3548 Signed-off-by: Karel Zak <kzak@redhat.com>
OpenWRT has SDKs targetting MIPS 32/64 bit, little/big endian.
Currently util-linux CI only uses 32 bit little endian through ath79.
Add a big-endian 64bit and little-endian 32bit architecture, too.
Karel Zak [Fri, 25 Apr 2025 08:39:59 +0000 (10:39 +0200)]
Merge branch 'PR/statmount-cleanup' of https://github.com/karelzak/util-linux-work
* 'PR/statmount-cleanup' of https://github.com/karelzak/util-linux-work:
libmount: use and add has_listmount()
libmount: avoid calling memset() unnecessarily
libmount: clean up statmount syscall-related functions