]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
5 days agolslogins: remove duplicate errno initialization
Christian Goeschel Ndjomouo [Fri, 28 Nov 2025 06:17:03 +0000 (01:17 -0500)] 
lslogins: remove duplicate errno initialization

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
6 days agoeject: fix const qualifier warning in read_speed
Karel Zak [Thu, 27 Nov 2025 15:50:19 +0000 (16:50 +0100)] 
eject: fix const qualifier warning in read_speed

Fix const qualifier discarded warning in read_speed().
This warning is reported by gcc 15 which defaults to the C23 standard.

The strrchr() function returns a pointer into a const string, so the
receiving variable must be declared as const char *.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 days agopartx: fix const qualifier warning in get_max_partno
Karel Zak [Thu, 27 Nov 2025 15:48:53 +0000 (16:48 +0100)] 
partx: fix const qualifier warning in get_max_partno

Fix const qualifier discarded warning in get_max_partno().
This warning is reported by gcc 15 which defaults to the C23 standard.

The strrchr() function returns a pointer into a const string, so the
receiving variable must be declared as const char *.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 days agoenosys: fix const qualifier warning in parse_block
Karel Zak [Thu, 27 Nov 2025 15:47:46 +0000 (16:47 +0100)] 
enosys: fix const qualifier warning in parse_block

Fix const qualifier discarded warning in parse_block().
This warning is reported by gcc 15 which defaults to the C23 standard.

The strchr() function returns a pointer into a const string, so the
receiving variable must be declared as const char *.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 days agowhereis: fix const qualifier warnings for C23
Karel Zak [Thu, 27 Nov 2025 15:46:22 +0000 (16:46 +0100)] 
whereis: fix const qualifier warnings for C23

Fix const qualifier discarded warnings in dirlist_add_subdir() and
lookup() functions. These warnings are reported by gcc 15 which
defaults to the C23 standard.

The strchr() and strrchr() functions return pointers into const strings,
so the receiving variables must be declared as const char *.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 days agonamei: fix const qualifier warning in readlink_to_namei
Karel Zak [Thu, 27 Nov 2025 15:44:47 +0000 (16:44 +0100)] 
namei: fix const qualifier warning in readlink_to_namei

Fix const qualifier discarded warning in readlink_to_namei().
This warning is reported by gcc 15 which defaults to the C23 standard.

The strrchr() function returns a pointer into a const string, so the
receiving variable must be declared as const char *.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 days agologger: fix const qualifier warnings for C23
Karel Zak [Thu, 27 Nov 2025 15:43:38 +0000 (16:43 +0100)] 
logger: fix const qualifier warnings for C23

Fix const qualifier discarded warnings in valid_structured_data_param()
and valid_structured_data_id() functions. These warnings are reported by
gcc 15 which defaults to the C23 standard.

The strchr() and strstr() functions return pointers into const strings,
so the receiving variables must be declared as const char *.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 days agolsfd: fix const qualifier warning in strnrstr
Karel Zak [Thu, 27 Nov 2025 15:38:18 +0000 (16:38 +0100)] 
lsfd: fix const qualifier warning in strnrstr

Fix const qualifier discarded warning in strnrstr().
This warning is reported by gcc 15 which defaults to the C23 standard.

The function returns a non-const pointer into the haystack parameter,
and callers modify the string through that pointer. Therefore, the
haystack parameter should be char * rather than const char *.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 days agolsfd: fix const qualifier warning in new_counter_spec
Karel Zak [Thu, 27 Nov 2025 15:35:56 +0000 (16:35 +0100)] 
lsfd: fix const qualifier warning in new_counter_spec

Fix const qualifier discarded warning in new_counter_spec().
This warning is reported by gcc 15 which defaults to the C23 standard.

The function modifies the input string by inserting a null terminator
to split it into name and expression parts, so the parameter should
be char * rather than const char *.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 days agodmesg: fix const qualifier warnings in parse_callerid
Karel Zak [Thu, 27 Nov 2025 15:33:04 +0000 (16:33 +0100)] 
dmesg: fix const qualifier warnings in parse_callerid

Fix const qualifier discarded warnings in parse_callerid().
These warnings are reported by gcc 15 which defaults to the C23 standard.

The strchr() and strstr() functions return pointers into const strings,
so the receiving variables must be declared as const char *.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 days agolibblkid: fix const qualifier warning in blkid_parse_tag_string
Karel Zak [Thu, 27 Nov 2025 15:28:41 +0000 (16:28 +0100)] 
libblkid: fix const qualifier warning in blkid_parse_tag_string

Fix const qualifier discarded warning in blkid_parse_tag_string().
This warning is reported by gcc 15 which defaults to the C23 standard.

The strchr() function returns a pointer into a const string, so
introduce a separate 'eq' variable to hold this const pointer for
finding the '=' separator. Also move the 'cp' variable declaration
into the block where it's actually used for quote handling.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 days agolibmount: fix const qualifier warning in mnt_parse_mountinfo_line
Karel Zak [Thu, 27 Nov 2025 15:24:11 +0000 (16:24 +0100)] 
libmount: fix const qualifier warning in mnt_parse_mountinfo_line

Fix const qualifier discarded warning in mnt_parse_mountinfo_line().
This warning is reported by gcc 15 which defaults to the C23 standard.

The strstr() function returns a pointer into a const string, so
introduce a separate 'sep' variable to hold this const pointer,
keeping 'p' for non-const unmangle() results that need to be freed.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 days agolibmount: fix const qualifier warnings for C23
Karel Zak [Thu, 27 Nov 2025 14:45:55 +0000 (15:45 +0100)] 
libmount: fix const qualifier warnings for C23

Fix const qualifier discarded warnings in optlist_add_flags(),
mnt_opt_value_with(), and mnt_optstr_apply_flags() functions.
These warnings are reported by gcc 15 which defaults to the C23 standard.

The strchr() and strstr() functions return pointers into const strings,
so the receiving variables must be declared as const char *.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 days agolsns: fix const qualifier warnings for C23
Karel Zak [Thu, 27 Nov 2025 14:41:21 +0000 (15:41 +0100)] 
lsns: fix const qualifier warnings for C23

Fix const qualifier discarded warnings in read_persistent_namespaces()
and is_path_included() functions. These warnings are reported by gcc 15
which defaults to the C23 standard.

The strchr() and strstr() functions return pointers into const strings,
so the receiving variables must be declared as const char *.

Signed-off-by: Karel Zak <kzak@redhat.com>
6 days agoMerge branch 'PR/build-bsearch-const' of https://github.com/karelzak/util-linux-work
Karel Zak [Thu, 27 Nov 2025 11:40:16 +0000 (12:40 +0100)] 
Merge branch 'PR/build-bsearch-const' of https://github.com/karelzak/util-linux-work

* 'PR/build-bsearch-const' of https://github.com/karelzak/util-linux-work:
  lib, lscpu: fix const qualifier discarded warnings in bsearch

6 days agoMerge branch 'lsfd--tun-netns' of https://github.com/masatake/util-linux
Karel Zak [Thu, 27 Nov 2025 09:32:15 +0000 (10:32 +0100)] 
Merge branch 'lsfd--tun-netns' of https://github.com/masatake/util-linux

* 'lsfd--tun-netns' of https://github.com/masatake/util-linux:
  lsfd: add TUN.DEVNETNS column
  tests: (lsfd::mkfds-cdev-tun,refactor) make the case extensible
  lsfd: (doc) fix English in SOCK.NETNS description
  lsfd: (cleanup) add missing "break" in a case statement
  lsfd: (cleanup) return 0 instead of false
  lsfd: (refactor) introduce tundata struct

6 days agoMerge branch 'drop-const' of https://github.com/DaanDeMeyer/util-linux
Karel Zak [Thu, 27 Nov 2025 09:30:59 +0000 (10:30 +0100)] 
Merge branch 'drop-const' of https://github.com/DaanDeMeyer/util-linux

* 'drop-const' of https://github.com/DaanDeMeyer/util-linux:
  blkid: Drop const from blkid_partitions_get_name()

6 days agolib, lscpu: fix const qualifier discarded warnings in bsearch
Karel Zak [Thu, 27 Nov 2025 09:27:07 +0000 (10:27 +0100)] 
lib, lscpu: fix const qualifier discarded warnings in bsearch

Fix compilation warnings from newer compilers with stricter
const-correctness checks. When bsearch() searches in const arrays,
the result pointer must also be const to avoid discarding the
const qualifier.

Fixed in:
- lib/color-names.c: searching in static const basic_schemes[]
- sys-utils/lscpu-cputype.c: searching in const pattern arrays

The warnings were:
  lib/color-names.c:62:13: error: assignment discards 'const'
  qualifier from pointer target type
  [-Werror=discarded-qualifiers]

Signed-off-by: Karel Zak <kzak@redhat.com>
6 days agoMerge branch 'docs--how-contribute' of https://github.com/masatake/util-linux
Karel Zak [Thu, 27 Nov 2025 09:10:37 +0000 (10:10 +0100)] 
Merge branch 'docs--how-contribute' of https://github.com/masatake/util-linux

* 'docs--how-contribute' of https://github.com/masatake/util-linux:
  docs: write about EditorConfig

7 days agoblkid: Drop const from blkid_partitions_get_name()
Daan De Meyer [Wed, 26 Nov 2025 14:08:25 +0000 (15:08 +0100)] 
blkid: Drop const from blkid_partitions_get_name()

const for idx is useless as the value is copied anyway, so drop the
const. AFAIK this doesn't change ABI.

7 days agoMerge branch 'fix/inconsistent_bash_completions' of https://github.com/cgoesche/util...
Karel Zak [Wed, 26 Nov 2025 10:46:55 +0000 (11:46 +0100)] 
Merge branch 'fix/inconsistent_bash_completions' of https://github.com/cgoesche/util-linux-fork

* 'fix/inconsistent_bash_completions' of https://github.com/cgoesche/util-linux-fork:
  bash-completion: (unshare) add missing --map-subids option
  tunelp: remove extraneous -T option
  partx: mark the --list option as deprecated
  namei: reestablish --nosymlinks option's functionality
  bash-completion: (mountpoint) add missing --show option
  bash-completion: (mount) add missing --ro option
  mount: document --ro option on the man page
  mount: add missing --ro option info in usage message
  bash-completion: (lslogins) add missing long options
  lslogins: fix incomplete option info in usage message
  lsclocks: add missing --no-discover-rtc option info in usage message
  bash-completion: (lsclocks) add missing --no-discover-rtc option
  bash-completion: (hwclock) add missing --ul-debug option
  bash-completion: (flock) add missing long options
  flock: fix incomplete -n option info in usage message

7 days agoMerge branch 'array_size_countof' of https://github.com/crrodriguez/util-linux
Karel Zak [Wed, 26 Nov 2025 10:26:13 +0000 (11:26 +0100)] 
Merge branch 'array_size_countof' of https://github.com/crrodriguez/util-linux

* 'array_size_countof' of https://github.com/crrodriguez/util-linux:
  include: implement ARRAY_SIZE with compiler _Countof if supported

7 days agodocs: write about EditorConfig
Masatake YAMATO [Wed, 26 Nov 2025 08:36:53 +0000 (17:36 +0900)] 
docs: write about EditorConfig

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
9 days agoinclude: implement ARRAY_SIZE with compiler _Countof if supported
Cristian Rodríguez [Mon, 24 Nov 2025 20:04:08 +0000 (17:04 -0300)] 
include: implement ARRAY_SIZE with compiler _Countof if supported

C2Y has _Countof operator for this.
GCC has an stdcountof.h hedaer and a countof definition
Clang implements _Countof and needs __has_extension check

9 days agobash-completion: (unshare) add missing --map-subids option
Christian Goeschel Ndjomouo [Mon, 24 Nov 2025 04:32:11 +0000 (23:32 -0500)] 
bash-completion: (unshare) add missing --map-subids option

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
9 days agotunelp: remove extraneous -T option
Christian Goeschel Ndjomouo [Mon, 24 Nov 2025 04:30:15 +0000 (23:30 -0500)] 
tunelp: remove extraneous -T option

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
9 days agopartx: mark the --list option as deprecated
Christian Goeschel Ndjomouo [Mon, 24 Nov 2025 04:19:56 +0000 (23:19 -0500)] 
partx: mark the --list option as deprecated

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
9 days agonamei: reestablish --nosymlinks option's functionality
Christian Goeschel Ndjomouo [Mon, 24 Nov 2025 04:04:55 +0000 (23:04 -0500)] 
namei: reestablish --nosymlinks option's functionality

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
9 days agobash-completion: (mountpoint) add missing --show option
Christian Goeschel Ndjomouo [Mon, 24 Nov 2025 04:01:30 +0000 (23:01 -0500)] 
bash-completion: (mountpoint) add missing --show option

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
9 days agobash-completion: (mount) add missing --ro option
Christian Goeschel Ndjomouo [Mon, 24 Nov 2025 03:59:31 +0000 (22:59 -0500)] 
bash-completion: (mount) add missing --ro option

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
9 days agomount: document --ro option on the man page
Christian Goeschel Ndjomouo [Mon, 24 Nov 2025 03:58:35 +0000 (22:58 -0500)] 
mount: document --ro option on the man page

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
9 days agomount: add missing --ro option info in usage message
Christian Goeschel Ndjomouo [Mon, 24 Nov 2025 03:57:35 +0000 (22:57 -0500)] 
mount: add missing --ro option info in usage message

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
9 days agobash-completion: (lslogins) add missing long options
Christian Goeschel Ndjomouo [Mon, 24 Nov 2025 03:53:31 +0000 (22:53 -0500)] 
bash-completion: (lslogins) add missing long options

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
9 days agolslogins: fix incomplete option info in usage message
Christian Goeschel Ndjomouo [Mon, 24 Nov 2025 03:51:34 +0000 (22:51 -0500)] 
lslogins: fix incomplete option info in usage message

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
9 days agolsclocks: add missing --no-discover-rtc option info in usage message
Christian Goeschel Ndjomouo [Mon, 24 Nov 2025 03:41:07 +0000 (22:41 -0500)] 
lsclocks: add missing --no-discover-rtc option info in usage message

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
9 days agobash-completion: (lsclocks) add missing --no-discover-rtc option
Christian Goeschel Ndjomouo [Mon, 24 Nov 2025 03:40:26 +0000 (22:40 -0500)] 
bash-completion: (lsclocks) add missing --no-discover-rtc option

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
9 days agobash-completion: (hwclock) add missing --ul-debug option
Christian Goeschel Ndjomouo [Mon, 24 Nov 2025 03:35:09 +0000 (22:35 -0500)] 
bash-completion: (hwclock) add missing --ul-debug option

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
9 days agobash-completion: (flock) add missing long options
Christian Goeschel Ndjomouo [Mon, 24 Nov 2025 03:31:00 +0000 (22:31 -0500)] 
bash-completion: (flock) add missing long options

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
9 days agoflock: fix incomplete -n option info in usage message
Christian Goeschel Ndjomouo [Mon, 24 Nov 2025 03:29:01 +0000 (22:29 -0500)] 
flock: fix incomplete -n option info in usage message

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
10 days agolsfd: add TUN.DEVNETNS column
Masatake YAMATO [Sun, 23 Nov 2025 07:18:48 +0000 (16:18 +0900)] 
lsfd: add TUN.DEVNETNS column

lsfd can show the name of the network device behind a file descriptor
pointing to a tun/tap device.

    # lsfd -Q 'SOURCE == "misc:tun"'
    COMMAND             PID       USER ASSOC  XMODE TYPE   SOURCE MNTID INODE NAME
    qemu-system-x86  846384       qemu    35 rw----  CHR misc:tun    36  1145 iface=vnet21
    pasta.avx2      1837933     yamato     8 rw---m  CHR misc:tun  2143  1145 iface=ens8191
    ...

This feature helps users inspect target processes, containers, and/or
VMs with tools such as tcpdump, wireshark, or ip-link.

However, I found a case where the device name was not sufficient.
pasta (https://passt.top/) provides networking for rootless
containers. It creates a tap device whose name matches the name of a
network device on the host:

    $ ip link show ens8191
    5: ens8191: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 ...

    $ ethtool -i ens8191 | head -1
    driver: atlantic

    $ podman exec 9fbbed215871 ip link show ens8191
    2: ens8191: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 65520 ...

    $ podman exec 9fbbed215871 ethtool -i ens8191 | head -1
    driver: tun

A name alone is not enough to identify a network device on the system.

With this change, lsfd reports the network namespace to which the
tun/tap device belongs:

    # lsfd -Q 'SOURCE == "misc:tun"' -oCOMMAND,PID,SOURCE,TUN.DEVNETNS,NAME
    COMMAND             PID   SOURCE TUN.DEVNETNS NAME
    qemu-system-x86  846384 misc:tun   4026531840 iface=vnet21 devnetns=4026531840
    pasta.avx2      1837933 misc:tun   4026536354 iface=ens8191 devnetns=4026536354
    ...

This change relies on the TUNGETDEVNETNS ioctl added in:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0c3e0e3bb623c3735b8c9ab8aa8332f944f83a9f

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
10 days agolsfd: fix bsearch macro usage with glibc C23
Cristian Rodríguez [Sat, 22 Nov 2025 13:41:08 +0000 (10:41 -0300)] 
lsfd: fix bsearch macro usage with glibc C23

C23 requires bsearch to be a const preserving macro, build now fails
with

../lsfd-cmd/lsfd.c:1879:75: error: macro ‘bsearch’ passed 6 arguments, but takes just 5
 1879 |                                     nfds, sizeof(struct pollfd), pollfdcmp))
      |                                                                           ^
In file included from ../include/c.h:17,
                 from ../lsfd-cmd/lsfd.c:48:
/usr/include/stdlib.h:987:10: note: macro ‘bsearch’ defined here
  987 | # define bsearch(KEY, BASE, NMEMB, SIZE, COMPAR)                        \

  add parenthesis around expression to fix it.

10 days agotests: (lsfd::mkfds-cdev-tun,refactor) make the case extensible
Masatake YAMATO [Sun, 23 Nov 2025 07:00:24 +0000 (16:00 +0900)] 
tests: (lsfd::mkfds-cdev-tun,refactor) make the case extensible

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
10 days agolsfd: (doc) fix English in SOCK.NETNS description
Masatake YAMATO [Sun, 23 Nov 2025 08:43:40 +0000 (17:43 +0900)] 
lsfd: (doc) fix English in SOCK.NETNS description

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
10 days agolsfd: (cleanup) add missing "break" in a case statement
Masatake YAMATO [Sat, 22 Nov 2025 23:15:38 +0000 (08:15 +0900)] 
lsfd: (cleanup) add missing "break" in a case statement

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
10 days agolsfd: (cleanup) return 0 instead of false
Masatake YAMATO [Sat, 22 Nov 2025 23:14:42 +0000 (08:14 +0900)] 
lsfd: (cleanup) return 0 instead of false

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
10 days agolsfd: (refactor) introduce tundata struct
Masatake YAMATO [Sat, 22 Nov 2025 21:35:14 +0000 (06:35 +0900)] 
lsfd: (refactor) introduce tundata struct

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
13 days agoMerge branch 'PR/mountpoint-statmount' of https://github.com/karelzak/util-linux...
Karel Zak [Thu, 20 Nov 2025 12:34:23 +0000 (13:34 +0100)] 
Merge branch 'PR/mountpoint-statmount' of https://github.com/karelzak/util-linux-work

* 'PR/mountpoint-statmount' of https://github.com/karelzak/util-linux-work:
  mountpoint: use single libmount cache for all path resolutions
  mountpoint: add --show option to print mountpoint path
  mountpoint: use statmount() syscall on modern kernels

13 days agoMerge branch 'master-branch-4' of https://github.com/Leefancy/util-linux
Karel Zak [Thu, 20 Nov 2025 11:20:01 +0000 (12:20 +0100)] 
Merge branch 'master-branch-4' of https://github.com/Leefancy/util-linux

* 'master-branch-4' of https://github.com/Leefancy/util-linux:
  kill: the situation where fd is opened but not closed

13 days agomountpoint: use single libmount cache for all path resolutions
Karel Zak [Wed, 19 Nov 2025 12:46:40 +0000 (13:46 +0100)] 
mountpoint: use single libmount cache for all path resolutions

Move libmount cache initialization to main() and pass it through
the control structure. This allows the cache to be reused across
all mnt_resolve_path() calls, reducing allocations.

Also add cleanup section in main() with goto labels for proper
resource deallocation in a single location.

Signed-off-by: Karel Zak <kzak@redhat.com>
13 days agomountpoint: add --show option to print mountpoint path
Karel Zak [Wed, 19 Nov 2025 12:32:25 +0000 (13:32 +0100)] 
mountpoint: add --show option to print mountpoint path

Add a new --show option that prints the actual mountpoint path for
a given directory or file. This is useful for:
- Resolving any path to its containing mountpoint
- Finding the canonical mountpoint path when symlinks are involved
- Determining the mountpoint from paths within filesystems

The option requires kernel support for statmount(2) (Linux 6.8+).
On older kernels without statmount support, the option fails with
an error message, as the /proc/self/mountinfo fallback cannot
resolve arbitrary paths to their containing mountpoint.

Example usage:
  $ mountpoint --show /
  /
  $ mountpoint --show /home/user/file.txt
  /home

The --show option always returns EXIT_SUCCESS (0) when it successfully
finds the mountpoint, regardless of whether the given path itself is
a mountpoint or not.

Addresses: https://github.com/util-linux/util-linux/issues/3806
Signed-off-by: Karel Zak <kzak@redhat.com>
13 days agomountpoint: use statmount() syscall on modern kernels
Karel Zak [Wed, 19 Nov 2025 12:01:02 +0000 (13:01 +0100)] 
mountpoint: use statmount() syscall on modern kernels

Improve mountpoint(1) to use the modern statmount() system call
(available since Linux 6.8) instead of parsing /proc/self/mountinfo.

- Works without /proc mounted on modern kernels
- More efficient than parsing /proc/self/mountinfo
- Better detection of bind mounts via statmount()
- Graceful fallback maintains compatibility

Addresses: https://github.com/util-linux/util-linux/issues/3806
Signed-off-by: Karel Zak <kzak@redhat.com>
2 weeks agokill: the situation where fd is opened but not closed
fortunate-lee [Wed, 19 Nov 2025 01:59:18 +0000 (09:59 +0800)] 
kill: the situation where fd is opened but not closed

Signed-off-by: fortunate-lee <lijian01@kylinos.cn>
2 weeks agoMerge branch 'set_up' of https://github.com/sbraz/util-linux
Karel Zak [Tue, 18 Nov 2025 08:57:27 +0000 (09:57 +0100)] 
Merge branch 'set_up' of https://github.com/sbraz/util-linux

* 'set_up' of https://github.com/sbraz/util-linux:
  Fix typos when "set up" is used as a verb

2 weeks agofincore: The previous exit did not call munmap, resulting in a memory mapping leak.
fortunate-lee [Tue, 18 Nov 2025 02:37:58 +0000 (10:37 +0800)] 
fincore: The previous exit did not call munmap, resulting in a memory mapping leak.

Signed-off-by: fortunate-lee <lijian01@kylinos.cn>
2 weeks agoFix typos when "set up" is used as a verb
Louis Sautier [Sun, 16 Nov 2025 21:44:02 +0000 (22:44 +0100)] 
Fix typos when "set up" is used as a verb

The noun is "setup" while the verb is "set up".

2 weeks agoMerge branch 'fix/su_lsb5_compliance' of https://github.com/cgoesche/util-linux-fork
Karel Zak [Fri, 14 Nov 2025 08:56:03 +0000 (09:56 +0100)] 
Merge branch 'fix/su_lsb5_compliance' of https://github.com/cgoesche/util-linux-fork

* 'fix/su_lsb5_compliance' of https://github.com/cgoesche/util-linux-fork:
  tests: (su) add more options tests
  su: pass arguments after <user> to shell

2 weeks agoMerge branch 'close-fts-handle' of https://github.com/syokensyo/util-linux
Karel Zak [Fri, 14 Nov 2025 08:48:02 +0000 (09:48 +0100)] 
Merge branch 'close-fts-handle' of https://github.com/syokensyo/util-linux

* 'close-fts-handle' of https://github.com/syokensyo/util-linux:
  fincore: close the ftsp to prevent fd leak

3 weeks agochmem: improve messages
Karel Zak [Wed, 12 Nov 2025 11:18:10 +0000 (12:18 +0100)] 
chmem: improve messages

Suggested-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
3 weeks agoMerge branch 'fincore/eperm' of https://github.com/t-8ch/util-linux
Karel Zak [Wed, 12 Nov 2025 11:10:03 +0000 (12:10 +0100)] 
Merge branch 'fincore/eperm' of https://github.com/t-8ch/util-linux

* 'fincore/eperm' of https://github.com/t-8ch/util-linux:
  fincore: do not fall back to mincore if cachestat fails with EPERM

3 weeks agoMerge branch 'PR/cal-header-colors' of https://github.com/karelzak/util-linux-work
Karel Zak [Wed, 12 Nov 2025 11:09:26 +0000 (12:09 +0100)] 
Merge branch 'PR/cal-header-colors' of https://github.com/karelzak/util-linux-work

* 'PR/cal-header-colors' of https://github.com/karelzak/util-linux-work:
  tests: update cal color outputs
  cal: improve header color printing

3 weeks agoMerge branch 'PR/chmem-dynamic-configuration' of https://github.com/karelzak/util...
Karel Zak [Wed, 12 Nov 2025 11:08:39 +0000 (12:08 +0100)] 
Merge branch 'PR/chmem-dynamic-configuration' of https://github.com/karelzak/util-linux-work

* 'PR/chmem-dynamic-configuration' of https://github.com/karelzak/util-linux-work:
  tests: update lsmem outputs
  lsmem: use xstrncpy()
  lsmem,chmem: add configure/deconfigure bash completion options
  lsmem: add doc for dynamic (de)configuration and memmap-on-memory support
  chmem: add chmem documentation for dynamic (de)configuration of memory
  chmem: add support for dynamic (de)configuration of hotplug memory
  lsmem: add support to display dynamic (de)configuration of memory
  lsmem: display global memmap on memory parameter

3 weeks agofincore: close the ftsp to prevent fd leak
syokensyo [Wed, 12 Nov 2025 06:57:57 +0000 (14:57 +0800)] 
fincore: close the ftsp to prevent fd leak

3 weeks agoMerge branch 'lsfd--netlink-lport-data-size' of https://github.com/masatake/util...
Karel Zak [Mon, 10 Nov 2025 11:46:55 +0000 (12:46 +0100)] 
Merge branch 'lsfd--netlink-lport-data-size' of https://github.com/masatake/util-linux

* 'lsfd--netlink-lport-data-size' of https://github.com/masatake/util-linux:
  lsfd: (bugfix) use PRIu32 for prining lport of netlink socket

3 weeks agoMerge branch 'hwclock-rtc-fix-typo' of https://github.com/jgilles/util-linux
Karel Zak [Mon, 10 Nov 2025 11:46:02 +0000 (12:46 +0100)] 
Merge branch 'hwclock-rtc-fix-typo' of https://github.com/jgilles/util-linux

* 'hwclock-rtc-fix-typo' of https://github.com/jgilles/util-linux:
  hwclock-rtc: fix verbose output when --param-set value is unchanged

3 weeks agoMerge branch 'fallocate' of https://github.com/t-8ch/util-linux
Karel Zak [Mon, 10 Nov 2025 11:43:57 +0000 (12:43 +0100)] 
Merge branch 'fallocate' of https://github.com/t-8ch/util-linux

* 'fallocate' of https://github.com/t-8ch/util-linux:
  tests: (swaplabel) don't create test image with truncate(1)
  fallocate: require posix_fallocate() from libc
  fallocate: drop syscall() fallback for fallocate()
  build: simplify checks for fallocate() and posix_fallocate()

3 weeks agoFix the issue of fd resource leakage
Leefancy [Mon, 10 Nov 2025 09:14:18 +0000 (17:14 +0800)] 
Fix the issue of fd resource leakage

Signed-off-by: Leefancy <lijian01@kylinos.cn>
3 weeks agotests: (swaplabel) don't create test image with truncate(1)
Thomas Weißschuh [Sat, 1 Nov 2025 15:50:49 +0000 (16:50 +0100)] 
tests: (swaplabel) don't create test image with truncate(1)

truncate(1) can create holes in the file. These will trigger a warning
in mkswap(1), failing the testsuite. Given that fallocate(1) now alway
supports posix_fallocate() which works on all filesystems, truncate(1)
is unnecessary anyways.

Reported-by: Christian Hesse <mail@eworm.de>
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
3 weeks agofallocate: require posix_fallocate() from libc
Thomas Weißschuh [Sat, 1 Nov 2025 15:55:49 +0000 (16:55 +0100)] 
fallocate: require posix_fallocate() from libc

Recent libcs implement posix_fallocate() properly. The fallback logic
should never be used. Furthermore unconditional support for
posix_fallocate() will enable some further cleanup and fixes.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
3 weeks agofallocate: drop syscall() fallback for fallocate()
Thomas Weißschuh [Sat, 1 Nov 2025 20:49:58 +0000 (21:49 +0100)] 
fallocate: drop syscall() fallback for fallocate()

The ABI of the fallocate() syscall is complicated and not properly
handled by the open-coded fallback logic.

As all recent libcs implement fallocate() properly, drop the
open-coded systemcall fallback and depend on the libc implementation.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
3 weeks agobuild: simplify checks for fallocate() and posix_fallocate()
Thomas Weißschuh [Fri, 7 Nov 2025 11:47:20 +0000 (12:47 +0100)] 
build: simplify checks for fallocate() and posix_fallocate()

The bespoke test logic for those two functions was only necessary for
old glibc versions which have long gone out of support.

Align the checks with all other ones.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
3 weeks agolsfd: (bugfix) use PRIu32 for prining lport of netlink socket
Masatake YAMATO [Sat, 8 Nov 2025 02:42:31 +0000 (11:42 +0900)] 
lsfd: (bugfix) use PRIu32 for prining lport of netlink socket

Fixes #3849

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
3 weeks agohwclock-rtc: fix verbose output when --param-set value is unchanged
Jesse Gilles [Fri, 7 Nov 2025 19:27:49 +0000 (13:27 -0600)] 
hwclock-rtc: fix verbose output when --param-set value is unchanged

RTC_PARAM_SET operation is skipped rather than GET

3 weeks agoMerge branch 'fix/missing_long_opts_completions' of https://github.com/cgoesche/util...
Karel Zak [Fri, 7 Nov 2025 11:33:56 +0000 (12:33 +0100)] 
Merge branch 'fix/missing_long_opts_completions' of https://github.com/cgoesche/util-linux-fork

* 'fix/missing_long_opts_completions' of https://github.com/cgoesche/util-linux-fork: (41 commits)
  bash-completion: (nsenter) add missing --follow-context
  bash-completion: (namei) add missing --context
  bash-completion: (setpriv) add missing long options
  bash-completion: (pg) add missing long options
  bash-completion: (lastlog2) add missing --active
  bash-completion: (whereis) add missing long options
  bash-completion: (wdctl) add missing long options
  bash-completion: (uuidd) add missing --cont-clock
  bash-completion: (unshare) add missing long options
  bash-completion: (swapon) add missing --options
  bash-completion: (sfdisk) add missing long options
  bash-completion: (setsid) add missing --fork
  bash-completion: (scriptlive) add missing --echo
  bash-completion: (renice) add missing --relative
  bash-completion: (more) add missing --exit-on-eof
  bash-completion: (mkswap) add missing long options
  bash-completion: (mkfs.minix) add missing --lock
  bash-completion: (mkfs.cramfs) add missing long options
  bash-completion: (mkfs.bfs) add missing --lock
  bash-completion: (lsmem) add missing --split
  ...

3 weeks agoMerge branch 'PR/benno-losetup' of https://github.com/karelzak/util-linux-work
Karel Zak [Fri, 7 Nov 2025 11:19:16 +0000 (12:19 +0100)] 
Merge branch 'PR/benno-losetup' of https://github.com/karelzak/util-linux-work

* 'PR/benno-losetup' of https://github.com/karelzak/util-linux-work:
  losetup: (man) put the synopses in a better order, the name-giver first
  losetup: remove the --verbose flag, as it doesn't actually do anything
  losetup: sort 'O' correctly for the mutual-exclusive check to work

3 weeks agoMerge branch 'PR/include-optutils-err' of https://github.com/karelzak/util-linux...
Karel Zak [Fri, 7 Nov 2025 11:18:50 +0000 (12:18 +0100)] 
Merge branch 'PR/include-optutils-err' of https://github.com/karelzak/util-linux-work

* 'PR/include-optutils-err' of https://github.com/karelzak/util-linux-work:
  include/optutils: improve err_exclusive_options() output

3 weeks agotests: update cal color outputs
Karel Zak [Fri, 7 Nov 2025 11:15:51 +0000 (12:15 +0100)] 
tests: update cal color outputs

Signed-off-by: Karel Zak <kzak@redhat.com>
3 weeks agologin: add line break after timeout message
Karel Zak [Fri, 7 Nov 2025 10:57:58 +0000 (11:57 +0100)] 
login: add line break after timeout message

Just to make login(1) more user-friendly for those who do crazy things.

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

Signed-off-by: Karel Zak <kzak@redhat.com>
3 weeks agotests: update lsmem outputs
Karel Zak [Fri, 7 Nov 2025 10:41:21 +0000 (11:41 +0100)] 
tests: update lsmem outputs

Signed-off-by: Karel Zak <kzak@redhat.com>
3 weeks agocal: improve header color printing
Karel Zak [Fri, 7 Nov 2025 10:35:12 +0000 (11:35 +0100)] 
cal: improve header color printing

It's more robust to avoid using line breaks within the colored area.

Fixes: https://github.com/util-linux/util-linux/issues/3844
Signed-off-by: Karel Zak <kzak@redhat.com>
3 weeks agoinclude/optutils: improve err_exclusive_options() output
Karel Zak [Mon, 3 Nov 2025 12:41:31 +0000 (13:41 +0100)] 
include/optutils: improve err_exclusive_options() output

OLD:
$ losetup --remove --detach loop0
losetup: mutually exclusive arguments: --detach-all --all --set-capacity --detach --find --associated --remove
NEW:
$ losetup --remove --detach loop0
losetup: options --detach and --remove cannot be combined.

Suggested-by: Benno Schulenberg <bensberg@telfort.nl>
Signed-off-by: Karel Zak <kzak@redhat.com>
3 weeks agolsmem: use xstrncpy()
Karel Zak [Fri, 7 Nov 2025 09:28:14 +0000 (10:28 +0100)] 
lsmem: use xstrncpy()

Signed-off-by: Karel Zak <kzak@redhat.com>
3 weeks agolsmem,chmem: add configure/deconfigure bash completion options
Sumanth Korikkar [Thu, 16 Oct 2025 15:38:06 +0000 (17:38 +0200)] 
lsmem,chmem: add configure/deconfigure bash completion options

Add bash completion for configure/deconfigure options in chmem and lsmem.

Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
3 weeks agolsmem: add doc for dynamic (de)configuration and memmap-on-memory support
Sumanth Korikkar [Thu, 16 Oct 2025 15:38:05 +0000 (17:38 +0200)] 
lsmem: add doc for dynamic (de)configuration and memmap-on-memory support

lsmem --output-all now displays two new columns:

CONFIGURED : yes/no indicating if a memory block has been explicitly
configured.

MEMMAP-ON-MEMORY : yes/no indicating whether the block uses
memmap-on-memory.

lsmem -o RANGE,SIZE,STATE,BLOCK,CONFIGURED,MEMMAP-ON-MEMORY
RANGE                   SIZE   STATE   BLOCK CONFIGURED MEMMAP-ON-MEMORY
0x00000000-0x7fffffff   2G     online  0-15  yes        no
0x80000000-0xffffffff   2G     offline 16-31 no         yes

Memory block size:                128M
Total online memory:                2G
Total offline memory:               2G
Memmap on memory parameter:        yes

Add documentation for new fields.

Reviewed-by: Maria Eisenhaendler <maria1@de.ibm.com>
Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
3 weeks agochmem: add chmem documentation for dynamic (de)configuration of memory
Sumanth Korikkar [Thu, 16 Oct 2025 15:38:04 +0000 (17:38 +0200)] 
chmem: add chmem documentation for dynamic (de)configuration of memory

Describe chmem configure, deconfigure and memmap-on-memory options:

ff18dcb19aab ("s390/sclp: Add support for dynamic (de)configuration of
memory") s390 kernel no longer pre-adds all standby memory at boot.
Instead, users must explicitly configure a block before it can be used
for online/offline actions. At configuration time, users can dynamically
decide whether to use optional memmap-on-memory for each memory block,
where value of 1 allocates metadata (such as struct pages array) from
the hotplug memory itself, enabling hot-add operations even under memory
pressure. A value of 0 stores metadata in regular system memory, which
may require additional free memory, but enables continuous physical
memory across memory blocks.

Add documentation to reflect the following options:
* chmem --configure 128M --memmap-on-memory 1
* chmem --deconfigure 128M
* chmem --enable 128M # implicitly configure memory if supported by
  architecture and online it
* chmem --disable 128M  # offline memory and implicitly deconfigure if
  supported by the architecture.

Just like online and offline actions, memory configuration and
deconfiguration can be controlled through similar options. Also,
memmap-on-memory setting can be changed, only when the memory block is
in deconfigured state. This means, it is usable only via --configure
option.

Reviewed-by: Maria Eisenhaendler <maria1@de.ibm.com>
Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
3 weeks agochmem: add support for dynamic (de)configuration of hotplug memory
Sumanth Korikkar [Thu, 16 Oct 2025 15:38:03 +0000 (17:38 +0200)] 
chmem: add support for dynamic (de)configuration of hotplug memory

Extend chmem to use the new s390 kernel interface for configuring and
deconfiguring hotpluggable memory blocks, with memmap-on-memory support.

Background:
On s390, memmap-on-memory was introduced to ensure that the struct page
array (metadata) for hotpluggable standby memory is allocated from the
memory block itself. This allowed hot-add operations even under memory
pressure, particularly in cases with a strong imbalance between
boot-time online memory and standby memory.

The original design, however, had few limitations:
* All hotpluggable standby memory was added at boot.
* The use of memmap-on-memory was global and static, decided at boot
  time. Either all standby blocks used it, or none of them did.
* memmap-on-memory choice could not be changed at runtime, limiting
  flexibility. For example, when continuous physical memory was required
  later across memory blocks.

The s390 kernel ff18dcb19aab ("s390/sclp: Add support for dynamic
(de)configuration of memory") no longer pre-adds all standby memory at
boot. Instead, users must explicitly configure a block before it can be
used for online/offline actions.  At configuration time, users can
dynamically decide whether to use optional memmap-on-memory for each
memory block, where value of 1 allocates metadata (such as struct pages
array) from the hotplug memory itself, enabling hot-add operations even
under memory pressure. A value of 0 stores metadata in regular system
memory and enables continuous physical memory across memory blocks.

s390 kernel sysfs interface to configure/deconfigure memory with
memmap-on-memory support looks as shown below:

1. Configure memory
echo 1 > /sys/firmware/memory/memoryX/config  

2. Deconfigure memory
echo 0 > /sys/firmware/memory/memoryX/config

3. Enable memmap-on-memory
echo 1 > /sys/firmware/memory/memoryX/memmap_on_memory

4. Disable memmap-on-memory
echo 0 > /sys/firmware/memory/memoryX/memmap_on_memory

* Initial memory layout:
lsmem -o RANGE,SIZE,STATE,BLOCK,CONFIGURED,MEMMAP-ON-MEMORY
RANGE                   SIZE   STATE   BLOCK CONFIGURED MEMMAP-ON-MEMORY
0x00000000-0x7fffffff   2G     online  0-15  yes        no
0x80000000-0xffffffff   2G     offline 16-31 no         yes

Memory block size:                128M
Total online memory:                2G
Total offline memory:               2G
Memmap on memory parameter:        yes

* Configure memory with memmap-on-memory.
chmem -c 128M -m 1
lsmem -o RANGE,SIZE,STATE,BLOCK,CONFIGURED,MEMMAP-ON-MEMORY
RANGE                   SIZE   STATE    BLOCK CONFIGURED MEMMAP-ON-MEMORY
0x00000000-0x7fffffff   2G     online   0-15  yes        no
0x80000000-0x87ffffff   128M   offline  16    yes        yes
0x88000000-0xffffffff   1.9G   offline  17-31 no         yes

Memory block size:                128M
Total online memory:                2G
Total offline memory:               2G
Memmap on memory parameter:        yes

* Deconfigure memory
chmem -g 128M
lsmem -o RANGE,SIZE,STATE,BLOCK,CONFIGURED,MEMMAP-ON-MEMORY
RANGE                   SIZE   STATE    BLOCK CONFIGURED MEMMAP-ON-MEMORY
0x00000000-0x7fffffff   2G     online   0-15  yes        no
0x80000000-0xffffffff   2G     offline  16-31 no         yes

Memory block size:                128M
Total online memory:                2G
Total offline memory:               2G
Memmap on memory parameter:        yes

* Online memory.
If the memory is in deconfigured state, configure and online it.

chmem -e 128M -v
Memory Block 16 (0x0000000080000000-0x0000000087ffffff) configured
Memory Block 16 (0x0000000080000000-0x0000000087ffffff) enabled

lsmem -o RANGE,SIZE,STATE,BLOCK,CONFIGURED,MEMMAP-ON-MEMORY
RANGE                   SIZE   STATE    BLOCK CONFIGURED MEMMAP-ON-MEMORY
0x00000000-0x7fffffff    2G    online   0-15  yes        no
0x80000000-0x87ffffff    128M  online   16    yes        yes
0x88000000-0xffffffff    1.9G  offline  17-31 no         yes

Memory block size:                128M
Total online memory:              2.1G
Total offline memory:             1.9G
Memmap on memory parameter:        yes

* Offline memory
If the memory is in online state, then offline it and deconfigure it.

chmem -d 128M -v
Memory Block 16 (0x0000000080000000-0x0000000087ffffff) disabled
Memory Block 16 (0x0000000080000000-0x0000000087ffffff) deconfigured

lsmem -o RANGE,SIZE,STATE,BLOCK,CONFIGURED,MEMMAP-ON-MEMORY
RANGE                   SIZE   STATE    BLOCK CONFIGURED MEMMAP-ON-MEMORY
0x00000000-0x7fffffff   2G     online   0-15  yes        no
0x80000000-0xffffffff   2G     offline  16-31 no         yes

Memory block size:                128M
Total online memory:                2G
Total offline memory:               2G
Memmap on memory parameter:        yes

Just like online and offline actions, memory configuration and
deconfiguration can be controlled through similar options. Also,
memmap-on-memory setting can be changed, only when the memory block is
in deconfigured state. This means, it is usable only via --configure
option.

Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
3 weeks agolsmem: add support to display dynamic (de)configuration of memory
Sumanth Korikkar [Thu, 16 Oct 2025 15:38:02 +0000 (17:38 +0200)] 
lsmem: add support to display dynamic (de)configuration of memory

Extend lsmem to display (de)configured blocks and memmap_on_memory
state. With the new s390 kernel interface (linux-next) ff18dcb19aab
("s390/sclp: Add support for dynamic (de)configuration of memory"),
standby memory blocks are no longer pre-added at boot, but must be
explicitly configured before being eligible for online/offline
operations. At configuration time, users can also decide whether to use
memmap-on-memory per block.

Add CONFIGURED column : indicate if a memory block has been explicitly
configured.

Add MEMMAP-ON-MEMORY column : indicate if a memory block uses
memmap-on-memory.

memmap-on-memory reference:
https://docs.kernel.org/admin-guide/mm/memory-hotplug.html

Users can now inspect memory configuration state and retrieve
memmap-on-memory state per block.

lsmem -o RANGE,SIZE,STATE,BLOCK,CONFIGURED,MEMMAP-ON-MEMORY
RANGE                   SIZE   STATE   BLOCK CONFIGURED MEMMAP-ON-MEMORY
0x00000000-0x7fffffff   2G     online  0-15  yes        no
0x80000000-0xffffffff   2G     offline 16-31 no         yes

Memory block size:                128M
Total online memory:                2G
Total offline memory:               2G
Memmap on memory parameter:        yes

Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
3 weeks agolsmem: display global memmap on memory parameter
Sumanth Korikkar [Thu, 16 Oct 2025 15:38:01 +0000 (17:38 +0200)] 
lsmem: display global memmap on memory parameter

Display the output of global memmap-on-memory parameter for memory
hotplug. Retrieve the details via
/sys/module/memory_hotplug/parameters/memmap_on_memory.

lsmem
RANGE                                 SIZE  STATE REMOVABLE BLOCK
0x0000000000000000-0x00000001ffffffff   8G online       yes  0-63

Memory block size:                128M
Total online memory:                8G
Total offline memory:               0B
Memmap on memory parameter:        yes

Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
4 weeks agotests: (su) add more options tests
cgoesche [Sun, 2 Nov 2025 17:54:02 +0000 (12:54 -0500)] 
tests: (su) add more options tests

Signed-off-by: cgoesche <cgoesc2@wgu.edu>
4 weeks agosu: pass arguments after <user> to shell
cgoesche [Sun, 2 Nov 2025 16:55:09 +0000 (11:55 -0500)] 
su: pass arguments after <user> to shell

The su(1) manpage describes how the arguments after <user>
are passed to the invoked shell. However this is empirically
wrong, as option flags after <user> are interpreted by su(1)
and will eventually never be passed or yield an error that
terminates the program due to an unrecognized option flag.

To fix this we can change getopt(3)'s scanning mode with a '+'
prefixed to 'optstring', this will make it so that getopt(3)
stops processing argv elements on the first occurrence of a
non-option argument, e.g. '-' or '<user>'.

Additionally, if the argument that directly follows '-' is an
option flag, su(1) will assume that this argument and the ones
that follow, are to be passed to a shell invoked by the root user.

Addresses: https://github.com/util-linux/util-linux/pull/1809
Signed-off-by: cgoesche <cgoesc2@wgu.edu>
4 weeks agolosetup: (man) put the synopses in a better order, the name-giver first
Benno Schulenberg [Wed, 29 Oct 2025 11:03:58 +0000 (12:03 +0100)] 
losetup: (man) put the synopses in a better order, the name-giver first

Also, condense the synopsis for setting up a loop device to just the
essentials -- it had become so long that it was incomprehensible.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
4 weeks agolosetup: remove the --verbose flag, as it doesn't actually do anything
Benno Schulenberg [Wed, 29 Oct 2025 11:03:57 +0000 (12:03 +0100)] 
losetup: remove the --verbose flag, as it doesn't actually do anything

Fourteen years ago, commit c7e0925def rewrote the `losetup` tool,
removing all references to the 'verbose' variable.  Three years
later, commit 60cb2c3720 removed the line 'verbose = 1' because
the compiler complained that the variable was set but never used.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
4 weeks agolosetup: sort 'O' correctly for the mutual-exclusive check to work
Benno Schulenberg [Wed, 29 Oct 2025 11:03:56 +0000 (12:03 +0100)] 
losetup: sort 'O' correctly for the mutual-exclusive check to work

The options need to be in strict ascending order.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
4 weeks agowdctl: remove -d option leftover
Munehisa Kamata [Tue, 28 Oct 2025 19:54:17 +0000 (12:54 -0700)] 
wdctl: remove -d option leftover

-d option was removed in commit f56338b43973 ("wdctl: allow to specify more
than one device"), but the optstring wasn't updated at that time and wdctl
can still accept the option halfway as below:

 $ wdctl -d
 wdctl: option requires an argument -- 'd'

whereas it should say:

 wdctl: invalid option -- 'd'

So update the optstring.

Fixes: f56338b43973 ("wdctl: allow to specify more than one device")
Signed-off-by: Munehisa Kamata <kamatam@amazon.com>
4 weeks agoMerge branch 'fix/login_manpage_grammar' of https://github.com/cgoesche/util-linux...
Karel Zak [Mon, 3 Nov 2025 11:16:23 +0000 (12:16 +0100)] 
Merge branch 'fix/login_manpage_grammar' of https://github.com/cgoesche/util-linux-fork

* 'fix/login_manpage_grammar' of https://github.com/cgoesche/util-linux-fork:
  login: fix minor grammar mistake in the manpage

4 weeks agoMerge branch 'meson' of https://github.com/neheb/util-linux
Karel Zak [Mon, 3 Nov 2025 11:16:08 +0000 (12:16 +0100)] 
Merge branch 'meson' of https://github.com/neheb/util-linux

* 'meson' of https://github.com/neheb/util-linux:
  meson: fix non threaded toolchains

4 weeks agoMerge branch 'bst/hwclock-cmp-set' of https://github.com/Bastian-Krause/util-linux
Karel Zak [Mon, 3 Nov 2025 11:13:26 +0000 (12:13 +0100)] 
Merge branch 'bst/hwclock-cmp-set' of https://github.com/Bastian-Krause/util-linux

* 'bst/hwclock-cmp-set' of https://github.com/Bastian-Krause/util-linux:
  hwclock: skip RTC_PARAM_SET for --param-set with unchanged value

4 weeks agologin: fix minor grammar mistake in the manpage
cgoesche [Mon, 3 Nov 2025 03:31:40 +0000 (22:31 -0500)] 
login: fix minor grammar mistake in the manpage

Signed-off-by: cgoesche <cgoesc2@wgu.edu>
4 weeks agomeson: fix non threaded toolchains
Rosen Penev [Sun, 2 Nov 2025 20:25:26 +0000 (12:25 -0800)] 
meson: fix non threaded toolchains

threads needs to be set as not required.

Cleaned up meson build slightly to use one dependency call.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 weeks agobash-completion: (nsenter) add missing --follow-context
cgoesche [Sat, 1 Nov 2025 23:50:17 +0000 (19:50 -0400)] 
bash-completion: (nsenter) add missing --follow-context

Signed-off-by: cgoesche <cgoesc2@wgu.edu>
4 weeks agobash-completion: (namei) add missing --context
cgoesche [Sat, 1 Nov 2025 23:49:33 +0000 (19:49 -0400)] 
bash-completion: (namei) add missing --context

Signed-off-by: cgoesche <cgoesc2@wgu.edu>