]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
18 months agobuild-sys: release++ (v2.40.1-rc1) v2.40.1-rc1
Karel Zak [Wed, 1 May 2024 19:46:06 +0000 (21:46 +0200)] 
build-sys: release++ (v2.40.1-rc1)

Signed-off-by: Karel Zak <kzak@redhat.com>
18 months agodocs: update v2.40.1-ReleaseNotes
Karel Zak [Wed, 1 May 2024 19:42:51 +0000 (21:42 +0200)] 
docs: update v2.40.1-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
18 months agodocs: update AUTHORS file
Karel Zak [Wed, 1 May 2024 19:39:24 +0000 (21:39 +0200)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
18 months agopo-man: merge changes
Karel Zak [Wed, 1 May 2024 19:35:43 +0000 (21:35 +0200)] 
po-man: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
18 months agopo: merge changes
Karel Zak [Wed, 1 May 2024 19:35:36 +0000 (21:35 +0200)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
18 months agolibsmartcols: fix column reduction
Karel Zak [Tue, 30 Apr 2024 08:26:09 +0000 (10:26 +0200)] 
libsmartcols: fix column reduction

4013986: libsmartcols:      TAB: [0x5626b97f8e10]: #5 reduce stage (width=38, term=1)
4013986: libsmartcols:      COL: [0x5626b97f9130]:  [01] (null) reduced 2-->18446744073709551615

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

18 months agobcachefs: Remove BCACHEFS_SB_MAX_SIZE & check
Tony Asleson [Mon, 29 Apr 2024 18:04:12 +0000 (13:04 -0500)] 
bcachefs: Remove BCACHEFS_SB_MAX_SIZE & check

This constant had an incorrect value.  However, the code already
does a max. size check which is correct.

Note: bcachefs can theoretically have a superblock of 32MiB, but
this is very unlikely to happen.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
(cherry picked from commit 63ffa1c6e616fd391fddabc15314d3a735c62d50)

18 months agolosetup.8: Clarify --direct-io
Colin Walters [Mon, 29 Apr 2024 19:45:56 +0000 (15:45 -0400)] 
losetup.8: Clarify --direct-io

See e.g. https://github.com/containers/bootc/pull/375#issuecomment-1981109022

The phrasing here was in my opinion technically correct but quite confusing and easy to misunderstand.

Let's be very clear:

- The default is *off*
- You can turn it on in two ways
- You can also explicitly turn it off

Signed-off-by: Colin Walters <walters@verbum.org>
18 months agolibmount: fix umount --read-only
Karel Zak [Tue, 23 Apr 2024 08:29:37 +0000 (10:29 +0200)] 
libmount: fix umount --read-only

Reported-by: Krzysztof Olędzki <ole@ans.pl>
Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit a20e7e23a8565e01b1c84de6924d1fbbdb1cfccc)

18 months agoMerge branch 'stable/v2.40-meson-more-build-options' of https://github.com/jwillikers...
Karel Zak [Wed, 1 May 2024 19:11:10 +0000 (21:11 +0200)] 
Merge branch 'stable/v2.40-meson-more-build-options' of https://github.com/jwillikers/util-linux into stable/v2.40

* 'stable/v2.40-meson-more-build-options' of https://github.com/jwillikers/util-linux: (21 commits)
  meson: Add build-lsclocks option
  meson: Add build-enosys option
  meson: Define _DARWIN_C_SOURCE on macOS as is done in Autotools
  strutils.h: Include strings.h header for strncasecmp function
  xalloc.h: Include stdio.h header for vasprintf function
  meson: Fix build by default and install behavior for build-pipesz option
  meson: Add build-fadvise option
  meson: Add build-scriptlive option
  meson: Add build-script option
  meson: Require pty for the su and runuser executables
  meson: Add have_pty variable to check if pty is available
  meson: Add build-blockdev option
  meson: Add build-chcpu option
  meson: Use has_type instead of sizeof to detect cpu_set_t type
  meson: Add build-setarch option
  meson: Add build-rtcwake option
  meson: Add build-ldattach option
  meson: Add build-blkdiscard option
  meson: Add build-fsfreeze option
  meson: Add build-blkzone option
  ...

18 months agolastlog2: begin descriptions of options with a lowercase letter
Benno Schulenberg [Tue, 26 Mar 2024 15:48:22 +0000 (16:48 +0100)] 
lastlog2: begin descriptions of options with a lowercase letter

These descriptions are not full sentences and do not end with a period,
so they should not start with a capital either.

18 months agotextual: fix some typos and inconsistencies in usage and error messages
Benno Schulenberg [Tue, 26 Mar 2024 15:48:21 +0000 (16:48 +0100)] 
textual: fix some typos and inconsistencies in usage and error messages

Reported-by: Petr Pisar <petr.pisar@atlas.cz>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
18 months agomeson: Add build-lsclocks option
Jordan Williams [Tue, 23 Apr 2024 12:45:24 +0000 (07:45 -0500)] 
meson: Add build-lsclocks option

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit 5873f36e0ebf40121cbe33e7c632193433b8d085)

18 months agomeson: Add build-enosys option
Jordan Williams [Tue, 23 Apr 2024 12:43:00 +0000 (07:43 -0500)] 
meson: Add build-enosys option

Add a check to ensure that the linux/audit.h header exists for enosys.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit 0f2dd62ed106af8291e91364e992bc9eb65cab55)

18 months agomeson: Define _DARWIN_C_SOURCE on macOS as is done in Autotools
Jordan Williams [Mon, 22 Apr 2024 20:03:50 +0000 (15:03 -0500)] 
meson: Define _DARWIN_C_SOURCE on macOS as is done in Autotools

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit df277231cf9f4dcb98dd16dc77ff5c9d4d0b1452)

18 months agostrutils.h: Include strings.h header for strncasecmp function
Jordan Williams [Mon, 22 Apr 2024 19:51:40 +0000 (14:51 -0500)] 
strutils.h: Include strings.h header for strncasecmp function

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit 42a7b48fd1f3643e962c75a6003a305851064763)

18 months agoxalloc.h: Include stdio.h header for vasprintf function
Jordan Williams [Mon, 22 Apr 2024 19:51:09 +0000 (14:51 -0500)] 
xalloc.h: Include stdio.h header for vasprintf function

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit d4d9744c62bfb4d179473e6adcd304318b4d952f)

18 months agomeson: Fix build by default and install behavior for build-pipesz option
Jordan Williams [Mon, 22 Apr 2024 19:35:50 +0000 (14:35 -0500)] 
meson: Fix build by default and install behavior for build-pipesz option

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit 5cf8a7ac3a8038212c369bf5d05c74516b328a3a)

18 months agomeson: Add build-fadvise option
Jordan Williams [Mon, 22 Apr 2024 19:33:49 +0000 (14:33 -0500)] 
meson: Add build-fadvise option

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit 3ba934c9c411795cca50e55cb3fc1309c3469827)

18 months agomeson: Add build-scriptlive option
Jordan Williams [Mon, 22 Apr 2024 16:08:26 +0000 (11:08 -0500)] 
meson: Add build-scriptlive option

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit 8f6efe8cb65498e9586a7217aac77f25068f770b)

18 months agomeson: Add build-script option
Jordan Williams [Mon, 22 Apr 2024 16:06:48 +0000 (11:06 -0500)] 
meson: Add build-script option

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit 236918fcc6d886270e8585cbc594ac71c24b1951)

18 months agomeson: Require pty for the su and runuser executables
Jordan Williams [Mon, 22 Apr 2024 16:04:36 +0000 (11:04 -0500)] 
meson: Require pty for the su and runuser executables

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit 8c917cf8a054058b261c7b02699b017443dbb501)

18 months agomeson: Add have_pty variable to check if pty is available
Jordan Williams [Mon, 22 Apr 2024 16:02:39 +0000 (11:02 -0500)] 
meson: Add have_pty variable to check if pty is available

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit f71723ef67d4d1ab5762492c4a162498c53e51eb)

18 months agomeson: Add build-blockdev option
Jordan Williams [Mon, 22 Apr 2024 14:42:25 +0000 (09:42 -0500)] 
meson: Add build-blockdev option

Only build blockdev on Linux.
The BLKROSET macro is used in blockdev.c from blkdev.h.
The blkdev.h header only defines this macro when it is missing on Linux.

Add blockdev to the list of executables, which appears to have been
omitted previously.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit 3e6d539e6e283927639c02792c968848f6c7dc71)

18 months agomeson: Add build-chcpu option
Jordan Williams [Mon, 22 Apr 2024 14:14:26 +0000 (09:14 -0500)] 
meson: Add build-chcpu option

The cpu_set_t type does not exist on macOS.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit a2c940f44b2a54deedfc21cc7fd91625dcbacf1a)

18 months agomeson: Use has_type instead of sizeof to detect cpu_set_t type
Jordan Williams [Mon, 22 Apr 2024 14:28:04 +0000 (09:28 -0500)] 
meson: Use has_type instead of sizeof to detect cpu_set_t type

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit fa3bce7e0025fb921a8d05ac26288e687cd1bec5)

18 months agomeson: Add build-setarch option
Jordan Williams [Tue, 23 Apr 2024 13:39:12 +0000 (08:39 -0500)] 
meson: Add build-setarch option

The sys/personality.h header does not exist on macOS.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit 17146fbf1bb4c93db53bd741f1484327c729631d)

18 months agomeson: Add build-rtcwake option
Jordan Williams [Mon, 22 Apr 2024 14:03:52 +0000 (09:03 -0500)] 
meson: Add build-rtcwake option

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit fa907a8810d9a0e7049a01828e2dd0d53567cf0a)

18 months agomeson: Add build-ldattach option
Jordan Williams [Mon, 22 Apr 2024 13:57:40 +0000 (08:57 -0500)] 
meson: Add build-ldattach option

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit 75637b8813f593225fa69b4f963c9bfd16daefc9)

18 months agomeson: Add build-blkdiscard option
Jordan Williams [Wed, 24 Apr 2024 20:30:26 +0000 (15:30 -0500)] 
meson: Add build-blkdiscard option

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit 9c4ef6f71169c48cee60523d851ff0b453a1d52f)

18 months agomeson: Add build-fsfreeze option
Jordan Williams [Wed, 24 Apr 2024 20:29:08 +0000 (15:29 -0500)] 
meson: Add build-fsfreeze option

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit 6549a90cb9d3f6c0a4a3fc7e87536b5e4690517a)

18 months agomeson: Add build-blkzone option
Jordan Williams [Mon, 22 Apr 2024 13:48:27 +0000 (08:48 -0500)] 
meson: Add build-blkzone option

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit ca42082d60de44534836571e109e14f3a47fcb61)

18 months agomeson: Add build-blkpr option
Jordan Williams [Mon, 22 Apr 2024 13:46:55 +0000 (08:46 -0500)] 
meson: Add build-blkpr option

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit cd8fd8a1e23b39f6cb069a4829cf2ecc497c8e1c)

18 months agodocs: fix GPL name typo
Karel Zak [Wed, 24 Apr 2024 10:05:25 +0000 (12:05 +0200)] 
docs: fix GPL name typo

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

18 months agolsfd: (man) fix license name
Jakub Wilk [Mon, 22 Apr 2024 13:52:04 +0000 (15:52 +0200)] 
lsfd: (man) fix license name

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
(cherry picked from commit d2dc150fe502a5bd8fa6f1a4a7c4c08bacfe4ca8)

18 months agolsns: fix netns use
Karel Zak [Mon, 22 Apr 2024 12:28:52 +0000 (14:28 +0200)] 
lsns: fix netns use

 # ip netns add vpn
 # lsns -T -t net
 Segmentation fault (core dumped)

The function interpolate_missing_namespaces() reads data from /proc.
However, in the case of a persistent namespace, there is no procfs
entry for the namespace. Therefore, this function should ignore it.

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

18 months agolibmount: fix comment typo for mnt_fs_get_comment()
Tianjia Zhang [Mon, 22 Apr 2024 06:01:25 +0000 (14:01 +0800)] 
libmount: fix comment typo for mnt_fs_get_comment()

Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
(cherry picked from commit c630dbc38f7cd1f838e65e2c43d8375bce1ec20f)

18 months agolibmount: Fix access check for utab in context
Karel Zak [Mon, 22 Apr 2024 11:09:04 +0000 (13:09 +0200)] 
libmount: Fix access check for utab in context

The function mnt_has_regular_utab() properly detects that the utab is
not writable, but this is ignored by the high-level context API. As a
result, the library later attempts to update the file and ends up with
a warning in mount(8):

 $ mkdir sys
 $ unshare --map-root-user --mount
 $ mount --rbind /sys sys
 $ umount --lazy sys; echo $?
 umount: /home/user/sys: filesystem was unmounted, but failed to update userspace mount table.
 16

In this case, the utab should be ignored.

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

18 months agomeson: Add build-dmesg option
Jordan Williams [Wed, 17 Apr 2024 16:13:59 +0000 (11:13 -0500)] 
meson: Add build-dmesg option

Require the sys/klog.h header to exist in order to enable the feature.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit 73f3e2ad6e00c93e9a0c7ed8bdb4eb63ac5ebdad)

18 months agolsblk: simplify SOURCES code
Karel Zak [Mon, 22 Apr 2024 09:51:56 +0000 (11:51 +0200)] 
lsblk: simplify SOURCES code

This complicated implementation originated from an early version of
zero-separated items for libsmartcols. It is no longer necessary.

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

18 months agofindmnt: always zero-terminate SOURCES data
Thomas Weißschuh [Sun, 21 Apr 2024 18:00:31 +0000 (20:00 +0200)] 
findmnt: always zero-terminate SOURCES data

libsmartcols expects it's data fields to be zero terminated.
See the call to strlen() in scols_column_greatest_wrap().
ul_buffer however does not guarantee that termination,
ul_buffer_append_strings() discard the zero-termination.

Always zero-terminate in get_data_col_sources() and drop the now
unnecessary variable "i".

Closes: https://github.com/util-linux/util-linux/issues/2980
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
(cherry picked from commit 6594679e9af805075c282da35b1b2a8d767e403b)

18 months agoagetty: Don't override TERM passed by the user
Daan De Meyer [Fri, 19 Apr 2024 18:07:47 +0000 (20:07 +0200)] 
agetty: Don't override TERM passed by the user

Before 4869b259d68f65ea88df625ce8df9c0177d55a01, any TERM passed
on the agetty command line would be used instead of the default TERM.
After 4869b259d68f65ea88df625ce8df9c0177d55a01, the default TERM is
used unconditionally.

Fix the regression by checking if the user passed a custom TERM.

Fixes: 4869b259d68f65ea88df625ce8df9c0177d55a01
(cherry picked from commit af354e92111769d57e43eb4f1825c0d99c894ddb)

18 months agoMerge branch 'stable/2.40-meson-fix-build-ipcrm-option' of https://github.com/jwillik...
Karel Zak [Mon, 22 Apr 2024 10:06:37 +0000 (12:06 +0200)] 
Merge branch 'stable/2.40-meson-fix-build-ipcrm-option' of https://github.com/jwillikers/util-linux into stable/v2.40

* 'stable/2.40-meson-fix-build-ipcrm-option' of https://github.com/jwillikers/util-linux:
  meson: Require the seminfo type for ipcmk, ipcrm, and ipcs
  meson: Add build-ipcmk option
  meson: Add missing check for build-ipcrm option

18 months agotests: (lsns::ioctl_ns) add more debug print
Masatake YAMATO [Tue, 16 Apr 2024 22:49:40 +0000 (07:49 +0900)] 
tests: (lsns::ioctl_ns) add more debug print

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
18 months agotests: (lsns::ioctl_ns) record stdout/stderr for debugging the case
Masatake YAMATO [Tue, 16 Apr 2024 20:57:45 +0000 (05:57 +0900)] 
tests: (lsns::ioctl_ns) record stdout/stderr for debugging the case

When the test case runs successfully, we expect the case test prints
nothing to stderr. If something is printed to stderr, it helps us
debug lsns command and the test case.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
18 months agomeson: Require the seminfo type for ipcmk, ipcrm, and ipcs
Jordan Williams [Wed, 17 Apr 2024 16:56:09 +0000 (11:56 -0500)] 
meson: Require the seminfo type for ipcmk, ipcrm, and ipcs

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit 023950b1b623e6c3598d244a5569eeb0d5141237)

18 months agomeson: Add build-ipcmk option
Jordan Williams [Wed, 17 Apr 2024 16:37:04 +0000 (11:37 -0500)] 
meson: Add build-ipcmk option

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit 0b91fd9f45bbdb0ed792f2535b8b95b965e8a176)

18 months agomeson: Add missing check for build-ipcrm option
Jordan Williams [Wed, 17 Apr 2024 16:11:21 +0000 (11:11 -0500)] 
meson: Add missing check for build-ipcrm option

The build-ipcrm option exists in meson_options.txt but has no effect.
Use the option to gate building the ipcrm executable.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit 25c9b3b4d849f6211ccb668932f0f8823286cd7d)

18 months agoall_syscalls: use sed to extract defines from headers
Thomas Weißschuh [Tue, 16 Apr 2024 19:56:22 +0000 (21:56 +0200)] 
all_syscalls: use sed to extract defines from headers

Posix-compliant awk does not seem capable of matching lines and
extracting capture groups of them.
Use sed instead.

Reported-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Link: https://lore.kernel.org/util-linux/051624b9256db27a731d62c031cb627d9f5a256e.camel@physik.fu-berlin.de/
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
(cherry picked from commit 7e8bf34a2a54b639d95c51a4a0368b0c9578d612)

18 months agoall_syscalls: don't hardcode AWK invocation
Thomas Weißschuh [Tue, 16 Apr 2024 07:26:22 +0000 (09:26 +0200)] 
all_syscalls: don't hardcode AWK invocation

Use the buildsystem to find a usable awk implementation and use that.

Reported-by: Firas Khalil Khana <firasuke@gmail.com>
Link: https://github.com/util-linux/util-linux/pull/2949
Reported-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
https://lore.kernel.org/util-linux/31ccace2e5912ffc428e065cd66764088c625c4d.camel@physik.fu-berlin.de/
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
(cherry picked from commit 543f991f62659b9a3ff67f9cda3456b2a5bb3f98)

18 months agoall_syscalls: don't warn during cleanup
Thomas Weißschuh [Tue, 16 Apr 2024 07:14:28 +0000 (09:14 +0200)] 
all_syscalls: don't warn during cleanup

On failure the output files may not have been created.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
(cherry picked from commit 4d5441ec53337edae2b9f7deef0e21d700c06b4d)

18 months agoall_syscalls: fail if any step fails
Thomas Weißschuh [Tue, 16 Apr 2024 07:00:41 +0000 (09:00 +0200)] 
all_syscalls: fail if any step fails

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
(cherry picked from commit 7522d8df797c9ed813b9f75050e25becdcb4a25b)

18 months agolibsmartcols: reset wrap after calculation
Karel Zak [Tue, 16 Apr 2024 08:49:31 +0000 (10:49 +0200)] 
libsmartcols: reset wrap after calculation

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

18 months agoMerge branch 'lslocks--no-sleep-in-test-case-for-stable' of https://github.com/masata...
Karel Zak [Wed, 17 Apr 2024 07:49:40 +0000 (09:49 +0200)] 
Merge branch 'lslocks--no-sleep-in-test-case-for-stable' of https://github.com/masatake/util-linux into stable/v2.40

* 'lslocks--no-sleep-in-test-case-for-stable' of https://github.com/masatake/util-linux:
  lslocks: remove a unused local variable
  lslocks: don't abort gathering per-process information even if opening a /proc/[0-9]* fails

18 months agolslocks: remove a unused local variable
Masatake YAMATO [Fri, 12 Apr 2024 19:13:03 +0000 (04:13 +0900)] 
lslocks: remove a unused local variable

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

18 months agolslocks: don't abort gathering per-process information even if opening a /proc/[0...
Masatake YAMATO [Fri, 12 Apr 2024 18:59:39 +0000 (03:59 +0900)] 
lslocks: don't abort gathering per-process information even if opening a /proc/[0-9]* fails

If a process ($pid) taking a lock is gone while running lslocks,
gathering per-process information for the process may fail in opening
/proc/$pid. Though lslocks should work with incomplete information,
the original code stopped gathering per-process information for the
other processes.

As a result of the original behavior, tests/ts/lslocks/lslocks really
failed in an environment where multiple test cases ran simultaneously.

Close #2624 again.
See also #2633.

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

18 months agomeson: Remove lingering mq_libs variable
Jordan Williams [Tue, 16 Apr 2024 15:30:42 +0000 (10:30 -0500)] 
meson: Remove lingering mq_libs variable

The cherry-pick of #2879 in PR #2941 to the stable/v2.40 branch didn't
include the removal of mq_libs like it should have.
I must have resolved a conflict incorrectly in the cherry-pick.
This just removes the lingering definitions which are no longer used.
The extra find_library call for rt is a problem.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
18 months agoMerge branch 'stable/meson-version-script-libblkid' of https://github.com/jwillikers...
Karel Zak [Tue, 16 Apr 2024 09:08:50 +0000 (11:08 +0200)] 
Merge branch 'stable/meson-version-script-libblkid' of https://github.com/jwillikers/util-linux into stable/v2.40

* 'stable/meson-version-script-libblkid' of https://github.com/jwillikers/util-linux:
  meson: Only use the --version-script linker flag where it is supported

18 months agoMerge branch 'stable/optional-libmount' of https://github.com/jwillikers/util-linux...
Karel Zak [Tue, 16 Apr 2024 09:07:35 +0000 (11:07 +0200)] 
Merge branch 'stable/optional-libmount' of https://github.com/jwillikers/util-linux into stable/v2.40

* 'stable/optional-libmount' of https://github.com/jwillikers/util-linux:
  meson: Remove libblkid dependency on libmount
  meson: Only build libmount when required
  meson: Use libblkid as a dependency
  meson: Use libmount as a dependency

18 months agolsns: tolerate lsns_ioctl(fd, NS_GET_{PARENT,USERNS}) failing with ENOSYS
Masatake YAMATO [Sat, 13 Apr 2024 16:40:14 +0000 (01:40 +0900)] 
lsns: tolerate lsns_ioctl(fd, NS_GET_{PARENT,USERNS}) failing with ENOSYS

With the original code, "lsns/filedesc" test case failed on
"build (qemu-user, s390x)" and "build (qemu-user, riscv64)".

On the platforms, lsns_ioctl(fd, NS_GET_{PARENT,USERNS}) failed
with ENOSYS. The error stoped the iteration for gathering
information from /proc/[0-9]+. As a result, lsns printed
nothing. We don't expect this behavior.

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

18 months agolsns: report with warnx if a namespace related ioctl fails with ENOSYS
Masatake YAMATO [Sun, 14 Apr 2024 16:44:38 +0000 (01:44 +0900)] 
lsns: report with warnx if a namespace related ioctl fails with ENOSYS

Qemu userspace emulation reports ENOSYS if it doesn't support a given
ioctl command.

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

18 months agoFix misplaced else in mnt_update_already_done
Gavin Lloyd [Wed, 10 Apr 2024 00:38:02 +0000 (17:38 -0700)] 
Fix misplaced else in mnt_update_already_done

See 477401f0de

(cherry picked from commit 6b316e0c9f1feb61bef3bb14b1356be8fbefcc17)

18 months agoRevert "lib/pager: Apply pager-specific fixes only when needed"
Thomas Weißschuh [Sat, 13 Apr 2024 07:42:39 +0000 (09:42 +0200)] 
Revert "lib/pager: Apply pager-specific fixes only when needed"

Less is not always detectable, as it can be hidden behind symlinks or
wrapper as for example in a default Debian installation.
Also testing for the literal string "less" does not match full path
specifications like "/usr/bin/less".

Instead always apply the fixes.

This reverts commit c10ad975895372122f72c8d9da089b6ea69f778b.
Closes #2951
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
(cherry picked from commit 966cb1382b59a9c1d5735b47aba27050c6d5c7e5)

18 months agomeson: Remove libblkid dependency on libmount
Jordan Williams [Mon, 8 Apr 2024 16:37:01 +0000 (11:37 -0500)] 
meson: Remove libblkid dependency on libmount

I added this incorrect dependency between libblkid and libmount.
The option to build libblkid should be allowed whether or not the
build-libmount feature is allowed.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit efce415c094e7daf2b0781c70129b4f0f05120d4)

18 months agomeson: Only build libmount when required
Jordan Williams [Fri, 5 Apr 2024 14:49:17 +0000 (07:49 -0700)] 
meson: Only build libmount when required

It is not currently possible to build any part of util-linux without
building libmount when using Meson.
The libuuid library is commonly used on macOS, where it is not possible
to build libmount.
To address this, this PR makes it possible to build without libmount and
 libblkid.

Options have been added to allow toggling whether to build targets that
require libmount.
This makes it possible to fully disable building libmount.

The python object had to be defined outside of the meson.build file in
libmount/python since this may no longer be included.
The python object is used for tests.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit b6799ccbc08aea69a26cdaa97ab436bfae2ae27f)

18 months agomeson: Use libblkid as a dependency
Jordan Williams [Mon, 15 Apr 2024 13:02:05 +0000 (08:02 -0500)] 
meson: Use libblkid as a dependency

Several utilities depend on libblkid internally.
Currently, link_with and global include directories are used to
associate targets with libblkid.
This PR uses Meson's dependencies argument for targets to define this
relationship instead.
This carries include directories along with the library to link.

An additional dependency is declared for the static libblkid library.
A couple of executables use this dependency explicitly.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit a764efb5fb14b9a66bff8807c04ddcebc51939ea)

18 months agomeson: Use libmount as a dependency
Jordan Williams [Fri, 5 Apr 2024 15:33:22 +0000 (08:33 -0700)] 
meson: Use libmount as a dependency

Several utilities depend on libmount internally.
Currently, link_with and global include directories are used to
associate targets with libmount.
This PR uses Meson's dependencies argument for targets to define this
relationship instead.
This carries include directories along with the library to link.

An additional dependency is declared for the static libmount library.
A couple of executables use this dependency explicitly.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit c43b185a3feb8cd7261c94f42a566486ce2c0438)

18 months agomeson: Only use the --version-script linker flag where it is supported
Jordan Williams [Mon, 8 Apr 2024 17:02:52 +0000 (12:02 -0500)] 
meson: Only use the --version-script linker flag where it is supported

macOS does not support the --version-script linker flag.
Only use it if it is available.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit 21da737099626a5cf00e1e0719ed2262aae6e2ea)

18 months agoMerge branch 'stable-meson-optional-rt' of https://github.com/jwillikers/util-linux...
Karel Zak [Mon, 15 Apr 2024 07:16:40 +0000 (09:16 +0200)] 
Merge branch 'stable-meson-optional-rt' of https://github.com/jwillikers/util-linux into stable/v2.40

* 'stable-meson-optional-rt' of https://github.com/jwillikers/util-linux:
  meson: Only pick up the rt library once
  meson: Add build-lsfd option and make rt dependency optional

18 months agomeson: Only pick up the rt library once
Jordan Williams [Mon, 1 Apr 2024 17:18:52 +0000 (12:18 -0500)] 
meson: Only pick up the rt library once

Require the rt library for the build-lsfd feature.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit 243950279f413e3844d13a2d87b3853c1242f437)

18 months agomeson: Add build-lsfd option and make rt dependency optional
Jordan Williams [Tue, 9 Apr 2024 21:58:27 +0000 (16:58 -0500)] 
meson: Add build-lsfd option and make rt dependency optional

A dependency on the rt library is unnecessarily required when checking
for the clock_gettime and timer_create functions.
This causes the build to fail if the rt library is not found.
This should not fail the build as rt is only required for the checks.
Additionally, the lsfd executable and some tests require rt.
There is currently no option to toggle building lsfd.

This PR makes it possible to build without the rt library.
Function checks no longer require rt for the build.
The function checks for the rt library only run when rt is available.
This PR adds an option to allow building without lsfd.
This makes it possible to build without the executable that requires rt.
To not require rt for the test, a additional check has been added.
The effected tests won't be built unless rt has been found.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit 06b27058a04c1ac9eba44f19e320ecd862f6d75f)

18 months agofindmnt: revise the code for -I and -D option
Masatake YAMATO [Fri, 5 Apr 2024 13:40:36 +0000 (22:40 +0900)] 
findmnt: revise the code for -I and -D option

Fixes #2913.

3dd79293b5b655da9d913dedd8facb08959a7826 added -I option.
However, the code used bit flags (FL_DF and FL_DF_INODES) wrongly;
the code broke the output of -D option.

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

19 months agoMerge branch 'lsfd--verify-proc-syscall' of https://github.com/masatake/util-linux...
Karel Zak [Mon, 8 Apr 2024 07:36:51 +0000 (09:36 +0200)] 
Merge branch 'lsfd--verify-proc-syscall' of https://github.com/masatake/util-linux into stable/v2.40

* 'lsfd--verify-proc-syscall' of https://github.com/masatake/util-linux:
  tests: (lsfd::mkfds-multiplexing) skip if /proc/$pid/syscall is broken

19 months agoMerge branch 'lsfd--debug-endpoint' of https://github.com/masatake/util-linux into...
Karel Zak [Fri, 5 Apr 2024 08:55:21 +0000 (10:55 +0200)] 
Merge branch 'lsfd--debug-endpoint' of https://github.com/masatake/util-linux into stable/v2.40

* 'lsfd--debug-endpoint' of https://github.com/masatake/util-linux:
  tests: (test_mkfds::sockdiag) verify the recieved message to detect whether the socket is usable or not
  lsfd: add LSFD_DEBUG env var for debugging

19 months agolibblkid: topology/ioctl: simplify ioctl handling
Thomas Weißschuh [Thu, 4 Apr 2024 05:24:58 +0000 (07:24 +0200)] 
libblkid: topology/ioctl: simplify ioctl handling

Coverity complains about the data copy within the union.
Instead unroll the loop which is less code and easier to follow.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
(cherry picked from commit 2ab95860db0b7423906911b8b9e9f231332c2c11)

19 months agotests: (lsfd::mkfds-multiplexing) skip if /proc/$pid/syscall is broken
Masatake YAMATO [Thu, 4 Apr 2024 19:00:45 +0000 (04:00 +0900)] 
tests: (lsfd::mkfds-multiplexing) skip if /proc/$pid/syscall is broken

Close #2867
Close #2887

We should skip the test case on the platforms where /proc/$pid/syscall
doesn't report correct system call number. On such platforms,

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
19 months agolibblkid: topology/ioctl: correctly handle kernel types
Thomas Weißschuh [Tue, 2 Apr 2024 16:55:29 +0000 (18:55 +0200)] 
libblkid: topology/ioctl: correctly handle kernel types

Commit 5d71d711d07a ("libblkid: topolicy/ioctl: use union for multiple data types")
incorrectly assumed that set_ulong and set_int refer to the type
returned by the kernel. Instead the different function pointer names
refer to the types of the function pointers.
However all ioctls, except for the later added BLKGETDISKSEQ, return
32bit integers.
This made libblkid also interpret the upper 32bits too, leading to
garbage values.

Introduce a new member 'kernel_size' to also handle the 64bit
BLKGETDISKSEQ.

Drop data.ul as it is no actually used.

Closes #2904
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
(cherry picked from commit a10081a52c48a5232db30d8e0a7a7570cc8163ae)

19 months agotests: (test_mkfds::sockdiag) verify the recieved message to detect whether the socke...
Masatake YAMATO [Mon, 1 Apr 2024 21:34:40 +0000 (06:34 +0900)] 
tests: (test_mkfds::sockdiag) verify the recieved message to detect whether the socket is usable or not

Close #2822.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
19 months agolsfd: add LSFD_DEBUG env var for debugging
Masatake YAMATO [Sat, 30 Mar 2024 09:47:03 +0000 (18:47 +0900)] 
lsfd: add LSFD_DEBUG env var for debugging

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
19 months agomeson: Only require the crypt library when necessary
Jordan Williams [Fri, 29 Mar 2024 15:31:27 +0000 (10:31 -0500)] 
meson: Only require the crypt library when necessary

The `crypt` library is only necessary for two executables.
These are build-newgrp and build-sulogin.
Don't otherwise require this dependency.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit d0a07e7fb8109e9fdeb5e2c90c019c0cf5f92009)

19 months agomeson: Fix false positive detection of mempcpy on macOS
Jordan Williams [Fri, 29 Mar 2024 19:00:01 +0000 (14:00 -0500)] 
meson: Fix false positive detection of mempcpy on macOS

The has_function check incorrectly detects mempcpy on macOS.
This function is not available on macOS and should not be detected.
Likely, this has to do with Meson's detection of compiler built-ins.
Using a specific prefix and defining _GNU_SOURCE fixes the detection.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit 2c5a42b3cbf278461a12872ce7a944ad396d47b5)

19 months agopam_lastlog2: link against liblastlog
Thomas Weißschuh [Mon, 1 Apr 2024 20:53:32 +0000 (22:53 +0200)] 
pam_lastlog2: link against liblastlog

While at it also drop the duplicated include path.

Fixes #2897
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
(cherry picked from commit 2722b40012740372daf3585b7c071fcbede13359)

19 months agolibblkid: Fix segfault when blkid.conf doesn't exist
Karel Zak [Mon, 1 Apr 2024 10:14:50 +0000 (12:14 +0200)] 
libblkid: Fix segfault when blkid.conf doesn't exist

* Move 'line' and 'uevent' to the beginning of the LIBECONF code.
* Remove unwanted space between function name and arguments.
* Check for 'line' pointer before dereferencing.

References: https://github.com/util-linux/util-linux/pull/2883
Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit 7e357241b413a01c37b0b4d064bc0a47e3259361)

19 months agomeson: respect c_args/CFLAGS when generating syscalls
Karel Zak [Tue, 2 Apr 2024 06:39:40 +0000 (08:39 +0200)] 
meson: respect c_args/CFLAGS when generating syscalls

References: http://github.com/util-linux/util-linux/commit/8e7f14391bab98b3ce83a2df27ebbf76c1b5a9fc
Signed-off-by: Karel Zak <kzak@redhat.com>
19 months agoautotools: distribute pam_lastlog2/meson.build
Thomas Weißschuh [Sat, 30 Mar 2024 16:46:19 +0000 (17:46 +0100)] 
autotools: distribute pam_lastlog2/meson.build

Otherwise building the dist tarball via meson doesn't work.

Fixes #2875
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
(cherry picked from commit f016443026af3dfafbb7b5a8c65c37768a9df182)

19 months agomeson: Don't define HAVE_ENVIRON_DECL when environ is unavailable
Jordan Williams [Fri, 29 Mar 2024 21:56:43 +0000 (16:56 -0500)] 
meson: Don't define HAVE_ENVIRON_DECL when environ is unavailable

HAVE_ENVIRON_DECL is being defined to 0 by cfg_data.set10().
The code only checks whether or not is defined.
This leads to it not being declared appropriately.
Use cfg_data.set() instead of cfg_data.set10() to define it when true.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit 640754e29475a22fb19082dbd5cd587edc05e4b7)

19 months agolibuuid: (man) fix function declarations
CismonX [Thu, 28 Mar 2024 23:26:35 +0000 (07:26 +0800)] 
libuuid: (man) fix function declarations

19 months agodocs: add COPYING.MIT
Karel Zak [Mon, 1 Apr 2024 10:04:47 +0000 (12:04 +0200)] 
docs: add COPYING.MIT

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

19 months agoREADME.licensing/flock: Add MIT license mention
Richard Purdie [Thu, 28 Mar 2024 12:16:57 +0000 (12:16 +0000)] 
README.licensing/flock: Add MIT license mention

Looking at the license text, flock.c is under the MIT license (see
https://spdx.org/licenses/MIT).

Add an SPDX license identifier header and add to the list of licenses the
source so everything is correctly listed/identified.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 5b8fab1584017d9d9be008c23b90128bba41a7b5)

19 months agobuild-sys: release++ (v2.40) v2.40
Karel Zak [Wed, 27 Mar 2024 11:46:59 +0000 (12:46 +0100)] 
build-sys: release++ (v2.40)

Signed-off-by: Karel Zak <kzak@redhat.com>
19 months agodocs: update v2.40-ReleaseNotes
Karel Zak [Wed, 27 Mar 2024 11:43:32 +0000 (12:43 +0100)] 
docs: update v2.40-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
19 months agowall: fix escape sequence Injection [CVE-2024-28085]
Karel Zak [Thu, 21 Mar 2024 10:16:20 +0000 (11:16 +0100)] 
wall: fix escape sequence Injection [CVE-2024-28085]

Let's use for all cases the same output function.

Reported-by: Skyler Ferrante <sjf5462@rit.edu>
Signed-off-by: Karel Zak <kzak@redhat.com>
19 months agodocs: update AUTHORS file
Karel Zak [Wed, 27 Mar 2024 11:16:05 +0000 (12:16 +0100)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
19 months agopo-man: merge changes
Karel Zak [Wed, 27 Mar 2024 11:12:37 +0000 (12:12 +0100)] 
po-man: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
19 months agopo: merge changes
Karel Zak [Wed, 27 Mar 2024 11:12:31 +0000 (12:12 +0100)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
19 months agopo-man: update uk.po (from translationproject.org)
Yuri Chornoivan [Wed, 27 Mar 2024 11:10:03 +0000 (12:10 +0100)] 
po-man: update uk.po (from translationproject.org)

19 months agopo-man: update ro.po (from translationproject.org)
Remus-Gabriel Chelu [Wed, 27 Mar 2024 11:10:03 +0000 (12:10 +0100)] 
po-man: update ro.po (from translationproject.org)

19 months agopo-man: update de.po (from translationproject.org)
Mario Blättermann [Wed, 27 Mar 2024 11:10:03 +0000 (12:10 +0100)] 
po-man: update de.po (from translationproject.org)

19 months agopo: update uk.po (from translationproject.org)
Yuri Chornoivan [Wed, 27 Mar 2024 11:08:32 +0000 (12:08 +0100)] 
po: update uk.po (from translationproject.org)

19 months agopo: update ro.po (from translationproject.org)
Remus-Gabriel Chelu [Wed, 27 Mar 2024 11:08:32 +0000 (12:08 +0100)] 
po: update ro.po (from translationproject.org)