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

15 months agopo-man: update ko.po (from translationproject.org)
Seong-ho Cho [Mon, 6 May 2024 08:01:55 +0000 (10:01 +0200)] 
po-man: update ko.po (from translationproject.org)

15 months agopo-man: update de.po (from translationproject.org)
Mario Blättermann [Mon, 6 May 2024 08:01:55 +0000 (10:01 +0200)] 
po-man: update de.po (from translationproject.org)

15 months agopo: update uk.po (from translationproject.org)
Yuri Chornoivan [Mon, 6 May 2024 08:00:24 +0000 (10:00 +0200)] 
po: update uk.po (from translationproject.org)

15 months agopo: update ro.po (from translationproject.org)
Remus-Gabriel Chelu [Mon, 6 May 2024 08:00:24 +0000 (10:00 +0200)] 
po: update ro.po (from translationproject.org)

15 months agopo: update pl.po (from translationproject.org)
Jakub Bogusz [Mon, 6 May 2024 08:00:24 +0000 (10:00 +0200)] 
po: update pl.po (from translationproject.org)

15 months agopo: update ko.po (from translationproject.org)
Seong-ho Cho [Mon, 6 May 2024 08:00:24 +0000 (10:00 +0200)] 
po: update ko.po (from translationproject.org)

15 months agopo: update ja.po (from translationproject.org)
Takeshi Hamasaki [Mon, 6 May 2024 08:00:24 +0000 (10:00 +0200)] 
po: update ja.po (from translationproject.org)

15 months agopo: update hr.po (from translationproject.org)
Božidar Putanec [Mon, 6 May 2024 08:00:24 +0000 (10:00 +0200)] 
po: update hr.po (from translationproject.org)

15 months agopo: update fr.po (from translationproject.org)
Frédéric Marchal [Mon, 6 May 2024 08:00:24 +0000 (10:00 +0200)] 
po: update fr.po (from translationproject.org)

15 months agopo: update cs.po (from translationproject.org)
Petr Písař [Mon, 6 May 2024 08:00:24 +0000 (10:00 +0200)] 
po: update cs.po (from translationproject.org)

15 months agohwclock: free temporary variable before return
Karel Zak [Thu, 2 May 2024 11:14:17 +0000 (13:14 +0200)] 
hwclock: free temporary variable before return

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

15 months agoagetty: make reload code more robust
Karel Zak [Thu, 2 May 2024 08:54:04 +0000 (10:54 +0200)] 
agetty: make reload code more robust

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

15 months agolibmount: fix possible memory leak
Karel Zak [Thu, 2 May 2024 08:15:29 +0000 (10:15 +0200)] 
libmount: fix possible memory leak

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

15 months agowall: check sysconf() returnvalue
Karel Zak [Thu, 2 May 2024 08:07:04 +0000 (10:07 +0200)] 
wall: check sysconf() returnvalue

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

15 months agogetopt: remove free-before-exit
Karel Zak [Tue, 30 Apr 2024 09:06:49 +0000 (11:06 +0200)] 
getopt: remove free-before-exit

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

15 months agofsck.minix: fix possible overrun
Karel Zak [Tue, 30 Apr 2024 09:04:32 +0000 (11:04 +0200)] 
fsck.minix: fix possible overrun

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

15 months agoagetty: fix resource leak
Karel Zak [Tue, 30 Apr 2024 09:01:06 +0000 (11:01 +0200)] 
agetty: fix resource leak

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

15 months agosuL fix use after free on error
Karel Zak [Tue, 30 Apr 2024 08:51:50 +0000 (10:51 +0200)] 
suL fix use after free on error

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

15 months agocal: use unsigned int to follow union with unsigned int
Karel Zak [Mon, 29 Apr 2024 13:33:07 +0000 (15:33 +0200)] 
cal: use unsigned int to follow union with unsigned int

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

15 months agowall: fix possible memory leak
Karel Zak [Mon, 29 Apr 2024 13:25:58 +0000 (15:25 +0200)] 
wall: fix possible memory leak

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

15 months agohwclock: initialize parser variables
Karel Zak [Mon, 29 Apr 2024 13:21:20 +0000 (15:21 +0200)] 
hwclock: initialize parser variables

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

15 months agolsclocks: fix FD leak
Karel Zak [Mon, 29 Apr 2024 13:17:53 +0000 (15:17 +0200)] 
lsclocks: fix FD leak

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

15 months agolibfdisk: add initializer to geometry
Karel Zak [Mon, 29 Apr 2024 12:59:44 +0000 (14:59 +0200)] 
libfdisk: add initializer to geometry

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

15 months agowall: make sure unsigned variable not underflow
Karel Zak [Mon, 29 Apr 2024 12:55:16 +0000 (14:55 +0200)] 
wall: make sure unsigned variable not underflow

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

15 months agobuild-sys: release++ (v2.40.1-rc1) v2.40.1-rc1
Karel Zak [Wed, 1 May 2024 19:46:06 +0000 (21:46 +0200)] 
build-sys: release++ (v2.40.1-rc1)

Signed-off-by: Karel Zak <kzak@redhat.com>
15 months agodocs: update v2.40.1-ReleaseNotes
Karel Zak [Wed, 1 May 2024 19:42:51 +0000 (21:42 +0200)] 
docs: update v2.40.1-ReleaseNotes

Signed-off-by: Karel Zak <kzak@redhat.com>
15 months agodocs: update AUTHORS file
Karel Zak [Wed, 1 May 2024 19:39:24 +0000 (21:39 +0200)] 
docs: update AUTHORS file

Signed-off-by: Karel Zak <kzak@redhat.com>
15 months agopo-man: merge changes
Karel Zak [Wed, 1 May 2024 19:35:43 +0000 (21:35 +0200)] 
po-man: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>
15 months agopo: merge changes
Karel Zak [Wed, 1 May 2024 19:35:36 +0000 (21:35 +0200)] 
po: merge changes

Signed-off-by: Karel Zak <kzak@redhat.com>