]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
3 months agologger: (man) improve --prio-prefix and --stderr description
Karel Zak [Wed, 16 Apr 2025 08:41:26 +0000 (10:41 +0200)] 
logger: (man) improve --prio-prefix and --stderr description

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

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

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

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

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

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

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

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

3 months agoci: update gcc to version 14
Thomas Weißschuh [Tue, 15 Apr 2025 15:17:38 +0000 (17:17 +0200)] 
ci: update gcc to version 14

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

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

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

Should append instead of assigning. Otherwise fails with

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

The original looked like a plate of spaghetti to me.

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
3 months agodisk-utils: add attribute nonstring to bfs byte arrays
Cristian Rodríguez [Tue, 8 Apr 2025 13:41:36 +0000 (09:41 -0400)] 
disk-utils: add attribute nonstring to bfs byte arrays

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

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

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

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

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

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

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

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

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
3 months agomount: (man) fix some indentation issues, and improve a few wordings
Benno Schulenberg [Mon, 7 Apr 2025 15:14:37 +0000 (17:14 +0200)] 
mount: (man) fix some indentation issues, and improve a few wordings

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
3 months agoeject: (man) add the missing SYNOPSIS header
Benno Schulenberg [Mon, 7 Apr 2025 15:14:36 +0000 (17:14 +0200)] 
eject: (man) add the missing SYNOPSIS header

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
3 months agoblkzone: (man) reduce two overblown tables to legible proportions
Benno Schulenberg [Mon, 7 Apr 2025 15:14:35 +0000 (17:14 +0200)] 
blkzone: (man) reduce two overblown tables to legible proportions

Before version 2.37, before asciidoctor was used, the first three lines
of the first table looked like this:

       start     Zone start sector
       len       Zone length in number of sectors
       wptr      Zone write pointer position

After the move to asciidoctor, the first three lines of the first table
in the generated man page looked like this:

       ┌────────┬────────────────────────────┐
       │        │                            │
       │start   │ Zone start sector          │
       ├────────┼────────────────────────────┤
       │        │                            │
       │len     │ Zone length in number of   │
       │        │ sectors                    │
       ├────────┼────────────────────────────┤
       │        │                            │
       │wptr    │ Zone write pointer         │
       │        │ position                   │
       ├────────┼────────────────────────────┤

Three to four screen lines for just one line of information!

Reduce the tables to sane proportions again by simply using blocks
of preformatted text.

(The substition of xN for x? is needed because somehow the ? in the
indented text is a special character in groff.)

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
3 months agohexdump: (man) normalize the synopsis, and shrink a list and two tables
Benno Schulenberg [Mon, 7 Apr 2025 15:14:34 +0000 (17:14 +0200)] 
hexdump: (man) normalize the synopsis, and shrink a list and two tables

Simply use blocks of preformatted text for the tables, as asciidoctor
inflates true tables to overblown proportions on a man page.

Also, correct the code for DEL from FF to 7F.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
3 months agochoom: (man) add the missing SYNOPSIS section header, and improve wording
Benno Schulenberg [Mon, 7 Apr 2025 15:14:33 +0000 (17:14 +0200)] 
choom: (man) add the missing SYNOPSIS section header, and improve wording

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
3 months agozramctl: (man) mention the required arguments for -p and -r
Benno Schulenberg [Sun, 6 Apr 2025 15:21:47 +0000 (17:21 +0200)] 
zramctl: (man) mention the required arguments for -p and -r

Also, sort the options strictly alphabetically ("r" before "raw").

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
3 months agozramctl: restore normal description indentations in the usage text
Benno Schulenberg [Sun, 6 Apr 2025 15:21:46 +0000 (17:21 +0200)] 
zramctl: restore normal description indentations in the usage text

Commit 19c12e63b1 from four months ago changed the indentation of *all*
the option descriptions in the usage text.  That was the wrong thing to
do, as it invalidates all existing translations for no good reason.

When one of the options is (or needs to become) overlong, then the thing
to do is: to put the description of this option on the next line.

So, restore the indentation of the descriptions to what they were
before commit 19c12e63b1, and wrap the description of -p.

Also, make the description of -b fit within 80 columns, and sort the
options better: alphabetically, but single letter before long option.

CC: LiviaMedeiros <livia@cirno.name>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
3 months agotextual: fix a mistruncated message, and fix a typo
Benno Schulenberg [Sun, 6 Apr 2025 15:21:45 +0000 (17:21 +0200)] 
textual: fix a mistruncated message, and fix a typo

The phrase "in human-readable form" was chosen rather than
"in human-readable format" because it's shorter and lets
the line fit *just* within 80 columns.

Reported-by: Petr Písař <petr.pisar@atlas.cz>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
3 months agohwclock: remove two comments about parameters that no longer exist
Benno Schulenberg [Sun, 6 Apr 2025 15:21:44 +0000 (17:21 +0200)] 
hwclock: remove two comments about parameters that no longer exist

Commit 336f7c5f68 from nine years ago removed the 'universal' and
'testing' parameters of do_adjustment() but forgot to update the
leading comment.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
3 months agoMerge branch 'fallthrough' of https://github.com/teknoraver/util-linux
Karel Zak [Tue, 8 Apr 2025 08:58:14 +0000 (10:58 +0200)] 
Merge branch 'fallthrough' of https://github.com/teknoraver/util-linux

* 'fallthrough' of https://github.com/teknoraver/util-linux:
  Use the 'fallthrough' attribute
  move XXH_FALLTHROUGH into a generic include file
  Fix XXH_HAS_C_ATTRIBUTE check

3 months agoMerge branch 'PR/treewide-fix-optarg' of https://github.com/karelzak/util-linux-work
Karel Zak [Tue, 8 Apr 2025 08:50:11 +0000 (10:50 +0200)] 
Merge branch 'PR/treewide-fix-optarg' of https://github.com/karelzak/util-linux-work

* 'PR/treewide-fix-optarg' of https://github.com/karelzak/util-linux-work:
  treewide: fix optional arguments usage

3 months agoMerge branch 'PR/findmnt-fix-k' of https://github.com/karelzak/util-linux-work
Karel Zak [Tue, 8 Apr 2025 08:49:40 +0000 (10:49 +0200)] 
Merge branch 'PR/findmnt-fix-k' of https://github.com/karelzak/util-linux-work

* 'PR/findmnt-fix-k' of https://github.com/karelzak/util-linux-work:
  findmnt: fix -k option parsing regression

3 months agoUse the 'fallthrough' attribute
Matteo Croce [Thu, 27 Mar 2025 19:49:10 +0000 (20:49 +0100)] 
Use the 'fallthrough' attribute

C23[1] and CPP17[2] introduced the 'fallthrough' attribute to let the
compiler know that we're intentionally falling through a case statement.
This suppress a warning with new compilers when doing an implicit fallthrough.

[1] https://en.cppreference.com/w/c/language/attributes/fallthrough
[2] https://en.cppreference.com/w/cpp/language/attributes/fallthrough

3 months agomove XXH_FALLTHROUGH into a generic include file
Matteo Croce [Thu, 3 Apr 2025 01:09:47 +0000 (03:09 +0200)] 
move XXH_FALLTHROUGH into a generic include file

Move XXH_FALLTHROUGH in c.h, and rename it to FALLTHROUGH

3 months agoFix XXH_HAS_C_ATTRIBUTE check
easyaspi314 (Devin) [Mon, 13 Dec 2021 20:08:50 +0000 (15:08 -0500)] 
Fix XXH_HAS_C_ATTRIBUTE check

3 months agotreewide: fix optional arguments usage
Karel Zak [Mon, 7 Apr 2025 11:49:43 +0000 (13:49 +0200)] 
treewide: fix optional arguments usage

In some parts of the code, the optional argument handling is missing
for cases where the argument starts with '='. This is particularly
important for short options with optional arguments, as suggested by
our man pages. The libc getopt_long() handles this for long options,
but for short options, it's our responsibility.

Note that some argument parsing functions (mostly colormode_or_err())
already implement this, as they are usually used with optional
arguments.

Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agonamespace.h: fix compilation on Linux < 4.10
Thomas Devoogdt [Mon, 7 Apr 2025 12:20:12 +0000 (14:20 +0200)] 
namespace.h: fix compilation on Linux < 4.10

sys-utils/lsns.c: In function ‘add_namespace_from_sock’:
sys-utils/lsns.c:580:19: error: ‘SIOCGSKNS’ undeclared (first use in this function)
  nsfd = ioctl(sk, SIOCGSKNS);
                   ^~~~~~~~~

SIOCGSKNS was added in https://github.com/torvalds/linux/commit/c62cce2caee558e18aa05c01c2fd3b40f07174f2.

Fixes: https://github.com/util-linux/util-linux/issues/3502
Signed-off-by: Thomas Devoogdt <thomas.devoogdt@barco.com>
3 months agoMerge branch 'fix/leading_colon_run_shell' of https://github.com/cgoesche/util-linux...
Karel Zak [Mon, 7 Apr 2025 12:11:42 +0000 (14:11 +0200)] 
Merge branch 'fix/leading_colon_run_shell' of https://github.com/cgoesche/util-linux-fork

* 'fix/leading_colon_run_shell' of https://github.com/cgoesche/util-linux-fork:
  more: fix broken ':!command' command key

3 months agoMerge branch 'fix/implicit_prev_shell_command' of https://github.com/cgoesche/util...
Karel Zak [Mon, 7 Apr 2025 12:11:05 +0000 (14:11 +0200)] 
Merge branch 'fix/implicit_prev_shell_command' of https://github.com/cgoesche/util-linux-fork

* 'fix/implicit_prev_shell_command' of https://github.com/cgoesche/util-linux-fork:
  more: fix implicit previous shell_line execution #3508

3 months agoMerge branch 'treewide--use-strtopid_or_err' of https://github.com/masatake/util...
Karel Zak [Mon, 7 Apr 2025 12:09:57 +0000 (14:09 +0200)] 
Merge branch 'treewide--use-strtopid_or_err' of https://github.com/masatake/util-linux

* 'treewide--use-strtopid_or_err' of https://github.com/masatake/util-linux:
  treewide: use strtopid_or_err()

3 months agoMerge branch 'PR/coverity' of https://github.com/karelzak/util-linux-work
Karel Zak [Mon, 7 Apr 2025 12:03:07 +0000 (14:03 +0200)] 
Merge branch 'PR/coverity' of https://github.com/karelzak/util-linux-work

* 'PR/coverity' of https://github.com/karelzak/util-linux-work:
  fdisk: fix possible memory leak
  fdformat: use size_t and ssize_t
  cfdisk: fix memory leak and possible NULL dereference [gcc-analyzer]

3 months agoMerge branch 'feat/add_secure_mode' of https://github.com/cgoesche/util-linux-fork
Karel Zak [Mon, 7 Apr 2025 12:02:45 +0000 (14:02 +0200)] 
Merge branch 'feat/add_secure_mode' of https://github.com/cgoesche/util-linux-fork

* 'feat/add_secure_mode' of https://github.com/cgoesche/util-linux-fork:
  more: Add MORESECURE and PAGERSECURE environment variables #3503

3 months agofindmnt: fix -k option parsing regression
Karel Zak [Mon, 7 Apr 2025 10:35:02 +0000 (12:35 +0200)] 
findmnt: fix -k option parsing regression

It's a really bad idea to change any existing short option to support
optional arguments.

Fixes: https://github.com/util-linux/util-linux/issues/3512
References: 841d15e5d13dd0cc56e450c8dcc592211d66be27
Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agomore: fix broken ':!command' command key
cgoesche [Sat, 5 Apr 2025 05:43:04 +0000 (01:43 -0400)] 
more: fix broken ':!command' command key

Addresses: #3509
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
3 months agomore: fix implicit previous shell_line execution #3508
cgoesche [Sat, 5 Apr 2025 05:29:35 +0000 (01:29 -0400)] 
more: fix implicit previous shell_line execution #3508

run_shell() will implicitly execute the previous ctl->shell_line
not only if the function was indirectly invoked by the '.' command
but also by a subsequent '!' command.

Addresses: #3508
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
3 months agotreewide: use strtopid_or_err()
Masatake YAMATO [Fri, 4 Apr 2025 00:27:10 +0000 (09:27 +0900)] 
treewide: use strtopid_or_err()

Addresses: https://github.com/util-linux/util-linux/pull/3486
Suggested-by: Thomas Weißschuh <thomas@t-8ch.de>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
3 months agomore: Add MORESECURE and PAGERSECURE environment variables #3503
Christian Goeschel Ndjomouo [Thu, 3 Apr 2025 04:38:29 +0000 (00:38 -0400)] 
more: Add MORESECURE and PAGERSECURE environment variables #3503

Add MORESECURE and PAGERSECURE environment variables to run 'more' in secure mode,
which will effectively disable the _!_ and _v_ commands. This helps to prevent
unprivileged users from running arbitrary shell commands or file manipulations.

Addresses: #3503
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
3 months agofdisk: fix possible memory leak
Karel Zak [Tue, 25 Mar 2025 11:44:13 +0000 (12:44 +0100)] 
fdisk: fix possible memory leak

Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agofdformat: use size_t and ssize_t
Karel Zak [Tue, 25 Mar 2025 11:23:35 +0000 (12:23 +0100)] 
fdformat: use size_t and ssize_t

Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agocfdisk: fix memory leak and possible NULL dereference [gcc-analyzer]
Karel Zak [Tue, 25 Mar 2025 11:14:14 +0000 (12:14 +0100)] 
cfdisk: fix memory leak and possible NULL dereference [gcc-analyzer]

Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agoMerge branch 'PR/Benno-31Mar' of https://github.com/karelzak/util-linux-work
Karel Zak [Thu, 3 Apr 2025 12:07:35 +0000 (14:07 +0200)] 
Merge branch 'PR/Benno-31Mar' of https://github.com/karelzak/util-linux-work

* 'PR/Benno-31Mar' of https://github.com/karelzak/util-linux-work:
  tests: update coresched tests
  coresched: reduce excessive whitespace and verbosity in usage text
  lsblk: (man) remove the incorrect spaces between the arguments of --ct
  hardlink: fix typoed semicolon to colon in error message
  findmnt: (man) remove duplicated option, and correct a description
  irqtop: improve several more option descriptions, and align them all
  irqtop: improve the description of --batch, and align it with others
  last: don't use a tab character in the --help usage text
  uclampset: simplify the synopsis in the --help usage text
  enosys: add the missing arguments of -s and -i to the usage text

3 months agosetarch: use strtopid_or_err()
Karel Zak [Thu, 3 Apr 2025 12:05:09 +0000 (14:05 +0200)] 
setarch: use strtopid_or_err()

Addresses: https://github.com/util-linux/util-linux/pull/3486
Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agoMerge branch 'PR/fix-strcasecmp' of https://github.com/karelzak/util-linux-work
Karel Zak [Thu, 3 Apr 2025 08:00:16 +0000 (10:00 +0200)] 
Merge branch 'PR/fix-strcasecmp' of https://github.com/karelzak/util-linux-work

* 'PR/fix-strcasecmp' of https://github.com/karelzak/util-linux-work:
  treewide: avoid strcasecmp() for ASCII-only strings
  fdisk,partx: avoid strcasecmp() for ASCII-only strings
  libmount: avoid strcasecmp() for ASCII-only strings
  lsblk: avoid strcasecmp() for ASCII-only strings
  libfdisk: avoid strcasecmp() for ASCII-only strings
  libblkid: avoid strcasecmp() for ASCII-only strings
  include/cctype: fix string comparison

3 months agotests: update coresched tests
Karel Zak [Wed, 2 Apr 2025 11:17:07 +0000 (13:17 +0200)] 
tests: update coresched tests

References: fe62e0a1109e2a108d9a8868211875811b1935b3
Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agocoresched: reduce excessive whitespace and verbosity in usage text
Benno Schulenberg [Mon, 31 Mar 2025 09:44:42 +0000 (11:44 +0200)] 
coresched: reduce excessive whitespace and verbosity in usage text

Also, use semicolons instead of periods in option descriptions.

And consistently use an uppercased "PID" in feedback messages.

CC: Phil Auld <pauld@redhat.com>
CC: Thijs Raymakers <thijs@raymakers.nl>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
3 months agolsblk: (man) remove the incorrect spaces between the arguments of --ct
Benno Schulenberg [Mon, 31 Mar 2025 09:44:41 +0000 (11:44 +0200)] 
lsblk: (man) remove the incorrect spaces between the arguments of --ct

Also, unabbreviate some needless abbreviations,
and improve some wordings and markup.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
3 months agohardlink: fix typoed semicolon to colon in error message
Benno Schulenberg [Mon, 31 Mar 2025 09:44:40 +0000 (11:44 +0200)] 
hardlink: fix typoed semicolon to colon in error message

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
3 months agofindmnt: (man) remove duplicated option, and correct a description
Benno Schulenberg [Mon, 31 Mar 2025 09:44:39 +0000 (11:44 +0200)] 
findmnt: (man) remove duplicated option, and correct a description

The page listed both '--shadowed' and '--shadow', while the description
of '--hyperlink' duplicated the possible values of the _mode_ argument
and mistakenly spoke of _when_.

Also, sort the options alphabetically and fix two bits of markup.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
3 months agoirqtop: improve several more option descriptions, and align them all
Benno Schulenberg [Mon, 31 Mar 2025 09:44:38 +0000 (11:44 +0200)] 
irqtop: improve several more option descriptions, and align them all

Keep at least two spaces between option+argument and its description,
while making sure not to go above 80 columns per line.

Also, improve the docstring (there is no need to mention that irqtop
is a utility) and remove the ugly Q from the list of interactive keys.

CC: Joe Jin <joe.jin@oracle.com>
CC: Zhenwei Pi <pizhenwei@bytedance.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
3 months agoirqtop: improve the description of --batch, and align it with others
Benno Schulenberg [Mon, 31 Mar 2025 09:44:37 +0000 (11:44 +0200)] 
irqtop: improve the description of --batch, and align it with others

Also improve the description of --delay and tweak the one of --json,
and align both descriptions with the preceding ones.

CC: Joe Jin <joe.jin@oracle.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
3 months agolast: don't use a tab character in the --help usage text
Benno Schulenberg [Mon, 31 Mar 2025 09:44:36 +0000 (11:44 +0200)] 
last: don't use a tab character in the --help usage text

Also, sort options -p and --time-format alphabetically,
like in the man page.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
3 months agouclampset: simplify the synopsis in the --help usage text
Benno Schulenberg [Mon, 31 Mar 2025 09:44:35 +0000 (11:44 +0200)] 
uclampset: simplify the synopsis in the --help usage text

The synopsis cannot express all possible forms of the command and still
stay readable, so do not even try.  Giving one, single synopsis is far
clearer.  Also, unabbreviate two words in the option descriptions.

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

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
3 months agoenosys: add the missing arguments of -s and -i to the usage text
Benno Schulenberg [Mon, 31 Mar 2025 09:44:34 +0000 (11:44 +0200)] 
enosys: add the missing arguments of -s and -i to the usage text

Also, add a docstring, drop the redundant double dash from the synopsis,
add the missing -m option, and add a missing word to an error message.

CC: Thomas Weißschuh <thomas@t-8ch.de>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
3 months agotreewide: avoid strcasecmp() for ASCII-only strings
Karel Zak [Tue, 1 Apr 2025 15:45:01 +0000 (17:45 +0200)] 
treewide: avoid strcasecmp() for ASCII-only strings

Use cctype.h for locale-independent string comparison and to avoid
tricky string conversions like in tr_TR locales.

Fixes: https://github.com/util-linux/util-linux/issues/3490
Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agofdisk,partx: avoid strcasecmp() for ASCII-only strings
Karel Zak [Tue, 1 Apr 2025 15:45:01 +0000 (17:45 +0200)] 
fdisk,partx: avoid strcasecmp() for ASCII-only strings

Use cctype.h for locale-independent string comparison and to avoid
tricky string conversions like in tr_TR locales.

Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agolibmount: avoid strcasecmp() for ASCII-only strings
Karel Zak [Tue, 1 Apr 2025 15:45:01 +0000 (17:45 +0200)] 
libmount: avoid strcasecmp() for ASCII-only strings

Use cctype.h for locale-independent string comparison and to avoid
tricky string conversions like in tr_TR locales.

Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agolsblk: avoid strcasecmp() for ASCII-only strings
Karel Zak [Tue, 1 Apr 2025 15:45:01 +0000 (17:45 +0200)] 
lsblk: avoid strcasecmp() for ASCII-only strings

Use cctype.h for locale-independent string comparison and to avoid
tricky string conversions like in tr_TR locales.

Fixes: https://github.com/util-linux/util-linux/issues/3490
Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agolibfdisk: avoid strcasecmp() for ASCII-only strings
Karel Zak [Tue, 1 Apr 2025 15:45:01 +0000 (17:45 +0200)] 
libfdisk: avoid strcasecmp() for ASCII-only strings

Use cctype.h for locale-independent string comparison and to avoid
tricky string conversions like in tr_TR locales.

Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agolibblkid: avoid strcasecmp() for ASCII-only strings
Karel Zak [Tue, 1 Apr 2025 15:45:01 +0000 (17:45 +0200)] 
libblkid: avoid strcasecmp() for ASCII-only strings

Use cctype.h for locale-independent string comparison and to avoid
tricky string conversions like in tr_TR locales.

Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agoinclude/cctype: fix string comparison
Karel Zak [Wed, 2 Apr 2025 09:00:47 +0000 (11:00 +0200)] 
include/cctype: fix string comparison

Reimplement c_strcasecmp() and c_strncasecmp() to be libc compatible
and fix c_strncasecmp() to avoid \0 misinterpretation. The original
implementation was pretty stupid (sorry).

Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agomkfs.bfs: fix memory leaks and weak code
Karel Zak [Tue, 1 Apr 2025 13:54:07 +0000 (15:54 +0200)] 
mkfs.bfs: fix memory leaks and weak code

- use size_t to store strlen() result
- init superblock with the default volume and fsname
- don't use strdup(), it's unnecessary as getopt_long() does not
  modify arguments
- don't use memcpy() as we need to check string sizes
- restrict verbose output 6 bytes

Addresses: https://github.com/util-linux/util-linux/pull/3488
Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agotests: mark lsns/filer as TS_KNOWN_FAIL
Karel Zak [Tue, 18 Feb 2025 16:55:36 +0000 (17:55 +0100)] 
tests: mark lsns/filer as TS_KNOWN_FAIL

Let's make the test more robust for stable/ branch.

Addresses: https://github.com/util-linux/util-linux/pull/3205
Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit f589580816220bd70ec5970b41006e1adc82bcf7)

3 months agoMerge branch 'setarch--show-pid' of https://github.com/masatake/util-linux
Karel Zak [Tue, 1 Apr 2025 13:06:54 +0000 (15:06 +0200)] 
Merge branch 'setarch--show-pid' of https://github.com/masatake/util-linux

* 'setarch--show-pid' of https://github.com/masatake/util-linux:
  setarch: add -p/--pid option showing the personality of specified process
  procfs: add a helper function to access /proc/$pid/personality
  bash-completion: (setarch) show some options as the 1st arg

3 months agoMerge branch 'lsfd--bugfix-af-packet' of https://github.com/masatake/util-linux
Karel Zak [Tue, 1 Apr 2025 12:59:24 +0000 (14:59 +0200)] 
Merge branch 'lsfd--bugfix-af-packet' of https://github.com/masatake/util-linux

* 'lsfd--bugfix-af-packet' of https://github.com/masatake/util-linux:
  lsfd: (bug fix) scan the protocol field of /proc/net/packet as a hex number
  tests: (test_mkfds::mapped-packet-socket) add a new parameter, protocol
  lsfd: fix the description for PACKET.PROTOCOL column

3 months agoMerge branch 'master' of https://github.com/pls-no-hack/util-linux
Karel Zak [Tue, 1 Apr 2025 12:43:05 +0000 (14:43 +0200)] 
Merge branch 'master' of https://github.com/pls-no-hack/util-linux

* 'master' of https://github.com/pls-no-hack/util-linux:
  Fix typo in blkdiscard docs

3 months agoMerge branch 'remove-list-head-macro' of https://github.com/masatake/util-linux
Karel Zak [Tue, 1 Apr 2025 12:40:23 +0000 (14:40 +0200)] 
Merge branch 'remove-list-head-macro' of https://github.com/masatake/util-linux

* 'remove-list-head-macro' of https://github.com/masatake/util-linux:
  include/list,lsfd: remove LIST_HEAD macro again

3 months agolsns: enhance compilation without USE_NS_GET_API
Karel Zak [Tue, 1 Apr 2025 12:36:36 +0000 (14:36 +0200)] 
lsns: enhance compilation without USE_NS_GET_API

- Move add_namespace_for_nsfd() declaration to the #ifdef block
- Replace get_netnsid_for_fd() with inline code as it's used only once

References: 2ced43400f35f7bd45b29364e04166a63a06e16a
Signed-off-by: Karel Zak <kzak@redhat.com>
3 months agoMerge branch 'bugfix/undefined-reference-add_namespace_for_nsfd' of https://github...
Karel Zak [Tue, 1 Apr 2025 12:26:44 +0000 (14:26 +0200)] 
Merge branch 'bugfix/undefined-reference-add_namespace_for_nsfd' of https://github.com/ThomasDevoogdt/util-linux

* 'bugfix/undefined-reference-add_namespace_for_nsfd' of https://github.com/ThomasDevoogdt/util-linux:
  lsns: fix undefined reference to add_namespace_for_nsfd #3483

3 months agolsfd: (bug fix) scan the protocol field of /proc/net/packet as a hex number
Masatake YAMATO [Sun, 5 Jan 2025 18:30:25 +0000 (03:30 +0900)] 
lsfd: (bug fix) scan the protocol field of /proc/net/packet as a hex number

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
3 months agotests: (test_mkfds::mapped-packet-socket) add a new parameter, protocol
Masatake YAMATO [Sun, 5 Jan 2025 18:49:46 +0000 (03:49 +0900)] 
tests: (test_mkfds::mapped-packet-socket) add a new parameter, protocol

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 months agolsfd: fix the description for PACKET.PROTOCOL column
Masatake YAMATO [Sun, 5 Jan 2025 17:55:19 +0000 (02:55 +0900)] 
lsfd: fix the description for PACKET.PROTOCOL column

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 months agoFix typo in blkdiscard docs
pls-no-hack [Fri, 28 Mar 2025 13:52:49 +0000 (13:52 +0000)] 
Fix typo in blkdiscard docs

4 months agosetarch: add -p/--pid option showing the personality of specified process
Masatake YAMATO [Tue, 25 Mar 2025 19:49:02 +0000 (04:49 +0900)] 
setarch: add -p/--pid option showing the personality of specified process

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 months agoprocfs: add a helper function to access /proc/$pid/personality
Masatake YAMATO [Tue, 25 Mar 2025 19:44:14 +0000 (04:44 +0900)] 
procfs: add a helper function to access /proc/$pid/personality

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 months agobash-completion: (setarch) show some options as the 1st arg
Masatake YAMATO [Thu, 27 Mar 2025 20:41:47 +0000 (05:41 +0900)] 
bash-completion: (setarch) show some options as the 1st arg

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 months agomore: improve help readability
Karel Zak [Thu, 27 Mar 2025 09:58:24 +0000 (10:58 +0100)] 
more: improve help readability

The internal help can be printed within the current content. In this
case, it's hard to see where the help starts. Add a separator to make
it easier to read.

Signed-off-by: Karel Zak <kzak@redhat.com>
4 months agoipcs: align the first group of options with later ones in the usage text
Benno Schulenberg [Tue, 25 Mar 2025 10:43:05 +0000 (11:43 +0100)] 
ipcs: align the first group of options with later ones in the usage text

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
4 months agomkfs.cramfs: (man) mark arguments of -N and -l in bold, not italics
Benno Schulenberg [Tue, 25 Mar 2025 10:43:04 +0000 (11:43 +0100)] 
mkfs.cramfs: (man) mark arguments of -N and -l in bold, not italics

Those possible arguments are literal values, not placeholder words.

Also, improve the description of option -l.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
4 months agomkfs.cramfs: vertically align the option descriptions of the usage text
Benno Schulenberg [Tue, 25 Mar 2025 10:43:03 +0000 (11:43 +0100)] 
mkfs.cramfs: vertically align the option descriptions of the usage text

And trim unneeded whitespace.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
4 months agomkfs.cramfs: reduce the synopsis to the standard, succinct form
Benno Schulenberg [Tue, 25 Mar 2025 10:43:02 +0000 (11:43 +0100)] 
mkfs.cramfs: reduce the synopsis to the standard, succinct form

The old synopsis was 1) incomplete (mentioning -h and -v, but not
-V and -E and -z, for example), and 2) overlong, being wider than
80 columns.  So, change the synposis to what most other utilities
nowadays use: "<name> [options] <arguments>..." -- this makes it
much clearer what the two required arguments are.

Also, reshuffle the descriptions of the two arguments, to not hide
them among the options.

And remove the description of option -s, as listing an option that
does nothing is not helpful.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
4 months agoswapon: improve a translator hint, and remove a pointless one
Benno Schulenberg [Tue, 25 Mar 2025 10:43:01 +0000 (11:43 +0100)] 
swapon: improve a translator hint, and remove a pointless one

The reference to "each entry below" made no sense, as that second
translator hint is not before a gettextized message and therefore
did not make it into the POT file.  Gettextizing that message is
not useful as 1) there is nothing to translate, and 2) allowing
the translators to fiddle with the tabs is too complicated, and
3) the --summary output is deprecated anyway.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
4 months agofstrim: mark only the mountpoint as placeholder, not options -A and -a
Benno Schulenberg [Tue, 25 Mar 2025 10:43:00 +0000 (11:43 +0100)] 
fstrim: mark only the mountpoint as placeholder, not options -A and -a

Also, write "mountpoint" as one word here, because it's clearer.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
4 months agochmem: (man) add missing end-of-bold marker, and add missing OR bar
Benno Schulenberg [Tue, 25 Mar 2025 10:42:59 +0000 (11:42 +0100)] 
chmem: (man) add missing end-of-bold marker, and add missing OR bar

Also, use "EXAMPLES", in the plural, as there are four examples.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
4 months agochmem: print warnings about failures always (not only with --verbose)
Benno Schulenberg [Tue, 25 Mar 2025 10:42:58 +0000 (11:42 +0100)] 
chmem: print warnings about failures always (not only with --verbose)

This makes the handling of errors the same as some 90 lines down.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
4 months agoipcutils, lsipc: unabbreviate two words in some error messages
Benno Schulenberg [Tue, 25 Mar 2025 10:42:57 +0000 (11:42 +0100)] 
ipcutils, lsipc: unabbreviate two words in some error messages

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
4 months agoipcrm: in usage text, use two lines when option+arguments is very long
Benno Schulenberg [Tue, 25 Mar 2025 10:42:56 +0000 (11:42 +0100)] 
ipcrm: in usage text, use two lines when option+arguments is very long

Also, do not use tabs in the usage text, and keep it within 80 columns.

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