]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
4 days agoMerge branch 'PR/fstrim-dedup-fix' of https://github.com/karelzak/util-linux-work master
Karel Zak [Tue, 2 Jun 2026 11:37:26 +0000 (13:37 +0200)] 
Merge branch 'PR/fstrim-dedup-fix' of https://github.com/karelzak/util-linux-work

* 'PR/fstrim-dedup-fix' of https://github.com/karelzak/util-linux-work:
  fstrim: resolve non-device sources to real block devices

4 days agoMerge branch 'PR/readprofile-no-popen' of https://github.com/karelzak/util-linux...
Karel Zak [Tue, 2 Jun 2026 11:34:40 +0000 (13:34 +0200)] 
Merge branch 'PR/readprofile-no-popen' of https://github.com/karelzak/util-linux-work

* 'PR/readprofile-no-popen' of https://github.com/karelzak/util-linux-work:
  readprofile: replace popen() with fork/exec for .gz map files

4 days agoMerge branch 'PR/hexdump-color-overflow' of https://github.com/karelzak/util-linux...
Karel Zak [Tue, 2 Jun 2026 11:34:00 +0000 (13:34 +0200)] 
Merge branch 'PR/hexdump-color-overflow' of https://github.com/karelzak/util-linux-work

* 'PR/hexdump-color-overflow' of https://github.com/karelzak/util-linux-work:
  tests: (hexdump) use arrays for OPTS and ADDRFMT
  hexdump: fix buffer overflow in color_cond()

4 days agoMerge branch 'PR/lscpu-arm-nooverwrite' of https://github.com/karelzak/util-linux...
Karel Zak [Tue, 2 Jun 2026 11:32:44 +0000 (13:32 +0200)] 
Merge branch 'PR/lscpu-arm-nooverwrite' of https://github.com/karelzak/util-linux-work

* 'PR/lscpu-arm-nooverwrite' of https://github.com/karelzak/util-linux-work:
  lscpu: set nooverwrite for Phytium ARM implementer
  lscpu: add nooverwrite flag for ARM implementer table
  lscpu: add find_implementer() for ARM implementer lookup

4 days agohardlink: preserve timestamps when reflinking files
Liu Zheng [Tue, 2 Jun 2026 06:26:28 +0000 (14:26 +0800)] 
hardlink: preserve timestamps when reflinking files

When using --reflink=always, the destination file gets the current
timestamp instead of preserving the original file's atime and mtime.
This differs from both hardlink behavior and "cp -p --reflink=always".

Add futimens() call after successful reflink to restore the original
timestamps from the target file's stat data.

Fixes #2340

5 days agoinclude/mountutils.h: fix LSMT_ROOT definition
Shubham Chakraborty [Sat, 30 May 2026 09:49:32 +0000 (11:49 +0200)] 
include/mountutils.h: fix LSMT_ROOT definition

Commit
ded434a63f3eee7fd7805b18d6c9bb912016c3c8 ("include/mount-api-utils:
add statmount and listmount") introduce a fallback definition for the
LSMT_ROOT defined, but a small typo makes this fallback definition
ineffective:

 #ifdef LSMT_ROOT
 # define LSMT_ROOT ...
 #endif

Should obviously have been:

 #ifndef LSMT_ROOT
 # define LSMT_ROOT ...
 #endif

Signed-off-by: Shubham Chakraborty <chakrabortyshubham66@gmail.com>
[Thomas: improve commit message]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
5 days agoreadprofile: replace popen() with fork/exec for .gz map files
Karel Zak [Mon, 1 Jun 2026 09:23:57 +0000 (11:23 +0200)] 
readprofile: replace popen() with fork/exec for .gz map files

Security scanners repeatedly flag the popen("zcat %s", name) pattern
as a command injection vulnerability (CWE-78). While this is a false
positive -- readprofile is not installed with elevated privileges and
the filename comes from the user's own command line -- the reports are
a recurring nuisance.

The root cause is that popen() passes the command through /bin/sh,
which makes scanners flag it regardless of whether the input is
actually untrusted. Replace popen() with fork()/execlp() to invoke
zcat directly without shell interpretation. This eliminates the
shell from the execution path and silences the scanners without
adding any new dependencies.

Also use ul_endswith() for the .gz suffix check, and handle fdopen()
failure after fork to avoid fd leak and zombie process.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 days agotests: (hexdump) use arrays for OPTS and ADDRFMT
Karel Zak [Mon, 1 Jun 2026 11:52:33 +0000 (13:52 +0200)] 
tests: (hexdump) use arrays for OPTS and ADDRFMT

Convert OPTS and ADDRFMT from plain strings to bash arrays and use
proper "${…[@]}" expansion to fix shellcheck SC2090/SC2086 warnings
about unquoted variables containing quotes/backslashes.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 days agoMerge branch 'uclampset-conditional-flags' of https://github.com/1frn10/util-linux...
Karel Zak [Mon, 1 Jun 2026 11:40:05 +0000 (13:40 +0200)] 
Merge branch 'uclampset-conditional-flags' of https://github.com/1frn10/util-linux-fork

* 'uclampset-conditional-flags' of https://github.com/1frn10/util-linux-fork:
  uclampset: fix lost-update race in set_uclamp_one()

5 days agofstrim: resolve non-device sources to real block devices
Karel Zak [Thu, 28 May 2026 12:01:53 +0000 (14:01 +0200)] 
fstrim: resolve non-device sources to real block devices

When fstrim reads fstab entries (--fstab, --listed-in), bind mount
entries use directory paths as sources (e.g. /data/ssd/ldap) rather
than device names. Source de-duplication compares path strings, so
these never match the real device paths (e.g. /dev/mapper/foo),
causing the same filesystem to be trimmed multiple times.

Use statmount(STATMOUNT_SB_SOURCE) to resolve directory source paths
to their real block device before de-duplication. Fall back to the
original source when statmount() is unavailable.

Addresses: https://github.com/util-linux/util-linux/issues/857
Signed-off-by: Karel Zak <kzak@redhat.com>
5 days agohexdump: fix buffer overflow in color_cond()
Karel Zak [Thu, 28 May 2026 14:09:20 +0000 (16:09 +0200)] 
hexdump: fix buffer overflow in color_cond()

Widen the color condition value from int (4 bytes) to int64_t (8 bytes)
to accommodate format strings with 8-byte conversion units (e.g.,
1/8 "%016x"). The memcpy() in color_cond() copies clr->range bytes
into a local variable, and for 8-byte units this overflows a 4-byte
int.

Also switch strtoul() to strtoll() in the color format parser to
correctly parse 64-bit values into the widened int64_t field.

Change hexdump_clr.range from int to size_t (a byte count should never
be negative), add a defensive guard against memcpy overflow in
color_cond(), and add an 8-byte color condition regression test.

Reported-by: Michał Majchrowicz (AFINE Team)
Reported-by: Marcin Wyczechowski (AFINE Team)
Signed-off-by: Karel Zak <kzak@redhat.com>
5 days agolscpu: set nooverwrite for Phytium ARM implementer
Karel Zak [Thu, 28 May 2026 10:04:32 +0000 (12:04 +0200)] 
lscpu: set nooverwrite for Phytium ARM implementer

The Phytium kernel provides model name in /proc/cpuinfo, prefer it
over the hardcoded table.

Addresses: https://github.com/util-linux/util-linux/pull/4362
Signed-off-by: Karel Zak <kzak@redhat.com>
5 days agolscpu: add nooverwrite flag for ARM implementer table
Karel Zak [Thu, 28 May 2026 10:03:28 +0000 (12:03 +0200)] 
lscpu: add nooverwrite flag for ARM implementer table

Add a nooverwrite flag to struct hw_impl. When set, vendor and model
name already provided by the kernel in /proc/cpuinfo are preserved
rather than being overwritten by the hardcoded lookup tables. The
tables serve as a fallback when the kernel does not provide the
information.

This approach keeps all implementer entries in the table, which is
also required for "lscpu --arm-id" to list all known vendors and
part IDs.

Addresses: https://github.com/util-linux/util-linux/pull/4362
Signed-off-by: Karel Zak <kzak@redhat.com>
5 days agoMerge branch 'PR/libmount-no-symlinks' of https://github.com/karelzak/util-linux...
Karel Zak [Mon, 1 Jun 2026 10:15:53 +0000 (12:15 +0200)] 
Merge branch 'PR/libmount-no-symlinks' of https://github.com/karelzak/util-linux-work

* 'PR/libmount-no-symlinks' of https://github.com/karelzak/util-linux-work:
  loopdev: use openat2(RESOLVE_NO_SYMLINKS) for backing file
  lib/fileutils: add ul_open_no_symlinks()

5 days agoMerge branch 'PR/tests-tar-no-same-owner' of https://github.com/karelzak/util-linux...
Karel Zak [Mon, 1 Jun 2026 10:15:22 +0000 (12:15 +0200)] 
Merge branch 'PR/tests-tar-no-same-owner' of https://github.com/karelzak/util-linux-work

* 'PR/tests-tar-no-same-owner' of https://github.com/karelzak/util-linux-work:
  tests: use tar --no-same-owner for sysfs dump extraction

5 days agoMerge branch 'fix-remove-bits-bash-completion' of https://github.com/add-uos/util...
Karel Zak [Mon, 1 Jun 2026 10:06:39 +0000 (12:06 +0200)] 
Merge branch 'fix-remove-bits-bash-completion' of https://github.com/add-uos/util-linux

* 'fix-remove-bits-bash-completion' of https://github.com/add-uos/util-linux:
  fix: (bash-completion) remove --bit option from bits completion

5 days agofix: (bash-completion) remove --bit option from bits completion
zhanghongyuan [Mon, 1 Jun 2026 03:29:19 +0000 (11:29 +0800)] 
fix: (bash-completion) remove --bit option from bits completion

6 days agouclampset: fix lost-update race in set_uclamp_one()
Furkan Caliskan [Sun, 31 May 2026 08:36:58 +0000 (11:36 +0300)] 
uclampset: fix lost-update race in set_uclamp_one()

The function unconditionally sets both SCHED_FLAG_UTIL_CLAMP_MIN and
SCHED_FLAG_UTIL_CLAMP_MAX in sa.sched_flags regardless of which values
the user actually requested to change.

This creates a lost-update race: sched_getattr() fetches the current
clamp values, but between that call and sched_setattr(), another thread
may legitimately update the value we did not intend to touch. Because
both flags are always set, sched_setattr() forces the kernel to apply
the stale cached value, silently overwriting the concurrent update.

Fix by setting the flags conditionally.

Signed-off-by: Furkan Caliskan <frn1furkan10@gmail.com>
7 days agodmesg: fix off-by-one read buffer size
Brian Mak [Thu, 28 May 2026 19:08:04 +0000 (12:08 -0700)] 
dmesg: fix off-by-one read buffer size

PRINTK_MESSAGE_MAX is 2048 in the kernel. In a formatted record that is
exactly 2048 bytes, reading /proc/kmsg with a size of PRINTK_MESSAGE_MAX
- 1 (2047) will result in the read syscall returning -EINVAL.

We see such a case when using a large initrd, for which the kernel
outputs loading spinner characters, based on the size of the initrd. For
a large enough initrd, there will be enough spinner characters to create
several formatted records of size 2048.

We fix this by increasing the kmsg_buf size by 1, which increases the
size used by the read syscall to PRINTK_MESSAGE_MAX (2048).

Signed-off-by: Brian Mak <makb@juniper.net>
9 days agoMerge branch 'blockdev_tests' of https://github.com/cgoesche/util-linux-fork
Karel Zak [Thu, 28 May 2026 10:38:01 +0000 (12:38 +0200)] 
Merge branch 'blockdev_tests' of https://github.com/cgoesche/util-linux-fork

* 'blockdev_tests' of https://github.com/cgoesche/util-linux-fork:
  tests: (blockdev) add missing tests

# Conflicts:
# tests/commands.sh

9 days agolscpu: add find_implementer() for ARM implementer lookup
Karel Zak [Thu, 28 May 2026 10:01:01 +0000 (12:01 +0200)] 
lscpu: add find_implementer() for ARM implementer lookup

Refactor ARM implementer lookup into a dedicated find_implementer()
function and use it in is_arm() and arm_ids_decode() to simplify
the code and avoid open-coded linear searches.

Addresses: https://github.com/util-linux/util-linux/pull/4362
Signed-off-by: Karel Zak <kzak@redhat.com>
9 days agofdisk: remove blank line
Karel Zak [Thu, 28 May 2026 09:44:13 +0000 (11:44 +0200)] 
fdisk: remove blank line

Signed-off-by: Karel Zak <kzak@redhat.com>
9 days agoMerge branch 'master-branch-5' of https://github.com/Leefancy/util-linux
Karel Zak [Thu, 28 May 2026 09:43:41 +0000 (11:43 +0200)] 
Merge branch 'master-branch-5' of https://github.com/Leefancy/util-linux

* 'master-branch-5' of https://github.com/Leefancy/util-linux:
  fdisk-list: fix memory leak when partition returns empty string

9 days agoMerge branch 'master-branch-4' of https://github.com/Leefancy/util-linux
Karel Zak [Thu, 28 May 2026 09:41:55 +0000 (11:41 +0200)] 
Merge branch 'master-branch-4' of https://github.com/Leefancy/util-linux

* 'master-branch-4' of https://github.com/Leefancy/util-linux:
  fdisk-list: fix memory leak in partition listing

9 days agoMerge branch 'blkzone_tests' of https://github.com/cgoesche/util-linux-fork
Karel Zak [Thu, 28 May 2026 09:26:57 +0000 (11:26 +0200)] 
Merge branch 'blkzone_tests' of https://github.com/cgoesche/util-linux-fork

* 'blkzone_tests' of https://github.com/cgoesche/util-linux-fork:
  tests: (blkzone) add missing tests
  blkzone: add missing newline in success message

9 days agotests: use tar --no-same-owner for sysfs dump extraction
Karel Zak [Thu, 28 May 2026 09:05:55 +0000 (11:05 +0200)] 
tests: use tar --no-same-owner for sysfs dump extraction

Use --no-same-owner when extracting sysfs dump tarballs so that
extracted files are owned by the current user rather than preserving
the original (often root) ownership from the archive.

This allows chmem tests to run without root since they only operate
on a local sysfs dump via --sysroot. The valid_zones file (0444 in
real sysfs) needs an explicit chmod u+w before the test can write
to it. Apply --no-same-owner to lsblk, lscpu, lsmem, and hardlink
tests for consistency.

Signed-off-by: Karel Zak <kzak@redhat.com>
9 days agoMerge branch 'lsmem_aarch64_dump' of https://github.com/cgoesche/util-linux-fork
Karel Zak [Thu, 28 May 2026 09:10:10 +0000 (11:10 +0200)] 
Merge branch 'lsmem_aarch64_dump' of https://github.com/cgoesche/util-linux-fork

* 'lsmem_aarch64_dump' of https://github.com/cgoesche/util-linux-fork:
  tests: (lsmem) add aarch64 memory block layout dump

9 days agochmem: simplify have_mem_blk_zones()
Karel Zak [Thu, 28 May 2026 08:54:33 +0000 (10:54 +0200)] 
chmem: simplify have_mem_blk_zones()

Use ul_path_accessf() instead of manual ul_strconcat() + ul_path_access()
+ free(). This avoids a potential NULL dereference if ul_strconcat() fails
on memory allocation.

Signed-off-by: Karel Zak <kzak@redhat.com>
9 days agoMerge branch 'chmem_tests' of https://github.com/cgoesche/util-linux-fork
Karel Zak [Thu, 28 May 2026 08:52:28 +0000 (10:52 +0200)] 
Merge branch 'chmem_tests' of https://github.com/cgoesche/util-linux-fork

* 'chmem_tests' of https://github.com/cgoesche/util-linux-fork:
  tests: (chmem) add tests for aarch64 16K 16G memory layout
  chmem: add helper function to sensibly detect the 'valid_zones' attribute
  tests: (chmem) add missing tests
  chmem: add a new --sysroot command line option

9 days agoloopdev: use openat2(RESOLVE_NO_SYMLINKS) for backing file
Karel Zak [Wed, 27 May 2026 13:15:22 +0000 (15:15 +0200)] 
loopdev: use openat2(RESOLVE_NO_SYMLINKS) for backing file

Use ul_open_no_symlinks() instead of open(O_NOFOLLOW) when
LOOPDEV_FL_NOFOLLOW is set.  O_NOFOLLOW only rejects symlinks at the
last path component, but TOCTOU attacks swap intermediate components.
openat2(RESOLVE_NO_SYMLINKS) rejects symlinks at any component.

Signed-off-by: Karel Zak <kzak@redhat.com>
9 days agolib/fileutils: add ul_open_no_symlinks()
Karel Zak [Wed, 27 May 2026 08:35:39 +0000 (10:35 +0200)] 
lib/fileutils: add ul_open_no_symlinks()

Add a helper that opens a path rejecting symlinks at any component,
not just the last one.  Uses openat2(RESOLVE_NO_SYMLINKS) when
available (Linux >= 5.6), falls back to open(O_NOFOLLOW).

Signed-off-by: Karel Zak <kzak@redhat.com>
9 days agoMerge branch 'PR/getino-op-types' of https://github.com/karelzak/util-linux-work
Karel Zak [Thu, 28 May 2026 08:14:29 +0000 (10:14 +0200)] 
Merge branch 'PR/getino-op-types' of https://github.com/karelzak/util-linux-work

* 'PR/getino-op-types' of https://github.com/karelzak/util-linux-work:
  getino: cleanup whitespace
  getino: rename GETINO_*_NAMESPACE to GETINO_NS_*
  getino: split operation type and namespace type

10 days agoMerge branch 'PR/libfdisk-gpt-entry-size' of https://github.com/karelzak/util-linux...
Karel Zak [Wed, 27 May 2026 12:21:50 +0000 (14:21 +0200)] 
Merge branch 'PR/libfdisk-gpt-entry-size' of https://github.com/karelzak/util-linux-work

* 'PR/libfdisk-gpt-entry-size' of https://github.com/karelzak/util-linux-work:
  libfdisk: fix use of on-disk sizeof_partition_entry in GPT

10 days agogetino: cleanup whitespace
Karel Zak [Tue, 26 May 2026 09:06:12 +0000 (11:06 +0200)] 
getino: cleanup whitespace

Fix indentation and alignment in ns_desc, ns_info[], longopts[]
and case 'p'.

Signed-off-by: Karel Zak <kzak@redhat.com>
10 days agogetino: rename GETINO_*_NAMESPACE to GETINO_NS_*
Karel Zak [Tue, 26 May 2026 08:59:22 +0000 (10:59 +0200)] 
getino: rename GETINO_*_NAMESPACE to GETINO_NS_*

Use shorter, consistent naming for namespace type enum values.

Signed-off-by: Karel Zak <kzak@redhat.com>
10 days agogetino: split operation type and namespace type
Karel Zak [Tue, 26 May 2026 08:57:09 +0000 (10:57 +0200)] 
getino: split operation type and namespace type

Separate the single GETINO_* enum into two levels: a basic operation
type (GETINO_OP_PIDFS vs GETINO_OP_NAMESPACE) and a namespace sub-type
that directly indexes the ns_info[] array starting at 0.

This eliminates the IS_NAMESPACE_OP() macro, the get_pidfd_ns_ioctl()
and pidfd_get_nsfd_or_err() helper functions, and the unused pidfd_ioctl
field from getino_context. The dispatch in print_inode() now uses a
clean switch on ctx->op.

Signed-off-by: Karel Zak <kzak@redhat.com>
10 days agofdisk-list: fix memory leak when partition returns empty string
Leefancy [Wed, 27 May 2026 07:45:41 +0000 (15:45 +0800)] 
fdisk-list: fix memory leak when partition returns empty string

Signed-off-by: Leefancy <lijian01@kylinos.cn>
10 days agofdisk-list: fix memory leak in partition listing
Leefancy [Wed, 27 May 2026 03:28:25 +0000 (11:28 +0800)] 
fdisk-list: fix memory leak in partition listing

Signed-off-by: Leefancy <lijian01@kylinos.cn>
11 days agolibfdisk: fix use of on-disk sizeof_partition_entry in GPT
Karel Zak [Tue, 26 May 2026 14:16:03 +0000 (16:16 +0200)] 
libfdisk: fix use of on-disk sizeof_partition_entry in GPT

The GPT code hardcodes sizeof(struct gpt_entry) (128 bytes) in
several places instead of using the on-disk sizeof_partition_entry
field from the GPT header. The UEFI specification allows entry sizes
larger than 128 bytes.

 - reject GPT headers where sizeof_partition_entry is smaller than
   sizeof(struct gpt_entry) to prevent out-of-bounds reads when
   accessing entry array elements

 - use the on-disk entry size as the qsort element stride in
   gpt_reorder() to avoid corrupting entries when sizeof_partition_entry
   differs from 128

 - use the on-disk entry size in gpt_copy_header() when calculating
   the backup partition entry array LBA

Signed-off-by: Karel Zak <kzak@redhat.com>
11 days agotests: (blkzone) add missing tests
Christian Goeschel Ndjomouo [Tue, 26 May 2026 03:55:34 +0000 (23:55 -0400)] 
tests: (blkzone) add missing tests

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
11 days agoblkzone: add missing newline in success message
Christian Goeschel Ndjomouo [Tue, 26 May 2026 11:25:28 +0000 (07:25 -0400)] 
blkzone: add missing newline in success message

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
11 days agotests: (chmem) add tests for aarch64 16K 16G memory layout
Christian Goeschel Ndjomouo [Mon, 25 May 2026 20:55:38 +0000 (16:55 -0400)] 
tests: (chmem) add tests for aarch64 16K 16G memory layout

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
11 days agochmem: add helper function to sensibly detect the 'valid_zones' attribute
Christian Goeschel Ndjomouo [Mon, 25 May 2026 20:38:53 +0000 (16:38 -0400)] 
chmem: add helper function to sensibly detect the 'valid_zones' attribute

On some systems the first available memory blocks start at an index
greater than 0, and on such systems we fail to properly detect the
valid_zones attribute, because we naively checked for the presence
of the memory block directory 'memory0'. To sensibly and reliably
detect the first memory block, we can use the directory sysmem->dirs
that are sorted in numeric order, so we can assume that the first
entry is the first memory block, i.e. sysmem->dirs[0]->d_name is
the name of the first configurable memory block.

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
11 days agotests: (chmem) add missing tests
Christian Goeschel Ndjomouo [Sun, 17 May 2026 13:02:31 +0000 (09:02 -0400)] 
tests: (chmem) add missing tests

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
11 days agochmem: add a new --sysroot command line option
Christian Goeschel Ndjomouo [Sun, 17 May 2026 04:17:28 +0000 (00:17 -0400)] 
chmem: add a new --sysroot command line option

This new option allows an administrator to configure memory
on a Linux instance other than the one on which chmem(1) is
executed. Additionally, it facilitates regression testing
with sysfs dumps.

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
11 days agochrt: restructure validation to use HAVE_SCHED_SETATTR as top-level guard
Karel Zak [Tue, 26 May 2026 10:39:52 +0000 (12:39 +0200)] 
chrt: restructure validation to use HAVE_SCHED_SETATTR as top-level guard

Signed-off-by: Karel Zak <kzak@redhat.com>
11 days agochrt: fix preprocessor indentation levels
Karel Zak [Tue, 26 May 2026 10:29:24 +0000 (12:29 +0200)] 
chrt: fix preprocessor indentation levels

Signed-off-by: Karel Zak <kzak@redhat.com>
11 days agochrt: always use sched_setattr() for all policies
Karel Zak [Tue, 26 May 2026 10:21:49 +0000 (12:21 +0200)] 
chrt: always use sched_setattr() for all policies

Remove the set_sched_one_by_setscheduler() shortcut for non-deadline
policies from the HAVE_SCHED_SETATTR code path. The original reason
(2016, commit 88b60f0bdee6) was that sched_setattr() reset the nice
value, causing EPERM for non-root users. But getpriority() already
preserves the nice setting, making the shortcut unnecessary.

The shortcut caused --clamp-min/--clamp-max (SCHED_FLAG_UTIL_CLAMP)
to be silently ignored for SCHED_FIFO and SCHED_RR, because those
policies were routed through sched_setscheduler() which cannot pass
sched_flags at all.

Using sched_setattr() unconditionally ensures all sched_flags work
with all policies and prevents the same class of bug for future flag
additions.

Addresses: https://github.com/util-linux/util-linux/pull/4351
Signed-off-by: Karel Zak <kzak@redhat.com>
11 days agoMerge branch 'chrt-util-clamp' of https://github.com/1frn10/util-linux-fork
Karel Zak [Tue, 26 May 2026 10:10:42 +0000 (12:10 +0200)] 
Merge branch 'chrt-util-clamp' of https://github.com/1frn10/util-linux-fork

* 'chrt-util-clamp' of https://github.com/1frn10/util-linux-fork:
  chrt: Add uclamp reset support via -1 sentinel
  Update schedutils/chrt.c
  Update schedutils/chrt.c
  chrt: Add support for SCHED_FLAG_UTIL_CLAMP

11 days agoMerge branch 'PR/pipesz-merge-getopt-loops' of https://github.com/karelzak/util-linux...
Karel Zak [Tue, 26 May 2026 09:44:00 +0000 (11:44 +0200)] 
Merge branch 'PR/pipesz-merge-getopt-loops' of https://github.com/karelzak/util-linux-work

* 'PR/pipesz-merge-getopt-loops' of https://github.com/karelzak/util-linux-work:
  pipesz: merge help/version getopt loop into main loop

11 days agoMerge branch 'apple' of https://github.com/barracuda156/util-linux
Karel Zak [Tue, 26 May 2026 09:40:27 +0000 (11:40 +0200)] 
Merge branch 'apple' of https://github.com/barracuda156/util-linux

* 'apple' of https://github.com/barracuda156/util-linux:
  libuuid: fix build with gcc-14 on macOS

11 days agoMerge branch 'master' of https://github.com/LexNastin/util-linux
Karel Zak [Tue, 26 May 2026 09:34:58 +0000 (11:34 +0200)] 
Merge branch 'master' of https://github.com/LexNastin/util-linux

* 'master' of https://github.com/LexNastin/util-linux:
  add emummc partition type

11 days agoMerge branch 'smartcols-test' of https://github.com/atsampson/util-linux
Karel Zak [Tue, 26 May 2026 09:32:56 +0000 (11:32 +0200)] 
Merge branch 'smartcols-test' of https://github.com/atsampson/util-linux

* 'smartcols-test' of https://github.com/atsampson/util-linux:
  tests: test_scols_termreduce needs libsmartcols

11 days agoMerge branch 'PR/agetty-split' of https://github.com/karelzak/util-linux-work
Karel Zak [Tue, 26 May 2026 09:29:46 +0000 (11:29 +0200)] 
Merge branch 'PR/agetty-split' of https://github.com/karelzak/util-linux-work

* 'PR/agetty-split' of https://github.com/karelzak/util-linux-work: (24 commits)
  agetty: guard conditional function declarations in header
  agetty: fix path_cxt leak in credential loading
  agetty: move fakehost to struct agetty_options
  agetty: make longopts[] static const
  agetty: move usage() and parse_args() before main()
  agetty: clean up includes in agetty.c
  agetty: add public domain header to all source files
  agetty: remove duplicate ISSUEDIR_EXT from agetty.c
  agetty: move login argv initialization to utils.c
  agetty: move username to struct agetty_options
  agetty: move parse_speeds() to utils.c
  agetty: move init_special_char() to utils.c
  agetty: move FIRST_SPEED to tty.c
  agetty: use bool for struct agetty_issue bitfields
  agetty: split out issue file functions to issuefile.c
  agetty: move struct issue and related defines to agetty.h
  agetty: split out terminal functions to tty.c
  agetty: split out speed table and baud code to tty.c
  agetty: move utility functions to utils.c
  agetty: split out credential loading to credentials.c
  ...

11 days agotests: (lsmem) add aarch64 memory block layout dump
Christian Goeschel Ndjomouo [Tue, 26 May 2026 01:12:16 +0000 (21:12 -0400)] 
tests: (lsmem) add aarch64 memory block layout dump

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
11 days agotests: (blockdev) add missing tests
Christian Goeschel Ndjomouo [Thu, 14 May 2026 17:07:07 +0000 (13:07 -0400)] 
tests: (blockdev) add missing tests

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
12 days agopipesz: merge help/version getopt loop into main loop
Karel Zak [Mon, 25 May 2026 11:33:34 +0000 (13:33 +0200)] 
pipesz: merge help/version getopt loop into main loop

The main() function scanned command-line options in two passes: the
first pass checked for --help/--version, and the second processed
normal options. When getopt_long encountered an unknown option in the
first pass, it printed an error message. The same error was then
printed again during the second pass, resulting in a duplicate
"unrecognized option" message.

Fix this by merging the first getopt_long loop into the main one,
following the standard util-linux convention.

Fixes: https://github.com/util-linux/util-linux/issues/3817
Signed-off-by: Karel Zak <kzak@redhat.com>
12 days agochrt: Add uclamp reset support via -1 sentinel
Furkan Caliskan [Fri, 15 May 2026 05:37:25 +0000 (08:37 +0300)] 
chrt: Add uclamp reset support via -1 sentinel

Passing -1 to --clamp-min or --clamp-max sets the corresponding
sched_attr field to UINT32_MAX, which tells the kernel to reset
the utilization clamp to its system default. Resetting requires
kernel >= 5.11, otherwise the syscall will fail with EINVAL.

Closes: https://github.com/util-linux/util-linux/issues/4339
Suggested-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
Signed-off-by: Furkan Caliskan <frn1furkan10@gmail.com>
12 days agoadd emummc partition type
Lex [Sat, 23 May 2026 12:08:43 +0000 (13:08 +0100)] 
add emummc partition type

13 days agolibuuid: fix build with gcc-14 on macOS
Sergey Fedorov [Sun, 24 May 2026 10:57:50 +0000 (18:57 +0800)] 
libuuid: fix build with gcc-14 on macOS

Fixes: https://github.com/util-linux/util-linux/issues/4368
2 weeks agoagetty: guard conditional function declarations in header
Karel Zak [Wed, 20 May 2026 10:44:21 +0000 (12:44 +0200)] 
agetty: guard conditional function declarations in header

Wrap agetty_update_utmp() declaration with #ifdef SYSV_STYLE and
agetty_issue_is_changed()/agetty_reload() with #ifdef AGETTY_RELOAD
to match the guards on their definitions.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 weeks agoagetty: fix path_cxt leak in credential loading
Karel Zak [Wed, 20 May 2026 10:44:11 +0000 (12:44 +0200)] 
agetty: fix path_cxt leak in credential loading

The ul_new_path() result was never freed. Use goto to ensure
ul_unref_path() is called on all exit paths.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 weeks agoMerge branch 'bsd-4-to-3-clause' of https://github.com/ionmeo/util-linux
Karel Zak [Wed, 20 May 2026 10:21:35 +0000 (12:21 +0200)] 
Merge branch 'bsd-4-to-3-clause' of https://github.com/ionmeo/util-linux

* 'bsd-4-to-3-clause' of https://github.com/ionmeo/util-linux:
  license: switch from BSD 4-clause to 3-clause

2 weeks agoMerge branch 'PR/libblkid-dasd' of https://github.com/karelzak/util-linux-work
Karel Zak [Wed, 20 May 2026 10:09:01 +0000 (12:09 +0200)] 
Merge branch 'PR/libblkid-dasd' of https://github.com/karelzak/util-linux-work

* 'PR/libblkid-dasd' of https://github.com/karelzak/util-linux-work:
  libblkid: (dasd) remove unnecessary 'rc' variable
  libblkid: (dasd) guard against uint64 underflow in LDL size calculation
  libblkid: (dasd) add buffer size guards to helper functions
  libblkid: (dasd) use rtrim_whitespace() for EBCDIC string trimming

2 weeks agoMerge branch 'tests/cramfs_fix_umask' of https://github.com/lRespublica/util-linux
Karel Zak [Wed, 20 May 2026 10:01:10 +0000 (12:01 +0200)] 
Merge branch 'tests/cramfs_fix_umask' of https://github.com/lRespublica/util-linux

* 'tests/cramfs_fix_umask' of https://github.com/lRespublica/util-linux:
  tests: (cramfs) restore umask after creating test input files

2 weeks agolsfd: (tests) drop suffix variable in lsfd_check_sockdiag
Thomas Weißschuh [Wed, 20 May 2026 07:54:36 +0000 (09:54 +0200)] 
lsfd: (tests) drop suffix variable in lsfd_check_sockdiag

It is not used anymore.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 weeks agotests: use ts_skip_config where appropriate
Thomas Weißschuh [Tue, 19 May 2026 20:52:42 +0000 (22:52 +0200)] 
tests: use ts_skip_config where appropriate

Replace the open-coded implementations with the proper helper.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 weeks agotests: fold ts_failed_subtest into ts_failed
Thomas Weißschuh [Tue, 19 May 2026 20:54:44 +0000 (22:54 +0200)] 
tests: fold ts_failed_subtest into ts_failed

The differences between ts_failed_subtest and ts_failed are miniminal.
Make ts_failed usable from subtest context and remove the now unnecessary
ts_failed_subtest.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 weeks agotests: fold ts_skip_subtest into ts_skip
Thomas Weißschuh [Tue, 19 May 2026 20:46:01 +0000 (22:46 +0200)] 
tests: fold ts_skip_subtest into ts_skip

The differences between ts_skip_subtest and ts_skip are miniminal.
Make ts_skip usable from subtest context and remove the now unnecessary
ts_skip_subtest.

This allows subtests to make use of all of the convenient helpers built
around ts_skip.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 weeks agolibmount: (tests) skip btrfs test if btrfs support is not enabled
Thomas Weißschuh [Mon, 18 May 2026 16:09:45 +0000 (18:09 +0200)] 
libmount: (tests) skip btrfs test if btrfs support is not enabled

btrfs support in libmount is optional. If it is not enabled, the test
will fail. Skip the test in that case.

Fixes: 4583d15248fd ("tests: add btrfs RAID is-mounted test for libmount")
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 weeks agotests: (cramfs) restore umask after creating test input files
Leonid Znamenok [Tue, 19 May 2026 18:41:57 +0000 (22:41 +0400)] 
tests: (cramfs) restore umask after creating test input files

The cramfs doubles/mkfs/mkfs-endianness tests set "umask 133" to get
deterministic permission bits on the test input files. The umask was
never restored, so it stayed in effect for every command run later in
the test, including the build-tree mount/umount/mkfs.cramfs helpers.

When such a helper is a libtool wrapper script that has to relink its
real binary on first use (fast_install=yes), the relink runs under the
leaked umask 133 and the resulting .libs/lt-* binary is created without
execute bits (mode 0644). The wrapper then fails to exec it with
"Permission denied" (EACCES). Because the broken binary is cached, every
subsequent test using that helper fails as well:

exec: .../.libs/lt-mount: cannot execute: Permission denied

Save and restore the umask so it only covers creation of the test input
files and does not affect helper invocations.

2 weeks agopam_lastlog2: fix libpam linking in autotools build
Karel Zak [Tue, 19 May 2026 08:54:57 +0000 (10:54 +0200)] 
pam_lastlog2: fix libpam linking in autotools build

Move -lpam from LDFLAGS to LIBADD. When -lpam is in LDFLAGS it
appears on the linker command line before object files, so the
--as-needed linker flag (default on Fedora) discards it before
seeing any undefined PAM symbols. This results in pam_lastlog2.so
missing libpam.so in its ELF NEEDED entries.

The module then fails to load with dlopen() if the calling process
does not itself link against libpam (e.g., systemd in Fedora 44+):

  PAM unable to dlopen(pam_lastlog2.so): undefined symbol: pam_syslog

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2453457
Signed-off-by: Karel Zak <kzak@redhat.com>
2 weeks agolibblkid: (dasd) remove unnecessary 'rc' variable
Karel Zak [Tue, 19 May 2026 08:28:21 +0000 (10:28 +0200)] 
libblkid: (dasd) remove unnecessary 'rc' variable

Return probe results directly instead of storing in an
intermediate variable.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 weeks agolibblkid: (dasd) guard against uint64 underflow in LDL size calculation
Karel Zak [Tue, 19 May 2026 08:18:44 +0000 (10:18 +0200)] 
libblkid: (dasd) guard against uint64 underflow in LDL size calculation

When an LDL volume label has ldl_version < 0xf2, the partition
size is derived from the device size. If the device is smaller
than the partition start offset (3 blocks), the subtraction
wraps around producing a bogus partition size.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 weeks agolibblkid: (dasd) add buffer size guards to helper functions
Karel Zak [Tue, 19 May 2026 08:12:41 +0000 (10:12 +0200)] 
libblkid: (dasd) add buffer size guards to helper functions

Add explicit buffer size parameters to dasd_get_volser(),
dasd_get_dsnam(), is_dasd_cdl_label(), is_dasd_ldl_label()
and is_dasd_f4_label() so that these functions can protect
against buffer overflows without relying on callers to pass
correctly sized buffers.

The conversion functions still follow the DASD standard field
sizes (DASD_VOLSER_LENGTH, sizeof DS1DSNAM), but clamp to the
buffer size as a safety net. The label detection functions
derive their minimum sizes from the actual struct offsets and
magic constants rather than hardcoded numbers.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 weeks agolibblkid: (dasd) use rtrim_whitespace() for EBCDIC string trimming
Karel Zak [Tue, 19 May 2026 07:49:32 +0000 (09:49 +0200)] 
libblkid: (dasd) use rtrim_whitespace() for EBCDIC string trimming

Replace hand-rolled trailing-space trim loops in dasd_get_volser()
and dasd_get_dsnam() with rtrim_whitespace() from strutils.h.

The original dasd_get_volser() loop had no lower-bound guard and
would read out-of-bounds if all VOLSER bytes were spaces.

Addresses: https://github.com/util-linux/util-linux/pull/4096

Signed-off-by: Karel Zak <kzak@redhat.com>
2 weeks agoMerge branch 'master_libblkid-dasd-support' of https://github.com/vojtechtrefny/util...
Karel Zak [Tue, 19 May 2026 08:31:52 +0000 (10:31 +0200)] 
Merge branch 'master_libblkid-dasd-support' of https://github.com/vojtechtrefny/util-linux

* 'master_libblkid-dasd-support' of https://github.com/vojtechtrefny/util-linux:
  libblkid: Add support for DASD partition table

2 weeks agotests: test_scols_termreduce needs libsmartcols
Adam Sampson [Mon, 18 May 2026 13:41:40 +0000 (14:41 +0100)] 
tests: test_scols_termreduce needs libsmartcols

This helper needs libsmartcols, so it can't be built if util-linux is
configured with --disable-libsmartcols. (It's still reasonable to want
to run the test suite in this case, for example if you're configuring
util-linux to only build libuuid.)

Signed-off-by: Adam Sampson <ats@offog.org>
2 weeks agoMerge branch 'macos' of https://github.com/t-8ch/util-linux
Karel Zak [Mon, 18 May 2026 09:59:17 +0000 (11:59 +0200)] 
Merge branch 'macos' of https://github.com/t-8ch/util-linux

* 'macos' of https://github.com/t-8ch/util-linux:
  ci: add a macos workflow
  test_threads_create: add a macOS fallback
  meson: gate test_child_create on sys/prctl.h
  ctrlaltdel: pass correct integer types to printf
  meson: gate irqtop on sys/epoll.h and cpu_set_t
  meson: gate lsirq on cpu_set_t
  meson: gate lsipc on LINUX
  meson: gate pivot_root on LINUX
  meson: gate lscpu on LINUX and cpu_set_t
  meson: add build-lscpu option

2 weeks agoMerge branch 'getino_tests_v2' of https://github.com/cgoesche/util-linux-fork
Karel Zak [Mon, 18 May 2026 09:39:23 +0000 (11:39 +0200)] 
Merge branch 'getino_tests_v2' of https://github.com/cgoesche/util-linux-fork

* 'getino_tests_v2' of https://github.com/cgoesche/util-linux-fork:
  tests: (getino) minor code simplification

2 weeks agoMerge branch 'fincore_test' of https://github.com/cgoesche/util-linux-fork
Karel Zak [Mon, 18 May 2026 09:36:24 +0000 (11:36 +0200)] 
Merge branch 'fincore_test' of https://github.com/cgoesche/util-linux-fork

* 'fincore_test' of https://github.com/cgoesche/util-linux-fork:
  tests: (fincore) add --cachestat option test
  fincore: define HAVE_CACHESTAT on fallback

2 weeks agoreadprofile: (man) clarify not designed for privilege-elevation use
Karel Zak [Mon, 18 May 2026 08:45:20 +0000 (10:45 +0200)] 
readprofile: (man) clarify not designed for privilege-elevation use

Add a note to the DESCRIPTION that readprofile is a diagnostic tool
not intended for security-sensitive contexts (setuid, setgid, sudo).
Remove the suggestion to make readprofile set-user-ID 0 from the -r
option, and drop sudo from the example.

3 weeks agolicense: switch from BSD 4-clause to 3-clause
ionmeo [Wed, 13 May 2026 15:57:11 +0000 (11:57 -0400)] 
license: switch from BSD 4-clause to 3-clause

Remove the advertising clause (clause 3) and renumber the
non-endorsement clause from 4 to 3 in all files containing the
BSD 4-clause license, following the notice issued by UC Berkeley
(quoted below).

Additional changes:
- Add SPDX-License-Identifier: BSD-3-Clause to each affected file.
- Remove the BSD-4-Clause-UC entry from README.licensing.
- Delete Documentation/licenses/COPYING.BSD-4-Clause-UC.

Reference:
https://ipira.berkeley.edu/sites/default/files/amendment_of_4-clause_bsd_software_license.pdf

Relevant text:

    January 31, 2012

    To all licensees, and distributors of software officially
    licensed under a UC Berkeley version of the BSD license:

    As you may know, certain software officially licensed by UC
    Berkeley using the original 4-clause BSD license required that
    further distributions of products containing all or portions of
    the software acknowledge within their advertising materials that
    such products contain software developed by UC Berkeley and its
    contributors.

    Specifically, the provision reads:

        "3. All advertising materials mentioning features or use of
        this software must display the following acknowledgement:
        This product includes software developed by the University
        of California, Berkeley and its contributors."

    Effective immediately, licensees and distributors are no longer
    required to include the acknowledgement within advertising
    materials. Accordingly, the advertising clause 3 of the original
    4-clause BSD license for any and all software officially licensed
    by UC Berkeley, is hereby deleted in its entirety.

    Michael Katz
    Executive Director
    Intellectual Property and Industry Research Alliances
    University of California, Berkeley

3 weeks agoUpdate schedutils/chrt.c
1frn10 [Thu, 14 May 2026 18:36:19 +0000 (21:36 +0300)] 
Update schedutils/chrt.c

Co-authored-by: Christian Goeschel Ndjomouo <162830835+cgoesche@users.noreply.github.com>
3 weeks agoUpdate schedutils/chrt.c
1frn10 [Thu, 14 May 2026 18:35:37 +0000 (21:35 +0300)] 
Update schedutils/chrt.c

Co-authored-by: Christian Goeschel Ndjomouo <162830835+cgoesche@users.noreply.github.com>
3 weeks agotests: (getino) minor code simplification
Christian Goeschel Ndjomouo [Wed, 13 May 2026 22:12:33 +0000 (18:12 -0400)] 
tests: (getino) minor code simplification

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
3 weeks agochrt: Add support for SCHED_FLAG_UTIL_CLAMP
Furkan Caliskan [Thu, 14 May 2026 11:52:22 +0000 (14:52 +0300)] 
chrt: Add support for SCHED_FLAG_UTIL_CLAMP

The SCHED_FLAG_UTIL_CLAMP_MIN and SCHED_FLAG_UTIL_CLAMP_MAX flags
allow users to set utilization hints for tasks. The minimum clamp
tells the scheduler to place the task on a CPU with enough capacity,
while the maximum clamp prevents unnecessary CPU frequency boosting.
Both accept a value in the range 0-1024, where 1024 represents 100%
of maximum CPU capacity. Mainly useful on heterogeneous systems.

Add -U/--clamp-min and -X/--clamp-max options to allow users to
set these hints for any scheduling policy.

Closes: https://github.com/util-linux/util-linux/issues/4339
Signed-off-by: Furkan Caliskan <frn1furkan10@gmail.com>
3 weeks agotests: (fincore) add --cachestat option test
Christian Goeschel Ndjomouo [Sun, 3 May 2026 01:04:06 +0000 (21:04 -0400)] 
tests: (fincore) add --cachestat option test

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
3 weeks agoci: add a macos workflow
Thomas Weißschuh [Sun, 12 Apr 2026 06:01:51 +0000 (08:01 +0200)] 
ci: add a macos workflow

Some users want to build parts of util-linux on macOS.
Add a workflow to make sure this works.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
3 weeks agotest_threads_create: add a macOS fallback
Thomas Weißschuh [Wed, 13 May 2026 13:56:09 +0000 (15:56 +0200)] 
test_threads_create: add a macOS fallback

SYS_gettid is Linux-specific. Add a fallback for macOS.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
3 weeks agomeson: gate test_child_create on sys/prctl.h
Thomas Weißschuh [Wed, 13 May 2026 13:48:34 +0000 (15:48 +0200)] 
meson: gate test_child_create on sys/prctl.h

The target needs this header, encode this in the build system.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
3 weeks agoctrlaltdel: pass correct integer types to printf
Thomas Weißschuh [Wed, 22 Apr 2026 21:40:51 +0000 (23:40 +0200)] 
ctrlaltdel: pass correct integer types to printf

The printf format %ju expects an 'uintmax_t'. Cast the value to make
sure the correct type is passed.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
3 weeks agomeson: gate irqtop on sys/epoll.h and cpu_set_t
Thomas Weißschuh [Wed, 29 Apr 2026 12:05:53 +0000 (14:05 +0200)] 
meson: gate irqtop on sys/epoll.h and cpu_set_t

The target needs these, encode this in the build system.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
3 weeks agomeson: gate lsirq on cpu_set_t
Thomas Weißschuh [Wed, 29 Apr 2026 12:07:56 +0000 (14:07 +0200)] 
meson: gate lsirq on cpu_set_t

The target needs this type, encode this in the build system.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
3 weeks agomeson: gate lsipc on LINUX
Thomas Weißschuh [Wed, 29 Apr 2026 12:30:00 +0000 (14:30 +0200)] 
meson: gate lsipc on LINUX

This tool uses Linux-specific API, encode this in the build system.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
3 weeks agomeson: gate pivot_root on LINUX
Thomas Weißschuh [Wed, 29 Apr 2026 11:56:11 +0000 (13:56 +0200)] 
meson: gate pivot_root on LINUX

This tool uses Linux-specific API, encode this in the build system.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
3 weeks agomeson: gate lscpu on LINUX and cpu_set_t
Thomas Weißschuh [Wed, 29 Apr 2026 11:37:45 +0000 (13:37 +0200)] 
meson: gate lscpu on LINUX and cpu_set_t

This tool uses Linux-specific API and cpu_set_t,
encode this in the build system.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
3 weeks agomeson: add build-lscpu option
Thomas Weißschuh [Wed, 29 Apr 2026 11:36:32 +0000 (13:36 +0200)] 
meson: add build-lscpu option

Allow the build of the target to be disabled by the user and also enable
the addition of platform restrictions.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
3 weeks agoagetty: move fakehost to struct agetty_options
Karel Zak [Thu, 14 May 2026 10:13:39 +0000 (12:13 +0200)] 
agetty: move fakehost to struct agetty_options

Move the file-scope fakehost variable into struct agetty_options
and drop the separate fakehost parameter from agetty_update_utmp()
and agetty_init_login_argv().

Signed-off-by: Karel Zak <kzak@redhat.com>
3 weeks agoagetty: make longopts[] static const
Karel Zak [Thu, 14 May 2026 10:07:23 +0000 (12:07 +0200)] 
agetty: make longopts[] static const

The getopt long options array is read-only, use static const
to avoid re-initializing it on every parse_args() call.

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