]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
12 days agoMerge PR #3953: waitpid pidfd inode format support
Karel Zak [Mon, 2 Feb 2026 12:54:05 +0000 (13:54 +0100)] 
Merge PR #3953: waitpid pidfd inode format support

Resolved conflicts due to test directory reorganization.
The waitpid test files were already moved to tests/expected/waitpid/
in a previous commit.

Signed-off-by: Karel Zak <kzak@redhat.com>
12 days agoMerge branch 'PR/chfn-version-help' of https://github.com/karelzak/util-linux-work
Karel Zak [Mon, 2 Feb 2026 12:48:41 +0000 (13:48 +0100)] 
Merge branch 'PR/chfn-version-help' of https://github.com/karelzak/util-linux-work

* 'PR/chfn-version-help' of https://github.com/karelzak/util-linux-work:
  chfn: allow --help and --version without login.defs restrictions

12 days agoMerge branch 'tests_convert_to_long_opts' of https://github.com/cgoesche/util-linux...
Karel Zak [Mon, 2 Feb 2026 12:46:44 +0000 (13:46 +0100)] 
Merge branch 'tests_convert_to_long_opts' of https://github.com/cgoesche/util-linux-fork

* 'tests_convert_to_long_opts' of https://github.com/cgoesche/util-linux-fork: (26 commits)
  tests: (waitpid) use long options to improve test coverage report
  tests: use long options globally in test scripts
  tests: (setarch) use long options to improve test coverage report
  tests: (script) use long options to improve test coverage report
  tests: (rev) use long options to improve test coverage report
  tests: (rename) use long options to improve test coverage report
  tests: (mount) use long options to improve test coverage report
  tests: (more) use long options to improve test coverage report
  tests: (lsns) use long options to improve test coverage report
  tests: (lsmem) use long options to improve test coverage report
  tests: (lscpu) use long options to improve test coverage report
  tests: (lsclocks) use long options to improve test coverage report
  tests: (losetup) use long options to improve test coverage report
  tests: (logger) use long options to improve test coverage report
  tests: (ipcs) use long options to improve test coverage report
  tests: (ionice) use long options to improve test coverage report
  tests: (hexdump) use long options to improve test coverage report
  tests: (getopt) use long options to improve test coverage report
  tests: (findmnt) use long options to improve test coverage report
  tests: (fdisk) use long options to improve test coverage report
  ...

12 days agoMerge branch 'issue/3980/hexdump' of https://github.com/echoechoin/util-linux
Karel Zak [Mon, 2 Feb 2026 12:38:18 +0000 (13:38 +0100)] 
Merge branch 'issue/3980/hexdump' of https://github.com/echoechoin/util-linux

* 'issue/3980/hexdump' of https://github.com/echoechoin/util-linux:
  hexdump: fixes Heap-buffer-overflow in rewrite_rules

12 days agoMerge branch 'lib_strutils_incomplete_null_term_check' of https://github.com/cgoesche...
Karel Zak [Mon, 2 Feb 2026 12:33:51 +0000 (13:33 +0100)] 
Merge branch 'lib_strutils_incomplete_null_term_check' of https://github.com/cgoesche/util-linux-fork

* 'lib_strutils_incomplete_null_term_check' of https://github.com/cgoesche/util-linux-fork:
  lib: (strutils.c) fix unchecked lookahead in ul_parse_size()

12 days agoMerge branch 'lsfd--ASSOC-pidfs' of https://github.com/masatake/util-linux
Karel Zak [Mon, 2 Feb 2026 12:28:12 +0000 (13:28 +0100)] 
Merge branch 'lsfd--ASSOC-pidfs' of https://github.com/masatake/util-linux

* 'lsfd--ASSOC-pidfs' of https://github.com/masatake/util-linux:
  lsfd: add new association "pidfs"

12 days agoMerge branch 'mount_manpage_grammar_mistake' of https://github.com/cgoesche/util...
Karel Zak [Mon, 2 Feb 2026 12:22:25 +0000 (13:22 +0100)] 
Merge branch 'mount_manpage_grammar_mistake' of https://github.com/cgoesche/util-linux-fork

* 'mount_manpage_grammar_mistake' of https://github.com/cgoesche/util-linux-fork:
  mount: (manpage) fix minor grammar mistakes

12 days agoMerge branch 'nsenter_manpage_improve' of https://github.com/cgoesche/util-linux...
Karel Zak [Mon, 2 Feb 2026 12:21:46 +0000 (13:21 +0100)] 
Merge branch 'nsenter_manpage_improve' of https://github.com/cgoesche/util-linux-fork

* 'nsenter_manpage_improve' of https://github.com/cgoesche/util-linux-fork:
  nsenter: (manpage) fix minor grammar mistake

12 days agoMerge branch 'column_man_page' of https://github.com/echoechoin/util-linux
Karel Zak [Mon, 2 Feb 2026 12:20:52 +0000 (13:20 +0100)] 
Merge branch 'column_man_page' of https://github.com/echoechoin/util-linux

* 'column_man_page' of https://github.com/echoechoin/util-linux:
  column doc: add missing attrubutes
  column doc: fix incorrect attribute: hidden

12 days agoMerge branch 'getino_man_page_improvements' of https://github.com/cgoesche/util-linux...
Karel Zak [Mon, 2 Feb 2026 12:18:33 +0000 (13:18 +0100)] 
Merge branch 'getino_man_page_improvements' of https://github.com/cgoesche/util-linux-fork

* 'getino_man_page_improvements' of https://github.com/cgoesche/util-linux-fork:
  getino: (manpage) improve grammar and wording

12 days agoMerge branch 'more_column_tests' of https://github.com/cgoesche/util-linux-fork
Karel Zak [Mon, 2 Feb 2026 12:11:11 +0000 (13:11 +0100)] 
Merge branch 'more_column_tests' of https://github.com/cgoesche/util-linux-fork

* 'more_column_tests' of https://github.com/cgoesche/util-linux-fork:
  tests: (column) add more tests

12 days agohexdump: fixes Heap-buffer-overflow in rewrite_rules
WanBingjiang [Mon, 2 Feb 2026 06:55:11 +0000 (14:55 +0800)] 
hexdump: fixes Heap-buffer-overflow in rewrite_rules

13 days agolib: (strutils.c) fix unchecked lookahead in ul_parse_size()
Christian Goeschel Ndjomouo [Mon, 2 Feb 2026 00:15:41 +0000 (19:15 -0500)] 
lib: (strutils.c) fix unchecked lookahead in ul_parse_size()

If the numeric value provided to ul_parse_size() via @str
is a decimal with fractions only containing zeros, the logic
fails to identify the end of the string and goes to the label
'check_suffix' and will do an unchecked lookahead (*p + 1)
that will result in an out-of-bounds read.

This is because the logic only checks for null-termination
when a fraction has been parsed, i.e. a fraction not only
containing zeros.

To fix the issue, we implicitly check for null-termination
when we have finished parsing the fraction.

Reported-by: Yashashree Gund <yash_gund@live.com>
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
13 days agotests: (waitpid) add tests for the pidfd inode format support
Christian Goeschel Ndjomouo [Tue, 27 Jan 2026 00:33:00 +0000 (19:33 -0500)] 
tests: (waitpid) add tests for the pidfd inode format support

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
13 days agotests: (waitpid) move waitpid tests to a dedicated subdir
Christian Goeschel Ndjomouo [Tue, 27 Jan 2026 00:28:41 +0000 (19:28 -0500)] 
tests: (waitpid) move waitpid tests to a dedicated subdir

Moving tests for waitpid(1) in tests/ts/misc to its own
subdirectory, namely tests/ts/waitpid, makes it possible
to add more extensive tests without cluttering tests/ts/misc
and makes the directory structure more coherent.

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
13 days agowaitpid: (manpage) document the support for the "PID:inode" addressing format
Christian Goeschel Ndjomouo [Wed, 14 Jan 2026 01:37:26 +0000 (20:37 -0500)] 
waitpid: (manpage) document the support for the "PID:inode" addressing format

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
13 days agowaitpid: close fd after removal from epoll interest list
Christian Goeschel Ndjomouo [Mon, 12 Jan 2026 18:53:36 +0000 (13:53 -0500)] 
waitpid: close fd after removal from epoll interest list

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
13 days agowaitpid: support 'PID:inode' process addressing format
Christian Goeschel Ndjomouo [Wed, 14 Jan 2026 00:42:09 +0000 (19:42 -0500)] 
waitpid: support 'PID:inode' process addressing format

Adding support for the 'PID:inode' format to address a
process ensures that waitpid(1) safely polls the status
of the expected process in a race-free manner. Worthy of
note is that with the addition of the getino(1) command
the aforementioned task becomes trivially simple.

Example:
        waitpid $(getino -p 123456)

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
13 days agowaitpid: refactor to improve maintainability
Christian Goeschel Ndjomouo [Wed, 14 Jan 2026 00:02:47 +0000 (19:02 -0500)] 
waitpid: refactor to improve maintainability

This refactor introduces 'struct waitpid_control' which is
used to control the program state, e.g. option flags, to
create context for internal routines that can adapt their
execution flow accordingly. It has as goal to make the code
easier to understand and reduces the scope of variables.

It also adds 'struct process_info' which stores information
on a process, specified by the PID passed on the command line,
such as the PID, process file descriptor and pidfd inode number.

An array of process_info is used to store information on all
specified PIDs on the command line and is used to create the
event poll list that is integral to the waitpid(1) logic.

This refactor lays the ground work to introduce support for
the 'PID:inode' process addressing format.

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
13 days agolib: (pidfd-utils) provide a more liberal variant of ul_get_valid_pidfd_or_err()
Christian Goeschel Ndjomouo [Sat, 10 Jan 2026 01:53:00 +0000 (20:53 -0500)] 
lib: (pidfd-utils) provide a more liberal variant of ul_get_valid_pidfd_or_err()

The new function ul_get_valid_pidfd() behaves less opinionated
in an error case and instead of terminating the calling process
it returns an error.

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
13 days agolsfd: add new association "pidfs"
Masatake YAMATO [Fri, 30 Jan 2026 20:27:02 +0000 (05:27 +0900)] 
lsfd: add new association "pidfs"

This new association is inspired by the getino command.

Output example:

  $ ./lsfd --pid=1 -Q '(ASSOC == "pidfs")'
  COMMAND PID USER ASSOC  XMODE  TYPE       SOURCE MNTID INODE NAME
  systemd   1 root pidfs ------ pidfd anon_inodefs     5     2 pid=1 comm=systemd nspid=1

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 weeks agonsenter: (manpage) fix minor grammar mistake
Christian Goeschel Ndjomouo [Fri, 30 Jan 2026 18:28:02 +0000 (13:28 -0500)] 
nsenter: (manpage) fix minor grammar mistake

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agomount: (manpage) fix minor grammar mistakes
Christian Goeschel Ndjomouo [Fri, 30 Jan 2026 18:34:17 +0000 (13:34 -0500)] 
mount: (manpage) fix minor grammar mistakes

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agocolumn doc: add missing attrubutes
WanBingjiang [Fri, 30 Jan 2026 13:32:06 +0000 (21:32 +0800)] 
column doc: add missing attrubutes

2 weeks agocolumn doc: fix incorrect attribute: hidden
WanBingjiang [Fri, 30 Jan 2026 13:22:28 +0000 (21:22 +0800)] 
column doc: fix incorrect attribute: hidden

2 weeks agogetino: (manpage) improve grammar and wording
Christian Goeschel Ndjomouo [Fri, 30 Jan 2026 02:45:10 +0000 (21:45 -0500)] 
getino: (manpage) improve grammar and wording

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: (waitpid) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Thu, 29 Jan 2026 05:58:16 +0000 (00:58 -0500)] 
tests: (waitpid) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: use long options globally in test scripts
Christian Goeschel Ndjomouo [Thu, 29 Jan 2026 05:03:29 +0000 (00:03 -0500)] 
tests: use long options globally in test scripts

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: (setarch) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Fri, 23 Jan 2026 20:36:35 +0000 (15:36 -0500)] 
tests: (setarch) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: (script) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Fri, 23 Jan 2026 20:31:41 +0000 (15:31 -0500)] 
tests: (script) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: (rev) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Fri, 23 Jan 2026 20:27:25 +0000 (15:27 -0500)] 
tests: (rev) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: (rename) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Fri, 23 Jan 2026 20:26:40 +0000 (15:26 -0500)] 
tests: (rename) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: (mount) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Fri, 23 Jan 2026 20:02:41 +0000 (15:02 -0500)] 
tests: (mount) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: (more) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Fri, 23 Jan 2026 19:43:16 +0000 (14:43 -0500)] 
tests: (more) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: (lsns) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Fri, 23 Jan 2026 19:12:33 +0000 (14:12 -0500)] 
tests: (lsns) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: (lsmem) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 03:36:51 +0000 (22:36 -0500)] 
tests: (lsmem) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: (lscpu) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 03:25:53 +0000 (22:25 -0500)] 
tests: (lscpu) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: (lsclocks) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 03:24:29 +0000 (22:24 -0500)] 
tests: (lsclocks) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: (losetup) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 03:22:36 +0000 (22:22 -0500)] 
tests: (losetup) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: (logger) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 03:17:18 +0000 (22:17 -0500)] 
tests: (logger) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: (ipcs) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 03:11:42 +0000 (22:11 -0500)] 
tests: (ipcs) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: (ionice) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 03:02:30 +0000 (22:02 -0500)] 
tests: (ionice) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: (hexdump) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 02:55:29 +0000 (21:55 -0500)] 
tests: (hexdump) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: (getopt) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 02:51:22 +0000 (21:51 -0500)] 
tests: (getopt) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: (findmnt) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 02:46:24 +0000 (21:46 -0500)] 
tests: (findmnt) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: (fdisk) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 02:41:17 +0000 (21:41 -0500)] 
tests: (fdisk) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: (fallocate) use long options to improve test coverage report
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 02:34:37 +0000 (21:34 -0500)] 
tests: (fallocate) use long options to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: (enosys) use long options instead, to improve test coverage report
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 02:23:41 +0000 (21:23 -0500)] 
tests: (enosys) use long options instead, to improve test coverage report

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: (chfn) test all long options
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 01:08:57 +0000 (20:08 -0500)] 
tests: (chfn) test all long options

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: (cal) use more long options to improve test coverage accuracy
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 00:48:12 +0000 (19:48 -0500)] 
tests: (cal) use more long options to improve test coverage accuracy

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: (blkid) use more long options to improve test coverage accuracy
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 00:36:23 +0000 (19:36 -0500)] 
tests: (blkid) use more long options to improve test coverage accuracy

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: (blkdiscard) use long options to improve test coverage accuracy
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 00:23:06 +0000 (19:23 -0500)] 
tests: (blkdiscard) use long options to improve test coverage accuracy

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: (column) add more tests
Christian Goeschel Ndjomouo [Thu, 22 Jan 2026 01:52:29 +0000 (20:52 -0500)] 
tests: (column) add more tests

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: (chrt) fix various shellcheck warnings
Christian Goeschel Ndjomouo [Thu, 29 Jan 2026 13:00:29 +0000 (08:00 -0500)] 
tests: (chrt) fix various shellcheck warnings

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: (flock) fix shellcheck warning
Christian Goeschel Ndjomouo [Thu, 29 Jan 2026 12:57:52 +0000 (07:57 -0500)] 
tests: (flock) fix shellcheck warning

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: (uuidd) fix various shellcheck warnings
Christian Goeschel Ndjomouo [Thu, 29 Jan 2026 12:55:48 +0000 (07:55 -0500)] 
tests: (uuidd) fix various shellcheck warnings

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: move schedutils tool test scripts to dedicated subdirs
Christian Goeschel Ndjomouo [Thu, 29 Jan 2026 06:16:26 +0000 (01:16 -0500)] 
tests: move schedutils tool test scripts to dedicated subdirs

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: move uuid* tool test scripts to dedicated subdirectories
Christian Goeschel Ndjomouo [Thu, 29 Jan 2026 05:53:02 +0000 (00:53 -0500)] 
tests: move uuid* tool test scripts to dedicated subdirectories

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: move test scripts from tests/ts/misc to dedicated subdir
Christian Goeschel Ndjomouo [Sun, 18 Jan 2026 17:22:36 +0000 (12:22 -0500)] 
tests: move test scripts from tests/ts/misc to dedicated subdir

This patch moves the test scripts in tests/ts/misc to subdirs
in tests/ts for each util-linux tool. It keeps the directory
structure consistent and allows to extend testing for each tool
individually. It also lays the groundwork for the test coverage
report helper script tools/testcoverage.sh.

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agochfn: allow --help and --version without login.defs restrictions
Karel Zak [Thu, 29 Jan 2026 11:50:16 +0000 (12:50 +0100)] 
chfn: allow --help and --version without login.defs restrictions

Parse command line arguments twice: first pass handles --help and
--version before restrictions are applied, second pass enforces
login.defs CHFN_RESTRICT settings for field options.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 weeks agotests: (chfn) ensure that invalid input is detected correctly
Christian Goeschel Ndjomouo [Thu, 15 Jan 2026 05:06:41 +0000 (00:06 -0500)] 
tests: (chfn) ensure that invalid input is detected correctly

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agochfn: improve man page
Christian Goeschel Ndjomouo [Fri, 16 Jan 2026 03:20:27 +0000 (22:20 -0500)] 
chfn: improve man page

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agochfn: make comment more accurate
Christian Goeschel Ndjomouo [Thu, 15 Jan 2026 23:32:50 +0000 (18:32 -0500)] 
chfn: make comment more accurate

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agochfn: fix minor grammar mistakes in comments
Christian Goeschel Ndjomouo [Thu, 15 Jan 2026 22:10:05 +0000 (17:10 -0500)] 
chfn: fix minor grammar mistakes in comments

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agochfn: use true/false bool values for semantic clarity
Christian Goeschel Ndjomouo [Thu, 15 Jan 2026 04:14:21 +0000 (23:14 -0500)] 
chfn: use true/false bool values for semantic clarity

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agochfn: use direct equality check for semantic clarity and readability
Christian Goeschel Ndjomouo [Wed, 14 Jan 2026 05:41:14 +0000 (00:41 -0500)] 
chfn: use direct equality check for semantic clarity and readability

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agochfn: free memory before return from save_new_data()
Christian Goeschel Ndjomouo [Wed, 14 Jan 2026 04:55:30 +0000 (23:55 -0500)] 
chfn: free memory before return from save_new_data()

[kzak@redhat.com: - remove error message modification]

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
Signed-off-by: Karel Zak <kzak@redhat.com>
2 weeks agochfn: use null character (0) for better readability
Christian Goeschel Ndjomouo [Wed, 14 Jan 2026 04:45:03 +0000 (23:45 -0500)] 
chfn: use null character (0) for better readability

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agochfn: fix typos, wording, and punctuation inconsistencies
Christian Goeschel Ndjomouo [Wed, 14 Jan 2026 04:21:33 +0000 (23:21 -0500)] 
chfn: fix typos, wording, and punctuation inconsistencies

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agoMerge branch 'lsfd--dont-reuse-stat-buffer' of https://github.com/masatake/util-linux
Karel Zak [Thu, 29 Jan 2026 09:33:09 +0000 (10:33 +0100)] 
Merge branch 'lsfd--dont-reuse-stat-buffer' of https://github.com/masatake/util-linux

* 'lsfd--dont-reuse-stat-buffer' of https://github.com/masatake/util-linux:
  lsfd: (bugfix) do not reuse stat(2) buffer for files with identical names
  tests: add a helper command, test_open_twice

2 weeks agolsfd: (bugfix) do not reuse stat(2) buffer for files with identical names
Masatake YAMATO [Thu, 22 Jan 2026 16:19:09 +0000 (01:19 +0900)] 
lsfd: (bugfix) do not reuse stat(2) buffer for files with identical names

To reduce the number of stat(2) calls, lsfd reused the buffer returned
from stat(2) when file descriptors opened files with the same name.

If file descriptors open different files that happen to have the same
name, lsfd may report incorrect results. In such cases, the stat(2)
buffer must not be reused.

The program a.out is run with a file name "D/a".  It opens the file
twice during its execution with an interval.  Between the two open()
calls, a different filesystem is mounted on "D".

<the source code of ./a.out>

  #include <fcntl.h>
  #include <err.h>
  #include <string.h>
  #include <stdio.h>
  #include <stdlib.h>
  #include <unistd.h>

  static void usage(const char *prog, int eval, FILE *fp)
  {
    fputs("Usage :\n", fp);
    fprintf(fp, " %s FILE\n", prog);
    exit(eval);
  }

  int main(int argc, char **argv)
  {
    const char *fname;
    int fd0, fd1;

    if (argc < 2)
      errx(2, "too few arguements");
    if (strcmp(argv[1], "-h") == 0 ||
strcmp(argv[1], "--h") == 0)
      usage(argv[0], 0, stdout);
    if (argc > 2)
      errx(2, "too many arguements");

    fname = argv[1];

    printf("pid: %d\n", getpid());
    fd0 = open(fname, O_RDONLY);
    if (fd0 < 0)
      err(1, "error in open \"%s\" in the first time", fname);

    fputs("[press RETURN to go to the next step] ", stderr);
    getchar();

    fd1 = open(fname, O_RDONLY);
    if (fd1 < 0)
      err(1, "error in open \"%s\" in the second time", fname);

    fputs("[press RETURN to exit] ", stderr);
    getchar();

    return 0;
  }

<PREPARATION>
  $ mkdir D
  $ touch D/a
  $ dd if=/dev/zero of=img.xfs count=1 bs=400MB
  1+0 records in
  1+0 records out
  400000000 bytes (400 MB, 381 MiB) copied, 0.427125 s, 936 MB/s
  $ mkfs.xfs img.xfs
  meta-data=img.xfs                isize=512    agcount=4, agsize=24414 blks
   =                       sectsz=512   attr=2, projid32bit=1
   =                       crc=1        finobt=1, sparse=1, rmapbt=1
   =                       reflink=1    bigtime=1 inobtcount=1 nrext64=1
   =                       exchange=0   metadir=0
  data     =                       bsize=4096   blocks=97656, imaxpct=25
   =                       sunit=0      swidth=0 blks
  naming   =version 2              bsize=4096   ascii-ci=0, ftype=1, parent=0
  log      =internal log           bsize=4096   blocks=16384, version=2
   =                       sectsz=512   sunit=0 blks, lazy-count=1
  realtime =none                   extsz=4096   blocks=0, rtextents=0
   =                       rgcount=0    rgsize=0 extents
   =                       zoned=0      start=0 reserved=0
  $ sudo mount img.xfs D
  $ sudo touch D/a
  $ sudo umount D

Let's see the bug.

<TERMNAL-1>
  $ ./a.out D/a
  pid: 770257
  [press RETURN to go to the next step]

<TERMNAL-2>
  $ sudo mount img.xfs D

<TERMNAL-1>
  (press RETURN)
  [press RETURN to exit]

<TERMNAL-2>
  $ ./lsfd-orignal -p 770257 -Q 'FD > 2'
  COMMAND    PID   USER ASSOC  XMODE TYPE SOURCE MNTID    INODE NAME
  a.out   770257 yamato     3 r-----  REG   dm-3    95 30947324 /home/yamato/D/a
  a.out   770257 yamato     4 r-----  REG   dm-3  1631 30947324 /home/yamato/D/a

  $ stat D/a
    File: D/a
    Size: 0               Blocks: 0          IO Block: 4096   regular empty file
  Device: 7,10    Inode: 131         Links: 1
  ...

Although D/a has inode number 131, lsfd-original reports 30947324.
After removing the code that reuses the stat(2) buffer, lsfd-new reports:

<TERMNAL-2>
  $ ./lsfd-new -p 770257 -Q 'FD > 2'
  COMMAND    PID   USER ASSOC  XMODE TYPE SOURCE MNTID    INODE NAME
  a.out   770257 yamato     3 r-----  REG   dm-3    95 30947324 /home/yamato/D/a
  a.out   770257 yamato     4 r-----  REG loop10  1631      131 /home/yamato/D/a

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 weeks agoAUTHORS: add copyfilerange
Karel Zak [Wed, 28 Jan 2026 12:14:10 +0000 (13:14 +0100)] 
AUTHORS: add copyfilerange

Signed-off-by: Karel Zak <kzak@redhat.com>
2 weeks agoMerge branch 'copyfilerange' of https://github.com/meeuw/util-linux
Karel Zak [Wed, 28 Jan 2026 12:12:28 +0000 (13:12 +0100)] 
Merge branch 'copyfilerange' of https://github.com/meeuw/util-linux

* 'copyfilerange' of https://github.com/meeuw/util-linux:
  copyfilerange: new command to call copy-file-range

2 weeks agoMerge branch 'maybe' of https://github.com/stoeckmann/util-linux
Karel Zak [Wed, 28 Jan 2026 12:03:59 +0000 (13:03 +0100)] 
Merge branch 'maybe' of https://github.com/stoeckmann/util-linux

* 'maybe' of https://github.com/stoeckmann/util-linux:
  Fix typos
  setpriv: (man) Fix grammar
  Documentation: Fix "maybe be" typo

2 weeks agoMerge branch 'nsenter_pidfd_inode' of https://github.com/cgoesche/util-linux-fork
Karel Zak [Wed, 28 Jan 2026 12:01:09 +0000 (13:01 +0100)] 
Merge branch 'nsenter_pidfd_inode' of https://github.com/cgoesche/util-linux-fork

* 'nsenter_pidfd_inode' of https://github.com/cgoesche/util-linux-fork:
  nsenter: support 'PID:inode' process address format

2 weeks agocopyfilerange: new command to call copy-file-range
Dick Marinus [Tue, 2 Dec 2025 19:51:35 +0000 (20:51 +0100)] 
copyfilerange: new command to call copy-file-range

This command allows you to call the copy-file range system call which
performs an in-kernel copy between two files without the additional cost
of transferring data from the kernel to user space and then back into
the kernel.

It gives filesystems an opportunity to implement "copy acceleration"
techniques, such as the use of reflinks (i.e., two or more inodes that
share  pointers to the same copy-on-write disk blocks) or
server-side-copy (in the case of NFS).

A purpose of this command is to in-place deduplicate equal file blocks
in two different files.

When calling this command the source and destination file are required
and ranges must be supplied using command line arguments or from a
ranges file.

A file range contains the offset in the source and destination file and
the length of the range in bytes. The offsets can be omitted so that the
current file pointer is used. When the size is omitted or set to zero
the remainder of the file is copied.

If the file range is too long to fit in SIZE_MAX subsequential calls to
copy_file_range will be performed to copy the whole range.

The following command will copy/reflink a file:

$ copyfilerange file1 file2 0::

The following command will copy the second block from file1 into file2:

        $ copyfilerange file1 file2 4096:4096:4096

Signed-off-by: Dick Marinus <dick@mrns.nl>
2 weeks agoFix typos
Tobias Stoeckmann [Tue, 27 Jan 2026 17:19:46 +0000 (18:19 +0100)] 
Fix typos

Typos found with codespell.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 weeks agosetpriv: (man) Fix grammar
Tobias Stoeckmann [Tue, 27 Jan 2026 17:03:01 +0000 (18:03 +0100)] 
setpriv: (man) Fix grammar

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 weeks agoDocumentation: Fix "maybe be" typo
Tobias Stoeckmann [Tue, 27 Jan 2026 17:01:56 +0000 (18:01 +0100)] 
Documentation: Fix "maybe be" typo

No functional change.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2 weeks agoMerge branch 'arm-ids' of https://github.com/mstorsjo/util-linux
Karel Zak [Tue, 27 Jan 2026 12:10:43 +0000 (13:10 +0100)] 
Merge branch 'arm-ids' of https://github.com/mstorsjo/util-linux

* 'arm-ids' of https://github.com/mstorsjo/util-linux:
  lscpu: Implement options for dumping ARM implementer/model name tables

2 weeks agonsenter: support 'PID:inode' process address format
Christian Goeschel Ndjomouo [Mon, 12 Jan 2026 04:14:18 +0000 (23:14 -0500)] 
nsenter: support 'PID:inode' process address format

The 'PID:inode' can be used for the --target option
to uniquely identify a process in a race-free manner.

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agoMerge branch 'pidutils_improve' of https://github.com/cgoesche/util-linux-fork
Karel Zak [Tue, 27 Jan 2026 10:37:28 +0000 (11:37 +0100)] 
Merge branch 'pidutils_improve' of https://github.com/cgoesche/util-linux-fork

* 'pidutils_improve' of https://github.com/cgoesche/util-linux-fork:
  lib: (pidutils) improve the return protocol
  lib: (pidutils) add a routine to parse pids and err() on failure
  lib: (pidutils) improve 'PID:inode' parsing logic

2 weeks agoMerge branch 'pager_removals' of https://github.com/stoeckmann/util-linux
Karel Zak [Tue, 27 Jan 2026 10:35:51 +0000 (11:35 +0100)] 
Merge branch 'pager_removals' of https://github.com/stoeckmann/util-linux

* 'pager_removals' of https://github.com/stoeckmann/util-linux:
  lib/pager: Fix typos
  lib/pager: Simplify wait_for_pager
  lib/pager: Merge wait_or_whine into wait_for_pager
  lib/pager: The variable need_in is always 1
  lib/pager: Remove struct field `no_stdin`
  lib/pager: Remove struct field preexec_cb
  lib/pager: Remove unused define
  lib/pager: Remove unused struct entry `err`
  lib/pager: Remove unused struct field "out"

2 weeks agoMerge branch 'PR/libpath-nonnull-check' of https://github.com/karelzak/util-linux...
Karel Zak [Tue, 27 Jan 2026 10:35:07 +0000 (11:35 +0100)] 
Merge branch 'PR/libpath-nonnull-check' of https://github.com/karelzak/util-linux-work

* 'PR/libpath-nonnull-check' of https://github.com/karelzak/util-linux-work:
  lib/path: add NULL checks for path in statx and access

2 weeks agolscpu: Implement options for dumping ARM implementer/model name tables
Martin Storsjö [Thu, 22 Jan 2026 22:56:56 +0000 (00:56 +0200)] 
lscpu: Implement options for dumping ARM implementer/model name tables

This allows extracting the contents of the tables, which itself
is uncopyrightable, for use in other projects with different
code licenses.

2 weeks agolsns: make the synopsis more coherent
Christian Goeschel Ndjomouo [Tue, 27 Jan 2026 01:14:02 +0000 (20:14 -0500)] 
lsns: make the synopsis more coherent

Using _namespace ID_ in the synopsis as argument definition
is more coherent as it lets a user easily infer that a
numeric value is required to identify a namespace.

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agolib: (pidutils) improve the return protocol
Christian Goeschel Ndjomouo [Mon, 26 Jan 2026 14:29:33 +0000 (09:29 -0500)] 
lib: (pidutils) improve the return protocol

Instead of using generic return codes, lets
be more precise and return negative errno
numbers and set errno accordingly, so that
higher level callers can report errors more
accurately.

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
2 weeks agotests: add a helper command, test_open_twice
Masatake YAMATO [Thu, 22 Jan 2026 17:56:46 +0000 (02:56 +0900)] 
tests: add a helper command, test_open_twice

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 weeks agoMerge branch 'spelling' of https://github.com/jwilk-forks/util-linux
Karel Zak [Mon, 26 Jan 2026 10:13:31 +0000 (11:13 +0100)] 
Merge branch 'spelling' of https://github.com/jwilk-forks/util-linux

* 'spelling' of https://github.com/jwilk-forks/util-linux:
  setpriv: (man) fix typo

2 weeks agolscpu: remove duplicate ARM names, clean up names
Karel Zak [Mon, 26 Jan 2026 09:37:49 +0000 (10:37 +0100)] 
lscpu: remove duplicate ARM names, clean up names

* Remove duplicate ARM core names
* Remove unwanted blank characters from core names

References: https://github.com/util-linux/util-linux/pull/3882
Reported-by: Martin Storsjö
Signed-off-by: Karel Zak <kzak@redhat.com>
3 weeks agosetpriv: (man) fix typo
Jakub Wilk [Sat, 24 Jan 2026 10:51:01 +0000 (11:51 +0100)] 
setpriv: (man) fix typo

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
3 weeks agolib: (pidutils) add a routine to parse pids and err() on failure
Christian Goeschel Ndjomouo [Tue, 13 Jan 2026 20:18:27 +0000 (15:18 -0500)] 
lib: (pidutils) add a routine to parse pids and err() on failure

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
3 weeks agolib: (pidutils) improve 'PID:inode' parsing logic
Christian Goeschel Ndjomouo [Wed, 14 Jan 2026 14:51:58 +0000 (09:51 -0500)] 
lib: (pidutils) improve 'PID:inode' parsing logic

The parsing logic in ul_parse_pid_str() failed to
identify invalid input when *pidstr starts with a
colon ':' followed by a number (inode), and also
in cases where the input does not consist of any
digits. And lastly if the PID or inode is 0.

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
3 weeks agoMerge branch 'PR/libfdisk-EBR-gap' of https://github.com/karelzak/util-linux-work
Karel Zak [Thu, 22 Jan 2026 19:03:20 +0000 (20:03 +0100)] 
Merge branch 'PR/libfdisk-EBR-gap' of https://github.com/karelzak/util-linux-work

* 'PR/libfdisk-EBR-gap' of https://github.com/karelzak/util-linux-work:
  tests: simplify TS_DESC in fdisk/mbr-logical-ebr-gap
  libfdisk: remove duplicate code
  tests: (fdisk) make sure test_strerror avalable
  tests: fdisk: add regression test for missing EBR gap between logical partitions
  libfdisk: (dos) fix logical partition start

3 weeks agotests: simplify TS_DESC in fdisk/mbr-logical-ebr-gap
Karel Zak [Thu, 22 Jan 2026 16:47:23 +0000 (17:47 +0100)] 
tests: simplify TS_DESC in fdisk/mbr-logical-ebr-gap

Signed-off-by: Karel Zak <kzak@redhat.com>
3 weeks agolibfdisk: remove duplicate code
Karel Zak [Thu, 22 Jan 2026 16:44:25 +0000 (17:44 +0100)] 
libfdisk: remove duplicate code

References: 8b8da020f57414c90981371da71fdf32d2253ac7
Signed-off-by: Karel Zak <kzak@redhat.com>
3 weeks agotests: (fdisk) make sure test_strerror avalable
Karel Zak [Thu, 22 Jan 2026 16:43:15 +0000 (17:43 +0100)] 
tests: (fdisk) make sure test_strerror avalable

Signed-off-by: Karel Zak <kzak@redhat.com>
3 weeks agoMerge branch 'master' of https://github.com/martinjungblut/util-linux into PR/libfdis...
Karel Zak [Thu, 22 Jan 2026 16:29:51 +0000 (17:29 +0100)] 
Merge branch 'master' of https://github.com/martinjungblut/util-linux into PR/libfdisk-EBR-gap

* 'master' of https://github.com/martinjungblut/util-linux:
  tests: fdisk: add regression test for missing EBR gap between logical partitions
  libfdisk: (dos) fix logical partition start

3 weeks agolsfd: fix dependency on errnos.h
Masatake YAMATO [Thu, 22 Jan 2026 14:41:54 +0000 (23:41 +0900)] 
lsfd: fix dependency on errnos.h

Fix a bug that I introduced in 764f1d396f.

Makemodule.am listed a dependency on errnos.h for file.c, but the header
is actually used by error.c.  Fix the dependency to ensure correct
rebuilds.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
3 weeks agolsfd: make sure errors array is not empty [-Werror=type-limits]
Karel Zak [Wed, 21 Jan 2026 10:56:54 +0000 (11:56 +0100)] 
lsfd: make sure errors array is not empty [-Werror=type-limits]

lsfd-cmd/error.c: In function ‘get_errno_name’:
lsfd-cmd/error.c:49:30: error: comparison of unsigned expression in ‘< 0’ is always false [-Werror=type-limits]
   49 |         for (size_t i = 0; i < ARRAY_SIZE(errnos); i ++) {
      |                              ^

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