]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
14 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

14 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>
14 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>
14 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>
14 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

14 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

14 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>
14 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>
14 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>
14 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>
14 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

14 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

14 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

14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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'

14 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.

14 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

14 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

14 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()

14 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

14 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

14 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_.*

14 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>
14 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

14 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

14 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)

14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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.

14 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.

14 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.

14 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.

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

14 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>
14 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)

14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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>
14 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

14 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

14 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

15 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>
15 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>
15 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>
15 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>
15 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)

15 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)

15 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

15 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

15 months agoMerge branch 'PR/flock-fcntl' of github.com:karelzak/util-linux-work
Karel Zak [Mon, 29 Apr 2024 08:25:17 +0000 (10:25 +0200)] 
Merge branch 'PR/flock-fcntl' of github.com:karelzak/util-linux-work

* 'PR/flock-fcntl' of github.com:karelzak/util-linux-work:
  flock: add support for using fcntl() with open file description locks

15 months agocoresched: Manage core scheduling cookies for tasks
Thijs Raymakers [Thu, 25 Apr 2024 16:22:25 +0000 (18:22 +0200)] 
coresched: Manage core scheduling cookies for tasks

Co-authored-by: Phil Auld <pauld@redhat.com>
Signed-off-by: Phil Auld <pauld@redhat.com>
Signed-off-by: Thijs Raymakers <thijs@raymakers.nl>
Signed-off-by: Karel Zak <kzak@redhat.com>
Reviewed-by: Thomas Weißschuh <thomas@t-8ch.de>
15 months agolsfd: include linux/fcntl.h
Thomas Weißschuh [Sun, 28 Apr 2024 21:35:12 +0000 (23:35 +0200)] 
lsfd: include linux/fcntl.h

asm/-headers are implementation details and not meant to be included
directly. Instead use the linux/ header which will always include the
correct asm/-headers.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
15 months agolsfd: include buffer.h in decode-file-flags.h
Thomas Weißschuh [Sun, 28 Apr 2024 21:23:47 +0000 (23:23 +0200)] 
lsfd: include buffer.h in decode-file-flags.h

buffer.h does not pull in the full c.h with it side-effects,
so it can be used now.

Drop the now unnecessary extern declarations.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
15 months agobuffer: replace include of c.h with stddef.h
Thomas Weißschuh [Sun, 28 Apr 2024 21:18:48 +0000 (23:18 +0200)] 
buffer: replace include of c.h with stddef.h

The interface of the buffer library only requires size_t.
It's enough to include stddef.h for that.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
15 months agolsfd: move interface of decode-file-flags to header
Thomas Weißschuh [Sun, 28 Apr 2024 21:22:13 +0000 (23:22 +0200)] 
lsfd: move interface of decode-file-flags to header

Use a proper header file to declare lsfd_decode_file_flags().

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
15 months agoflock: add support for using fcntl() with open file description locks
Rasmus Villemoes [Thu, 25 Apr 2024 09:44:17 +0000 (11:44 +0200)] 
flock: add support for using fcntl() with open file description locks

Currently, there is no way for shell scripts to safely access
resources protected by POSIX locking (fcntl with the F_SETLK/F_SETLKW
commands). For example, the glibc function lckpwdf(), used to
protect access to the /etc/shadow database, works by taking a
F_SETLKW on /etc/.pwd.lock .

Due to the odd semantics of POSIX locking (e.g. released when any file
descriptor associated to the inode is closed), we cannot usefully
directly expose the POSIX F_SETLK/F_SETLKW commands. However, linux
3.15 introduced F_OFD_SETLK[W], with semantics wrt. ownership and
release better matching those of flock(2), and crucially they do
conflict with locks obtained via F_SETLK[W]. With this, a shell script
can do

  exec 4> /etc/.pwd.lock
  flock --fcntl 4
  <access/modify /etc/shadow ...>
  flock --fcntl --unlock 4 # or just exit

without conflicting with passwd(1) or other utilities that
access/modify /etc/shadow.

No single-letter shorthand is defined for the option, because this is
somewhat low-level and the user really needs to know what he is doing.

Also, this leaves the door open for teaching --fcntl to accept an
optional argument: "ofd", the default, and "posix", should anyone find
a use for flock(1) taking a F_SETLK[W] lock.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
15 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>
(cherry picked from commit 380120a07154d9447edc703d628416c717493b7d)

15 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>
(cherry picked from commit 82ecf6cf5495f43716fbe9d72411d8bd5994f75d)

15 months agoMerge branch 'meson-more-build-options' of https://github.com/jwillikers/util-linux
Karel Zak [Thu, 25 Apr 2024 09:22:32 +0000 (11:22 +0200)] 
Merge branch 'meson-more-build-options' of https://github.com/jwillikers/util-linux

* '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
  ...

15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>