]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
15 months agomeson: Use is_absolute to determine if the prefix directory is absolute
Jordan Williams [Wed, 17 Apr 2024 15:08:40 +0000 (10:08 -0500)] 
meson: Use is_absolute to determine if the prefix directory is absolute

Meson's check for an absolute path does not work on Windows.
Meson 0.54.0 introduced the fs.is_absolute function.
Use this instead.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
15 months agoMerge branch 'sed' of https://github.com/t-8ch/util-linux
Karel Zak [Wed, 17 Apr 2024 11:08:34 +0000 (13:08 +0200)] 
Merge branch 'sed' of https://github.com/t-8ch/util-linux

* 'sed' of https://github.com/t-8ch/util-linux:
  all_errnos/all_syscalls: use sed to extract defines from headers

15 months agoMerge branch 'PR/libsmartcols-fix-wrap' of github.com:karelzak/util-linux-work
Karel Zak [Wed, 17 Apr 2024 07:50:52 +0000 (09:50 +0200)] 
Merge branch 'PR/libsmartcols-fix-wrap' of github.com:karelzak/util-linux-work

* 'PR/libsmartcols-fix-wrap' of github.com:karelzak/util-linux-work:
  libsmartcols: (sample) add wrap repeating example
  libsmartcols: reset wrap after calculation

15 months agolsfd: add meson.build for the command
Masatake YAMATO [Tue, 16 Apr 2024 20:32:12 +0000 (05:32 +0900)] 
lsfd: add meson.build for the command

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
15 months agoall_errnos/all_syscalls: use sed to extract defines from headers
Thomas Weißschuh [Tue, 16 Apr 2024 19:56:22 +0000 (21:56 +0200)] 
all_errnos/all_syscalls: use sed to extract defines from headers

Posix-compliant awk does not seem capable of matching lines and
extracting capture groups of them.
Use sed instead.

Reported-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Link: https://lore.kernel.org/util-linux/051624b9256db27a731d62c031cb627d9f5a256e.camel@physik.fu-berlin.de/
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
15 months agolsfd: (po-man) update po4a.cfg
Karel Zak [Tue, 16 Apr 2024 09:53:45 +0000 (11:53 +0200)] 
lsfd: (po-man) update po4a.cfg

Signed-off-by: Karel Zak <kzak@redhat.com>
15 months agoMerge branch 'lsfd-cmd--dir' of https://github.com/masatake/util-linux
Karel Zak [Tue, 16 Apr 2024 09:36:34 +0000 (11:36 +0200)] 
Merge branch 'lsfd-cmd--dir' of https://github.com/masatake/util-linux

* 'lsfd-cmd--dir' of https://github.com/masatake/util-linux:
  lsfd: move the source code to new ./lsfd-cmd directory

15 months agoMerge branch 'getwc' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 16 Apr 2024 09:28:53 +0000 (11:28 +0200)] 
Merge branch 'getwc' of https://github.com/t-8ch/util-linux

* 'getwc' of https://github.com/t-8ch/util-linux:
  textutils: introduce and use fgetwc_or_err
  treewide: use fgetc() instead of getc()
  textutils: use fgetwc() instead of getwc()

15 months agoMerge branch 'awk' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 16 Apr 2024 09:21:56 +0000 (11:21 +0200)] 
Merge branch 'awk' of https://github.com/t-8ch/util-linux

* 'awk' of https://github.com/t-8ch/util-linux:
  all_errnos/all_syscalls: don't hardcode AWK invocation
  all_errnos/all_syscalls: don't warn during cleanup
  all_errnos/all_syscalls: fail if any step fails

15 months agoMerge branch 'patch-1' of https://github.com/I-use-Arch-btw-00111/util-linux
Karel Zak [Tue, 16 Apr 2024 09:19:03 +0000 (11:19 +0200)] 
Merge branch 'patch-1' of https://github.com/I-use-Arch-btw-00111/util-linux

* 'patch-1' of https://github.com/I-use-Arch-btw-00111/util-linux:
  (minor) update sulogin.c

15 months agolibsmartcols: (sample) add wrap repeating example
Karel Zak [Tue, 16 Apr 2024 08:57:37 +0000 (10:57 +0200)] 
libsmartcols: (sample) add wrap repeating example

Signed-off-by: Karel Zak <kzak@redhat.com>
15 months agolibsmartcols: reset wrap after calculation
Karel Zak [Tue, 16 Apr 2024 08:49:31 +0000 (10:49 +0200)] 
libsmartcols: reset wrap after calculation

Fixes: https://github.com/util-linux/util-linux/issues/2956
Signed-off-by: Karel Zak <kzak@redhat.com>
15 months agoall_errnos/all_syscalls: don't hardcode AWK invocation
Thomas Weißschuh [Tue, 16 Apr 2024 07:26:22 +0000 (09:26 +0200)] 
all_errnos/all_syscalls: don't hardcode AWK invocation

Use the buildsystem to find a usable awk implementation and use that.

Reported-by: Firas Khalil Khana <firasuke@gmail.com>
Link: https://github.com/util-linux/util-linux/pull/2949
Reported-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
https://lore.kernel.org/util-linux/31ccace2e5912ffc428e065cd66764088c625c4d.camel@physik.fu-berlin.de/
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
15 months agoall_errnos/all_syscalls: don't warn during cleanup
Thomas Weißschuh [Tue, 16 Apr 2024 07:14:28 +0000 (09:14 +0200)] 
all_errnos/all_syscalls: don't warn during cleanup

On failure the output files may not have been created.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
15 months agoall_errnos/all_syscalls: fail if any step fails
Thomas Weißschuh [Tue, 16 Apr 2024 07:00:41 +0000 (09:00 +0200)] 
all_errnos/all_syscalls: fail if any step fails

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
15 months ago(minor) update sulogin.c
Leaflet [Mon, 15 Apr 2024 16:52:19 +0000 (16:52 +0000)] 
(minor) update sulogin.c

Make the root password prompt more technical

15 months agolibsmartcols: (filter) emulate YYerror for old Bison
Karel Zak [Mon, 15 Apr 2024 12:14:53 +0000 (14:14 +0200)] 
libsmartcols: (filter) emulate YYerror for old Bison

The special YYerror token is supported in Bison 3.6 and above.
Fortunately, it is possible to emulate this functionality in older
versions as well.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 months agolibsmartcols: (filter) check vasprintf() return value
Karel Zak [Mon, 15 Apr 2024 10:53:46 +0000 (12:53 +0200)] 
libsmartcols: (filter) check vasprintf() return value

Signed-off-by: Karel Zak <kzak@redhat.com>
15 months agolibsmartcols: (filter) accept prefixes like k, M, G as a parts of a number
Karel Zak [Mon, 15 Apr 2024 10:34:31 +0000 (12:34 +0200)] 
libsmartcols: (filter) accept prefixes like k, M, G as a parts of a number

Co-Author: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
15 months agolibsmartcols: (filter) use variable argument lists for yyerror()
Karel Zak [Mon, 15 Apr 2024 09:59:01 +0000 (11:59 +0200)] 
libsmartcols: (filter) use variable argument lists for yyerror()

Signed-off-by: Karel Zak <kzak@redhat.com>
15 months agolibsmartcols; (filter) make libscols_filter accessible in lex
Karel Zak [Mon, 15 Apr 2024 09:54:34 +0000 (11:54 +0200)] 
libsmartcols; (filter) make libscols_filter accessible in lex

In the reentrant parser, we cannot easily extend the argument list for
yylex() using %lex-param. Instead, we must use a lex-extra pointer.

Signed-off-by: Karel Zak <kzak@redhat.com>
15 months agolsfd: move the source code to new ./lsfd-cmd directory
Masatake YAMATO [Tue, 9 Apr 2024 06:07:18 +0000 (15:07 +0900)] 
lsfd: move the source code to new ./lsfd-cmd directory

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
15 months agotests: (lsfd) don't refer "$?" on the line follwoing the use of "local"
Masatake YAMATO [Thu, 11 Apr 2024 02:49:21 +0000 (11:49 +0900)] 
tests: (lsfd) don't refer "$?" on the line follwoing the use of "local"

Suggested by ShellCheck.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
15 months agotests: (functions.sh) add a helper funcion making a device number from given major...
Masatake YAMATO [Wed, 10 Apr 2024 09:36:47 +0000 (18:36 +0900)] 
tests: (functions.sh) add a helper funcion making a device number from given major and minor nums

Fixes #2919.
Suggested by Karel Zak <kzak@redhat.com>.

The original code used an obsolete formula to make a device number from
given major and minor numbers.

ts_device_make is a new helper function based on the formula of
__SYSMACROS_DEFINE_MAKEDEV macro defined in
/usr/include/bits/sysmacros.h of GNU libc.

Suggested by Karel Zak <kzak@redhat.com> in #2919.
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
15 months agoMerge branch 'pager/less-quirk' of https://github.com/t-8ch/util-linux
Karel Zak [Mon, 15 Apr 2024 07:07:41 +0000 (09:07 +0200)] 
Merge branch 'pager/less-quirk' of https://github.com/t-8ch/util-linux

* 'pager/less-quirk' of https://github.com/t-8ch/util-linux:
  Revert "lib/pager: Apply pager-specific fixes only when needed"

15 months agoMerge branch 'lslocks--no-sleep-in-test-case' of https://github.com/masatake/util...
Karel Zak [Mon, 15 Apr 2024 07:07:12 +0000 (09:07 +0200)] 
Merge branch 'lslocks--no-sleep-in-test-case' of https://github.com/masatake/util-linux

* 'lslocks--no-sleep-in-test-case' of https://github.com/masatake/util-linux:
  lslocks: remove a unused local variable
  lslocks: don't abort gathering per-process information even if opening a /proc/[0-9]* fails

15 months agoMerge branch 'PR/autotools' of github.com:karelzak/util-linux-work
Karel Zak [Mon, 15 Apr 2024 07:04:38 +0000 (09:04 +0200)] 
Merge branch 'PR/autotools' of github.com:karelzak/util-linux-work

* 'PR/autotools' of github.com:karelzak/util-linux-work:
  autotools: add --disable-enosys, check for linux/audit.h
  autotools: check for sys/vfs.h and linux/bpf.h

15 months agoMerge branch 'fix-mnt-update' of https://github.com/gavinhungry/util-linux
Karel Zak [Mon, 15 Apr 2024 06:59:45 +0000 (08:59 +0200)] 
Merge branch 'fix-mnt-update' of https://github.com/gavinhungry/util-linux

* 'fix-mnt-update' of https://github.com/gavinhungry/util-linux:
  Fix misplaced else in mnt_update_already_done

15 months agoMerge branch 'meson-version-script-libblkid' of https://github.com/jwillikers/util...
Karel Zak [Mon, 15 Apr 2024 06:59:07 +0000 (08:59 +0200)] 
Merge branch 'meson-version-script-libblkid' of https://github.com/jwillikers/util-linux

* 'meson-version-script-libblkid' of https://github.com/jwillikers/util-linux:
  meson: Only use the --version-script linker flag where it is supported

15 months agoMerge branch 'meson-fix-libmount-libblkid-feature-dep' of https://github.com/jwillike...
Karel Zak [Mon, 15 Apr 2024 06:57:44 +0000 (08:57 +0200)] 
Merge branch 'meson-fix-libmount-libblkid-feature-dep' of https://github.com/jwillikers/util-linux

* 'meson-fix-libmount-libblkid-feature-dep' of https://github.com/jwillikers/util-linux:
  meson: Remove libblkid dependency on libmount

15 months agoMerge branch 'meson-have-sys-vfs-header' of https://github.com/jwillikers/util-linux
Karel Zak [Mon, 15 Apr 2024 06:57:13 +0000 (08:57 +0200)] 
Merge branch 'meson-have-sys-vfs-header' of https://github.com/jwillikers/util-linux

* 'meson-have-sys-vfs-header' of https://github.com/jwillikers/util-linux:
  meson: Require the sys/vfs.h header for libmount and fstrim

15 months agoMerge branch 'zlib-disabler' of https://github.com/jwillikers/util-linux
Karel Zak [Mon, 15 Apr 2024 06:56:25 +0000 (08:56 +0200)] 
Merge branch 'zlib-disabler' of https://github.com/jwillikers/util-linux

* 'zlib-disabler' of https://github.com/jwillikers/util-linux:
  meson: Make the zlib dependency a disabler when not found

15 months agoMerge branch 'tinfo-disabler' of https://github.com/jwillikers/util-linux
Karel Zak [Mon, 15 Apr 2024 06:55:47 +0000 (08:55 +0200)] 
Merge branch 'tinfo-disabler' of https://github.com/jwillikers/util-linux

* 'tinfo-disabler' of https://github.com/jwillikers/util-linux:
  meson: Make ncurses dependency a disabler when not found
  meson: Make tinfo dependency a disabler when not found

15 months agotests: (lsns::filedesc) skip if NS_GET_NSTYPE ioctl cmd not available
Masatake YAMATO [Sun, 14 Apr 2024 17:18:19 +0000 (02:18 +0900)] 
tests: (lsns::filedesc) skip if NS_GET_NSTYPE ioctl cmd not available

Currently, Qemu userspace emulation doesn't support the ioctl cmd.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
15 months agolsns: report with warnx if a namespace related ioctl fails with ENOSYS
Masatake YAMATO [Sun, 14 Apr 2024 16:44:38 +0000 (01:44 +0900)] 
lsns: report with warnx if a namespace related ioctl fails with ENOSYS

Qemu userspace emulation reports ENOSYS if it doesn't support a given
ioctl command.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
15 months agolsns: fill the netsid member of lsns_process with reliable value
Masatake YAMATO [Sat, 13 Apr 2024 17:05:10 +0000 (02:05 +0900)] 
lsns: fill the netsid member of lsns_process with reliable value

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
15 months agolsns: tolerate lsns_ioctl(fd, NS_GET_{PARENT,USERNS}) failing with ENOSYS
Masatake YAMATO [Sat, 13 Apr 2024 16:40:14 +0000 (01:40 +0900)] 
lsns: tolerate lsns_ioctl(fd, NS_GET_{PARENT,USERNS}) failing with ENOSYS

With the original code, "lsns/filedesc" test case failed on
"build (qemu-user, s390x)" and "build (qemu-user, riscv64)".

On the platforms, lsns_ioctl(fd, NS_GET_{PARENT,USERNS}) failed
with ENOSYS. The error stoped the iteration for gathering
information from /proc/[0-9]+. As a result, lsns printed
nothing. We don't expect this behavior.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
15 months agotextutils: introduce and use fgetwc_or_err
Thomas Weißschuh [Sat, 13 Apr 2024 08:34:32 +0000 (10:34 +0200)] 
textutils: introduce and use fgetwc_or_err

A return value of WEOF of fgetwc() can either mean end-of-file or an
error in errno. The error was ignored and interpreted as end-of-file.
Introduce a new helper that aborts on error and use it in text-utils.

This replaces all calls to plain fgetwc().

Closes #2909
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
15 months agotreewide: use fgetc() instead of getc()
Thomas Weißschuh [Sat, 13 Apr 2024 10:59:10 +0000 (12:59 +0200)] 
treewide: use fgetc() instead of getc()

fgetc() is similar to getc() but is guaranteed to be a function.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
15 months agotextutils: use fgetwc() instead of getwc()
Thomas Weißschuh [Sat, 13 Apr 2024 08:21:21 +0000 (10:21 +0200)] 
textutils: use fgetwc() instead of getwc()

getwc() has the same semantics as fgetwc() but may be a function or
macro. According to the manpage "there is no reason ever to use it".

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
15 months agoRevert "lib/pager: Apply pager-specific fixes only when needed"
Thomas Weißschuh [Sat, 13 Apr 2024 07:42:39 +0000 (09:42 +0200)] 
Revert "lib/pager: Apply pager-specific fixes only when needed"

Less is not always detectable, as it can be hidden behind symlinks or
wrapper as for example in a default Debian installation.
Also testing for the literal string "less" does not match full path
specifications like "/usr/bin/less".

Instead always apply the fixes.

This reverts commit c10ad975895372122f72c8d9da089b6ea69f778b.
Closes #2951
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
15 months agolsns: add more print-debug code
Masatake YAMATO [Sat, 13 Apr 2024 02:32:14 +0000 (11:32 +0900)] 
lsns: add more print-debug code

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
15 months agotests: (lsns::filedesc) enable debug output and show the exit status
Masatake YAMATO [Fri, 12 Apr 2024 20:04:33 +0000 (05:04 +0900)] 
tests: (lsns::filedesc) enable debug output and show the exit status

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
15 months agolslocks: remove a unused local variable
Masatake YAMATO [Fri, 12 Apr 2024 19:13:03 +0000 (04:13 +0900)] 
lslocks: remove a unused local variable

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
15 months agolslocks: don't abort gathering per-process information even if opening a /proc/[0...
Masatake YAMATO [Fri, 12 Apr 2024 18:59:39 +0000 (03:59 +0900)] 
lslocks: don't abort gathering per-process information even if opening a /proc/[0-9]* fails

If a process ($pid) taking a lock is gone while running lslocks,
gathering per-process information for the process may fail in opening
/proc/$pid. Though lslocks should work with incomplete information,
the original code stopped gathering per-process information for the
other processes.

As a result of the original behavior, tests/ts/lslocks/lslocks really
failed in an environment where multiple test cases ran simultaneously.

Close #2624 again.
See also #2633.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
15 months agodocs: lsns(8): ENVIRONMENT: describe LSNS_DEBUG
Masatake YAMATO [Fri, 12 Apr 2024 18:39:18 +0000 (03:39 +0900)] 
docs: lsns(8): ENVIRONMENT: describe LSNS_DEBUG

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
15 months agolsns: continue the executing even if opening a /proc/$pid fails
Masatake YAMATO [Fri, 12 Apr 2024 18:16:32 +0000 (03:16 +0900)] 
lsns: continue the executing even if opening a /proc/$pid fails

In the original code, lsns printed nothing if it failed in opening the
last dntry in /proc/[0-9]* though lsns should work partially.

The original behavior caused the combination of the following two
test cases failed:

    $ tests/ts/lsns/filter & tests/ts/lsns/ioctl_ns &
    [1] 19178
    [2] 19179
    $          lsns: ownership and hierarchy        ...         \
    lsns: -Q, --filter option            ... FAILED
     FAILED

    [1]-  Done                    tests/ts/lsns/filter
    [2]+  Done                    tests/ts/lsns/ioctl_ns

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
15 months agotests: (lsns::filter) don't use double-quotes chars for PID
Masatake YAMATO [Mon, 8 Apr 2024 19:22:54 +0000 (04:22 +0900)] 
tests: (lsns::filter) don't use double-quotes chars for PID

15 months agotests: (lsns::filter) add more debug printing
Masatake YAMATO [Mon, 8 Apr 2024 19:18:43 +0000 (04:18 +0900)] 
tests: (lsns::filter) add more debug printing

15 months agotests: (lsns::filter) delete an unused variable
Masatake YAMATO [Mon, 8 Apr 2024 19:12:44 +0000 (04:12 +0900)] 
tests: (lsns::filter) delete an unused variable

15 months agomeson: Remove libblkid dependency on libmount
Jordan Williams [Mon, 8 Apr 2024 16:37:01 +0000 (11:37 -0500)] 
meson: Remove libblkid dependency on libmount

I added this incorrect dependency between libblkid and libmount.
The option to build libblkid should be allowed whether or not the
build-libmount feature is allowed.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
15 months agomeson: Make the zlib dependency a disabler when not found
Jordan Williams [Mon, 8 Apr 2024 15:49:01 +0000 (10:49 -0500)] 
meson: Make the zlib dependency a disabler when not found

This disables targets that require zlib when it is not found.
Currently, targets requiring zlib are built when it is not found.
Fixes #2930.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
15 months agomeson: Make ncurses dependency a disabler when not found
Jordan Williams [Mon, 8 Apr 2024 15:42:00 +0000 (10:42 -0500)] 
meson: Make ncurses dependency a disabler when not found

This disables targets that require ncurses when it is not found.
Currently, targets requiring ncurses are built when it is not found.
Fixes #2929.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
15 months agomeson: Make tinfo dependency a disabler when not found
Jordan Williams [Mon, 8 Apr 2024 15:28:02 +0000 (10:28 -0500)] 
meson: Make tinfo dependency a disabler when not found

This disables targets that require tinfo when it is not found.
Currently, targets requiring tinfo are built when it is not found.
Fixes #2927.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
15 months agoautotools: add --disable-enosys, check for linux/audit.h
Karel Zak [Wed, 10 Apr 2024 09:50:58 +0000 (11:50 +0200)] 
autotools: add --disable-enosys, check for linux/audit.h

Signed-off-by: Karel Zak <kzak@redhat.com>
15 months agoautotools: check for sys/vfs.h and linux/bpf.h
Karel Zak [Wed, 10 Apr 2024 09:44:49 +0000 (11:44 +0200)] 
autotools: check for sys/vfs.h and linux/bpf.h

Addresses: https://github.com/util-linux/util-linux/pull/2933
Addresses: https://github.com/util-linux/util-linux/issues/2945
Signed-off-by: Karel Zak <kzak@redhat.com>
15 months agoFix misplaced else in mnt_update_already_done
Gavin Lloyd [Wed, 10 Apr 2024 00:38:02 +0000 (17:38 -0700)] 
Fix misplaced else in mnt_update_already_done

See 477401f0de

15 months agomeson: Only use the --version-script linker flag where it is supported
Jordan Williams [Mon, 8 Apr 2024 17:02:52 +0000 (12:02 -0500)] 
meson: Only use the --version-script linker flag where it is supported

macOS does not support the --version-script linker flag.
Only use it if it is available.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
15 months agomeson: Require the sys/vfs.h header for libmount and fstrim
Jordan Williams [Mon, 8 Apr 2024 16:17:12 +0000 (11:17 -0500)] 
meson: Require the sys/vfs.h header for libmount and fstrim

libmount and fstrim both include sys/vfs.h unconditionally.
To avoid an error at compile time, require this header for their
respective feature options to be enabled.
This avoids building them on systems without sys/vfs.h, such as macOS.

Fixes #2932.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
15 months agoaudit-arch.h: add defines for m68k, sh
Chris Hofstaedtler [Tue, 9 Apr 2024 08:34:59 +0000 (10:34 +0200)] 
audit-arch.h: add defines for m68k, sh

John Paul Adrian Glaubitz points out that libseccomp needs to release 2.6.0,
too.

Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Reviewed-by: Thomas Weißschuh <thomas@t-8ch.de>
Signed-off-by: Chris Hofstaedtler <zeha@debian.org>
15 months agolsns: fix ul_path_stat() error handling [coverity scan]
Karel Zak [Tue, 9 Apr 2024 11:45:50 +0000 (13:45 +0200)] 
lsns: fix ul_path_stat() error handling [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
15 months agoMerge branch 'logger/fixes' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 9 Apr 2024 10:16:21 +0000 (12:16 +0200)] 
Merge branch 'logger/fixes' of https://github.com/t-8ch/util-linux

* 'logger/fixes' of https://github.com/t-8ch/util-linux:
  logger: correctly format tv_usec
  logger: rework error handling in logger_gettimeofday()
  logger: handle failures of gettimeofday()

15 months agoMerge branch 'lsfd--verify-proc-syscall-for-master' of https://github.com/masatake...
Karel Zak [Tue, 9 Apr 2024 10:07:12 +0000 (12:07 +0200)] 
Merge branch 'lsfd--verify-proc-syscall-for-master' of https://github.com/masatake/util-linux

* 'lsfd--verify-proc-syscall-for-master' of https://github.com/masatake/util-linux:
  tests: (lsfd::mkfds-multiplexing) skip if /proc/$pid/syscall is broken

15 months agoMerge branch 'missing-pam' of https://github.com/jwillikers/util-linux
Karel Zak [Tue, 9 Apr 2024 10:04:33 +0000 (12:04 +0200)] 
Merge branch 'missing-pam' of https://github.com/jwillikers/util-linux

* 'missing-pam' of https://github.com/jwillikers/util-linux:
  meson: Disable targets requiring pam when it is missing

15 months agoMerge branch 'meson-python-embed-dep' of https://github.com/jwillikers/util-linux
Karel Zak [Tue, 9 Apr 2024 10:02:35 +0000 (12:02 +0200)] 
Merge branch 'meson-python-embed-dep' of https://github.com/jwillikers/util-linux

* 'meson-python-embed-dep' of https://github.com/jwillikers/util-linux:
  meson: Require Python dependency which can be embedded for pylibmount

15 months agoMerge branch 'sqlite-dep-liblastlog2' of https://github.com/jwillikers/util-linux
Karel Zak [Tue, 9 Apr 2024 10:00:53 +0000 (12:00 +0200)] 
Merge branch 'sqlite-dep-liblastlog2' of https://github.com/jwillikers/util-linux

* 'sqlite-dep-liblastlog2' of https://github.com/jwillikers/util-linux:
  meson: Enforce sqlite dependency for liblastlog2

15 months agologger: correctly format tv_usec
Thomas Weißschuh [Tue, 9 Apr 2024 09:00:26 +0000 (11:00 +0200)] 
logger: correctly format tv_usec

tv_usec is an unspecified signed integer type.
The format string %u assumes an unsigned int, which is incorrect.
Especially on 32bit big-endian, where it can lead to invalid values.

Reported-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Link: https://lore.kernel.org/util-linux/afef1b770ad80d50660bb2c53a0a8330b88d1049.camel@physik.fu-berlin.de/
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
15 months agologger: rework error handling in logger_gettimeofday()
Thomas Weißschuh [Tue, 9 Apr 2024 09:00:08 +0000 (11:00 +0200)] 
logger: rework error handling in logger_gettimeofday()

* Fail when LOGGER_TEST_TIMEOFDAY is set to an invalid value
* Fail with return -1 and errno, the same as normal gettimeofday()

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
15 months agologger: handle failures of gettimeofday()
Thomas Weißschuh [Tue, 9 Apr 2024 08:58:19 +0000 (10:58 +0200)] 
logger: handle failures of gettimeofday()

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
15 months agofindmnt: revise the code for -I and -D option
Masatake YAMATO [Fri, 5 Apr 2024 13:40:36 +0000 (22:40 +0900)] 
findmnt: revise the code for -I and -D option

Fixes #2913.

3dd79293b5b655da9d913dedd8facb08959a7826 added -I option.
However, the code used bit flags (FL_DF and FL_DF_INODES) wrongly;
the code broke the output of -D option.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
15 months agotests: (lsfd::mkfds-multiplexing) skip if /proc/$pid/syscall is broken
Masatake YAMATO [Thu, 4 Apr 2024 19:00:45 +0000 (04:00 +0900)] 
tests: (lsfd::mkfds-multiplexing) skip if /proc/$pid/syscall is broken

Close #2867
Close #2887

We should skip the test case on the platforms where /proc/$pid/syscall
doesn't report correct system call number. On such platforms,

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
(cherry picked from commit e199a933058ae052b1dfa2fcb457791f47b60b11)

15 months agomeson: Disable targets requiring pam when it is missing
Jordan Williams [Mon, 8 Apr 2024 15:12:17 +0000 (10:12 -0500)] 
meson: Disable targets requiring pam when it is missing

Several executables require the pam library.
The current behavior in Meson only requires this library when these
executables are explicitly enabled.
Unfortunately, by default, Meson will not throw an error when the
required pam library is missing while still trying to build these
executables.
To fix this, make the pam library a disabler which automatically
disables these executables if it is not found.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
15 months agomeson: Require Python dependency which can be embedded for pylibmount
Jordan Williams [Mon, 8 Apr 2024 14:33:19 +0000 (09:33 -0500)] 
meson: Require Python dependency which can be embedded for pylibmount

Meson doesn't properly check that the necessary Python.h header file is
available for the pylibmount module.
Passing true for the embed keyword argument for the Python dependency
method ensures that this header file is available.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
15 months agomeson: Enforce sqlite dependency for liblastlog2
Jordan Williams [Mon, 8 Apr 2024 13:30:24 +0000 (08:30 -0500)] 
meson: Enforce sqlite dependency for liblastlog2

liblastlog2 requires the sqlite dependency.
Currently, Meson enforces this dependency to be available only when the
build-liblastlog2 feature is explicitly enabled.
liblastlog2 is built by default, so if sqlite is not available, the
build will be configured correctly, but fail to compile.
This commit fixes this case by automatically disabling the
build-liblastlog2 feature when it is auto and sqlite is not found.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
15 months agofindfs: (man) be more accurate in describing non-tags
Karel Zak [Mon, 8 Apr 2024 08:19:56 +0000 (10:19 +0200)] 
findfs: (man) be more accurate in describing non-tags

Addresses: https://github.com/util-linux/util-linux/discussions/2914
Signed-off-by: Karel Zak <kzak@redhat.com>
15 months agoMerge branch 'spelling' of https://github.com/jwilk-forks/util-linux
Karel Zak [Mon, 8 Apr 2024 07:59:23 +0000 (09:59 +0200)] 
Merge branch 'spelling' of https://github.com/jwilk-forks/util-linux

* 'spelling' of https://github.com/jwilk-forks/util-linux:
  enosys: (man) add missing word

15 months agoMerge branch 'test_mkfds-sockdiag-for-master' of https://github.com/masatake/util...
Karel Zak [Mon, 8 Apr 2024 07:55:59 +0000 (09:55 +0200)] 
Merge branch 'test_mkfds-sockdiag-for-master' of https://github.com/masatake/util-linux

* 'test_mkfds-sockdiag-for-master' of https://github.com/masatake/util-linux:
  tests: (test_mkfds::sockdiag) verify the recieved message to detect whether the socket is usable or not
  lsfd: add LSFD_DEBUG env var for debugging
  tests: (lsfd) skip some cases if NETLINK_SOCK_DIAG for AF_UNIX is not available
  tests: (test_mkfds::sockdiag) new factory
  tests: (lsfd-functions.bash,cosmetic) unify the style to define functions
  tests: (lsfd) fix typoes in an error name

15 months agoMerge branch 'xry111/pidfs' of https://github.com/xry111/util-linux
Karel Zak [Mon, 8 Apr 2024 07:48:10 +0000 (09:48 +0200)] 
Merge branch 'xry111/pidfs' of https://github.com/xry111/util-linux

* 'xry111/pidfs' of https://github.com/xry111/util-linux:
  lsfd: test: Adapt test cases for pidfs
  lsfd: Support pidfs
  lsfd: Refactor the pidfd logic into lsfd-pidfd.c
  include: Include <unistd.h> in pidfd-utils.h for syscall()

15 months agoMerge branch 'meson-make-libmount-optional' of https://github.com/jwillikers/util...
Karel Zak [Mon, 8 Apr 2024 07:43:15 +0000 (09:43 +0200)] 
Merge branch 'meson-make-libmount-optional' of https://github.com/jwillikers/util-linux

* 'meson-make-libmount-optional' of https://github.com/jwillikers/util-linux:
  meson: Only build libmount when required
  meson: Use libblkid as a dependency
  meson: Use libmount as a dependency

15 months agoMerge branch 'lsns--opened-ns' of https://github.com/masatake/util-linux
Karel Zak [Mon, 8 Apr 2024 07:41:03 +0000 (09:41 +0200)] 
Merge branch 'lsns--opened-ns' of https://github.com/masatake/util-linux

* 'lsns--opened-ns' of https://github.com/masatake/util-linux:
  lsns: show namespaces only kept alive by open file descriptors
  lsns: (refactor) use ul_new_path and procfs_process_init_path

15 months agoenosys: (man) add missing word
Jakub Wilk [Mon, 8 Apr 2024 06:50:39 +0000 (08:50 +0200)] 
enosys: (man) add missing word

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
15 months agomeson: use signed chars
Thomas Weißschuh [Sun, 7 Apr 2024 09:15:29 +0000 (11:15 +0200)] 
meson: use signed chars

This matches what the autotools build is doing.
Also see https://github.com/util-linux/util-linux/pull/2768 .

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
15 months agomeson: Only build libmount when required
Jordan Williams [Fri, 5 Apr 2024 14:49:17 +0000 (07:49 -0700)] 
meson: Only build libmount when required

It is not currently possible to build any part of util-linux without
building libmount when using Meson.
The libuuid library is commonly used on macOS, where it is not possible
to build libmount.
To address this, this PR makes it possible to build without libmount and
 libblkid.

Options have been added to allow toggling whether to build targets that
require libmount.
This makes it possible to fully disable building libmount.

The python object had to be defined outside of the meson.build file in
libmount/python since this may no longer be included.
The python object is used for tests.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
15 months agomeson: Use libblkid as a dependency
Jordan Williams [Fri, 5 Apr 2024 15:30:02 +0000 (08:30 -0700)] 
meson: Use libblkid as a dependency

Several utilities depend on libblkid internally.
Currently, link_with and global include directories are used to
associate targets with libblkid.
This PR uses Meson's dependencies argument for targets to define this
relationship instead.
This carries include directories along with the library to link.

An additional dependency is declared for the static libblkid library.
A couple of executables use this dependency explicitly.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
15 months agomeson: Use libmount as a dependency
Jordan Williams [Fri, 5 Apr 2024 15:33:22 +0000 (08:33 -0700)] 
meson: Use libmount as a dependency

Several utilities depend on libmount internally.
Currently, link_with and global include directories are used to
associate targets with libmount.
This PR uses Meson's dependencies argument for targets to define this
relationship instead.
This carries include directories along with the library to link.

An additional dependency is declared for the static libmount library.
A couple of executables use this dependency explicitly.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
15 months agotests: (test_mkfds::sockdiag) verify the recieved message to detect whether the socke...
Masatake YAMATO [Mon, 1 Apr 2024 21:34:40 +0000 (06:34 +0900)] 
tests: (test_mkfds::sockdiag) verify the recieved message to detect whether the socket is usable or not

Close #2822 again.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
(cherry picked from commit f98a4c12b366ae2b5e01fa30d72eef34f3bab681)

15 months agolsfd: add LSFD_DEBUG env var for debugging
Masatake YAMATO [Sat, 30 Mar 2024 09:47:03 +0000 (18:47 +0900)] 
lsfd: add LSFD_DEBUG env var for debugging

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
(cherry picked from commit fbdbf44752b1b8fe5caeae168809fe2e4629752f)

15 months agotests: (lsfd) skip some cases if NETLINK_SOCK_DIAG for AF_UNIX is not available
Masatake YAMATO [Sat, 16 Mar 2024 13:20:00 +0000 (22:20 +0900)] 
tests: (lsfd) skip some cases if NETLINK_SOCK_DIAG for AF_UNIX is not available

Close #2822.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
15 months agotests: (test_mkfds::sockdiag) new factory
Masatake YAMATO [Sat, 16 Mar 2024 13:07:43 +0000 (22:07 +0900)] 
tests: (test_mkfds::sockdiag) new factory

The factory is for detecting whether a platform provides
NETLINK_SOCK_DIAG sockets for a given family.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
15 months agotests: (lsfd-functions.bash,cosmetic) unify the style to define functions
Masatake YAMATO [Sat, 16 Mar 2024 13:05:48 +0000 (22:05 +0900)] 
tests: (lsfd-functions.bash,cosmetic) unify the style to define functions

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
15 months agotests: (lsfd) fix typoes in an error name
Masatake YAMATO [Sat, 16 Mar 2024 15:38:17 +0000 (00:38 +0900)] 
tests: (lsfd) fix typoes in an error name

15 months agoMerge branch 'meson-optional-rt' of https://github.com/jwillikers/util-linux
Karel Zak [Fri, 5 Apr 2024 08:57:13 +0000 (10:57 +0200)] 
Merge branch 'meson-optional-rt' of https://github.com/jwillikers/util-linux

* 'meson-optional-rt' of https://github.com/jwillikers/util-linux:
  meson: Only pick up the rt library once
  meson: Add build-lsfd option and make rt dependency optional

15 months agoMerge branch 'PR/libsmartcols-json-empty' of github.com:karelzak/util-linux-work
Karel Zak [Fri, 5 Apr 2024 07:40:48 +0000 (09:40 +0200)] 
Merge branch 'PR/libsmartcols-json-empty' of github.com:karelzak/util-linux-work

* 'PR/libsmartcols-json-empty' of github.com:karelzak/util-linux-work:
  libsmartcols: print empty arrays in better way
  lib/jsonwrt: introduce ul_jsonwrt_empty()

15 months agoMerge branch 'fix/opal_luks_blkid_scan' of https://github.com/oldium/util-linux
Karel Zak [Fri, 5 Apr 2024 07:33:40 +0000 (09:33 +0200)] 
Merge branch 'fix/opal_luks_blkid_scan' of https://github.com/oldium/util-linux

* 'fix/opal_luks_blkid_scan' of https://github.com/oldium/util-linux:
  libblkid: check OPAL lock only when necessary
  libblkid: introduce luks opal prober

15 months agoMerge branch 'blkid/topology-ioctl' of https://github.com/t-8ch/util-linux
Karel Zak [Fri, 5 Apr 2024 06:49:48 +0000 (08:49 +0200)] 
Merge branch 'blkid/topology-ioctl' of https://github.com/t-8ch/util-linux

* 'blkid/topology-ioctl' of https://github.com/t-8ch/util-linux:
  libblkid: topology/ioctl: simplify ioctl handling

15 months agolibblkid: topology/ioctl: simplify ioctl handling
Thomas Weißschuh [Thu, 4 Apr 2024 05:24:58 +0000 (07:24 +0200)] 
libblkid: topology/ioctl: simplify ioctl handling

Coverity complains about the data copy within the union.
Instead unroll the loop which is less code and easier to follow.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
15 months agomount: (man) add note about -o bind,rw
Karel Zak [Thu, 4 Apr 2024 10:19:09 +0000 (12:19 +0200)] 
mount: (man) add note about -o bind,rw

Signed-off-by: Karel Zak <kzak@redhat.com>
15 months agosys-utils/irq-common: fix SPDX typos
Karel Zak [Thu, 4 Apr 2024 09:54:27 +0000 (11:54 +0200)] 
sys-utils/irq-common: fix SPDX typos

Reported-by: oliver Fendt <ofendt@googlemail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
15 months agoMerge branch 'blkid/topology-ioctl' of https://github.com/t-8ch/util-linux
Karel Zak [Wed, 3 Apr 2024 12:10:06 +0000 (14:10 +0200)] 
Merge branch 'blkid/topology-ioctl' of https://github.com/t-8ch/util-linux

* 'blkid/topology-ioctl' of https://github.com/t-8ch/util-linux:
  libblkid: topology/ioctl: correctly handle kernel types

15 months agolibsmartcols: print empty arrays in better way
Karel Zak [Wed, 3 Apr 2024 12:00:45 +0000 (14:00 +0200)] 
libsmartcols: print empty arrays in better way

Use "[]" rather than "[null]" to print empty array.

Old version:
         "mountpoints": [
             null
         ],
New version:
"mountpoints": [],

Fixes: https://github.com/util-linux/util-linux/issues/2871
Signed-off-by: Karel Zak <kzak@redhat.com>