]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
3 days agochrt: Allow optional priority for non‑prio policies without --pid master
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>
3 days 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

3 days 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

3 days 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

3 days 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>
3 days 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>
4 days 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>
4 days 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>
4 days 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

4 days 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>
8 days 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()

8 days 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

8 days 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>
8 days 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>
11 days 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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

3 weeks agocolumn: add --color[=<when>] to control colorization
Karel Zak [Tue, 8 Jul 2025 15:02:52 +0000 (17:02 +0200)] 
column: add --color[=<when>] to control colorization

This implements terminal-colors.d(5) behavior.

Signed-off-by: Karel Zak <kzak@redhat.com>
3 weeks agocpuset: Use stride in cpulist_create
Jesse Rosenstock [Tue, 1 Jul 2025 10:38:24 +0000 (12:38 +0200)] 
cpuset: Use stride in cpulist_create

Format cpu lists for `taskset -c`, `lscpu`, etc. using stride.  This
usually produces shorter output.

Now:
% ./taskset -c 0-24:2,25-47:4 ./taskset -pc 0
pid 3937653's current affinity list: 0-24:2,25-45:4

Previously:
% ./taskset -c 0-23:2,24-47:4 ./taskset -pc 0
pid 3933321's current affinity list: 0,2,4,6,8,10,12,14,16,18,20,22,24,28,32,36,40,44

The ranges are constructed greedily; in general it is difficult to
construct a minimal list.
% ./taskset -c 0-63:3,0-63:4 ./taskset -pc 0
pid 3926213's current affinity list: 0,3,4-8:2,9-15:3,16-20:2,21-27:3,28-32:2,33-39:3,40-44:2,45

Signed-off-by: Jesse Rosenstock <jmr@google.com>
3 weeks agocolumn: add basic colors support
Karel Zak [Mon, 7 Jul 2025 13:10:52 +0000 (15:10 +0200)] 
column: add basic colors support

Signed-off-by: Karel Zak <kzak@redhat.com>
3 weeks agochrt: do not try to interpret any other option as a PID either
Benno Schulenberg [Thu, 3 Jul 2025 14:47:52 +0000 (16:47 +0200)] 
chrt: do not try to interpret any other option as a PID either

When doing, for example, `chrt --pid --max`, it would report:

  chrt: invalid PID argument: '--max'

This mistakenly gave the impression that the PID argument has to follow
directly after the --pid option.

Avoid this by delaying the parsing of a PID until after all options have
been parsed.  Temporarily set 'ctl->pid' to zero to indicate that a PID
needs to be read.

After this change, `chrt --pid --max` will simply report the minimum and
maximum valid priorities.  And `chrt --pid -v`:

  chrt: too few arguments

Also, add a missing call of gettext() for the other error message.

CC: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
3 weeks agochrt: simplify the other check for too few arguments
Benno Schulenberg [Thu, 3 Jul 2025 14:47:51 +0000 (16:47 +0200)] 
chrt: simplify the other check for too few arguments

Without option --pid, always at least two arguments are needed:
the <priority> value and a <command>.  (The 'need_prio' variable
is relevant only for the --pid case.)

Also, make the error message more informative.

CC: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
3 weeks agochrt: do not try to interpret the --pid option itself as a PID
Benno Schulenberg [Thu, 3 Jul 2025 14:47:50 +0000 (16:47 +0200)] 
chrt: do not try to interpret the --pid option itself as a PID

When not specifying a PID with --pid, `chrt` would report:

  chrt: invalid PID argument: '--pid'

That was silly.  After this change, `chrt --pid` will report:

  chrt: too few arguments

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
3 weeks agochrt: with more than one argument, interpret first argument as priority
Benno Schulenberg [Thu, 3 Jul 2025 14:47:49 +0000 (16:47 +0200)] 
chrt: with more than one argument, interpret first argument as priority

The first argument is a priority not only for `chrt --pid <prio> <pid>`
but also for `chrt <prio> <command> [<argument>...]`.

This fixes an oversight in recent commit e7a2d62434.

Reviewed-by: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
Tested-by: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
4 weeks agotaskset: Accept 0 pid for current process
Jesse Rosenstock [Fri, 27 Jun 2025 07:47:35 +0000 (09:47 +0200)] 
taskset: Accept 0 pid for current process

This is useful to print the current mask without using `$$`: `taskset -p 0`.

It is also helpful to test taskset: `taskset -c 1-4 taskset -p 0`.
This is not easy with `$$`.

sched_setaffinity(2)/sched_getaffinity(2) accept 0 for the calling
thread, so this seems consistent.

As an implementation detail, we replace 0 with getpid(), so the existing
pid != 0 <==> "will exec" logic continues to work unchanged.

A reasonable alternative would be to interpret just `taskset` (currently
an error) as printing the current mask.  This seems less orthogonal,
and a better use may be found for plain `taskset` in the future.

Signed-off-by: Jesse Rosenstock <jmr@google.com>
4 weeks agolib/path: avoid double free() for cpusets
Karel Zak [Wed, 2 Jul 2025 10:25:45 +0000 (12:25 +0200)] 
lib/path: avoid double free() for cpusets

Addresses: https://github.com/util-linux/util-linux/issues/3641
Signed-off-by: Karel Zak <kzak@redhat.com>
4 weeks agolsblk: fix possible use-after-free
Karel Zak [Wed, 2 Jul 2025 09:48:22 +0000 (11:48 +0200)] 
lsblk: fix possible use-after-free

Signed-off-by: Karel Zak <kzak@redhat.com>
4 weeks agoMerge branch 'bash-completion-enosys' of https://github.com/akinomyoga/util-linux
Karel Zak [Wed, 2 Jul 2025 09:15:01 +0000 (11:15 +0200)] 
Merge branch 'bash-completion-enosys' of https://github.com/akinomyoga/util-linux

* 'bash-completion-enosys' of https://github.com/akinomyoga/util-linux:
  bash-completion: fix function name of enosys completion

4 weeks agoMerge branch 'man-exit-status' of https://github.com/jmr/util-linux
Karel Zak [Wed, 2 Jul 2025 09:06:43 +0000 (11:06 +0200)] 
Merge branch 'man-exit-status' of https://github.com/jmr/util-linux

* 'man-exit-status' of https://github.com/jmr/util-linux:
  man: Replace RETURN VALUE with EXIT STATUS in section 1

4 weeks agorename: change "expression" to "substring"
Haelwenn (lanodan) Monnier [Tue, 1 Jul 2025 16:01:05 +0000 (18:01 +0200)] 
rename: change "expression" to "substring"

As rename(1) doesn't uses an expression (like regex or glob) but rather a substring.

4 weeks agobash-completion: fix function name of enosys completion
Koichi Murase [Tue, 1 Jul 2025 13:39:23 +0000 (22:39 +0900)] 
bash-completion: fix function name of enosys completion

The function "_enosys_module" referenced by the completion setting on
the last line of "bash-completion/enosys" is not defined in the
current master.  As reported in Ref. [1], this causes the following
error on an attempt at argument completion for the "enosys" command:

  bash: _enosys_module: command not found

[1] https://www.reddit.com/r/Fedora/comments/1llmu0w/comment/n00y98k/

Also, the function "_waitpid_module" defined in
"bash-completion/enosys" overwrites another completion function of the
same name defined in "bash-completion/waitpid".  This patch renames
the function in "bash-completion/enosys" to the correct one,
"_enosys_module".

4 weeks agomore: Use ul_strtou16() in a robust way
Karel Zak [Tue, 1 Jul 2025 08:09:46 +0000 (10:09 +0200)] 
more: Use ul_strtou16() in a robust way

Signed-off-by: Karel Zak <kzak@redhat.com>
4 weeks agolsblk: fix memory leak [coverity scan]
Karel Zak [Tue, 1 Jul 2025 08:00:19 +0000 (10:00 +0200)] 
lsblk: fix memory leak [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
4 weeks agoMerge branch 'PR/Benno-27Jun' of https://github.com/karelzak/util-linux-work
Karel Zak [Tue, 1 Jul 2025 07:57:25 +0000 (09:57 +0200)] 
Merge branch 'PR/Benno-27Jun' of https://github.com/karelzak/util-linux-work

* 'PR/Benno-27Jun' of https://github.com/karelzak/util-linux-work:
  lsclocks: (man) remove stray backslash, and correct short form of --time
  script: (man,usage) correct the markup of the synopsis
  chrt: (man) mark "argument" as optional, and unabbreviate it in usage
  chrt: (man) correct the short form of --ext, from -d to -e

4 weeks agoMerge branch 'PR/more-busy-loop' of https://github.com/karelzak/util-linux-work
Karel Zak [Tue, 1 Jul 2025 07:56:51 +0000 (09:56 +0200)] 
Merge branch 'PR/more-busy-loop' of https://github.com/karelzak/util-linux-work

* 'PR/more-busy-loop' of https://github.com/karelzak/util-linux-work:
  more: temporarily ignore stdin when waiting for stderr

4 weeks agoMerge branch 'PR/strv-prefix' of https://github.com/karelzak/util-linux-work
Karel Zak [Tue, 1 Jul 2025 07:56:22 +0000 (09:56 +0200)] 
Merge branch 'PR/strv-prefix' of https://github.com/karelzak/util-linux-work

* 'PR/strv-prefix' of https://github.com/karelzak/util-linux-work:
  lib/strutils: add ul_ prefix to strrep() and strrem() functions
  lib/strutils: add ul_ prefix to split() function
  lib/strutils: add ul_ prefix to strappend() functions
  lib/strutils: add ul_ prefix to strconcat() functions
  lib/strutils: add ul_ prefix to startswith() and endswith()
  lib/strv: use ul_ prefix for strv functions

4 weeks agoman: Replace RETURN VALUE with EXIT STATUS in section 1
Jesse Rosenstock [Mon, 30 Jun 2025 18:32:49 +0000 (20:32 +0200)] 
man: Replace RETURN VALUE with EXIT STATUS in section 1

According to man-pages(7), sections 1 and 8 should normally use
EXIT STATUS, while sections 2 and 3 should use RETURN VALUE.

https://man7.org/linux/man-pages/man7/man-pages.7.html

Signed-off-by: Jesse Rosenstock <jmr@google.com>
4 weeks agolsclocks: (man) remove stray backslash, and correct short form of --time
Benno Schulenberg [Fri, 27 Jun 2025 12:04:08 +0000 (14:04 +0200)] 
lsclocks: (man) remove stray backslash, and correct short form of --time

This fixes commits 98f4e4833c and e9ddea7912.

CC: Thomas Weißschuh <thomas@t-8ch.de>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
4 weeks agoscript: (man,usage) correct the markup of the synopsis
Benno Schulenberg [Fri, 27 Jun 2025 12:04:07 +0000 (14:04 +0200)] 
script: (man,usage) correct the markup of the synopsis

Also, use the word "command", to match the wording for the --command
option, and improve the wording of the description of that option.

This fixes 7268e79bc5.

CC: WanBingjiang <wanbingjiang@webray.com.cn>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
4 weeks agochrt: (man) mark "argument" as optional, and unabbreviate it in usage
Benno Schulenberg [Wed, 25 Jun 2025 08:09:48 +0000 (10:09 +0200)] 
chrt: (man) mark "argument" as optional, and unabbreviate it in usage

Also, consistently uppercase "PID", to indicate it is an abbreviation,
and align the strings properly.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
4 weeks agochrt: (man) correct the short form of --ext, from -d to -e
Benno Schulenberg [Wed, 25 Jun 2025 08:09:47 +0000 (10:09 +0200)] 
chrt: (man) correct the short form of --ext, from -d to -e

This fixes 3e667cf7ed from last month.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
4 weeks agomore: temporarily ignore stdin when waiting for stderr
Karel Zak [Mon, 30 Jun 2025 10:20:13 +0000 (12:20 +0200)] 
more: temporarily ignore stdin when waiting for stderr

more waits for user commands on stderr, but at the same time, it
monitors sigalfd and stdin (for data and POLLHUP|POLLNVAL). We need to
temporarily ignore stdin if there is new data waiting for read()
(e.g., dmesg | more); otherwise, more_key_command() will end in a busy
loop.

Fixes: https://github.com/util-linux/util-linux/issues/3634
Signed-off-by: Karel Zak <kzak@redhat.com>
4 weeks agoMerge branch 'fix-lsblk-empty-type' of https://github.com/codefiles/util-linux
Karel Zak [Mon, 30 Jun 2025 09:34:36 +0000 (11:34 +0200)] 
Merge branch 'fix-lsblk-empty-type' of https://github.com/codefiles/util-linux

* 'fix-lsblk-empty-type' of https://github.com/codefiles/util-linux:
  lsblk: use md as fallback TYPE when md/level empty

4 weeks agolib/strutils: add ul_ prefix to strrep() and strrem() functions
Karel Zak [Mon, 30 Jun 2025 09:15:30 +0000 (11:15 +0200)] 
lib/strutils: add ul_ prefix to strrep() and strrem() functions

Addresses: https://github.com/util-linux/util-linux/issues/3626
Signed-off-by: Karel Zak <kzak@redhat.com>
4 weeks agolib/strutils: add ul_ prefix to split() function
Karel Zak [Mon, 30 Jun 2025 09:15:30 +0000 (11:15 +0200)] 
lib/strutils: add ul_ prefix to split() function

Addresses: https://github.com/util-linux/util-linux/issues/3626
Signed-off-by: Karel Zak <kzak@redhat.com>
4 weeks agolib/strutils: add ul_ prefix to strappend() functions
Karel Zak [Mon, 30 Jun 2025 09:15:30 +0000 (11:15 +0200)] 
lib/strutils: add ul_ prefix to strappend() functions

Addresses: https://github.com/util-linux/util-linux/issues/3626
Signed-off-by: Karel Zak <kzak@redhat.com>
4 weeks agolib/strutils: add ul_ prefix to strconcat() functions
Karel Zak [Mon, 30 Jun 2025 09:15:30 +0000 (11:15 +0200)] 
lib/strutils: add ul_ prefix to strconcat() functions

Addresses: https://github.com/util-linux/util-linux/issues/3626
Signed-off-by: Karel Zak <kzak@redhat.com>
4 weeks agolib/strutils: add ul_ prefix to startswith() and endswith()
Karel Zak [Mon, 30 Jun 2025 09:15:30 +0000 (11:15 +0200)] 
lib/strutils: add ul_ prefix to startswith() and endswith()

Addresses: https://github.com/util-linux/util-linux/issues/3626
Signed-off-by: Karel Zak <kzak@redhat.com>
5 weeks agolsblk: use md as fallback TYPE when md/level empty
codefiles [Sat, 28 Jun 2025 00:53:16 +0000 (20:53 -0400)] 
lsblk: use md as fallback TYPE when md/level empty

5 weeks agogitignore: Ignore tests/diff/ and test/output/
Jesse Rosenstock [Fri, 27 Jun 2025 08:27:25 +0000 (10:27 +0200)] 
gitignore: Ignore tests/diff/ and test/output/

These are auto-generated and clutter git status.
It's even worse with jj, which will auto-add them.

Signed-off-by: Jesse Rosenstock <jmr@google.com>
5 weeks agolib/strv: use ul_ prefix for strv functions
Karel Zak [Thu, 26 Jun 2025 11:47:00 +0000 (13:47 +0200)] 
lib/strv: use ul_ prefix for strv functions

The functions are originally from systemd/udev, so it's possible that
during static linking, they may collide with other systemd-based
components.

Fixes: https://github.com/util-linux/util-linux/issues/3626
Signed-off-by: Karel Zak <kzak@redhat.com>
5 weeks agobash-completion: add choom and coresched
Karel Zak [Thu, 26 Jun 2025 09:14:11 +0000 (11:14 +0200)] 
bash-completion: add choom and coresched

Addresses: https://github.com/util-linux/util-linux/issues/3469
Signed-off-by: Karel Zak <kzak@redhat.com>
5 weeks agoMerge branch 'master' of https://github.com/ndrake/util-linux
Karel Zak [Thu, 26 Jun 2025 09:02:59 +0000 (11:02 +0200)] 
Merge branch 'master' of https://github.com/ndrake/util-linux

* 'master' of https://github.com/ndrake/util-linux:
  Add missing ;; to -m case (#1)

5 weeks agoAdd missing ;; to -m case (#1)
Nate Drake [Wed, 25 Jun 2025 22:39:05 +0000 (18:39 -0400)] 
Add missing ;; to -m case (#1)

5 weeks agoscript: support non-option argument as command
WanBingjiang [Thu, 29 May 2025 08:39:46 +0000 (16:39 +0800)] 
script: support non-option argument as command

[kzak@redhat.com: - don't use POSIXLY_CORRECT, use "+" in getopt_long(),
                  - use strv_join() rather than local concat function]

Based-on: https://github.com/util-linux/util-linux/pull/3599
Fixes: https://github.com/util-linux/util-linux/issues/3481
Signed-off-by: Karel Zak <kzak@redhat.com>
5 weeks agomore: Add MORE_SHELL_LINES environmental variable
cgoesche [Fri, 13 Jun 2025 05:59:28 +0000 (01:59 -0400)] 
more: Add MORE_SHELL_LINES environmental variable

This provides an alternative way to set the number of lines per screenful, with the same
effect as the '-n' and '--lines' command line options.

[kzak@redhat.com: - use ul_strtou16()]

Addresses: #3476
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
Signed-off-by: Karel Zak <kzak@redhat.com>
5 weeks agoinclude/strutils: add ul_strtou16()
Karel Zak [Tue, 24 Jun 2025 09:29:22 +0000 (11:29 +0200)] 
include/strutils: add ul_strtou16()

Signed-off-by: Karel Zak <kzak@redhat.com>
5 weeks agoldattach: add ifndef BOTHER
Karel Zak [Tue, 24 Jun 2025 09:14:29 +0000 (11:14 +0200)] 
ldattach: add ifndef BOTHER

Signed-off-by: Karel Zak <kzak@redhat.com>
5 weeks agoMerge branch 'PR/chrt-optional-prio' of https://github.com/karelzak/util-linux-work
Karel Zak [Tue, 24 Jun 2025 09:08:36 +0000 (11:08 +0200)] 
Merge branch 'PR/chrt-optional-prio' of https://github.com/karelzak/util-linux-work

* 'PR/chrt-optional-prio' of https://github.com/karelzak/util-linux-work:
  chrt: Make priority optional for policies that don't use it
  chrt: Only display current settings when no policy is specified
  chrt: Make minor cleanups in chrt

5 weeks agopo: update uk.po (from translationproject.org)
Yuri Chornoivan [Tue, 24 Jun 2025 08:22:17 +0000 (10:22 +0200)] 
po: update uk.po (from translationproject.org)

5 weeks agopo: update sr.po (from translationproject.org)
Мирослав Николић [Tue, 24 Jun 2025 08:22:17 +0000 (10:22 +0200)] 
po: update sr.po (from translationproject.org)

5 weeks agopo: update ro.po (from translationproject.org)
Remus-Gabriel Chelu [Tue, 24 Jun 2025 08:22:16 +0000 (10:22 +0200)] 
po: update ro.po (from translationproject.org)

5 weeks agopo: update pt.po (from translationproject.org)
Pedro Albuquerque [Tue, 24 Jun 2025 08:22:16 +0000 (10:22 +0200)] 
po: update pt.po (from translationproject.org)

5 weeks agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Tue, 24 Jun 2025 08:22:16 +0000 (10:22 +0200)] 
po: update pl.po (from translationproject.org)

5 weeks agopo: update nl.po (from translationproject.org)
Benno Schulenberg [Tue, 24 Jun 2025 08:22:16 +0000 (10:22 +0200)] 
po: update nl.po (from translationproject.org)

5 weeks agopo: update ja.po (from translationproject.org)
YOSHIDA Hideki [Tue, 24 Jun 2025 08:22:16 +0000 (10:22 +0200)] 
po: update ja.po (from translationproject.org)

5 weeks agopo: update hr.po (from translationproject.org)
Božidar Putanec [Tue, 24 Jun 2025 08:22:16 +0000 (10:22 +0200)] 
po: update hr.po (from translationproject.org)

5 weeks agopo: update fr.po (from translationproject.org)
Frédéric Marchal [Tue, 24 Jun 2025 08:22:16 +0000 (10:22 +0200)] 
po: update fr.po (from translationproject.org)

5 weeks agopo: update es.po (from translationproject.org)
Antonio Ceballos Roa [Tue, 24 Jun 2025 08:22:16 +0000 (10:22 +0200)] 
po: update es.po (from translationproject.org)

5 weeks agopo: update de.po (from translationproject.org)
Mario Blättermann [Tue, 24 Jun 2025 08:22:16 +0000 (10:22 +0200)] 
po: update de.po (from translationproject.org)

5 weeks agopo: update cs.po (from translationproject.org)
Petr Písař [Tue, 24 Jun 2025 08:22:16 +0000 (10:22 +0200)] 
po: update cs.po (from translationproject.org)

5 weeks agopo-man: merge changes
Karel Zak [Tue, 24 Jun 2025 08:22:14 +0000 (10:22 +0200)] 
po-man: merge changes

5 weeks agopo-man: update sr.po (from translationproject.org)
Мирослав Николић [Tue, 24 Jun 2025 08:21:51 +0000 (10:21 +0200)] 
po-man: update sr.po (from translationproject.org)

5 weeks agopo-man: update de.po (from translationproject.org)
Mario Blättermann [Tue, 24 Jun 2025 08:21:51 +0000 (10:21 +0200)] 
po-man: update de.po (from translationproject.org)

5 weeks agochrt: Make priority optional for policies that don't use it
Madadi Vineeth Reddy [Sat, 21 Jun 2025 19:50:48 +0000 (01:20 +0530)] 
chrt: Make priority optional for policies that don't use it

Currently, chrt requires a priority argument even for scheduling
policies like SCHED_OTHER and SCHED_BATCH, which ignore it.

This change relaxes that requirement. Now, priority is only expected
for SCHED_FIFO and SCHED_RR. For other policies, a default value of 0
is set internally and no argument is required on the command line.

This simplifies usage when modifying runtime parameters like
--sched-runtime for non-realtime tasks.

For example, to change the EEVDF tunable base_slice, one currently
needs to run:
chrt -o -T 1000000 --pid 0 $PID

Passing '0' after --pid is not intutive and not required as priority
is not applicable to SCHED_OTHER tasks. Now with this patch, one can do:
chrt -o -T 1000000 --pid $PID

Passing '0' still works ensuring ABI doesn't break.

Signed-off-by: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
5 weeks agochrt: Only display current settings when no policy is specified
Madadi Vineeth Reddy [Sat, 21 Jun 2025 19:50:47 +0000 (01:20 +0530)] 
chrt: Only display current settings when no policy is specified

Previously, running "chrt --pid <pid>" with no policy options
would display the process’s current scheduling attributes, but
specifying a policy without a priority (e.g. chrt --rr --pid <pid>)
would silently fallback to displaying the same info. This was
confusing, since a policy option normally implies an intent to
change something.

This patch changes the behavior so that
chrt --pid <pid> continues to show the current settings:

chrt --pid 10862
pid 10862's current scheduling policy:  SCHED_OTHER
pid 10862's current scheduling priority: 0
pid 10862's current runtime parameter:  2800000

If a policy is specified but no priority follows, chrt now
errors out:

chrt --rr --pid 10862
chrt: policy SCHED_RR requires a priority argument

Verbose output (-v) still prints the current settings when a
valid policy+priority is provided.

Signed-off-by: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
5 weeks agochrt: Make minor cleanups in chrt
Madadi Vineeth Reddy [Sat, 21 Jun 2025 19:50:46 +0000 (01:20 +0530)] 
chrt: Make minor cleanups in chrt

Minor changes such as fixing an incorrect comment and aligning
the closing brace of an if condition in main() were made, along
with making the usage of --pid consistent across files instead
of -p, although -p still works, for better readability.

No functional change is intended.

Signed-off-by: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
6 weeks agodocs: update mount options for 'ntfs3'
Johannes Schneider [Thu, 19 Jun 2025 18:41:40 +0000 (20:41 +0200)] 
docs: update mount options for 'ntfs3'

Cleanout the mount options, and import the options from the upstream
documentation found at https://docs.kernel.org/filesystems/ntfs3.html

Fixes: 847264af6 docs: update mount type to 'ntfs3'
Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com>
6 weeks agolibmount: don't update utab when moving /run
Karel Zak [Thu, 19 Jun 2025 10:23:57 +0000 (12:23 +0200)] 
libmount: don't update utab when moving /run

It's bad idea to try update /run/mount/utab when moving any directory
in way to the file (like /run).

It's also unnecessary to prepare any updates if the utab file is
empty. This is already done for umount, and we can use it for mount
move as well.

Fixes: https://github.com/util-linux/util-linux/issues/3619
Signed-off-by: Karel Zak <kzak@redhat.com>
6 weeks agoinclude/strutils: Add startswithpath()
Karel Zak [Thu, 19 Jun 2025 10:23:27 +0000 (12:23 +0200)] 
include/strutils: Add startswithpath()

This is similar to startswith() but checks if the prefix is a complete
path or a complete subdirectory (needs to end with '/').

Signed-off-by: Karel Zak <kzak@redhat.com>
6 weeks agoMerge branch 'ntfs3-type-detection' of https://github.com/js731ca/util-linux
Karel Zak [Thu, 19 Jun 2025 08:45:14 +0000 (10:45 +0200)] 
Merge branch 'ntfs3-type-detection' of https://github.com/js731ca/util-linux

* 'ntfs3-type-detection' of https://github.com/js731ca/util-linux:
  bash-completion: update autocompletion list to 'ntfs3'
  docs: update mount type to 'ntfs3'
  tests: update expected type to 'ntfs3'
  libblkid/libmount: ntfs: return filesystem type 'ntfs3'

6 weeks agoMerge branch 'musl-kill-decode' of https://github.com/ChenQi1989/util-linux
Karel Zak [Mon, 16 Jun 2025 11:37:50 +0000 (13:37 +0200)] 
Merge branch 'musl-kill-decode' of https://github.com/ChenQi1989/util-linux

* 'musl-kill-decode' of https://github.com/ChenQi1989/util-linux:
  ts/kill/decode: use RTMIN from 'kill -L' instead of hardcoding 34

7 weeks agobash-completion: update autocompletion list to 'ntfs3'
Johannes Schneider [Fri, 13 Jun 2025 15:46:44 +0000 (17:46 +0200)] 
bash-completion: update autocompletion list to 'ntfs3'

Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com>
7 weeks agodocs: update mount type to 'ntfs3'
Johannes Schneider [Fri, 13 Jun 2025 15:46:11 +0000 (17:46 +0200)] 
docs: update mount type to 'ntfs3'

Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com>
7 weeks agotests: update expected type to 'ntfs3'
Johannes Schneider [Fri, 13 Jun 2025 15:45:30 +0000 (17:45 +0200)] 
tests: update expected type to 'ntfs3'

Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com>
7 weeks agolibblkid/libmount: ntfs: return filesystem type 'ntfs3'
Johannes Schneider [Fri, 13 Jun 2025 13:55:31 +0000 (15:55 +0200)] 
libblkid/libmount: ntfs: return filesystem type 'ntfs3'

Change the returned filesystem type from 'ntfs' to 'ntfs3', to match
what the kernel/fs/ntfs3 driver calls register_filesystem on [1][2].
This same driver also registers itself as 'ntfs', but then runs in a
"legacy" mode [3] which forces the mount to stay RO.

Link: [1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/ntfs3/super.c?h=v6.12#n1794
Link: [2]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/ntfs3/super.c?h=v6.12#n1874
Link: [3]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/ntfs3/super.c?h=v6.12#n412
Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com>
7 weeks agolibblkid/src/topology/dm: fix fscanf return value check to match expected number...
Mingjie Shen [Wed, 11 Jun 2025 21:11:35 +0000 (17:11 -0400)] 
libblkid/src/topology/dm: fix fscanf return value check to match expected number of parsed items

7 weeks agoMerge branch 'doc-col-set-data-func' of https://github.com/ferdnyc/util-linux
Karel Zak [Mon, 9 Jun 2025 12:43:13 +0000 (14:43 +0200)] 
Merge branch 'doc-col-set-data-func' of https://github.com/ferdnyc/util-linux

* 'doc-col-set-data-func' of https://github.com/ferdnyc/util-linux:
  Make scols_column_set_data_func docs visible

7 weeks agoMerge branch 'PR/Benno-2Jun' of https://github.com/karelzak/util-linux-work
Karel Zak [Mon, 9 Jun 2025 12:42:46 +0000 (14:42 +0200)] 
Merge branch 'PR/Benno-2Jun' of https://github.com/karelzak/util-linux-work

* 'PR/Benno-2Jun' of https://github.com/karelzak/util-linux-work:
  treewide: replace postal address in license specifier with a terse URL
  docs: stop the copyright verbiage from getting included in the POT file
  docs: make the "po4a:" line the first line, like in all other .adoc files
  correct the full name of the GPL in various files
  remove "Copyright (C) ...." notes from files that claim no copyright
  remove two leftover license lines from colors.{c,h}

7 weeks agoMerge branch 'fix-mkfds-foreign-sockets' of https://github.com/ChenQi1989/util-linux
Karel Zak [Mon, 9 Jun 2025 12:40:09 +0000 (14:40 +0200)] 
Merge branch 'fix-mkfds-foreign-sockets' of https://github.com/ChenQi1989/util-linux

* 'fix-mkfds-foreign-sockets' of https://github.com/ChenQi1989/util-linux:
  lsfd/mkfds-foreign-sockets: skip when lacking sock_diag ability

7 weeks agoMake scols_column_set_data_func docs visible
FeRD (Frank Dana) [Mon, 9 Jun 2025 08:55:00 +0000 (04:55 -0400)] 
Make scols_column_set_data_func docs visible

The documentation comment for scols_column_set_data_func was missing the
second asterisk in its opening marker, causing the contents to be
omitted from the rendered documentation.

Signed-off-by: FeRD (Frank Dana) <ferdnyc@gmail.com>
7 weeks agots/kill/decode: use RTMIN from 'kill -L' instead of hardcoding 34
Chen Qi [Wed, 4 Jun 2025 08:27:19 +0000 (16:27 +0800)] 
ts/kill/decode: use RTMIN from 'kill -L' instead of hardcoding 34

glibc uses 34 as the value of SIGRTMIN:
https://sourceware.org/git/?p=glibc.git;a=blob;f=signal/allocrtsig.c;h=8ed8e37dd6c41f94be6eef042ce9db1af1153228;hb=HEAD#l27 """
static int current_rtmin = __SIGRTMIN + RESERVED_SIGRT; """

musl uses 35 as the value of SIGRTMIN:
https://git.musl-libc.org/cgit/musl/tree/src/signal/sigrtmin.c

With the hardcoded 34, test case fails with the following difference:

-Ignored: HUP QUIT TRAP PIPE ALRM
+Ignored: HUP QUIT TRAP PIPE ALRM 34

Extract the value of RTMIN from 'kill -L' to avoid such hardcoding.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
8 weeks agoMerge branch 'nsenter-man' of https://github.com/mjoerg/util-linux
Karel Zak [Fri, 6 Jun 2025 09:37:27 +0000 (11:37 +0200)] 
Merge branch 'nsenter-man' of https://github.com/mjoerg/util-linux

* 'nsenter-man' of https://github.com/mjoerg/util-linux:
  nsenter: (man) improve descriptions for some options

8 weeks agoMerge branch 'lsclocks/doc' of https://github.com/t-8ch/util-linux
Karel Zak [Fri, 6 Jun 2025 09:36:49 +0000 (11:36 +0200)] 
Merge branch 'lsclocks/doc' of https://github.com/t-8ch/util-linux

* 'lsclocks/doc' of https://github.com/t-8ch/util-linux:
  lsclocks: (man) list supported clock types