]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
7 weeks agoMerge branch 'bash-completion-command-lsblk' of https://github.com/akinomyoga/util...
Karel Zak [Fri, 6 Jun 2025 09:36:14 +0000 (11:36 +0200)] 
Merge branch 'bash-completion-command-lsblk' of https://github.com/akinomyoga/util-linux

* 'bash-completion-command-lsblk' of https://github.com/akinomyoga/util-linux:
  bash-completion: use "command ls" instead of "\ls"
  bash-completion: prefix "command" to other external commands
  bash-completion: prefer "builtin cd" to "cd" to avoid aliases
  bash-completion: prefer "command lsblk" to "lsblk" to avoid aliases

7 weeks agotreewide: replace postal address in license specifier with a terse URL
Benno Schulenberg [Mon, 2 Jun 2025 14:14:36 +0000 (16:14 +0200)] 
treewide: replace postal address in license specifier with a terse URL

This brings the license specifier into the internet age.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
7 weeks agodocs: stop the copyright verbiage from getting included in the POT file
Benno Schulenberg [Mon, 2 Jun 2025 14:14:35 +0000 (16:14 +0200)] 
docs: stop the copyright verbiage from getting included in the POT file

For some reason the asciidoc parser from `po4a` includes *all* comments
from an adoc file into the util-linux-man.pot file.  Xgettext had a way
to include only certain comments, but `po4a` does not appear to have a
dedicated mechanism for this.

So... use some bricolage: insert a fruitless 'ifdef' as a barrier
between the copyright/license comment and the title line.  This
prevents `po4a` from seeing the two things as belonging together.

This shrinks the util-linux-man.pot file by 1267 lines (2.5%),
equivalent to nearly 67kB (4.8%).

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
7 weeks agodocs: make the "po4a:" line the first line, like in all other .adoc files
Benno Schulenberg [Mon, 2 Jun 2025 14:14:34 +0000 (16:14 +0200)] 
docs: make the "po4a:" line the first line, like in all other .adoc files

Also, there should be no space before "po4a:" for the line to be valid.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
7 weeks agocorrect the full name of the GPL in various files
Benno Schulenberg [Mon, 2 Jun 2025 14:14:33 +0000 (16:14 +0200)] 
correct the full name of the GPL in various files

Last year, commit f4cb44bd11 corrected the full name of the GPL in
a dozen files, but still left the mistaken name in eight places.

(Also, in the first file, just reshuffle the license line, to be
in the same position as in other files.)

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
7 weeks agoremove "Copyright (C) ...." notes from files that claim no copyright
Benno Schulenberg [Mon, 2 Jun 2025 14:14:32 +0000 (16:14 +0200)] 
remove "Copyright (C) ...." notes from files that claim no copyright

Replace them with a "Written by" or "Authors:" label.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
7 weeks agoremove two leftover license lines from colors.{c,h}
Benno Schulenberg [Mon, 2 Jun 2025 14:14:31 +0000 (16:14 +0200)] 
remove two leftover license lines from colors.{c,h}

Last March, commit 549a517857 replaced the SPDX line in three files
with a "No copyright is claimed" phrase, but forgot to remove from
two of those files the text lines that correspond to the SPDX.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
8 weeks agonsenter: (man) improve descriptions for some options
Martin Joerg [Thu, 5 Jun 2025 11:13:55 +0000 (11:13 +0000)] 
nsenter: (man) improve descriptions for some options

Signed-off-by: Martin Joerg <martin.joerg@gmail.com>
8 weeks agolsclocks: (man) list supported clock types
Thomas Weißschuh [Tue, 3 Jun 2025 16:05:30 +0000 (18:05 +0200)] 
lsclocks: (man) list supported clock types

Document the different types of clocks that are supported by lsclocks(1).

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
8 weeks agobash-completion: use "command ls" instead of "\ls"
Koichi Murase [Tue, 3 Jun 2025 13:08:04 +0000 (22:08 +0900)] 
bash-completion: use "command ls" instead of "\ls"

The backslash quoting can be used to bypass aliases, but it cannot be
used to bypass shell functions for interactive uses defined by the
users.  We can use "command ls" instead to bypass both aliases and
shell functions.

8 weeks agobash-completion: prefix "command" to other external commands
Koichi Murase [Tue, 3 Jun 2025 12:50:22 +0000 (21:50 +0900)] 
bash-completion: prefix "command" to other external commands

8 weeks agobash-completion: prefer "builtin cd" to "cd" to avoid aliases
Koichi Murase [Tue, 3 Jun 2025 10:29:06 +0000 (19:29 +0900)] 
bash-completion: prefer "builtin cd" to "cd" to avoid aliases

The command "cd" is also often aliased, so we should use "builtin cd"
to make sure to use the built-in version of "cd".

8 weeks agoMerge branch 'cachestat' of https://github.com/teknoraver/util-linux
Karel Zak [Mon, 2 Jun 2025 12:03:55 +0000 (14:03 +0200)] 
Merge branch 'cachestat' of https://github.com/teknoraver/util-linux

* 'cachestat' of https://github.com/teknoraver/util-linux:
  add option to force cachestat() usage

8 weeks agoMerge branch 'PR/Benno-28May' of https://github.com/karelzak/util-linux-work
Karel Zak [Mon, 2 Jun 2025 12:03:32 +0000 (14:03 +0200)] 
Merge branch 'PR/Benno-28May' of https://github.com/karelzak/util-linux-work

* 'PR/Benno-28May' of https://github.com/karelzak/util-linux-work:
  textual: harmonize the wording of the error message for an invalid PID
  colrm: make two error messages actually say that something is wrong
  lib/strutils: call gettext() only when argument of --hyperlink is invalid
  lib/colors: call gettext() only when the argument of --color is invalid

8 weeks agoMerge branch 'existing' of https://github.com/teknoraver/util-linux
Karel Zak [Mon, 2 Jun 2025 11:50:00 +0000 (13:50 +0200)] 
Merge branch 'existing' of https://github.com/teknoraver/util-linux

* 'existing' of https://github.com/teknoraver/util-linux:
  fix typo: exciting -> existing

8 weeks agobash-completion: prefer "command lsblk" to "lsblk" to avoid aliases
Koichi Murase [Sun, 1 Jun 2025 20:14:52 +0000 (05:14 +0900)] 
bash-completion: prefer "command lsblk" to "lsblk" to avoid aliases

The user may define an alias lsblk to specify the default formatting,
such as -T, which would conflict with lsblk -r used in the Bash
completion settings. In the Bash completion settings, to prevent the
calls of lsblk -r ... from being replaced with lsblk -T -r ... and
failing, lsblk should be called using command lsblk.

2 months agolibblkid: Add scoutfs filesystem.
Auke Kok [Tue, 27 May 2025 19:34:43 +0000 (12:34 -0700)] 
libblkid: Add scoutfs filesystem.

The scoutfs filesystem is maintained out-of-tree, but current enough
that we want to submit it for inclusion in libblkid - there's a few
users out there that would benefit from being able to have lsblk aid in
diagnosing and identifying.

For more information about scoutfs, visit the github page here:
   https://github.com/versity/scoutfs

Test images are provided for both data and meta devices. These were
taken from validation samples.

The wiper is set to only wipe a minute part of the filesystem -
basically only the superblock. This is adequately destructive.

Signed-off-by: Auke Kok <auke.kok@versity.com>
2 months agofix typo: exciting -> existing
Matteo Croce [Fri, 23 May 2025 03:42:53 +0000 (05:42 +0200)] 
fix typo: exciting -> existing

2 months agoadd option to force cachestat() usage
Matteo Croce [Fri, 23 May 2025 01:59:36 +0000 (03:59 +0200)] 
add option to force cachestat() usage

When cachestat() is not available, mmap() and fincore() are used to get
cache statistics.
This fallback returns less data than cachestat, and potentially hides
read errors by reporting that the file is all mapped in memory:

$ fincore /usr/bin/java
fincore: failed to do cachestat: /usr/bin/java: Operation not permitted
  RES PAGES   SIZE FILE
 208K    13 198,1K /usr/bin/java
$ echo $?
0
$ sudo fincore /usr/bin/java
RES PAGES   SIZE FILE
 0B     0 198,1K /usr/bin/java

Add a --cachestat argument which forces cachestat usage and fails if
it's not available:

$ fincore -C /usr/bin/java
fincore: failed to do cachestat: /usr/bin/java: Operation not permitted
$ echo $?
1

Also, on huge files the fallback is very slow and memory consuming,
so this flag can be user to avoid doing it by mistake.

2 months agoMerge branch 'patch-1' of https://github.com/Zephkek/util-linux
Karel Zak [Thu, 29 May 2025 11:26:40 +0000 (13:26 +0200)] 
Merge branch 'patch-1' of https://github.com/Zephkek/util-linux

* 'patch-1' of https://github.com/Zephkek/util-linux:
  Update bufflen
  Update setpwnam.c

2 months agotextual: harmonize the wording of the error message for an invalid PID
Benno Schulenberg [Wed, 28 May 2025 09:37:04 +0000 (11:37 +0200)] 
textual: harmonize the wording of the error message for an invalid PID

Having four different forms for the same basic message is unneeded.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agocolrm: make two error messages actually say that something is wrong
Benno Schulenberg [Wed, 28 May 2025 09:37:03 +0000 (11:37 +0200)] 
colrm: make two error messages actually say that something is wrong

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agolib/strutils: call gettext() only when argument of --hyperlink is invalid
Benno Schulenberg [Wed, 28 May 2025 09:37:02 +0000 (11:37 +0200)] 
lib/strutils: call gettext() only when argument of --hyperlink is invalid

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agolib/colors: call gettext() only when the argument of --color is invalid
Benno Schulenberg [Wed, 28 May 2025 09:37:01 +0000 (11:37 +0200)] 
lib/colors: call gettext() only when the argument of --color is invalid

Instead of calling gettext() before starting to interpret the argument
of option -L/--color, call it only when it's needed: when the argument
is not recognized.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agoMerge branch 'PR/Benno-23May' of https://github.com/karelzak/util-linux-work
Karel Zak [Thu, 29 May 2025 10:02:53 +0000 (12:02 +0200)] 
Merge branch 'PR/Benno-23May' of https://github.com/karelzak/util-linux-work

* 'PR/Benno-23May' of https://github.com/karelzak/util-linux-work:
  hardlink: (man,usage) sort the options mostly alphabetically
  hardlink: (usage) improve the descriptions of three options
  hardlink: (usage) remove mistaken period from two option descriptions
  hexdump: (man) put a list item on a single line, to avoid a warning

2 months agoMerge branch 'PR/libmount-verity-deinit' of https://github.com/karelzak/util-linux...
Karel Zak [Thu, 29 May 2025 10:02:29 +0000 (12:02 +0200)] 
Merge branch 'PR/libmount-verity-deinit' of https://github.com/karelzak/util-linux-work

* 'PR/libmount-verity-deinit' of https://github.com/karelzak/util-linux-work:
  libmount: (verity) use messages API for important errors
  libmount: (verity) use messages API for dlopen errors
  libmount: (verity) fix compiler warning
  libmount: (verity) fix deinitialization

2 months agoMerge branch 'total' of https://github.com/teknoraver/util-linux
Karel Zak [Thu, 29 May 2025 10:02:09 +0000 (12:02 +0200)] 
Merge branch 'total' of https://github.com/teknoraver/util-linux

* 'total' of https://github.com/teknoraver/util-linux:
  fincore: add option to show a grand total

2 months agohardlink: (man,usage) sort the options mostly alphabetically
Benno Schulenberg [Fri, 23 May 2025 12:04:07 +0000 (14:04 +0200)] 
hardlink: (man,usage) sort the options mostly alphabetically

Also, improve some markup and wording and grammar.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agohardlink: (usage) improve the descriptions of three options
Benno Schulenberg [Fri, 23 May 2025 12:04:06 +0000 (14:04 +0200)] 
hardlink: (usage) improve the descriptions of three options

The first description was too wordy for a --help text, the second
was vague and seemed to imply that it should be combined with the
preceding option, and the third failed to mention that it doesn't
actually link anything.

(Note: the choice for -m for --maximize and -M for --minimize is
unfortunate, as most people would guess the opposite, especially
since -s is used for --minimum-size and -S for --maximum-size.)

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agohardlink: (usage) remove mistaken period from two option descriptions
Benno Schulenberg [Fri, 23 May 2025 12:04:05 +0000 (14:04 +0200)] 
hardlink: (usage) remove mistaken period from two option descriptions

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agohexdump: (man) put a list item on a single line, to avoid a warning
Benno Schulenberg [Fri, 23 May 2025 12:04:04 +0000 (14:04 +0200)] 
hexdump: (man) put a list item on a single line, to avoid a warning

Asciidoctor annoyingly warned for every translation that
unindented content was added to a list item.  Avoid this
by not breaking the list item into two lines.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2 months agoAUTHORS: update Zhenwei Pi email
zhenwei pi [Mon, 26 May 2025 09:37:57 +0000 (17:37 +0800)] 
AUTHORS: update Zhenwei Pi email

I will be leaving ByteDance so updating my email in AUTHORS to my
personal email.

Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
2 months agolibmount: (verity) use messages API for important errors
Karel Zak [Mon, 26 May 2025 16:55:36 +0000 (18:55 +0200)] 
libmount: (verity) use messages API for important errors

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agolibmount: (verity) use messages API for dlopen errors
Karel Zak [Mon, 26 May 2025 16:44:08 +0000 (18:44 +0200)] 
libmount: (verity) use messages API for dlopen errors

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agolibmount: (verity) fix compiler warning
Karel Zak [Mon, 26 May 2025 15:58:48 +0000 (17:58 +0200)] 
libmount: (verity) fix compiler warning

libmount/src/hook_veritydev.c: In function 'setup_veritydev':
libmount/src/hook_veritydev.c:457:13: warning: '%s' directive argument is null [-Wformat-overflow=]

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agolibmount: (verity) fix deinitialization
Karel Zak [Mon, 26 May 2025 15:57:34 +0000 (17:57 +0200)] 
libmount: (verity) fix deinitialization

Fixes: https://github.com/util-linux/util-linux/issues/3592
Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agoMerge branch 'master' of https://github.com/formtapez/util-linux
Karel Zak [Mon, 26 May 2025 09:58:31 +0000 (11:58 +0200)] 
Merge branch 'master' of https://github.com/formtapez/util-linux

* 'master' of https://github.com/formtapez/util-linux:
  fix sectors typos

2 months agoMerge branch 'PR/lsblk-pttype' of https://github.com/karelzak/util-linux-work
Karel Zak [Mon, 26 May 2025 09:32:49 +0000 (11:32 +0200)] 
Merge branch 'PR/lsblk-pttype' of https://github.com/karelzak/util-linux-work

* 'PR/lsblk-pttype' of https://github.com/karelzak/util-linux-work:
  lsblk: use ID_PART_ENTRY_SCHEME as fallback for PTTYPE

2 months agoMerge branch 'PR/AT_SECURE' of https://github.com/karelzak/util-linux-work
Karel Zak [Mon, 26 May 2025 09:32:25 +0000 (11:32 +0200)] 
Merge branch 'PR/AT_SECURE' of https://github.com/karelzak/util-linux-work

* 'PR/AT_SECURE' of https://github.com/karelzak/util-linux-work:
  treewide: improve getauxval(AT_SECURE) usage
  lib/env, ...: use getauxval(AT_SECURE) for SUID check

2 months agoUpdate bufflen
Mohamed Maatallah [Mon, 26 May 2025 09:06:02 +0000 (10:06 +0100)] 
Update bufflen

Update buflen

2 months agolsfd/mkfds-foreign-sockets: skip when lacking sock_diag ability
Chen Qi [Mon, 26 May 2025 07:24:16 +0000 (15:24 +0800)] 
lsfd/mkfds-foreign-sockets: skip when lacking sock_diag ability

The ENDPOINTS will need sock_diag ability. The kernel might not
enable related configs. Check and skip in case of lacking such ability.

Fixes: https://github.com/util-linux/util-linux/issues/3590
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
2 months agofix sectors typos
formtapez [Sat, 24 May 2025 21:39:04 +0000 (23:39 +0200)] 
fix sectors typos

2 months agofincore: add option to show a grand total
Matteo Croce [Thu, 22 May 2025 20:44:32 +0000 (22:44 +0200)] 
fincore: add option to show a grand total

Similarly to `du`, add a --total option to produce a grand total
of the files analyzed.

Signed-off-by: Matteo Croce <teknoraver@meta.com>
2 months agoUpdate setpwnam.c
Mohamed Maatallah [Sat, 24 May 2025 02:16:09 +0000 (03:16 +0100)] 
Update setpwnam.c

2 months agoMerge branch 'xry111/loongarch-isa-linux-6-12' of https://github.com/xry111/util...
Karel Zak [Thu, 22 May 2025 08:21:42 +0000 (10:21 +0200)] 
Merge branch 'xry111/loongarch-isa-linux-6-12' of https://github.com/xry111/util-linux

* 'xry111/loongarch-isa-linux-6-12' of https://github.com/xry111/util-linux:
  lscpu: Fix loongarch op-mode output with recent kernel

2 months agolsblk: use ID_PART_ENTRY_SCHEME as fallback for PTTYPE
Karel Zak [Thu, 22 May 2025 08:01:03 +0000 (10:01 +0200)] 
lsblk: use ID_PART_ENTRY_SCHEME as fallback for PTTYPE

The udev database typically inherits the ID_PART_TABLE_TYPE property
from the entire disk device to its partitions. However, in some cases,
this property may be missing. Fortunately, blkid/udev also provides
ID_PART_ENTRY_SCHEME for all partitions.

Fixes: https://github.com/util-linux/util-linux/issues/3570
Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agolscpu: Fix loongarch op-mode output with recent kernel
Xi Ruoyao [Thu, 22 May 2025 05:04:48 +0000 (13:04 +0800)] 
lscpu: Fix loongarch op-mode output with recent kernel

Since Linux-6.12, the "loongarch32" item in the ISA field is separated
to "loongarch32r" and "loongarch32s," breaking our expectation.

Link: https://git.kernel.org/torvalds/c/34e3c4500cdc
Signed-off-by: Xi Ruoyao <xry111@xry111.site>
2 months agouuidgen.1.adoc: remove superfluous 'plus'
Daniel Lublin [Wed, 21 May 2025 09:20:34 +0000 (11:20 +0200)] 
uuidgen.1.adoc: remove superfluous 'plus'

Likely copy-paste mistake from the --time flag

2 months agoMerge branch 'login_fix' of https://github.com/echoechoin/util-linux
Karel Zak [Wed, 21 May 2025 09:05:38 +0000 (11:05 +0200)] 
Merge branch 'login_fix' of https://github.com/echoechoin/util-linux

* 'login_fix' of https://github.com/echoechoin/util-linux:
  login: (adoc) add a description about LOGIN_SHELL_FALLBACK
  login: using an avaiable shell while logging in.

2 months agofincore: add recursive directory scanning
Matteo Croce [Sat, 19 Apr 2025 01:09:25 +0000 (03:09 +0200)] 
fincore: add recursive directory scanning

Add a --recursive flag to fincore which allows to recursively scan
directories.

Co-authored-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Matteo Croce <teknoraver@meta.com>
2 months agologin: (adoc) add a description about LOGIN_SHELL_FALLBACK
WanBingjiang [Wed, 21 May 2025 01:49:33 +0000 (09:49 +0800)] 
login: (adoc) add a description about LOGIN_SHELL_FALLBACK

2 months agotreewide: improve getauxval(AT_SECURE) usage
Karel Zak [Tue, 20 May 2025 18:08:09 +0000 (20:08 +0200)] 
treewide: improve getauxval(AT_SECURE) usage

Let's enhance portability and readability slightly.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agoMerge branch 'at_secure' of https://github.com/MaxKellermann/util-linux into PR/AT_SECURE
Karel Zak [Tue, 20 May 2025 17:49:13 +0000 (19:49 +0200)] 
Merge branch 'at_secure' of https://github.com/MaxKellermann/util-linux into PR/AT_SECURE

* 'at_secure' of https://github.com/MaxKellermann/util-linux:
  lib/env, ...: use getauxval(AT_SECURE) for SUID check

2 months agolscpu: fix possible buffer overflow in cpuinfo parser
Karel Zak [Tue, 20 May 2025 08:10:59 +0000 (10:10 +0200)] 
lscpu: fix possible buffer overflow in cpuinfo parser

Addresses: https://github.com/util-linux/util-linux/pull/3577
Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agolib/shells: fix indentation
Karel Zak [Mon, 19 May 2025 10:17:25 +0000 (12:17 +0200)] 
lib/shells: fix indentation

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agoMerge branch 'master' of https://github.com/shashank-mahadasyam/util-linux
Karel Zak [Mon, 19 May 2025 10:13:20 +0000 (12:13 +0200)] 
Merge branch 'master' of https://github.com/shashank-mahadasyam/util-linux

* 'master' of https://github.com/shashank-mahadasyam/util-linux:
  bash-completion: (chrt) add completion for -e/--ext
  chrt: (man) add SCHED_EXT
  tests: add chrt SCHED_EXT test
  chrt: add support for SCHED_EXT

2 months agoMerge branch 'PR/add_ul_prefix' of https://github.com/karelzak/util-linux-work
Karel Zak [Mon, 19 May 2025 09:39:14 +0000 (11:39 +0200)] 
Merge branch 'PR/add_ul_prefix' of https://github.com/karelzak/util-linux-work

* 'PR/add_ul_prefix' of https://github.com/karelzak/util-linux-work:
  treewide: add ul_ to parse_timestamp() function name
  treewide: add ul_ to parse_switch() function name
  treewide: add ul_ to parse_size() function name
  treewide: add ul_  to parse_range() function name

2 months agoMerge branch 'only-_exit-in-shlib' of https://github.com/crrodriguez/util-linux
Karel Zak [Mon, 19 May 2025 09:36:39 +0000 (11:36 +0200)] 
Merge branch 'only-_exit-in-shlib' of https://github.com/crrodriguez/util-linux

* 'only-_exit-in-shlib' of https://github.com/crrodriguez/util-linux:
  Do not call exit() on code ending in shared libraries

2 months agoMerge branch 'master' of https://github.com/stanislav-brabec/util-linux
Karel Zak [Mon, 19 May 2025 09:34:12 +0000 (11:34 +0200)] 
Merge branch 'master' of https://github.com/stanislav-brabec/util-linux

* 'master' of https://github.com/stanislav-brabec/util-linux:
  libblkid: Fix crash while parsing config with libeconf

2 months agotests/ts/kill/decode: avoid using shell built-in kill command
Chen Qi [Thu, 15 May 2025 08:44:33 +0000 (16:44 +0800)] 
tests/ts/kill/decode: avoid using shell built-in kill command

This test case should do the same as other kill test cases, avoiding
using shell built-in kill command.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
2 months agoshells.c: call setusershell before getusershell
WanBingjiang [Thu, 8 May 2025 02:28:48 +0000 (10:28 +0800)] 
shells.c: call setusershell before getusershell

2 months agoDo not call exit() on code ending in shared libraries
Cristian Rodríguez [Sat, 17 May 2025 19:07:02 +0000 (15:07 -0400)] 
Do not call exit() on code ending in shared libraries

It is not cool to call atexit() handlers of unknown
applications from shared libraries, use _exit instead.

Signed-off-by: Cristian Rodríguez <cristian@rodriguez.im>
2 months agolibblkid: Fix crash while parsing config with libeconf
Stanislav Brabec [Fri, 16 May 2025 01:10:14 +0000 (03:10 +0200)] 
libblkid: Fix crash while parsing config with libeconf

As the whole econf_file structure is freed by econf_free(file) at the end
of blkid_read_config(), econf_file structure cannot be defined as static
and initialized only once. The econf_free() is not robust enough and keeps
a pointer to the garbage after the first call of blkid_read_config(). And
if /etc/blkid.conf does not exist, it is called second time.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
Cc: Stefan Schubert <schubi@suse.de>
Link: https://bugzilla.opensuse.org/show_bug.cgi?id=1242705
2 months agobash-completion: (chrt) add completion for -e/--ext
Shashank Balaji [Fri, 16 May 2025 17:03:43 +0000 (02:03 +0900)] 
bash-completion: (chrt) add completion for -e/--ext

chrt's -e/--ext corresponds to the SCHED_EXT scheduling policy,
which, for the purposes of bash completion, behaves just like
--other, --idle, and --batch

Signed-off-by: Shashank Balaji <shashank.mahadasyam@sony.com>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months agotreewide: add ul_ to parse_timestamp() function name
Karel Zak [Tue, 13 May 2025 09:32:14 +0000 (11:32 +0200)] 
treewide: add ul_ to parse_timestamp() function name

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agotreewide: add ul_ to parse_switch() function name
Karel Zak [Tue, 13 May 2025 09:26:49 +0000 (11:26 +0200)] 
treewide: add ul_ to parse_switch() function name

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agotreewide: add ul_ to parse_size() function name
Karel Zak [Tue, 13 May 2025 09:25:39 +0000 (11:25 +0200)] 
treewide: add ul_ to parse_size() function name

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agotreewide: add ul_ to parse_range() function name
Karel Zak [Tue, 13 May 2025 09:24:48 +0000 (11:24 +0200)] 
treewide: add ul_  to parse_range() function name

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months 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

2 months 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

2 months 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

2 months 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

2 months agolib/env, ...: use getauxval(AT_SECURE) for SUID check
Max Kellermann [Sat, 10 May 2025 20:26:50 +0000 (22:26 +0200)] 
lib/env, ...: use getauxval(AT_SECURE) for SUID check

Comparing effective and real uid/gid is not a proper way to check for
SUID execution:

1. this does not consider file capabilities

2. this check breaks when NO_NEW_PRIVS is used as the Linux kernel
   resets effective ids during execve(); this means the check is
   false, but the process still has raised capabilities

For more details about the NO_NEW_PRIVS problem, check this post and
the surrounding thread:

 https://lore.kernel.org/lkml/20250509184105.840928-1-max.kellermann@ionos.com/

Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
2 months agologin: using an avaiable shell while logging in.
WanBingjiang [Thu, 8 May 2025 02:14:35 +0000 (10:14 +0800)] 
login: using an avaiable shell while logging in.

2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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>
2 months 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

2 months 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'

2 months 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>
2 months 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

2 months 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

2 months 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

2 months 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>
2 months 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.

2 months 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>
2 months 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>
2 months 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>
3 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>
3 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>
3 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>