]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
11 months agoMerge branch 'setpriv-ptracer' of https://github.com/geofft/util-linux
Karel Zak [Wed, 14 Aug 2024 09:07:23 +0000 (11:07 +0200)] 
Merge branch 'setpriv-ptracer' of https://github.com/geofft/util-linux

* 'setpriv-ptracer' of https://github.com/geofft/util-linux:
  setpriv: Add --ptracer, which calls PR_SET_PTRACER

11 months agoMerge branch 'lastlog2' of https://github.com/stoeckmann/util-linux
Karel Zak [Wed, 14 Aug 2024 07:54:44 +0000 (09:54 +0200)] 
Merge branch 'lastlog2' of https://github.com/stoeckmann/util-linux

* 'lastlog2' of https://github.com/stoeckmann/util-linux:
  lastlog2: Improve comments and documentation
  Treat out of memory as error

11 months agoMerge branch 'meson' of https://github.com/ldv-alt/util-linux
Karel Zak [Wed, 14 Aug 2024 07:52:19 +0000 (09:52 +0200)] 
Merge branch 'meson' of https://github.com/ldv-alt/util-linux

* 'meson' of https://github.com/ldv-alt/util-linux:
  meson: use a / b instead of join_paths(a, b)

11 months agoMerge branch 'openwrt/23.05.4' of https://github.com/t-8ch/util-linux
Karel Zak [Wed, 14 Aug 2024 07:50:33 +0000 (09:50 +0200)] 
Merge branch 'openwrt/23.05.4' of https://github.com/t-8ch/util-linux

* 'openwrt/23.05.4' of https://github.com/t-8ch/util-linux:
  ci: use OpenWRT SDK v23.05.4

11 months agoMerge branch 'ts_helper_cap' of https://github.com/t-8ch/util-linux
Karel Zak [Wed, 14 Aug 2024 07:49:50 +0000 (09:49 +0200)] 
Merge branch 'ts_helper_cap' of https://github.com/t-8ch/util-linux

* 'ts_helper_cap' of https://github.com/t-8ch/util-linux:
  tests: properly look for ts_cap helper

11 months agosetpriv: Add --ptracer, which calls PR_SET_PTRACER
Geoffrey Thomas [Mon, 12 Aug 2024 23:02:05 +0000 (23:02 +0000)] 
setpriv: Add --ptracer, which calls PR_SET_PTRACER

This makes it easier to use a debugger on systems with Yama configured
without making the debugger binary itself privileged.

Signed-off-by: Geoffrey Thomas <geofft@ldpreload.com>
11 months agolastlog2: Improve comments and documentation
Tobias Stoeckmann [Mon, 12 Aug 2024 15:37:53 +0000 (17:37 +0200)] 
lastlog2: Improve comments and documentation

Fix grammar issues and unify style across documentation and code comments.
No functional change.

11 months agoTreat out of memory as error
Tobias Stoeckmann [Mon, 12 Aug 2024 15:37:03 +0000 (17:37 +0200)] 
Treat out of memory as error

Otherwise it might happen that a configured file location is not taken
into account. A NULL value would lead to default file location.

11 months agomeson: use a / b instead of join_paths(a, b)
Dmitry V. Levin [Sun, 11 Aug 2024 08:00:00 +0000 (08:00 +0000)] 
meson: use a / b instead of join_paths(a, b)

According to [1], since meson 0.49.0, using the / operator on strings
is equivalent to calling join_paths().

As the expressions written using the / operator are shorter and nicer
than their equivalents written using join_paths(), and given that
we've been using this new operator since commit
5f2c862a4aff19f5bc732e677405f04e2d07c211, let's convert remaining
join_paths() invocations to use the / operator instead.

[1] https://mesonbuild.com/Reference-manual_functions.html#join_paths

11 months agoci: use OpenWRT SDK v23.05.4
Thomas Weißschuh [Tue, 6 Aug 2024 19:32:42 +0000 (21:32 +0200)] 
ci: use OpenWRT SDK v23.05.4

Binary builds and SDKs for archs38 are not provided anymore.

The SDK now also requires STAGING_DIR_HOST to be set.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
12 months agotests: properly look for ts_cap helper
Thomas Weißschuh [Tue, 6 Aug 2024 17:44:00 +0000 (19:44 +0200)] 
tests: properly look for ts_cap helper

Helpers should use ts_check_test_command, not ts_check_prog.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
12 months agolibmount: propagate first error of multiple filesystem types
John Keeping [Tue, 6 Aug 2024 17:17:29 +0000 (18:17 +0100)] 
libmount: propagate first error of multiple filesystem types

Use the same error handling logic as do_mount_by_pattern() to better
handle the case where EROFS is returned from the first filesystem in a
list but subsequent filesystems overwrite this status with, for example,
ENODEV.

This allows read-only devices to mount without the user needing to
explicitly specify "ro" while specifying a list of potential
filesystems, some of which may not be available.

Signed-off-by: John Keeping <jkeeping@inmusicbrands.com>
12 months agolibmount: extract common error handling function
John Keeping [Tue, 6 Aug 2024 17:16:00 +0000 (18:16 +0100)] 
libmount: extract common error handling function

Extract the logic for whether to continue trying more filesystem types
to a function so that it can be reused to make this consistent between
do_mount_by_pattern() and do_mount_by_types().

Signed-off-by: John Keeping <jkeeping@inmusicbrands.com>
12 months agoMerge branch 'typos' of https://github.com/howjmay/util-linux-c
Karel Zak [Mon, 5 Aug 2024 09:13:35 +0000 (11:13 +0200)] 
Merge branch 'typos' of https://github.com/howjmay/util-linux-c

* 'typos' of https://github.com/howjmay/util-linux-c:
  Fix the typos

12 months agoAdd GPT type "Atari TOS raw data (XHDI)"
Uwe Seimet [Sat, 3 Aug 2024 11:12:53 +0000 (13:12 +0200)] 
Add GPT type "Atari TOS raw data (XHDI)"

12 months agoFix the typos
Yang Hau [Fri, 2 Aug 2024 13:05:35 +0000 (21:05 +0800)] 
Fix the typos

12 months agoMerge branch 'bash-completion--fadvise--typo' of https://github.com/masatake/util...
Karel Zak [Fri, 2 Aug 2024 10:39:21 +0000 (12:39 +0200)] 
Merge branch 'bash-completion--fadvise--typo' of https://github.com/masatake/util-linux

* 'bash-completion--fadvise--typo' of https://github.com/masatake/util-linux:
  fadvise: fix a typo of an option name in the bash completion rule

12 months agolscpu: make code more readable
Karel Zak [Mon, 29 Jul 2024 08:21:28 +0000 (10:21 +0200)] 
lscpu: make code more readable

Signed-off-by: Karel Zak <kzak@redhat.com>
12 months agolscpu: Skip aarch64 decode path for rest of the architectures
Pratik R. Sampat [Mon, 22 Jul 2024 16:00:46 +0000 (16:00 +0000)] 
lscpu: Skip aarch64 decode path for rest of the architectures

lscpu behaves differently when run sudo vs non-sudo on AMD architectures.

On sudo runs, it adds a BIOS model name and BIOS CPU family which it
does not add for the latter. However since this parsing from the DMI is
primarily catered to aarch64, for AMD platform the BIOS model name is
printed out as follows "AMD XXX Processor *Unknown* CPU @ X.XGHz" due
to the part number is not populated on the platform.

The issue boils down to an unconditional call to arm_decode() which
attempts to read the DMI path and populate the processor information
such as processor version and part number which is set to Unknown on AMD
CPUs.

81d6de9 (lscpu: remove the old code) changed the DMI path from
/sys/firmware/dmi/entries/4-0/raw (non-existent) to
/sys/firmware/dmi/tables/dmi (existent) which has brought this latent
issue to light as DMI was starting to be parsed incorrectly.

Therefore, do not perform aarch64 parsing for other architectures.

Before
------
$ lscpu
Vendor ID:                AuthenticAMD
  Model name:             AMD EPYC XXXX X-Core Processor
    CPU family:           26

$ sudo lscpu
Vendor ID:                AuthenticAMD
  BIOS Vendor ID:         Advanced Micro Devices, Inc.
  Model name:             AMD EPYC XXXX X-Core Processor
    BIOS Model name:      AMD EPYC XXXX X-Core Processor Unknown CPU @ X.XGHz
    BIOS CPU family:      107
    CPU family:           26

After
-----
$ lscpu
Vendor ID:                AuthenticAMD
  Model name:             AMD EPYC XXXX X-Core Processor
    CPU family:           26

$ sudo lscpu
Vendor ID:                AuthenticAMD
  Model name:             AMD EPYC XXXX X-Core Processor
    CPU family:           26

Fixes: 81d6de9 ("lscpu: remove the old code")
Co-developed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Pratik R. Sampat <pratikrajesh.sampat@amd.com>
12 months agofadvise: fix a typo of an option name in the bash completion rule
Masatake YAMATO [Tue, 30 Jul 2024 05:05:00 +0000 (14:05 +0900)] 
fadvise: fix a typo of an option name in the bash completion rule

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
12 months agoMerge branch 'patch-2' of https://github.com/satmandu/util-linux
Karel Zak [Mon, 29 Jul 2024 08:00:26 +0000 (10:00 +0200)] 
Merge branch 'patch-2' of https://github.com/satmandu/util-linux

* 'patch-2' of https://github.com/satmandu/util-linux:
  Add thread dep to libuuid meson.build

12 months agolibblkid: bitlocker: add drive label
Victor Westerhuis [Wed, 24 Jul 2024 15:32:28 +0000 (17:32 +0200)] 
libblkid: bitlocker: add drive label

12 months agolibblkid: bitlocker: use volume identifier as UUID
Victor Westerhuis [Wed, 24 Jul 2024 15:31:04 +0000 (17:31 +0200)] 
libblkid: bitlocker: use volume identifier as UUID

12 months agolibblkid: bitlocker: add image for Windows 7+ BitLocker
Victor Westerhuis [Thu, 25 Jul 2024 10:58:34 +0000 (12:58 +0200)] 
libblkid: bitlocker: add image for Windows 7+ BitLocker

12 months agolibblkid: bitlocker: fix version on big-endian systems
Victor Westerhuis [Thu, 25 Jul 2024 13:10:16 +0000 (15:10 +0200)] 
libblkid: bitlocker: fix version on big-endian systems

12 months agoagetty: fix ambiguous ‘else’ [-Werror=dangling-else]
Karel Zak [Wed, 24 Jul 2024 07:13:08 +0000 (09:13 +0200)] 
agetty: fix ambiguous ‘else’ [-Werror=dangling-else]

Signed-off-by: Karel Zak <kzak@redhat.com>
12 months agoagetty: Prevent cursor escape
Stanislav Brabec [Sun, 21 Jul 2024 13:01:42 +0000 (15:01 +0200)] 
agetty: Prevent cursor escape

Starting with 5de97519, it is possible to escape the login dialog on the
screen by arrow characters or using escape sequences.

Since full processing of escape sequences and ignore them would be
complicated, use a work around: instead of sending ESC to output, send a
printable character.

It could cause a rendering regression in a very obscure condition: compiled
without IUTF8, encoding is ISO-11548-1 and BRAILLE PATTERN DOTS-1245 is
part of login name. I believe that it is out of supported combinations.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
12 months agoMerge branch 'PR/coverity-misc' of github.com:karelzak/util-linux-work
Karel Zak [Tue, 23 Jul 2024 12:07:10 +0000 (14:07 +0200)] 
Merge branch 'PR/coverity-misc' of github.com:karelzak/util-linux-work

* 'PR/coverity-misc' of github.com:karelzak/util-linux-work:
  cal: make sure day_in_week() does not overrun array size [coverity scan]

12 months agoscriptlive: add --echo <never|always|auto>
Karel Zak [Tue, 23 Jul 2024 11:57:46 +0000 (13:57 +0200)] 
scriptlive: add --echo <never|always|auto>

It would be beneficial to have a method for controlling the ECHO flag.

References: https://github.com/util-linux/util-linux/pull/3133
Signed-off-by: Karel Zak <kzak@redhat.com>
12 months agoMerge branch 'scriptlive_echo' of https://github.com/werekraken/util-linux
Karel Zak [Tue, 23 Jul 2024 11:44:48 +0000 (13:44 +0200)] 
Merge branch 'scriptlive_echo' of https://github.com/werekraken/util-linux

* 'scriptlive_echo' of https://github.com/werekraken/util-linux:
  scriptlive: echo re-run commands from in stream

12 months agolibuuid: fix gcc15 warnings
Cristian Rodríguez [Fri, 19 Jul 2024 00:40:33 +0000 (20:40 -0400)] 
libuuid: fix gcc15 warnings

gcc15 complains that the initialization is too long, indeed it is not
counting the last null byte, fix by simply not using an explicit count

Signed-off-by: Karel Zak <kzak@redhat.com>
12 months agoscriptlive: echo re-run commands from in stream
Matt Cover [Sat, 20 Jul 2024 21:49:35 +0000 (14:49 -0700)] 
scriptlive: echo re-run commands from in stream

12 months agoAdd thread dep to libuuid meson.build
Satadru Pramanik, DO, MPH, MEng [Fri, 19 Jul 2024 17:52:26 +0000 (13:52 -0400)] 
Add thread dep to libuuid meson.build

Fixes: https://github.com/util-linux/util-linux/issues/3131
12 months agolibuuid: set variant in the corrrect byte: __uuid_set_variant_and_version
oittaa [Tue, 16 Jul 2024 01:35:58 +0000 (03:35 +0200)] 
libuuid: set variant in the corrrect byte: __uuid_set_variant_and_version

12 months agoMerge branch 'mes2' of https://github.com/neheb/util-linux
Karel Zak [Mon, 15 Jul 2024 10:16:16 +0000 (12:16 +0200)] 
Merge branch 'mes2' of https://github.com/neheb/util-linux

* 'mes2' of https://github.com/neheb/util-linux:
  meson: add options for more utilities

12 months agoMerge branch 'kill--decode' of https://github.com/masatake/util-linux
Karel Zak [Mon, 15 Jul 2024 10:15:28 +0000 (12:15 +0200)] 
Merge branch 'kill--decode' of https://github.com/masatake/util-linux

* 'kill--decode' of https://github.com/masatake/util-linux:
  kill: (test) add a case for testing -l 0xSIGMASK and -d $PID options
  kill: add a feature decoding signal masks

12 months agocal: make sure day_in_week() does not overrun array size [coverity scan]
Karel Zak [Thu, 11 Jul 2024 12:15:44 +0000 (14:15 +0200)] 
cal: make sure day_in_week() does not overrun array size [coverity scan]

It's very theoretical, but protect against this possibility.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 months agoagetty: add "systemd" to --version output
Karel Zak [Thu, 11 Jul 2024 11:26:30 +0000 (13:26 +0200)] 
agetty: add "systemd" to --version output

Signed-off-by: Karel Zak <kzak@redhat.com>
12 months agouuidd: fix typo in tmpfiles.conf
Karel Zak [Wed, 10 Jul 2024 13:55:35 +0000 (15:55 +0200)] 
uuidd: fix typo in tmpfiles.conf

Let's change 2755 to 2775. The directory must be writable for the
'uuidd' group.

Addresses: http://github.com/util-linux/util-linux/commit/e0c41735aa13a7a62e42c0428823537d3edc02a8
Signed-off-by: Karel Zak <kzak@redhat.com>
12 months agoMerge branch 'bug3120' of https://github.com/dgibson/util-linux
Karel Zak [Wed, 10 Jul 2024 09:31:54 +0000 (11:31 +0200)] 
Merge branch 'bug3120' of https://github.com/dgibson/util-linux

* 'bug3120' of https://github.com/dgibson/util-linux:
  unshare: Add options to identity map the user's subordinate uids and gids

12 months agoMerge branch 'mess' of https://github.com/neheb/util-linux
Karel Zak [Wed, 10 Jul 2024 09:22:05 +0000 (11:22 +0200)] 
Merge branch 'mess' of https://github.com/neheb/util-linux

* 'mess' of https://github.com/neheb/util-linux:
  meson: po: disable if nls is disabled

12 months agoMerge branch 'tos_basic_data' of https://github.com/uweseimet/util-linux
Karel Zak [Wed, 10 Jul 2024 08:07:34 +0000 (10:07 +0200)] 
Merge branch 'tos_basic_data' of https://github.com/uweseimet/util-linux

* 'tos_basic_data' of https://github.com/uweseimet/util-linux:
  Add GPT type "Atari TOS basic data" (734E5AFE-F61A-11E6-BC64-92361F002671)

12 months agolsmem: improve coding style
Karel Zak [Wed, 10 Jul 2024 08:06:54 +0000 (10:06 +0200)] 
lsmem: improve coding style

Signed-off-by: Karel Zak <kzak@redhat.com>
12 months agoMerge branch 'lsmem' of https://github.com/biubiuzy/util-linux
Karel Zak [Wed, 10 Jul 2024 08:05:20 +0000 (10:05 +0200)] 
Merge branch 'lsmem' of https://github.com/biubiuzy/util-linux

* 'lsmem' of https://github.com/biubiuzy/util-linux:
  lsmem: make lsmem to check for the nodes more robust

12 months agouuidd: fix /var/lib/libuuid mode uuidd-tmpfiles.conf
Karel Zak [Tue, 9 Jul 2024 15:04:09 +0000 (17:04 +0200)] 
uuidd: fix /var/lib/libuuid mode uuidd-tmpfiles.conf

The directory can be directly used by libuuid, for example, by running
"uuidgen --time" as root, even if the uuidd daemon is not installed.
In this case, we must create a clock.txt file with the uuidd group to
prevent any potential ownership mismatch if the uuidd daemon is
installed later. The 2xxx mode (setgid) forces open(O_CREAT) in
libuuid to create the file with the uuidd group.

Please note that mode 2755 is the standard used for years in RHEL.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 months agoAdd GPT type "Atari TOS basic data" (734E5AFE-F61A-11E6-BC64-92361F002671)
Uwe Seimet [Tue, 9 Jul 2024 10:23:14 +0000 (12:23 +0200)] 
Add GPT type "Atari TOS basic data" (734E5AFE-F61A-11E6-BC64-92361F002671)

12 months agoMerge branch 'spaces' of https://github.com/emperor06/util-linux
Karel Zak [Tue, 9 Jul 2024 08:42:58 +0000 (10:42 +0200)] 
Merge branch 'spaces' of https://github.com/emperor06/util-linux

* 'spaces' of https://github.com/emperor06/util-linux:
  column: Adds option -S <num> so whitespaces are used instead of tabs in non table mode.

12 months agounshare: Add options to identity map the user's subordinate uids and gids
David Gibson [Tue, 9 Jul 2024 05:44:31 +0000 (15:44 +1000)] 
unshare: Add options to identity map the user's subordinate uids and gids

--map-users=auto, --map-groups=auto and --map-auto allow automatically
mapping the first block of user or group IDs owned by the effective user
from /etc/sub[ug]id to a block starting at user ID 0.  Add options
--map-users=subids, --map-groups=subids and --map-subids to perform a
mapping of the same IDs, but as an identity mapping instead of to UID 0.

This is useful in similar situations to --map-current-user, but preserves
access to the user's subordinate IDs.  That allows nested namespaces to
be created with more complex user mappings, either with unshare or with
a container runtime such as podman.

Fixes: https://github.com/util-linux/util-linux/issues/3120
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
12 months agomeson: add options for more utilities
Rosen Penev [Tue, 2 Jul 2024 19:52:13 +0000 (12:52 -0700)] 
meson: add options for more utilities

Allows using -Dauto_features=disabled to disable most utilities.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
12 months agoliblastlog2: tests: provide fallback PATH_MAX definition
Pino Toscano [Mon, 8 Jul 2024 17:16:30 +0000 (19:16 +0200)] 
liblastlog2: tests: provide fallback PATH_MAX definition

... by including the helper "c.h", which will do the right job.

Signed-off-by: Pino Toscano <toscano.pino@tiscali.it>
12 months agoMerge branch 'patch-1' of https://github.com/tbertels/util-linux
Karel Zak [Mon, 8 Jul 2024 11:17:35 +0000 (13:17 +0200)] 
Merge branch 'patch-1' of https://github.com/tbertels/util-linux

* 'patch-1' of https://github.com/tbertels/util-linux:
  Prevent problems with period after the URL

12 months agomeson: add missing sample-mount-overwrite
Karel Zak [Mon, 8 Jul 2024 11:15:05 +0000 (13:15 +0200)] 
meson: add missing sample-mount-overwrite

Signed-off-by: Karel Zak <kzak@redhat.com>
12 months agocolumn: Adds option -S <num> so whitespaces are used instead of tabs in non table...
drax [Sat, 6 Jul 2024 23:29:27 +0000 (01:29 +0200)] 
column: Adds option -S <num> so whitespaces are used instead of tabs in non table mode.

Entries are padded with whitespaces, then <num> spaces are added to separate the columns.
This should fix https://github.com/util-linux/util-linux/issues/1551

12 months agoMerge branch 'build-only-linux' of https://github.com/pinotree/util-linux
Karel Zak [Mon, 8 Jul 2024 10:44:04 +0000 (12:44 +0200)] 
Merge branch 'build-only-linux' of https://github.com/pinotree/util-linux

* 'build-only-linux' of https://github.com/pinotree/util-linux:
  build-sys: build sample-mount-overwrite only on Linux

12 months agotests: add mount-api-utils.h to linux only ifdef
Karel Zak [Mon, 8 Jul 2024 10:41:34 +0000 (12:41 +0200)] 
tests: add mount-api-utils.h to linux only ifdef

This is a cosmetic change. Let's use the already defined Linux-only
ifdef for mount-api-utils.h too.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 months agokill: (test) add a case for testing -l 0xSIGMASK and -d $PID options
Masatake YAMATO [Sun, 7 Jul 2024 17:53:52 +0000 (02:53 +0900)] 
kill: (test) add a case for testing -l 0xSIGMASK and -d $PID options

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
13 months agotests: include <sys/mount.h> only on Linux
Pino Toscano [Sun, 7 Jul 2024 07:08:06 +0000 (09:08 +0200)] 
tests: include <sys/mount.h> only on Linux

Include <sys/mount.h> only on Linux; it is used for fsopen(), which is
available only on Linux.

Signed-off-by: Pino Toscano <toscano.pino@tiscali.it>
13 months agobuild-sys: build sample-mount-overwrite only on Linux
Pino Toscano [Sun, 7 Jul 2024 06:52:45 +0000 (08:52 +0200)] 
build-sys: build sample-mount-overwrite only on Linux

This sample uses the libmnt_context API, which is available only on
Linux.

Signed-off-by: Pino Toscano <toscano.pino@tiscali.it>
13 months agoPrevent problems with period after the URL
Thomas Bertels [Thu, 4 Jul 2024 10:41:51 +0000 (12:41 +0200)] 
Prevent problems with period after the URL

Otherwise, the period gets included in the URL which makes it not work.

13 months agolsmem: make lsmem to check for the nodes more robust
zhangyao [Thu, 4 Jul 2024 08:28:51 +0000 (16:28 +0800)] 
lsmem: make lsmem to check for the nodes more robust

See #3110.

13 months agokill: add a feature decoding signal masks
Masatake YAMATO [Sun, 30 Jun 2024 12:09:44 +0000 (21:09 +0900)] 
kill: add a feature decoding signal masks

-l/--list option is extended to work well with the output of ps command:

   $ ps s $$
     UID     PID          PENDING          BLOCKED          IGNORED           CAUGHT STAT TTY        TIME COMMAND
    1000 1588189 0000000000000000 0000000000010000 0000000000384004 000000004b813efb S    pts/56     0:00 bash

   $ ./kill --list 0x000000004b813efb
   HUP
   INT
   ILL
   TRAP
   ABRT
   ...

If you know the pid you are interested in, you can skip running ps
comman with -d/--show-process-state option:

   $ ./kill --show-process-state $$
   Blocked: INT
   Ignored: TERM TSTP TTIN TTOU
   Caught: HUP INT PIPE ALRM CHLD WINCH

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
13 months agomeson: po: disable if nls is disabled
Rosen Penev [Tue, 2 Jul 2024 19:51:37 +0000 (12:51 -0700)] 
meson: po: disable if nls is disabled

Doesn't make much sense to build.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
13 months agorename: use ul_basename()
Karel Zak [Tue, 2 Jul 2024 09:23:13 +0000 (11:23 +0200)] 
rename: use ul_basename()

Fixes: https://github.com/util-linux/util-linux/issues/3071
Signed-off-by: Karel Zak <kzak@redhat.com>
13 months agolib/fileutils: add ul_basename()
Karel Zak [Tue, 2 Jul 2024 09:14:06 +0000 (11:14 +0200)] 
lib/fileutils: add ul_basename()

Unfortunately, the basename() function can be affected by the
creativity of different libc authors, resulting in varying behavior
across implementations.

Instead, use a local implementation to ensure consistency and
portability.

Signed-off-by: Karel Zak <kzak@redhat.com>
13 months agoMerge branch 'automake/install-dependency' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 2 Jul 2024 07:32:19 +0000 (09:32 +0200)] 
Merge branch 'automake/install-dependency' of https://github.com/t-8ch/util-linux

* 'automake/install-dependency' of https://github.com/t-8ch/util-linux:
  autotools: Properly order install dependencies of pam_lastlog2
  autotools: make pam install path configurable

13 months agomisc-utils:uuidd: Use ul_sig_err instead of errx
Cristian Rodríguez [Mon, 1 Jul 2024 22:10:49 +0000 (18:10 -0400)] 
misc-utils:uuidd: Use ul_sig_err instead of errx

Calling errx in sa_handler is as-unsafe as it is implemented using stdio.

13 months agolibfdisk: fix fdisk_partition_start_follow_default() docs
Karel Zak [Mon, 1 Jul 2024 12:35:55 +0000 (14:35 +0200)] 
libfdisk: fix fdisk_partition_start_follow_default() docs

Unfortunately, the behavior is different between DOS (original docs)
and GPT. Due to the need for backward compatibility, it is likely
impossible to change the default setting ...

Addresses: https://github.com/util-linux/util-linux/issues/3097
Signed-off-by: Karel Zak <kzak@redhat.com>
13 months agoautotools: Properly order install dependencies of pam_lastlog2
Thomas Weißschuh [Sun, 30 Jun 2024 09:23:53 +0000 (11:23 +0200)] 
autotools: Properly order install dependencies of pam_lastlog2

As pam_lastlog2 is relinked during installation, all its dependencies
need to already be installed.
This is the same issue that affected pylibmount which was fixed in
commit 324330aca644 ("build-sys: Properly order install dependencies of pylibmount").
Extend the logic added in that commit to also apply to pam_lastlog2.

Closes: #3011
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
13 months agoautotools: make pam install path configurable
Thomas Weißschuh [Mon, 1 Jul 2024 12:04:46 +0000 (14:04 +0200)] 
autotools: make pam install path configurable

While at it, also move the initial definition of
usesecurelib_exec_LTLIBRARIES into Makefile.am.
Also add "exec" to the target name which is recognized by automake to
mark the targets as architecture-specific.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
13 months agoMerge branch 'PR/lsblk-properties-by' of github.com:karelzak/util-linux-work
Karel Zak [Thu, 27 Jun 2024 09:56:52 +0000 (11:56 +0200)] 
Merge branch 'PR/lsblk-properties-by' of github.com:karelzak/util-linux-work

* 'PR/lsblk-properties-by' of github.com:karelzak/util-linux-work:
  lsblk: add --properties-by option

13 months agoMerge branch 'PR/cfdisk-tiny-fixes' of github.com:karelzak/util-linux-work
Karel Zak [Thu, 27 Jun 2024 09:56:33 +0000 (11:56 +0200)] 
Merge branch 'PR/cfdisk-tiny-fixes' of github.com:karelzak/util-linux-work

* 'PR/cfdisk-tiny-fixes' of github.com:karelzak/util-linux-work:
  lib/colors: free unnecessary ncurses resources
  cfdisk: fix possible integer overflow [coverity scan]

13 months agoMerge branch 'hexdump-build' of https://github.com/robimarko/util-linux
Karel Zak [Thu, 27 Jun 2024 09:54:37 +0000 (11:54 +0200)] 
Merge branch 'hexdump-build' of https://github.com/robimarko/util-linux

* 'hexdump-build' of https://github.com/robimarko/util-linux:
  hexdump: allow enabling with --disable-all-programs

13 months agosys-utils/setpgid: fix --help typo (foregound > foreground) + alignment
Emanuele Torre [Wed, 26 Jun 2024 07:43:43 +0000 (09:43 +0200)] 
sys-utils/setpgid: fix --help typo (foregound > foreground) + alignment

Typo reported by @yurchor on github
https://github.com/util-linux/util-linux/commit/f092076fecc7ada2911df1b34f75091573ac08a8#r139271937

13 months agosys-utils/setpgid: make -f work
Emanuele Torre [Wed, 26 Jun 2024 07:22:59 +0000 (09:22 +0200)] 
sys-utils/setpgid: make -f work

f  was missing from the getopt_long optstring so only --foreground was
working, not -f.

13 months agohexdump: allow enabling with --disable-all-programs
Robert Marko [Tue, 25 Jun 2024 15:32:08 +0000 (17:32 +0200)] 
hexdump: allow enabling with --disable-all-programs

Currently, if --disable-all-programs is used hexdump cannot be built
as --enable-hexdump is not recognized, so lets add support for it.

Signed-off-by: Robert Marko <robimarko@gmail.com>
13 months agolsblk: add --properties-by option
Karel Zak [Mon, 24 Jun 2024 10:09:38 +0000 (12:09 +0200)] 
lsblk: add --properties-by option

This new option allows for controlling the method(s) used by lsblk to
gather file system and partition data about devices.

Fixes: https://github.com/util-linux/util-linux/issues/2047
Signed-off-by: Karel Zak <kzak@redhat.com>
13 months agoMerge branch 'PR/swapoff-oom' of github.com:karelzak/util-linux-work
Karel Zak [Mon, 24 Jun 2024 08:05:14 +0000 (10:05 +0200)] 
Merge branch 'PR/swapoff-oom' of github.com:karelzak/util-linux-work

* 'PR/swapoff-oom' of github.com:karelzak/util-linux-work:
  swapoff: avoid being killed by OOM

13 months agolib/colors: free unnecessary ncurses resources
Karel Zak [Mon, 24 Jun 2024 08:00:33 +0000 (10:00 +0200)] 
lib/colors: free unnecessary ncurses resources

Signed-off-by: Karel Zak <kzak@redhat.com>
13 months agocfdisk: fix possible integer overflow [coverity scan]
Karel Zak [Mon, 24 Jun 2024 07:46:37 +0000 (09:46 +0200)] 
cfdisk: fix possible integer overflow [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
13 months agoMerge branch 'PR/libmount-fix-mesg' of github.com:karelzak/util-linux-work
Karel Zak [Thu, 20 Jun 2024 10:22:06 +0000 (12:22 +0200)] 
Merge branch 'PR/libmount-fix-mesg' of github.com:karelzak/util-linux-work

* 'PR/libmount-fix-mesg' of github.com:karelzak/util-linux-work:
  libmount: improving robustness in reading kernel messages

13 months agoMerge branch 'PR/unshare-binfmt_misc' of github.com:karelzak/util-linux-work
Karel Zak [Thu, 20 Jun 2024 10:20:07 +0000 (12:20 +0200)] 
Merge branch 'PR/unshare-binfmt_misc' of github.com:karelzak/util-linux-work

* 'PR/unshare-binfmt_misc' of github.com:karelzak/util-linux-work:
  unshare: load binfmt_misc interpreter
  unshare: mount binfmt_misc

13 months agoumount, losetup: Document loop destroy behavior
Stanislav Brabec [Wed, 19 Jun 2024 15:31:34 +0000 (17:31 +0200)] 
umount, losetup: Document loop destroy behavior

The loop device detach runs asynchronously in the background. It can cause
unexpected errors. Document the possible existence of the loop device after
exit of losetup -d or umount and need of "udevadm settle".

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
13 months agoswapoff: avoid being killed by OOM
Karel Zak [Thu, 20 Jun 2024 10:07:12 +0000 (12:07 +0200)] 
swapoff: avoid being killed by OOM

Based on patch from dparalen <vetrisko@gmail.com>.

Fixes: https://github.com/util-linux/util-linux/issues/3095
Signed-off-by: Karel Zak <kzak@redhat.com>
13 months agounshare: load binfmt_misc interpreter
Laurent Vivier [Wed, 19 Jun 2024 08:19:51 +0000 (10:19 +0200)] 
unshare: load binfmt_misc interpreter

add -l, --load-interp <file> to load a binfmt_misc interpreter at startup.

The interpreter is loaded from the initial fileystem if the 'F' flags is
provided, otherwise from inside the new namespace
This makes possible to start a chroot of another architecture without
being root.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
13 months agounshare: mount binfmt_misc
Laurent Vivier [Wed, 19 Jun 2024 08:19:50 +0000 (10:19 +0200)] 
unshare: mount binfmt_misc

add --mount-binfmt[=<dir>] to mount binfmt_misc filesystem,
this results in clearing inherited interpreters from the previous namespace

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
13 months agolslocks: remove unnecessary code
Karel Zak [Wed, 19 Jun 2024 09:54:40 +0000 (11:54 +0200)] 
lslocks: remove unnecessary code

Signed-off-by: Karel Zak <kzak@redhat.com>
13 months agolibmount: improving robustness in reading kernel messages
Karel Zak [Wed, 19 Jun 2024 09:19:49 +0000 (11:19 +0200)] 
libmount: improving robustness in reading kernel messages

* Ensure data termination from read() function
* Allocate space for terminator using "sizeof(buf)-1"

Signed-off-by: Karel Zak <kzak@redhat.com>
13 months agolib/sysfs: zero-terminate result of sysfs_blkdev_get_devchain()
Thomas Weißschuh [Wed, 12 Jun 2024 21:32:15 +0000 (23:32 +0200)] 
lib/sysfs: zero-terminate result of sysfs_blkdev_get_devchain()

sysfs_blkdev_get_devchain() does not zero-terminate its result, but the
caller expects a C-string.
Use ul_buffer_get_string() which includes a trailing zero-byte.

Now it's also valid for sz and bufsz to be equal.

See #3088.
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
13 months agolib/buffer: introduce ul_buffer_get_string()
Thomas Weißschuh [Thu, 13 Jun 2024 09:39:34 +0000 (11:39 +0200)] 
lib/buffer: introduce ul_buffer_get_string()

Some users need a zero-byte-terminated string.
As the buffer internally already maintains a zero-termination, add a
helper function that exposes this to users.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
13 months agolib/sysfs: abort device hierarchy walk at root of sysfs
Thomas Weißschuh [Wed, 12 Jun 2024 21:30:28 +0000 (23:30 +0200)] 
lib/sysfs: abort device hierarchy walk at root of sysfs

It does not make sense to leave the sysfs hierarchy during the walk of
the parent directories.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
13 months agoMerge branch 'lsfd--close-all' of https://github.com/masatake/util-linux
Karel Zak [Mon, 10 Jun 2024 09:10:07 +0000 (11:10 +0200)] 
Merge branch 'lsfd--close-all' of https://github.com/masatake/util-linux

* 'lsfd--close-all' of https://github.com/masatake/util-linux:
  lsfd: minimize the output related to lsfd itself

13 months agolsns: ignore ESRCH errors reported when accessing files under /proc
Masatake YAMATO [Fri, 7 Jun 2024 19:54:03 +0000 (04:54 +0900)] 
lsns: ignore ESRCH errors reported when accessing files under /proc

Fix #2799.

If a process is gone, system calls accessing files under /proc can
return ESRCH.

Suggested by Johannes Edmeier (@joshiste).
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
13 months agolsfd: minimize the output related to lsfd itself
Masatake YAMATO [Thu, 4 Jan 2024 02:33:51 +0000 (11:33 +0900)] 
lsfd: minimize the output related to lsfd itself

Copied from the test case in lib/fileutils.c.

14 months agoWall: Fix terminal flag usage
Karel Zak [Thu, 6 Jun 2024 07:36:28 +0000 (09:36 +0200)] 
Wall: Fix terminal flag usage
.
Signed-off-by: Karel Zak <kzak@redhat.com>
14 months agoMerge branch 'ci/armv7' of https://github.com/t-8ch/util-linux
Karel Zak [Thu, 6 Jun 2024 07:32:19 +0000 (09:32 +0200)] 
Merge branch 'ci/armv7' of https://github.com/t-8ch/util-linux

* 'ci/armv7' of https://github.com/t-8ch/util-linux:
  ci: test on armv7
  lsfd: (tests) skip tests using fd flags on qemu-user

14 months agoMerge branch 'spelling' of https://github.com/scop/util-linux
Karel Zak [Thu, 6 Jun 2024 07:30:25 +0000 (09:30 +0200)] 
Merge branch 'spelling' of https://github.com/scop/util-linux

* 'spelling' of https://github.com/scop/util-linux:
  *: spelling and grammar fixes

14 months agoMerge branch 'feat/logger-sd-completions' of https://github.com/scop/util-linux
Karel Zak [Thu, 6 Jun 2024 07:27:19 +0000 (09:27 +0200)] 
Merge branch 'feat/logger-sd-completions' of https://github.com/scop/util-linux

* 'feat/logger-sd-completions' of https://github.com/scop/util-linux:
  bash-completion: add logger --sd-* completions

14 months agoMerge branch 'wdctl/compat-chardev' of https://github.com/t-8ch/util-linux
Karel Zak [Thu, 6 Jun 2024 07:26:26 +0000 (09:26 +0200)] 
Merge branch 'wdctl/compat-chardev' of https://github.com/t-8ch/util-linux

* 'wdctl/compat-chardev' of https://github.com/t-8ch/util-linux:
  wdctl: always query device node when sysfs is unavailable

14 months agoMerge branch 'PR/wall-tty-list' of github.com:karelzak/util-linux-work
Karel Zak [Thu, 6 Jun 2024 07:25:10 +0000 (09:25 +0200)] 
Merge branch 'PR/wall-tty-list' of github.com:karelzak/util-linux-work

* 'PR/wall-tty-list' of github.com:karelzak/util-linux-work:
  wall: always use utmp as fallback

14 months ago*: spelling and grammar fixes
Ville Skyttä [Tue, 4 Jun 2024 20:44:40 +0000 (23:44 +0300)] 
*: spelling and grammar fixes

Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>