]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
10 months agoMerge branch 'coverage-tweaks' of https://github.com/mrc0mmand/util-linux
Karel Zak [Thu, 22 Jun 2023 12:19:07 +0000 (14:19 +0200)] 
Merge branch 'coverage-tweaks' of https://github.com/mrc0mmand/util-linux

* 'coverage-tweaks' of https://github.com/mrc0mmand/util-linux:
  ci: collect coverage on _exit() as well
  ci: hide coverage-related stuff begind --enable-coverage
  ci: tweak build dir's ACL when collecting coverage
  ci: fix indentation

10 months agoMerge branch 'cancel-jobs-on-push' of https://github.com/mrc0mmand/util-linux
Karel Zak [Thu, 22 Jun 2023 12:15:46 +0000 (14:15 +0200)] 
Merge branch 'cancel-jobs-on-push' of https://github.com/mrc0mmand/util-linux

* 'cancel-jobs-on-push' of https://github.com/mrc0mmand/util-linux:
  ci: cancel running jobs on push

10 months agoci: cancel running jobs on push
Frantisek Sumsal [Thu, 22 Jun 2023 10:33:12 +0000 (12:33 +0200)] 
ci: cancel running jobs on push

Let's cancel already running GH Actions jobs when a PR is (force) pushed
to conserve resources and make the CI runs faster thanks to the freed up
queue.

10 months agoci: collect coverage on _exit() as well
Frantisek Sumsal [Tue, 20 Jun 2023 21:01:35 +0000 (23:01 +0200)] 
ci: collect coverage on _exit() as well

_exit() skips the gcov hooks, so we lose all coverage collected up to
that point. Let's work around this by intercepting _exit() with our
wrapper that calls __gcov_dump() just before _exit().

10 months agoci: hide coverage-related stuff begind --enable-coverage
Frantisek Sumsal [Tue, 20 Jun 2023 21:00:28 +0000 (23:00 +0200)] 
ci: hide coverage-related stuff begind --enable-coverage

10 months agoci: tweak build dir's ACL when collecting coverage
Frantisek Sumsal [Tue, 20 Jun 2023 14:25:07 +0000 (16:25 +0200)] 
ci: tweak build dir's ACL when collecting coverage

So gcov can create necessary directories/.gcda files even with dropped
privileges.

10 months agohwclock: add --vl-read, --vl-clear documentation and bash-completion
Rasmus Villemoes [Wed, 21 Jun 2023 20:18:23 +0000 (22:18 +0200)] 
hwclock: add --vl-read, --vl-clear documentation and bash-completion

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
10 months agohwclock: add support for RTC_VL_READ/RTC_VL_CLR ioctls
Rasmus Villemoes [Tue, 13 Jun 2023 10:14:28 +0000 (12:14 +0200)] 
hwclock: add support for RTC_VL_READ/RTC_VL_CLR ioctls

Implement a way for userspace to query the status of the backup
battery, if supported by the hardware and driver.

The RTC_VL_* bits are a somewhat recent addition (3431ca4837bf, but
really only from b0efe0281234) to the uapi header,
so provide our own definition if the build host's header doesn't.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
10 months agosfdisk: add hint about duplicate UUIDs when use dump
Karel Zak [Wed, 21 Jun 2023 08:57:37 +0000 (10:57 +0200)] 
sfdisk: add hint about duplicate UUIDs when use dump

Signed-off-by: Karel Zak <kzak@redhat.com>
10 months agoci: fix indentation
Frantisek Sumsal [Tue, 20 Jun 2023 14:19:42 +0000 (16:19 +0200)] 
ci: fix indentation

10 months agolib: remove pager.c from libcommon
Karel Zak [Tue, 20 Jun 2023 11:15:45 +0000 (13:15 +0200)] 
lib: remove pager.c from libcommon

The libcommon is a binary archive to keep compilation and maintenance
simple. The library is not linked as shared or so. The unused symbols
are removed from binaries (for example, by "make install-strip").

But it isn't evident for license analyzers (and some humans) that the
library uses GPL and non-GPL stuff simultaneously. Let's avoid doubts
and keep pager.c (with GPL license) out of the archive

Signed-off-by: Karel Zak <kzak@redhat.com>
10 months agolib/ include/: cleanup licence headers
Karel Zak [Tue, 20 Jun 2023 10:52:35 +0000 (12:52 +0200)] 
lib/ include/: cleanup licence headers

This patch does not change any license of the affected files. Changes:

* add missing SPDX-License-Identifier lines for LGPL

* copy missing license lines from code (lib/) to header files (include/)

* use the same comment formatting

Signed-off-by: Karel Zak <kzak@redhat.com>
10 months agolib/color-names: fix licence header
Karel Zak [Tue, 20 Jun 2023 10:49:26 +0000 (12:49 +0200)] 
lib/color-names: fix licence header

The header file and code uses a different license. Let's use (public
domain) license from code also for the header file.

Signed-off-by: Karel Zak <kzak@redhat.com>
10 months agosys-utils: fix SELinux context example in mount.8
Todd Zullinger [Sun, 18 Jun 2023 21:29:11 +0000 (17:29 -0400)] 
sys-utils: fix SELinux context example in mount.8

In the description of the context option, the example which shows how to
properly quote is displayed incorrectly on terminals > 80 columns.  This
leaves a seemingly needless '\' in the command, e.g.:

    mount -t tmpfs none /mnt -o \ 'context="system_u:...'

The intent is to display the command properly on terminals <= 80
columns.  Use a literal block to ensure the code is displayed
consistently, regardless of the terminal width.

Connect the blockquote to the previous indented items in the context
option description to ensure it is properly indented.

Signed-off-by: Todd Zullinger <tmz@pobox.com>
10 months agotests: add omitted files
Karel Zak [Mon, 19 Jun 2023 12:59:15 +0000 (14:59 +0200)] 
tests: add omitted files

Sorry, forgot in the previous commit ...

Signed-off-by: Karel Zak <kzak@redhat.com>
10 months agotests: add user and user=name mount test
Karel Zak [Mon, 19 Jun 2023 11:45:06 +0000 (13:45 +0200)] 
tests: add user and user=name mount test

Signed-off-by: Karel Zak <kzak@redhat.com>
10 months agolibmount: always ignore user=<name>
Karel Zak [Mon, 19 Jun 2023 11:29:42 +0000 (13:29 +0200)] 
libmount: always ignore user=<name>

The library (on mount) cares about "user", but has to ignore
"user=name". It works as expected, but only for non-root users. We
need to ignore it also root to be compatible with /sbin/mount.cifs
where some people still use "user=" (rather than "username=").

References: fe0b1e793c9017edba72768e2e0b4c769c204604
Addresses: https://github.com/util-linux/util-linux/issues/2315
Signed-off-by: Karel Zak <kzak@redhat.com>
11 months agoMerge pull request #2317 from eworm-de/meson-langinfo
Karel Zak [Sat, 17 Jun 2023 09:56:48 +0000 (11:56 +0200)] 
Merge pull request #2317 from eworm-de/meson-langinfo

meson: check for _NL_TIME_WEEK_1STDAY in langinfo.h

11 months agoMerge pull request #2318 from mariobl/patch-11
Karel Zak [Sat, 17 Jun 2023 09:52:11 +0000 (11:52 +0200)] 
Merge pull request #2318 from mariobl/patch-11

[man] Fix typo in irqtop.1.adoc

11 months ago[man] Fix typo in irqtop.1.adoc
Mario Blättermann [Fri, 16 Jun 2023 14:31:47 +0000 (16:31 +0200)] 
[man] Fix typo in irqtop.1.adoc

11 months agomeson: check for _NL_TIME_WEEK_1STDAY in langinfo.h
Christian Hesse [Fri, 16 Jun 2023 09:52:10 +0000 (11:52 +0200)] 
meson: check for _NL_TIME_WEEK_1STDAY in langinfo.h

... which is required for `cal`.

Fixes GH-2316

11 months agoMerge branch 'ci/gcc-13' of https://github.com/t-8ch/util-linux
Karel Zak [Wed, 14 Jun 2023 07:54:25 +0000 (09:54 +0200)] 
Merge branch 'ci/gcc-13' of https://github.com/t-8ch/util-linux

* 'ci/gcc-13' of https://github.com/t-8ch/util-linux:
  ci: use clang 16
  ci: build with GCC 13/11

11 months agoMerge branch 'lsfd--inotify' of https://github.com/masatake/util-linux
Karel Zak [Wed, 14 Jun 2023 07:53:04 +0000 (09:53 +0200)] 
Merge branch 'lsfd--inotify' of https://github.com/masatake/util-linux

* 'lsfd--inotify' of https://github.com/masatake/util-linux:
  lsfd: use xstrdup instead of xasprintf(...\"%s\"
  tests: (lsfd) add a case for testing INOTIFY.INODES.RAW column
  tests: (mkfds) add / and /etc/fstab as the monitoring targets to inotify
  lsfd: fill NAME column of inotify files with the information about their monitoring targets
  lsdf: make the code for filling SOURCE, PARTITION, and MAJMIN reusable

11 months agoMerge branch 'meson-more-conditions' of https://github.com/keszybz/util-linux
Karel Zak [Wed, 14 Jun 2023 07:51:12 +0000 (09:51 +0200)] 
Merge branch 'meson-more-conditions' of https://github.com/keszybz/util-linux

* 'meson-more-conditions' of https://github.com/keszybz/util-linux:
  meson: conditionalize waitpid
  meson: add conditionalization for test progs
  meson: implement HAVE_PTY

11 months agomeson: conditionalize waitpid
Zbigniew Jędrzejewski-Szmek [Tue, 13 Jun 2023 08:15:39 +0000 (10:15 +0200)] 
meson: conditionalize waitpid

I *think* this mirros what configure.ac does, except that the configuration
option is not implemented.

11 months agomeson: add conditionalization for test progs
Zbigniew Jędrzejewski-Szmek [Tue, 13 Jun 2023 08:01:52 +0000 (10:01 +0200)] 
meson: add conditionalization for test progs

This just mirrors what the autotools setup is doing.

11 months agomeson: implement HAVE_PTY
Zbigniew Jędrzejewski-Szmek [Tue, 13 Jun 2023 07:55:22 +0000 (09:55 +0200)] 
meson: implement HAVE_PTY

This conditional was never implemented in the meson config. Under
autotools, it is guarded by availability of headers and an option. I
didn't implement the option here.

Fixes #2310.

'!= false' is used because 'x == 1' is rejected by meson if 'x' is
false. OTOH, 'x != false' seems to work if 'x' is 1.

11 months agolsfd: use xstrdup instead of xasprintf(...\"%s\"
Masatake YAMATO [Tue, 13 Jun 2023 10:21:33 +0000 (19:21 +0900)] 
lsfd: use xstrdup instead of xasprintf(...\"%s\"

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
11 months agotests: (lsfd) add a case for testing INOTIFY.INODES.RAW column
Masatake YAMATO [Fri, 9 Jun 2023 10:03:48 +0000 (19:03 +0900)] 
tests: (lsfd) add a case for testing INOTIFY.INODES.RAW column

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
11 months agotests: (mkfds) add / and /etc/fstab as the monitoring targets to inotify
Masatake YAMATO [Fri, 9 Jun 2023 10:02:25 +0000 (19:02 +0900)] 
tests: (mkfds) add / and /etc/fstab as the monitoring targets to inotify

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
11 months agolsfd: fill NAME column of inotify files with the information about their monitoring...
Masatake YAMATO [Fri, 9 Jun 2023 05:55:05 +0000 (14:55 +0900)] 
lsfd: fill NAME column of inotify files with the information about their monitoring targets

    # ./lsfd  -p 1  -Q '(TYPE == "inotify") and (FD > 7)'
    COMMAND PID USER ASSOC MODE    TYPE       SOURCE MNTID INODE NAME
    systemd   1 root    11  r-- inotify anon_inodefs    15  1060 inodes=116@dm-0
    systemd   1 root    13  r-- inotify anon_inodefs    15  1060 inodes=299@tmpfs
    systemd   1 root    19  r-- inotify anon_inodefs    15  1060 inodes=41@tmpfs,2@tmpfs,1@tmpfs,96@dm-0
    systemd   1 root    21  r-- inotify anon_inodefs    15  1060 inodes=41@tmpfs,2@tmpfs,1@tmpfs,96@dm-0

In addition, INOTIFY.INODES and INOTIFY.INODES.RAW column are added.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
11 months agolsdf: make the code for filling SOURCE, PARTITION, and MAJMIN reusable
Masatake YAMATO [Fri, 9 Jun 2023 05:52:18 +0000 (14:52 +0900)] 
lsdf: make the code for filling SOURCE, PARTITION, and MAJMIN reusable

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
11 months agolibmount: (tests) add helper for option list splitting
Thomas Weißschuh [Tue, 13 Jun 2023 06:27:48 +0000 (08:27 +0200)] 
libmount: (tests) add helper for option list splitting

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
11 months agomeson: build test_mount_optlist
Thomas Weißschuh [Tue, 13 Jun 2023 06:19:55 +0000 (08:19 +0200)] 
meson: build test_mount_optlist

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
11 months agobuild-sys: add enosys and syscalls.h to gitignore
Enze Li [Fri, 9 Jun 2023 01:37:04 +0000 (09:37 +0800)] 
build-sys: add enosys and syscalls.h to gitignore

After compiling enosys, the syscalls.h file and the executable enosys are
generated, let's add these two files to the .gitignore file.

Signed-off-by: Enze Li <lienze@kylinos.cn>
11 months agobuild-sys: rearrange gitignore in alphabetical order
Enze Li [Fri, 9 Jun 2023 01:37:03 +0000 (09:37 +0800)] 
build-sys: rearrange gitignore in alphabetical order

Signed-off-by: Enze Li <lienze@kylinos.cn>
11 months agocfdisk: add hint about labels for bootable flag
Karel Zak [Mon, 12 Jun 2023 10:33:01 +0000 (12:33 +0200)] 
cfdisk: add hint about labels for bootable flag

Addresses: https://github.com/util-linux/util-linux/discussions/2220
Signed-off-by: Karel Zak <kzak@redhat.com>
11 months agoMerge branch 'libmount/loop-rw' of https://github.com/t-8ch/util-linux
Karel Zak [Mon, 12 Jun 2023 10:22:02 +0000 (12:22 +0200)] 
Merge branch 'libmount/loop-rw' of https://github.com/t-8ch/util-linux

* 'libmount/loop-rw' of https://github.com/t-8ch/util-linux:
  libmount: (optlist) correctly detect ro status

11 months agoMerge branch 'lsfd--refactor' of https://github.com/masatake/util-linux
Karel Zak [Mon, 12 Jun 2023 10:18:50 +0000 (12:18 +0200)] 
Merge branch 'lsfd--refactor' of https://github.com/masatake/util-linux

* 'lsfd--refactor' of https://github.com/masatake/util-linux:
  timeutils: add an inline funciton, is_timespecset()
  lsfd: use scols_table_get_column_by_name

11 months agoMerge branch 'setuid' of https://github.com/eworm-de/util-linux
Karel Zak [Mon, 12 Jun 2023 10:16:27 +0000 (12:16 +0200)] 
Merge branch 'setuid' of https://github.com/eworm-de/util-linux

* 'setuid' of https://github.com/eworm-de/util-linux:
  meson: install write setgid
  meson: install wall setgid
  meson: install umount setuid
  meson: install mount setuid
  meson: install newgrp setuid
  meson: install su setuid
  meson: install chsh setuid
  meson: install chfn setuid

11 months agoMerge branch 'lsfd--signalfd' of https://github.com/masatake/util-linux
Karel Zak [Mon, 12 Jun 2023 10:15:41 +0000 (12:15 +0200)] 
Merge branch 'lsfd--signalfd' of https://github.com/masatake/util-linux

* 'lsfd--signalfd' of https://github.com/masatake/util-linux:
  tests: (lsfd) add a case for testing signalfd related columns
  tests: (mkfds) add a factory to make a signalfd
  lsfd.1.adoc: update for signalfds
  lsfd: print the masks specified in signalfds

11 months agolibmount: (optlist) correctly detect ro status
Thomas Weißschuh [Sun, 11 Jun 2023 09:49:54 +0000 (11:49 +0200)] 
libmount: (optlist) correctly detect ro status

Fixes #2305

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
11 months agotimeutils: add an inline funciton, is_timespecset()
Masatake YAMATO [Sat, 10 Jun 2023 15:31:46 +0000 (00:31 +0900)] 
timeutils: add an inline funciton, is_timespecset()

Close #2300.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
11 months agolsfd: use scols_table_get_column_by_name
Masatake YAMATO [Fri, 9 Jun 2023 16:47:16 +0000 (01:47 +0900)] 
lsfd: use scols_table_get_column_by_name

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
11 months agomeson: install write setgid
Christian Hesse [Fri, 9 Jun 2023 13:04:00 +0000 (15:04 +0200)] 
meson: install write setgid

... as this requires elevated privileges.

11 months agomeson: install wall setgid
Christian Hesse [Fri, 9 Jun 2023 13:02:57 +0000 (15:02 +0200)] 
meson: install wall setgid

... as this requires elevated privileges.

11 months agomeson: install umount setuid
Christian Hesse [Fri, 9 Jun 2023 12:09:02 +0000 (14:09 +0200)] 
meson: install umount setuid

... as this requires elevated privileges.

11 months agomeson: install mount setuid
Christian Hesse [Fri, 9 Jun 2023 12:09:02 +0000 (14:09 +0200)] 
meson: install mount setuid

... as this requires elevated privileges.

11 months agomeson: install newgrp setuid
Christian Hesse [Fri, 9 Jun 2023 12:09:02 +0000 (14:09 +0200)] 
meson: install newgrp setuid

... as this requires elevated privileges.

11 months agomeson: install su setuid
Christian Hesse [Fri, 9 Jun 2023 12:09:02 +0000 (14:09 +0200)] 
meson: install su setuid

... as this requires elevated privileges.

11 months agomeson: install chsh setuid
Christian Hesse [Fri, 9 Jun 2023 12:09:02 +0000 (14:09 +0200)] 
meson: install chsh setuid

... as this requires elevated privileges.

11 months agomeson: install chfn setuid
Christian Hesse [Fri, 9 Jun 2023 12:09:02 +0000 (14:09 +0200)] 
meson: install chfn setuid

... as this requires elevated privileges.

11 months agoMerge branch 'PR/libmount-force-mount2' of github.com:karelzak/util-linux-work
Karel Zak [Fri, 9 Jun 2023 09:50:23 +0000 (11:50 +0200)] 
Merge branch 'PR/libmount-force-mount2' of github.com:karelzak/util-linux-work

* 'PR/libmount-force-mount2' of github.com:karelzak/util-linux-work:
  libmount: introduce LIBMOUNT_FORCE_MOUNT2={always,never,auto}

11 months agotests: (lsfd) add a case for testing signalfd related columns
Masatake YAMATO [Tue, 6 Jun 2023 23:01:40 +0000 (08:01 +0900)] 
tests: (lsfd) add a case for testing signalfd related columns

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
11 months agotests: (mkfds) add a factory to make a signalfd
Masatake YAMATO [Tue, 6 Jun 2023 22:55:09 +0000 (07:55 +0900)] 
tests: (mkfds) add a factory to make a signalfd

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
11 months agolsfd.1.adoc: update for signalfds
Masatake YAMATO [Tue, 6 Jun 2023 22:40:45 +0000 (07:40 +0900)] 
lsfd.1.adoc: update for signalfds

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
11 months agolsfd: print the masks specified in signalfds
Masatake YAMATO [Tue, 6 Jun 2023 22:30:06 +0000 (07:30 +0900)] 
lsfd: print the masks specified in signalfds

An example output:

    # ./lsfd -p "$(pidof systemd-journald)" -Q '(TYPE == "signalfd")'

    COMMAND             PID USER ASSOC MODE     TYPE       SOURCE MNTID INODE NAME
    systemd-journal 2382709 root   238  rw- signalfd anon_inodefs    15  1060 mask=USR1,USR2
    systemd-journal 2382709 root   239  rw- signalfd anon_inodefs    15  1060 mask=INT,TERM
    systemd-journal 2382709 root   240  rw- signalfd anon_inodefs    15  1060 mask=35

Using signum_to_signame is suggested by Karel Zak <kzak@redhat.com>.
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
11 months agolibmount: introduce LIBMOUNT_FORCE_MOUNT2={always,never,auto}
Karel Zak [Mon, 5 Jun 2023 11:21:11 +0000 (13:21 +0200)] 
libmount: introduce LIBMOUNT_FORCE_MOUNT2={always,never,auto}

Let's introduce a stable workaround for use cases where new kernel API
is not ready to use.

The patch does not use "goto enosys" to exit as nothing in the hookset
is initialized yet.

Addresses: https://github.com/util-linux/util-linux/issues/1992
Addresses: https://github.com/util-linux/util-linux/issues/2283
Signed-off-by: Karel Zak <kzak@redhat.com>
11 months agoMerge branch 'pr/libmount-5.12.0' of github.com:karelzak/util-linux-work
Karel Zak [Tue, 6 Jun 2023 08:47:35 +0000 (10:47 +0200)] 
Merge branch 'pr/libmount-5.12.0' of github.com:karelzak/util-linux-work

* 'pr/libmount-5.12.0' of github.com:karelzak/util-linux-work:
  libmount: use mount(2) for remount on Linux < 5.14

11 months agoMerge branch 'lsfd--misc-fix' of https://github.com/masatake/util-linux
Karel Zak [Tue, 6 Jun 2023 08:46:19 +0000 (10:46 +0200)] 
Merge branch 'lsfd--misc-fix' of https://github.com/masatake/util-linux

* 'lsfd--misc-fix' of https://github.com/masatake/util-linux:
  lsfd: assign a class to the file in new_file()
  lsfd: don't check the value returned from new_file()

11 months agoMerge branch 'lsfd--timerfd' of https://github.com/masatake/util-linux
Karel Zak [Tue, 6 Jun 2023 08:45:17 +0000 (10:45 +0200)] 
Merge branch 'lsfd--timerfd' of https://github.com/masatake/util-linux

* 'lsfd--timerfd' of https://github.com/masatake/util-linux:
  tests: (lsfd/filter) add a case for comparing floating point numbers
  tests: (lsfd) add a case for testing timerfd related columns
  tests: add ts_skip_capability
  tests: (mkfds) add a factory to make a timerfd
  lsfd.1.adoc: write about timerfd
  lsfd: print the detail of the timer associated with a timerfd
  lsfd: (filter) accept floating point numbers in expressions
  lsfd: (filter) support floating point number used in columns
  lsfd: (filter) reduce duplicated code in macro definitions
  lsfd: (filter) improve error message
  lsfd.1.adoc: revise type names for columns
  lsfd.1.adoc: fix typos
  lsfd: adjust coding style
  lsfd: fix a sentence in comment

11 months agolibmount: use mount(2) for remount on Linux < 5.14
Karel Zak [Mon, 5 Jun 2023 10:59:41 +0000 (12:59 +0200)] 
libmount: use mount(2) for remount on Linux < 5.14

It seems mount_setattr() is supported on Linux < 5.14, but it's without
MOUNT_ATTR_NOSYMFOLLOW. That's problem for remount where we reset all
VFS flags.

The most simple (but not elegant) is to check for kernel version and
fallback to mount(2) on remount.

Addresses: https://github.com/util-linux/util-linux/issues/2283
Signed-off-by: Karel Zak <kzak@redhat.com>
11 months agoMerge branch 'fix-jfs' of https://github.com/mbroz/util-linux
Karel Zak [Mon, 5 Jun 2023 09:46:11 +0000 (11:46 +0200)] 
Merge branch 'fix-jfs' of https://github.com/mbroz/util-linux

* 'fix-jfs' of https://github.com/mbroz/util-linux:
  libblkid: jfs - avoid undefined shift

11 months agoMerge branch 'libblkid/bcache-csum' of https://github.com/t-8ch/util-linux
Karel Zak [Mon, 5 Jun 2023 09:45:37 +0000 (11:45 +0200)] 
Merge branch 'libblkid/bcache-csum' of https://github.com/t-8ch/util-linux

* 'libblkid/bcache-csum' of https://github.com/t-8ch/util-linux:
  libblkid: (bcache) report block size
  libblkid: (bcache) report version
  libblkid: (bcache) report label
  libblkid: (bcache) also calculate checksum over journal buckets
  libblkid: (bcache) extend superblock definition

11 months agoMerge branch 'fixes' of https://github.com/t-8ch/util-linux
Karel Zak [Mon, 5 Jun 2023 09:44:30 +0000 (11:44 +0200)] 
Merge branch 'fixes' of https://github.com/t-8ch/util-linux

* 'fixes' of https://github.com/t-8ch/util-linux:
  libmount (python) : simplify struct initialization
  lsfd-filter: constify filter logic
  misc: constify some fields

11 months agolsfd: assign a class to the file in new_file()
Masatake YAMATO [Sun, 4 Jun 2023 21:39:26 +0000 (06:39 +0900)] 
lsfd: assign a class to the file in new_file()

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
11 months agolsfd: don't check the value returned from new_file()
Masatake YAMATO [Sun, 4 Jun 2023 21:31:30 +0000 (06:31 +0900)] 
lsfd: don't check the value returned from new_file()

The funciton newver returns NULL.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
11 months agolibblkid: jfs - avoid undefined shift
Milan Broz [Sun, 4 Jun 2023 17:15:55 +0000 (19:15 +0200)] 
libblkid: jfs - avoid undefined shift

Fix previous commit 04a0717b0b0faa1a8078dc6fad05183b8bada395
to avoid undefined shift if value is exactly 32.

  libblkid/src/superblocks/jfs.c:46:39: runtime error:
  shift exponent 32 is too large for 32-bit type 'unsigned int'

Reproducer found with OSS-Fuzz (issue 59284) running over
cryptsetup project (blkid is used in header init).

Signed-off-by: Milan Broz <gmazyland@gmail.com>
11 months agotests: (lsfd/filter) add a case for comparing floating point numbers
Masatake YAMATO [Sun, 4 Jun 2023 03:00:39 +0000 (12:00 +0900)] 
tests: (lsfd/filter) add a case for comparing floating point numbers

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
11 months agotests: (lsfd) add a case for testing timerfd related columns
Masatake YAMATO [Sat, 3 Jun 2023 04:11:00 +0000 (13:11 +0900)] 
tests: (lsfd) add a case for testing timerfd related columns

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
11 months agotests: add ts_skip_capability
Masatake YAMATO [Sun, 4 Jun 2023 07:55:00 +0000 (16:55 +0900)] 
tests: add ts_skip_capability

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
11 months agotests: (mkfds) add a factory to make a timerfd
Masatake YAMATO [Fri, 2 Jun 2023 23:40:18 +0000 (08:40 +0900)] 
tests: (mkfds) add a factory to make a timerfd

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
11 months agolsfd.1.adoc: write about timerfd
Masatake YAMATO [Sat, 3 Jun 2023 00:36:57 +0000 (09:36 +0900)] 
lsfd.1.adoc: write about timerfd

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
11 months agolsfd: print the detail of the timer associated with a timerfd
Masatake YAMATO [Fri, 2 Jun 2023 23:42:27 +0000 (08:42 +0900)] 
lsfd: print the detail of the timer associated with a timerfd

An example output:

    # ./lsfd -p 1  -Q '(TYPE == "timerfd")' -oCOMMAND,PID,ASSOC,TYPE,INODE,NAME
    COMMAND PID ASSOC    TYPE INODE NAME
    systemd   1    22 timerfd  1060 clockid=monotonic remaining=4625.661834645
    systemd   1    25 timerfd  1060 clockid=realtime remaining=398.164618943
    systemd   1   112 timerfd  1060 clockid=realtime remaining=7537606384.202715161

Added three new columns, TIMERFD.{CLOCKID,TIMERFD.REMAINING,INTERVAL}.
The filter engine works well with them.

An example listing timerfd files expiring within 1.2 seconds.

    # ./lsfd -Q '(TIMERFD.REMAINING > 0.0) && (TIMERFD.REMAINING < 1.2)'
    COMMAND          PID        USER ASSOC MODE    TYPE       SOURCE MNTID INODE NAME
    Xorg           17069         jet    26  rw- timerfd anon_inodefs    15  1060 clockid=monotonic remaining=0.061075544
    systemd-oomd 2382701 systemd-oom     8  rw- timerfd anon_inodefs    15  1060 clockid=monotonic remaining=0.178126915

Using SCOLS_JSON_NUMBER as the data type for TIMERFD.REMAINING and
TIMERFD.INTERVAL columns is suggested by Thomas Weißschuh
<thomas@t-8ch.de>.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
11 months agolsfd: (filter) accept floating point numbers in expressions
Masatake YAMATO [Sat, 3 Jun 2023 21:18:45 +0000 (06:18 +0900)] 
lsfd: (filter) accept floating point numbers in expressions

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
11 months agolsfd: (filter) support floating point number used in columns
Masatake YAMATO [Sat, 3 Jun 2023 09:42:40 +0000 (18:42 +0900)] 
lsfd: (filter) support floating point number used in columns

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
11 months agolsfd: (filter) reduce duplicated code in macro definitions
Masatake YAMATO [Sat, 3 Jun 2023 09:34:53 +0000 (18:34 +0900)] 
lsfd: (filter) reduce duplicated code in macro definitions

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
11 months agolsfd: (filter) improve error message
Masatake YAMATO [Sat, 3 Jun 2023 20:44:38 +0000 (05:44 +0900)] 
lsfd: (filter) improve error message

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
11 months agolsfd.1.adoc: revise type names for columns
Masatake YAMATO [Sat, 3 Jun 2023 22:39:32 +0000 (07:39 +0900)] 
lsfd.1.adoc: revise type names for columns

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
11 months agolsfd.1.adoc: fix typos
Masatake YAMATO [Fri, 2 Jun 2023 23:27:05 +0000 (08:27 +0900)] 
lsfd.1.adoc: fix typos

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
11 months agolsfd: adjust coding style
Masatake YAMATO [Mon, 29 May 2023 12:59:04 +0000 (21:59 +0900)] 
lsfd: adjust coding style

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
11 months agolsfd: fix a sentence in comment
Masatake YAMATO [Sat, 3 Jun 2023 18:42:38 +0000 (03:42 +0900)] 
lsfd: fix a sentence in comment

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
11 months agolibblkid: (bcache) report block size
Thomas Weißschuh [Sat, 3 Jun 2023 11:49:18 +0000 (13:49 +0200)] 
libblkid: (bcache) report block size

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
11 months agolibblkid: (bcache) report version
Thomas Weißschuh [Sat, 3 Jun 2023 09:15:13 +0000 (11:15 +0200)] 
libblkid: (bcache) report version

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
11 months agolibblkid: (bcache) report label
Thomas Weißschuh [Sat, 3 Jun 2023 08:50:26 +0000 (10:50 +0200)] 
libblkid: (bcache) report label

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
11 months agolibblkid: (bcache) also calculate checksum over journal buckets
Thomas Weißschuh [Sat, 3 Jun 2023 11:13:52 +0000 (13:13 +0200)] 
libblkid: (bcache) also calculate checksum over journal buckets

Fixes #2291

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
11 months agolibblkid: (bcache) extend superblock definition
Thomas Weißschuh [Sat, 3 Jun 2023 11:13:37 +0000 (13:13 +0200)] 
libblkid: (bcache) extend superblock definition

We will need it for the correct checksum calculation.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
11 months agolibmount (python) : simplify struct initialization
Thomas Weißschuh [Mon, 29 May 2023 07:23:37 +0000 (09:23 +0200)] 
libmount (python) : simplify struct initialization

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
11 months agolsfd-filter: constify filter logic
Thomas Weißschuh [Sat, 3 Jun 2023 08:22:46 +0000 (10:22 +0200)] 
lsfd-filter: constify filter logic

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
11 months agomisc: constify some fields
Thomas Weißschuh [Mon, 29 May 2023 07:23:53 +0000 (09:23 +0200)] 
misc: constify some fields

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
11 months agoci: use clang 16
Thomas Weißschuh [Thu, 1 Jun 2023 13:10:38 +0000 (15:10 +0200)] 
ci: use clang 16

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
11 months agotests: fix subtests containing spaces in their name
Thomas Weißschuh [Fri, 2 Jun 2023 20:53:40 +0000 (22:53 +0200)] 
tests: fix subtests containing spaces in their name

Previously these tests would silently fail to compare
$TS_OUTPUT / $TS_ERRLOG.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
11 months agoci: build with GCC 13/11
Thomas Weißschuh [Mon, 29 May 2023 09:23:47 +0000 (11:23 +0200)] 
ci: build with GCC 13/11

Newer releases of GCC 13 have reigned in the false positives, so use it
for CI now.
The sanitizer builds are sticking to GCC 11 for now.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
11 months agoci: build on old distro
Thomas Weißschuh [Wed, 31 May 2023 06:09:39 +0000 (08:09 +0200)] 
ci: build on old distro

This should help to catch build breaks

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
11 months agoci: mark source directory as safe
Thomas Weißschuh [Wed, 31 May 2023 08:26:50 +0000 (10:26 +0200)] 
ci: mark source directory as safe

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
11 months agoci: prevent prompts during installation
Thomas Weißschuh [Wed, 31 May 2023 08:15:11 +0000 (10:15 +0200)] 
ci: prevent prompts during installation

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
11 months agotests: skip broken tests on docker
Thomas Weißschuh [Wed, 31 May 2023 15:31:01 +0000 (17:31 +0200)] 
tests: skip broken tests on docker

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
11 months agotests: add ts_skip_docker
Thomas Weißschuh [Wed, 31 May 2023 15:27:38 +0000 (17:27 +0200)] 
tests: add ts_skip_docker

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
11 months agotools: (asciidoctor) explicitly require extensions module
Thomas Weißschuh [Wed, 31 May 2023 15:12:12 +0000 (17:12 +0200)] 
tools: (asciidoctor) explicitly require extensions module

This is needed for older versions of asciidoctor.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
11 months agobuild-sys: only pass --failure-level if supported
Thomas Weißschuh [Wed, 31 May 2023 14:56:31 +0000 (16:56 +0200)] 
build-sys: only pass --failure-level if supported

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>