]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
6 months agobuild-sys: release++ (v2.40.4) stable/v2.40 v2.40.4
Karel Zak [Mon, 13 Jan 2025 12:24:38 +0000 (13:24 +0100)] 
build-sys: release++ (v2.40.4)

Signed-off-by: Karel Zak <kzak@redhat.com>
6 months agodocs: add v2.40.4-ReleaseNotes
Karel Zak [Mon, 13 Jan 2025 12:23:24 +0000 (13:23 +0100)] 
docs: add v2.40.4-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
6 months agopo-man: merge changes
Karel Zak [Mon, 13 Jan 2025 12:20:52 +0000 (13:20 +0100)] 
po-man: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
6 months agopo: merge changes
Karel Zak [Mon, 13 Jan 2025 12:20:46 +0000 (13:20 +0100)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
6 months agoFix table formatting
M Sirabella [Mon, 6 Jan 2025 06:23:39 +0000 (22:23 -0800)] 
Fix table formatting

asciidoctor-2.0.23 was giving an error:

    asciidoctor: ERROR: fsck.minix.8.adoc: line 29: dropping cells from incomplete row detected end of table

(cherry picked from commit 07b944dc3aab3d1981d1cd73d62a22296b07d165)

6 months agoRevert "libmount: exec mount helpers with posixly correct argument order"
Karel Zak [Mon, 13 Jan 2025 09:36:09 +0000 (10:36 +0100)] 
Revert "libmount: exec mount helpers with posixly correct argument order"

The change is backwardly incompatible.

https://github.com/util-linux/util-linux/issues/3355

This reverts commit 474f2599a3786d4359b8f5abe7416cdf6321c002.

6 months agobuild-sys: release++ (v2.40.3) v2.40.3
Karel Zak [Thu, 9 Jan 2025 11:53:48 +0000 (12:53 +0100)] 
build-sys: release++ (v2.40.3)

Signed-off-by: Karel Zak <kzak@redhat.com>
6 months agodocs: add v2.40.3-ReleaseNotes
Karel Zak [Thu, 9 Jan 2025 11:51:51 +0000 (12:51 +0100)] 
docs: add v2.40.3-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
6 months agodocs: update AUTHORS file
Karel Zak [Thu, 9 Jan 2025 11:34:46 +0000 (12:34 +0100)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
6 months agopo-man: merge changes
Karel Zak [Thu, 9 Jan 2025 11:32:21 +0000 (12:32 +0100)] 
po-man: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
6 months agopo: merge changes
Karel Zak [Thu, 9 Jan 2025 11:32:15 +0000 (12:32 +0100)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
6 months agopo-man: update pt_BR.po (from translationproject.org)
Rafael Fontenelle [Thu, 9 Jan 2025 11:28:39 +0000 (12:28 +0100)] 
po-man: update pt_BR.po (from translationproject.org)

6 months agopo-man: update fr.po (from translationproject.org)
Frédéric Marchal [Thu, 9 Jan 2025 11:28:39 +0000 (12:28 +0100)] 
po-man: update fr.po (from translationproject.org)

6 months agopo: update zh_CN.po (from translationproject.org)
Mingye Wang (Artoria2e5) [Thu, 9 Jan 2025 11:27:53 +0000 (12:27 +0100)] 
po: update zh_CN.po (from translationproject.org)

6 months agopo: update sr.po (from translationproject.org)
Мирослав Николић [Thu, 9 Jan 2025 11:27:52 +0000 (12:27 +0100)] 
po: update sr.po (from translationproject.org)

6 months agopo: update pt_BR.po (from translationproject.org)
Rafael Fontenelle [Thu, 9 Jan 2025 11:27:52 +0000 (12:27 +0100)] 
po: update pt_BR.po (from translationproject.org)

6 months agopo: update ja.po (from translationproject.org)
Hideki Yoshida [Thu, 9 Jan 2025 11:27:52 +0000 (12:27 +0100)] 
po: update ja.po (from translationproject.org)

6 months agopo: update de.po (from translationproject.org)
Mario Blättermann [Thu, 9 Jan 2025 11:27:52 +0000 (12:27 +0100)] 
po: update de.po (from translationproject.org)

6 months agoci: bump coveralls compiler version to gcc 13
Karel Zak [Wed, 8 Jan 2025 10:35:03 +0000 (11:35 +0100)] 
ci: bump coveralls compiler version to gcc 13

coverall CI output:

COMPILER=gcc
COMPILER_VERSION=10
...
Found gcov version: 13.2.0
...
geninfo: ERROR: Incompatible GCC/GCOV version found

Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit d8532ef299c2dc5e13489df19fc483a67d45f8f5)

6 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>
(cherry picked from commit 6a14f8d1727035a68b1fef167499930e09a2b234)

6 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>
(cherry picked from commit 5d1129e6879a05aa9ac5804ffc8ace22cda735c1)

6 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>
Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit fc67f18be51f57ee9a59a0f8f7ad16f284a24a3e)

6 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>
(cherry picked from commit 50a3efab6d126b28fcdcc28f1a0cd5cd596ae357)

6 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>
(cherry picked from commit 20b405c0fea29675e1fb54b894eb1c18459f9d50)

6 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>
(cherry picked from commit e2b3f9915333b6e423e1f47d3f5e7cc6ea0ff482)

6 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>
(cherry picked from commit 7903560fa34fe1810cdaf3dcda7cafbdefb488ac)

6 months agohardlink: fix memory corruption (size calculation)
Karel Zak [Thu, 26 Dec 2024 11:45:31 +0000 (12:45 +0100)] 
hardlink: fix memory corruption (size calculation)

The current code rounds down the values for readsiz and blocksmax,
which is incorrect. The sizes must be large enough to match the files.

Addresses: https://github.com/util-linux/util-linux/issues/3330
Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit 70c1ffbdf4ecac30536e1af13764adbd883a161d)

6 months agotests: fdisk/bsd: Update expected output for alpha
John Paul Adrian Glaubitz [Wed, 25 Dec 2024 13:08:32 +0000 (14:08 +0100)] 
tests: fdisk/bsd: Update expected output for alpha

Fixes #3332

Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
(cherry picked from commit 851a168e82a1264e2693acba5746ec30eee0c43b)

6 months agofincore: Use correct syscall number for cachestat on alpha
John Paul Adrian Glaubitz [Wed, 25 Dec 2024 15:21:13 +0000 (16:21 +0100)] 
fincore: Use correct syscall number for cachestat on alpha

Fixes #3331, #3333

Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
(cherry picked from commit a0ce085c261a1d981bfa0acd4272b6ba77bfa3be)

6 months agofstab.5 mount.8: add note about field separator
Karel Zak [Thu, 26 Dec 2024 10:34:10 +0000 (11:34 +0100)] 
fstab.5 mount.8: add note about field separator

The value of the mount option X-mount.idmap= can contain spaces as
separators between mappings. Unfortunately, this conflicts with the
fstab format where fields are separated by spaces. Using quotes does
not solve this issue because fields are separated before they are
parsed.

This limitation of the fstab parser within libmount is due to backward
compatibility. The fstab format is a de-facto standard and is parsed
by many tools and libraries, including third-party shell scripts. It
would not be practical to introduce any improvements in libmount that
would make fstabs unparseable in other places.

Users must understand that in-field spaces must be escaped by \040.
For example, X-mount.idmap="0:0:1\040500:1000:1".

Addresses: https://github.com/util-linux/util-linux/issues/2829
Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit 52dc9260d469a3731f49c5a78b23f38f2314789e)

6 months agoSkip tmpfs-sensitive tests if fstype cannot be determined
Chris Hofstaedtler [Wed, 13 Nov 2024 13:51:37 +0000 (14:51 +0100)] 
Skip tmpfs-sensitive tests if fstype cannot be determined

In certain isolation environments (f.e. Debian's sbuild+unshare),
`/proc/mounts` does not have an entry for the directory we're building in.

Then, findmnt as used in the tests returns nothing. As the build directory
might very well be on tmpfs (and often is, in Debian), disable the two tests
known to fail on tmpfs.

In yet another scenario, if ran in a Docker/podman container, the fstype
will read "overlay", which in the end can also be tmpfs, and we see problems
there, too.

This was noticed because torvalds/linux@e88e0d366f9cfbb810b0c8509dc5d130d5a53e02
changed the behaviour of the underlying syscalls on tmpfs in Linux 6.6.

Closes: #3266
Debian bug #1086706

Signed-off-by: Chris Hofstaedtler <zeha@debian.org>
(cherry picked from commit 83359a297911f39245343e270f8b9ea587df23f2)

6 months agohardlink.1: directory|file is mandatory
наб [Mon, 28 Oct 2024 18:19:14 +0000 (19:19 +0100)] 
hardlink.1: directory|file is mandatory

(cherry picked from commit 2d2e78720440a611656ec0ce7fdb3e2e5a5f24eb)

6 months agoUpdate chsh.1.adoc to avoid duplicates in man page
bearhoney [Sun, 20 Oct 2024 21:21:02 +0000 (23:21 +0200)] 
Update chsh.1.adoc to avoid duplicates in man page

Excluded  man-common/help-version.adoc  to avoid duplicate -h  and -V option descriptions in the man page for  chsh(1).

(cherry picked from commit 3dc249abb2685f42c84323ae758d5e1ba8d9d02a)

6 months agodoc: fsck.8.adoc - fix email typo
Geoffrey Casper [Sat, 19 Oct 2024 05:34:35 +0000 (01:34 -0400)] 
doc: fsck.8.adoc - fix email typo

(cherry picked from commit 4acd71d2495159d18ea326d43be1bfe97d13d383)

6 months agofdisk: (man) improve --sector-size description
Karel Zak [Mon, 14 Oct 2024 13:47:03 +0000 (15:47 +0200)] 
fdisk: (man) improve --sector-size description

Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit 54f9a79301dcf492cab8e07134f96a921d367aa0)

6 months agolibfdisk: make sure libblkid uses the same sector size
Karel Zak [Mon, 14 Oct 2024 09:45:32 +0000 (11:45 +0200)] 
libfdisk: make sure libblkid uses the same sector size

Libfdisk uses libblkid to check for filesystems on the device. It
makes sense for both libraries to share the logical sector size
setting, as this setting can be modified by using the fdisk command
line.

We do not see this as an issue, as filesystem detection rarely depends
on sector size (with the exception of some RAIDs). Additionally,
libblkid is usually intelligent enough to check multiple locations
independently of the current device's sector size setting.

Addresses: https://github.com/util-linux/util-linux/pull/3235
Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit 7ada6547fcd1f649fadaa8021ff21e3e0f431459)

6 months agolibblkid: add FSLASTBLOCK for swaparea
Karel Zak [Wed, 9 Oct 2024 07:54:41 +0000 (09:54 +0200)] 
libblkid: add FSLASTBLOCK for swaparea

Suggested-by: Peter Rajnoha <prajnoha@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit 0567efc790d4426df3001c6f8a19e276f114a450)

6 months agolibblkid: (exfat): validate fields used by prober
Thomas Weißschuh [Thu, 3 Oct 2024 07:14:57 +0000 (09:14 +0200)] 
libblkid: (exfat): validate fields used by prober

The exFAT specification lists valid value ranges for the superblock
fields. Validate the fields interpreted by the libblkid prober to avoid
undefined behaviour.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
(cherry picked from commit 1bdfbe9a7af4f5897624ec1ab14e9f60a5b72c61)

6 months agoautotools: allow enabling dmesg with --disable-all-programs
Henrik Lindström [Sat, 21 Sep 2024 08:23:10 +0000 (10:23 +0200)] 
autotools: allow enabling dmesg with --disable-all-programs

Signed-off-by: Henrik Lindström <henrik@lxm.se>
(cherry picked from commit 42aa4cd4f6383875d4163620b0590c4ab659b68b)

6 months agoautotools: allow enabling lsblk with --disable-all-programs
Henrik Lindström [Sat, 21 Sep 2024 08:23:09 +0000 (10:23 +0200)] 
autotools: allow enabling lsblk with --disable-all-programs

Signed-off-by: Henrik Lindström <henrik@lxm.se>
(cherry picked from commit d87ac5c6f2df44987528e03f603a35ab457f052c)

6 months agopartx: Fix example in man page
Michal Suchanek [Tue, 24 Sep 2024 07:19:39 +0000 (09:19 +0200)] 
partx: Fix example in man page

The example is:

  partx -d --nr :-1 /dev/sdd
  Removes the last partition on _/dev/sdd_.

The documentation says:

           M:
               Specifies the lower limit only (e.g. --nr 2:).

           :N
               Specifies the upper limit only (e.g. --nr :4).

In the above example the lower limit is not set and the upper is set to
the last partition, meaning all partitions. The lower limit should be
set instead.

  partx -d --nr -1: /dev/sdd

(cherry picked from commit 50ff6cbfe5bf0fa20dc61631346b2d6ccafc0b41)

6 months agoUpdate description of --disable-poman in configure.ac
Firas Khalil Khana [Mon, 23 Sep 2024 18:17:42 +0000 (21:17 +0300)] 
Update description of --disable-poman in configure.ac

(cherry picked from commit ff8752841ddc94f8867088b0c0002ed830f3300b)

6 months agoFix typos in TODO
Firas Khalil Khana [Mon, 23 Sep 2024 20:41:01 +0000 (23:41 +0300)] 
Fix typos in TODO

(cherry picked from commit 937c13872cb6a4d9f3e10537f00e1af3abfa8e8a)

6 months agoautotools: add Libs.private to uuid.pc
Karel Zak [Mon, 23 Sep 2024 10:01:40 +0000 (12:01 +0200)] 
autotools: add Libs.private to uuid.pc

Addresses: https://github.com/util-linux/util-linux/issues/3210
Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit 81ea117e0396274808a77d40bf11af44ea047285)

6 months agochcpu(8): Document CPU deconfiguring behavior
Mete Durlu [Mon, 2 Sep 2024 15:05:53 +0000 (17:05 +0200)] 
chcpu(8): Document CPU deconfiguring behavior

If architecture supports (de)configuring CPUs, the user should
deconfigure disabled CPUs to prevent performance penalties.

Signed-off-by: Mete Durlu <meted@linux.ibm.com>
(cherry picked from commit 5be86d47ad6d1bbdf6699e7cabc8dc663abfa1d7)

6 months agochcpu(8): Fix typo
Mete Durlu [Mon, 2 Sep 2024 15:05:52 +0000 (17:05 +0200)] 
chcpu(8): Fix typo

Signed-off-by: Mete Durlu <meted@linux.ibm.com>
(cherry picked from commit d4c819768fe5a666902d50a961cab770f81b5247)

6 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>
(cherry picked from commit 9c787eaac43f5f01146f792b0239f587e4b81202)

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

(cherry picked from commit 6dd59417e81967036037d430cc56b3e64d45f5a3)

6 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>
(cherry picked from commit 640b9480bd3efc0f4bc7f38a785d02cda70ec5c3)

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

(cherry picked from commit d2cf3cd6137d5612a3984b301e6c25d429976886)

6 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'.

(cherry picked from commit d10b038506936f3ad584fa2e017d2d860ed6d133)

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

(cherry picked from commit 6dfc07a7189eea461d52ff85620b286a4817a658)

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

(cherry picked from commit 50f2c94846d737afc00692ed440e5e1f02281f6e)

7 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>
(cherry picked from commit 6fc5b5af4bfea4e3115cddb2c1716b3120bb3d4f)

7 months agoaudit-arch.h: add defines for m68k, sh
Chris Hofstaedtler [Tue, 9 Apr 2024 08:34:59 +0000 (10:34 +0200)] 
audit-arch.h: add defines for m68k, sh

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

Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Reviewed-by: Thomas Weißschuh <thomas@t-8ch.de>
Signed-off-by: Chris Hofstaedtler <zeha@debian.org>
(cherry picked from commit 5ebf0edb0a0531cba801c7791543c610725bf944)

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

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

Reported-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Link: https://lore.kernel.org/util-linux/afef1b770ad80d50660bb2c53a0a8330b88d1049.camel@physik.fu-berlin.de/
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
(cherry picked from commit 6227b2b0585ee2ccf224cf70c7144296a814a4ab)

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

[kzak@redhat.com: - backport to stable/v2.40]

Suggested by Johannes Edmeier (@joshiste).
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
7 months agohwclock: Remove ioperm declare as it causes nested extern declare warning
Zhaoming Luo [Mon, 9 Dec 2024 02:11:54 +0000 (10:11 +0800)] 
hwclock: Remove ioperm declare as it causes nested extern declare warning

The extern declaration causes the following warning:

```
  CC       sys-utils/hwclock-hwclock-cmos.o
sys-utils/hwclock-cmos.c: In function 'i386_iopl':
sys-utils/hwclock-cmos.c:356:20: warning: nested extern declaration of 'ioperm' [-Wnested-externs]
  356 |         extern int ioperm(unsigned long from, unsigned long num, int turn_on);
      |                    ^~~~~~
sys-utils/hwclock-cmos.c:356:20: warning: redundant redeclaration of 'ioperm' [-Wredundant-decls]
In file included from sys-utils/hwclock-cmos.c:68:
/usr/include/i386-gnu/sys/io.h:29:12: note: previous declaration of 'ioperm' with type 'int(long unsigned int,  long unsigned int,  int)'
   29 | extern int ioperm (unsigned long int __from, unsigned long int __num,
      |            ^~~~~~
  CCLD     hwclock
```

(cherry picked from commit 5763e74d3cea008c31bfd48bc88660a1a32ecfa6)

7 months agolibblkid: (gpt) use blkid_probe_verify_csum() for partition array checksum
Thomas Weißschuh [Sun, 8 Dec 2024 08:55:27 +0000 (09:55 +0100)] 
libblkid: (gpt) use blkid_probe_verify_csum() for partition array checksum

All checksums should be tests with this function to keep checksum
validation configurable.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
(cherry picked from commit fce366c4982273cd73df727338ed02d9f357b6c6)

7 months agolibmount: exec mount helpers with posixly correct argument order
nilfsuser5678 [Fri, 29 Nov 2024 17:27:12 +0000 (17:27 +0000)] 
libmount: exec mount helpers with posixly correct argument order

This improves compatibility with non-gnu userspaces.

On systems where the libc provides posix getopt instead of gnu getopt,
mount helpers which use getopt to parse arguments will not parse
options which appear after non-option arguments. This patch ensures
mount/unmount work as expected in this situation.

mount: fix expected argument order for mount helpers in tests
(cherry picked from commit 2d680b72ac61644e4ba177e6569d8ca13580c248)

7 months agolibmount/context_mount: fix argument number comments
nilfsuser5678 [Fri, 29 Nov 2024 17:22:57 +0000 (17:22 +0000)] 
libmount/context_mount: fix argument number comments

(cherry picked from commit d2f7e308f4507dadc213e293771d627a0fd41f9c)

7 months agoman pages: document `--user` option for `runuser`
Christoph Anton Mitterer [Mon, 25 Nov 2024 01:42:27 +0000 (02:42 +0100)] 
man pages: document `--user` option for `runuser`

Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
(cherry picked from commit 2a562a5f5f56f6afb87ee7521f486248cb21aab6)

7 months agoman pages: use `user` rather than `username`
Christoph Anton Mitterer [Mon, 25 Nov 2024 01:41:13 +0000 (02:41 +0100)] 
man pages: use `user` rather than `username`

This are also the terms used in the usage outputs of the programs and the rest
of the man pages.

Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
(cherry picked from commit c8506371c644dc057d9f933cf2b0b48799a720bc)

7 months agobash-completion: add `--pty` and `--no-pty` options for `su` and `runuser`
Christoph Anton Mitterer [Mon, 25 Nov 2024 01:38:14 +0000 (02:38 +0100)] 
bash-completion: add `--pty` and `--no-pty` options for `su` and `runuser`

Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
(cherry picked from commit 4c60f0a0f80169840eba42d9a55bd2f920000921)

7 months agobash-completion: complete `--user` only for `runuser`, not for `su`
Christoph Anton Mitterer [Mon, 25 Nov 2024 01:35:34 +0000 (02:35 +0100)] 
bash-completion: complete `--user` only for `runuser`, not for `su`

Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
(cherry picked from commit 364f87a474ed9945e5b5527ebefe2bb15a721237)

7 months agopo-man: fix typo, update .gitignore
Karel Zak [Mon, 25 Nov 2024 09:51:41 +0000 (10:51 +0100)] 
po-man: fix typo, update .gitignore

* remove "po" from po4a.cfg (it's not lang)
* add ko/, ro/ and sr/ to .gitignore
* add po/ to .gitignore (it's directory with generic po stuff)

Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit 9902cf42b8c5140aae163598c3228f2a63a417de)

7 months agopo-man: add missing langs to po4a.cfg
Karel Zak [Wed, 20 Nov 2024 22:45:50 +0000 (23:45 +0100)] 
po-man: add missing langs to po4a.cfg

Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit 23a4dc0a35ec9d77653dfca509210ee6bb4c96e6)

7 months agomkswap: set selinux label also when creating file
Zbigniew Jędrzejewski-Szmek [Sun, 17 Nov 2024 18:04:49 +0000 (19:04 +0100)] 
mkswap: set selinux label also when creating file

With --file, shen the file is created by mkswap, stat() fails with -ENOENT
and the st_mode field is not populated, so the IS_REG() check fails. But if
we created by mkswap, we know it's just a regular file and we should apply
the selinux label.

Reported in https://bugzilla.redhat.com/show_bug.cgi?id=2324811#c56.

(cherry picked from commit 1dd27d1fa733f97b3a94822ccfd406e1a572867d)

8 months agonsenter: support empty environ[]
Karel Zak [Thu, 7 Nov 2024 11:26:25 +0000 (12:26 +0100)] 
nsenter: support empty environ[]

There is no error when the /proc/#/environ file does not contain any
NAME=value items.

Backport from master (v2.41) branch.

Fixes: https://github.com/util-linux/util-linux/issues/3270
Signed-off-by: Karel Zak <kzak@redhat.com>
8 months agolib/env: fix env_list_setenv() for strings without '='
Karel Zak [Thu, 7 Nov 2024 10:31:07 +0000 (11:31 +0100)] 
lib/env: fix env_list_setenv() for strings without '='

If there is no '=' in the string, the function will not move to the
next list item and will loop indefinitely.

Fixes: https://github.com/util-linux/util-linux/issues/3270
Signed-off-by: Karel Zak <kzak@redhat.com>
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

(cherry picked from commit 8d66c53d34f4d79ba4d84ab868e3aabd722aa073)

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>
(cherry picked from commit 1399c75764811398086b9e7bbb59c5ebfccf2310)

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>
(cherry picked from commit 036d72749ca274294051b43fd66727061a772b9c)

11 months agoautotools: add --disable-enosys, check for linux/audit.h
Karel Zak [Wed, 10 Apr 2024 09:50:58 +0000 (11:50 +0200)] 
autotools: add --disable-enosys, check for linux/audit.h

Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit ba05b9ffa7544c2fa5f88147acc85f704d4785de)

11 months agoautotools: check for sys/vfs.h and linux/bpf.h
Karel Zak [Wed, 10 Apr 2024 09:44:49 +0000 (11:44 +0200)] 
autotools: check for sys/vfs.h and linux/bpf.h

Addresses: https://github.com/util-linux/util-linux/pull/2933
Addresses: https://github.com/util-linux/util-linux/issues/2945
Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit 0c44599f92dc556364c18bd8c1e65808776dd614)

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
(cherry picked from commit 51369aa1e11b14af26cdb91f5fff6bbbf1d306af)

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

(cherry picked from commit 63d3b78b67123da942edc084bc2257ed20874be2)

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

(cherry picked from commit a4d0f18f46b9968a02653a5a7b5332f8c0466ba9)

12 months agolslocks: remove deadcode [coverity scan]
Karel Zak [Wed, 17 Apr 2024 10:46:50 +0000 (12:46 +0200)] 
lslocks: remove deadcode [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit 82af9ab04fd31eef71f207d344fbf893a6ef4765)

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>
(cherry picked from commit 7af2539f58b3bd3bb2f5e44138595be116c8d76c)

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>
(cherry picked from commit e0c41735aa13a7a62e42c0428823537d3edc02a8)

12 months agobuild-sys: release++ (v2.40.2) v2.40.2
Karel Zak [Thu, 4 Jul 2024 07:59:17 +0000 (09:59 +0200)] 
build-sys: release++ (v2.40.2)

Signed-off-by: Karel Zak <kzak@redhat.com>
12 months agodocs: update v2.40.2-ReleaseNotes
Karel Zak [Wed, 3 Jul 2024 12:43:30 +0000 (14:43 +0200)] 
docs: update v2.40.2-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
12 months agodocs: update AUTHORS file
Karel Zak [Wed, 3 Jul 2024 12:36:32 +0000 (14:36 +0200)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
12 months agopo-man: merge changes
Karel Zak [Wed, 3 Jul 2024 12:33:35 +0000 (14:33 +0200)] 
po-man: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
12 months agopo: merge changes
Karel Zak [Wed, 3 Jul 2024 12:33:28 +0000 (14:33 +0200)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
12 months agopo: update ja.po (from translationproject.org)
Hideki Yoshida [Wed, 3 Jul 2024 12:30:03 +0000 (14:30 +0200)] 
po: update ja.po (from translationproject.org)

12 months agopo: update es.po (from translationproject.org)
Antonio Ceballos Roa [Wed, 3 Jul 2024 12:28:22 +0000 (14:28 +0200)] 
po: update es.po (from translationproject.org)

12 months agolsfd: test: Adapt test cases for pidfs
Xi Ruoyao [Wed, 27 Mar 2024 20:01:02 +0000 (04:01 +0800)] 
lsfd: test: Adapt test cases for pidfs

On Linux >= 6.9, pidfds are from pidfs instead of anonymous inode.
Thus:

STTYPE is REG on Linux >= 6.9, UNKN on Linux < 6.9.

KNAME is pidfd:[inode number] on Linux >= 6.9, anon_inode:[pidfd] on
Linux < 6.9.

And ainode_class test cannot work on Linux >= 6.9, just skip this sub
test if STTYPE is REG.

Signed-off-by: Xi Ruoyao <xry111@xry111.site>
(cherry picked from commit 04db2ba9008e9635286b1aafc8ecd9533a0a91bf)

12 months agolsfd: Support pidfs
Xi Ruoyao [Wed, 3 Apr 2024 07:46:57 +0000 (15:46 +0800)] 
lsfd: Support pidfs

In Linux 6.9 pidfds are moved from the anonymous inode infrastructure to
a tiny pseudo filesystem named pidfs.  Recognize it properly.

Fixes #2865.

Signed-off-by: Xi Ruoyao <xry111@xry111.site>
(cherry picked from commit b1a48efd173c7f37d8df39a84eb25b4440335661)
Signed-off-by: Karel Zak <kzak@redhat.com>
12 months agolsfd: Refactor the pidfd logic into lsfd-pidfd.c
Xi Ruoyao [Wed, 3 Apr 2024 07:29:34 +0000 (15:29 +0800)] 
lsfd: Refactor the pidfd logic into lsfd-pidfd.c

We'll reuse these logic for pidfd support on Linux >= 6.9.  This should
be a no-functional change.

Besides moving the code, this change also renames anon_pidfd_data to
pidfd_data, and removes a redundant nullity check for free (because
free(NULL) will just do nothing per the C standard).

Signed-off-by: Xi Ruoyao <xry111@xry111.site>
(cherry picked from commit bf6645dc1edef09ad378cc5b9eb2c93861408735)

12 months agoinclude/pidfd-utils: provide ENOSYS stubs if pidfd functions are missing
Thomas Weißschuh [Mon, 13 May 2024 18:21:24 +0000 (20:21 +0200)] 
include/pidfd-utils: provide ENOSYS stubs if pidfd functions are missing

This allows code which can gracefully fall back to compile.

This should fix the CI on Ubuntu 18.04.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
(cherry picked from commit 4e8c092266e28589abd5ca149ee8b3a43a9a6ee0)

12 months agoinclude/pidfd-utils: remove hardcoded syscall fallback
Karel Zak [Mon, 13 May 2024 09:43:57 +0000 (11:43 +0200)] 
include/pidfd-utils: remove hardcoded syscall fallback

Based on https://github.com/util-linux/util-linux/pull/3018

The syscall numbers should not be hardcoded in the header file. If we
really need them, there is UL_CHECK_SYSCALL() to define the numbers
for different architectures. I doubt it's really necessary. Just
update your kernel header files to get the latest kernel updates ...

Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit 057080b5c89fa63cece8a5d4a6da4959bd004aa1)

12 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>
(cherry picked from commit 0309a6f5ca018d83420e49e0f9d046fecdb29261)

12 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>
(cherry picked from commit ff8ee29d648111eb222612ad4251e4c3b236a389)

12 months agoMerge branch 'stable/v2.40/autotools' of https://github.com/t-8ch/util-linux into...
Karel Zak [Tue, 2 Jul 2024 10:05:34 +0000 (12:05 +0200)] 
Merge branch 'stable/v2.40/autotools' of https://github.com/t-8ch/util-linux into stable/v2.40

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

12 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>
(cherry picked from commit 20dc72d8c1f3a53c0408858f0046e1849644c710)

12 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>
(cherry picked from commit 8c03e75c0b837f4285bd34f08eae40b48d3378be)

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

(cherry picked from commit a7df5b6380b2679635293130b0a5eba904464c1b)

12 months agobuild-sys: _PATH_VENDORDIR workaround
Karel Zak [Tue, 2 Jul 2024 08:39:12 +0000 (10:39 +0200)] 
build-sys: _PATH_VENDORDIR workaround

It appears that certain versions of libeconf do not handle calls to
econf_readDirs() with NULL path. Therefore, let's set the default to
"/usr/etc" if no value is defined by using the "--with-vendordir="
option.

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