]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
7 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)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

8 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>
8 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)

8 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)

8 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)

8 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)

8 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)

8 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)

8 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)

8 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)

8 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)

8 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)

8 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)

9 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>
9 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)

13 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)

13 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)

13 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)

13 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>
13 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>
13 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>
13 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>
13 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>
13 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)

13 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)

13 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)

13 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>
13 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)

13 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)

13 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)

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

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

13 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

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

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

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.

(cherry picked from commit a7df5b6380b2679635293130b0a5eba904464c1b)

13 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>
13 months agoConditionally add uuid_time64 to sym. version map
Nicholas Vinson [Wed, 15 May 2024 15:14:54 +0000 (11:14 -0400)] 
Conditionally add uuid_time64 to sym. version map

The symbol uuid_time64 is conditionally defined. It only exists on
32-bit platforms that use the glibc library and enable support for
the 64-bit time_t type.

For all other platforms, the symbol is undefined. As a result, when
ld.lld version 17 or newer is used with default flags, ld.lld will
reject the symbol map with the error:

    version script assignment of 'UUID_2.40' to symbol 'uuid_time64'
    failed: symbol not defined

To fix this issue, the reference to uuid_time64 is changed to
uuid_time64*. The change to a glob pattern satisifies ld.lld and allows
the library to link.

fixes util-linux/util-linux#3036
fixes Gentoo bug #931328

Signed-off-by: Nicholas Vinson <nvinson234@gmail.com>
(cherry picked from commit 86d3f3f03231d25f9cbf18d83aeeccd2225dd246)

13 months agolibuuid: clear uuidd cache on fork()
Thomas Weißschuh [Tue, 7 May 2024 11:44:31 +0000 (13:44 +0200)] 
libuuid: clear uuidd cache on fork()

After fork() the memory of the calling thread is preserved into the new
process. This also includes TLS.
Make sure to reset the cache after a fork to avoid reuse of cached
values.

Only the TLS of the thread calling fork() is relevant as that is the
only thread that gets forked.
New threads will received newly initialized TLS.

Fixes https://github.com/util-linux/util-linux/issues/3009
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
(cherry picked from commit a3f1255f1891ddbaf3bb6a32af28569c0e6f3b91)

13 months agolibuuid: split uuidd cache into dedicated struct
Thomas Weißschuh [Tue, 7 May 2024 11:33:40 +0000 (13:33 +0200)] 
libuuid: split uuidd cache into dedicated struct

To clear the struct we need to be able to refer to it by name.

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

13 months agolibuuid: drop check for HAVE_TLS
Thomas Weißschuh [Tue, 7 May 2024 11:28:41 +0000 (13:28 +0200)] 
libuuid: drop check for HAVE_TLS

In the function get_clock() TLS is used unconditionally anyways.

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

13 months agolibuuid: drop duplicate assignment liuuid_la_LDFLAGS
Karel Zak [Wed, 15 May 2024 11:07:56 +0000 (13:07 +0200)] 
libuuid: drop duplicate assignment liuuid_la_LDFLAGS

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

13 months agolibmount: fix syscall save function
Karel Zak [Thu, 27 Jun 2024 10:57:19 +0000 (12:57 +0200)] 
libmount: fix syscall save function

Signed-off-by: Karel Zak <kzak@redhat.com>
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.

(cherry picked from commit 4b9e4d3f5950fcbcc177c315058b6e335d8c4362)

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

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

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

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

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

13 months agobash-completion: add logger --sd-* completions
Ville Skyttä [Tue, 4 Jun 2024 20:19:38 +0000 (23:19 +0300)] 
bash-completion: add logger --sd-* completions

Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
13 months agowdctl: always query device node when sysfs is unavailable
Thomas Weißschuh [Tue, 4 Jun 2024 19:06:49 +0000 (21:06 +0200)] 
wdctl: always query device node when sysfs is unavailable

When there is no sysfs at all for the watchdog, fall back to reading
from the device node.
This is also useful if the legacy compat /dev/watchdog device which
never has a sysfs interface.

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

14 months agolscpu: New Arm Cortex part numbers
Jeremy Linton [Wed, 29 May 2024 16:04:38 +0000 (11:04 -0500)] 
lscpu: New Arm Cortex part numbers

Arm has announced the Cortex-X925 and published the TRM here:
https://developer.arm.com/documentation/102807/0001/?lang=en

As well as the Cortex-A725 with a TRM here:
https://developer.arm.com/documentation/107652/0001/?lang=en

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
(cherry picked from commit 7a136d595f1b3b48128afdb9bd110a40aec771af)

14 months agolibmount: fix tree FD usage in subdir hook
Karel Zak [Mon, 3 Jun 2024 10:33:01 +0000 (12:33 +0200)] 
libmount: fix tree FD usage in subdir hook

* Initialize the tree file descriptor in the hook_subdir.c module if
  it has not been initialized yet. (hook_mount.c does not open the
  tree if the mount.<type> helper will be executed.)

* Move the function to open the tree to context.c to make it more
  generic and usable in more places.

Reported-by: Linus Heckemann <git@sphalerite.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit 2a684833d723e29af0ba772b3e6917492c69e023)

14 months agolibsmartcols/src/Makemodule.am: ensure filter-scanner/paser.c file is newer than...
Chen Qi [Sat, 25 May 2024 03:41:35 +0000 (11:41 +0800)] 
libsmartcols/src/Makemodule.am: ensure filter-scanner/paser.c file is newer than the .h file

In released tarball, for filter-scanner/parser, the .h and the .c
file has the same mtime. The 'make' tool thinks .h is newer than
the .c file, thus deciding to remake it. This will not only cause
unnecessary rebuild, but also parallel make error. For example,
after 'make', when running 'make install', the libmount.la and findmnt
are both rebuilt and findmnt building will somethings error out complaining
'libmount.so: no such file or directory' or 'libmount.so: file format
not recognized'.

Touch the generated .c file to ensure it's newer than the .h file.
In this way, in new released tarballs in the future, there will
be no unnecessary remake.

fixes util-linux/util-linux#3061

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
(cherry picked from commit bf751e8effcc348495aa3a7aeb7a4257cf2ffa6e)

14 months agolibsmartcols: fix reduction stages use
Karel Zak [Wed, 15 May 2024 13:45:19 +0000 (15:45 +0200)] 
libsmartcols: fix reduction stages use

There is no proper check for the number of reduction stages, so in
some cases, the code can loop indefinitely.

The patch also fixes 'rc' variable shadowing.

Fixes: https://github.com/util-linux/util-linux/issues/3046
Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit 8a01276a3c5bc09dce342e087019c704d8c56a32)

14 months agomeson: Correctly require the Python.h header for the python dependency
Jordan Williams [Tue, 7 May 2024 14:40:44 +0000 (09:40 -0500)] 
meson: Correctly require the Python.h header for the python dependency

The current solution to require the Python.h header works around a bug
in Meson that has been fixed for version 1.4.1 of Meson.
Refer to https://github.com/mesonbuild/meson/issues/12862.
This change uses an explicit check for the Python.h include.
This verifies the required header exists.
This check is only necessary prior to version 1.4.1 of Meson.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit 7e582204cd7cac2b55a2f7c0fb06899fcf7ff5df)

14 months agomeson: Only require Python module when building pylibmount
Jordan Williams [Thu, 9 May 2024 21:46:58 +0000 (16:46 -0500)] 
meson: Only require Python module when building pylibmount

Only the python executable is required for tests.
Version 1.4.1 of Meson will require the Python.h for find_installation.
This will result in the tests requiring Python.h unnecessarily.
Use find_program to find the Python program for the tests instead.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit cb7ac65dcaf655ea5dedf8820ab6417629241aa4)

14 months agomeson: Fix build-python option
Jordan Williams [Mon, 13 May 2024 12:25:50 +0000 (07:25 -0500)] 
meson: Fix build-python option

The build-python option is for controlling whether or not pylibmount is
built.
Unfortunately, commit b6799cc rendered the option unused.
This change uses the build-python option again.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit b66b70d62e50923502aeb3f6420a5f9c20f769d3)

14 months agoFix fstab order in `column` manpage example.
Rom [Sat, 11 May 2024 18:41:39 +0000 (11:41 -0700)] 
Fix fstab order in `column` manpage example.

fstab is:

1. fs_spec
2. fs_file
3. fs_vfstype
4. fs_mntops
5. fs_freq
6. fs_passno

In other words it's:

    SOURCE,TARGET,TYPE,OPTIONS,FREQ,PASS

(cherry picked from commit 7f4ffbc2e6740f829b45c0801fdfadea966615d5)

14 months agolibmount/utils: add pidfs to pseudo fs list
Mike Yuan [Fri, 10 May 2024 17:11:28 +0000 (01:11 +0800)] 
libmount/utils: add pidfs to pseudo fs list

(cherry picked from commit 62cf52f81d5baaba2cfe6dfe00aa4975ebd55d92)

14 months agomkswap.8.adoc: update note regarding swapfile creation
Mike Yuan [Fri, 10 May 2024 17:03:51 +0000 (01:03 +0800)] 
mkswap.8.adoc: update note regarding swapfile creation

Follow-up for 7377b0d99560460806eab9efa9d8224d084c2082
(the addition of --file option)

(cherry picked from commit 7b4e937c862ea84e1568b01cd5ec69918920f9a5)

14 months agoFix ul_path_read_buffer()
Daan De Meyer [Thu, 9 May 2024 10:32:31 +0000 (12:32 +0200)] 
Fix ul_path_read_buffer()

The current implementation cuts off the last character of the buffer
if there is no trailing newline.

(cherry picked from commit 6273c12257973cbd3c59a710049ee8a8027bbbb1)

15 months agobuild-sys: release++ (v2.40.1) v2.40.1
Karel Zak [Mon, 6 May 2024 08:17:19 +0000 (10:17 +0200)] 
build-sys: release++ (v2.40.1)

Signed-off-by: Karel Zak <kzak@redhat.com>
15 months agodocs: update v2.40.1-ReleaseNotes
Karel Zak [Mon, 6 May 2024 08:14:59 +0000 (10:14 +0200)] 
docs: update v2.40.1-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
15 months agopo-man: merge changes
Karel Zak [Mon, 6 May 2024 08:11:22 +0000 (10:11 +0200)] 
po-man: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
15 months agopo: merge changes
Karel Zak [Mon, 6 May 2024 08:11:09 +0000 (10:11 +0200)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
15 months agopo-man: update ro.po (from translationproject.org)
Remus-Gabriel Chelu [Mon, 6 May 2024 08:01:55 +0000 (10:01 +0200)] 
po-man: update ro.po (from translationproject.org)