]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
2 years agofsck: use BLKID_SUBLKS_BADCSUM
Karel Zak [Tue, 9 May 2023 11:25:09 +0000 (13:25 +0200)] 
fsck: use BLKID_SUBLKS_BADCSUM

We need to be a little bit more promiscuou in fsck to see also
inconsistent superblocks.

It would be possible to do not use libmount to ask for filesystem type
and ask directly libblkid, but libmount is also used to parse fstab
and search in the file and in this case it caches FS tags. It seems
better to continue with libmount to reduce overhead and keep the code
simple.

Addresses: https://github.com/util-linux/util-linux/issues/2214
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibmount: allow overwrite how to use libblkid
Karel Zak [Tue, 9 May 2023 11:21:58 +0000 (13:21 +0200)] 
libmount: allow overwrite how to use libblkid

This is unnecessary for classic mount-like tasks, but application
may use libmount in situation when the default for probing is not
optimal.

Addresses: https://github.com/util-linux/util-linux/issues/2214
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibfdisk: use BLKID_SUBLKS_BADCSUM and BLKID_PARTS_FORCE_GPT
Karel Zak [Tue, 9 May 2023 11:19:20 +0000 (13:19 +0200)] 
libfdisk: use BLKID_SUBLKS_BADCSUM and BLKID_PARTS_FORCE_GPT

Let's keep libblkid in more promiscuous mode to detect more possible
signatures.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'sulogin-term' of https://github.com/DaanDeMeyer/util-linux
Karel Zak [Tue, 9 May 2023 09:21:57 +0000 (11:21 +0200)] 
Merge branch 'sulogin-term' of https://github.com/DaanDeMeyer/util-linux

* 'sulogin-term' of https://github.com/DaanDeMeyer/util-linux:
  sulogin: Don't overwrite TERM if already set

2 years agoMerge branch 'ci/riscv' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 9 May 2023 09:21:37 +0000 (11:21 +0200)] 
Merge branch 'ci/riscv' of https://github.com/t-8ch/util-linux

* 'ci/riscv' of https://github.com/t-8ch/util-linux:
  ci: also build on riscv64
  lsns: (tests) skip test if rtnetlin is nonfunctional

2 years agopo-man: add cs to po4a.cfg
Karel Zak [Tue, 9 May 2023 08:52:02 +0000 (10:52 +0200)] 
po-man: add cs to po4a.cfg

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agosulogin: Don't overwrite TERM if already set
Daan De Meyer [Mon, 8 May 2023 08:03:09 +0000 (10:03 +0200)] 
sulogin: Don't overwrite TERM if already set

The service invoking sulogin might already have set TERM to something
useful so if that's the case let's not overwrite it.

2 years agoci: also build on riscv64
Thomas Weißschuh [Sat, 6 May 2023 06:25:34 +0000 (08:25 +0200)] 
ci: also build on riscv64

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolsns: (tests) skip test if rtnetlin is nonfunctional
Thomas Weißschuh [Sat, 6 May 2023 21:19:03 +0000 (23:19 +0200)] 
lsns: (tests) skip test if rtnetlin is nonfunctional

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agopo-man: clean all generated files
Thomas Weißschuh [Sat, 6 May 2023 05:07:01 +0000 (07:07 +0200)] 
po-man: clean all generated files

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agopo-man: ignore all generated sources
Thomas Weißschuh [Sat, 6 May 2023 04:53:51 +0000 (06:53 +0200)] 
po-man: ignore all generated sources

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agoci: build translated manpages during test
Thomas Weißschuh [Fri, 5 May 2023 08:42:03 +0000 (10:42 +0200)] 
ci: build translated manpages during test

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agotools: (asciidoctor-unicodeconverter) fix up name section with dash
Thomas Weißschuh [Fri, 5 May 2023 21:33:14 +0000 (23:33 +0200)] 
tools: (asciidoctor-unicodeconverter) fix up name section with dash

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agotools: (asciidoctor-unicodeconverter) fix state machine comparision
Thomas Weißschuh [Fri, 5 May 2023 21:14:44 +0000 (23:14 +0200)] 
tools: (asciidoctor-unicodeconverter) fix state machine comparision

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agopo-man: fix quoting in comparision to skip nonexisting translations
Thomas Weißschuh [Fri, 5 May 2023 09:11:23 +0000 (11:11 +0200)] 
po-man: fix quoting in comparision to skip nonexisting translations

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agoMerge branch 'ci/python' of https://github.com/t-8ch/util-linux
Karel Zak [Fri, 5 May 2023 07:27:33 +0000 (09:27 +0200)] 
Merge branch 'ci/python' of https://github.com/t-8ch/util-linux

* 'ci/python' of https://github.com/t-8ch/util-linux:
  ci: test python bindings

2 years agotests: (test_sysinfo) include sys/mount.h
Thomas Weißschuh [Tue, 2 May 2023 16:53:20 +0000 (18:53 +0200)] 
tests: (test_sysinfo) include sys/mount.h

When fsopen() is not provided by mount-api-utils.h it comes from
sys/mount.h.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agotests: disable mount/subdir on unshared session without new mount API
Karel Zak [Tue, 2 May 2023 12:59:04 +0000 (14:59 +0200)] 
tests: disable mount/subdir on unshared session without new mount API

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibmount: (subdir) support unshared sessions too
Karel Zak [Tue, 2 May 2023 11:27:52 +0000 (13:27 +0200)] 
libmount: (subdir) support unshared sessions too

* enter original namespace for the final move_mount(), it means that
  the original unshare() (to create the temporary mount) will be
  ineffective for this final step. God bless FD based APIs (setns()
  and open_tree())! ;-)

* improve cleanup code (call umount only once)

* remember private namespace

* update note in man page

Addresses: https://github.com/util-linux/util-linux/pull/2198
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'mount/qemu-user' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 2 May 2023 10:13:53 +0000 (12:13 +0200)] 
Merge branch 'mount/qemu-user' of https://github.com/t-8ch/util-linux

* 'mount/qemu-user' of https://github.com/t-8ch/util-linux:
  mount: (tests) run bind mount tests on qemu-user
  ci: (s390x) run container privileged and with access to /dev
  mount: (tests) also skip tests on private,slave propagation
  mount: (tests) skip fstab-btrfs on broken ENOTTY return
  lsns: (tests) skip nsfs test on broken ENOTTY return
  tests: (test_sysinfo) add helper for invalid ioctl errno
  libmount: fix some typos

2 years agoMerge branch 'hwclock/skip-test-show' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 2 May 2023 10:13:27 +0000 (12:13 +0200)] 
Merge branch 'hwclock/skip-test-show' of https://github.com/t-8ch/util-linux

* 'hwclock/skip-test-show' of https://github.com/t-8ch/util-linux:
  hwclock: (tests) mark show test failed on GitHub Actions
  tests: (functions.sh): add func to detect virtualization platform

2 years agosulogin: fix KDGKBMODE ifdef
Karel Zak [Tue, 2 May 2023 09:36:49 +0000 (11:36 +0200)] 
sulogin: fix KDGKBMODE ifdef

* remove ifdef-else for KDGKBMODE

* always call KDGKBMODE for virtual console to get K_UNICODE status

* use KDGKBMODE as a fallback to detect serial line

Fixes: https://github.com/util-linux/util-linux/issues/2185
Suggested-by: Marcos Mello
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agomount: (tests) run bind mount tests on qemu-user
Thomas Weißschuh [Mon, 24 Apr 2023 15:22:01 +0000 (17:22 +0200)] 
mount: (tests) run bind mount tests on qemu-user

Since commit e828630a16c7 ("libmount: recover from ENOSYS for the new API")
these work correctly.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agoci: (s390x) run container privileged and with access to /dev
Thomas Weißschuh [Tue, 25 Apr 2023 06:11:28 +0000 (08:11 +0200)] 
ci: (s390x) run container privileged and with access to /dev

This is necessary for the mount tests.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agomount: (tests) also skip tests on private,slave propagation
Thomas Weißschuh [Sun, 30 Apr 2023 18:50:21 +0000 (20:50 +0200)] 
mount: (tests) also skip tests on private,slave propagation

On docker the mount propagation is "private,slave".
Adapt the pattern to handle this.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agomount: (tests) skip fstab-btrfs on broken ENOTTY return
Thomas Weißschuh [Sun, 30 Apr 2023 08:24:34 +0000 (10:24 +0200)] 
mount: (tests) skip fstab-btrfs on broken ENOTTY return

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolsns: (tests) skip nsfs test on broken ENOTTY return
Thomas Weißschuh [Sun, 30 Apr 2023 08:24:05 +0000 (10:24 +0200)] 
lsns: (tests) skip nsfs test on broken ENOTTY return

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agotests: (test_sysinfo) add helper for invalid ioctl errno
Thomas Weißschuh [Sun, 30 Apr 2023 08:18:20 +0000 (10:18 +0200)] 
tests: (test_sysinfo) add helper for invalid ioctl errno

This can be used to detect qemu-user returning ENOSYS for invalid ioctl
numbers.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolibmount: fix some typos
Thomas Weißschuh [Wed, 26 Apr 2023 20:50:45 +0000 (22:50 +0200)] 
libmount: fix some typos

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agoci: test python bindings
Thomas Weißschuh [Sun, 30 Apr 2023 06:47:54 +0000 (08:47 +0200)] 
ci: test python bindings

2 years agohwclock: (tests) mark show test failed on GitHub Actions
Thomas Weißschuh [Sun, 30 Apr 2023 05:56:25 +0000 (07:56 +0200)] 
hwclock: (tests) mark show test failed on GitHub Actions

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agotests: (functions.sh): add func to detect virtualization platform
Thomas Weißschuh [Sun, 30 Apr 2023 06:36:23 +0000 (08:36 +0200)] 
tests: (functions.sh): add func to detect virtualization platform

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agomount: fix and improve man page subdir desc
Karel Zak [Fri, 28 Apr 2023 17:56:59 +0000 (19:56 +0200)] 
mount: fix and improve man page subdir desc

Addresses: https://github.com/util-linux/util-linux/commit/2186677456f2a03d6645874ccc3e675f204cdb5b#commitcomment-110992331
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agotests: skip subdir test if unshared session
Karel Zak [Fri, 28 Apr 2023 09:01:01 +0000 (11:01 +0200)] 
tests: skip subdir test if unshared session

Addresses: https://github.com/util-linux/util-linux/pull/2197
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agomount: (man) add note about namespaces to subdir= desc
Karel Zak [Fri, 28 Apr 2023 08:19:52 +0000 (10:19 +0200)] 
mount: (man) add note about namespaces to subdir= desc

Addresses: https://github.com/util-linux/util-linux/pull/2198
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agotests: skip complex mount test on qemu
Karel Zak [Thu, 27 Apr 2023 09:21:07 +0000 (11:21 +0200)] 
tests: skip complex mount test on qemu

Addresses: https://github.com/util-linux/util-linux/pull/2197
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'enosys/fixes' of https://github.com/t-8ch/util-linux
Karel Zak [Wed, 26 Apr 2023 14:52:18 +0000 (16:52 +0200)] 
Merge branch 'enosys/fixes' of https://github.com/t-8ch/util-linux

* 'enosys/fixes' of https://github.com/t-8ch/util-linux:
  mount: (tests) skip test if test_enosys is nonfunctional
  test_enosys: provide more diagnostics on failure
  test_enosys: use correct return value for getopt_long

2 years agomount: (tests) skip test if test_enosys is nonfunctional
Thomas Weißschuh [Wed, 26 Apr 2023 10:15:58 +0000 (12:15 +0200)] 
mount: (tests) skip test if test_enosys is nonfunctional

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agotest_enosys: provide more diagnostics on failure
Thomas Weißschuh [Wed, 26 Apr 2023 10:15:33 +0000 (12:15 +0200)] 
test_enosys: provide more diagnostics on failure

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agotest_enosys: use correct return value for getopt_long
Thomas Weißschuh [Wed, 26 Apr 2023 09:49:08 +0000 (11:49 +0200)] 
test_enosys: use correct return value for getopt_long

Otherwise option parsing is broken on big endian.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agobuild-sys: enable translated man pages if po4a installed
Karel Zak [Wed, 26 Apr 2023 10:20:00 +0000 (12:20 +0200)] 
build-sys: enable translated man pages if po4a installed

Suggested-by: Mario Blättermann <mario.blaettermann@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'login-utils/supam_conv_fix' of https://github.com/Stefan-Radu/util...
Karel Zak [Wed, 26 Apr 2023 09:36:08 +0000 (11:36 +0200)] 
Merge branch 'login-utils/supam_conv_fix' of https://github.com/Stefan-Radu/util-linux

* 'login-utils/supam_conv_fix' of https://github.com/Stefan-Radu/util-linux:
  wrap return in #else directive to avoid dead code
  add return in supam_conv function

2 years agolibmount: (legacy) fix typo in assert()
Karel Zak [Wed, 26 Apr 2023 09:22:32 +0000 (11:22 +0200)] 
libmount: (legacy) fix typo in assert()

Addresses: https://github.com/util-linux/util-linux/pull/2197
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agotests: add subdir test to mount fallback
Karel Zak [Wed, 26 Apr 2023 09:14:42 +0000 (11:14 +0200)] 
tests: add subdir test to mount fallback

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibmount: (mount) free hook data if new APi not avalable
Karel Zak [Wed, 26 Apr 2023 09:02:03 +0000 (11:02 +0200)] 
libmount: (mount) free hook data if new APi not avalable

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoblockdev: add --getdiskseq to bash completion
Thomas Weißschuh [Wed, 26 Apr 2023 06:50:08 +0000 (08:50 +0200)] 
blockdev: add --getdiskseq to bash completion

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agowrap return in #else directive to avoid dead code
Stefan Radu [Tue, 25 Apr 2023 15:55:07 +0000 (18:55 +0300)] 
wrap return in #else directive to avoid dead code

Signed-off-by: Stefan Radu <stefan270101@gmail.com>
2 years agoMerge branch 'mount/bind-test' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 25 Apr 2023 15:33:27 +0000 (17:33 +0200)] 
Merge branch 'mount/bind-test' of https://github.com/t-8ch/util-linux

* 'mount/bind-test' of https://github.com/t-8ch/util-linux:
  mount: (tests) skip fstab-bind on qemu-user

2 years agotests: extend fsopen libmount fallback test
Karel Zak [Tue, 25 Apr 2023 14:56:09 +0000 (16:56 +0200)] 
tests: extend fsopen libmount fallback test

* add later-fsopen check
* remove move_mount check (unnecessary)

Addresses: https://github.com/util-linux/util-linux/pull/2197
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'libmount/enosys' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 25 Apr 2023 14:42:36 +0000 (16:42 +0200)] 
Merge branch 'libmount/enosys' of https://github.com/t-8ch/util-linux

* 'libmount/enosys' of https://github.com/t-8ch/util-linux:
  mount: (tests) add disabled testcase for mount without move_mount()
  mount: (tests) test fallback codepaths
  tests: add test_enosys helper

2 years agolibmount: improve ENOSYS fallback
Karel Zak [Tue, 25 Apr 2023 14:25:14 +0000 (16:25 +0200)] 
libmount: improve ENOSYS fallback

In some cases, for example:

 # mount -t foo,bar,ext4 /dev/sdc /mnt/test

libmount calls fsopen() later (after mount preparation stage), but we
need during preparation check if hook_mount.c stuff (new API) is usable.

Let's do it by dummy fsopen() call.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoadd return in supam_conv function
Stefan Radu [Tue, 25 Apr 2023 12:00:36 +0000 (15:00 +0300)] 
add return in supam_conv function

Added return statement to ensure that all execution paths end with a
return statement.

Signed-off-by: Stefan Radu <stefan270101@gmail.com>
2 years agolibmount: fix copy & past typo
Karel Zak [Tue, 25 Apr 2023 10:33:44 +0000 (12:33 +0200)] 
libmount: fix copy & past typo

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoRevert "ci: (s390x/qemu-user) speed up build preparation"
Karel Zak [Tue, 25 Apr 2023 10:08:30 +0000 (12:08 +0200)] 
Revert "ci: (s390x/qemu-user) speed up build preparation"

This reverts commit 006275ac911e393b5ab6ace921c3b3bb206d6cb0.

Addresses: https://github.com/util-linux/util-linux/pull/2198
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoci: (s390x/qemu-user) speed up build preparation
Thomas Weißschuh [Tue, 25 Apr 2023 06:27:12 +0000 (08:27 +0200)] 
ci: (s390x/qemu-user) speed up build preparation

By configuring the build action properly the setup steps can be cached,
speeding up the build.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolibmount: Don't silently accept an X-mount.idmap with only whitespace
Chris Webb [Mon, 24 Apr 2023 16:14:47 +0000 (17:14 +0100)] 
libmount: Don't silently accept an X-mount.idmap with only whitespace

X-mount.idmap accepts a series of whitespace-separated tokens. We reject
an empty argument but silently accept an argument consisting of whitespace
with no tokens. Test for the empty case more thoroughly.

[kzak@redhat.com: - use skip_blank()]

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agomount: (tests) add disabled testcase for mount without move_mount()
Thomas Weißschuh [Mon, 24 Apr 2023 17:11:48 +0000 (19:11 +0200)] 
mount: (tests) add disabled testcase for mount without move_mount()

This does currently not work.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agomount: (tests) test fallback codepaths
Thomas Weißschuh [Mon, 24 Apr 2023 17:11:03 +0000 (19:11 +0200)] 
mount: (tests) test fallback codepaths

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agotests: add test_enosys helper
Thomas Weißschuh [Mon, 24 Apr 2023 16:35:27 +0000 (18:35 +0200)] 
tests: add test_enosys helper

This helper can be used to block certain syscalls with ENOSYS for
executed programs. This allows testing of fallback codepaths inside
util-linux.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolibmount: recover from ENOSYS for the new API
Karel Zak [Mon, 24 Apr 2023 15:29:05 +0000 (17:29 +0200)] 
libmount: recover from ENOSYS for the new API

Addresses: https://github.com/util-linux/util-linux/pull/2188
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agohexdump: fix ability to use given format when invoked as hd
Alexander Müller [Mon, 24 Apr 2023 13:08:42 +0000 (15:08 +0200)] 
hexdump: fix ability to use given format when  invoked as hd

Fixes: https://github.com/util-linux/util-linux/issues/2177
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoinclude/mount-api-utils: make fallback more portable
Karel Zak [Mon, 24 Apr 2023 12:12:14 +0000 (14:12 +0200)] 
include/mount-api-utils: make fallback more portable

Addresses: https://github.com/util-linux/util-linux/issues/2186
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibmount: check for errors from prep-options hooks
Chris Webb [Sun, 23 Apr 2023 16:05:07 +0000 (17:05 +0100)] 
libmount: check for errors from prep-options hooks

fix_optstr() in context_mount.c calls the MNT_STAGE_PREP_OPTIONS hooks
but discards returned errors. This suppresses error messages and can
make invalid option strings 'fail open' in surprising ways. Handle error
returns from these hooks correctly.

No other callers of mnt_context_call_hooks() discard the return value,
so other hooks aren't affected.

Signed-off-by: Chris Webb <chris@arachsys.com>
2 years agomount: (tests) skip fstab-bind on qemu-user
Thomas Weißschuh [Sat, 22 Apr 2023 08:56:23 +0000 (10:56 +0200)] 
mount: (tests) skip fstab-bind on qemu-user

The necessry functionality is not implemented there.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolibmount: don't include mount-api-utils.h everywhere
Karel Zak [Thu, 20 Apr 2023 10:36:41 +0000 (12:36 +0200)] 
libmount: don't include mount-api-utils.h everywhere

Let's keep the file included only when the new kernel API is
necessary.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'lsfd--ping-test-description' of https://github.com/masatake/util-linux
Karel Zak [Thu, 20 Apr 2023 10:10:17 +0000 (12:10 +0200)] 
Merge branch 'lsfd--ping-test-description' of https://github.com/masatake/util-linux

* 'lsfd--ping-test-description' of https://github.com/masatake/util-linux:
  tests: (lsfd) add losetup as a required cmd
  tests: (lsfd) make the message for skipping the case more descriptive
  tests: (mkfds) delete nls markers _("...") from the helper command

2 years agoMerge branch 'libmount/relative' of https://github.com/t-8ch/util-linux
Karel Zak [Thu, 20 Apr 2023 10:09:08 +0000 (12:09 +0200)] 
Merge branch 'libmount/relative' of https://github.com/t-8ch/util-linux

* 'libmount/relative' of https://github.com/t-8ch/util-linux:
  libmount: safe_stat: support relative filenames

2 years agoMerge branch 'fadvise' of https://github.com/eworm-de/util-linux
Karel Zak [Thu, 20 Apr 2023 09:11:31 +0000 (11:11 +0200)] 
Merge branch 'fadvise' of https://github.com/eworm-de/util-linux

* 'fadvise' of https://github.com/eworm-de/util-linux:
  add waitpid in bash-completion/Makemodule.am
  add fadvise in bash-completion/Makemodule.am

2 years agotests: add mount bind from fstab
Karel Zak [Thu, 20 Apr 2023 08:52:18 +0000 (10:52 +0200)] 
tests: add mount bind from fstab

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibmount: improve hooks de-initialization
Karel Zak [Thu, 20 Apr 2023 08:39:20 +0000 (10:39 +0200)] 
libmount: improve hooks de-initialization

Don't cleanup if all related to the hooks is already empty.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibmount: fix optlist cache refresh
Karel Zak [Thu, 20 Apr 2023 08:30:35 +0000 (10:30 +0200)] 
libmount: fix optlist cache refresh

Fixes: https://github.com/util-linux/util-linux/issues/2182
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agotests: (lsfd) add losetup as a required cmd
Masatake YAMATO [Wed, 19 Apr 2023 22:48:11 +0000 (07:48 +0900)] 
tests: (lsfd) add losetup as a required cmd

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agotests: (lsfd) make the message for skipping the case more descriptive
Masatake YAMATO [Wed, 19 Apr 2023 22:01:06 +0000 (07:01 +0900)] 
tests: (lsfd) make the message for skipping the case more descriptive

Using errno is suggested by Thomas Weißschuh <thomas@t-8ch.de>

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agotests: (mkfds) delete nls markers _("...") from the helper command
Masatake YAMATO [Wed, 19 Apr 2023 21:37:26 +0000 (06:37 +0900)] 
tests: (mkfds) delete nls markers _("...") from the helper command

No translation is needed.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolibmount: safe_stat: support relative filenames
Thomas Weißschuh [Wed, 19 Apr 2023 19:48:00 +0000 (21:48 +0200)] 
libmount: safe_stat: support relative filenames

By using AT_CWFD the call to statx() can also handle relative filenames.
Without this safe_stat() which is called on the fstab, source, target...

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agoadd waitpid in bash-completion/Makemodule.am
Christian Hesse [Wed, 19 Apr 2023 13:05:00 +0000 (15:05 +0200)] 
add waitpid in bash-completion/Makemodule.am

2 years agoadd fadvise in bash-completion/Makemodule.am
Christian Hesse [Wed, 19 Apr 2023 12:57:31 +0000 (14:57 +0200)] 
add fadvise in bash-completion/Makemodule.am

2 years agobuild-sys: release++ (v2.39-rc3) v2.39-rc3
Karel Zak [Wed, 19 Apr 2023 08:15:18 +0000 (10:15 +0200)] 
build-sys: release++ (v2.39-rc3)

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agodocs: update v2.39-ReleaseNotes
Karel Zak [Wed, 19 Apr 2023 08:14:26 +0000 (10:14 +0200)] 
docs: update v2.39-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agopo-man: merge changes
Karel Zak [Wed, 19 Apr 2023 07:52:36 +0000 (09:52 +0200)] 
po-man: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agopo: merge changes
Karel Zak [Wed, 19 Apr 2023 07:50:56 +0000 (09:50 +0200)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agopo-man: update de.po (from translationproject.org)
Mario Blättermann [Wed, 19 Apr 2023 07:49:15 +0000 (09:49 +0200)] 
po-man: update de.po (from translationproject.org)

2 years agopo: update uk.po (from translationproject.org)
Yuri Chornoivan [Wed, 19 Apr 2023 07:48:37 +0000 (09:48 +0200)] 
po: update uk.po (from translationproject.org)

2 years agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Wed, 19 Apr 2023 07:48:37 +0000 (09:48 +0200)] 
po: update pl.po (from translationproject.org)

2 years agopo: update ko.po (from translationproject.org)
Seong-ho Cho [Wed, 19 Apr 2023 07:48:37 +0000 (09:48 +0200)] 
po: update ko.po (from translationproject.org)

2 years agopo: update hr.po (from translationproject.org)
Božidar Putanec [Wed, 19 Apr 2023 07:48:37 +0000 (09:48 +0200)] 
po: update hr.po (from translationproject.org)

2 years agopo: update fr.po (from translationproject.org)
Frédéric Marchal [Wed, 19 Apr 2023 07:48:37 +0000 (09:48 +0200)] 
po: update fr.po (from translationproject.org)

2 years agopo: update de.po (from translationproject.org)
Mario Blättermann [Wed, 19 Apr 2023 07:48:37 +0000 (09:48 +0200)] 
po: update de.po (from translationproject.org)

2 years agopo: update cs.po (from translationproject.org)
Petr Písař [Wed, 19 Apr 2023 07:48:37 +0000 (09:48 +0200)] 
po: update cs.po (from translationproject.org)

2 years agolsfd: make a test case executable
Masatake YAMATO [Wed, 19 Apr 2023 01:08:43 +0000 (10:08 +0900)] 
lsfd: make a test case executable

It has been kept non-executable because of my mistake.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: skip test option-inet in qemu-user
Masatake YAMATO [Wed, 19 Apr 2023 00:53:12 +0000 (09:53 +0900)] 
lsfd: skip test option-inet in qemu-user

The option-inet test case has not run because it was incorrectly kept
as non-executable.

Mark the test case as "skip" in qmeu-user before making the test case
executable because we already know the case fails on qmeu-user. A fix
on qmeu-user may come later.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolibmount: cleanup all stat() use
Karel Zak [Tue, 18 Apr 2023 13:54:25 +0000 (15:54 +0200)] 
libmount: cleanup all stat() use

* don't use STATX_MODE as we need only file type
* use fstatat() or stat() as fallback on EOPNOTSUPP
* use st_rdev from statx() too

* rename to mnt_stat_mountpoint() to more generic mnt_safe_stat()

* use mnt_is_path() on more places
* cleanup mnt_context_*_excode() to not use stat()
* use on others places mnt_safe_stat()

Note that on some places stat() remaining, but it's not related to the
mountpoints, it's about /run/mount/utab permissions, file locking and
/dev/* permissions for non-root mounts.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'test/commands' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 18 Apr 2023 11:57:05 +0000 (13:57 +0200)] 
Merge branch 'test/commands' of https://github.com/t-8ch/util-linux

* 'test/commands' of https://github.com/t-8ch/util-linux:
  tests: don't skip on incorrectly search executables
  fincore: (tests) correctly look for findmnt

2 years agolib/crc32c: fix assert()
Karel Zak [Tue, 18 Apr 2023 11:54:17 +0000 (13:54 +0200)] 
lib/crc32c: fix assert()

Addresses: https://github.com/util-linux/util-linux/pull/2165
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agotests: don't skip on incorrectly search executables
Thomas Weißschuh [Mon, 17 Apr 2023 16:30:05 +0000 (18:30 +0200)] 
tests: don't skip on incorrectly search executables

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agofincore: (tests) correctly look for findmnt
Thomas Weißschuh [Mon, 17 Apr 2023 16:29:35 +0000 (18:29 +0200)] 
fincore: (tests) correctly look for findmnt

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolibmount: use AT_STATX_DONT_SYNC when touch mountpoints
Karel Zak [Mon, 17 Apr 2023 12:23:18 +0000 (14:23 +0200)] 
libmount: use AT_STATX_DONT_SYNC when touch mountpoints

* prefer statx() with AT_STATX_DONT_SYNC if available
* keep fstatat() and stat() as fallback
* add test to mnt_stat_mountpoint()

The goal is to minimize situations when we need classic stat() because
it triggers automount, and stat() syscall may hang on unreachable
network filesystems. The automount issue was resolved years ago by
AT_NO_AUTOMOUNT; now we can use statx() to fix also hangs on NFS.

Addresses: https://github.com/util-linux/util-linux/issues/2049
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibmount: don't define struct stat is unnecessary
Karel Zak [Mon, 17 Apr 2023 11:22:03 +0000 (13:22 +0200)] 
libmount: don't define struct stat is unnecessary

Let's introduce simple function to hide 'struct stat' if unnecessary.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'libblkid/crc32c-exclude' of https://github.com/t-8ch/util-linux
Karel Zak [Mon, 17 Apr 2023 11:06:01 +0000 (13:06 +0200)] 
Merge branch 'libblkid/crc32c-exclude' of https://github.com/t-8ch/util-linux

* 'libblkid/crc32c-exclude' of https://github.com/t-8ch/util-linux:
  libblkid: xfs: clean up call to ul_crc32_exclude_offset
  libblkid: erofs: calculate checksum with offset

2 years agohwclock: use kernel struct rtc_time for RTC ioctls
Karel Zak [Mon, 17 Apr 2023 10:29:40 +0000 (12:29 +0200)] 
hwclock: use kernel struct rtc_time for RTC ioctls

Based on patch from Matt Nourse.

Addresses: https://github.com/util-linux/util-linux/pull/2123
Reported-by: Matthew Nourse <matthew@nplus1.com.au>
Signed-off-by: Karel Zak <kzak@redhat.com>