]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
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 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>
4 months agoipcrm: move a constant argument in order to gettextize the message
Benno Schulenberg [Tue, 25 Mar 2025 10:42:55 +0000 (11:42 +0100)] 
ipcrm: move a constant argument in order to gettextize the message

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
4 months agoinclude/list,lsfd: remove LIST_HEAD macro again
Masatake YAMATO [Tue, 25 Mar 2025 18:36:50 +0000 (03:36 +0900)] 
include/list,lsfd: remove LIST_HEAD macro again

This reverts commit cafae2d19742ad56a05a51bb23b798dbbd5c62a8.
See 5d74cf0092b132bf224024548e46566033c84937 about the reason.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 months agolsns: fix undefined reference to add_namespace_for_nsfd #3483
Thomas Devoogdt [Tue, 25 Mar 2025 10:58:18 +0000 (11:58 +0100)] 
lsns: fix undefined reference to add_namespace_for_nsfd #3483

Fixes:

sys-utils/lsns-lsns.o: In function `read_process':
lsns.c:(.text+0x9e8): undefined reference to `add_namespace_for_nsfd'
collect2: error: ld returned 1 exit status

Signed-off-by: Thomas Devoogdt <thomas.devoogdt@barco.com>
4 months agoMerge branch 'PR/meson-fix-manadocs' of https://github.com/karelzak/util-linux-work
Karel Zak [Tue, 25 Mar 2025 12:40:36 +0000 (13:40 +0100)] 
Merge branch 'PR/meson-fix-manadocs' of https://github.com/karelzak/util-linux-work

* 'PR/meson-fix-manadocs' of https://github.com/karelzak/util-linux-work:
  meson: fix manadocs for libsmartcols and libblkid

4 months agoMerge branch 'PR/libmount-fix-nocanonicalize' of https://github.com/karelzak/util...
Karel Zak [Tue, 25 Mar 2025 10:15:13 +0000 (11:15 +0100)] 
Merge branch 'PR/libmount-fix-nocanonicalize' of https://github.com/karelzak/util-linux-work

* 'PR/libmount-fix-nocanonicalize' of https://github.com/karelzak/util-linux-work:
  libmount: fix --no-canonicalize regression

4 months agomeson: fix manadocs for libsmartcols and libblkid
Karel Zak [Mon, 24 Mar 2025 14:18:24 +0000 (15:18 +0100)] 
meson: fix manadocs for libsmartcols and libblkid

Fixes: https://github.com/util-linux/util-linux/issues/3475
Signed-off-by: Karel Zak <kzak@redhat.com>
4 months agoMerge branch 'rtc-default' of https://github.com/Villemoes/util-linux
Karel Zak [Mon, 24 Mar 2025 14:05:42 +0000 (15:05 +0100)] 
Merge branch 'rtc-default' of https://github.com/Villemoes/util-linux

* 'rtc-default' of https://github.com/Villemoes/util-linux:
  Revert "hwclock-rtc.c: try the 'new' rtc class first"

4 months agoMerge branch 'PR/meson-poman-install' of https://github.com/karelzak/util-linux-work
Karel Zak [Mon, 24 Mar 2025 13:45:34 +0000 (14:45 +0100)] 
Merge branch 'PR/meson-poman-install' of https://github.com/karelzak/util-linux-work

* 'PR/meson-poman-install' of https://github.com/karelzak/util-linux-work:
  meson: fix po-man installation

4 months agoMerge branch 'PR/fix-non-widechar' of https://github.com/karelzak/util-linux-work
Karel Zak [Mon, 24 Mar 2025 13:44:46 +0000 (14:44 +0100)] 
Merge branch 'PR/fix-non-widechar' of https://github.com/karelzak/util-linux-work

* 'PR/fix-non-widechar' of https://github.com/karelzak/util-linux-work:
  misc: never include wchar.h
  autotools: don't use wide-character ncurses if --disable-widechar
  column: fix compiler warning for non-widechar compilation

4 months agoMerge branch 'fix-2nd-typo' of https://github.com/standby24x7/util-linux
Karel Zak [Mon, 24 Mar 2025 13:43:59 +0000 (14:43 +0100)] 
Merge branch 'fix-2nd-typo' of https://github.com/standby24x7/util-linux

* 'fix-2nd-typo' of https://github.com/standby24x7/util-linux:
  sys-utils/flock.c Fix a typo in flock.c

4 months agolibmount: fix --no-canonicalize regression
Karel Zak [Mon, 24 Mar 2025 13:31:05 +0000 (14:31 +0100)] 
libmount: fix --no-canonicalize regression

Fixes: https://github.com/util-linux/util-linux/issues/3474
Signed-off-by: Karel Zak <kzak@redhat.com>
4 months agosys-utils/flock.c Fix a typo in flock.c
Masanari Iida [Mon, 24 Mar 2025 09:21:48 +0000 (18:21 +0900)] 
sys-utils/flock.c Fix a typo in flock.c

This patch fixes a spelling typo in a message.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
4 months agolib/fileeq.c Fix a typo in message.
Masanari Iida [Mon, 24 Mar 2025 07:21:44 +0000 (16:21 +0900)] 
lib/fileeq.c Fix a typo in message.

This patch fixes a spelling typo in a command message.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
4 months agoirqtop: use output string in a more robust way
Karel Zak [Thu, 20 Mar 2025 13:28:17 +0000 (14:28 +0100)] 
irqtop: use output string in a more robust way

Reporte-by: Benno Schulenberg <bensberg@telfort.nl>
Signed-off-by: Karel Zak <kzak@redhat.com>
4 months agolibsmartcols: report cells data size on debug
Karel Zak [Thu, 20 Mar 2025 13:19:52 +0000 (14:19 +0100)] 
libsmartcols: report cells data size on debug

Signed-off-by: Karel Zak <kzak@redhat.com>
4 months agoirqtop,lsirq: use scols debug
Karel Zak [Thu, 20 Mar 2025 13:18:14 +0000 (14:18 +0100)] 
irqtop,lsirq: use scols debug

Signed-off-by: Karel Zak <kzak@redhat.com>
4 months agomeson: fix po-man installation
Karel Zak [Thu, 20 Mar 2025 12:15:26 +0000 (13:15 +0100)] 
meson: fix po-man installation

* in po-man/meson.build use already defined mandir
* make sure $DESTDIR is used in the install script

Addresses: https://github.com/util-linux/util-linux/pull/3378
Signed-off-by: Karel Zak <kzak@redhat.com>
4 months agomisc: never include wchar.h
Karel Zak [Thu, 20 Mar 2025 10:57:06 +0000 (11:57 +0100)] 
misc: never include wchar.h

We have a portable "widechar.h" that follows --disable-widechar and
provides portability. It is a bug to directly include libc's wchar.h
or wctype.h.

Fixes: https://github.com/util-linux/util-linux/issues/3470
Signed-off-by: Karel Zak <kzak@redhat.com>
4 months agoautotools: don't use wide-character ncurses if --disable-widechar
Karel Zak [Thu, 20 Mar 2025 10:56:07 +0000 (11:56 +0100)] 
autotools: don't use wide-character ncurses if --disable-widechar

Signed-off-by: Karel Zak <kzak@redhat.com>
4 months agocolumn: fix compiler warning for non-widechar compilation
Karel Zak [Thu, 20 Mar 2025 10:53:59 +0000 (11:53 +0100)] 
column: fix compiler warning for non-widechar compilation

text-utils/column.c: In function ‘ansi_esc_width’:
text-utils/column.c:212:17: warning: case label value exceeds maximum value for type [-Wswitch-outside-range]

Signed-off-by: Karel Zak <kzak@redhat.com>
4 months agodocs: cherry-pick 2.41-ReleaseNotes
Karel Zak [Tue, 18 Mar 2025 13:52:34 +0000 (14:52 +0100)] 
docs: cherry-pick 2.41-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
4 months agobuild-sys: update release dates
Karel Zak [Tue, 18 Mar 2025 13:33:47 +0000 (14:33 +0100)] 
build-sys: update release dates

Signed-off-by: Karel Zak <kzak@redhat.com>
4 months agopo: update uk.po (from translationproject.org)
Yuri Chornoivan [Tue, 18 Mar 2025 13:33:43 +0000 (14:33 +0100)] 
po: update uk.po (from translationproject.org)

4 months agopo: update ro.po (from translationproject.org)
Remus-Gabriel Chelu [Tue, 18 Mar 2025 13:33:42 +0000 (14:33 +0100)] 
po: update ro.po (from translationproject.org)

4 months agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Tue, 18 Mar 2025 13:33:42 +0000 (14:33 +0100)] 
po: update pl.po (from translationproject.org)

4 months agopo: update nl.po (from translationproject.org)
Benno Schulenberg [Tue, 18 Mar 2025 13:33:42 +0000 (14:33 +0100)] 
po: update nl.po (from translationproject.org)

4 months agopo: update ko.po (from translationproject.org)
Seong-ho Cho [Tue, 18 Mar 2025 13:33:42 +0000 (14:33 +0100)] 
po: update ko.po (from translationproject.org)

4 months agopo: update hr.po (from translationproject.org)
Božidar Putanec [Tue, 18 Mar 2025 13:33:42 +0000 (14:33 +0100)] 
po: update hr.po (from translationproject.org)

4 months agopo: update fr.po (from translationproject.org)
Frédéric Marchal [Tue, 18 Mar 2025 13:33:42 +0000 (14:33 +0100)] 
po: update fr.po (from translationproject.org)

4 months agopo: update es.po (from translationproject.org)
Antonio Ceballos Roa [Tue, 18 Mar 2025 13:33:42 +0000 (14:33 +0100)] 
po: update es.po (from translationproject.org)

4 months agopo-man: merge changes
Karel Zak [Tue, 18 Mar 2025 13:33:40 +0000 (14:33 +0100)] 
po-man: merge changes

4 months agopo-man: add pl.po (from translationproject.org)
Michał Kułach [Tue, 18 Mar 2025 13:33:30 +0000 (14:33 +0100)] 
po-man: add pl.po (from translationproject.org)

4 months agopo-man: update uk.po (from translationproject.org)
Yuri Chornoivan [Tue, 18 Mar 2025 13:33:30 +0000 (14:33 +0100)] 
po-man: update uk.po (from translationproject.org)

4 months agopo-man: update ro.po (from translationproject.org)
Remus-Gabriel Chelu [Tue, 18 Mar 2025 13:33:30 +0000 (14:33 +0100)] 
po-man: update ro.po (from translationproject.org)

4 months agopo-man: update fr.po (from translationproject.org)
Frédéric Marchal [Tue, 18 Mar 2025 13:33:30 +0000 (14:33 +0100)] 
po-man: update fr.po (from translationproject.org)

4 months agopo-man: fix typos in configuration
Karel Zak [Tue, 18 Mar 2025 12:39:09 +0000 (13:39 +0100)] 
po-man: fix typos in configuration

Signed-off-by: Karel Zak <kzak@redhat.com>
4 months agoMerge branch 'PR/no_color' of https://github.com/karelzak/util-linux-work
Karel Zak [Tue, 18 Mar 2025 11:51:09 +0000 (12:51 +0100)] 
Merge branch 'PR/no_color' of https://github.com/karelzak/util-linux-work

* 'PR/no_color' of https://github.com/karelzak/util-linux-work:
  terminal-colors.d: support NO_COLOR

4 months agosu: (man) fix duplicate asterisk
Gaël PORTAY [Tue, 18 Mar 2025 08:58:32 +0000 (09:58 +0100)] 
su: (man) fix duplicate asterisk

Signed-off-by: Gaël PORTAY <gael.portay@rtone.fr>
Signed-off-by: Karel Zak <kzak@redhat.com>
4 months agoinclude: use public domain for colors.{c,h} and xalloc.h
Karel Zak [Mon, 17 Mar 2025 13:35:10 +0000 (14:35 +0100)] 
include: use public domain for colors.{c,h} and xalloc.h

The LGPL makes it difficult to use the code in the old BSD tools we
have in util-linux. After obtaining agreement from the major
contributors to the files, we are changing it to "Public Domain".

Signed-off-by: Karel Zak <kzak@redhat.com>
4 months agounshare: fix typo in --map-groups=subids map name [coverity scan]
Karel Zak [Mon, 17 Mar 2025 12:55:06 +0000 (13:55 +0100)] 
unshare: fix typo in --map-groups=subids map name [coverity scan]

Addresses: https://github.com/util-linux/util-linux/pull/3121
Signed-off-by: Karel Zak <kzak@redhat.com>
4 months agoterminal-colors.d: support NO_COLOR
Karel Zak [Mon, 17 Mar 2025 12:38:20 +0000 (13:38 +0100)] 
terminal-colors.d: support NO_COLOR

We already provide the ability to easily disable output colorization,
but there is also the https://no-color.org initiative based on the
NO_COLOR environment variable. Let's support this method to disable
colors. Let's be friendly :-)

Addresses: https://github.com/util-linux/util-linux/issues/3463
Signed-off-by: Karel Zak <kzak@redhat.com>
4 months agoMerge branch 'PR/lscpu-risc' of https://github.com/karelzak/util-linux-work
Karel Zak [Mon, 17 Mar 2025 11:11:08 +0000 (12:11 +0100)] 
Merge branch 'PR/lscpu-risc' of https://github.com/karelzak/util-linux-work

* 'PR/lscpu-risc' of https://github.com/karelzak/util-linux-work:
  tests: (lscpu) update RISC-V tests to add ISA line
  lscpu: RISC-V: Print ISA information in summary

4 months agoMerge branch 'lsfd--revise-unix-endpoints' of https://github.com/masatake/util-linux
Karel Zak [Mon, 17 Mar 2025 11:10:26 +0000 (12:10 +0100)] 
Merge branch 'lsfd--revise-unix-endpoints' of https://github.com/masatake/util-linux

* 'lsfd--revise-unix-endpoints' of https://github.com/masatake/util-linux:
  lsfd: (man) fix a typo
  lsfd: add UNIX.IPEER column
  lsfd: fill ENDPOINTS column for UNIX one-way sockets
  include/list: add a macro for initializing list_head a declarative way
  lsfd: (refactor) add a helper function building ENDPOINTS strings for UNIX socket
  lsfd: add a dummy entry for UNIX socket having no peer to the IPC table
  tests: (lsfd::mkfds-unix-dgram, refactor) split the test into subtests
  tests: add ts_is_in_docker as a helper function
  lsfd: (man) fix a typo

4 months agomore: fix repeat command
Karel Zak [Mon, 17 Mar 2025 10:49:57 +0000 (11:49 +0100)] 
more: fix repeat command

The function more_key_command() may modify the current command setting.
We need to remember the original unmodified version, as specified by
the user, as the previous command; otherwise, the output will be affected
by unexpected cmd.number settings.

Simple reproducer:

 $ more -c /etc/passwd

 - Press <enter> to jump to the next line.
 - Press '.' to repeat the last command.

Old version:
 - It clears the screen and prints only one line (like the "1 <enter>" command).
Fixed version:
 - It jumps to the next line (like the "<enter>" command).

Reported-by: Benno Schulenberg <bensberg@telfort.nl>
Signed-off-by: Karel Zak <kzak@redhat.com>
4 months agotests: (lscpu) update RISC-V tests to add ISA line
Karel Zak [Mon, 17 Mar 2025 10:03:52 +0000 (11:03 +0100)] 
tests: (lscpu) update RISC-V tests to add ISA line

Signed-off-by: Karel Zak <kzak@redhat.com>
4 months agolscpu: RISC-V: Print ISA information in summary
Sunil V L [Tue, 11 Mar 2025 16:06:46 +0000 (21:36 +0530)] 
lscpu: RISC-V: Print ISA information in summary

The ISA information for RISC-V is important for understanding the
different extensions supported by the CPU. Print the ISA information in
the summary, with the Base ISA and single-letter extensions at the
beginning, followed by multi-letter extensions sorted in alphabetical
order. The information is the same as the cpuinfo information, except
that underscores are replaced by spaces and multi-letter extensions are
simply sorted instead of following any ISA string ordering rule.

The sample output below shows the difference between cpuinfo and lscpu.

cpuinfo output:
isa             : rv64imafdch_zicbom_zicboz_zicntr_zicsr_zifencei_zihintntl_zihintpause_zihpm_zawrs_zfa_zba_zbb_zbc_zbs_smaia_ssaia_sstc

lscpu output:
ISA:                rv64imafdch smaia ssaia sstc zawrs zba zbb zbc zbs zfa zicbom zicboz zicntr zicsr zifencei zihintntl zihintpause zihpm

Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
4 months agoswapon: remove unnecessary variable usage
Karel Zak [Mon, 17 Mar 2025 09:54:55 +0000 (10:54 +0100)] 
swapon: remove unnecessary variable usage

Signed-off-by: Karel Zak <kzak@redhat.com>
4 months agovarious: (man) list --help and --version last among the options
Benno Schulenberg [Sun, 16 Mar 2025 15:20:39 +0000 (16:20 +0100)] 
various: (man) list --help and --version last among the options

Almost all util-linux man pages mention -h/--help and -V/--version
last in the list of options.  Make the few deviant pages conform.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
4 months agomore: remove a duplicate call of setlocale()
Benno Schulenberg [Sun, 16 Mar 2025 15:20:38 +0000 (16:20 +0100)] 
more: remove a duplicate call of setlocale()

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
4 months agoirqtop,lsirq: set up locale path, so messages get actually translated
Benno Schulenberg [Sun, 16 Mar 2025 15:20:37 +0000 (16:20 +0100)] 
irqtop,lsirq: set up locale path, so messages get actually translated

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
4 months agoswapon: make options --help and --version override --summary
Benno Schulenberg [Thu, 13 Mar 2025 14:51:49 +0000 (15:51 +0100)] 
swapon: make options --help and --version override --summary

When -h or --help is among the given options, most utilities
print a help text, ignoring all other options and arguments.
Make `swapon --summary --help` conform to this general pattern.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
4 months agoMerge branch 'master' of https://github.com/mdcssw/c-util-linux
Karel Zak [Mon, 17 Mar 2025 09:33:53 +0000 (10:33 +0100)] 
Merge branch 'master' of https://github.com/mdcssw/c-util-linux

* 'master' of https://github.com/mdcssw/c-util-linux:
  Use ipc_stat::cgid for the column COL_CGID.

4 months agoMerge branch 'PR/meson-poman' of https://github.com/karelzak/util-linux-work
Karel Zak [Mon, 17 Mar 2025 09:32:31 +0000 (10:32 +0100)] 
Merge branch 'PR/meson-poman' of https://github.com/karelzak/util-linux-work

* 'PR/meson-poman' of https://github.com/karelzak/util-linux-work:
  tools/poman-translate: fix to work outside on source dir

4 months agolslogins: fix typo
Karel Zak [Mon, 17 Mar 2025 09:32:08 +0000 (10:32 +0100)] 
lslogins: fix typo

Signed-off-by: Karel Zak <kzak@redhat.com>
4 months agoMerge branch 'PR/coverity' of https://github.com/karelzak/util-linux-work
Karel Zak [Mon, 17 Mar 2025 09:30:16 +0000 (10:30 +0100)] 
Merge branch 'PR/coverity' of https://github.com/karelzak/util-linux-work

* 'PR/coverity' of https://github.com/karelzak/util-linux-work:
  hwclock: avoid dereferencing a pointer [coverity scan]
  lsfd: initialize struct stat [coverity scan]
  unshare: make strings more robust
  liblastlog2: (test) fix memory leak in failed test [coverity scan]
  libmount: remove possible leak in mnt_context_guess_srcpath_fstype() [coverity scan]
  test_sysinfo: remove memory lea [coverity scan]
  lslogins: remove possible memory leaks [coverity scan]

4 months agolsfd: (man) fix a typo
Masatake YAMATO [Fri, 14 Mar 2025 21:54:02 +0000 (06:54 +0900)] 
lsfd: (man) fix a typo

4 months agolsfd: add UNIX.IPEER column
Masatake YAMATO [Sun, 9 Mar 2025 22:26:49 +0000 (07:26 +0900)] 
lsfd: add UNIX.IPEER column

An example output:

    # ./lsfd -Q 'TYPE == "UNIX" && SOCK.TYPE == "dgram"' \
             -oCOMMAND,PID,TYPE,INODE,UNIX.IPEER,NAME | head

    COMMAND             PID TYPE   INODE UNIX.IPEER NAME
    systemd               1 UNIX    3239      13482 state=connected type=dgram
    systemd               1 UNIX 1649064    1649065 state=connected type=dgram
    systemd               1 UNIX 1649065    1649064 state=connected type=dgram
    systemd               1 UNIX   13465          0 state=connected path=/run/systemd/notify type=dgram
    ...

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 months agolsfd: fill ENDPOINTS column for UNIX one-way sockets
Masatake YAMATO [Sun, 9 Mar 2025 21:54:04 +0000 (06:54 +0900)] 
lsfd: fill ENDPOINTS column for UNIX one-way sockets

With recvfrom(2) and sendto(2), we can use a UNIX datagram socket at
server side without assigning a peer address with connect(2). Here, I
call such sockets one-way sockets.

    # ss -x -p
    Netid State Recv-Q Send-Q        Local Address:Port  Peer Address:Port Process
    ...
    u_dgr ESTAB      0      0 /run/systemd/notify 13465               * 0  users:(("systemd",pid=1,fd=227))
    u_dgr ESTAB      0      0                   * 35438           * 13465  users:(("systemd-journal",pid=1280,fd=15))
    u_dgr ESTAB      0      0                   * 74792           * 13465  users:(("bluetoothd",pid=13874,fd=4))
    ...

The orignal code could not fill ENDPOINTS for UNIX one-way sockets:

  # ./original-lsfd -Q 'INODE == 13465' -oCOMMAND,PID,TYPE,INODE,NAME,ENDPOINTS
  COMMAND PID TYPE INODE NAME                                                ENDPOINTS
  systemd   1 UNIX 13465 state=connected path=/run/systemd/notify type=dgram

With this change, lsfd can fill the column:

  # ./new-lsfd -Q 'INODE == 13465' -oCOMMAND,PID,TYPE,INODE,NAME,ENDPOINTS
  COMMAND PID TYPE INODE NAME                                                ENDPOINTS
  systemd   1 UNIX 13465 state=connected path=/run/systemd/notify type=dgram 1280,systemd-journal,15rw
                                                                             13874,bluetoothd,4rw

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 months agoinclude/list: add a macro for initializing list_head a declarative way
Masatake YAMATO [Sun, 9 Mar 2025 21:52:19 +0000 (06:52 +0900)] 
include/list: add a macro for initializing list_head a declarative way

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 months agolsfd: (refactor) add a helper function building ENDPOINTS strings for UNIX socket
Masatake YAMATO [Sun, 9 Mar 2025 21:40:01 +0000 (06:40 +0900)] 
lsfd: (refactor) add a helper function building ENDPOINTS strings for UNIX socket

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 months agolsfd: add a dummy entry for UNIX socket having no peer to the IPC table
Masatake YAMATO [Sun, 9 Mar 2025 03:48:34 +0000 (12:48 +0900)] 
lsfd: add a dummy entry for UNIX socket having no peer to the IPC table

With recvfrom(2) and sendto(2), we can use a UNIX datagram socket at
server side without assigning a peer address with connect(2). Here, I
call such sockets one-way sockets.

   # ss -x -p
   Netid State Recv-Q Send-Q        Local Address:Port  Peer Address:Port Process
   ...
   u_dgr ESTAB      0      0 /run/systemd/notify 13465               * 0  users:(("systemd",pid=1,fd=227))
   u_dgr ESTAB      0      0                   * 35438           * 13465  users:(("systemd-journal",pid=1280,fd=15))
   u_dgr ESTAB      0      0                   * 74792           * 13465  users:(("bluetoothd",pid=13874,fd=4))
   ...

The socket, opened with systemd as fd 227, is an example of one-way
socket (13465). It has 0 as "Peer Address:Port". From the side of
systemd process, there is no communication peers. However, the
sockets (35438 and 74792) opened with systemd-journal and bluetoothd
have the one-way socket (13465) as their communication peers.

We expect lsfd prints these connections if user specifies
-o+ENDPOINTS. This change and subsequent changes remove limitations in
this area.

In the early stage of lsfd process, lsfd collects information about
UNIX sockets on the system via unix-diag netlink. lsfd stores the
information to the IPC table. lsfd looks up the IPC table when
printing ENDPOINTS column.

With the original code, lsfd could not fill the ENDPOINTS columns
for sockets connecting to an one-way socket because lsfd did not
store one-way sockets to the IPC table.

  # ./original-lsfd -Q 'INODE == 35438 || INODE == 74792' -oCOMMAND,PID,TYPE,INODE,NAME,ENDPOINTS
  COMMAND           PID TYPE INODE NAME                       ENDPOINTS
  systemd-journal  1280 UNIX 35438 state=connected type=dgram
  bluetoothd      13874 UNIX 74792 state=connected type=dgram

With this change, lsfd can fill the ENDPOINTS columns for sockets
connecting to an one-way socket. The new code puts dummy entries for
the one-way sockets to the IPC table. The dummy entries help lsfd to
find the connections.

  # ./new-lsfd -Q 'INODE == 35438 || INODE == 74792' -oCOMMAND,PID,TYPE,INODE,NAME,ENDPOINTS
  COMMAND           PID TYPE INODE NAME                       ENDPOINTS
  systemd-journal  1280 UNIX 35438 state=connected type=dgram 1,systemd,227rw
  bluetoothd      13874 UNIX 74792 state=connected type=dgram 1,systemd,227rw

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 months agotests: (lsfd::mkfds-unix-dgram, refactor) split the test into subtests
Masatake YAMATO [Mon, 10 Mar 2025 16:21:16 +0000 (01:21 +0900)] 
tests: (lsfd::mkfds-unix-dgram, refactor) split the test into subtests

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 months agotests: add ts_is_in_docker as a helper function
Masatake YAMATO [Tue, 11 Mar 2025 16:32:34 +0000 (01:32 +0900)] 
tests: add ts_is_in_docker as a helper function

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 months agolsfd: (man) fix a typo
Masatake YAMATO [Tue, 11 Mar 2025 15:19:45 +0000 (00:19 +0900)] 
lsfd: (man) fix a typo

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 months agotools/poman-translate: fix to work outside on source dir
Karel Zak [Thu, 13 Mar 2025 13:46:38 +0000 (14:46 +0100)] 
tools/poman-translate: fix to work outside on source dir

* Let's check only the adoc file name if defined in po4a.cfg, not the
  complete path.

 cd ..
 meson setup build-dir util-linux
 ninja -C build-dir

* Exclude manpage-stub.adoc (it's just an example)

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