]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
5 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>
5 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

5 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

5 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

6 weeks 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>
6 weeks agofix typo: exciting -> existing
Matteo Croce [Fri, 23 May 2025 03:42:53 +0000 (05:42 +0200)] 
fix typo: exciting -> existing

6 weeks 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.

6 weeks 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

6 weeks 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>
6 weeks 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>
6 weeks 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>
6 weeks 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>
6 weeks 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

6 weeks 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

6 weeks 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

6 weeks 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>
6 weeks 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>
6 weeks 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>
6 weeks 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>
6 weeks 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>
6 weeks 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>
6 weeks 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>
6 weeks 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>
6 weeks 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>
6 weeks 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

6 weeks 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

6 weeks 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

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

Update buflen

6 weeks agofix sectors typos
formtapez [Sat, 24 May 2025 21:39:04 +0000 (23:39 +0200)] 
fix sectors typos

7 weeks 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>
7 weeks agoUpdate setpwnam.c
Mohamed Maatallah [Sat, 24 May 2025 02:16:09 +0000 (03:16 +0100)] 
Update setpwnam.c

7 weeks 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

7 weeks 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>
7 weeks 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>
7 weeks 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

7 weeks 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.

7 weeks 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>
7 weeks 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

7 weeks 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>
7 weeks 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

7 weeks 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>
7 weeks 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>
7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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>
7 weeks agoshells.c: call setusershell before getusershell
WanBingjiang [Thu, 8 May 2025 02:28:48 +0000 (10:28 +0800)] 
shells.c: call setusershell before getusershell

7 weeks 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>
8 weeks 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
8 weeks 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>
8 weeks agochrt: (man) add SCHED_EXT
Shashank Balaji [Fri, 16 May 2025 09:36:21 +0000 (18:36 +0900)] 
chrt: (man) add SCHED_EXT

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

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

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

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

References: 63d7937180fcce4ea7fc1d2855872e464f06e779
Signed-off-by: Karel Zak <kzak@redhat.com>
8 weeks 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>
8 weeks 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>
8 weeks 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>
8 weeks 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>
8 weeks agoMerge branch 'PR/PATH-consolidate' of https://github.com/karelzak/util-linux-work
Karel Zak [Tue, 13 May 2025 06:09:37 +0000 (08:09 +0200)] 
Merge branch 'PR/PATH-consolidate' of https://github.com/karelzak/util-linux-work

* 'PR/PATH-consolidate' of https://github.com/karelzak/util-linux-work:
  setpriv: follow /etc/login.defs for PATH
  su: use logindefs_setenv_path()
  login: use logindefs_setenv_path()
  logindefs: Add function to set PATH

8 weeks agoMerge branch 'PR/login-su-TERM' of https://github.com/karelzak/util-linux-work
Karel Zak [Tue, 13 May 2025 06:09:16 +0000 (08:09 +0200)] 
Merge branch 'PR/login-su-TERM' of https://github.com/karelzak/util-linux-work

* 'PR/login-su-TERM' of https://github.com/karelzak/util-linux-work:
  setpriv: protect COLORTERM and NO_COLOR env. variables
  su: protect COLORTERM and NO_COLOR env. variables
  login: protect COLORTERM and NO_COLOR env. variables

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

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

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

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

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>
2 months agopo-man: add hyperlink.adoc to po4a.cfg
Karel Zak [Wed, 30 Apr 2025 11:14:02 +0000 (13:14 +0200)] 
po-man: add hyperlink.adoc to po4a.cfg

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

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

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

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

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

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

Also, use <list> (the standard way to indicate multiple arguments) as
argument of --pid,  and don't use "<when>" when the possible arguments
differ from "always", "never", "auto".

In addition, improve some wording and markup in the man page.

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

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

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

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

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

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

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

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

The functions are called many times.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agohardlink: fix performance regression (inefficient signal evaluation)
Karel Zak [Tue, 29 Apr 2025 10:29:32 +0000 (12:29 +0200)] 
hardlink: fix performance regression (inefficient signal evaluation)

During work on better verbose output, I found a regression between
v2.40 and v2.41 (and v2.42). In the new version, hardlink is 3-4 times
slower.

The problem is in the function where we verify signals. It calls the
function signal() even though no signal is delivered. It's called in
code loops where hardlink scans files, making it a performance-sensitive
area.

Another significant performance improvement is using an inline function
for handle_interrupt().

This simple patch improves hardlink performance by 10 times.

Fixes: http://github.com/util-linux/util-linux/commit/1453200e22dd4ec858be027653c167225f2fb358
Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agohardlink: Use macro for verbose output
Karel Zak [Tue, 29 Apr 2025 09:49:23 +0000 (11:49 +0200)] 
hardlink: Use macro for verbose output

Now that jlog() is a function, all gettext() arguments are evaluated
in all cases, including when output is unnecessary due to --quiet or
low verbose mode.

Fixes: https://github.com/util-linux/util-linux/issues/3548
Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agoci: build on MIPS
Thomas Weißschuh [Tue, 6 Aug 2024 20:58:04 +0000 (22:58 +0200)] 
ci: build on MIPS

OpenWRT has SDKs targetting MIPS 32/64 bit, little/big endian.
Currently util-linux CI only uses 32 bit little endian through ath79.
Add a big-endian 64bit and little-endian 32bit architecture, too.

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

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

Signed-off-by: Karel Zak <kzak@redhat.com>
2 months agoMerge branch 'PR/statmount-cleanup' of https://github.com/karelzak/util-linux-work
Karel Zak [Fri, 25 Apr 2025 08:39:59 +0000 (10:39 +0200)] 
Merge branch 'PR/statmount-cleanup' of https://github.com/karelzak/util-linux-work

* 'PR/statmount-cleanup' of https://github.com/karelzak/util-linux-work:
  libmount: use and add has_listmount()
  libmount: avoid calling memset() unnecessarily
  libmount: clean up statmount syscall-related functions

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

Addresses: https://github.com/util-linux/util-linux/issues/3544
Signed-off-by: Karel Zak <kzak@redhat.com>