Karel Zak [Mon, 27 Apr 2026 11:09:43 +0000 (13:09 +0200)]
Merge branch 'PR/agetty-credentials' of https://github.com/karelzak/util-linux-work
* 'PR/agetty-credentials' of https://github.com/karelzak/util-linux-work:
agetty: add support for more systemd credentials
agetty: add cred_read_bool() for credential boolean parsing
agetty: add cred_read_num() for credential numeric parsing
agetty: add cred_read_str() for credential string parsing
Karel Zak [Mon, 27 Apr 2026 10:34:50 +0000 (12:34 +0200)]
Merge branch 'manpages_term_consistency' of https://github.com/cgoesche/util-linux-fork
* 'manpages_term_consistency' of https://github.com/cgoesche/util-linux-fork:
man: use the term 'calling process' instead of 'current process'
man: use the term unprivileged instead of non-root
man: (mount) fix minor term inconsistency
man: use symbolic link instead of symlink
man: use superblock term consistently
man: use the term 'real-time' more consistently
man: use 'pseudoterminal' instead of 'pseudo[- ]terminal'
man: use 'pathname' instead of 'path name'
man: use 'nonzero' instead of 'non-zero'
man: use 'uppercase' instead of 'upper case'
man: use 'lowercase' instead of 'lower case'
man: (lastlog) fix minor wording inconsistency
man: use 'filesystem(s)' instead of 'file system(s)'
man: use 'filename(s)' instead of 'file name(s)'
man: use 'Epoch' instead of 'epoch'
man: use 'built-in' instead of 'builtin'
man: use 'bit mask' instead of 'bitmask'
Karel Zak [Mon, 27 Apr 2026 09:37:19 +0000 (11:37 +0200)]
Merge branch 'fix/4157' of https://github.com/echoechoin/util-linux
* 'fix/4157' of https://github.com/echoechoin/util-linux:
liblastlog2: declare variables at the top of the block
liblastlog2: register journal mode man pages in build system
lastlog2: add --journal option to manage SQLite journal mode
liblastlog2: add support for WAL journal mode
Alessandro Ratti [Fri, 27 Mar 2026 14:40:49 +0000 (15:40 +0100)]
lsblk: move source files to dedicated lsblk-cmd/ directory
Move all lsblk source files from misc-utils/ to a dedicated
lsblk-cmd/ directory, following the pattern established by lsfd-cmd/.
Update both autotools and meson build systems accordingly.
lastlog2: add --journal option to manage SQLite journal mode
Add -j/--journal option to the lastlog2 command to allow users to
view and set the SQLite journal mode. Without an argument, it displays
the current mode. With an argument, it sets the mode to the specified
value (WAL, DELETE, TRUNCATE, PERSIST, MEMORY, OFF).
The option supports flexible argument formats:
- Short option with space: -j WAL
- Short option without space: -jWAL
- Long option with equals: --journal=WAL
Also update bash-completion to provide journal mode suggestions and
add documentation to the man page with usage examples.
Add ll2_set_journal_mode() and ll2_get_journal_mode() functions to
allow setting and querying SQLite journal modes. This enables users
to switch to WAL (Write-Ahead Logging) mode for better concurrency
in high-traffic scenarios.
WAL mode allows readers and writers to operate concurrently without
blocking each other, significantly reducing database lock contention
in environments with frequent SSH logins.
The journal mode setting is persistent and only needs to be set once
per database.
Karel Zak [Wed, 15 Apr 2026 13:53:56 +0000 (15:53 +0200)]
libblkid: nilfs: fix byte order and block size validation
Fix s_dev_size comparison to use le64_to_cpu() for big-endian
architectures. Tighten s_log_block_size check to match kernel limit
(NILFS_MAX_BLOCK_SIZE=65536, max shift 6).
Karel Zak [Wed, 15 Apr 2026 13:48:09 +0000 (15:48 +0200)]
libblkid: udf: cap descriptor sequence iteration count
The descriptor count is derived from attacker-controlled anchor length
and has no upper bound. Cap at 64 -- a UDF volume descriptor sequence
contains only a handful of descriptors (PVD, LVD, USD, IUVD, TD, ...),
similar to the kernel's UDF_MAX_TD_NESTING limit in fs/udf/super.c.
Karel Zak [Wed, 22 Apr 2026 10:23:37 +0000 (12:23 +0200)]
agetty: add cred_read_bool() for credential boolean parsing
Introduce cred_read_bool() helper that reads a systemd credential
file and parses the value as a boolean using ul_strtobool(). The
invert argument allows handling "noissue"-style credentials where
true means the flag should be cleared rather than set.
Addresses: https://github.com/util-linux/util-linux/issues/2255 Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Wed, 22 Apr 2026 10:21:50 +0000 (12:21 +0200)]
agetty: add cred_read_num() for credential numeric parsing
Introduce cred_read_num() helper that reads a systemd credential
file and parses the value as a number. The type argument selects
between unsigned ('u') and signed ('d') parsing, making it easy
to extend for other numeric types in the future.
Addresses: https://github.com/util-linux/util-linux/issues/2255 Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Wed, 22 Apr 2026 10:18:08 +0000 (12:18 +0200)]
agetty: add cred_read_str() for credential string parsing
Introduce cred_read_str() helper that reads a systemd credential
file and stores the string value into a struct member addressed
via offsetof(). This replaces the open-coded string credential
handling and prepares for adding more credential types.
Addresses: https://github.com/util-linux/util-linux/issues/2255 Signed-off-by: Karel Zak <kzak@redhat.com>
lslogins: use new lib functions for user/group name parsing
This patch makes use of the new ul_get{grp,userpw}_str lib
functions to parse user/group names passed to the --logins
and --groups options. The use of these functions simplifies
the code base and makes str_to_uint() useless, therefore we
can remove it.
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
- Remove extra newline in errx messages
- Use fprintf/exit for usage to avoid repeated program name
- Improve signal safety by using appropriate functions
This code is not installed, thus no functional change in final
installation of util-linux.
Karel Zak [Tue, 21 Apr 2026 11:15:38 +0000 (13:15 +0200)]
Merge branch 'fallocate_checks' of https://github.com/stoeckmann/util-linux
* 'fallocate_checks' of https://github.com/stoeckmann/util-linux:
fallocate: Add range check
fallocate: Improve argument range check
fallocate: Use off_t instead of loff_t
fallocate: Remove outdated copyright statement
fallocate: Use correct formatters and casts
Cast off_t for F_ADDRESS to long long. In most cases, this should be
actually unsigned long long due to %llx or %llo, but since %lld is also
available and off_t is signed, keep it at that.
In theory, this might fix very intelligent static analysers which notice
that off_t is long int but %ll expects long long, but in reality, this
fixes 32 bit off_t builds. Without this, wrong addresses are shown.
Eventually, the loff_t values are used as arguments for functions which
expect an off_t. Use off_t directly and, while at it, introduce a proper
range check in cvtnum.
Check st.st_size (off_t) for actual file size instead of the possibly
already truncated entry->size (unsigned int) value. Otherwise files
larger than 4 GB might be silently truncated.
libblkid: introduce sysfs_devno_is_dm_hidden() for pre-open check
Stratis reuses the DM "private" UUID convention ("stratis-1-private")
but its devices are legitimately opened by tools like mkfs.xfs to
obtain device geometry. The pre-open check added in the previous
commit (d05a84b22) used sysfs_devno_is_dm_private() which also
blocks Stratis devices, breaking mkfs.xfs on Stratis pools.
Introduce sysfs_devno_is_dm_hidden() which only checks for LVM
internal devices (the "LVM-<uuid>-<name>" UUID pattern). A "hidden"
DM device is one that exists solely as a building block for another
DM target -- no user-space tool should normally open or write to it.
Use sysfs_devno_is_dm_hidden() in blkid_new_probe_from_filename()
so that Stratis devices remain accessible while LVM internal devices
are still skipped before open().
Karel Zak [Thu, 16 Apr 2026 12:59:33 +0000 (14:59 +0200)]
Merge branch 'copyfilerange_syscall_fallback' of https://github.com/cgoesche/util-linux-fork
* 'copyfilerange_syscall_fallback' of https://github.com/cgoesche/util-linux-fork:
build: (copyfilerange) include syscall header check for fallback
style: (misc-utils/copyfilerange.c) fix indentation
include: (fileutils.h) add fallback for the copy_file_range syscall