]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
17 months agotmpfiles: add and install for uuidd, generate /run/uuidd & /var/lib/libuuid
Christian Hesse [Thu, 22 Feb 2024 07:48:55 +0000 (08:48 +0100)] 
tmpfiles: add and install for uuidd, generate /run/uuidd & /var/lib/libuuid

These directories are requird for uuidd, so let systemd-tmpfiles create them.

Signed-off-by: Christian Hesse <mail@eworm.de>
17 months agodocs: move GPL-2.0 license text to Docimentation directory
Karel Zak [Wed, 28 Feb 2024 13:37:25 +0000 (14:37 +0100)] 
docs: move GPL-2.0 license text to Docimentation directory

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agodocs: use proper XSPD identifier for GPL-2.0
Karel Zak [Wed, 28 Feb 2024 12:22:51 +0000 (13:22 +0100)] 
docs: use proper XSPD identifier for GPL-2.0

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agoMerge branch 'PR/hexdump-overflow' of github.com:karelzak/util-linux-work
Karel Zak [Wed, 28 Feb 2024 11:16:25 +0000 (12:16 +0100)] 
Merge branch 'PR/hexdump-overflow' of github.com:karelzak/util-linux-work

* 'PR/hexdump-overflow' of github.com:karelzak/util-linux-work:
  hexdump: check blocksize when display data

17 months agoMerge branch 'enosys/dump' of https://github.com/t-8ch/util-linux
Karel Zak [Wed, 28 Feb 2024 10:49:51 +0000 (11:49 +0100)] 
Merge branch 'enosys/dump' of https://github.com/t-8ch/util-linux

* 'enosys/dump' of https://github.com/t-8ch/util-linux:
  enosys: allow dumping to file
  codeql: don't report world-writable files

17 months agoMerge branch 'PR/libmount-errmsg' of github.com:karelzak/util-linux-work
Karel Zak [Wed, 28 Feb 2024 10:49:37 +0000 (11:49 +0100)] 
Merge branch 'PR/libmount-errmsg' of github.com:karelzak/util-linux-work

* 'PR/libmount-errmsg' of github.com:karelzak/util-linux-work:
  libmount: report kernel message from new API

17 months agoenosys: allow dumping to file
Thomas Weißschuh [Thu, 22 Feb 2024 21:54:41 +0000 (22:54 +0100)] 
enosys: allow dumping to file

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
17 months agocodeql: don't report world-writable files
Thomas Weißschuh [Tue, 27 Feb 2024 19:54:33 +0000 (20:54 +0100)] 
codeql: don't report world-writable files

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
17 months agohexdump: check blocksize when display data
Karel Zak [Tue, 27 Feb 2024 17:38:02 +0000 (18:38 +0100)] 
hexdump: check blocksize when display data

hexdump(1) stores input to buffer and apply format unit when prints
the output. The unit can move pointer which points to the buffer, but
code does not check for limits.

Fixes: https://github.com/util-linux/util-linux/issues/2806
Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agoMerge branch 'PR/dmesg-2807' of github.com:karelzak/util-linux-work
Karel Zak [Tue, 27 Feb 2024 15:10:22 +0000 (16:10 +0100)] 
Merge branch 'PR/dmesg-2807' of github.com:karelzak/util-linux-work

* 'PR/dmesg-2807' of github.com:karelzak/util-linux-work:
  dmesg: fix wrong size calculation

17 months agolibmount: report kernel message from new API
Karel Zak [Mon, 26 Feb 2024 11:44:10 +0000 (12:44 +0100)] 
libmount: report kernel message from new API

This is a very minimalistic implementation for v2.40 designed to print
error messages from the kernel. It exclusively displays errors, and
the patch does not introduce any new library interface for this
purpose. Instead, it simply replaces hardcoded messages within
libmount with kernel messages.

It's worth noting that the final implementation will necessitate
per-hook error handling in libmount and likely a new library API to
access other types of messages (warnings, notices, etc.).

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agoMerge branch 'patch-1' of https://github.com/ThomasKaiser/util-linux
Karel Zak [Tue, 27 Feb 2024 13:28:48 +0000 (14:28 +0100)] 
Merge branch 'patch-1' of https://github.com/ThomasKaiser/util-linux

* 'patch-1' of https://github.com/ThomasKaiser/util-linux:
  Adding Neoverse-V3/-N3 ARM cores

17 months agomeson: avoid future-deprecated feature
Thomas Weißschuh [Mon, 26 Feb 2024 19:01:45 +0000 (20:01 +0100)] 
meson: avoid future-deprecated feature

Avoid the following message from meson:

  NOTICE: Future-deprecated features used:
   * 1.1.0: {'"boolean option" keyword argument "value" of type str'}

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
17 months agodmesg: fix wrong size calculation
Karel Zak [Mon, 26 Feb 2024 13:30:55 +0000 (14:30 +0100)] 
dmesg: fix wrong size calculation

* don't use string based function strspn() if work with non-zero terminated
  buffer

* make sure that message size is calculated from within buffer pointers

Fixes: https://github.com/util-linux/util-linux/issues/2807
Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agoAdding Neoverse-V3/-N3 ARM cores
Thomas Kaiser [Mon, 26 Feb 2024 11:20:11 +0000 (12:20 +0100)] 
Adding Neoverse-V3/-N3 ARM cores

17 months agoMerge branch 'meson/gnu-source' of https://github.com/t-8ch/util-linux
Karel Zak [Mon, 26 Feb 2024 08:51:54 +0000 (09:51 +0100)] 
Merge branch 'meson/gnu-source' of https://github.com/t-8ch/util-linux

* 'meson/gnu-source' of https://github.com/t-8ch/util-linux:
  meson: run compiler checks with -D_GNU_SOURCE when necessary

17 months agolibmount: don't hold write fd to mounted device
Jan Kara [Wed, 21 Feb 2024 17:30:50 +0000 (18:30 +0100)] 
libmount: don't hold write fd to mounted device

Avoid holding writeable fd to a loop device that is being mounted. In
the hardened configurations (CONFIG_BLK_DEV_WRITE_MOUNTED = n) the
kernel wants to make sure nobody else has the block device writeably
open when mounting so this makes the mount fail.

Reported-by: JunChao Sun <sunjunchao2870@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Acked-by: Christian Brauner <brauner@kernel.org>
17 months agomeson: run compiler checks with -D_GNU_SOURCE when necessary
Thomas Weißschuh [Fri, 23 Feb 2024 07:15:32 +0000 (08:15 +0100)] 
meson: run compiler checks with -D_GNU_SOURCE when necessary

Through the addition of default_options: c_std=c99 some build-time
checks were incorrect. Explicitly add -D_GNU_SOURCE where necessary.

Fixes: 6240e4458cdf ("build: use -std=c99 and -std=c++11 by default")
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
17 months agoMerge branch 'lastlog2_error' of https://github.com/schubi2/util-linux
Karel Zak [Thu, 22 Feb 2024 09:44:41 +0000 (10:44 +0100)] 
Merge branch 'lastlog2_error' of https://github.com/schubi2/util-linux

* 'lastlog2_error' of https://github.com/schubi2/util-linux:
  liblastlog2: Improved sqlite3 error handling

17 months agoMerge branch 'PR/more-poll' of github.com:karelzak/util-linux-work
Karel Zak [Thu, 22 Feb 2024 09:39:03 +0000 (10:39 +0100)] 
Merge branch 'PR/more-poll' of github.com:karelzak/util-linux-work

* 'PR/more-poll' of github.com:karelzak/util-linux-work:
  more: fix poll() use

17 months agoMerge branch 'PR/lastlog2-cleanup' of github.com:karelzak/util-linux-work
Karel Zak [Thu, 22 Feb 2024 09:38:25 +0000 (10:38 +0100)] 
Merge branch 'PR/lastlog2-cleanup' of github.com:karelzak/util-linux-work

* 'PR/lastlog2-cleanup' of github.com:karelzak/util-linux-work:
  lastlog2: convert check_user() to boolean-like macro
  lastlog: cleanup function definitions
  lastlog2: make longopts[] static-const
  lastlog: improve errors printing
  lastlog2: improve coding style

17 months agoenosys: add support for alternative error codes
Thomas Weißschuh [Sun, 4 Feb 2024 10:56:58 +0000 (11:56 +0100)] 
enosys: add support for alternative error codes

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
17 months agoenosys: generalize named number parsing
Thomas Weißschuh [Sun, 4 Feb 2024 10:36:54 +0000 (11:36 +0100)] 
enosys: generalize named number parsing

[kzak@redhat.com: - resolve merge conflict in main()]

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
17 months agoautotools: make errnos.h available without lsfd
Thomas Weißschuh [Sat, 17 Feb 2024 09:03:22 +0000 (10:03 +0100)] 
autotools: make errnos.h available without lsfd

enosys will use it.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
17 months agoMerge branch 'enosys/dump' of https://github.com/t-8ch/util-linux
Karel Zak [Thu, 22 Feb 2024 09:26:15 +0000 (10:26 +0100)] 
Merge branch 'enosys/dump' of https://github.com/t-8ch/util-linux

* 'enosys/dump' of https://github.com/t-8ch/util-linux:
  setpriv: (tests) add seccomp test
  setpriv: add support for seccomp filters
  enosys: add functionality to dump filter
  include: introduce seccomp.h

17 months agoliblastlog2: Improved sqlite3 error handling
Stefan Schubert [Wed, 21 Feb 2024 12:09:52 +0000 (13:09 +0100)] 
liblastlog2: Improved sqlite3 error handling

17 months agodocs: cleanup public domain license texts
Karel Zak [Wed, 21 Feb 2024 09:13:50 +0000 (10:13 +0100)] 
docs: cleanup public domain license texts

The absence of an official 'Public domain' definition is the reason
why, for example, the Fedora distribution aggregates all variants from
various projects to make them reviewable.

This commit unifies the 'Public domain' statements to make it simple.

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agomore: fix poll() use
Karel Zak [Tue, 20 Feb 2024 11:26:33 +0000 (12:26 +0100)] 
more: fix poll() use

The more(1) command utilizes signalfd() to monitor signals and reads
commands from the user via stderr (as stdin is typically used for
piping and not for user interaction).

However, the current more_poll() implementation ignores stderr. As a result,
more(1) waits on read(stderr) while completely ignoring signals. This issue
becomes evident when using commands like:

    grep foo /path/file | more

In such cases, it's only possible to exit 'more' by pressing 'q';
CTRL+C does not work.

Changes:

- Refactor more_poll() code:
  - Introduce an enum to access pfd[] items instead of using magical constants.
  - Implement a while() loop to handle EAGAIN or POLLHUP.

- Ignore stdin after POLLHUP (indicating that the pipe's peer closed).
- Ensure stderr is also checked.
- Use return codes akin to classic poll().

Note: I have doubts regarding the usability of stdin in more_poll(),
as the function is primarily used to wait for user input (via stderr)
and to monitor signals. Nevertheless, it is retained for potential use
in detecting when the pipe's peer (or the entire session) has been
terminated (see commit 68e14d3d5f4116ad3aca0e392d008645ea90cf70).

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agolastlog2: convert check_user() to boolean-like macro
Karel Zak [Tue, 20 Feb 2024 09:37:02 +0000 (10:37 +0100)] 
lastlog2: convert check_user() to boolean-like macro

Let's make simple and stupid.

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agolastlog: cleanup function definitions
Karel Zak [Tue, 20 Feb 2024 09:28:06 +0000 (10:28 +0100)] 
lastlog: cleanup function definitions

- let's make it more compatible with the rest of util-linux

- don't initialize global static variables (it's unnecessary)

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agolastlog2: make longopts[] static-const
Karel Zak [Tue, 20 Feb 2024 09:20:10 +0000 (10:20 +0100)] 
lastlog2: make longopts[] static-const

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agolastlog: improve errors printing
Karel Zak [Tue, 20 Feb 2024 09:12:19 +0000 (10:12 +0100)] 
lastlog: improve errors printing

- single exit by goto

- always print specific error (e.g. "Couldn't update login time ...")
  and then optionally generic ll2 error

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agolastlog2: improve coding style
Karel Zak [Tue, 20 Feb 2024 08:55:48 +0000 (09:55 +0100)] 
lastlog2: improve coding style

- use space around operators
- remove unnecessary line breaks from errx() calls

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agolastlog2: Don't print space if Service column is not printed
Miika Alikirri [Mon, 19 Feb 2024 10:09:13 +0000 (12:09 +0200)] 
lastlog2: Don't print space if Service column is not printed

17 months agoMerge branch 'foo' of https://github.com/emanuele6/util-linux
Karel Zak [Mon, 19 Feb 2024 09:22:11 +0000 (10:22 +0100)] 
Merge branch 'foo' of https://github.com/emanuele6/util-linux

* 'foo' of https://github.com/emanuele6/util-linux:
  docs: remove duplicated author name in namei.1.adoc

17 months agoMerge branch 'patch-2' of https://github.com/ThomasKaiser/util-linux
Karel Zak [Mon, 19 Feb 2024 09:20:42 +0000 (10:20 +0100)] 
Merge branch 'patch-2' of https://github.com/ThomasKaiser/util-linux

* 'patch-2' of https://github.com/ThomasKaiser/util-linux:
  Add Microsoft as vendor and Cobalt 100 core

17 months agoMerge branch 'meson/lslogins' of https://github.com/t-8ch/util-linux
Karel Zak [Mon, 19 Feb 2024 09:13:59 +0000 (10:13 +0100)] 
Merge branch 'meson/lslogins' of https://github.com/t-8ch/util-linux

* 'meson/lslogins' of https://github.com/t-8ch/util-linux:
  meson: fix build of lslogins with -Dbuild-liblastlog2=disabled

17 months agoMerge branch 'fix-luks-offset' of https://github.com/mbroz/util-linux
Karel Zak [Mon, 19 Feb 2024 09:13:42 +0000 (10:13 +0100)] 
Merge branch 'fix-luks-offset' of https://github.com/mbroz/util-linux

* 'fix-luks-offset' of https://github.com/mbroz/util-linux:
  libblkid: Check offset in LUKS2 header

17 months agodocs: improve howto-pull-request
Karel Zak [Mon, 19 Feb 2024 09:10:56 +0000 (10:10 +0100)] 
docs: improve howto-pull-request

* improve branch naming suggestions

* recommend GitHub, make Mailing-List optional

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agoAdd Microsoft as vendor and Cobalt 100 core
Thomas Kaiser [Sun, 18 Feb 2024 23:16:54 +0000 (00:16 +0100)] 
Add Microsoft as vendor and Cobalt 100 core

https://lore.kernel.org/linux-arm-kernel/b99a7196-011e-4f08-83ec-e63a690ab919@linux.microsoft.com/T/

17 months agodocs: remove duplicated author name in namei.1.adoc
Emanuele Torre [Sun, 18 Feb 2024 03:43:09 +0000 (04:43 +0100)] 
docs: remove duplicated author name in namei.1.adoc

This was being rendered in the man page as:

    The program was rewritten by Karel Zak Karel Zak <kzak@redhat.com>.

Instead of as:

    The program was rewritten by Karel Zak <kzak@redhat.com>.

17 months agomeson: fix build of lslogins with -Dbuild-liblastlog2=disabled
Thomas Weißschuh [Sat, 17 Feb 2024 08:54:56 +0000 (09:54 +0100)] 
meson: fix build of lslogins with -Dbuild-liblastlog2=disabled

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
17 months agolibblkid: Check offset in LUKS2 header
Milan Broz [Fri, 16 Feb 2024 15:44:12 +0000 (16:44 +0100)] 
libblkid: Check offset in LUKS2 header

LUKS2 binary header contains offset field that describes where
the header should be located.

If this offset is not correct, blkid should tread this header
as invalid.

This patch fixes problem when both swap and LUKS headers are
present (LUKS header was swapped out) and detected LUKS header
is at a wrong offset.
As LUKS has higher priority, it confuses detection.

Signed-off-by: Milan Broz <gmazyland@gmail.com>
17 months agodocs: add hints about systemd
Karel Zak [Thu, 15 Feb 2024 09:33:42 +0000 (10:33 +0100)] 
docs: add hints about systemd

Suggested-by: Stanislav Brabec <sbrabec@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agoMerge branch 'PR/dmesg-fixes' of github.com:karelzak/util-linux-work
Karel Zak [Thu, 15 Feb 2024 09:10:42 +0000 (10:10 +0100)] 
Merge branch 'PR/dmesg-fixes' of github.com:karelzak/util-linux-work

* 'PR/dmesg-fixes' of github.com:karelzak/util-linux-work:
  tests: update dmesg deltas
  dmesg: fix delta calculation
  dmesg: don't affect delta by --since

17 months agoMerge branch 'PR/meson-lastlog2' of github.com:karelzak/util-linux-work
Karel Zak [Thu, 15 Feb 2024 09:10:08 +0000 (10:10 +0100)] 
Merge branch 'PR/meson-lastlog2' of github.com:karelzak/util-linux-work

* 'PR/meson-lastlog2' of github.com:karelzak/util-linux-work:
  meson: install lastlog2.h library header file

17 months agoMerge branch 'lslogins-lastlog2' of https://github.com/schubi2/util-linux
Karel Zak [Wed, 14 Feb 2024 13:46:26 +0000 (14:46 +0100)] 
Merge branch 'lslogins-lastlog2' of https://github.com/schubi2/util-linux

* 'lslogins-lastlog2' of https://github.com/schubi2/util-linux:
  added build option login-lastlogin
  added sqlite3 to packit
  added sqlite3 to debian build
  fixed time
  unifiy test output
  cleanup tests
  cleanup tests
  fixed time-stamp
  creating lastlog2 database in the tests
  check test output
  cleanup; Added testcase for lslogins and lastlog2 DB
  lslogins: Add support for lastlog2

17 months agomeson: install lastlog2.h library header file
Karel Zak [Wed, 14 Feb 2024 08:31:34 +0000 (09:31 +0100)] 
meson: install lastlog2.h library header file

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agoMerge branch 'as-safe-maybe_final' of https://github.com/crrodriguez/util-linux
Karel Zak [Tue, 13 Feb 2024 19:08:58 +0000 (20:08 +0100)] 
Merge branch 'as-safe-maybe_final' of https://github.com/crrodriguez/util-linux

* 'as-safe-maybe_final' of https://github.com/crrodriguez/util-linux:
  Save and restore errno on signal handlers

17 months agoRevert "libmount: don't canonicalize symlinks for bind operation"
Karel Zak [Tue, 13 Feb 2024 18:54:08 +0000 (19:54 +0100)] 
Revert "libmount: don't canonicalize symlinks for bind operation"

This reverts commit 1b2d8187360157b00b47f52522fc039d82e34e6b.

Unfortunately, this new feature introduces a regression. We need a
better solution (probably mount options option to enable the feature)
rather than enable it by default.

Fixes: https://github.com/util-linux/util-linux/issues/2773
References: https://github.com/util-linux/util-linux/issues/2370

17 months agotests: update dmesg deltas
Karel Zak [Tue, 13 Feb 2024 18:09:38 +0000 (19:09 +0100)] 
tests: update dmesg deltas

See commit a355f2b78a8c486f7721371d9010f4f1bafcee00.

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agodmesg: fix delta calculation
Karel Zak [Tue, 13 Feb 2024 09:56:41 +0000 (10:56 +0100)] 
dmesg: fix delta calculation

Old:
./dmesg --nopager --color=never --decode --time-format delta  --kernel --since "@$t"
kern  :info  : [<18446744098961.000000>] bash (40091): drop_caches: 3

Fixed:
./dmesg --nopager --color=never --decode --time-format delta  --kernel --since "@$t"
kern  :info  : [<25251.997673>] bash (40091): drop_caches: 3

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agodmesg: don't affect delta by --since
Karel Zak [Tue, 13 Feb 2024 09:53:41 +0000 (10:53 +0100)] 
dmesg: don't affect delta by --since

Fixes: https://github.com/util-linux/util-linux/issues/2770
Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agoSave and restore errno on signal handlers
Cristian Rodríguez [Sun, 11 Feb 2024 18:53:30 +0000 (15:53 -0300)] 
Save and restore errno on signal handlers

"Fetching and setting the value of errno is async-signal-safe
provided that the signal handler saves errno on entry and
       restores its value before returning."

save and restore errno on cases where it is needed.

17 months agoMerge branch 'minor-improvement' of https://github.com/calestyo/util-linux
Karel Zak [Mon, 12 Feb 2024 11:53:20 +0000 (12:53 +0100)] 
Merge branch 'minor-improvement' of https://github.com/calestyo/util-linux

* 'minor-improvement' of https://github.com/calestyo/util-linux:
  blkdev.h: update location of SCSI device types

17 months agofsck: warn if fsck.<type> not found and device is specified
Karel Zak [Thu, 8 Feb 2024 11:42:51 +0000 (12:42 +0100)] 
fsck: warn if fsck.<type> not found and device is specified

The fsck(8) command prints an error for certain 'required'
filesystems, such as extN, if the corresponding fsck.<type> helper is
not found. However, for other filesystems, it silently ignores the
device. While this behavior is acceptable for the -A option, if a user
explicitly specifies the device on the command line, it is probably a
good idea to be more verbose and issue a warning that the device will
be ignored. The warning is enabled only for interactive mode (only one
device specified or -s).

Note that some filesystems do not have an fsck utility, so caution is
needed when issuing such warnings to prevent the generation of a large
number of unwanted entries in system logs, etc."

Reported-by: наб <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agoMerge branch 'nopython' of https://github.com/Vogtinator/util-linux
Karel Zak [Mon, 12 Feb 2024 11:49:29 +0000 (12:49 +0100)] 
Merge branch 'nopython' of https://github.com/Vogtinator/util-linux

* 'nopython' of https://github.com/Vogtinator/util-linux:
  meson: Only build libmount python module if python was found

17 months agoMerge branch 'lastlog2' of https://github.com/Vogtinator/util-linux
Karel Zak [Mon, 12 Feb 2024 11:49:11 +0000 (12:49 +0100)] 
Merge branch 'lastlog2' of https://github.com/Vogtinator/util-linux

* 'lastlog2' of https://github.com/Vogtinator/util-linux:
  lastlog2: Fix various issues with meson

17 months agoMerge branch 'more-meson' of https://github.com/keszybz/util-linux
Karel Zak [Mon, 12 Feb 2024 11:48:52 +0000 (12:48 +0100)] 
Merge branch 'more-meson' of https://github.com/keszybz/util-linux

* 'more-meson' of https://github.com/keszybz/util-linux:
  meson: fix mismatch with handling of lib_dl dependency
  meson: add forgotten files to lists
  meson: fix disablement check

17 months agoMerge branch 'column-handle-ansi-escapes' of https://github.com/juarezr/util-linux
Karel Zak [Mon, 12 Feb 2024 11:48:13 +0000 (12:48 +0100)] 
Merge branch 'column-handle-ansi-escapes' of https://github.com/juarezr/util-linux

* 'column-handle-ansi-escapes' of https://github.com/juarezr/util-linux:
  column: add doc comment explaining ansi code detection
  column: fix regression tests complaint
  column: add test for ansi escapes
  column: fix unaligned cols in text with ansi escapes

17 months agoblkdev.h: update location of SCSI device types
Christoph Anton Mitterer [Fri, 9 Feb 2024 22:34:25 +0000 (23:34 +0100)] 
blkdev.h: update location of SCSI device types

In Linux commit c5f1ac8b94bd10f97f5aa1a3279ad8e8bbc6311a (“Split SCSI header
files”) these definition where split out into `include/scsi/scsi_proto.h`.

This commit also removes the git link (any kernel sources will do just fine) and
just names the file.

Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
17 months agomeson: Only build libmount python module if python was found
Fabian Vogt [Wed, 7 Feb 2024 10:48:33 +0000 (11:48 +0100)] 
meson: Only build libmount python module if python was found

The extension_module call was in the wrong place.

17 months agolastlog2: Fix various issues with meson
Fabian Vogt [Wed, 7 Feb 2024 10:29:26 +0000 (11:29 +0100)] 
lastlog2: Fix various issues with meson

- Make sure @usrbin_execdir@ is actually replaced
- pam_lastlog2.so is always a shared library that's dlopen()ed,
  so use shared_module and do not generate a pkgconfig module

17 months agolibmount: fix copy & past bug in lock initialization
Karel Zak [Wed, 7 Feb 2024 09:56:19 +0000 (10:56 +0100)] 
libmount: fix copy & past bug in lock initialization

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agocolumn: add doc comment explaining ansi code detection
Juarez Rudsatz [Mon, 5 Feb 2024 18:59:15 +0000 (15:59 -0300)] 
column: add doc comment explaining ansi code detection

17 months agocolumn: fix regression tests complaint
Juarez Rudsatz [Mon, 5 Feb 2024 14:49:27 +0000 (11:49 -0300)] 
column: fix regression tests complaint

17 months agocolumn: add test for ansi escapes
Juarez Rudsatz [Mon, 5 Feb 2024 01:33:35 +0000 (22:33 -0300)] 
column: add test for ansi escapes

17 months agocolumn: fix unaligned cols in text with ansi escapes
Juarez Rudsatz [Mon, 5 Feb 2024 01:32:41 +0000 (22:32 -0300)] 
column: fix unaligned cols in text with ansi escapes

17 months agomeson: fix mismatch with handling of lib_dl dependency
Zbigniew Jędrzejewski-Szmek [Tue, 6 Feb 2024 12:41:53 +0000 (13:41 +0100)] 
meson: fix mismatch with handling of lib_dl dependency

lib_dl is only defined if both conditions are met, so meson would fail with an
undefined variable.

17 months agomeson: add forgotten files to lists
Zbigniew Jędrzejewski-Szmek [Tue, 6 Feb 2024 12:18:38 +0000 (13:18 +0100)] 
meson: add forgotten files to lists

17 months agomeson: fix disablement check
Zbigniew Jędrzejewski-Szmek [Tue, 6 Feb 2024 12:14:37 +0000 (13:14 +0100)] 
meson: fix disablement check

opt is not defined for those programs.

17 months agosetpriv: (tests) add seccomp test
Thomas Weißschuh [Fri, 2 Feb 2024 14:20:57 +0000 (15:20 +0100)] 
setpriv: (tests) add seccomp test

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
17 months agosetpriv: add support for seccomp filters
Thomas Weißschuh [Fri, 2 Feb 2024 14:20:40 +0000 (15:20 +0100)] 
setpriv: add support for seccomp filters

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
17 months agoenosys: add functionality to dump filter
Thomas Weißschuh [Fri, 2 Feb 2024 14:00:56 +0000 (15:00 +0100)] 
enosys: add functionality to dump filter

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
17 months agoinclude: introduce seccomp.h
Thomas Weißschuh [Fri, 2 Feb 2024 14:28:30 +0000 (15:28 +0100)] 
include: introduce seccomp.h

It will be used by setpriv in a future commit.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
17 months agoMerge branch 'lsfd--error' of https://github.com/masatake/util-linux
Karel Zak [Mon, 5 Feb 2024 11:07:49 +0000 (12:07 +0100)] 
Merge branch 'lsfd--error' of https://github.com/masatake/util-linux

* 'lsfd--error' of https://github.com/masatake/util-linux:
  tests: (lsfd) add a case testing ERROR type appeared in TYPE column
  tests: (test_mkfds::mmap) new factory
  lsfd: add --_drop-prvilege option for testing purpose
  lsfd: add ERROR as a new type
  lsfd: (refactor) make the steps for new_file consistent
  lsfd: (refactor) add abst_class as super class of file_class
  lsfd: (refactor) simplify the step to make a file struct
  lsfd: (refactor) simplify the step to copy a file struct if the result of its stat is reusable
  lsfd: (refactor) flatten bit fields in struct file
  lsfd: fix typos of a function name

17 months agoMerge branch 'meson/lastlog2' of https://github.com/t-8ch/util-linux v2.41-start
Karel Zak [Mon, 5 Feb 2024 10:55:39 +0000 (11:55 +0100)] 
Merge branch 'meson/lastlog2' of https://github.com/t-8ch/util-linux

* 'meson/lastlog2' of https://github.com/t-8ch/util-linux:
  meson: only build liblastlog when enabled
  meson: create dedicated config for pam_lastlog2
  meson: use a dependency object for sqlite3
  meson: use a dependency object for liblastlog2

17 months agoMerge branch 'lsclocks' of https://github.com/alanc/util-linux
Karel Zak [Mon, 5 Feb 2024 10:53:55 +0000 (11:53 +0100)] 
Merge branch 'lsclocks' of https://github.com/alanc/util-linux

* 'lsclocks' of https://github.com/alanc/util-linux:
  lsclocks: use clock id from clock_getcpuclockid in add_cpu_clock

17 months agoMerge branch 'strtod' of https://github.com/alanc/util-linux
Karel Zak [Mon, 5 Feb 2024 10:42:53 +0000 (11:42 +0100)] 
Merge branch 'strtod' of https://github.com/alanc/util-linux

* 'strtod' of https://github.com/alanc/util-linux:
  lib/c_strtod: fix uselocale() fallback if strtod_l() is not available

17 months agofdisk: (man) fix typo, improve readability
Karel Zak [Mon, 5 Feb 2024 10:21:41 +0000 (11:21 +0100)] 
fdisk: (man) fix typo, improve readability

Reported-by: Michael Partridge <mcp292@nau.edu>
Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agoMerge branch 'enosys/optim' of https://github.com/t-8ch/util-linux
Karel Zak [Mon, 5 Feb 2024 09:54:17 +0000 (10:54 +0100)] 
Merge branch 'enosys/optim' of https://github.com/t-8ch/util-linux

* 'enosys/optim' of https://github.com/t-8ch/util-linux:
  enosys: optimize bytecode when execve is not blocked
  enosys: optimize bytecode when no ioctls are blocked
  enosys: add helpers for 64 bit integer loading
  enosys: drop unnessecary load of ioctl number

17 months agoMerge branch 'master' of https://github.com/echoechoin/util-linux
Karel Zak [Mon, 5 Feb 2024 09:38:40 +0000 (10:38 +0100)] 
Merge branch 'master' of https://github.com/echoechoin/util-linux

* 'master' of https://github.com/echoechoin/util-linux:
  sys-utils/lscpu: Unblock SIGSEGV before vmware_bdoor

17 months agodocs: add setpgid do ReleaseNotes
Karel Zak [Mon, 5 Feb 2024 09:20:39 +0000 (10:20 +0100)] 
docs: add setpgid do ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agoliblastlog2: fix pkg-config inclidedir
Karel Zak [Mon, 5 Feb 2024 08:15:55 +0000 (09:15 +0100)] 
liblastlog2: fix pkg-config inclidedir

The path for .pc must be the same as liblastlog2/src/Makemodule.am:$lastlog2incdir
(and it's usually /usr/include/liblastlog2/).

Signed-off-by: Karel Zak <kzak@redhat.com>
17 months agolsclocks: use clock id from clock_getcpuclockid in add_cpu_clock
Alan Coopersmith [Sun, 4 Feb 2024 17:14:23 +0000 (09:14 -0800)] 
lsclocks: use clock id from clock_getcpuclockid in add_cpu_clock

Fixes #2761

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
17 months agoenosys: optimize bytecode when execve is not blocked
Thomas Weißschuh [Sun, 4 Feb 2024 09:06:39 +0000 (10:06 +0100)] 
enosys: optimize bytecode when execve is not blocked

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
17 months agoenosys: optimize bytecode when no ioctls are blocked
Thomas Weißschuh [Sat, 3 Feb 2024 17:55:13 +0000 (18:55 +0100)] 
enosys: optimize bytecode when no ioctls are blocked

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
17 months agoenosys: add helpers for 64 bit integer loading
Thomas Weißschuh [Sun, 4 Feb 2024 09:21:05 +0000 (10:21 +0100)] 
enosys: add helpers for 64 bit integer loading

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
17 months agoenosys: drop unnessecary load of ioctl number
Thomas Weißschuh [Sun, 4 Feb 2024 09:24:26 +0000 (10:24 +0100)] 
enosys: drop unnessecary load of ioctl number

The ioctl number is properly loaded just below the deleted instruction
anyways.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
17 months agolib/c_strtod: fix uselocale() fallback if strtod_l() is not available
Alan Coopersmith [Sat, 3 Feb 2024 02:09:18 +0000 (18:09 -0800)] 
lib/c_strtod: fix uselocale() fallback if strtod_l() is not available

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
17 months agotests: (lsfd) add a case testing ERROR type appeared in TYPE column
Masatake YAMATO [Tue, 23 Jan 2024 23:57:06 +0000 (08:57 +0900)] 
tests: (lsfd) add a case testing ERROR type appeared in TYPE column

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
17 months agotests: (test_mkfds::mmap) new factory
Masatake YAMATO [Mon, 29 Jan 2024 16:02:07 +0000 (01:02 +0900)] 
tests: (test_mkfds::mmap) new factory

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
17 months agolsfd: add --_drop-prvilege option for testing purpose
Masatake YAMATO [Tue, 23 Jan 2024 20:20:49 +0000 (05:20 +0900)] 
lsfd: add --_drop-prvilege option for testing purpose

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
17 months agolsfd: add ERROR as a new type
Masatake YAMATO [Mon, 15 Jan 2024 19:18:38 +0000 (04:18 +0900)] 
lsfd: add ERROR as a new type

lsfd ignored file descriptors with that readlink(2) or
stat(2) returned errors.

With ERORR type, lsfd can print these file descriptors with incomplete
information.

An example output:

   COMMAND        PID   USER ASSOC  XMODE  TYPE          SOURCE MNTID INODE NAME
   systemd      10677 yamato    31 ????-- ERROR readlink:EACCES
   slirp4netns 901147 yamato     7 ????-- ERROR     stat:EACCES             /home/yamato/.local/share/.../merged

The format of SOURCE column is SYSCALL:ERRNO.

The code for printing errno name is highly based on the code for
printing syscall name in enosys.c.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
17 months agolsfd: (refactor) make the steps for new_file consistent
Masatake YAMATO [Mon, 15 Jan 2024 17:50:23 +0000 (02:50 +0900)] 
lsfd: (refactor) make the steps for new_file consistent

In parse_maps_line of the original code, we called readlink after stat
for gathering arguments that were passed to new_file().

The order was different from that in collect_file_symlink.
In parse_maps_line, we called stat after readlink.

The difference of the order may make the way of handling
errors of readlink and stat complicated.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
17 months agolsfd: (refactor) add abst_class as super class of file_class
Masatake YAMATO [Sun, 14 Jan 2024 22:18:58 +0000 (07:18 +0900)] 
lsfd: (refactor) add abst_class as super class of file_class

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
17 months agolsfd: (refactor) simplify the step to make a file struct
Masatake YAMATO [Sun, 14 Jan 2024 21:40:37 +0000 (06:40 +0900)] 
lsfd: (refactor) simplify the step to make a file struct

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
17 months agolsfd: (refactor) simplify the step to copy a file struct if the result of its stat...
Masatake YAMATO [Sun, 14 Jan 2024 21:26:07 +0000 (06:26 +0900)] 
lsfd: (refactor) simplify the step to copy a file struct if the result of its stat is reusable

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
17 months agolsfd: (refactor) flatten bit fields in struct file
Masatake YAMATO [Sun, 14 Jan 2024 00:37:37 +0000 (09:37 +0900)] 
lsfd: (refactor) flatten bit fields in struct file

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
17 months agolsfd: fix typos of a function name
Masatake YAMATO [Sun, 14 Jan 2024 21:19:50 +0000 (06:19 +0900)] 
lsfd: fix typos of a function name

Signed-off-by: Masatake YAMATO <yamato@redhat.com>