]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
2 years agotests: allow paths in tests to contain '@' char
David Anes [Fri, 9 Dec 2022 17:09:31 +0000 (18:09 +0100)] 
tests: allow paths in tests to contain '@' char

Tests fail when the build directory contains
'@' in its path, as its sent to 'sed' unescaped.

This patch allows to build in such environments,
which typically happen on automated systems (for
example, when building concurrently with Jenkins).

2 years agotests: use KNOWN_FAIL for lsns/ioctl_ns
Karel Zak [Fri, 9 Dec 2022 10:28:25 +0000 (11:28 +0100)] 
tests: use KNOWN_FAIL for lsns/ioctl_ns

It seems 32bit userspace on 64bit kernel return ENOTTY for
NS_GET_USERNS ioctl (for example when execute tests in mock
environment).

Addresses: https://github.com/util-linux/util-linux/pull/1924
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agohardlink: cleanup options
Karel Zak [Thu, 8 Dec 2022 10:12:47 +0000 (11:12 +0100)] 
hardlink: cleanup options

* add missing stuff to bash-completion
* reorder --help output
* reorder man page

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agohardlink: add --respect-dir
Karel Zak [Thu, 8 Dec 2022 09:49:45 +0000 (10:49 +0100)] 
hardlink: add --respect-dir

Fixes: https://github.com/util-linux/util-linux/issues/1942
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoblkdiscard: add extra exit code when device does not support discard
Karel Zak [Wed, 7 Dec 2022 10:43:20 +0000 (11:43 +0100)] 
blkdiscard: add extra exit code when device does not support discard

Fixes: https://github.com/util-linux/util-linux/issues/1941
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agobash-completion: add blkdiscard --quiet
Karel Zak [Wed, 7 Dec 2022 10:13:48 +0000 (11:13 +0100)] 
bash-completion: add blkdiscard --quiet

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoblkdiscard: sort options
Karel Zak [Wed, 7 Dec 2022 10:12:13 +0000 (11:12 +0100)] 
blkdiscard: sort options

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoblkdiscard: add --quiet
Karel Zak [Wed, 7 Dec 2022 10:11:08 +0000 (11:11 +0100)] 
blkdiscard: add --quiet

Addresses: https://github.com/util-linux/util-linux/issues/1941
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agobuild-sys: add hint to have_pty check
Karel Zak [Wed, 7 Dec 2022 09:17:07 +0000 (10:17 +0100)] 
build-sys: add hint to have_pty check

Fixes: https://github.com/util-linux/util-linux/issues/1943
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agotests: add SPDX-License-Identifier to helper
Karel Zak [Mon, 5 Dec 2022 11:51:03 +0000 (12:51 +0100)] 
tests: add SPDX-License-Identifier to helper

The default util-linux license is GPL-2.0-or-later. The header is
missing in some files or quotation from the license is incomplete. It
seem the best is to use the License-Identifier header to make things
more obvious and readable for code analyzers, etc.

Fixes: https://github.com/util-linux/util-linux/issues/1932
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoldattach: fix --intro-command and --pause
Karel Zak [Mon, 5 Dec 2022 11:36:42 +0000 (12:36 +0100)] 
ldattach: fix --intro-command and --pause

The long version of the command line options should not ignore arguments.

Fixes: https://github.com/util-linux/util-linux/issues/1940
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibblkid: add BLKID_SUBLKS_FSINFO to docs
Karel Zak [Mon, 5 Dec 2022 11:03:19 +0000 (12:03 +0100)] 
libblkid: add BLKID_SUBLKS_FSINFO to docs

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibblkid: cleanup definitions and add docs for return values
Karel Zak [Mon, 5 Dec 2022 10:57:13 +0000 (11:57 +0100)] 
libblkid: cleanup definitions and add docs for return values

* make it possible to use #ifdef for the return values

* add docs for the return values

Addresses: https://github.com/util-linux/util-linux/issues/1939
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibblkid: define probing return values
Karel Zak [Fri, 2 Dec 2022 08:20:18 +0000 (09:20 +0100)] 
libblkid: define probing return values

Don't use magic numbers in library and applications code.

Fixes: https://github.com/util-linux/util-linux/issues/1939
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agotests: be explicit with ext2 block size
Karel Zak [Thu, 1 Dec 2022 15:40:57 +0000 (16:40 +0100)] 
tests: be explicit with ext2 block size

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'autotools/show-diff' of https://github.com/t-8ch/util-linux
Karel Zak [Thu, 1 Dec 2022 14:56:45 +0000 (15:56 +0100)] 
Merge branch 'autotools/show-diff' of https://github.com/t-8ch/util-linux

* 'autotools/show-diff' of https://github.com/t-8ch/util-linux:
  autotools: show test failure diff

2 years agoMerge branch 'lsfd--fix-format-to-scan-maps' of https://github.com/masatake/util...
Karel Zak [Thu, 1 Dec 2022 14:55:24 +0000 (15:55 +0100)] 
Merge branch 'lsfd--fix-format-to-scan-maps' of https://github.com/masatake/util-linux

* 'lsfd--fix-format-to-scan-maps' of https://github.com/masatake/util-linux:
  lsfd: consider 64bit addresses when scanning /proc/pid/map_files dir

2 years agoMerge branch 'meson/econf' of https://github.com/t-8ch/util-linux
Karel Zak [Thu, 1 Dec 2022 14:54:53 +0000 (15:54 +0100)] 
Merge branch 'meson/econf' of https://github.com/t-8ch/util-linux

* 'meson/econf' of https://github.com/t-8ch/util-linux:
  meson: logindefs.c: handle libeconf dependency

2 years agotests: add blkid --offset test
Karel Zak [Thu, 1 Dec 2022 14:08:19 +0000 (15:08 +0100)] 
tests: add blkid --offset test

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoautotools: show test failure diff
Thomas Weißschuh [Wed, 30 Nov 2022 04:57:12 +0000 (05:57 +0100)] 
autotools: show test failure diff

This helps investigating issues, especially spurious errors only
happening during CI like the failure of "hardlink/options-maximum-size-8192"

2 years agolsfd: consider 64bit addresses when scanning /proc/pid/map_files dir
Masatake YAMATO [Wed, 30 Nov 2022 05:55:32 +0000 (14:55 +0900)] 
lsfd: consider 64bit addresses when scanning /proc/pid/map_files dir

Close #1930.

The original code assumed 48bit addresses. This assumption came
from linux running on x86_64. As reported in #1930, Linux on
sparc64 uses 64bit addresses.

Tested-by: Anatoly Pugachev <matorola@gmail.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agomeson: logindefs.c: handle libeconf dependency
Thomas Weißschuh [Wed, 30 Nov 2022 04:30:31 +0000 (05:30 +0100)] 
meson: logindefs.c: handle libeconf dependency

2 years agolibmount: use autofs mount hint to ignore autofs mount entries
Ian Kent [Thu, 24 Nov 2022 08:54:19 +0000 (16:54 +0800)] 
libmount: use autofs mount hint to ignore autofs mount entries

Historically autofs mounts were not included in mount table listings.
This is the case in other SysV autofs implementations and was also
the case with Linux autofs.

But now that /etc/mtab is a symlink to the proc filesystem mount
table the autofs mount entries appear in the mount table on Linux.

Prior to the symlinking of /etc/mtab mount table it was sufficient
to call mount(2) and simply not update /etc/mtab to exclude autofs
mounts from mount listings.

Also, with this symlinking of /etc/mtab we have seen a shift in usage
toward using the proc mount tables directly.

But the autofs mount entries need to be retained when coming from the
proc file system for applications that need them (such as systemd) so
filtering out these entries within the kernel itself can't be done,
it needs be done in user space.

There are three reasons to omit the autofs mount entries.

One is that certain types of auto-mounts have an autofs mount for every
entry in their autofs mount map (autofs direct mounts) and these maps
can be quite large. This leads to mount table listings containing a lot
of unnecessary entries.

Also, this difference in behaviour between autofs implementations can
cause problems for applications that need to use the mount table and
expect autofs entries aren't present.

Lastly, there's very little that user space can do with autofs mount
entries since this must be left to the autofs mount owner, typically
the automount daemon. And it can also lead to attempts to access
automount managed paths resulting in mounts being triggered when they
aren't needed or mounts staying mounted for much longer thay they
need to be.

So the Linux autofs file system has been modified to accept a pseudo
mount option of "ignore" (as is used in other OS implementations) so
that user space utilities can use this as a hint to skip these autofs
entries on reading the mount table.

The Linux autofs automount daemon used getmntent(3) itself and has been
modified to use the proc file system directly so that it isn't affected
by the presence of the "ignore" mount option.

The use of the "ignore" mount option is opt-in by autofs users and a
configuration option has been added which defaults to not use the option
so if there are applications that need these entries, other than autofs
itself, they can be retained. Also, since this filtering is based on an
added mount option earlier versions of Linux autofs and other autofs file
system users will not use the option and so won't be affected by the change.

Changes in v2:
- make naming consistent with util-linux conventions.
- make ignoring autofs mount entries the default since it will only
  have an effect if it has been enabled in the autofs configuration.
- drop patch to set ingore autofs mounts for mount(8) since it's now
  default.

Signed-off-by: Ian Kent <raven@themaw.net>
2 years agolibblkid: squashfs: report filesystem size
Thomas Weißschuh [Tue, 29 Nov 2022 02:46:18 +0000 (03:46 +0100)] 
libblkid: squashfs: report filesystem size

2 years agolibblkid: squashfs: report block sizes
Thomas Weißschuh [Tue, 29 Nov 2022 02:44:11 +0000 (03:44 +0100)] 
libblkid: squashfs: report block sizes

2 years agolibblkid: squashfs: add more superblock fields
Thomas Weißschuh [Tue, 29 Nov 2022 02:41:37 +0000 (03:41 +0100)] 
libblkid: squashfs: add more superblock fields

Also rename the existing fields to match the documentation.
We use the Version 4 fields because we will use those in a future
commit.

Field names taken from
https://dr-emann.github.io/squashfs/squashfs.html#_the_superblock

2 years agorename: (bash-completion) fix typo
Karel Zak [Mon, 28 Nov 2022 08:47:18 +0000 (09:47 +0100)] 
rename: (bash-completion) fix typo

Fixes: https://github.com/util-linux/util-linux/issues/1928
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'bcache/pack' of https://github.com/t-8ch/util-linux
Karel Zak [Mon, 28 Nov 2022 08:29:26 +0000 (09:29 +0100)] 
Merge branch 'bcache/pack' of https://github.com/t-8ch/util-linux

* 'bcache/pack' of https://github.com/t-8ch/util-linux:
  libblkid: bcache: pack superblock struct

2 years agolibblkid: bcache: pack superblock struct
Thomas Weißschuh [Fri, 25 Nov 2022 13:51:14 +0000 (14:51 +0100)] 
libblkid: bcache: pack superblock struct

2 years agodmesg: allow specification of level range
Thomas Weißschuh [Mon, 21 Nov 2022 02:19:16 +0000 (03:19 +0100)] 
dmesg: allow specification of level range

2 years agoMerge branch 'fix-exfat2' of https://github.com/mbroz/util-linux
Karel Zak [Thu, 24 Nov 2022 19:52:30 +0000 (20:52 +0100)] 
Merge branch 'fix-exfat2' of https://github.com/mbroz/util-linux

* 'fix-exfat2' of https://github.com/mbroz/util-linux:
  libblkid: fix misaligned-address in probe_exfat

2 years agoMerge branch 'lsfd-nsfs' of https://github.com/masatake/util-linux
Karel Zak [Thu, 24 Nov 2022 19:51:32 +0000 (20:51 +0100)] 
Merge branch 'lsfd-nsfs' of https://github.com/masatake/util-linux

* 'lsfd-nsfs' of https://github.com/masatake/util-linux:
  lsfd: show extra information returned from ioctl(..., NS_GET_NSTYPE)
  lsfd: collect namespace files after collecting information about "nodev" fs
  lsfd: introduce is_mapped_file macro
  lsfd: introduce is_opened_file macro

2 years agolibblkid: fix misaligned-address in probe_exfat
Milan Broz [Thu, 24 Nov 2022 09:54:01 +0000 (10:54 +0100)] 
libblkid: fix misaligned-address in probe_exfat

Value checked in le32_to_cpu() needs to be properly
aligned. Just copy the value temporarily for conversion.

Fix OSS-Fuzz issue 53696

2 years agolsfd: show extra information returned from ioctl(..., NS_GET_NSTYPE)
Masatake YAMATO [Thu, 10 Nov 2022 21:09:57 +0000 (06:09 +0900)] 
lsfd: show extra information returned from ioctl(..., NS_GET_NSTYPE)

lsfd uses the information to fill the newly added NS.TYPE and NS.NAME
columns:

  # ./lsfd -oCOMMAND,PID,USER,ASSOC,SOURCE,MNTID,NS.TYPE,NS.NAME,NAME
           -Q '(FD >= 0) and (SOURCE == "nsfs")'
  COMMAND            PID USER ASSOC SOURCE MNTID NS.TYPE          NS.NAME NAME
  NetworkManager    1114 root     8   nsfs     3     net net:[4026531840] net:[4026531840]
  NetworkManager    1114 root     9   nsfs     3     mnt mnt:[4026532758] mnt:[4026532758]
  lsfd             14379 root     3   nsfs     3     net net:[4026531840] net:[4026531840]
  podman         1532759 root     7   nsfs  1546     net net:[4026533029] /run/netns/netns-4f5ecc46-d6a0-175c-46a8-2e4ba180b94a

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: collect namespace files after collecting information about "nodev" fs
Masatake YAMATO [Wed, 23 Nov 2022 06:41:57 +0000 (15:41 +0900)] 
lsfd: collect namespace files after collecting information about "nodev" fs

In my plan, lsfd will need the information of the backing device for
"nsfs" file system before collecing the information about th namespaces
associated with fds.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: introduce is_mapped_file macro
Masatake YAMATO [Thu, 10 Nov 2022 21:02:00 +0000 (06:02 +0900)] 
lsfd: introduce is_mapped_file macro

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: introduce is_opened_file macro
Masatake YAMATO [Thu, 10 Nov 2022 20:54:28 +0000 (05:54 +0900)] 
lsfd: introduce is_opened_file macro

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agotests: wrap $TS_{TOPDIR,SELF} in "." cmdline with double quote chars
Masatake YAMATO [Wed, 23 Nov 2022 07:03:37 +0000 (16:03 +0900)] 
tests: wrap $TS_{TOPDIR,SELF} in "." cmdline with double quote chars

The command lines used for this change:

  $ cd tests/ts
  $ sed  -i -e 's|. $TS_SELF/|. "$TS_SELF"/|'  $(grep --exclude='*~' -lr -e '^\. \$TS_SELF/')
  $ sed -i -e 's|. $TS_TOPDIR/functions.sh|. "$TS_TOPDIR"/functions.sh|'  $(grep --exclude='*~' -lr -e '^\. \$TS_TOPDIR/functions.sh')

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agocfdisk: prevent unused variables
Thomas Weißschuh [Mon, 21 Nov 2022 03:17:44 +0000 (04:17 +0100)] 
cfdisk: prevent unused variables

2 years agofileeq/lsfd: use correct format specifier
Thomas Weißschuh [Mon, 21 Nov 2022 02:50:06 +0000 (03:50 +0100)] 
fileeq/lsfd: use correct format specifier

2 years agoMerge branch 'btrfs/checksums' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 22 Nov 2022 13:30:11 +0000 (14:30 +0100)] 
Merge branch 'btrfs/checksums' of https://github.com/t-8ch/util-linux

* 'btrfs/checksums' of https://github.com/t-8ch/util-linux:
  libblkid: btrfs: add support for xxhash checksums
  lib: xxhash: customize for util-linux
  lib: add xxhash implementation
  libblkid: btrfs: add support for sha256 checksums
  libblkid: add function blkid_probe_verify_csum_buf
  libblkid: btrfs: prepare for more checksum algorithms

2 years agolibblkid: fix misaligned-address in probe_erofs
Milan Broz [Tue, 22 Nov 2022 11:37:11 +0000 (12:37 +0100)] 
libblkid: fix misaligned-address in probe_erofs

Erofs on-disk superblock struct should be marked as packed
to avoid default struct members alignment.

Fix OSS-Fuzz issue 53615

2 years agolibblkid: btrfs: add support for xxhash checksums
Thomas Weißschuh [Fri, 18 Nov 2022 19:07:37 +0000 (20:07 +0100)] 
libblkid: btrfs: add support for xxhash checksums

2 years agolib: xxhash: customize for util-linux
Thomas Weißschuh [Sun, 20 Nov 2022 21:34:02 +0000 (22:34 +0100)] 
lib: xxhash: customize for util-linux

2 years agolib: add xxhash implementation
Thomas Weißschuh [Fri, 18 Nov 2022 17:41:50 +0000 (18:41 +0100)] 
lib: add xxhash implementation

Release v0.8.1 from https://github.com/Cyan4973/xxHash

2 years agolibblkid: btrfs: add support for sha256 checksums
Thomas Weißschuh [Fri, 18 Nov 2022 19:02:54 +0000 (20:02 +0100)] 
libblkid: btrfs: add support for sha256 checksums

2 years agolibblkid: add function blkid_probe_verify_csum_buf
Thomas Weißschuh [Sat, 19 Nov 2022 00:55:40 +0000 (01:55 +0100)] 
libblkid: add function blkid_probe_verify_csum_buf

This function is more convenient for checksums with longer digests.

2 years agolibblkid: btrfs: prepare for more checksum algorithms
Thomas Weißschuh [Fri, 18 Nov 2022 18:54:33 +0000 (19:54 +0100)] 
libblkid: btrfs: prepare for more checksum algorithms

2 years agoscript: abort if unused arguments are given
Chris Hofstaedtler [Fri, 18 Nov 2022 13:23:37 +0000 (13:23 +0000)] 
script: abort if unused arguments are given

scripts uses either a free-standing "file" argument, or the value
passed as --log-out "file". Additional filenames are ignored.
They are also ignored if --log-in "file" is given, as it turns off
output logging by default (can still be overriden by adding --log-out).
Avoid surprises when passing multiple filenames by writing usage
message instead.

[kzak@redhat.com: - use errtryhelp() rather than usage()]

Signed-off-by: Chris Hofstaedtler <zeha@debian.org>
Reported-by: наб <nabijaczleweli@nabijaczleweli.xyz>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1016193
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'meson/colors' of https://github.com/t-8ch/util-linux
Karel Zak [Mon, 21 Nov 2022 08:56:10 +0000 (09:56 +0100)] 
Merge branch 'meson/colors' of https://github.com/t-8ch/util-linux

* 'meson/colors' of https://github.com/t-8ch/util-linux:
  meson: implement colors-default

2 years agoMerge branch 'master' of https://github.com/rsaxvc/util-linux
Karel Zak [Mon, 21 Nov 2022 08:55:31 +0000 (09:55 +0100)] 
Merge branch 'master' of https://github.com/rsaxvc/util-linux

* 'master' of https://github.com/rsaxvc/util-linux:
  irqtop: improve delta-sort stability

2 years agoMerge branch 'exfat/fields' of https://github.com/t-8ch/util-linux
Karel Zak [Mon, 21 Nov 2022 08:54:36 +0000 (09:54 +0100)] 
Merge branch 'exfat/fields' of https://github.com/t-8ch/util-linux

* 'exfat/fields' of https://github.com/t-8ch/util-linux:
  libblkid: dos: ignore exfat superblocks
  libblkid: exfat: report filesystem size
  libblkid: exfat: validate more fields
  libblkid: exfat: rename superblocks fields to match specification

2 years agoinclude: don't use UL_NG_ prefix
Karel Zak [Mon, 21 Nov 2022 08:50:07 +0000 (09:50 +0100)] 
include: don't use UL_NG_ prefix

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'cifuzz-32-bit' of https://github.com/evverx/util-linux
Karel Zak [Mon, 21 Nov 2022 08:34:13 +0000 (09:34 +0100)] 
Merge branch 'cifuzz-32-bit' of https://github.com/evverx/util-linux

* 'cifuzz-32-bit' of https://github.com/evverx/util-linux:
  ci: run fuzz targets on i386 as well

2 years agoMerge branch 'alignment-check' of https://github.com/evverx/util-linux
Karel Zak [Mon, 21 Nov 2022 08:33:46 +0000 (09:33 +0100)] 
Merge branch 'alignment-check' of https://github.com/evverx/util-linux

* 'alignment-check' of https://github.com/evverx/util-linux:
  oss-fuzz: turn on the alignment check explicitly

2 years agoirqtop: improve delta-sort stability
Richard Allen [Sun, 20 Nov 2022 20:49:43 +0000 (14:49 -0600)] 
irqtop: improve delta-sort stability

When sorting irqs by delta, sort first by delta, then by name.
This helps interrupts occuring at the same rate reach a more
stable display ordering.

Signed-off-by: Richard Allen <rsaxvc@gmail.com>
2 years agomeson: implement colors-default
Thomas Weißschuh [Mon, 21 Nov 2022 01:49:40 +0000 (02:49 +0100)] 
meson: implement colors-default

2 years agolibblkid: dos: ignore exfat superblocks
Thomas Weißschuh [Sun, 20 Nov 2022 04:50:16 +0000 (05:50 +0100)] 
libblkid: dos: ignore exfat superblocks

2 years agolibblkid: exfat: report filesystem size
Thomas Weißschuh [Sat, 19 Nov 2022 19:53:11 +0000 (20:53 +0100)] 
libblkid: exfat: report filesystem size

2 years agolibblkid: exfat: validate more fields
Thomas Weißschuh [Sat, 19 Nov 2022 19:37:50 +0000 (20:37 +0100)] 
libblkid: exfat: validate more fields

2 years agolibblkid: exfat: rename superblocks fields to match specification
Thomas Weißschuh [Sat, 19 Nov 2022 19:32:30 +0000 (20:32 +0100)] 
libblkid: exfat: rename superblocks fields to match specification

Now that we have access to the official exFAT specification [0], let's
use its nomenclature.

[0] https://learn.microsoft.com/en-us/windows/win32/fileio/exfat-specification

2 years agoci: run fuzz targets on i386 as well
Evgeny Vereshchagin [Fri, 18 Nov 2022 07:37:29 +0000 (07:37 +0000)] 
ci: run fuzz targets on i386 as well

2 years agooss-fuzz: turn on the alignment check explicitly
Evgeny Vereshchagin [Fri, 18 Nov 2022 07:09:30 +0000 (07:09 +0000)] 
oss-fuzz: turn on the alignment check explicitly

to somewhat cover architectures where unaligned access can lead to
crashes and make it possible for OSS-Fuzz to catch issues like
https://github.com/util-linux/util-linux/pull/1906.

With this patch applied the libblkid fuzz target built with the OSS-Fuzz
toolchain triggers "runtime error: load of misaligned address" in `probe_exfat`
so it seems to be working.

2 years agomeson: enable warnings
Thomas Weißschuh [Wed, 2 Nov 2022 03:38:07 +0000 (04:38 +0100)] 
meson: enable warnings

2 years agoscript: fix use of utempter
Karel Zak [Wed, 16 Nov 2022 08:19:18 +0000 (09:19 +0100)] 
script: fix use of utempter

libutempter uses SIGCHLD, but script(1) pty implementation completely
control all signals by signalfd and utempter does not work.

The solution is to setup signalfd later (after libutempter use).

Fixes: https://github.com/util-linux/util-linux/issues/1904
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agollib/pty-session: split PTY and signalfd setup
Karel Zak [Wed, 16 Nov 2022 08:17:52 +0000 (09:17 +0100)] 
llib/pty-session: split PTY and signalfd setup

In some cases applications need to use PTY before signalfd is enabled.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agobash-completion: add --zero to rev module
Karel Zak [Wed, 16 Nov 2022 07:48:43 +0000 (08:48 +0100)] 
bash-completion: add --zero to rev module

Addresses: https://github.com/util-linux/util-linux/pull/1900
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'rev0' of https://github.com/t-8ch/util-linux
Karel Zak [Wed, 16 Nov 2022 07:46:29 +0000 (08:46 +0100)] 
Merge branch 'rev0' of https://github.com/t-8ch/util-linux

* 'rev0' of https://github.com/t-8ch/util-linux:
  rev: allow zero-byte as separator
  rev: make separator configurable
  rev: use pointer-size-pairs instead of C-string

2 years agoMerge branch 'oss-fuzz' of https://github.com/t-8ch/util-linux
Karel Zak [Wed, 16 Nov 2022 07:36:19 +0000 (08:36 +0100)] 
Merge branch 'oss-fuzz' of https://github.com/t-8ch/util-linux

* 'oss-fuzz' of https://github.com/t-8ch/util-linux:
  libblkid: iso9660: allocate enough space for UTF16 decoding
  libblkid: ntfs: avoid UB in signed shift

2 years agolibblkid: iso9660: allocate enough space for UTF16 decoding
Thomas Weißschuh [Thu, 10 Nov 2022 18:48:20 +0000 (19:48 +0100)] 
libblkid: iso9660: allocate enough space for UTF16 decoding

When merge_utf16be_ascii() encounters high-codepoint surrogate pairs it
emits four bytes of output for one byte of ascii input.
In addition with the remaining ascii characters from the second loop we
need up to 5 * sizeof(input) / 2 bytes as output buffer.

As we decode up to 128 ascii characters with merge_utf16be_ascii() we
need 320 bytes of buffer available.

Furthermore adapt merge_utf16be_ascii() to not write paste the output
buffer end.

Fix OSS-Fuzz issue 53149 ( #1887 )

2 years agoMerge branch 'widestring-check' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 15 Nov 2022 13:42:47 +0000 (14:42 +0100)] 
Merge branch 'widestring-check' of https://github.com/t-8ch/util-linux

* 'widestring-check' of https://github.com/t-8ch/util-linux:
  tests: properly check for widestring functionality

2 years agoMerge branch 'blkid_fuzz' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 15 Nov 2022 13:39:03 +0000 (14:39 +0100)] 
Merge branch 'blkid_fuzz' of https://github.com/t-8ch/util-linux

* 'blkid_fuzz' of https://github.com/t-8ch/util-linux:
  test_blkid_fuzz: fix test execution

2 years agoMerge branch 'unaligned-access' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 15 Nov 2022 13:32:36 +0000 (14:32 +0100)] 
Merge branch 'unaligned-access' of https://github.com/t-8ch/util-linux

* 'unaligned-access' of https://github.com/t-8ch/util-linux:
  libblkid: f2fs: fix unaligned access
  libblkid: bitlocker: fix unaligned access

2 years agoMerge branch 'lsns--timens' of https://github.com/masatake/util-linux
Karel Zak [Mon, 14 Nov 2022 12:13:55 +0000 (13:13 +0100)] 
Merge branch 'lsns--timens' of https://github.com/masatake/util-linux

* 'lsns--timens' of https://github.com/masatake/util-linux:
  lsns: add TIMENS to the map from CLONE_* to LSNS_ID_*

2 years agosfdisk: (man) fix man page move example
Karel Zak [Mon, 14 Nov 2022 12:12:53 +0000 (13:12 +0100)] 
sfdisk: (man) fix man page move example

Fixes: #1902
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibblkid: f2fs: fix unaligned access
Thomas Weißschuh [Mon, 14 Nov 2022 03:19:34 +0000 (04:19 +0100)] 
libblkid: f2fs: fix unaligned access

2 years agolibblkid: bitlocker: fix unaligned access
Thomas Weißschuh [Mon, 14 Nov 2022 03:18:57 +0000 (04:18 +0100)] 
libblkid: bitlocker: fix unaligned access

Value of 64 has been chose arbitrarily

2 years agorev: allow zero-byte as separator
Thomas Weißschuh [Sat, 12 Nov 2022 04:32:33 +0000 (05:32 +0100)] 
rev: allow zero-byte as separator

Fixes #1868

2 years agotests: properly check for widestring functionality
Thomas Weißschuh [Sun, 13 Nov 2022 01:38:40 +0000 (02:38 +0100)] 
tests: properly check for widestring functionality

Instead of blindly disabling those test under qemu-user use proper
feature-tests.

2 years agorev: make separator configurable
Thomas Weißschuh [Sat, 12 Nov 2022 19:30:59 +0000 (20:30 +0100)] 
rev: make separator configurable

2 years agorev: use pointer-size-pairs instead of C-string
Thomas Weißschuh [Sat, 12 Nov 2022 04:09:38 +0000 (05:09 +0100)] 
rev: use pointer-size-pairs instead of C-string

This allows us to properly handle zero-bytes

2 years agotest_blkid_fuzz: fix test execution
Thomas Weißschuh [Sat, 12 Nov 2022 14:16:32 +0000 (15:16 +0100)] 
test_blkid_fuzz: fix test execution

2 years agolibblkid: ntfs: avoid UB in signed shift
Thomas Weißschuh [Thu, 10 Nov 2022 17:35:00 +0000 (18:35 +0100)] 
libblkid: ntfs: avoid UB in signed shift

Fix OSS-Fuzz issue 53142 ( #1886 )
Fix OSS-Fuzz issue 53160 ( #1888 )

2 years agolsns: add TIMENS to the map from CLONE_* to LSNS_ID_*
Masatake YAMATO [Thu, 10 Nov 2022 21:25:03 +0000 (06:25 +0900)] 
lsns: add TIMENS to the map from CLONE_* to LSNS_ID_*

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agoMerge branch 'meson/fixes' of https://github.com/t-8ch/util-linux
Karel Zak [Thu, 10 Nov 2022 08:49:20 +0000 (09:49 +0100)] 
Merge branch 'meson/fixes' of https://github.com/t-8ch/util-linux

* 'meson/fixes' of https://github.com/t-8ch/util-linux:
  meson: libmount: compile test helpers
  pylibmount: properly mark initialization function
  meson: define USE_LIBMOUNT_SUPPORT_NAMESPACES
  dmesg: move fallthrough comment to correct place
  meson: use -Wno-cast-function-type for libmount python bindings
  meson: fix test for HAVE_LANGINFO_H

2 years agomore: update basic command description
Karel Zak [Thu, 10 Nov 2022 08:39:47 +0000 (09:39 +0100)] 
more: update basic command  description

Fixes: https://github.com/util-linux/util-linux/discussions/1891
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agofdisk: make it more obvious that DOS means MBR
Karel Zak [Thu, 10 Nov 2022 08:24:23 +0000 (09:24 +0100)] 
fdisk: make it more obvious that DOS means MBR

Fixes: https://github.com/util-linux/util-linux/issues/1890
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agomeson: libmount: compile test helpers
Thomas Weißschuh [Thu, 3 Nov 2022 15:47:36 +0000 (16:47 +0100)] 
meson: libmount: compile test helpers

2 years agopylibmount: properly mark initialization function
Thomas Weißschuh [Thu, 10 Nov 2022 03:05:30 +0000 (04:05 +0100)] 
pylibmount: properly mark initialization function

The module initialization function is supposed to only public function
in a module.
Newer versions of meson use -fvisibility=hidden and expected this
function to be marked with PyMODINIT_FUNC [0].

As this does not hurt on autotools either, let's use it everywhere.

[0] https://mesonbuild.com/Release-notes-for-0-63-0.html#python-extension-modules-now-build-with-hidden-visibility

2 years agomeson: define USE_LIBMOUNT_SUPPORT_NAMESPACES
Thomas Weißschuh [Wed, 2 Nov 2022 04:19:19 +0000 (05:19 +0100)] 
meson: define USE_LIBMOUNT_SUPPORT_NAMESPACES

This works around warnings about unused parameters.
To be correct we should be checking for the setns syscall, but so far we
don't have logic for this in meson.

2 years agodmesg: move fallthrough comment to correct place
Thomas Weißschuh [Wed, 2 Nov 2022 04:19:11 +0000 (05:19 +0100)] 
dmesg: move fallthrough comment to correct place

For some reason the existing location is accepted by the autotools build
but not by meson.

2 years agomeson: use -Wno-cast-function-type for libmount python bindings
Thomas Weißschuh [Wed, 2 Nov 2022 04:19:03 +0000 (05:19 +0100)] 
meson: use -Wno-cast-function-type for libmount python bindings

The same way it is done by autotools.

2 years agomeson: fix test for HAVE_LANGINFO_H
Thomas Weißschuh [Wed, 2 Nov 2022 03:38:12 +0000 (04:38 +0100)] 
meson: fix test for HAVE_LANGINFO_H

2 years agoMerge branch 'fix/rfkill-bash-completion-toggle' of https://github.com/dpeukert/util...
Karel Zak [Wed, 9 Nov 2022 11:24:44 +0000 (12:24 +0100)] 
Merge branch 'fix/rfkill-bash-completion-toggle' of https://github.com/dpeukert/util-linux

* 'fix/rfkill-bash-completion-toggle' of https://github.com/dpeukert/util-linux:
  rfkill: add toggle to bash completion

2 years agoskip btrfs tests if kernel support for btrfs is missing
Anatoly Pugachev [Wed, 9 Nov 2022 09:00:12 +0000 (12:00 +0300)] 
skip btrfs tests if kernel support for btrfs is missing

2 years agorfkill: add toggle to bash completion
Daniel Peukert [Tue, 8 Nov 2022 18:48:08 +0000 (19:48 +0100)] 
rfkill: add toggle to bash completion

Signed-off-by: Daniel Peukert <daniel@peukert.cc>
2 years agoMerge branch 'blkid_fuzzing' of https://github.com/xflord/util-linux
Karel Zak [Tue, 8 Nov 2022 09:56:18 +0000 (10:56 +0100)] 
Merge branch 'blkid_fuzzing' of https://github.com/xflord/util-linux

* 'blkid_fuzzing' of https://github.com/xflord/util-linux:
  libblkid: new fuzz target

2 years agobash-completion: update lsns
Karel Zak [Tue, 8 Nov 2022 09:11:57 +0000 (10:11 +0100)] 
bash-completion: update lsns

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolsns: show persistent namespace, add --persistent
Karel Zak [Tue, 8 Nov 2022 09:09:28 +0000 (10:09 +0100)] 
lsns: show persistent namespace, add --persistent

* show persistent namespaces (without processes) by default
* add option --persistent only these namespaces

Fixes: https://github.com/util-linux/util-linux/issues/1881
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibblkid: new fuzz target
David Flor [Fri, 28 Oct 2022 15:31:03 +0000 (17:31 +0200)] 
libblkid: new fuzz target

* Added new fuzz target calling blkid_do_safeprobe(), mainly based off of how libblkid is used in the cryptsetup project (same flags used etc.)
* Added the fuzz target to the Makemodule and all relevant scripts.
* Made as part of my upcoming bachelor thesis.

Signed-off-by: David Flor <493294@muni.cz>