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
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
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.
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) \
| ^~~~~~~~~~~~~~~
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>
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>
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
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 ...
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
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_.*
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>
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>
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>
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.
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.
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
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_.
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