]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
5 weeks agobash-completion: add fallback to filename expansion for umount
Christian Goeschel Ndjomouo [Thu, 28 Aug 2025 03:26:42 +0000 (23:26 -0400)] 
bash-completion: add fallback to filename expansion for umount

If the user defined path can not be found in the mount table
fallback to simple filename expansion.

Addresses: #1333
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
5 weeks agoMerge branch 'PR/color-names-fixes' of https://github.com/karelzak/util-linux-work
Karel Zak [Tue, 26 Aug 2025 09:26:48 +0000 (11:26 +0200)] 
Merge branch 'PR/color-names-fixes' of https://github.com/karelzak/util-linux-work

* 'PR/color-names-fixes' of https://github.com/karelzak/util-linux-work:
  tests: add color names test
  lib/color-names: fix stupid bugs

5 weeks agoMerge branch 'sfdisk/args' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 26 Aug 2025 09:26:21 +0000 (11:26 +0200)] 
Merge branch 'sfdisk/args' of https://github.com/t-8ch/util-linux

* 'sfdisk/args' of https://github.com/t-8ch/util-linux:
  sfdisk: reject spurious arguments for --reorder/--backup-pt-sectors

5 weeks agoMerge branch 'feat/add_microcode_to_lscpu_summary' of https://github.com/cgoesche...
Karel Zak [Tue, 26 Aug 2025 09:25:48 +0000 (11:25 +0200)] 
Merge branch 'feat/add_microcode_to_lscpu_summary' of https://github.com/cgoesche/util-linux-fork

* 'feat/add_microcode_to_lscpu_summary' of https://github.com/cgoesche/util-linux-fork:
  lscpu: add 'microcode' information to the CPU summary

5 weeks agoMerge branch 'fix/clarify_long_flag_in_getopt_script_examples' of https://github...
Karel Zak [Tue, 26 Aug 2025 09:25:18 +0000 (11:25 +0200)] 
Merge branch 'fix/clarify_long_flag_in_getopt_script_examples' of https://github.com/cgoesche/util-linux-fork

* 'fix/clarify_long_flag_in_getopt_script_examples' of https://github.com/cgoesche/util-linux-fork:
  getopt: clarify the use of '--long' instead of '--longoptions' in shell examples

5 weeks agoMerge branch 'fix/fstrim_use_f_type_equal_macro' of https://github.com/cgoesche/util...
Karel Zak [Tue, 26 Aug 2025 09:24:34 +0000 (11:24 +0200)] 
Merge branch 'fix/fstrim_use_f_type_equal_macro' of https://github.com/cgoesche/util-linux-fork

* 'fix/fstrim_use_f_type_equal_macro' of https://github.com/cgoesche/util-linux-fork:
  fstrim: use F_TYPE_EQUAL() macro for statfs.f_type comparison

5 weeks agoMerge branch 'fix/procfs_use_f_type_equal_macro' of https://github.com/cgoesche/util...
Karel Zak [Tue, 26 Aug 2025 09:24:16 +0000 (11:24 +0200)] 
Merge branch 'fix/procfs_use_f_type_equal_macro' of https://github.com/cgoesche/util-linux-fork

* 'fix/procfs_use_f_type_equal_macro' of https://github.com/cgoesche/util-linux-fork:
  procfs: use F_TYPE_EQUAL() macro for statfs.f_type comparison

5 weeks agoMerge branch 'feat/support_lsblk_columns_env' of https://github.com/cgoesche/util...
Karel Zak [Tue, 26 Aug 2025 09:22:41 +0000 (11:22 +0200)] 
Merge branch 'feat/support_lsblk_columns_env' of https://github.com/cgoesche/util-linux-fork

* 'feat/support_lsblk_columns_env' of https://github.com/cgoesche/util-linux-fork:
  lsblk: add support for LSBLK_COLUMNS environmental variable as an alternative to --output

5 weeks agoMerge branch 'fix/typo_in_lsblk_routine' of https://github.com/cgoesche/util-linux...
Karel Zak [Tue, 26 Aug 2025 09:20:44 +0000 (11:20 +0200)] 
Merge branch 'fix/typo_in_lsblk_routine' of https://github.com/cgoesche/util-linux-fork

* 'fix/typo_in_lsblk_routine' of https://github.com/cgoesche/util-linux-fork:
  lsblk: (typo) rename list_colunms() to list_columns()

5 weeks agoMerge branch 'fix/document_special_chars_in_getopt' of https://github.com/cgoesche...
Karel Zak [Tue, 26 Aug 2025 09:20:16 +0000 (11:20 +0200)] 
Merge branch 'fix/document_special_chars_in_getopt' of https://github.com/cgoesche/util-linux-fork

* 'fix/document_special_chars_in_getopt' of https://github.com/cgoesche/util-linux-fork:
  getopt: document special symbols that should not be used as option characters

5 weeks agoMerge branch 'master' of https://github.com/ticpu/util-linux
Karel Zak [Tue, 26 Aug 2025 09:19:23 +0000 (11:19 +0200)] 
Merge branch 'master' of https://github.com/ticpu/util-linux

* 'master' of https://github.com/ticpu/util-linux:
  zramctl: fix MEM-USED column description

5 weeks agoMerge branch 'PR/lscpu-extend-dmi' of https://github.com/karelzak/util-linux-work
Karel Zak [Tue, 26 Aug 2025 09:18:00 +0000 (11:18 +0200)] 
Merge branch 'PR/lscpu-extend-dmi' of https://github.com/karelzak/util-linux-work

* 'PR/lscpu-extend-dmi' of https://github.com/karelzak/util-linux-work:
  lscpu: use maximum CPU speed from DMI, avoid duplicate version string

5 weeks agoMerge branch 'lsfd--raw-decode-protocol' of https://github.com/masatake/util-linux
Karel Zak [Tue, 26 Aug 2025 09:17:15 +0000 (11:17 +0200)] 
Merge branch 'lsfd--raw-decode-protocol' of https://github.com/masatake/util-linux

* 'lsfd--raw-decode-protocol' of https://github.com/masatake/util-linux:
  lsfd: decode protocol numbers of RAW and RAW6 sockets

5 weeks agoMerge branch 'PR/mount-api-includes' of https://github.com/karelzak/util-linux-work
Karel Zak [Tue, 26 Aug 2025 09:16:41 +0000 (11:16 +0200)] 
Merge branch 'PR/mount-api-includes' of https://github.com/karelzak/util-linux-work

* 'PR/mount-api-includes' of https://github.com/karelzak/util-linux-work:
  include/mount-api-utils: update to recent kernel
  include/mount-api-utils: avoid using sys/mount.h

5 weeks agochmem: Remove commit - chmem print warnings about failures always
Sumanth Korikkar [Fri, 22 Aug 2025 15:13:53 +0000 (17:13 +0200)] 
chmem: Remove commit - chmem print warnings about failures always

Users do not care which blocks are set offline, when using size option
Consistently printing warnings/errors in this case may confuse them and
create the false impression that the enable/disable operation itself has
failed.

If size option succeeds, chmem should not print errors/warnings.

Hence, revert commit
48675a744 ("chmem: print warnings about failures always (not only with --verbose)")

Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
5 weeks agolscpu: add 'microcode' information to the CPU summary
cgoesche [Sun, 24 Aug 2025 00:25:36 +0000 (20:25 -0400)] 
lscpu: add 'microcode' information to the CPU summary

The procfs provides microcode revision information on
supported platforms (probably only x86 for now).
It can be useful to show this in the output of lscpu
for various use cases, e.g. applications that wish to
make sure that a specific microcode version has been
loaded.

Addresses: #3050
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
5 weeks agotests: add color names test
Karel Zak [Mon, 25 Aug 2025 11:07:21 +0000 (13:07 +0200)] 
tests: add color names test

Signed-off-by: Karel Zak <kzak@redhat.com>
5 weeks agolib/color-names: fix stupid bugs
Karel Zak [Mon, 25 Aug 2025 10:05:01 +0000 (12:05 +0200)] 
lib/color-names: fix stupid bugs

- sort "white" -> "yellow"
- fix typo "lightgray,"

Fixes: https://github.com/util-linux/util-linux/issues/2863
Signed-off-by: Karel Zak <kzak@redhat.com>
6 weeks agosfdisk: reject spurious arguments for --reorder/--backup-pt-sectors
Thomas Weißschuh [Sun, 24 Aug 2025 09:45:45 +0000 (11:45 +0200)] 
sfdisk: reject spurious arguments for --reorder/--backup-pt-sectors

These commands only accept a single device argument.
Reject any additional unexpected arguments.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
6 weeks agogetopt: clarify the use of '--long' instead of '--longoptions' in shell examples
cgoesche [Sat, 23 Aug 2025 01:52:29 +0000 (21:52 -0400)] 
getopt: clarify the use of '--long' instead of '--longoptions' in shell examples

Addresses: #2593
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
6 weeks agofstrim: use F_TYPE_EQUAL() macro for statfs.f_type comparison
cgoesche [Sat, 23 Aug 2025 01:01:16 +0000 (21:01 -0400)] 
fstrim: use F_TYPE_EQUAL() macro for statfs.f_type comparison

Addresses: #2332
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
6 weeks agoprocfs: use F_TYPE_EQUAL() macro for statfs.f_type comparison
cgoesche [Sat, 23 Aug 2025 00:56:48 +0000 (20:56 -0400)] 
procfs: use F_TYPE_EQUAL() macro for statfs.f_type comparison

Addresses: #2332
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
6 weeks agolsblk: add support for LSBLK_COLUMNS environmental variable as an alternative to...
cgoesche [Sat, 23 Aug 2025 00:26:07 +0000 (20:26 -0400)] 
lsblk: add support for LSBLK_COLUMNS environmental variable as an alternative to --output

Addresses: #2816
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
6 weeks agolsblk: (typo) rename list_colunms() to list_columns()
cgoesche [Fri, 22 Aug 2025 23:35:36 +0000 (19:35 -0400)] 
lsblk: (typo) rename list_colunms() to list_columns()

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
6 weeks agogetopt: document special symbols that should not be used as option characters
cgoesche [Fri, 22 Aug 2025 21:31:24 +0000 (17:31 -0400)] 
getopt: document special symbols that should not be used as option characters

getopt(3) routines return `?` or `:` when an unknown option character is encountered
or an option is missing its required argument, respectively. It also disallows
`;` as an option character. Documenting this makes users aware that they may not use
these reserved symbols as option characters, e.g. `-?` which is used in some older programs.

Addresses: #2995
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
6 weeks agozramctl: fix MEM-USED column description
Jérôme Poulin [Fri, 22 Aug 2025 03:54:17 +0000 (23:54 -0400)] 
zramctl: fix MEM-USED column description

The MEM-USED column was incorrectly documented as showing current
memory consumption. This is due to confusing naming in the kernel's
zram implementation:

- Kernel field "mem_used_total" (3rd in mm_stat) = current memory usage
- Kernel field "mem_used_max" (5th in mm_stat) = peak memory usage

zramctl maps these as:
- TOTAL column <= mem_used_total (current usage)
- MEM-USED column <= mem_used_max (peak usage)

The misleading "MEM-USED" name suggests current usage, but it actually
shows the peak memory usage (high water mark) since device creation
or last reset. This is tracked by the kernel's max_used_pages which
only increases when current usage exceeds the stored maximum.

Fixed description from:
"memory zram have been consumed to store compressed data" to
"peak memory usage to store compressed data".

Mise à jour de la traduction française.

6 weeks agolscpu: use maximum CPU speed from DMI, avoid duplicate version string
Karel Zak [Thu, 21 Aug 2025 09:35:17 +0000 (11:35 +0200)] 
lscpu: use maximum CPU speed from DMI, avoid duplicate version string

* Read maximum CPU speed from DMI
* Don't use max speed if nonsensical
* Avoid appending "CPU @ speed" to the version string if it's already included.
  (This is a code robustness improvement as DMI is currently read for ARMs only,
   and the issue was detected on Intel.)

Fixes: https://github.com/util-linux/util-linux/commit/a772d7c493afcec32f0123fc947013f74db6e45d
Signed-off-by: Karel Zak <kzak@redhat.com>
6 weeks agoMerge branch 'kill/usage-indent-comment-grammar' of https://github.com/WakeNaoki...
Karel Zak [Thu, 21 Aug 2025 08:59:25 +0000 (10:59 +0200)] 
Merge branch 'kill/usage-indent-comment-grammar' of https://github.com/WakeNaoki/util-linux

* 'kill/usage-indent-comment-grammar' of https://github.com/WakeNaoki/util-linux:
  kill: comments: fix grammar in parse_arguments()
  kill: usage: fix wrapped indent in -l/--list description

6 weeks agoinclude/mount-api-utils: update to recent kernel
Karel Zak [Thu, 21 Aug 2025 08:16:14 +0000 (10:16 +0200)] 
include/mount-api-utils: update to recent kernel

Signed-off-by: Karel Zak <kzak@redhat.com>
6 weeks agoinclude/mount-api-utils: avoid using sys/mount.h
Karel Zak [Thu, 21 Aug 2025 07:59:10 +0000 (09:59 +0200)] 
include/mount-api-utils: avoid using sys/mount.h

The file is unnecessary and introduces duplicate #define of MS_* macros.

Fixes: https://github.com/util-linux/util-linux/issues/3674
Signed-off-by: Karel Zak <kzak@redhat.com>
6 weeks agoliblastlog2: markup fixes for man pages
Mario Blättermann [Thu, 21 Aug 2025 07:35:47 +0000 (09:35 +0200)] 
liblastlog2: markup fixes for man pages

Signed-off-by: Karel Zak <kzak@redhat.com>
6 weeks agokill: comments: fix grammar in parse_arguments()
Naoki Wake [Tue, 19 Aug 2025 01:49:35 +0000 (18:49 -0700)] 
kill: comments: fix grammar in parse_arguments()

Insert 'that' so the sentence reads '... only option that can be
used with other options.' Comment-only change; no functional impact.

Signed-off-by: Naoki Wake <wakeke.rainbowearth@gmail.com>
6 weeks agokill: usage: fix wrapped indent in -l/--list description
Naoki Wake [Tue, 19 Aug 2025 01:46:08 +0000 (18:46 -0700)] 
kill: usage: fix wrapped indent in -l/--list description

Increase the indentation of the continuation line from one to two
spaces to match the common util-linux help style (see
Documentation/howto-usage-function.txt). This touches a translatable
string. Whitespace-only change; no functional impact.

Signed-off-by: Naoki Wake <wakeke.rainbowearth@gmail.com>
6 weeks agolsfd: decode protocol numbers of RAW and RAW6 sockets
Masatake YAMATO [Fri, 3 Jan 2025 18:50:01 +0000 (03:50 +0900)] 
lsfd: decode protocol numbers of RAW and RAW6 sockets

NOTE: this chage breaks compatibility of existing -Q expression used
in a shell script; the data type of RAW.PROTOCOL has changed from
<number> to <string>.

With this change, lsfd decodes RAW.PROTOCOL with a built-in table
based on linux/in.h and getprotobynumber(3) that may refer to
/etc/protocols internally.

In addition, this change adds RAW.PROTOCOL.RAW column that holds
the original protocol numbers.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
6 weeks agoMerge branch 'PR/fallocate-write-zeroes' of https://github.com/karelzak/util-linux...
Karel Zak [Wed, 20 Aug 2025 07:14:02 +0000 (09:14 +0200)] 
Merge branch 'PR/fallocate-write-zeroes' of https://github.com/karelzak/util-linux-work

* 'PR/fallocate-write-zeroes' of https://github.com/karelzak/util-linux-work:
  fallocate: add FALLOC_FL_WRITE_ZEROES support

6 weeks agolsclocks: stop using MAX_CLOCKS
Thomas Weißschuh [Tue, 19 Aug 2025 16:13:02 +0000 (18:13 +0200)] 
lsclocks: stop using MAX_CLOCKS

MAX_CLOCKS is only available in the kernel UAPI headers and not libc
headers. Switch back to a hardcoded value. This value is a stable ABI
anyways and matches the other fallback definitions.

Fixes: d3c49ee062f7 ("lsclocks: use MAX_CLOCKS, improve indention")
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
7 weeks agolsclocks: use MAX_CLOCKS, improve indention
Karel Zak [Thu, 14 Aug 2025 10:38:29 +0000 (12:38 +0200)] 
lsclocks: use MAX_CLOCKS, improve indention

Let's follow the kernel and use MAX_CLOCKS to define CLOCK_AUX.

Signed-off-by: Karel Zak <kzak@redhat.com>
7 weeks agoMerge branch 'lsclocks/auxclocks' of https://github.com/t-8ch/util-linux
Karel Zak [Thu, 14 Aug 2025 10:18:50 +0000 (12:18 +0200)] 
Merge branch 'lsclocks/auxclocks' of https://github.com/t-8ch/util-linux

* 'lsclocks/auxclocks' of https://github.com/t-8ch/util-linux:
  lsclocks: add auxiliary clocks

7 weeks agoMerge branch 'fix-logger-issue' of https://github.com/akappner/util-linux
Karel Zak [Thu, 14 Aug 2025 10:06:40 +0000 (12:06 +0200)] 
Merge branch 'fix-logger-issue' of https://github.com/akappner/util-linux

* 'fix-logger-issue' of https://github.com/akappner/util-linux:
  logger: fix incorrect warning message when both --file and a message are specified

7 weeks agoMerge branch 'PR/swapon-fstab' of https://github.com/karelzak/util-linux-work
Karel Zak [Thu, 14 Aug 2025 10:05:22 +0000 (12:05 +0200)] 
Merge branch 'PR/swapon-fstab' of https://github.com/karelzak/util-linux-work

* 'PR/swapon-fstab' of https://github.com/karelzak/util-linux-work:
  swapon: (man page) add details about fstab configuration

7 weeks agologger: fix incorrect warning message when both --file and a message are specified
Alexander Kappner [Wed, 13 Aug 2025 11:10:28 +0000 (04:10 -0700)] 
logger: fix incorrect warning message when both --file and a message are specified

Logger warns that when both --file and a message are given, the message is ignored.
It does the opposite. Fix the warning message to conform to the observed behavior.

Example:
echo "You will not see this file in the log" > file.txt
logger -f file.txt "You will see this message in the log"

Signed-off-by: Alexander Kappner <agk@godking.net>
7 weeks agofallocate: add FALLOC_FL_WRITE_ZEROES support
Zhang Yi [Wed, 13 Aug 2025 02:40:15 +0000 (10:40 +0800)] 
fallocate: add FALLOC_FL_WRITE_ZEROES support

The Linux kernel (since version 6.17) supports FALLOC_FL_WRITE_ZEROES in
fallocate(2). Add support for FALLOC_FL_WRITE_ZEROES to the fallocate
utility by introducing a new option -w|--write-zeroes.

Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=278c7d9b5e0c
Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
7 weeks agoswapon: (man page) add details about fstab configuration
Karel Zak [Tue, 12 Aug 2025 12:47:49 +0000 (14:47 +0200)] 
swapon: (man page) add details about fstab configuration

The fstab(5) man page already describes some basic aspects of "swap,"
but it makes sense to be more specific in the swapon man page and
describe everything in one place, serving as a normative reference for
what is expected on Linux in fstab for swap.

Fixes: https://github.com/util-linux/util-linux/issues/3667
Signed-off-by: Karel Zak <kzak@redhat.com>
7 weeks agolsclocks: add auxiliary clocks
Thomas Weißschuh [Mon, 2 Jun 2025 21:10:35 +0000 (23:10 +0200)] 
lsclocks: add auxiliary clocks

Add support for the auxiliary posix clocks introduced in Linux 6.17.

When auxiliary clocks are not supported, no output line is generated.
When an auxiliary clock is not enabled an output line without TIME
columns is generated.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
7 weeks agomount: add --beneath support
Karel Zak [Mon, 11 Aug 2025 11:08:13 +0000 (13:08 +0200)] 
mount: add --beneath support

Signed-off-by: Karel Zak <kzak@redhat.com>
7 weeks agolibmount: add MOVE_MOUNT_BENEATH support
Karel Zak [Mon, 11 Aug 2025 11:07:38 +0000 (13:07 +0200)] 
libmount: add MOVE_MOUNT_BENEATH support

Fixes: https://github.com/util-linux/util-linux/issues/2604
Signed-off-by: Karel Zak <kzak@redhat.com>
7 weeks agomount: (bash-completion) add --exclusive
Karel Zak [Mon, 11 Aug 2025 11:10:53 +0000 (13:10 +0200)] 
mount: (bash-completion) add --exclusive

Signed-off-by: Karel Zak <kzak@redhat.com>
7 weeks agoMerge branch 'PR/libmount-fanotify' of https://github.com/karelzak/util-linux-work
Karel Zak [Mon, 11 Aug 2025 09:22:10 +0000 (11:22 +0200)] 
Merge branch 'PR/libmount-fanotify' of https://github.com/karelzak/util-linux-work

* 'PR/libmount-fanotify' of https://github.com/karelzak/util-linux-work:
  libmount: ifdef for fanotify support on older systems
  libmount: (monitor) add fanotify_next_fs()
  libmount: (monitor) add basic fanotify support
  libmount: (monitor) rename public API to "mountinfo"
  libmount: (monitor) clean up mountinfo function names
  libmount: add mnt_fs_is_{moved,attached,detached} functions
  libmount: (monitor)  cleanup userspace_add_watch() exiting
  libmount: (monitor) check for utab delete
  libmount: (monitor) optimize inotify utab watch
  libmount: (monitor) cleanup op_process_event() return codes
  libmount: (monitor) add next-fs API
  libmount: (monitor) epoll_wait code consolidation
  libmount: (monitor) require entry-specific functions
  libmount: (monitor) clean up internal names
  libmount: (monitor) support type-specific data
  libmount: (monitor) support additional monitor identifiers
  libmount: split monitor code to more files

8 weeks agolibmount: ifdef for fanotify support on older systems
Karel Zak [Thu, 7 Aug 2025 11:15:32 +0000 (13:15 +0200)] 
libmount: ifdef for fanotify support on older systems

Signed-off-by: Karel Zak <kzak@redhat.com>
8 weeks agolibmount: (monitor) add fanotify_next_fs()
Karel Zak [Tue, 5 Aug 2025 13:39:53 +0000 (15:39 +0200)] 
libmount: (monitor) add fanotify_next_fs()

This function returns a unique filesystem ID to the caller.

Signed-off-by: Karel Zak <kzak@redhat.com>
8 weeks agochrt: (man,usage) put --pid first in synopses and examples, for clarity
Benno Schulenberg [Tue, 5 Aug 2025 09:24:43 +0000 (11:24 +0200)] 
chrt: (man,usage) put --pid first in synopses and examples, for clarity

When --pid is among the options, it is clearest when it is given as the
first option, because then it doesn't sit between the policy option and
the somewhat related priority value.  It creates some kind of symmetry:
the --pid option first, then other things, and the actual PID last.

CC: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
8 weeks agochrt: (man) improve wording and markup of some examples
Benno Schulenberg [Tue, 5 Aug 2025 09:24:42 +0000 (11:24 +0200)] 
chrt: (man) improve wording and markup of some examples

CC: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
8 weeks agochrt: (man,usage) mark the priority value as optional in the synopses
Benno Schulenberg [Tue, 5 Aug 2025 09:24:41 +0000 (11:24 +0200)] 
chrt: (man,usage) mark the priority value as optional in the synopses

The priority value is optional in some cases, so it cannot be listed
as required.

CC: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
8 weeks agochrt: produce better error message for missing priority with implied -r
Benno Schulenberg [Tue, 5 Aug 2025 09:24:40 +0000 (11:24 +0200)] 
chrt: produce better error message for missing priority with implied -r

Since commit 4c425142844d, the following two equivalent commands produce
different error messages:

  # chrt -r ls NEWS
  chrt: invalid priority argument: 'ls'
  # chrt ls NEWS
  chrt: unsupported priority value for the policy: 0: see --max for valid range

The latter error message is enigmatic: where did the user specify '0'?

Before the mentioned commit, the second command would produce the same
error message as the first.  Restore that behavior.

CC: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
8 weeks agolibmount: (monitor) add basic fanotify support
Karel Zak [Wed, 11 Jun 2025 11:49:05 +0000 (13:49 +0200)] 
libmount: (monitor) add basic fanotify support

* add mnt_monitor_enable_fanotify() to add the new monitor

* add MNT_MONITOR_TYPE_FANOTIFY to identify events

* add new monitor to the test

Signed-off-by: Karel Zak <kzak@redhat.com>
8 weeks agolibmount: (monitor) rename public API to "mountinfo"
Karel Zak [Wed, 6 Aug 2025 12:09:12 +0000 (14:09 +0200)] 
libmount: (monitor) rename public API to "mountinfo"

There will be more kernel monitors in the future. Ensure the API is
easy to understand.

* Rename MNT_MONITOR_TYPE_KERNEL to MNT_MONITOR_TYPE_MOUNTINFO

* Rename mnt_monitor_enable_kernel() to mnt_monitor_enable_mountinfo()

The change is backward compatible; the old names are still usable.

Signed-off-by: Karel Zak <kzak@redhat.com>
8 weeks agolibmount: (monitor) clean up mountinfo function names
Karel Zak [Wed, 6 Aug 2025 11:48:27 +0000 (13:48 +0200)] 
libmount: (monitor) clean up mountinfo function names

There will be more kernel monitors in the future. It's better to use
names specific to the monitoring method rather than the generic
"kernel."

This commit renames only internal components.

Signed-off-by: Karel Zak <kzak@redhat.com>
8 weeks agolibmount: add mnt_fs_is_{moved,attached,detached} functions
Karel Zak [Wed, 16 Jul 2025 11:52:07 +0000 (13:52 +0200)] 
libmount: add mnt_fs_is_{moved,attached,detached} functions

Let's use these simple functions to report what the last operation or
status detected by the library means to the filesystem. It will be
used by the fanotify monitor as well.

Signed-off-by: Karel Zak <kzak@redhat.com>
8 weeks agolibmount: (monitor) cleanup userspace_add_watch() exiting
Karel Zak [Wed, 11 Jun 2025 09:38:10 +0000 (11:38 +0200)] 
libmount: (monitor)  cleanup userspace_add_watch() exiting

Signed-off-by: Karel Zak <kzak@redhat.com>
8 weeks agolibmount: (monitor) check for utab delete
Karel Zak [Tue, 10 Jun 2025 12:06:53 +0000 (14:06 +0200)] 
libmount: (monitor) check for utab delete

Also, monitor for "rm -rf /run/mount" to reinitialize the monitor.

Signed-off-by: Karel Zak <kzak@redhat.com>
8 weeks agolibmount: (monitor) optimize inotify utab watch
Karel Zak [Tue, 10 Jun 2025 11:51:23 +0000 (13:51 +0200)] 
libmount: (monitor) optimize inotify utab watch

Don't repeat no-op inotify_add_watch() calls. This happens when we
monitor the /run[/mount] directory before the utab.event file exists.
The old version just tries to create a watch and ignores ENOENT
errors. It seems better to remember the path of the last created watch
and not repeat it.

Signed-off-by: Karel Zak <kzak@redhat.com>
8 weeks agolibmount: (monitor) cleanup op_process_event() return codes
Karel Zak [Tue, 10 Jun 2025 10:15:28 +0000 (12:15 +0200)] 
libmount: (monitor) cleanup op_process_event() return codes

Let's use usual concept (<0 error; 0 success; 1 nothing).

Signed-off-by: Karel Zak <kzak@redhat.com>
8 weeks agolibmount: (monitor) add next-fs API
Karel Zak [Tue, 10 Jun 2025 09:05:20 +0000 (11:05 +0200)] 
libmount: (monitor) add next-fs API

Signed-off-by: Karel Zak <kzak@redhat.com>
8 weeks agolibmount: (monitor) epoll_wait code consolidation
Karel Zak [Wed, 28 May 2025 09:18:57 +0000 (11:18 +0200)] 
libmount: (monitor) epoll_wait code consolidation

The epoll_wait() and op_process_event() are called in two places. Move
the code to read_epoll_events() and process everything in one place

Signed-off-by: Karel Zak <kzak@redhat.com>
8 weeks agolibmount: (monitor) require entry-specific functions
Karel Zak [Tue, 27 May 2025 11:23:39 +0000 (13:23 +0200)] 
libmount: (monitor) require entry-specific functions

8 weeks agolibmount: (monitor) clean up internal names
Karel Zak [Tue, 27 May 2025 11:14:34 +0000 (13:14 +0200)] 
libmount: (monitor) clean up internal names

In future changes, we need to process active monitor entries in entry
type-specific code to return data from events.

This requires a slight change in the function's logic, so it makes
sense to rename the function according to the new logic, meaning
changes --> active, verify --> process.

The patch also replaces bit fields with booleans.

Signed-off-by: Karel Zak <kzak@redhat.com>
8 weeks agolibmount: (monitor) support type-specific data
Karel Zak [Tue, 27 May 2025 10:04:24 +0000 (12:04 +0200)] 
libmount: (monitor) support type-specific data

Signed-off-by: Karel Zak <kzak@redhat.com>
8 weeks agolibmount: (monitor) support additional monitor identifiers
Karel Zak [Wed, 21 May 2025 10:39:17 +0000 (12:39 +0200)] 
libmount: (monitor) support additional monitor identifiers

This is necessary to support multiple monitors of the same type.
Currently, only one monitor per type is supported.

Signed-off-by: Karel Zak <kzak@redhat.com>
8 weeks agolibmount: split monitor code to more files
Karel Zak [Wed, 21 May 2025 09:43:57 +0000 (11:43 +0200)] 
libmount: split monitor code to more files

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agoMerge branch 'patch-1' of https://github.com/neheb/util-linux
Karel Zak [Tue, 5 Aug 2025 11:22:30 +0000 (13:22 +0200)] 
Merge branch 'patch-1' of https://github.com/neheb/util-linux

* 'patch-1' of https://github.com/neheb/util-linux:
  meson: use curses dep for ncurses

2 months agoMerge branch 'PR/libmount-excl' of https://github.com/karelzak/util-linux-work
Karel Zak [Tue, 5 Aug 2025 11:22:10 +0000 (13:22 +0200)] 
Merge branch 'PR/libmount-excl' of https://github.com/karelzak/util-linux-work

* 'PR/libmount-excl' of https://github.com/karelzak/util-linux-work:
  mount: add --exclusive command line option
  libmount: Add support for FSCONFIG_CMD_CREATE_EXCL
  lib: add FSCONFIG_CMD_CREATE_EXCL

2 months agosetpriv: improve landlock usage() output
Karel Zak [Tue, 5 Aug 2025 11:18:32 +0000 (13:18 +0200)] 
setpriv: improve landlock usage() output

* Add help for rights names
* Keep usage() output for Landlock more structured
* Add a note to the man page that "fs" is subject to change

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agosetpriv: Add support for LANDLOCK_ACCESS_FS_IOCTL_DEV
Günther Noack [Sat, 2 Aug 2025 15:43:05 +0000 (17:43 +0200)] 
setpriv: Add support for LANDLOCK_ACCESS_FS_IOCTL_DEV

The LANDLOCK_ACCESS_FS_IOCTL_DEV access right controls whether the
process may use IOCTL on opened device files.  It is available since
Linux 6.10.

Compatibility remark:
With this change, using the --landlock-access="fs" shortcut now
requires Linux 6.10+, where it previously required Linux 6.2+.

2 months agomount: add --exclusive command line option
Karel Zak [Thu, 31 Jul 2025 10:31:36 +0000 (12:31 +0200)] 
mount: add --exclusive command line option

The new option ensures that the kernel does not reuse existing
superblock.

The new option is available to non-root users as it does not affect
the superblock itself or any other aspects of the mount process. It
makes the current mounting more restrictive, so it makes sense to
allow it for non-root users.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agolibmount: Add support for FSCONFIG_CMD_CREATE_EXCL
Karel Zak [Thu, 31 Jul 2025 10:28:33 +0000 (12:28 +0200)] 
libmount: Add support for FSCONFIG_CMD_CREATE_EXCL

* Add API functions mnt_context_enable_exclusive() and mnt_context_is_exclusive()

* Use the new flag when creating the superblock

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agolib: add FSCONFIG_CMD_CREATE_EXCL
Karel Zak [Thu, 31 Jul 2025 10:25:18 +0000 (12:25 +0200)] 
lib: add FSCONFIG_CMD_CREATE_EXCL

* add FSCONFIG_CMD_CREATE_EXCL to mount-api-utils.h

* (like libc) define FSCONFIG_ macros to be usable for #ifdefs

* add fallback for FSCONFIG_CMD_CREATE_EXCL as fsconfig_command enum
  in system headers may be without the flag

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agomeson: use curses dep for ncurses
Rosen Penev [Wed, 30 Jul 2025 21:40:53 +0000 (14:40 -0700)] 
meson: use curses dep for ncurses

curses is special in that it's able to find ncurses in a lot more locations that ncurses, which only looks at pkg-config and cmake. This is somewhat useful with exotic OSes like macOS.

2 months agochrt: Allow optional priority for non‑prio policies without --pid
Madadi Vineeth Reddy [Tue, 29 Jul 2025 09:47:03 +0000 (15:17 +0530)] 
chrt: Allow optional priority for non‑prio policies without --pid

This extends commit e7a2d62434c2
("chrt: Make priority optional for policies that don't use it")
so that priority arguments are optional even when --pid is not specified.

Before this patch:
$ chrt --other ls -lh
chrt: invalid priority argument: 'ls'
-> only "chrt --other 0 ls -lh" would work

After this patch:
$ chrt --other ls -lh
$ chrt --other 0 ls -lh
-> both now work

If an out‑of‑range priority is given, it reports an error:
$ chrt --other 1 ls -lh
unsupported priority value for the policy: 1 (see --max for valid range)

Changes in v2:
- Removed is_number() and used isdigit_string() (Karel Zak)
- used _() for translation (Karel Zak)

Fixes: e7a2d62434c2 ("chrt: Make priority optional for policies that don't use it")
Signed-off-by: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
2 months agoMerge branch 'master' of https://github.com/hongxu-jia/util-linux
Karel Zak [Tue, 29 Jul 2025 12:18:30 +0000 (14:18 +0200)] 
Merge branch 'master' of https://github.com/hongxu-jia/util-linux

* 'master' of https://github.com/hongxu-jia/util-linux:
  tests/helpers/test_sigstate.c: explicitly reset SIGINT to default action after trapping

2 months agoMerge branch 'ldattach_mtu' of https://github.com/SeppoTakalo/util-linux
Karel Zak [Tue, 29 Jul 2025 12:16:31 +0000 (14:16 +0200)] 
Merge branch 'ldattach_mtu' of https://github.com/SeppoTakalo/util-linux

* 'ldattach_mtu' of https://github.com/SeppoTakalo/util-linux:
  ldattach: Allow changing the MTU for GSM0710 framing

2 months agoMerge branch 'lsfd--packet-raw-protocol' of https://github.com/masatake/util-linux
Karel Zak [Tue, 29 Jul 2025 10:58:32 +0000 (12:58 +0200)] 
Merge branch 'lsfd--packet-raw-protocol' of https://github.com/masatake/util-linux

* 'lsfd--packet-raw-protocol' of https://github.com/masatake/util-linux:
  lsfd: add PACKET.PROTOCOL.RAW, a new column

2 months agolsfd: add PACKET.PROTOCOL.RAW, a new column
Masatake YAMATO [Sun, 5 Jan 2025 18:34:22 +0000 (03:34 +0900)] 
lsfd: add PACKET.PROTOCOL.RAW, a new column

Using sizeof for the calculating buffer size is suggested
by @karelzak.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 months agomkfs.cramfs: avoid uninitialized value [coverity scan]
Karel Zak [Tue, 29 Jul 2025 09:40:16 +0000 (11:40 +0200)] 
mkfs.cramfs: avoid uninitialized value [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agotests/helpers/test_sigstate.c: explicitly reset SIGINT to default action after trapping
Hongxu Jia [Mon, 28 Jul 2025 12:35:13 +0000 (20:35 +0800)] 
tests/helpers/test_sigstate.c: explicitly reset SIGINT to default action after trapping

After upgrading bash to 5.3 to contain commit [1], if SIGINT was trapped in
asynchronous subshell, bash called set_signal_async_ignored to make sure
processes that are created by this asynchronous subshell to ignore SIGINT.

And it caused test case `kill/decode' failed, the signal INT was existed in
both of Blocked and Ignored

$ ./tests/run.sh --use-system-commands --parsable --show-diff   kill/decode
...
diff-{{{
|--- /usr/lib/util-linux/ptest/tests/expected/kill/decode        2011-04-05 23:00:00.000000000 +0000
|+++ /usr/lib/util-linux/ptest/tests/output/kill/decode  2025-07-28 12:09:46.279000000 +0000
@@ -16,5 +16,5 @@
 Pending (thread): INT ILL
 Pending (process): USR1
 Blocked: INT ILL ABRT FPE USR1 SEGV TERM
-Ignored: HUP QUIT TRAP PIPE ALRM
+Ignored: HUP INT QUIT TRAP PIPE ALRM
 Caught: ILL USR1
}}}-diff
...

Explicitly reset SIGINT to default action after trapping, then the
test case `kill/decode' works on both of old (<5.3) and new (>=5.3) bash

[1] https://cgit.git.savannah.gnu.org/cgit/bash.git/commit/?h=devel&id=a5d2617c7a7e602ace1f4149987cdfd075c4e762

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
2 months agoldattach: Allow changing the MTU for GSM0710 framing
Seppo Takalo [Thu, 24 Jul 2025 11:38:59 +0000 (14:38 +0300)] 
ldattach: Allow changing the MTU for GSM0710 framing

Traditionally ldattach have hard coded MTU of 127 bytes
which differs from defaults proposed in 3GPP TS 27.010
which is 31 bytes when basic framing is used.

Add '-m <value>' parameter that is only GSM0710 specific
and already handled by the kernel. Use same value for both
MTU and MRU.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2 months agoMerge branch 'PR/column-colors' of https://github.com/karelzak/util-linux-work
Karel Zak [Mon, 28 Jul 2025 09:51:43 +0000 (11:51 +0200)] 
Merge branch 'PR/column-colors' of https://github.com/karelzak/util-linux-work

* 'PR/column-colors' of https://github.com/karelzak/util-linux-work:
  column: add support for color scheme
  libsmartcols: add function to set/get header colors
  lib/strutils: add ul_optstr_get_value()
  lib/color-names: Fix color name canonicalization
  column: add --color[=<when>] to control colorization
  column: add basic colors support

2 months agolibblkid: (ext) reduce false positive
胡玮文 [Mon, 28 Jul 2025 06:32:13 +0000 (14:32 +0800)] 
libblkid: (ext) reduce false positive

Signed-off-by: 胡玮文 <huweiwen.hww@alibaba-inc.com>
2 months agoMerge branch 'PR/fsck.cramfs-memcpy' of https://github.com/karelzak/util-linux-work
Karel Zak [Thu, 24 Jul 2025 11:18:43 +0000 (13:18 +0200)] 
Merge branch 'PR/fsck.cramfs-memcpy' of https://github.com/karelzak/util-linux-work

* 'PR/fsck.cramfs-memcpy' of https://github.com/karelzak/util-linux-work:
  fsck.cramfs: check buffer size for memcpy()

2 months agoMerge branch 'PR/setpriv-getgroups' of https://github.com/karelzak/util-linux-work
Karel Zak [Thu, 24 Jul 2025 11:18:01 +0000 (13:18 +0200)] 
Merge branch 'PR/setpriv-getgroups' of https://github.com/karelzak/util-linux-work

* 'PR/setpriv-getgroups' of https://github.com/karelzak/util-linux-work:
  setpriv: Improve getgroups() Portability

2 months agosetpriv: Improve getgroups() Portability
Karel Zak [Mon, 21 Jul 2025 06:16:25 +0000 (08:16 +0200)] 
setpriv: Improve getgroups() Portability

setpriv(1) is Linux-only, and on Linux, getgroups() returns at least one group.
However, it's better to use more portable and generic code patterns and assume
that getgroups() can return zero.

Fixes: https://github.com/util-linux/util-linux/issues/3654
Reported-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agolibblkid: improve UUID_SUB= description
Karel Zak [Thu, 24 Jul 2025 10:48:00 +0000 (12:48 +0200)] 
libblkid: improve UUID_SUB= description

Fixes: https://github.com/util-linux/util-linux/issues/3657
Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agofsck.cramfs: check buffer size for memcpy()
Karel Zak [Mon, 21 Jul 2025 07:48:06 +0000 (09:48 +0200)] 
fsck.cramfs: check buffer size for memcpy()

- reuse MAX_INPUT_NAMELEN
- check path buffer size before memcpy() to the buffer
- check for zero path before use it

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agocolumn: add support for color scheme
Karel Zak [Tue, 15 Jul 2025 13:38:46 +0000 (15:38 +0200)] 
column: add support for color scheme

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agolibsmartcols: add function to set/get header colors
Karel Zak [Tue, 15 Jul 2025 13:37:56 +0000 (15:37 +0200)] 
libsmartcols: add function to set/get header colors

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agolib/strutils: add ul_optstr_get_value()
Karel Zak [Tue, 15 Jul 2025 13:36:22 +0000 (15:36 +0200)] 
lib/strutils: add ul_optstr_get_value()

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agolib/color-names: Fix color name canonicalization
Karel Zak [Tue, 15 Jul 2025 13:35:05 +0000 (15:35 +0200)] 
lib/color-names: Fix color name canonicalization

Return NULL rather than a random string if it cannot be translated to
the color sequence.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agotextual: harmonize the messages for invalid count and timeout values
Benno Schulenberg [Wed, 9 Jul 2025 09:07:34 +0000 (11:07 +0200)] 
textual: harmonize the messages for invalid count and timeout values

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agotextual: harmonize the messages for an invalid size, length, and offset
Benno Schulenberg [Wed, 9 Jul 2025 09:07:33 +0000 (11:07 +0200)] 
textual: harmonize the messages for an invalid size, length, and offset

The added words "argument" or "value" or "specified" don't make things
clearer and are just unneeded verbosity.  Also, use all lowercase.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agocolumn: call gettext() on an error message only when it gets printed
Benno Schulenberg [Wed, 9 Jul 2025 09:07:32 +0000 (11:07 +0200)] 
column: call gettext() on an error message only when it gets printed

Just mark error messages for translation, with gettext_noop(), and pass
them untranslated to the subroutines.  Then call gettext() on such a
message only when an error occurs and the message gets printed.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agoMerge branch 'cpulist-stride' of https://github.com/jmr/util-linux
Karel Zak [Mon, 14 Jul 2025 11:45:06 +0000 (13:45 +0200)] 
Merge branch 'cpulist-stride' of https://github.com/jmr/util-linux

* 'cpulist-stride' of https://github.com/jmr/util-linux:
  cpuset: Use stride in cpulist_create