]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
10 months agosfdisk: ignore last-lba from script on --force
Karel Zak [Mon, 2 Sep 2024 12:04:18 +0000 (14:04 +0200)] 
sfdisk: ignore last-lba from script on --force

The last LBA depends on the disk size. It seems like a good idea to
ignore it when using the --force option, in order to make it possible
to apply the script on smaller disks.

Addresses: https://github.com/util-linux/util-linux/issues/3186
Signed-off-by: Karel Zak <kzak@redhat.com>
11 months agoMerge branch 'patch-1' of https://github.com/hmaarrfk/util-linux
Karel Zak [Thu, 29 Aug 2024 09:55:28 +0000 (11:55 +0200)] 
Merge branch 'patch-1' of https://github.com/hmaarrfk/util-linux

* 'patch-1' of https://github.com/hmaarrfk/util-linux:
  Define EXIT_ENOSYS in test helpers

11 months agoMerge branch 'PR/autotools-securelib' of github.com:karelzak/util-linux-work
Karel Zak [Thu, 29 Aug 2024 09:54:21 +0000 (11:54 +0200)] 
Merge branch 'PR/autotools-securelib' of github.com:karelzak/util-linux-work

* 'PR/autotools-securelib' of github.com:karelzak/util-linux-work:
  autotools: fix securedir and pam_lastlog2 install

11 months agoMerge branch 'spelling-and-typos' of https://github.com/mr-bronson/util-linux
Karel Zak [Thu, 29 Aug 2024 09:53:42 +0000 (11:53 +0200)] 
Merge branch 'spelling-and-typos' of https://github.com/mr-bronson/util-linux

* 'spelling-and-typos' of https://github.com/mr-bronson/util-linux:
  fix it's vs. its, and some adjacent errors

11 months agoMerge branch 'PR/buildsys-lsfd-bpf' of github.com:karelzak/util-linux-work
Karel Zak [Thu, 29 Aug 2024 09:52:31 +0000 (11:52 +0200)] 
Merge branch 'PR/buildsys-lsfd-bpf' of github.com:karelzak/util-linux-work

* 'PR/buildsys-lsfd-bpf' of github.com:karelzak/util-linux-work:
  meson: check for BPF_OBJ_NAME_LEN and linux/bpf.h
  autotools: Check for BPF_OBJ_NAME_LEN (required by lsfd)

11 months agoDefine EXIT_ENOSYS in test helpers
Mark Harfouche [Thu, 29 Aug 2024 02:02:06 +0000 (22:02 -0400)] 
Define EXIT_ENOSYS in test helpers

11 months agoMerge branch 'master' into spelling-and-typos
Bron Potomac [Tue, 27 Aug 2024 12:39:18 +0000 (12:39 +0000)] 
Merge branch 'master' into spelling-and-typos

11 months agoautotools: fix securedir and pam_lastlog2 install
Karel Zak [Tue, 27 Aug 2024 10:00:21 +0000 (12:00 +0200)] 
autotools: fix securedir and pam_lastlog2 install

Addresses: https://github.com/util-linux/util-linux/pull/3173
Signed-off-by: Karel Zak <kzak@redhat.com>
11 months agoMerge branch 'PR/findmnt-Q-tree' of github.com:karelzak/util-linux-work
Karel Zak [Tue, 27 Aug 2024 09:25:33 +0000 (11:25 +0200)] 
Merge branch 'PR/findmnt-Q-tree' of github.com:karelzak/util-linux-work

* 'PR/findmnt-Q-tree' of github.com:karelzak/util-linux-work:
  tests: update findmnt -Q tests
  findmnt: improve -Q to output tree

11 months agolibmount: cleanup comments
Karel Zak [Tue, 27 Aug 2024 09:14:01 +0000 (11:14 +0200)] 
libmount: cleanup comments

Signed-off-by: Karel Zak <kzak@redhat.com>
11 months agofix it's vs. its, and some adjacent errors
mr-bronson [Tue, 27 Aug 2024 06:19:47 +0000 (06:19 +0000)] 
fix it's vs. its, and some adjacent errors

But still need rewrite of opaque comments @ libmount/src/context_umount.c:350-353 and libmount/src/context.c:1149-1150.

11 months agomeson: check for BPF_OBJ_NAME_LEN and linux/bpf.h
Karel Zak [Mon, 26 Aug 2024 12:23:16 +0000 (14:23 +0200)] 
meson: check for BPF_OBJ_NAME_LEN and linux/bpf.h

Signed-off-by: Karel Zak <kzak@redhat.com>
11 months agoautotools: Check for BPF_OBJ_NAME_LEN (required by lsfd)
Karel Zak [Mon, 26 Aug 2024 12:12:44 +0000 (14:12 +0200)] 
autotools: Check for BPF_OBJ_NAME_LEN (required by lsfd)

Addresses: https://github.com/util-linux/util-linux/issues/2945
Signed-off-by: Karel Zak <kzak@redhat.com>
11 months agotests: update findmnt -Q tests
Karel Zak [Mon, 26 Aug 2024 11:46:54 +0000 (13:46 +0200)] 
tests: update findmnt -Q tests

Now the tree-like output is possible for "findmnt -Q".

Signed-off-by: Karel Zak <kzak@redhat.com>
11 months agoMerge branch 'PR/more-stderr' of github.com:karelzak/util-linux-work
Karel Zak [Mon, 26 Aug 2024 10:26:34 +0000 (12:26 +0200)] 
Merge branch 'PR/more-stderr' of github.com:karelzak/util-linux-work

* 'PR/more-stderr' of github.com:karelzak/util-linux-work:
  more: make sure we have data on stderr

11 months agoMerge branch 'PR/lscpu-optimize' of github.com:karelzak/util-linux-work
Karel Zak [Mon, 26 Aug 2024 10:25:58 +0000 (12:25 +0200)] 
Merge branch 'PR/lscpu-optimize' of github.com:karelzak/util-linux-work

* 'PR/lscpu-optimize' of github.com:karelzak/util-linux-work:
  lscpu: optimize query virt pci device

11 months agoMerge branch 'libblkid/apfs/checksum' of https://github.com/t-8ch/util-linux
Karel Zak [Mon, 26 Aug 2024 10:24:36 +0000 (12:24 +0200)] 
Merge branch 'libblkid/apfs/checksum' of https://github.com/t-8ch/util-linux

* 'libblkid/apfs/checksum' of https://github.com/t-8ch/util-linux:
  libblkid: apfs: validate checksums

11 months agolibblkid: improve portability
Yang Kun [Sat, 24 Aug 2024 14:15:16 +0000 (22:15 +0800)] 
libblkid: improve portability

11 months agolibblkid: apfs: validate checksums
Thomas Weißschuh [Tue, 6 Aug 2024 17:07:48 +0000 (19:07 +0200)] 
libblkid: apfs: validate checksums

The apfs superblock contains a checksum based on Fletcher-64.
Validate the checksum to make the probing more robust.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
11 months agolscpu: optimize query virt pci device
Guixin Liu [Wed, 21 Aug 2024 08:49:54 +0000 (16:49 +0800)] 
lscpu: optimize query virt pci device

The lscpu command needs to traverse the /proc/bus/pci/devices file
three times to check for any PCI devices related to virtualization.
If there are many PCI devices on the machine, this can lead to
increased execution time for lscpu. It would be beneficial to
consolidate these queries into a single check to optimize the
execution time of lscpu.

Use time command to test on a machine with 13000 PCI devices:
before:
real  0m13.506s
user  0m0.028s
sys   0m13.409s
after:
real  0m5.834s
user  0m0.018s
sys   0m5.771s

Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
11 months agofindmnt: improve -Q to output tree
Karel Zak [Thu, 22 Aug 2024 10:31:41 +0000 (12:31 +0200)] 
findmnt: improve -Q to output tree

$ findmnt -Q 'FSTYPE=="ext4"'
TARGET         SOURCE                  FSTYPE OPTIONS
/              /dev/sda4               ext4   rw,relatime
├─/var         /dev/sda3               ext4   rw,relatime
│ └─/var/cache /dev/sda5               ext4   rw,relatime
├─/mnt/virt    /dev/sdb1               ext4   rw,relatime
└─/boot        /dev/sda2               ext4   rw,relatime

Addresses: https://github.com/util-linux/util-linux/pull/3090
Signed-off-by: Karel Zak <kzak@redhat.com>
11 months agoMerge branch 'findmnt-Q' of https://github.com/masatake/util-linux
Karel Zak [Thu, 22 Aug 2024 09:31:21 +0000 (11:31 +0200)] 
Merge branch 'findmnt-Q' of https://github.com/masatake/util-linux

* 'findmnt-Q' of https://github.com/masatake/util-linux:
  tests: (findmnt) add a case testing -Q option
  findmnt: (man) write about -Q,--filter option
  findmnt: add -Q,--filter option
  findmnt: (refactor) convert add_column macro to a function
  findmnt: (refactor) add a helper function making an instance of libscols_table
  findmnt: (refactor) remove global variables shared between findmnt.c and fintmnt-verify.c

11 months agoMerge branch 'fix_generated_header_paths' of https://github.com/amibranch/util-linux
Karel Zak [Thu, 22 Aug 2024 09:19:39 +0000 (11:19 +0200)] 
Merge branch 'fix_generated_header_paths' of https://github.com/amibranch/util-linux

* 'fix_generated_header_paths' of https://github.com/amibranch/util-linux:
  meson: fix generated header paths

11 months agoMerge branch 'simplify' of https://github.com/ikspress/util-linux
Karel Zak [Thu, 22 Aug 2024 09:18:45 +0000 (11:18 +0200)] 
Merge branch 'simplify' of https://github.com/ikspress/util-linux

* 'simplify' of https://github.com/ikspress/util-linux:
  meson: simplify code
  ipcrm: simplify code

11 months agomore: make sure we have data on stderr
Karel Zak [Thu, 22 Aug 2024 06:56:52 +0000 (08:56 +0200)] 
more: make sure we have data on stderr

more(1) uses more_poll() to monitor data on stdin, stderr, and
signals. It is used before read_command(), but this function only
reads from stderr. Therefore, if any other non-stderr event occurs,
this function will wait on read(). In this case, more(1) will not
react to signals anymore. We need to ensure that more(1) only waits in
more_poll().

Try

 for x in {1..1000}; do echo "line $x"; done | more

to reproduce.

Reported-by: Radka Skvarilova <rskvaril@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
11 months agomeson: fix generated header paths
amibranch [Wed, 21 Aug 2024 15:30:55 +0000 (15:30 +0000)] 
meson: fix generated header paths

11 months agofix spelling and typos
mr-bronson [Wed, 21 Aug 2024 15:28:22 +0000 (15:28 +0000)] 
fix spelling and typos

A good start. Some lines moved because they were under a misspelled duplicate heading.

11 months agofix typos
Yang Hau [Tue, 20 Aug 2024 15:48:19 +0000 (23:48 +0800)] 
fix typos

Signed-off-by: Karel Zak <kzak@redhat.com>
11 months agoMerge branch 'tailing' of https://github.com/stoeckmann/util-linux
Karel Zak [Tue, 20 Aug 2024 13:27:01 +0000 (15:27 +0200)] 
Merge branch 'tailing' of https://github.com/stoeckmann/util-linux

* 'tailing' of https://github.com/stoeckmann/util-linux:
  Fix typos

11 months agoMerge branch 'fdisk-sgi-bootfile' of https://github.com/mr-bronson/util-linux
Karel Zak [Tue, 20 Aug 2024 13:21:06 +0000 (15:21 +0200)] 
Merge branch 'fdisk-sgi-bootfile' of https://github.com/mr-bronson/util-linux

* 'fdisk-sgi-bootfile' of https://github.com/mr-bronson/util-linux:
  fdisk: fix sgi_menu_cb return value
  fdisk: fix fdisk_sgi_set_bootfile return value
  fdisk: fix sgi_check_bootfile name size minimum
  fdisk: fix SGI boot file prompt

11 months agomeson: simplify code
Yang Kun [Tue, 20 Aug 2024 12:43:11 +0000 (20:43 +0800)] 
meson: simplify code

11 months agoipcrm: simplify code
Yang Kun [Tue, 20 Aug 2024 12:38:15 +0000 (20:38 +0800)] 
ipcrm: simplify code

11 months agoAdd missing section comment
Uwe Seimet [Mon, 19 Aug 2024 15:56:44 +0000 (17:56 +0200)] 
Add missing section comment

11 months agoAdd GPT type for Minix filesystem
Uwe Seimet [Mon, 19 Aug 2024 08:49:02 +0000 (10:49 +0200)] 
Add GPT type for Minix filesystem

11 months agofdisk: fix sgi_menu_cb return value
mr-bronson [Sun, 18 Aug 2024 01:32:00 +0000 (01:32 +0000)] 
fdisk: fix sgi_menu_cb return value

Would otherwise return -EINVAL even on success after fdisk_sgi_set_bootfile.

11 months agofdisk: fix fdisk_sgi_set_bootfile return value
mr-bronson [Sun, 18 Aug 2024 01:06:44 +0000 (01:06 +0000)] 
fdisk: fix fdisk_sgi_set_bootfile return value

Supposed to be '0 on success, <0 on error'.

11 months agofdisk: fix sgi_check_bootfile name size minimum
mr-bronson [Sun, 18 Aug 2024 00:54:08 +0000 (00:54 +0000)] 
fdisk: fix sgi_check_bootfile name size minimum

The name does not contain newline, so the comment and logic was wrong.

11 months agofdisk: fix SGI boot file prompt
mr-bronson [Sun, 18 Aug 2024 00:49:27 +0000 (00:49 +0000)] 
fdisk: fix SGI boot file prompt

Prompt was clearly missing something.

11 months agoFix typos
Tobias Stoeckmann [Wed, 14 Aug 2024 19:37:39 +0000 (21:37 +0200)] 
Fix typos

These occurrences should be "trailing" instead of "tailing".

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>
11 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>
11 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>
11 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>
11 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

11 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)"

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

11 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>
12 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>
12 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>
12 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.

12 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.

12 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>