]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
6 weeks agochrt: (man) add SCHED_EXT
Shashank Balaji [Fri, 16 May 2025 09:36:21 +0000 (18:36 +0900)] 
chrt: (man) add SCHED_EXT

Signed-off-by: Shashank Balaji <shashank.mahadasyam@sony.com>
6 weeks agotests: add chrt SCHED_EXT test
Shashank Balaji [Fri, 16 May 2025 09:35:15 +0000 (18:35 +0900)] 
tests: add chrt SCHED_EXT test

Signed-off-by: Shashank Balaji <shashank.mahadasyam@sony.com>
6 weeks agochrt: add support for SCHED_EXT
Shashank Balaji [Fri, 16 May 2025 09:33:45 +0000 (18:33 +0900)] 
chrt: add support for SCHED_EXT

SCHED_EXT lets processes be scheduled by a BPF program-defined
scheduler. This is supported since kernel version 6.12.

Signed-off-by: Shashank Balaji <shashank.mahadasyam@sony.com>
7 weeks agologger: drop pointless bitfields
Karel Zak [Tue, 13 May 2025 09:48:11 +0000 (11:48 +0200)] 
logger: drop pointless bitfields

References: 63d7937180fcce4ea7fc1d2855872e464f06e779
Signed-off-by: Karel Zak <kzak@redhat.com>
7 weeks agoMerge branch 'PR/PATH-consolidate' of https://github.com/karelzak/util-linux-work
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

7 weeks agoMerge branch 'PR/login-su-TERM' of https://github.com/karelzak/util-linux-work
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

7 weeks agoMerge branch 'PR/mount-hint-tty' of https://github.com/karelzak/util-linux-work
Karel Zak [Tue, 13 May 2025 06:08:54 +0000 (08:08 +0200)] 
Merge branch 'PR/mount-hint-tty' of https://github.com/karelzak/util-linux-work

* 'PR/mount-hint-tty' of https://github.com/karelzak/util-linux-work:
  mount: check for stdout for fstab reload hint

7 weeks agoMerge branch 'PR/libmount-escape' of https://github.com/karelzak/util-linux-work
Karel Zak [Tue, 13 May 2025 06:08:33 +0000 (08:08 +0200)] 
Merge branch 'PR/libmount-escape' of https://github.com/karelzak/util-linux-work

* 'PR/libmount-escape' of https://github.com/karelzak/util-linux-work:
  libmount: add function to remove escaped chars

8 weeks agosetpriv: protect COLORTERM and NO_COLOR env. variables
Karel Zak [Wed, 7 May 2025 10:52:47 +0000 (12:52 +0200)] 
setpriv: protect COLORTERM and NO_COLOR env. variables

The patch also replaces set/get env with ul_env_list to protect
variables.

Fixes: https://github.com/util-linux/util-linux/issues/3463
Signed-off-by: Karel Zak <kzak@redhat.com>
8 weeks agosetpriv: follow /etc/login.defs for PATH
Karel Zak [Wed, 7 May 2025 10:32:11 +0000 (12:32 +0200)] 
setpriv: follow /etc/login.defs for PATH

The patch also cleans up the --reset-env description in the man page.

Fixes: https://github.com/util-linux/util-linux/issues/3560
Signed-off-by: Karel Zak <kzak@redhat.com>
8 weeks agosu: use logindefs_setenv_path()
Karel Zak [Wed, 7 May 2025 10:06:47 +0000 (12:06 +0200)] 
su: use logindefs_setenv_path()

Signed-off-by: Karel Zak <kzak@redhat.com>
8 weeks agologin: use logindefs_setenv_path()
Karel Zak [Wed, 7 May 2025 10:06:21 +0000 (12:06 +0200)] 
login: use logindefs_setenv_path()

Signed-off-by: Karel Zak <kzak@redhat.com>
8 weeks agologindefs: Add function to set PATH
Karel Zak [Wed, 7 May 2025 10:03:51 +0000 (12:03 +0200)] 
logindefs: Add function to set PATH

Let's avoid duplicate code in su() and login(1).

Signed-off-by: Karel Zak <kzak@redhat.com>
8 weeks agosu: protect COLORTERM and NO_COLOR env. variables
Karel Zak [Wed, 7 May 2025 09:35:05 +0000 (11:35 +0200)] 
su: protect COLORTERM and NO_COLOR env. variables

Fixes: https://github.com/util-linux/util-linux/issues/3463
Signed-off-by: Karel Zak <kzak@redhat.com>
8 weeks agologin: protect COLORTERM and NO_COLOR env. variables
Karel Zak [Wed, 7 May 2025 09:34:26 +0000 (11:34 +0200)] 
login: protect COLORTERM and NO_COLOR env. variables

Fixes: https://github.com/util-linux/util-linux/issues/3463
Signed-off-by: Karel Zak <kzak@redhat.com>
8 weeks agomount: check for stdout for fstab reload hint
Karel Zak [Wed, 7 May 2025 08:47:13 +0000 (10:47 +0200)] 
mount: check for stdout for fstab reload hint

Fixes: https://github.com/util-linux/util-linux/issues/3558
Signed-off-by: Karel Zak <kzak@redhat.com>
8 weeks agoMerge branch 'ci/openwrt-mips' of https://github.com/t-8ch/util-linux
Karel Zak [Mon, 5 May 2025 13:02:23 +0000 (15:02 +0200)] 
Merge branch 'ci/openwrt-mips' of https://github.com/t-8ch/util-linux

* 'ci/openwrt-mips' of https://github.com/t-8ch/util-linux:
  ci: build on MIPS
  ci: add OpenWRT subtarget to matrix name

8 weeks agoMerge branch 'PR/parse_switch' of https://github.com/karelzak/util-linux-work
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'

8 weeks agolibmount: add function to remove escaped chars
Karel Zak [Mon, 5 May 2025 11:04:54 +0000 (13:04 +0200)] 
libmount: add function to remove escaped chars

Follow-up: 8a69fa852dd5f41f8456756d18bfac6d8208219f https://github.com/util-linux/util-linux/pull/3541
Signed-off-by: Karel Zak <kzak@redhat.com>
8 weeks agoMerge branch 'PR/bits-build' of https://github.com/karelzak/util-linux-work
Karel Zak [Mon, 5 May 2025 11:07:11 +0000 (13:07 +0200)] 
Merge branch 'PR/bits-build' of https://github.com/karelzak/util-linux-work

* 'PR/bits-build' of https://github.com/karelzak/util-linux-work:
  bits: only build when cpu_set_t is available

8 weeks agoMerge branch 'PR/Benno-29Apr' of https://github.com/karelzak/util-linux-work
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

8 weeks agoMerge branch 'PR/hardlink-logging' of https://github.com/karelzak/util-linux-work
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

8 weeks agofix and add parse_switch() test
Karel Zak [Mon, 5 May 2025 10:18:10 +0000 (12:18 +0200)] 
fix and add parse_switch() test

Signed-off-by: Karel Zak <kzak@redhat.com>
8 weeks agoMerge branch 'master' of https://github.com/echoechoin/util-linux
Karel Zak [Mon, 5 May 2025 08:48:09 +0000 (10:48 +0200)] 
Merge branch 'master' of https://github.com/echoechoin/util-linux

* 'master' of https://github.com/echoechoin/util-linux:
  strutils.c: ignore escape characters while parsing options.

8 weeks agostrutils: move an error message to where it is used, and improve it
Benno Schulenberg [Fri, 2 May 2025 12:22:42 +0000 (14:22 +0200)] 
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".

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
8 weeks agoirqtop: use standard 'always/never' arguments instead of 'enable/disable'
Benno Schulenberg [Fri, 2 May 2025 12:22:41 +0000 (14:22 +0200)] 
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>
8 weeks agobits: only build when cpu_set_t is available
Alyssa Ross [Thu, 1 May 2025 07:58:06 +0000 (09:58 +0200)] 
bits: only build when cpu_set_t is available

Doesn't build on macOS.

Fixes: 6e1301d59 ("text-utils: add bits command")
Signed-off-by: Alyssa Ross <hi@alyssa.is>
2 months agopo-man: add hyperlink.adoc to po4a.cfg
Karel Zak [Wed, 30 Apr 2025 11:14:02 +0000 (13:14 +0200)] 
po-man: add hyperlink.adoc to po4a.cfg

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agodocs,usage: harmonize description of --hyperlink, and add 2 missing ones
Benno Schulenberg [Sat, 26 Apr 2025 09:30:18 +0000 (11:30 +0200)] 
docs,usage: harmonize description of --hyperlink, and add 2 missing ones

Harmonize the description by placing the option in a separate file.

Also, use _when_/<when> (instead of _mode_/<mode>) as the optional
argument, since the possible values are: "always", "never", "auto".

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agopipesz: report default size in --help, instead of referring the user
Benno Schulenberg [Fri, 25 Apr 2025 10:34:21 +0000 (12:34 +0200)] 
pipesz: report default size in --help, instead of referring the user

The man page says where this default size can be found.  In the --help
text it is more useful to directly say what this default size is.

CC: Nathan Sharp <nwsharp@live.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agolsfd: improve grammar, and use angular brackets around placeholder word
Benno Schulenberg [Fri, 25 Apr 2025 10:32:08 +0000 (12:32 +0200)] 
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.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agouuidd: put an option and its description in a single message
Benno Schulenberg [Thu, 24 Apr 2025 09:32:37 +0000 (11:32 +0200)] 
uuidd: put an option and its description in a single message

Also, improve the markup and the wording in the man page.

CC: Michael Trapp <michael.trapp@sap.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agopipesz: (man) improve the markup and some wordings
Benno Schulenberg [Thu, 24 Apr 2025 09:32:35 +0000 (11:32 +0200)] 
pipesz: (man) improve the markup and some wordings

CC: Nathan Sharp <nwsharp@live.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agoirqtop: make the wording of an error message identical to that of another
Benno Schulenberg [Thu, 24 Apr 2025 09:32:32 +0000 (11:32 +0200)] 
irqtop: make the wording of an error message identical to that of another

(Besides: the original looked like a statement, not like an error message.)

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agounshare: make the wording of a message identical to that of three others
Benno Schulenberg [Thu, 24 Apr 2025 09:32:31 +0000 (11:32 +0200)] 
unshare: make the wording of a message identical to that of three others

That is: spare translators having to translate different strings that
mean the exact same thing.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agohardlink: define more function as inline
Karel Zak [Tue, 29 Apr 2025 10:50:48 +0000 (12:50 +0200)] 
hardlink: define more function as inline

The functions are called many times.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agohardlink: fix performance regression (inefficient signal evaluation)
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>
2 months agohardlink: Use macro for verbose output
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>
2 months agoci: build on MIPS
Thomas Weißschuh [Tue, 6 Aug 2024 20:58:04 +0000 (22:58 +0200)] 
ci: build on MIPS

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.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 months agoci: add OpenWRT subtarget to matrix name
Thomas Weißschuh [Tue, 6 Aug 2024 21:01:57 +0000 (23:01 +0200)] 
ci: add OpenWRT subtarget to matrix name

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 months agolibmount: fix typo in comment
Karel Zak [Fri, 25 Apr 2025 08:46:07 +0000 (10:46 +0200)] 
libmount: fix typo in comment

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agoMerge branch 'PR/statmount-cleanup' of https://github.com/karelzak/util-linux-work
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

2 months agoWipefs: improve --all descriptions for whole-disks
Karel Zak [Thu, 24 Apr 2025 17:25:11 +0000 (19:25 +0200)] 
Wipefs: improve --all descriptions for whole-disks

Addresses: https://github.com/util-linux/util-linux/issues/3544
Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agolibmount: use and add has_listmount()
Karel Zak [Thu, 24 Apr 2025 16:45:24 +0000 (18:45 +0200)] 
libmount: use and add has_listmount()

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agolibmount: avoid calling memset() unnecessarily
Karel Zak [Thu, 24 Apr 2025 16:32:35 +0000 (18:32 +0200)] 
libmount: avoid calling memset() unnecessarily

This is primarily to satisfy static analyzers, as memset() is defined
as a non-null function (although it does nothing when bufsiz=0).

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agolibmount: clean up statmount syscall-related functions
Karel Zak [Thu, 24 Apr 2025 16:16:07 +0000 (18:16 +0200)] 
libmount: clean up statmount syscall-related functions

* Rename the raw version of the syscall from ul_statmount() to
  ul_statmount_syscall().

* Rename `sys_statmount()` to `ul_statmount()`. The goal is to use the
  same naming convention as `ul_listmount()` for a function that is
  expected to be called from code.

* Move ul_statmount() to be in the same #ifdef block as the rest of
  the statmount code in the header file.

* Add has_statmount() to make it easy to verify the usability of the
  statmount syscall.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agodocs: correct mistaken uses of "overwrite" to say "override" instead
Benno Schulenberg [Thu, 17 Apr 2025 09:48:24 +0000 (11:48 +0200)] 
docs: correct mistaken uses of "overwrite" to say "override" instead

This mostly comes down to harmonizing the wording and markup of the
various --lock options.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agodocs: correct misspellings of "may be" and mistaken uses of "overwritten"
Benno Schulenberg [Thu, 17 Apr 2025 09:48:23 +0000 (11:48 +0200)] 
docs: correct misspellings of "may be" and mistaken uses of "overwritten"

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agolscpu: (man) don't refer to a missing section, and improve some wordings
Benno Schulenberg [Thu, 17 Apr 2025 09:48:22 +0000 (11:48 +0200)] 
lscpu: (man) don't refer to a missing section, and improve some wordings

Three years ago commit aa049eabb3 removed the COLUMNS section but forgot
to remove the reference to it.  Replace the reference with a referral to
the --help text.

In the bargain, join two paragraphs that belong together, improve some
wordings, and sort two options.

This fixes #2590 (https://github.com/util-linux/util-linux/issues/2590).
Reported-by: Fabien Malfoy
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agorenice: (man) reword several things, to be clearer, and improve some markup
Benno Schulenberg [Thu, 17 Apr 2025 09:48:21 +0000 (11:48 +0200)] 
renice: (man) reword several things, to be clearer, and improve some markup

Also, remove a reference to ulimit(1p) that doesn't make sense.

CC: David Anes <david.anes@suse.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agorenice: in usage text, condense the oververbose description of option -n
Benno Schulenberg [Thu, 17 Apr 2025 09:48:20 +0000 (11:48 +0200)] 
renice: in usage text, condense the oververbose description of option -n

The --help text should be concise: it serves only as a reminder of how
things work.  When a more wordy explanation is needed, there is always
the man page (as every --help text says at the end).

CC: David Anes <david.anes@suse.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agoterminal-colors.d: (man) reduce two tables to succinct lists
Benno Schulenberg [Thu, 17 Apr 2025 09:48:19 +0000 (11:48 +0200)] 
terminal-colors.d: (man) reduce two tables to succinct lists

Before the move to asciidoctor, these tables were succinct lists in the
man page.  Change the asciidoc text to make them into lists again.

Use {nbsp} on one line to avoid weird groff behavior for \? when .ss
is defined to be zero-width (as asciidoctor does), and reshuffle two
paragraphs to avoid an asciidoctor bug that adds a spurious \fP after
a monospace span defined with double backticks.

Also, correct some markup in a few earlier paragraphs.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agortcwake: (man) reduce an inflated table to sane proportions
Benno Schulenberg [Thu, 17 Apr 2025 09:48:18 +0000 (11:48 +0200)] 
rtcwake: (man) reduce an inflated table to sane proportions

Asciidoctor puts an unneeded blank line into every table cell (this
is fixed in git [1], but not released yet), and will unnecessarily
wrap text in a cell when the text is slightly longer than average.

Replace the table with a block of preformatted text, and replace
the "+5min" example with a true format that covers most cases,
and give some examples of that format after the block.

[1] https://github.com/asciidoctor/asciidoctor/commit/9cb73f8c9bee

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agolast: (man) reduce an inflated table to sane proportions
Benno Schulenberg [Thu, 17 Apr 2025 09:48:17 +0000 (11:48 +0200)] 
last: (man) reduce an inflated table to sane proportions

Also, reword some things for better flow, improve some markup, and
combine username and tty to [username|tty]... in the synopsis, as
this better indicates that the two identifiers can be mixed.

Furthermore, use quotes around the time formats that contain a space,
as otherwise the time would be understood as a user name / tty name.
Drop the "tomorrow" and "+5min" examples, as they don't make sense
here.  And change the "-5days" example to a true format that covers
most possibilities, and give a few examples of it after the table.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agolast: (man) correct the descriptions of --present and --since
Benno Schulenberg [Thu, 17 Apr 2025 09:48:16 +0000 (11:48 +0200)] 
last: (man) correct the descriptions of --present and --since

Doing `last --present -24h` will show who was logged in around this time
yesterday.  But when doing (what according to the man page is equivalent)
`last --since -24h --until -24h` nothing will be shown -- unless someone
logged in exactly 24 hours ago to the second.

So, correct the descriptions of --present and --since.

This fixes #1896 (https://github.com/util-linux/util-linux/issues/1896).
Reported-by: Finn Krein-Schuch
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agobits: (man) normalize the markup and improve some layout
Benno Schulenberg [Thu, 17 Apr 2025 09:48:15 +0000 (11:48 +0200)] 
bits: (man) normalize the markup and improve some layout

The convention in man pages is: to put command arguments in lowercase
and without angle brackets (these are for --help texts), and without
unneeded abbreviations.  Literal values (as in some examples) should
be in bold, not in italics.

CC: Robin Jarry <robin@jarry.cc>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
Reviewed-by: Robin Jarry <robin@jarry.cc>
2 months agoswapoff: check blkid_probe_lookup_value() return code [coverity scan]
Karel Zak [Wed, 23 Apr 2025 09:14:09 +0000 (11:14 +0200)] 
swapoff: check  blkid_probe_lookup_value() return code [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agoMerge branch 'PR/swapoff-resolve-leaks' of https://github.com/karelzak/util-linux...
Karel Zak [Tue, 22 Apr 2025 10:24:46 +0000 (12:24 +0200)] 
Merge branch 'PR/swapoff-resolve-leaks' of https://github.com/karelzak/util-linux-work

* 'PR/swapoff-resolve-leaks' of https://github.com/karelzak/util-linux-work:
  swapoff: add comments for do_swapoff
  swapoff: clean up tag resolution

2 months agoMerge branch 'spelling' of https://github.com/jwilk-forks/util-linux
Karel Zak [Tue, 22 Apr 2025 10:24:25 +0000 (12:24 +0200)] 
Merge branch 'spelling' of https://github.com/jwilk-forks/util-linux

* 'spelling' of https://github.com/jwilk-forks/util-linux:
  mount: (man) add missing word

2 months agoMerge branch 'no_strerror_shlib' of https://github.com/crrodriguez/util-linux
Karel Zak [Tue, 22 Apr 2025 10:23:31 +0000 (12:23 +0200)] 
Merge branch 'no_strerror_shlib' of https://github.com/crrodriguez/util-linux

* 'no_strerror_shlib' of https://github.com/crrodriguez/util-linux:
  Do not use strerror on shared libraries

2 months agoMerge branch 'losetup/udev' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 22 Apr 2025 10:21:59 +0000 (12:21 +0200)] 
Merge branch 'losetup/udev' of https://github.com/t-8ch/util-linux

* 'losetup/udev' of https://github.com/t-8ch/util-linux:
  lib/loopdev: open loop control device read-only if possible
  lib/loopdev: clarify comment about device and backing file modes
  lib/loopdev: remove loopcxt_set_fd()

2 months agoMerge branch 'fix-befs-fuzz' of https://github.com/mbroz/util-linux
Karel Zak [Tue, 22 Apr 2025 10:20:57 +0000 (12:20 +0200)] 
Merge branch 'fix-befs-fuzz' of https://github.com/mbroz/util-linux

* 'fix-befs-fuzz' of https://github.com/mbroz/util-linux:
  libblkid: befs: fix underflow

2 months agostrutils.c: ignore escape characters while parsing options.
WanBingjiang [Tue, 22 Apr 2025 10:16:41 +0000 (18:16 +0800)] 
strutils.c: ignore escape characters while parsing options.

2 months agoinclude/mount-api-utils: include linux/unistd.h
Thomas Weißschuh [Sat, 19 Apr 2025 20:02:11 +0000 (22:02 +0200)] 
include/mount-api-utils: include linux/unistd.h

If SYS_statmount/SYS_listmount is not provided by the libc,
util-linux will fall back to __NR_statmount/__NR_listmount from the
kernel UAPI headers.
However it is not guaranteed that these symbols are actually visible in
mount-api-utils.

Include linux/unistd.h which provides syscall numbers.
While this header is specific to Linux, the code is already using
linux/mount.h.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 months agolibblkid: befs: fix underflow
Milan Broz [Sat, 19 Apr 2025 13:54:40 +0000 (15:54 +0200)] 
libblkid: befs: fix underflow

Fix segfault caused by underflow while parsing a corrupted metadata.

Found by OSS-Fuzz by cryptsetup project fuzzers (issue 411003898).

Signed-off-by: Milan Broz <gmazyland@gmail.com>
2 months agoMerge branch 'PR/libmount-subdir' of https://github.com/karelzak/util-linux-work
Karel Zak [Wed, 16 Apr 2025 11:21:47 +0000 (13:21 +0200)] 
Merge branch 'PR/libmount-subdir' of https://github.com/karelzak/util-linux-work

* 'PR/libmount-subdir' of https://github.com/karelzak/util-linux-work:
  libmount: (subdir) support detached open_tree() (>=6.15)
  libmount: (subdir) restrict for real mounts only
  libmount: (subdir) remove unused code

2 months agolib/loopdev: open loop control device read-only if possible
Thomas Weißschuh [Wed, 16 Apr 2025 09:55:31 +0000 (11:55 +0200)] 
lib/loopdev: open loop control device read-only if possible

Opening the control device read-write to trigger udev events is a hack.
It works around a kernel bug which fails to send uevents directly from the
kernel by triggering a full udev reprobe.
While it works to trigger the events, it is problematic.
The udev reprobe will asynchronously recreate all partition devices which
requires an ungly locking and synchronization scheme after losetup has
completed to guarantee the usability of the partition devices.

The kernel has been fixed to properly emit these uevents in
commit 7ed2a771b5fb ("loop: properly send KOBJ_CHANGED uevent for disk device").

Drop the workaround.

This is a partial revert of
commit ced1142d6f25 ("losetup: cleanup device node modes").

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
2 months agolib/loopdev: clarify comment about device and backing file modes
Thomas Weißschuh [Wed, 16 Apr 2025 09:53:36 +0000 (11:53 +0200)] 
lib/loopdev: clarify comment about device and backing file modes

If either the backing file or ioctl loop device are opened read-only the
kernel will silently downgrade the resulting loop device to read-only.

Adapt the comment to this.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
2 months agologger: (man) improve --prio-prefix and --stderr description
Karel Zak [Wed, 16 Apr 2025 08:41:26 +0000 (10:41 +0200)] 
logger: (man) improve --prio-prefix and --stderr description

Fixes: https://github.com/util-linux/util-linux/issues/3527
Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agolibmount: (subdir) support detached open_tree() (>=6.15)
Karel Zak [Tue, 15 Apr 2025 10:29:37 +0000 (12:29 +0200)] 
libmount: (subdir) support detached open_tree() (>=6.15)

The latest kernel can open a directory as a tree (open_tree()) on a
detached mount tree. This means we do not need to unshare and
attach the root of the filesystem to a private temporary directory. All
this machinery can be replaced by one open_tree() call.

Old version:
fsopen("ext4", FSOPEN_CLOEXEC)          = 3
unshare(CLONE_NEWNS)                    = 0
fsconfig(3, FSCONFIG_SET_STRING, "source", "/dev/sdc", 0) = 0
fsconfig(3, FSCONFIG_CMD_CREATE, NULL, NULL, 0) = 0
fsmount(3, FSMOUNT_CLOEXEC, 0)          = 6
move_mount(6, "", AT_FDCWD, "/run/mount/tmptgt", MOVE_MOUNT_F_EMPTY_PATH) = 0
open_tree(6, "subdir", OPEN_TREE_CLONE|OPEN_TREE_CLOEXEC) = 7
setns(4, CLONE_NEWNS)                   = 0
move_mount(7, "", AT_FDCWD, "/mnt/test", MOVE_MOUNT_F_EMPTY_PATH) = 0
setns(5, CLONE_NEWNS)                   = 0
umount2("/run/mount/tmptgt", 0)         = 0
setns(4, CLONE_NEWNS)                   = 0

New version:
fsopen("ext4", FSOPEN_CLOEXEC)          = 3
fsconfig(3, FSCONFIG_SET_STRING, "source", "/dev/sda", 0) = 0
fsconfig(3, FSCONFIG_CMD_CREATE, NULL, NULL, 0) = 0
fsmount(3, FSMOUNT_CLOEXEC, 0)          = 4
open_tree(4, "subdir", OPEN_TREE_CLONE|OPEN_TREE_CLOEXEC|AT_SYMLINK_NOFOLLOW|AT_NO_AUTOMOUNT|AT_RECURSIVE
move_mount(5, "", AT_FDCWD, "/mnt/test", MOVE_MOUNT_F_EMPTY_PATH) = 0

Note that this commit does not completely deactivate hook_subdir.c
because it is better to keep things in one place. It only adds a "subdir"
to the struct libmnt_sysapi to force hook_mount.c to call open_tree(subdir),
but all the logic and checks are still in hook_subdir.c.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agosetarch: (man) correct the markup of the synopsis and of two options
Benno Schulenberg [Wed, 9 Apr 2025 09:36:35 +0000 (11:36 +0200)] 
setarch: (man) correct the markup of the synopsis and of two options

Drop the second line of the synopsis as it is unneeded (it is covered
by the first line since argument "arch" became optional) and distracts
from the similarity/contrast between the other two lines.

Mark "arch" in the new second synopsis line in italics, as it is a
placeholder, not a literal.

Also, improve some wording, reduce redundancy by reshuffling the --pid
option, and remove a redudant -v from an example.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agoMerge branch 'PR/Benno-14Apr' of https://github.com/karelzak/util-linux-work
Karel Zak [Wed, 16 Apr 2025 08:17:49 +0000 (10:17 +0200)] 
Merge branch 'PR/Benno-14Apr' of https://github.com/karelzak/util-linux-work

* 'PR/Benno-14Apr' of https://github.com/karelzak/util-linux-work:
  lastlog2: besides -v, recognize also the standard -V for --version
  lastlog2: (man) fix some broken markup, and lowercase option arguments
  docs: add -h/--help and -V/--version to three man pages that lacked them
  losetup,lscpu: (man) add the missing -h/--help and -V/--version options
  agetty,setterm: (man) remove the mistakenly added -h and -V short options
  docs: fix a few indentation issues
  docs: improve and harmonize the description of -H / --list-columns
  docs: rewrite the description of --bytes, to be clearer

2 months agoMerge branch 'ci/llvm-20' of https://github.com/t-8ch/util-linux
Karel Zak [Wed, 16 Apr 2025 08:17:07 +0000 (10:17 +0200)] 
Merge branch 'ci/llvm-20' of https://github.com/t-8ch/util-linux

* 'ci/llvm-20' of https://github.com/t-8ch/util-linux:
  ci: update gcc to version 14
  ci: update clang to version 20

2 months agolib/loopdev: remove loopcxt_set_fd()
Thomas Weißschuh [Tue, 15 Apr 2025 15:03:30 +0000 (17:03 +0200)] 
lib/loopdev: remove loopcxt_set_fd()

It is not used.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
2 months agoci: update gcc to version 14
Thomas Weißschuh [Tue, 15 Apr 2025 15:17:38 +0000 (17:17 +0200)] 
ci: update gcc to version 14

Also drop the note about GCC which is obsolete.
Skip the coveralls job as it does not yet support GCC 14.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 months agoci: update clang to version 20
Thomas Weißschuh [Tue, 15 Apr 2025 15:16:49 +0000 (17:16 +0200)] 
ci: update clang to version 20

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 months agomeson: fix a bug in posixipc_libs configuration
Martin Valgur [Tue, 15 Apr 2025 13:19:21 +0000 (16:19 +0300)] 
meson: fix a bug in posixipc_libs configuration

Should append instead of assigning. Otherwise fails with

meson.build:1482:22: ERROR: Object <[ExternalLibraryHolder] holds [ExternalLibrary]: <ExternalLibrary rt: True>> of type ExternalLibrary does not support the `+` operator.

2 months agolastlog2: besides -v, recognize also the standard -V for --version
Benno Schulenberg [Mon, 14 Apr 2025 09:45:34 +0000 (11:45 +0200)] 
lastlog2: besides -v, recognize also the standard -V for --version

The --help text already proclaimed that -V would work.

CC: Stefan Schubert <schubi@suse.de>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agolastlog2: (man) fix some broken markup, and lowercase option arguments
Benno Schulenberg [Mon, 14 Apr 2025 09:45:33 +0000 (11:45 +0200)] 
lastlog2: (man) fix some broken markup, and lowercase option arguments

Also, reshuffle two paragraphs (from the end to the beginning), reword
some things, and remove the mistaken _num_ argument of --service.

Furthermore, use triple pluses to tell asciidoctor that two asterisks
in a message are literal asterisks and not markup: +++**+++.

CC: Stefan Schubert <schubi@suse.de>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agodocs: add -h/--help and -V/--version to three man pages that lacked them
Benno Schulenberg [Mon, 14 Apr 2025 09:45:32 +0000 (11:45 +0200)] 
docs: add -h/--help and -V/--version to three man pages that lacked them

Also, harmonize the wording and placement of these options in
a few other man pages, and use an `include` where possible.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agolosetup,lscpu: (man) add the missing -h/--help and -V/--version options
Benno Schulenberg [Mon, 14 Apr 2025 09:45:31 +0000 (11:45 +0200)] 
losetup,lscpu: (man) add the missing -h/--help and -V/--version options

Three years ago, commit 2b2d317242 removed these options from these
two man pages but forgot to replace them with the relevant `include`.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agoagetty,setterm: (man) remove the mistakenly added -h and -V short options
Benno Schulenberg [Mon, 14 Apr 2025 09:45:30 +0000 (11:45 +0200)] 
agetty,setterm: (man) remove the mistakenly added -h and -V short options

Three years ago, commit 2b2d317242 was a little overzealous and replaced
also occurrences of --help and --version that were *not* paired with -h
and -V: `agetty` does not know -V and uses -h for something else, and
`setterm` does not know any short options at all.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agodocs: fix a few indentation issues
Benno Schulenberg [Mon, 14 Apr 2025 09:45:29 +0000 (11:45 +0200)] 
docs: fix a few indentation issues

That is: add "+" or " +" to keep paragraphs together.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agodocs: improve and harmonize the description of -H / --list-columns
Benno Schulenberg [Mon, 14 Apr 2025 09:45:28 +0000 (11:45 +0200)] 
docs: improve and harmonize the description of -H / --list-columns

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agodocs: rewrite the description of --bytes, to be clearer
Benno Schulenberg [Mon, 14 Apr 2025 09:45:27 +0000 (11:45 +0200)] 
docs: rewrite the description of --bytes, to be clearer

The original looked like a plate of spaghetti to me.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agoMerge branch 'meson-fixes' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 15 Apr 2025 10:48:32 +0000 (12:48 +0200)] 
Merge branch 'meson-fixes' of https://github.com/t-8ch/util-linux

* 'meson-fixes' of https://github.com/t-8ch/util-linux:
  meson: use .to_string() in configuration data check
  meson: add feature for translated documentation
  meson: remove tinfo dependency from 'more'

2 months agoMerge branch 'fix-2873' of https://github.com/gershnik/util-linux
Karel Zak [Tue, 15 Apr 2025 10:47:09 +0000 (12:47 +0200)] 
Merge branch 'fix-2873' of https://github.com/gershnik/util-linux

* 'fix-2873' of https://github.com/gershnik/util-linux:
  libuuid: fix uuid_time on macOS without attribute((alias))

2 months agomeson: use .to_string() in configuration data check
Thomas Weißschuh [Mon, 14 Apr 2025 21:07:18 +0000 (23:07 +0200)] 
meson: use .to_string() in configuration data check

Newer versions of meson validate the types of comparisions.
Explicitly convert to strings.

Fixes the following error:
meson.build:1875:70: ERROR: The `==` operator of bool does not accept objects of type int (1)

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 months agomeson: add feature for translated documentation
Thomas Weißschuh [Mon, 14 Apr 2025 21:32:36 +0000 (23:32 +0200)] 
meson: add feature for translated documentation

Translating the documentation is slow.
Add a feature which can be used to disable this step.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 months agomeson: remove tinfo dependency from 'more'
Thomas Weißschuh [Mon, 14 Apr 2025 21:19:06 +0000 (23:19 +0200)] 
meson: remove tinfo dependency from 'more'

The more utility does not need libtinfo and it is not
specified in autotools either.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 months agoDo not use strerror on shared libraries
Cristian Rodríguez [Sun, 13 Apr 2025 13:22:47 +0000 (09:22 -0400)] 
Do not use strerror on shared libraries

Using strerror is not safe in shared libraries as it is unknown
what the calling apps may do with the storage behind the scenes.
Using %m is ok, except in contexts that need to be as-safe.

2 months agomount: (man) add missing word
Jakub Wilk [Wed, 9 Apr 2025 17:53:34 +0000 (19:53 +0200)] 
mount: (man) add missing word

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
2 months agolibmount: (subdir) restrict for real mounts only
Karel Zak [Wed, 9 Apr 2025 10:15:57 +0000 (12:15 +0200)] 
libmount: (subdir) restrict for real mounts only

It's now possible to use, for example, for bind operations, but it
does not make sense as you can specify the target with the
subdirectory.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agolibmount: (subdir) remove unused code
Karel Zak [Wed, 9 Apr 2025 09:32:08 +0000 (11:32 +0200)] 
libmount: (subdir) remove unused code

The optlist already handles quoted values, so there's no need to do it
in the callers.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agoswapoff: add comments for do_swapoff
zt20xx [Tue, 8 Apr 2025 00:49:51 +0000 (08:49 +0800)] 
swapoff: add comments for do_swapoff

[kzak@redhat.com: - add the comment to swapoff_by() too]

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agoswapoff: clean up tag resolution
Karel Zak [Wed, 9 Apr 2025 08:51:59 +0000 (10:51 +0200)] 
swapoff: clean up tag resolution

- Rename swapoff_resolve_tag() to resolve_swapfile_tag() and retain
  only code relevant to swapfiles.

- Always call mnt_resolve_*() before resolve_swapfile_tag() to resolve
  tags/paths on standard block devices.

- Call free() for resolve_swapfile_tag() to avoid memory leaks.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agodisk-utils: add attribute nonstring to bfs byte arrays
Cristian Rodríguez [Tue, 8 Apr 2025 13:41:36 +0000 (09:41 -0400)] 
disk-utils: add attribute nonstring to bfs byte arrays

GCC15 requires to annotate such fields as nonstrings or a warning
is now issued that they are missing the ending null.

2 months agoMerge branch 'PR/Benno-8Apr' of https://github.com/karelzak/util-linux-work
Karel Zak [Tue, 8 Apr 2025 11:41:11 +0000 (13:41 +0200)] 
Merge branch 'PR/Benno-8Apr' of https://github.com/karelzak/util-linux-work

* 'PR/Benno-8Apr' of https://github.com/karelzak/util-linux-work:
  zramctl: (man) mention the required arguments for -p and -r
  zramctl: restore normal description indentations in the usage text
  textual: fix a mistruncated message, and fix a typo
  hwclock: remove two comments about parameters that no longer exist

2 months agocolumn: (man) fix broken markup, and improve other markup and wordings
Benno Schulenberg [Mon, 7 Apr 2025 15:14:39 +0000 (17:14 +0200)] 
column: (man) fix broken markup, and improve other markup and wordings

Since commit aa4efb2030 from five months ago, almost the entire text
of the section OPTIONS was underlined / in italics.  Correct that.

Also improve various other markup and wordings, and unswap the names of
--table-column and --table-columns in the first paragraph of OPTIONS.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agomount: (man) shorten an overlong line, and improve some markup
Benno Schulenberg [Mon, 7 Apr 2025 15:14:38 +0000 (17:14 +0200)] 
mount: (man) shorten an overlong line, and improve some markup

Also, in the synopis mention -F separately to make it more obvious that
it applies only to -A, swap two options to make a line more similar to
the preceding one, and improve some wording.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>