]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
16 months agoMerge branch 'add_eupl' of https://github.com/ThijsRay/util-linux
Karel Zak [Thu, 23 May 2024 08:52:45 +0000 (10:52 +0200)] 
Merge branch 'add_eupl' of https://github.com/ThijsRay/util-linux

* 'add_eupl' of https://github.com/ThijsRay/util-linux:
  docs: add European Public License v1.2

16 months agoMerge branch 'coresched_bash_completions' of https://github.com/ThijsRay/util-linux
Karel Zak [Thu, 23 May 2024 08:52:14 +0000 (10:52 +0200)] 
Merge branch 'coresched_bash_completions' of https://github.com/ThijsRay/util-linux

* 'coresched_bash_completions' of https://github.com/ThijsRay/util-linux:
  coresched: add bash completions

16 months agolibuuid: link test_uuid_time with pthread
Thomas Weißschuh [Wed, 22 May 2024 15:10:26 +0000 (17:10 +0200)] 
libuuid: link test_uuid_time with pthread

Since commit a3f1255f1891 ("libuuid: clear uuidd cache on fork()")
compilation of gen_uuid.c requires libpthreads.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
16 months agocoresched: add bash completions
Thijs Raymakers [Wed, 22 May 2024 14:24:01 +0000 (16:24 +0200)] 
coresched: add bash completions

Signed-off-by: Thijs Raymakers <thijs@raymakers.nl>
16 months agodocs: add European Public License v1.2
Thijs Raymakers [Wed, 22 May 2024 11:38:18 +0000 (13:38 +0200)] 
docs: add European Public License v1.2

schedutils/coresched is licensed under the EUPL 1.2.

Signed-off-by: Thijs Raymakers <thijs@raymakers.nl>
16 months agoMerge branch 'libuuid/coverity' of https://github.com/t-8ch/util-linux
Karel Zak [Wed, 22 May 2024 10:14:43 +0000 (12:14 +0200)] 
Merge branch 'libuuid/coverity' of https://github.com/t-8ch/util-linux

* 'libuuid/coverity' of https://github.com/t-8ch/util-linux:
  libuuid: construct UUIDv7 without "struct uuid"
  libuuid: construct UUIDv6 without "struct uuid"
  libuuid: add helper to set version and variant in uuid_t

16 months agoMerge branch 'clang-17' of https://github.com/nvinson/util-linux
Karel Zak [Wed, 22 May 2024 10:13:23 +0000 (12:13 +0200)] 
Merge branch 'clang-17' of https://github.com/nvinson/util-linux

* 'clang-17' of https://github.com/nvinson/util-linux:
  Conditionally add uuid_time64 to sym. version map

16 months agoMerge branch 'libuuid/fork' of https://github.com/t-8ch/util-linux
Karel Zak [Wed, 22 May 2024 10:12:34 +0000 (12:12 +0200)] 
Merge branch 'libuuid/fork' of https://github.com/t-8ch/util-linux

* 'libuuid/fork' of https://github.com/t-8ch/util-linux:
  libuuid: clear uuidd cache on fork()
  libuuid: split uuidd cache into dedicated struct
  libuuid: drop check for HAVE_TLS

16 months agoMerge branch 'patch-1' of https://github.com/strongtz/util-linux
Karel Zak [Wed, 22 May 2024 10:11:00 +0000 (12:11 +0200)] 
Merge branch 'patch-1' of https://github.com/strongtz/util-linux

* 'patch-1' of https://github.com/strongtz/util-linux:
  Add Qualcomm Oryon ARM core

16 months agoMerge branch 'libuuid/time-tests' of https://github.com/t-8ch/util-linux
Karel Zak [Wed, 22 May 2024 10:10:37 +0000 (12:10 +0200)] 
Merge branch 'libuuid/time-tests' of https://github.com/t-8ch/util-linux

* 'libuuid/time-tests' of https://github.com/t-8ch/util-linux:
  libuuid: test time-based UUID generation

16 months agoMerge branch 'master' of https://github.com/ffontaine/util-linux
Karel Zak [Wed, 22 May 2024 10:09:31 +0000 (12:09 +0200)] 
Merge branch 'master' of https://github.com/ffontaine/util-linux

* 'master' of https://github.com/ffontaine/util-linux:
  sys-utils/setarch.c: fix build with uclibc-ng < 1.0.39

16 months agoMerge branch 'PR/libsmartcols-fix-stages' of github.com:karelzak/util-linux-work
Karel Zak [Wed, 22 May 2024 10:08:50 +0000 (12:08 +0200)] 
Merge branch 'PR/libsmartcols-fix-stages' of github.com:karelzak/util-linux-work

* 'PR/libsmartcols-fix-stages' of github.com:karelzak/util-linux-work:
  libsmartcols: fix reduction stages use

16 months agoMerge branch 'PR/hardlink-trees-prio' of github.com:karelzak/util-linux-work
Karel Zak [Wed, 22 May 2024 10:08:13 +0000 (12:08 +0200)] 
Merge branch 'PR/hardlink-trees-prio' of github.com:karelzak/util-linux-work

* 'PR/hardlink-trees-prio' of github.com:karelzak/util-linux-work:
  hardlink: add --prioritize-trees

16 months agofdisk: fix typos
Karel Zak [Wed, 22 May 2024 10:02:56 +0000 (12:02 +0200)] 
fdisk: fix typos

Adresses: https://github.com/util-linux/util-linux/issues/2804
Signed-off-by: Karel Zak <kzak@redhat.com>
16 months agolibuuid: construct UUIDv7 without "struct uuid"
Thomas Weißschuh [Tue, 21 May 2024 16:44:19 +0000 (18:44 +0200)] 
libuuid: construct UUIDv7 without "struct uuid"

The layout of "struct uuid" is specific to UUIDv1.
Using it for UUIDv7 makes the logic complicated and confuses Coverity.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
16 months agolibuuid: construct UUIDv6 without "struct uuid"
Thomas Weißschuh [Tue, 21 May 2024 16:43:36 +0000 (18:43 +0200)] 
libuuid: construct UUIDv6 without "struct uuid"

The layout of "struct uuid" is specific to UUIDv1.
Using it for UUIDv6 makes the logic complicated and confuses Coverity.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
16 months agolibuuid: add helper to set version and variant in uuid_t
Thomas Weißschuh [Tue, 21 May 2024 16:41:59 +0000 (18:41 +0200)] 
libuuid: add helper to set version and variant in uuid_t

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
16 months agoAdd Qualcomm Oryon ARM core
Sophon [Tue, 21 May 2024 07:42:17 +0000 (15:42 +0800)] 
Add Qualcomm Oryon ARM core

Adding core information for Oryon found in Qualcomm Snapdragon X series SoCs

17 months agolibuuid: test time-based UUID generation
Thomas Weißschuh [Thu, 16 May 2024 17:05:01 +0000 (19:05 +0200)] 
libuuid: test time-based UUID generation

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
17 months agoConditionally add uuid_time64 to sym. version map
Nicholas Vinson [Wed, 15 May 2024 15:14:54 +0000 (11:14 -0400)] 
Conditionally add uuid_time64 to sym. version map

The symbol uuid_time64 is conditionally defined. It only exists on
32-bit platforms that use the glibc library and enable support for
the 64-bit time_t type.

For all other platforms, the symbol is undefined. As a result, when
ld.lld version 17 or newer is used with default flags, ld.lld will
reject the symbol map with the error:

    version script assignment of 'UUID_2.40' to symbol 'uuid_time64'
    failed: symbol not defined

To fix this issue, the reference to uuid_time64 is changed to
uuid_time64*. The change to a glob pattern satisifies ld.lld and allows
the library to link.

fixes util-linux/util-linux#3036
fixes Gentoo bug #931328

Signed-off-by: Nicholas Vinson <nvinson234@gmail.com>
17 months agosys-utils/setarch.c: fix build with uclibc-ng < 1.0.39
Fabrice Fontaine [Wed, 15 May 2024 16:22:11 +0000 (18:22 +0200)] 
sys-utils/setarch.c: fix build with uclibc-ng < 1.0.39

Fix the following build failure with uclibc-ng < 1.0.39 (i.e., without
https://github.com/wbx-github/uclibc-ng/commit/85ac4f04d94e98389a8315e720630d0f95bfdfd6)
raised since version 2.39 and
https://github.com/util-linux/util-linux/commit/03a254f010b08da1175f50a8ae7882e59228f1b4:

sys-utils/setarch.c:106:7: error: 'PER_LINUX32_3GB' undeclared here (not in a function); did you mean 'PER_LINUX32'?
  106 |     X(PER_LINUX32_3GB) \
      |       ^~~~~~~~~~~~~~~

Fixes:
 - http://autobuild.buildroot.org/results/fb1feb47f2660882fa53f66bacc63e191fd52175

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
17 months agolibsmartcols: fix reduction stages use
Karel Zak [Wed, 15 May 2024 13:45:19 +0000 (15:45 +0200)] 
libsmartcols: fix reduction stages use

There is no proper check for the number of reduction stages, so in
some cases, the code can loop indefinitely.

The patch also fixes 'rc' variable shadowing.

Fixes: https://github.com/util-linux/util-linux/issues/3046
Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agohardlink: add --prioritize-trees
Karel Zak [Wed, 15 May 2024 13:25:35 +0000 (15:25 +0200)] 
hardlink: add --prioritize-trees

Based on patch from discussion at https://github.com/util-linux/util-linux/issues/3016

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agolibblkid: make example more robust
Karel Zak [Wed, 15 May 2024 11:24:29 +0000 (13:24 +0200)] 
libblkid: make example more robust

Fixes: https://github.com/util-linux/util-linux/issues/3043
Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agoMerge branch 'PR/libmount-fix-atime-remount' of github.com:karelzak/util-linux-work
Karel Zak [Wed, 15 May 2024 11:12:00 +0000 (13:12 +0200)] 
Merge branch 'PR/libmount-fix-atime-remount' of github.com:karelzak/util-linux-work

* 'PR/libmount-fix-atime-remount' of github.com:karelzak/util-linux-work:
  libmount: Fix atime remount for new API

17 months agoMerge branch 'libuuid/fix-uuidv6' of https://github.com/t-8ch/util-linux
Karel Zak [Wed, 15 May 2024 11:11:11 +0000 (13:11 +0200)] 
Merge branch 'libuuid/fix-uuidv6' of https://github.com/t-8ch/util-linux

* 'libuuid/fix-uuidv6' of https://github.com/t-8ch/util-linux:
  libuuid: fix v6 generation

17 months agolibuuid: drop duplicate assignment liuuid_la_LDFLAGS
Karel Zak [Wed, 15 May 2024 11:07:56 +0000 (13:07 +0200)] 
libuuid: drop duplicate assignment liuuid_la_LDFLAGS

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agolibuuid: fix v6 generation
Thomas Weißschuh [Wed, 15 May 2024 06:42:42 +0000 (06:42 +0000)] 
libuuid: fix v6 generation

get_clock_counter() does not return a gregorian timestamp as required
for v6.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
17 months agopam_lastlog2: drop duplicate assignment pam_lastlog2_la_LDFLAGS
Thomas Weißschuh [Tue, 14 May 2024 19:38:52 +0000 (21:38 +0200)] 
pam_lastlog2: drop duplicate assignment pam_lastlog2_la_LDFLAGS

The second assignment ends up on the linker/libtool commandline,
potentially confusing the tools.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
17 months agolibuuid: clear uuidd cache on fork()
Thomas Weißschuh [Tue, 7 May 2024 11:44:31 +0000 (13:44 +0200)] 
libuuid: clear uuidd cache on fork()

After fork() the memory of the calling thread is preserved into the new
process. This also includes TLS.
Make sure to reset the cache after a fork to avoid reuse of cached
values.

Only the TLS of the thread calling fork() is relevant as that is the
only thread that gets forked.
New threads will received newly initialized TLS.

Fixes https://github.com/util-linux/util-linux/issues/3009
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
17 months agolibuuid: split uuidd cache into dedicated struct
Thomas Weißschuh [Tue, 7 May 2024 11:33:40 +0000 (13:33 +0200)] 
libuuid: split uuidd cache into dedicated struct

To clear the struct we need to be able to refer to it by name.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
17 months agolibuuid: drop check for HAVE_TLS
Thomas Weißschuh [Tue, 7 May 2024 11:28:41 +0000 (13:28 +0200)] 
libuuid: drop check for HAVE_TLS

In the function get_clock() TLS is used unconditionally anyways.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
17 months agolibmount: Fix atime remount for new API
Karel Zak [Tue, 14 May 2024 09:58:20 +0000 (11:58 +0200)] 
libmount: Fix atime remount for new API

All atime settings are mutually exclusive, and the attr_set mask for
the mount_setattr() syscall cannot contain multiple MOUNT_ATTR_ atime
related options.

Unfortunately, during a remount, the list of options is composed of
both old and new options. In this case, libmount sets more atime
options to the mask. The correct behavior is to use the last atime
related option from the list.

Fixes: https://github.com/util-linux/util-linux/issues/3032
Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agoMerge branch 'uuidv7' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 14 May 2024 08:01:47 +0000 (10:01 +0200)] 
Merge branch 'uuidv7' of https://github.com/t-8ch/util-linux

* 'uuidv7' of https://github.com/t-8ch/util-linux:
  uuidgen: add support for RFC9562 UUIDs
  uuidparse: add support for RFC9562 UUIDs
  libuuid: add support for RFC9562 UUIDs

17 months agoMerge branch 'pidfd-enosys' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 14 May 2024 07:53:59 +0000 (09:53 +0200)] 
Merge branch 'pidfd-enosys' of https://github.com/t-8ch/util-linux

* 'pidfd-enosys' of https://github.com/t-8ch/util-linux:
  include/pidfd-utils: provide ENOSYS stubs if pidfd functions are missing

17 months agoMerge branch 'lsfd--use-new-ul_path-functions' of https://github.com/masatake/util...
Karel Zak [Tue, 14 May 2024 07:52:01 +0000 (09:52 +0200)] 
Merge branch 'lsfd--use-new-ul_path-functions' of https://github.com/masatake/util-linux

* 'lsfd--use-new-ul_path-functions' of https://github.com/masatake/util-linux:
  lsfd: (refactor) use ul_path_statf and ul_path_readlinkf

17 months agowipefs: fix typo
Karel Zak [Tue, 14 May 2024 07:45:00 +0000 (09:45 +0200)] 
wipefs: fix typo

Fixes: https://github.com/util-linux/util-linux/issues/3027
Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agoinclude/pidfd-utils: provide ENOSYS stubs if pidfd functions are missing
Thomas Weißschuh [Mon, 13 May 2024 18:21:24 +0000 (20:21 +0200)] 
include/pidfd-utils: provide ENOSYS stubs if pidfd functions are missing

This allows code which can gracefully fall back to compile.

This should fix the CI on Ubuntu 18.04.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
17 months agolib/path: use _vreadf_buffer for _cpuparse()
Thomas Weißschuh [Mon, 13 May 2024 08:46:39 +0000 (10:46 +0200)] 
lib/path: use _vreadf_buffer for _cpuparse()

ul_path_vreadf_buffer already provides zero-termination and newline
trimming, so make use of it.

We now could read more than a single line, but the files this is used on
contain only a single line anyways.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
17 months agolib/path: introduce ul_path_vreadf_buffer
Thomas Weißschuh [Mon, 13 May 2024 19:01:16 +0000 (21:01 +0200)] 
lib/path: introduce ul_path_vreadf_buffer

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
17 months agolsfd: (refactor) use ul_path_statf and ul_path_readlinkf
Masatake YAMATO [Mon, 13 May 2024 16:43:42 +0000 (01:43 +0900)] 
lsfd: (refactor) use ul_path_statf and ul_path_readlinkf

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
17 months agolib/path: use _read_buffer for _read_string()
Thomas Weißschuh [Mon, 13 May 2024 08:46:31 +0000 (10:46 +0200)] 
lib/path: use _read_buffer for _read_string()

ul_path_read_buffer already provides zero-termination and newline
trimming, so make use of it.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
17 months agoinclude/pidfd-utils: remove hardcoded syscall fallback
Karel Zak [Mon, 13 May 2024 09:43:57 +0000 (11:43 +0200)] 
include/pidfd-utils: remove hardcoded syscall fallback

Based on https://github.com/util-linux/util-linux/pull/3018

The syscall numbers should not be hardcoded in the header file. If we
really need them, there is UL_CHECK_SYSCALL() to define the numbers
for different architectures. I doubt it's really necessary. Just
update your kernel header files to get the latest kernel updates ...

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agoMerge branch 'structlceanup' of https://github.com/penguin42/util-linux
Karel Zak [Mon, 13 May 2024 08:17:57 +0000 (10:17 +0200)] 
Merge branch 'structlceanup' of https://github.com/penguin42/util-linux

* 'structlceanup' of https://github.com/penguin42/util-linux:
  cfdisk: Remove unused struct 'cfdisk_extra'

17 months agoMerge branch 'fix-column-example' of https://github.com/4KiB/util-linux
Karel Zak [Mon, 13 May 2024 08:16:30 +0000 (10:16 +0200)] 
Merge branch 'fix-column-example' of https://github.com/4KiB/util-linux

* 'fix-column-example' of https://github.com/4KiB/util-linux:
  Fix fstab order in `column` manpage example.

17 months agoMerge branch 'pidfs-pseudo' of https://github.com/YHNdnzj/util-linux
Karel Zak [Mon, 13 May 2024 08:15:23 +0000 (10:15 +0200)] 
Merge branch 'pidfs-pseudo' of https://github.com/YHNdnzj/util-linux

* 'pidfs-pseudo' of https://github.com/YHNdnzj/util-linux:
  libmount/utils: add pidfs to pseudo fs list

17 months agoMerge branch 'mkswap-file' of https://github.com/YHNdnzj/util-linux
Karel Zak [Mon, 13 May 2024 08:14:54 +0000 (10:14 +0200)] 
Merge branch 'mkswap-file' of https://github.com/YHNdnzj/util-linux

* 'mkswap-file' of https://github.com/YHNdnzj/util-linux:
  mkswap.8.adoc: update note regarding swapfile creation

17 months agoMerge branch 'fix' of https://github.com/DaanDeMeyer/util-linux
Karel Zak [Mon, 13 May 2024 08:09:54 +0000 (10:09 +0200)] 
Merge branch 'fix' of https://github.com/DaanDeMeyer/util-linux

* 'fix' of https://github.com/DaanDeMeyer/util-linux:
  Fix ul_path_read_buffer()

17 months agoMerge branch 'flock-test-doc' of https://github.com/Villemoes/util-linux
Karel Zak [Mon, 13 May 2024 07:59:33 +0000 (09:59 +0200)] 
Merge branch 'flock-test-doc' of https://github.com/Villemoes/util-linux

* 'flock-test-doc' of https://github.com/Villemoes/util-linux:
  tests: add --fcntl testing to flock
  tests: prepare flock for testing --fcntl
  flock: document --fcntl
  flock: bash-completion: add --fcntl

17 months agoMerge branch 'meson-fix-Python.h-check' of https://github.com/jwillikers/util-linux
Karel Zak [Mon, 13 May 2024 07:58:21 +0000 (09:58 +0200)] 
Merge branch 'meson-fix-Python.h-check' of https://github.com/jwillikers/util-linux

* 'meson-fix-Python.h-check' of https://github.com/jwillikers/util-linux:
  meson: Correctly require the Python.h header for the python dependency
  meson: Only require Python module when building pylibmount
  meson: Fix build-python option

17 months agoMerge branch 'lsns--refactor-related-to-2987' of https://github.com/masatake/util...
Karel Zak [Mon, 13 May 2024 06:42:06 +0000 (08:42 +0200)] 
Merge branch 'lsns--refactor-related-to-2987' of https://github.com/masatake/util-linux

* 'lsns--refactor-related-to-2987' of https://github.com/masatake/util-linux:
  lsns: (refactor) use ls_path_{openf|statf} to make the code simple
  lib/path: add ul_path_statf() and ul_path_vstatf()
  lsns: verify the uniqueness of a namespace in ls->namespaces list
  lsns: (refactor) make the function names for reading namespaces consistent
  lsns: (refactor) rename read_related_namespaces to connect_namespaces
  lsns: (refactor) rename get_ns_ino() to get_ns_inos()
  lsns: (refactor) use get_{parent|owner}_ns_ino() in add_namespace_for_nsfd
  lsns: (refactor) add get_{parent|owner}_ns_ino() implementing some parts of get_ns_ino()
  lsns: (refactor) give a enumeration name 'lsns_type' to LSNS_TYPE_ enumerators
  lsns: (refactor) rename LSNS_ID_.* to LSNS_TYPE_.*

17 months agocfdisk: Remove unused struct 'cfdisk_extra'
Dr. David Alan Gilbert [Sun, 12 May 2024 12:49:23 +0000 (13:49 +0100)] 
cfdisk: Remove unused struct 'cfdisk_extra'

'cfdisk_extra' looks unused since it's original commit
(I think because it ended up using libscols instead).
Remove it.

Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
17 months agoFix fstab order in `column` manpage example.
Rom [Sat, 11 May 2024 18:41:39 +0000 (11:41 -0700)] 
Fix fstab order in `column` manpage example.

fstab is:

1. fs_spec
2. fs_file
3. fs_vfstype
4. fs_mntops
5. fs_freq
6. fs_passno

In other words it's:

    SOURCE,TARGET,TYPE,OPTIONS,FREQ,PASS

17 months agolibmount/utils: add pidfs to pseudo fs list
Mike Yuan [Fri, 10 May 2024 17:11:28 +0000 (01:11 +0800)] 
libmount/utils: add pidfs to pseudo fs list

17 months agomkswap.8.adoc: update note regarding swapfile creation
Mike Yuan [Fri, 10 May 2024 17:03:51 +0000 (01:03 +0800)] 
mkswap.8.adoc: update note regarding swapfile creation

Follow-up for 7377b0d99560460806eab9efa9d8224d084c2082
(the addition of --file option)

17 months agouuidgen: add support for RFC9562 UUIDs
Thomas Weißschuh [Mon, 5 Feb 2024 15:06:46 +0000 (16:06 +0100)] 
uuidgen: add support for RFC9562 UUIDs

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
17 months agouuidparse: add support for RFC9562 UUIDs
Thomas Weißschuh [Mon, 12 Feb 2024 17:46:27 +0000 (18:46 +0100)] 
uuidparse: add support for RFC9562 UUIDs

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
17 months agolibuuid: add support for RFC9562 UUIDs
Thomas Weißschuh [Mon, 12 Feb 2024 17:44:41 +0000 (18:44 +0100)] 
libuuid: add support for RFC9562 UUIDs

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
17 months agomeson: Correctly require the Python.h header for the python dependency
Jordan Williams [Tue, 7 May 2024 14:40:44 +0000 (09:40 -0500)] 
meson: Correctly require the Python.h header for the python dependency

The current solution to require the Python.h header works around a bug
in Meson that has been fixed for version 1.4.1 of Meson.
Refer to https://github.com/mesonbuild/meson/issues/12862.
This change uses an explicit check for the Python.h include.
This verifies the required header exists.
This check is only necessary prior to version 1.4.1 of Meson.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
17 months agomeson: Only require Python module when building pylibmount
Jordan Williams [Thu, 9 May 2024 21:46:58 +0000 (16:46 -0500)] 
meson: Only require Python module when building pylibmount

Only the python executable is required for tests.
Version 1.4.1 of Meson will require the Python.h for find_installation.
This will result in the tests requiring Python.h unnecessarily.
Use find_program to find the Python program for the tests instead.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
17 months agomeson: Fix build-python option
Jordan Williams [Thu, 9 May 2024 20:57:12 +0000 (15:57 -0500)] 
meson: Fix build-python option

The build-python option is for controlling whether or not pylibmount is
built.
Unfortunately, commit b6799cc rendered the option unused.
This change uses the build-python option again.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
17 months agoFix ul_path_read_buffer()
Daan De Meyer [Thu, 9 May 2024 10:32:31 +0000 (12:32 +0200)] 
Fix ul_path_read_buffer()

The current implementation cuts off the last character of the buffer
if there is no trailing newline.

17 months agotests: add --fcntl testing to flock
Rasmus Villemoes [Wed, 8 May 2024 13:32:26 +0000 (15:32 +0200)] 
tests: add --fcntl testing to flock

All the existing tests are also done with --fcntl in effect, and then
we add one more test, namely that a flock(2) lock can be be obtained
even while a fcntl(2) lock is held - not that anyone should ever need
that, but it does show that the lock types are completely independent.

17 months agotests: prepare flock for testing --fcntl
Rasmus Villemoes [Wed, 8 May 2024 13:16:10 +0000 (15:16 +0200)] 
tests: prepare flock for testing --fcntl

Prepare the test script for doing all the same things, but with
--fcntl in effect. The diff is much smaller when viewed with
git show -w.

17 months agoflock: document --fcntl
Rasmus Villemoes [Wed, 8 May 2024 12:29:43 +0000 (14:29 +0200)] 
flock: document --fcntl

I'm not sure how much technical detail/symbolic constants to include
in the explanation.

17 months agoflock: bash-completion: add --fcntl
Rasmus Villemoes [Wed, 8 May 2024 12:18:26 +0000 (14:18 +0200)] 
flock: bash-completion: add --fcntl

17 months agolsns: (refactor) use ls_path_{openf|statf} to make the code simple
Masatake YAMATO [Thu, 2 May 2024 22:10:04 +0000 (07:10 +0900)] 
lsns: (refactor) use ls_path_{openf|statf} to make the code simple

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
17 months agolib/path: add ul_path_statf() and ul_path_vstatf()
Karel Zak [Thu, 2 May 2024 13:56:29 +0000 (15:56 +0200)] 
lib/path: add ul_path_statf() and ul_path_vstatf()

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

17 months agohwclock: free temporary variable before return
Karel Zak [Thu, 2 May 2024 11:14:17 +0000 (13:14 +0200)] 
hwclock: free temporary variable before return

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agoagetty: make reload code more robust
Karel Zak [Thu, 2 May 2024 08:54:04 +0000 (10:54 +0200)] 
agetty: make reload code more robust

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agolibmount: fix possible memory leak
Karel Zak [Thu, 2 May 2024 08:15:29 +0000 (10:15 +0200)] 
libmount: fix possible memory leak

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agowall: check sysconf() returnvalue
Karel Zak [Thu, 2 May 2024 08:07:04 +0000 (10:07 +0200)] 
wall: check sysconf() returnvalue

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agogetopt: remove free-before-exit
Karel Zak [Tue, 30 Apr 2024 09:06:49 +0000 (11:06 +0200)] 
getopt: remove free-before-exit

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agofsck.minix: fix possible overrun
Karel Zak [Tue, 30 Apr 2024 09:04:32 +0000 (11:04 +0200)] 
fsck.minix: fix possible overrun

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agoagetty: fix resource leak
Karel Zak [Tue, 30 Apr 2024 09:01:06 +0000 (11:01 +0200)] 
agetty: fix resource leak

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agosuL fix use after free on error
Karel Zak [Tue, 30 Apr 2024 08:51:50 +0000 (10:51 +0200)] 
suL fix use after free on error

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agocal: use unsigned int to follow union with unsigned int
Karel Zak [Mon, 29 Apr 2024 13:33:07 +0000 (15:33 +0200)] 
cal: use unsigned int to follow union with unsigned int

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agowall: fix possible memory leak
Karel Zak [Mon, 29 Apr 2024 13:25:58 +0000 (15:25 +0200)] 
wall: fix possible memory leak

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agohwclock: initialize parser variables
Karel Zak [Mon, 29 Apr 2024 13:21:20 +0000 (15:21 +0200)] 
hwclock: initialize parser variables

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agolsclocks: fix FD leak
Karel Zak [Mon, 29 Apr 2024 13:17:53 +0000 (15:17 +0200)] 
lsclocks: fix FD leak

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agolibfdisk: add initializer to geometry
Karel Zak [Mon, 29 Apr 2024 12:59:44 +0000 (14:59 +0200)] 
libfdisk: add initializer to geometry

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agowall: make sure unsigned variable not underflow
Karel Zak [Mon, 29 Apr 2024 12:55:16 +0000 (14:55 +0200)] 
wall: make sure unsigned variable not underflow

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agolsns: verify the uniqueness of a namespace in ls->namespaces list
Masatake YAMATO [Wed, 1 May 2024 18:51:18 +0000 (03:51 +0900)] 
lsns: verify the uniqueness of a namespace in ls->namespaces list

In read_open_ns_inos(), a namespace is added to the list without
verifying its uniqueness in the list.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
17 months agolsns: (refactor) make the function names for reading namespaces consistent
Masatake YAMATO [Wed, 1 May 2024 19:49:13 +0000 (04:49 +0900)] 
lsns: (refactor) make the function names for reading namespaces consistent

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
17 months agolsns: (refactor) rename read_related_namespaces to connect_namespaces
Masatake YAMATO [Wed, 1 May 2024 17:21:09 +0000 (02:21 +0900)] 
lsns: (refactor) rename read_related_namespaces to connect_namespaces

read_related_namespaces() itself doesn't read names of new namespaces.
Connecting namespaces for making a tree is the the main job the function.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
17 months agolsns: (refactor) rename get_ns_ino() to get_ns_inos()
Masatake YAMATO [Wed, 1 May 2024 03:02:10 +0000 (12:02 +0900)] 
lsns: (refactor) rename get_ns_ino() to get_ns_inos()

The function gets three inode numbers.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
17 months agolsns: (refactor) use get_{parent|owner}_ns_ino() in add_namespace_for_nsfd
Masatake YAMATO [Wed, 1 May 2024 17:00:15 +0000 (02:00 +0900)] 
lsns: (refactor) use get_{parent|owner}_ns_ino() in add_namespace_for_nsfd

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
17 months agolsns: (refactor) add get_{parent|owner}_ns_ino() implementing some parts of get_ns_ino()
Masatake YAMATO [Wed, 1 May 2024 02:46:05 +0000 (11:46 +0900)] 
lsns: (refactor) add get_{parent|owner}_ns_ino() implementing some parts of get_ns_ino()

get_ns_ino() returns three inode numbers. The code for the two of three,
inodes for PARENT and USERNS, is moved to the new functions.
So we can reuse the code in other places in lsns.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
17 months agolsns: (refactor) give a enumeration name 'lsns_type' to LSNS_TYPE_ enumerators
Masatake YAMATO [Wed, 1 May 2024 02:18:09 +0000 (11:18 +0900)] 
lsns: (refactor) give a enumeration name 'lsns_type' to LSNS_TYPE_ enumerators

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
17 months agoMerge branch 'PR/libsmartcols-reduce-fix' of github.com:karelzak/util-linux-work
Karel Zak [Wed, 1 May 2024 19:23:03 +0000 (21:23 +0200)] 
Merge branch 'PR/libsmartcols-reduce-fix' of github.com:karelzak/util-linux-work

* 'PR/libsmartcols-reduce-fix' of github.com:karelzak/util-linux-work:
  libsmartcols: fix column reduction

17 months agoMerge branch 'bcachefs_correct_max_size_constant' of https://github.com/tasleson...
Karel Zak [Wed, 1 May 2024 19:20:50 +0000 (21:20 +0200)] 
Merge branch 'bcachefs_correct_max_size_constant' of https://github.com/tasleson/util-linux

* 'bcachefs_correct_max_size_constant' of https://github.com/tasleson/util-linux:
  bcachefs: Remove BCACHEFS_SB_MAX_SIZE & check

17 months agoMerge branch 'lsfd/fcntl' of https://github.com/t-8ch/util-linux
Karel Zak [Wed, 1 May 2024 19:17:52 +0000 (21:17 +0200)] 
Merge branch 'lsfd/fcntl' of https://github.com/t-8ch/util-linux

* 'lsfd/fcntl' of https://github.com/t-8ch/util-linux:
  lsfd: include buffer.h in decode-file-flags.h
  buffer: replace include of c.h with stddef.h
  lsfd: move interface of decode-file-flags to header

17 months agolsns: (refactor) rename LSNS_ID_.* to LSNS_TYPE_.*
Masatake YAMATO [Wed, 1 May 2024 02:07:31 +0000 (11:07 +0900)] 
lsns: (refactor) rename LSNS_ID_.* to LSNS_TYPE_.*

Functions taking LSNS_ID_ as arguments have .*_lsns_type_.* or
.*_type_.* as parts of their name. This implies the prefix LSNS_TYPE_
is more consistent than LSNS_ID_.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
17 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>
17 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>
17 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>
17 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.

(cherry picked from commit 991cb1568a7b3770e33d68c4df49a97068ac8588)

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

17 months agoMerge branch 'lsfd/fcntl.h' of https://github.com/t-8ch/util-linux
Karel Zak [Mon, 29 Apr 2024 08:27:17 +0000 (10:27 +0200)] 
Merge branch 'lsfd/fcntl.h' of https://github.com/t-8ch/util-linux

* 'lsfd/fcntl.h' of https://github.com/t-8ch/util-linux:
  lsfd: include linux/fcntl.h

17 months agoMerge branch 'lsns--debug-ioctl_ns-test-for-master' of https://github.com/masatake...
Karel Zak [Mon, 29 Apr 2024 08:26:25 +0000 (10:26 +0200)] 
Merge branch 'lsns--debug-ioctl_ns-test-for-master' of https://github.com/masatake/util-linux

* 'lsns--debug-ioctl_ns-test-for-master' of https://github.com/masatake/util-linux:
  tests: (lsns::ioctl_ns) add more debug print
  tests: (lsns::ioctl_ns) record stdout/stderr for debugging the case