]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
3 months agolibuuid: fix uuid_time on macOS without attribute((alias))
Eugene Gershnik [Mon, 6 May 2024 16:29:39 +0000 (09:29 -0700)] 
libuuid: fix uuid_time on macOS without attribute((alias))

Weak aliases are not supported by clang on Darwin.
Instead this fix uses inline asm to make `_uuid_time` an alias to
`___uuid_time`

It appears that on macOS the time API is purely 32 or 64 bit depending
on the build type. There is no ABI issue on that platform and `uuid_time`
can be unconditionally aliased to `_uuid_time`. This is all conjectural,
however, since I have no ability to make 32-bit builds for macOS - the
Apple toolchain doesn't support this since 2019.

Fixes util-linux/util-linux#2873

(cherry picked from commit e47c6f751a7ef87640c61316ada774e8e9cc6b07)

4 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>
(cherry picked from commit 0ecaef693ea60aab709e79dd4a8eb2865ec08967)

4 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>
(cherry picked from commit c4a24f5301ec9779a0492dd110824c2ce813f3eb)

4 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>
(cherry picked from commit 10ee66ed1b08586bde42582e34355418eef33ef5)

4 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>
(cherry picked from commit 71719680968c86a09ad0ba76339447f18996610b)

4 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>
(cherry picked from commit 310806a25f1da9e1e6819c57d2e358bb439ed56d)

4 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>
(cherry picked from commit 33ca468b67d34dead8fb8b41dc9f328971e5fe70)

4 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>
(cherry picked from commit 3f3bb6f9103daaf7a8f47ebe57cbe90bac852e6e)

4 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>
(cherry picked from commit b6f9362988dbe5427d52b31ac3add37a7ddb6b12)

4 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>
(cherry picked from commit 107293a68206f24e531fd906e8114b578911bb7a)

4 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>
(cherry picked from commit 7efdcd75f041fa1cb9a7c05e22dea3567d48bf9e)

4 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>
(cherry picked from commit ea694f8b91b82474c018dac2250b03cb00685b26)

4 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>
(cherry picked from commit b5ae9e8d0234738f381c56aa797aeba81a05d587)

4 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>
(cherry picked from commit 8ec0c305e9f6ab904119201a13873faedb30da57)

4 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>
(cherry picked from commit 7eb663503c77d739f2cc80d78ee9d380b11b6eb9)

4 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>
(cherry picked from commit 259157b0c1a00806ff75188325e40ba10adf12ce)

4 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>
(cherry picked from commit 0da7e8201aa7b9b2c5d0e901c0ccfd6f3bdc54d3)

4 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>
(cherry picked from commit a6584a456835bbef703d7aae1f51d4e07177f8cb)

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>
(cherry picked from commit df3b38fab56001537364302479b33cb104ef7411)

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

(cherry picked from commit 7d181e8f1ecdeca764b62f1daf0bb13cec349e7e)

4 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
(based on c62ed3d58602fd29fe12085f7caf03761ed91b81)

References: 2ced43400f35f7bd45b29364e04166a63a06e16a
Signed-off-by: Karel Zak <kzak@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>
(cherry picked from commit 2ced43400f35f7bd45b29364e04166a63a06e16a)

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>
(cherry picked from commit 7dbfe31a83f45d5aef2b508697e9511c569ffbc8)

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>
(cherry picked from commit 531b2afd4ef3016b14fff41eef208ead5213138e)

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>
(cherry picked from commit 56b97db03a56d90f0480885a35b0383afabc2e18)

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>
(cherry picked from commit 5c0888dde3cc296d06b8243dcc78248ff90526e5)

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>
(cherry picked from commit 23aa09d7baec72cf6bac9d32c844a5bd2a6ef609)

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>
(cherry picked from commit 0e28ab361375036f62dbba9d589576d38f43f157)

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>
(cherry picked from commit ccda6b9abde4425c03bf9c8da967fa02a64d0887)

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>
(cherry picked from commit b7f5e6bba0b77c50eff53d5a9079403cde4cfc18)

4 months agobuild-sys: update release dates v2.41
Karel Zak [Tue, 18 Mar 2025 12:50:51 +0000 (13:50 +0100)] 
build-sys: update release dates

Signed-off-by: Karel Zak <kzak@redhat.com>
4 months agodocs: update v2.41-ReleaseNotes
Karel Zak [Tue, 18 Mar 2025 12:50:16 +0000 (13:50 +0100)] 
docs: update v2.41-ReleaseNotes

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

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

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

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

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

4 months agopo: update hr.po (from translationproject.org)
Božidar Putanec [Tue, 18 Mar 2025 12:44:59 +0000 (13:44 +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 12:44:59 +0000 (13:44 +0100)] 
po: update fr.po (from translationproject.org)

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

4 months agopo-man: add pl.po (from translationproject.org)
Michał Kułach [Tue, 18 Mar 2025 12:44:49 +0000 (13:44 +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 12:44:49 +0000 (13:44 +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 12:44:48 +0000 (13:44 +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 12:44:48 +0000 (13:44 +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>
(cherry picked from commit 126ef957f7c5d42a4ef51353d521eee6e22b8015)

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>
(cherry picked from commit 61bd162fa1246a1d296cf943d12f7c01c8053b10)

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>
(cherry picked from commit 1b317ef942bf007d2c765a390d2087a79a6de766)

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>
(cherry picked from commit 549a5178574364a2bd219ad1ed028f4f4ea71c3d)

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>
(cherry picked from commit 9dd140220c6d6c53383405191001c7372488d264)

4 months agoUse ipc_stat::cgid for the column COL_CGID.
Koutheir Attouchi [Thu, 13 Mar 2025 18:45:01 +0000 (14:45 -0400)] 
Use ipc_stat::cgid for the column COL_CGID.

(cherry picked from commit c64c64b7683695828a6fef044c7193cfa0461be9)

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

(cherry picked from commit d6cdde2d6b9482c1cb790bd17c84fc31a2fad410)

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>
(cherry picked from commit 77b01d90dad212e57fa801e2eccda9724d102c0b)

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>
(cherry picked from commit 361718387dc19334d060b5f303cd9fe1c19af01e)

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>
(cherry picked from commit ede1561d2071e0da859cbdd36bee8cf07807caf4)

4 months agohwclock: avoid dereferencing a pointer [coverity scan]
Karel Zak [Wed, 12 Mar 2025 14:34:17 +0000 (15:34 +0100)] 
hwclock: avoid dereferencing a pointer [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit 16c1d8734847bdeac0e6650a7364e33fb881bfc6)

4 months agolsfd: initialize struct stat [coverity scan]
Karel Zak [Wed, 12 Mar 2025 14:16:18 +0000 (15:16 +0100)] 
lsfd: initialize struct stat [coverity scan]

It's probably unnecessary, but for a complicated function, it's
probably better just to keep the static analyzer happy.

Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit e05e2b4f89a00fadc1032ad7720fefdd99dca029)

4 months agounshare: make strings more robust
Karel Zak [Wed, 12 Mar 2025 14:05:47 +0000 (15:05 +0100)] 
unshare: make strings more robust

Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit ad591f1a8e5917cd41d91de18626494e072414f8)

4 months agoliblastlog2: (test) fix memory leak in failed test [coverity scan]
Karel Zak [Wed, 12 Mar 2025 13:29:10 +0000 (14:29 +0100)] 
liblastlog2: (test) fix memory leak in failed test [coverity scan]

This is just a cosmetic change to satisfy the static analyzer. The
free-before-exit is unnecessary, but in this case (library test), it's
better.

Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit 2e6cc76741a580b9338ab679cf96375eb1084e92)

4 months agolibmount: remove possible leak in mnt_context_guess_srcpath_fstype() [coverity scan]
Karel Zak [Wed, 12 Mar 2025 13:11:49 +0000 (14:11 +0100)] 
libmount: remove possible leak in mnt_context_guess_srcpath_fstype() [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit 6e2127384ba267119311437b233e413e16ef8721)

4 months agotest_sysinfo: remove memory lea [coverity scan]
Karel Zak [Wed, 12 Mar 2025 12:55:12 +0000 (13:55 +0100)] 
test_sysinfo: remove memory lea [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit 87c1ea68155b88ccdc07069c267a3121468d72c8)

4 months agolslogins: remove possible memory leaks [coverity scan]
Karel Zak [Wed, 12 Mar 2025 12:49:02 +0000 (13:49 +0100)] 
lslogins: remove possible memory leaks [coverity scan]

The column can be specified more than once. In this case, the code
will gather the column data multiple times, resulting in a memory
leak.

Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit 52a6e45bfe5ddee1fed20f2f4f7542cac6bf13c9)

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>
(cherry picked from commit 5be4bdf81a8e89b98b12db275deb6154f87feb4b)

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>
(cherry picked from commit 7dd72369680323a1c01dd7226e1158741cc8d55d)

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>
(cherry picked from commit 7a912b98f99131049f91c1a3f53c4f51075ac348)

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>
(cherry picked from commit ad9b9058721a7322f702d5c9beea6e77cd923377)

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>
(cherry picked from commit beaa7dd93ed336c7e486f1200feeaaec50bb8e52)

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>
(cherry picked from commit 95833d8e5e32dea9781873cbbd4e8b01e02d8bad)

4 months agomeson: bring hexdump in line with others
Christian Hesse [Wed, 12 Mar 2025 13:06:14 +0000 (14:06 +0100)] 
meson: bring hexdump in line with others

Before it was different, and the executable was not installed.

(cherry picked from commit ecd8d1e56ca5aeef0b47f3a2b855b83e121359b8)

4 months agoautotools: add missing meson.build files
Karel Zak [Thu, 13 Mar 2025 09:09:21 +0000 (10:09 +0100)] 
autotools: add missing meson.build files

Fixes: https://github.com/util-linux/util-linux/issues/3460
Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit b8d8e3c7a03e36e3e4ef1c31416f7ef1e36a3e58)

4 months agotools: add SPDX-License-Identifier
Karel Zak [Thu, 13 Mar 2025 08:54:45 +0000 (09:54 +0100)] 
tools: add SPDX-License-Identifier

Add an SPDX label to the newly added scripts.

Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit f4c71fbb24a0a47e1c9e9d834bc05f4c02bdc4c7)

5 months agosys-utils/chmem: fix typo.
WanBingjiang [Fri, 7 Mar 2025 02:11:54 +0000 (10:11 +0800)] 
sys-utils/chmem: fix typo.

(cherry picked from commit 43d88060d368c17c7ca572f13ced42c255c540ab)

5 months agolscpu: New Arm part numbers
Jeremy Linton [Thu, 6 Mar 2025 18:17:30 +0000 (12:17 -0600)] 
lscpu: New Arm part numbers

Arm has announced the Cortex-A320 and published the TRM here:
https://developer.arm.com/documentation/109551

The Cortex-A520AE with a TRM here:
https://developer.arm.com/documentation/107726

The Cortex-A720AE with a TRM here:
https://developer.arm.com/documentation/102828

The Neoverse-V3AE with a TRM here:
https://developer.arm.com/documentation/101595

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
(cherry picked from commit be77fa82ad491f38537030c329c2a8e0612506a5)

5 months agoexch: cosmetic code changes
Karel Zak [Mon, 10 Mar 2025 13:43:00 +0000 (14:43 +0100)] 
exch: cosmetic code changes

* Remove unnecessary dirfd (use AT_FDCWD directly)
* Remove unnecessary 'rc' variable

Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit 6bef160562189a72c6f5c779cb7e06e72a0fe6bc)

5 months agoexch: fix compile error if renameat2 is not present
Thomas Devoogdt [Thu, 6 Mar 2025 13:18:48 +0000 (14:18 +0100)] 
exch: fix compile error if renameat2 is not present

https://www.man7.org/linux/man-pages/man2/rename.2.html
Available since Linux 3.15 or glibc 2.28,
add a fallback for older systems.

My initial implementation did the exchange using a swap
file if both HAVE_RENAMEAT2 and SYS_renameat2 were absent.
But that is not really what is desired since exch is supposed
to be atomic. So simply return -1 renameat2 is available.

Signed-off-by: Thomas Devoogdt <thomas.devoogdt@barco.com>
(cherry picked from commit 72a99516f7bdf72411501d0a04cc8f8a7e562d10)

5 months ago{configure.ac,meson.build}: conditionally build {enosys,setpriv} if seccomp is presen...
Thomas Devoogdt [Thu, 6 Mar 2025 10:49:12 +0000 (11:49 +0100)] 
{configure.ac,meson.build}: conditionally build {enosys,setpriv} if seccomp is present #3280

misc-utils/enosys.c:25:27: fatal error: linux/seccomp.h: No such file or directory
 #include <linux/seccomp.h>

Signed-off-by: Thomas Devoogdt <thomas.devoogdt@barco.com>
(cherry picked from commit 8de1ec203b0fbf86ae67b1ac18ba094d36b6a34a)

5 months agobuild-sys: update release dates v2.41-rc2
Karel Zak [Thu, 6 Mar 2025 11:14:41 +0000 (12:14 +0100)] 
build-sys: update release dates

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agotests: update lsmem outputs
Karel Zak [Thu, 6 Mar 2025 11:11:37 +0000 (12:11 +0100)] 
tests: update lsmem outputs

Addresses: 68c9f5578230b8a715204d7f05b52b65f97f808a
Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit 0e08b4300efac2230d65bdbc737985e399b168d7)

5 months agotools/git-version-bump: add from master branch
Karel Zak [Thu, 6 Mar 2025 10:09:13 +0000 (11:09 +0100)] 
tools/git-version-bump: add from master branch

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agodocs: update v2.41-rc2-ReleaseNotes
Karel Zak [Thu, 6 Mar 2025 10:07:42 +0000 (11:07 +0100)] 
docs: update v2.41-rc2-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agotools/git-grouped-log: sort output
Karel Zak [Thu, 6 Mar 2025 10:05:55 +0000 (11:05 +0100)] 
tools/git-grouped-log: sort output

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agotools/git-grouped-log: add from master branch
Karel Zak [Thu, 6 Mar 2025 09:52:59 +0000 (10:52 +0100)] 
tools/git-grouped-log: add from master branch

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agotools/git-tp-sync: update also po-man
Karel Zak [Thu, 6 Mar 2025 09:39:15 +0000 (10:39 +0100)] 
tools/git-tp-sync: update also po-man

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agopo-man: merge changes
Karel Zak [Thu, 6 Mar 2025 09:38:20 +0000 (10:38 +0100)] 
po-man: merge changes

5 months agotools/git-tp-sync: fix checkout -f use
Karel Zak [Thu, 6 Mar 2025 09:23:36 +0000 (10:23 +0100)] 
tools/git-tp-sync: fix checkout -f use

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agopo: merge changes
Karel Zak [Thu, 6 Mar 2025 09:22:03 +0000 (10:22 +0100)] 
po: merge changes

5 months agopo: update nl.po (from translationproject.org)
Benno Schulenberg [Thu, 6 Mar 2025 09:06:48 +0000 (10:06 +0100)] 
po: update nl.po (from translationproject.org)

5 months agopo: update es.po (from translationproject.org)
Antonio Ceballos Roa [Thu, 6 Mar 2025 09:06:48 +0000 (10:06 +0100)] 
po: update es.po (from translationproject.org)

5 months agohardlink: replace a strange word in an error message
Benno Schulenberg [Tue, 4 Mar 2025 16:08:06 +0000 (17:08 +0100)] 
hardlink: replace a strange word in an error message

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
(cherry picked from commit bd83387e25fca9e3fbeb6787b421b24673d7ac8c)

5 months agolsmem: increase the available width for the summary text labels
Benno Schulenberg [Tue, 4 Mar 2025 16:08:05 +0000 (17:08 +0100)] 
lsmem: increase the available width for the summary text labels

This allows the subsequent numbers to get vertically aligned for
most translations too.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
(cherry picked from commit 68c9f5578230b8a715204d7f05b52b65f97f808a)

5 months agotests: (lsns/nsfs) consider the cases that lsns returns multiple paths
Masatake YAMATO [Wed, 5 Mar 2025 14:25:52 +0000 (23:25 +0900)] 
tests: (lsns/nsfs) consider the cases that lsns returns multiple paths

Fixes #3442

If a target directory is bind-mount'ed, lsns returns multiple paths
as the value for NSFS column. This change considers this case.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
(cherry picked from commit dc5c86e91aa9a8fa386896865e069383c5bc4cac)

5 months agotests: (lsns/nsfs) check test_sysinfo helper
Masatake YAMATO [Tue, 4 Mar 2025 19:39:12 +0000 (04:39 +0900)] 
tests: (lsns/nsfs) check test_sysinfo helper

This check was missed though the command was used in
the test case.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
(cherry picked from commit f39d142bfea2471ea94cb17de884642e8fcbc880)

5 months agotests: improve test_sysinfo to check for NS_GET_NSTYPE usability
Karel Zak [Wed, 5 Mar 2025 08:53:34 +0000 (09:53 +0100)] 
tests: improve test_sysinfo to check for NS_GET_NSTYPE usability

Now the test checks if the kernel supports the NS_GET_NSTYPE ioctl,
but it seems that on some platforms it's implemented but does not work
as expected and returns ENOTTY.

Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit 4391638806a40b71383646a33ed022476f4c9dea)

5 months agotests: check for ns-get*-ok
Karel Zak [Tue, 4 Mar 2025 18:07:43 +0000 (19:07 +0100)] 
tests: check for ns-get*-ok

Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit 4f6135531ceb808e721f36937c0a11c865bb4bd8)

5 months agoci: bump uraimo/run-on-arch-action to v3
Frantisek Sumsal [Tue, 4 Mar 2025 12:37:11 +0000 (13:37 +0100)] 
ci: bump uraimo/run-on-arch-action to v3

The latest v3 version should address the sporadic segfaults we've been
seeing (mainly on s390x).

(cherry picked from commit 14707be7318936a6bed2f1bba5dc7b8741e83992)

5 months agoRevert "ci: temporarily switch the alt-arch job worker to Ubuntu 22.04"
Frantisek Sumsal [Tue, 4 Mar 2025 12:36:53 +0000 (13:36 +0100)] 
Revert "ci: temporarily switch the alt-arch job worker to Ubuntu 22.04"

This reverts commit c389f166e5c35e3a7d91205997b75bec5d4353fb.

(cherry picked from commit fca77fea84d080547714f5c866c0775d04b61125)

5 months agofallocate: rework incompatible options
Antonio Russo [Sun, 2 Mar 2025 19:58:07 +0000 (12:58 -0700)] 
fallocate: rework incompatible options

Follow up to d95f9a6, addressing ordering requirements, natural
incompatibilities between various options, and limitations of
posix_fallocate.

(cherry picked from commit 7130d901f1867061514296395589fe004a3e4bec)

5 months agotest_mkfds: disable ppoll multiplexer if sigset_t is not defined
Masatake YAMATO [Tue, 4 Mar 2025 11:05:29 +0000 (20:05 +0900)] 
test_mkfds: disable ppoll multiplexer if sigset_t is not defined

Fixes #3432

The ppoll multiplexer requires RAW sigset_t type generally defined in
asm/linux.h. However, the parisc arch of the kernel older than
487fa28fa8b60417642ac58e8beda6e2509d18f9 didn't export the type to
the user space.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
(cherry picked from commit 82390c030674ec496ab70b143c54f7e961f45a48)

5 months agotest_mkfds: remove local pidfd_open() fallback
Karel Zak [Tue, 4 Mar 2025 10:44:16 +0000 (11:44 +0100)] 
test_mkfds: remove local pidfd_open() fallback

Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit 3664cacaafa4834b0b7702da9e4df0aef9700263)

5 months agoinclude/pidfd-utils: improve robustness
Karel Zak [Tue, 4 Mar 2025 08:47:11 +0000 (09:47 +0100)] 
include/pidfd-utils: improve robustness

* remove global UL_HAVE_PIDFD, in many cases we need only subset of pidfd
  kernel API, rrather than all the functios

* improve #ifdefs for pidfd_*() direct syscalls

* improve dummy fallback to not redefine system header files

Fixes: https://github.com/util-linux/util-linux/issues/3437
Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit 4a1053812f396619070b6849f4d8830c1ee272ee)

5 months agocolumn: replace a mistaken word in an error message
Benno Schulenberg [Mon, 3 Mar 2025 10:21:37 +0000 (11:21 +0100)] 
column: replace a mistaken word in an error message

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
(cherry picked from commit 455e609f06810d01336b61a273673e4fddeb33c2)