]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
2 years agolibmount: ifdef statx() call
Karel Zak [Thu, 3 Aug 2023 10:39:19 +0000 (12:39 +0200)] 
libmount: ifdef statx() call

In this case the statx() is use to get mount ID. It's optional and not
required. Let's #ifdef the statx() call and also check for stx_mnt_id
struct member.

Fixes: https://github.com/util-linux/util-linux/issues/2415
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'bug911336' of https://github.com/floppym/util-linux
Karel Zak [Thu, 3 Aug 2023 10:11:06 +0000 (12:11 +0200)] 
Merge branch 'bug911336' of https://github.com/floppym/util-linux

* 'bug911336' of https://github.com/floppym/util-linux:
  wall: do not error for ttys that do not exist

2 years agoMerge branch 'highsierra' of https://github.com/pali/util-linux
Karel Zak [Thu, 3 Aug 2023 10:09:29 +0000 (12:09 +0200)] 
Merge branch 'highsierra' of https://github.com/pali/util-linux

* 'highsierra' of https://github.com/pali/util-linux:
  libblkid: iso9660: Implement full High Sierra CDROM format support
  libblkid: iso9660: Define all fields in iso_volume_descriptor according to ECMA-119 4th edition spec

2 years agoMerge branch 'mkfds--INET-alter-the-ports' of https://github.com/masatake/util-linux
Karel Zak [Thu, 3 Aug 2023 10:08:43 +0000 (12:08 +0200)] 
Merge branch 'mkfds--INET-alter-the-ports' of https://github.com/masatake/util-linux

* 'mkfds--INET-alter-the-ports' of https://github.com/masatake/util-linux:
  tests: (lsfd::mkfds-*) alter the L4 ports for avoiding the conflict with option-inet test case

2 years agoMerge branch 'tests--TESTS_COMPONENTS' of https://github.com/masatake/util-linux
Karel Zak [Thu, 3 Aug 2023 10:07:55 +0000 (12:07 +0200)] 
Merge branch 'tests--TESTS_COMPONENTS' of https://github.com/masatake/util-linux

* 'tests--TESTS_COMPONENTS' of https://github.com/masatake/util-linux:
  tests,autotools: add TESTS_COMPONENTS macro for specfying test components from make cmdline

2 years agoMerge branch 'lsfds--dont-run-unix-stream-test-on-qemu-user' of https://github.com...
Karel Zak [Thu, 3 Aug 2023 10:07:33 +0000 (12:07 +0200)] 
Merge branch 'lsfds--dont-run-unix-stream-test-on-qemu-user' of https://github.com/masatake/util-linux

* 'lsfds--dont-run-unix-stream-test-on-qemu-user' of https://github.com/masatake/util-linux:
  tests: (lsfd) don't run the unix-stream testcase including newlines in the path on qemu-user
  lsfd: (refactor) unify the invocations of  sysfs_get_byteorder()

2 years agoMerge branch 'lsclocks/rtc' of https://github.com/t-8ch/util-linux
Karel Zak [Thu, 3 Aug 2023 10:06:24 +0000 (12:06 +0200)] 
Merge branch 'lsclocks/rtc' of https://github.com/t-8ch/util-linux

* 'lsclocks/rtc' of https://github.com/t-8ch/util-linux:
  lsclocks: add support for RTC
  lsclocks: factor out path based clocks

2 years agoinclude: define pidfd syscalls if needed
Markus Mayer [Tue, 1 Aug 2023 20:08:24 +0000 (13:08 -0700)] 
include: define pidfd syscalls if needed

If the kernel headers are too old to provide the pidfd syscall numbers,
let's define them ourselves. This can be helpful while cross-compiling.
The runtime environment may provide a kernel that is new enough to
handle the calls, even if the toolchain doesn't.

Signed-off-by: Markus Mayer <mmayer@broadcom.com>
2 years agolibmount: check for struct statx
Markus Mayer [Tue, 1 Aug 2023 19:59:27 +0000 (12:59 -0700)] 
libmount: check for struct statx

Let's ensure struct statx exists before we try to use it. Checking for
the existence of linux/stat.h is not sufficient. This is because
[uapi/]linux/stat.h has existed since Linux 3.7, however struct statx
was only introduced with Linux 4.11.

The problem arises if one happens ot be using kernel headers from within
the aforementioned range, such as Linux 4.9.

  CC       libmount/src/la-utils.lo
In file included from libmount/src/utils.c:31:
./include/fileutils.h:100:33: warning: declaration of 'struct statx' will not
be visible outside of this function [-Wvisibility]
                    unsigned int mask, struct statx *stx)
                                              ^
libmount/src/utils.c:117:16: error: variable has incomplete type 'struct statx'
                struct statx stx = { 0 };
                             ^
libmount/src/utils.c:117:10: note: forward declaration of 'struct statx'
                struct statx stx = { 0 };
                       ^
libmount/src/utils.c:125:5: error: use of undeclared identifier 'STATX_TYPE'
                                STATX_TYPE
                                ^
libmount/src/utils.c:126:8: error: use of undeclared identifier 'STATX_MODE'
                                        | STATX_MODE
                                          ^
libmount/src/utils.c:127:8: error: use of undeclared identifier 'STATX_INO'
                                        | STATX_INO,
                                          ^
1 warning and 4 errors generated.
make[4]: *** [Makefile:11269: libmount/src/la-utils.lo] Error 1

Checking for the presence of struct statx explicitly avoids this
problem.

Signed-off-by: Markus Mayer <mmayer@broadcom.com>
2 years agolibmount: check for linux/mount.h
Markus Mayer [Tue, 1 Aug 2023 19:59:26 +0000 (12:59 -0700)] 
libmount: check for linux/mount.h

Check that linux/mount.h is present before using features that rely on
it.

It is necessary to check for the presence of linux/mount.h explicitly.
Simply relying on the presence of several syscalls (e.g. SYS_move_mount,
SYS_open_tree) does not work reliably, at least not in a cross-compiling
environment.

The syscall definitions are provided by the C library. Meanwhile,
linux/mount.h is provided by the kernel. This opens the possibility for
discrepancies.

A problem arises if the C library (e.g. musl-1.2.3) defines all "mount
fd API" syscalls (and HAVE_MOUNTFD_API becomes true), but the kernel
headers are old enough to not provide linux/mount.h. The resulting error
looks as follows. This example is using an LLVM-13 cross-compiler from
x86_64 to aarch64 with musl-1.2.3 as the C library.

  CC       libmount/src/la-hooks.lo
In file included from libmount/src/hooks.c:30:
./include/mount-api-utils.h:11:10: fatal error: 'linux/mount.h' file not found
         ^~~~~~~~~~~~~~~
1 error generated.
make[4]: *** [Makefile:11185: libmount/src/la-hooks.lo] Error 1

To prevent this condition, we add a check to configure that will test
for the presence of linux/mount.h in addition to testing for the mount
fd API. Only if both conditions are met can we actually use the mount
fd API.

Signed-off-by: Markus Mayer <mmayer@broadcom.com>
2 years agoMerge branch 'mount/statx-enosys' of https://github.com/t-8ch/util-linux
Karel Zak [Thu, 3 Aug 2023 10:01:49 +0000 (12:01 +0200)] 
Merge branch 'mount/statx-enosys' of https://github.com/t-8ch/util-linux

* 'mount/statx-enosys' of https://github.com/t-8ch/util-linux:
  libmount: (utils) fix statx fallback

2 years agoMerge branch 'PR/libmount-fake' of github.com:karelzak/util-linux-work
Karel Zak [Thu, 3 Aug 2023 10:00:43 +0000 (12:00 +0200)] 
Merge branch 'PR/libmount-fake' of github.com:karelzak/util-linux-work

* 'PR/libmount-fake' of github.com:karelzak/util-linux-work:
  libmount: cleanup --fake mode

2 years agolibmount: don't canonicalize symlinks for bind operation
Karel Zak [Thu, 3 Aug 2023 09:43:28 +0000 (11:43 +0200)] 
libmount: don't canonicalize symlinks for bind operation

The new kernel mount API can bind over symlink by default.

Unfortunately, libmount always canonicalizes all paths (due to
backward compatibility, search in mountinfo, search in fstab, etc.).

Possible workaround is -c, --no-canonicalize but it disable all paths
canonicalization, tags to paths conversions etc.

This patch disables the canonicalization only for the target path
(if symlink) on bind operation.

Fixes: https://github.com/util-linux/util-linux/issues/2370
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibmount: (utils) fix statx fallback
Thomas Weißschuh [Thu, 3 Aug 2023 05:13:28 +0000 (07:13 +0200)] 
libmount: (utils) fix statx fallback

If the systemcall is not available ENOSYS is returned.

Under glibc the statx implementation also has its own fallback logic.
As AT_STATX_DONT_SYNC can't be implemented correctly in that fallback
logic the wrapper will return EINVAL in case the emulation is needed and
AT_STATX_DONT_SYNC is set.
So also use our own fallback in that case.

Fixes: #2409
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agowall: do not error for ttys that do not exist
Mike Gilbert [Sat, 29 Jul 2023 21:32:57 +0000 (17:32 -0400)] 
wall: do not error for ttys that do not exist

Some wayland display managers (GDM) put strings like "seat0" in the
ut_line field of utmp entries. These are not valid tty devices.

Avoid writing a confusing error message for ttys that do not exist.

Bug: https://bugs.gentoo.org/911336
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
2 years agolsclocks: add support for RTC
Thomas Weißschuh [Tue, 11 Jul 2023 19:01:05 +0000 (21:01 +0200)] 
lsclocks: add support for RTC

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolsclocks: factor out path based clocks
Thomas Weißschuh [Tue, 11 Jul 2023 18:33:41 +0000 (20:33 +0200)] 
lsclocks: factor out path based clocks

They will also be used by the RTC implementation.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agocolumn: fix -l
Karel Zak [Wed, 2 Aug 2023 10:57:37 +0000 (12:57 +0200)] 
column: fix -l

The original implementation is complicated and broken.

It's possible to calculate the rest of the string (for the last
column) from the current position rather than calculate it
continuously. Use the last wcstok() result also means that it will
work as expected independently on "greedy" mode (skips repeating
separators.

 # printf 'a   b c d\n1 2 3 4\n' | ./column -t -o '|' -l3
 a|b|c d
 1|2|3 4

(see space between 'a' and 'b' on input)

References: 8ac75e31de0ece74515e98e0b22e54cc0a9808bd
Fixes: https://github.com/util-linux/util-linux/issues/1763
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibblkid: iso9660: Implement full High Sierra CDROM format support
Pali Rohár [Tue, 1 Aug 2023 21:09:52 +0000 (23:09 +0200)] 
libblkid: iso9660: Implement full High Sierra CDROM format support

Specification of High Sierra CDROM format was lost for a longer time, but
now was found again. So this change improves parsing High Sierra CDROM
images and implements everything which is already supported for ISO9660.

High Sierra and ISO9660 are very similar and there are only few differences
in headers. Most visible is that High Sierra has additional 8 bytes at
beginning of each descriptor with Volume Descriptor LBN value, it has more
locations of path table occurrences in Volume descriptor, has shorten
copyright and abstract file ids, bibliographic file id is missing, standard
version is 0 and it does not have timezone offset field in date structure.
Thus positions of some fields are different between High Sierra and ISO9960.

Code in iso9660.c is adjusted to handle both formats, instead implementing
two very similar parsers.

CDROM image of Microsoft Programmers Library 1.0 (MSPL10) from 1988, which
is in High Sierra format, was before this change parsed as:

ID_FS_BLOCK_SIZE=2048
ID_FS_VERSION=High\x20Sierra
ID_FS_LABEL=MS_PL_VERSION_100
ID_FS_LABEL_ENC=MS_PL_VERSION_100
ID_FS_TYPE=iso9660
ID_FS_USAGE=filesystem

And after this change as:

ID_FS_FSBLOCKSIZE=2048
ID_FS_BLOCK_SIZE=2048
ID_FS_FSSIZE=542998528
ID_FS_PUBLISHER_ID=MICROSOFTCORPORATION16011NE36THWAYREDMONDWA98073
ID_FS_DATA_PREPARER_ID=MERIDIAN_DATA_CD_PUBLISHER
ID_FS_APPLICATION_ID=PL
ID_FS_UUID=1988-07-12-00-37-37-00
ID_FS_UUID_ENC=1988-07-12-00-37-37-00
ID_FS_VERSION=High\x20Sierra
ID_FS_LABEL=MS_PL_VERSION_100
ID_FS_LABEL_ENC=MS_PL_VERSION_100
ID_FS_TYPE=iso9660
ID_FS_USAGE=filesystem

Scan of original hardcopy High Sierra specification:
https://www.os2museum.com/files/docs/cdrom/CDROM_Working_Paper-1986.pdf

HTML version of High Sierra specification:
https://www.os2museum.com/files/docs/cdrom/hsg_wp.html

Archived hardcopy of High Sierra specification:
https://archive.org/details/cdrom-working-paper-1986

Story behind Looking for High Sierra:
https://www.os2museum.com/wp/looking-for-high-sierra/

2 years agolibblkid: iso9660: Define all fields in iso_volume_descriptor according to ECMA-119...
Pali Rohár [Tue, 1 Aug 2023 20:17:10 +0000 (22:17 +0200)] 
libblkid: iso9660: Define all fields in iso_volume_descriptor according to ECMA-119 4th edition spec

2 years agotests,autotools: add TESTS_COMPONENTS macro for specfying test components from make...
Masatake YAMATO [Tue, 1 Aug 2023 17:12:02 +0000 (02:12 +0900)] 
tests,autotools: add TESTS_COMPONENTS macro for specfying test components from make cmdline

An example cmdline:

$ make check TESTS_COMPONENTS=lsfd

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agotests: (lsfd::mkfds-*) alter the L4 ports for avoiding the conflict with option-inet...
Masatake YAMATO [Tue, 1 Aug 2023 16:50:38 +0000 (01:50 +0900)] 
tests: (lsfd::mkfds-*) alter the L4 ports for avoiding the conflict with option-inet test case

Close #2397

The conflict appears in parallel execution.
This change just mitigates the original issue.
An ideal solution is that finding unused ports if bind(2) is failed.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agotests: (lsfd) don't run the unix-stream testcase including newlines in the path on...
Masatake YAMATO [Tue, 1 Aug 2023 16:06:40 +0000 (01:06 +0900)] 
tests: (lsfd) don't run the unix-stream testcase including newlines in the path on qemu-user

Close #2402.

The communication code for retrieving unix socket information doesn't
consider the byteorder now.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: (refactor) unify the invocations of sysfs_get_byteorder()
Masatake YAMATO [Tue, 1 Aug 2023 15:53:46 +0000 (00:53 +0900)] 
lsfd: (refactor) unify the invocations of  sysfs_get_byteorder()

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolscpu: Even more Arm part numbers (early 2023)
Jeremy Linton [Wed, 26 Jul 2023 20:54:20 +0000 (15:54 -0500)] 
lscpu: Even more Arm part numbers (early 2023)

There have been further MIDR/part numbers published
on https://developer.arm.com, they include:

Cortex-X4, Cortex-A520, Cortex-A720, Cortex-M85,
Cortex-M55 and Cortex-R52+.

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
2 years agolibmount: cleanup --fake mode
Karel Zak [Tue, 1 Aug 2023 12:49:48 +0000 (14:49 +0200)] 
libmount: cleanup --fake mode

It was originally designed to play nasty games with /etc/mtab (mount
when /etc is read-only and update later when it's write-able).

The --fake is completely useless with the new API due to complexity
where we cannot skip any step, because the next stuff depends on it.
So, it makes more sense skip all functionality where libmount does
anything significant.

This commit add --fake check to hooks logic to skip all hooks as the
hooks are place where libmount implements mount related invasive
operations (create mountpoint, namespaces, create superblock, move,
mount, etc.).

Frankly, --fake without mtab is useless.

Fixes: https://github.com/util-linux/util-linux/issues/2395
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'lsfd--fix-2399-use-fifo-in-test-cases' of https://github.com/masatake...
Karel Zak [Tue, 1 Aug 2023 08:43:59 +0000 (10:43 +0200)] 
Merge branch 'lsfd--fix-2399-use-fifo-in-test-cases' of https://github.com/masatake/util-linux

* 'lsfd--fix-2399-use-fifo-in-test-cases' of https://github.com/masatake/util-linux:
  tests: (lsfd::option-inet) get child-processes' pids via fifo

2 years agoMerge branch 'cachestat' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 1 Aug 2023 08:42:06 +0000 (10:42 +0200)] 
Merge branch 'cachestat' of https://github.com/t-8ch/util-linux

* 'cachestat' of https://github.com/t-8ch/util-linux:
  fincore: report data from cachestat()
  fincore: refactor output formatting
  fincore: add --output-all

2 years agofincore: report data from cachestat()
Thomas Weißschuh [Mon, 31 Jul 2023 16:00:11 +0000 (18:00 +0200)] 
fincore: report data from cachestat()

The cachestat() syscall was introduced in Linux 6.5 and reports data
that complements that from mincore().

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agofincore: refactor output formatting
Thomas Weißschuh [Mon, 31 Jul 2023 16:00:08 +0000 (18:00 +0200)] 
fincore: refactor output formatting

This will make the upcoming addition of cachestat() columns nicer.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agofincore: add --output-all
Thomas Weißschuh [Mon, 31 Jul 2023 16:00:05 +0000 (18:00 +0200)] 
fincore: add --output-all

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolsclocks: add support for cpu clocks
Thomas Weißschuh [Mon, 31 Jul 2023 15:49:11 +0000 (17:49 +0200)] 
lsclocks: add support for cpu clocks

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolsclocks: improve dynamic clocks docs and completion
Thomas Weißschuh [Mon, 31 Jul 2023 15:49:07 +0000 (17:49 +0200)] 
lsclocks: improve dynamic clocks docs and completion

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolsclocks: don't fail without dynamic clocks
Thomas Weißschuh [Mon, 31 Jul 2023 15:49:04 +0000 (17:49 +0200)] 
lsclocks: don't fail without dynamic clocks

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agotests: (lsfd::option-inet) get child-processes' pids via fifo
Masatake YAMATO [Mon, 31 Jul 2023 11:32:18 +0000 (20:32 +0900)] 
tests: (lsfd::option-inet) get child-processes' pids via fifo

Close #2399.

The original code assumes the background processes prepare sockets enough
fast. #2399 showed the assumption was wrong; lsfd reported half-cooked
sockets.

To avoid the timing issue, the test case with this change uses a fifo
to receive pids from the child test_mkfds processes. test_mkfds reports
its pid after cooking the sockets. When the option-inet script recives the pid,
we can expect the sockets are ready.

Note: bash's coproc cannot be used here; it supports only one co-process at
once.

Analysed-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agoMerge branch 'fincore-test' of https://github.com/zeha/util-linux
Karel Zak [Mon, 31 Jul 2023 10:44:17 +0000 (12:44 +0200)] 
Merge branch 'fincore-test' of https://github.com/zeha/util-linux

* 'fincore-test' of https://github.com/zeha/util-linux:
  fincore: (tests) fix double log output

2 years agochrt: (man) add note about --sched-period lower limit
Karel Zak [Mon, 31 Jul 2023 10:41:39 +0000 (12:41 +0200)] 
chrt: (man) add note about --sched-period lower limit

References: https://github.com/util-linux/util-linux/pull/2393
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'chrt/fixes' of https://github.com/t-8ch/util-linux
Karel Zak [Mon, 31 Jul 2023 10:31:35 +0000 (12:31 +0200)] 
Merge branch 'chrt/fixes' of https://github.com/t-8ch/util-linux

* 'chrt/fixes' of https://github.com/t-8ch/util-linux:
  ci: (codeql) ignore cpp/uncontrolled-process-operation
  chrt: allow option separator
  chrt: (tests) don't mark tests as known failed
  chrt: (tests) increase deadline test parameters

2 years agoMerge branch 'lsfd--handle-newline-in-unix-socket-path' of https://github.com/masatak...
Karel Zak [Mon, 31 Jul 2023 10:29:01 +0000 (12:29 +0200)] 
Merge branch 'lsfd--handle-newline-in-unix-socket-path' of https://github.com/masatake/util-linux

* 'lsfd--handle-newline-in-unix-socket-path' of https://github.com/masatake/util-linux:
  lsfd: (test) add a case for testing a unix socket including newline characters in its path name
  lsfd: re-fill unix socket paths with sockdiag netlink interface
  lsfd: add comment listing functions names importing via #include
  lsfd: include common headers in lsfd.h
  lsfd: include system header files first
  lsfd: fix a misleading parameter name
  lsfd: add const modifier

2 years agoMerge branch 'lsfd--bpf-prog' of https://github.com/masatake/util-linux
Karel Zak [Mon, 31 Jul 2023 10:13:24 +0000 (12:13 +0200)] 
Merge branch 'lsfd--bpf-prog' of https://github.com/masatake/util-linux

* 'lsfd--bpf-prog' of https://github.com/masatake/util-linux:
  test: (lsfd) add a case for testing BPF-PROG.TYPE and BPF-PROG.TYPE.RAW columns
  test: (mkfds::bpf-prog) new factory
  lsfd: add BPF-PROG.TYPE, BPF-PROG.TYPE.RAW, and BPF-PROG.ID columns

2 years agoMerge branch 'last-reboot-crash-reporting' of https://github.com/troyrollo/util-linux
Karel Zak [Mon, 31 Jul 2023 10:10:26 +0000 (12:10 +0200)] 
Merge branch 'last-reboot-crash-reporting' of https://github.com/troyrollo/util-linux

* 'last-reboot-crash-reporting' of https://github.com/troyrollo/util-linux:
  login-utils: Report crashes on reboot lines insted of overlapping uptimes

2 years agoMerge branch 'fincore-block' of https://github.com/dancerj/util-linux
Karel Zak [Mon, 31 Jul 2023 09:48:37 +0000 (11:48 +0200)] 
Merge branch 'fincore-block' of https://github.com/dancerj/util-linux

* 'fincore-block' of https://github.com/dancerj/util-linux:
  iterate according to review comments.
  Support device files.

2 years agofincore: (tests) fix double log output
Chris Hofstaedtler [Tue, 18 Jul 2023 21:34:51 +0000 (23:34 +0200)] 
fincore: (tests) fix double log output

The fincore tests call ts_log_both inside an output redirection of both stdout
and stderr, leading to the ts_log_both output ending up twice in both stdout
and stderr.
Call ts_log_both before setting up the output redirection.

Signed-off-by: Chris Hofstaedtler <zeha@debian.org>
2 years agoci: (codeql) ignore cpp/uncontrolled-process-operation
Thomas Weißschuh [Thu, 27 Jul 2023 05:21:02 +0000 (07:21 +0200)] 
ci: (codeql) ignore cpp/uncontrolled-process-operation

In the context of util-linux these are mostly false positives.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agochrt: allow option separator
Thomas Weißschuh [Wed, 26 Jul 2023 14:33:09 +0000 (16:33 +0200)] 
chrt: allow option separator

Allow the option separator "--".
It works in other, similar tools like nice and ionice.

Example:

chrt 1 -- id

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agochrt: (tests) don't mark tests as known failed
Thomas Weißschuh [Wed, 26 Jul 2023 14:33:05 +0000 (16:33 +0200)] 
chrt: (tests) don't mark tests as known failed

The broken CI platform is not used anymore.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agochrt: (tests) increase deadline test parameters
Thomas Weißschuh [Wed, 26 Jul 2023 14:32:59 +0000 (16:32 +0200)] 
chrt: (tests) increase deadline test parameters

Since kernel commit
b4098bfc5efb ("sched/deadline: Impose global limits on sched_attr::sched_period")
the value for dl_period has a lower bound of 100us.
Adjust the test parameters so the test can work on newer kernels.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolsfd: (test) add a case for testing a unix socket including newline characters in...
Masatake YAMATO [Sun, 23 Jul 2023 05:43:36 +0000 (14:43 +0900)] 
lsfd: (test) add a case for testing a unix socket including newline characters in its path name

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: re-fill unix socket paths with sockdiag netlink interface
Masatake YAMATO [Fri, 21 Jul 2023 19:02:38 +0000 (04:02 +0900)] 
lsfd: re-fill unix socket paths with sockdiag netlink interface

This commit is mostly based on Thomas Weißschuh's work,
https://github.com/t-8ch/util-linux/commit/06030390a5e6a16cc4b914bbf5fcedd3b6d83608.

Unlike the original work, this commit keeps /proc related code.

Unlike /proc interface, the sockdiag information source doesn't provide
enough information for filling struct unix_xinfo::st member. So this
commit uses /proc interface for filling the most of all unix_xinfo
members as before.

On the other hande, as discussed in
https://github.com/util-linux/util-linux/pull/2067, the /proc
interface in unreliable if a unix path name includes newline
characters. This commit uses the sockdiag interface to compensate
for the weakness of the /proc interface.

2 years agolsfd: add comment listing functions names importing via #include
Masatake YAMATO [Wed, 19 Jul 2023 21:11:55 +0000 (06:11 +0900)] 
lsfd: add comment listing functions names importing via #include

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: include common headers in lsfd.h
Masatake YAMATO [Wed, 19 Jul 2023 21:06:27 +0000 (06:06 +0900)] 
lsfd: include common headers in lsfd.h

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: include system header files first
Masatake YAMATO [Wed, 19 Jul 2023 21:34:30 +0000 (06:34 +0900)] 
lsfd: include system header files first

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: fix a misleading parameter name
Masatake YAMATO [Thu, 20 Jul 2023 13:00:54 +0000 (22:00 +0900)] 
lsfd: fix a misleading parameter name

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: add const modifier
Thomas Weißschuh [Fri, 14 Apr 2023 10:48:59 +0000 (12:48 +0200)] 
lsfd: add const modifier

(The log is edited by @masatake.)

2 years agolosetup: add --loop-ref and REF column
Karel Zak [Thu, 16 Mar 2023 12:41:36 +0000 (13:41 +0100)] 
losetup: add --loop-ref and REF column

The lo_file_name is nowhere used (kernel uses backing file descriptor,
no path) and it was used to store limited info about the backing file path
(64 bytes only!). For backward compatibility, we still fill lo_file_name
with the path, but it's nowhere in the userspace used as the complete
backing file path in sysfs.

This commit introduces a new option to overwrite the default path in
lo_file_name. The idea is to use the reference string by udevd in
/dev/loop/by-ref to address loop devices independently on paths.

Addresses: https://github.com/util-linux/util-linux/issues/2106
Suggested-by: Lennart Poettering <lennart@poettering.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibmount: use some MS_* flags as superblock flags
Karel Zak [Thu, 20 Jul 2023 10:34:14 +0000 (12:34 +0200)] 
libmount: use some MS_* flags as superblock flags

The old mount(2) API usually utilizes MS_* flags to set up the VFS
node. However, there are some exceptions like "sync" (MS_SYNCHRONOUS),
where the flag is used (by kernel) for the superblock instead. The new
API addresses this issue, ensuring that these options are used for
fsconfig().

This commit introduces MNT_SUPERBLOCK to identify these options in the
libmount options Linux map, and it enforces the new mount code to
utilize these options for fsconfig(FSCONFIG_SET_FLAG).

Reported-by: Abbink Esger <esger.abbink.ext@siemens.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agotest: (lsfd) add a case for testing BPF-PROG.TYPE and BPF-PROG.TYPE.RAW columns
Masatake YAMATO [Wed, 19 Jul 2023 06:38:55 +0000 (15:38 +0900)] 
test: (lsfd) add a case for testing BPF-PROG.TYPE and BPF-PROG.TYPE.RAW columns

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agotest: (mkfds::bpf-prog) new factory
Masatake YAMATO [Wed, 19 Jul 2023 06:27:07 +0000 (15:27 +0900)] 
test: (mkfds::bpf-prog) new factory

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: add BPF-PROG.TYPE, BPF-PROG.TYPE.RAW, and BPF-PROG.ID columns
Masatake YAMATO [Tue, 11 Jul 2023 13:12:05 +0000 (22:12 +0900)] 
lsfd: add BPF-PROG.TYPE, BPF-PROG.TYPE.RAW, and BPF-PROG.ID columns

Based on these new columsn, the NAME column for "bpf-prog" is
enhanced.

An example output:

  # ./lsfd -p 1 -Q '(TYPE == "bpf-prog")' | head
  COMMAND PID USER ASSOC XMODE     TYPE       SOURCE MNTID INODE NAME
  systemd   1 root    14 rw--- bpf-prog anon_inodefs    15   106 id=1008 type=lsm
  systemd   1 root    26 rw--- bpf-prog anon_inodefs    15   106 id=2073 type=cgroup_device
  systemd   1 root    27 rw--- bpf-prog anon_inodefs    15   106 id=2074 type=cgroup_skb
  systemd   1 root    28 rw--- bpf-prog anon_inodefs    15   106 id=2075 type=cgroup_skb
  systemd   1 root    30 rw--- bpf-prog anon_inodefs    15   106 id=2076 type=cgroup_device
  systemd   1 root    31 rw--- bpf-prog anon_inodefs    15   106 id=2077 type=cgroup_device
  systemd   1 root    32 rw--- bpf-prog anon_inodefs    15   106 id=2078 type=cgroup_device
  systemd   1 root    33 rw--- bpf-prog anon_inodefs    15   106 id=2079 type=cgroup_skb
  systemd   1 root    34 rw--- bpf-prog anon_inodefs    15   106 id=2080 type=cgroup_skb

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agologin-utils: Report crashes on reboot lines insted of overlapping uptimes
Troy Rollo [Wed, 19 Jul 2023 01:04:56 +0000 (11:04 +1000)] 
login-utils: Report crashes on reboot lines insted of overlapping uptimes

2 years agoMerge branch 'libsmartcols/noheading-width' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 18 Jul 2023 08:13:09 +0000 (10:13 +0200)] 
Merge branch 'libsmartcols/noheading-width' of https://github.com/t-8ch/util-linux

* 'libsmartcols/noheading-width' of https://github.com/t-8ch/util-linux:
  libsmartcols: don't include hidden headers in column width calculation
  lsfd: avoid passing NULL to qsort()
  column: fix memory leak

2 years agoMerge branch 'wip/rishi/libmount-handle-failure-to-apply-flags-as-part-of-mount'...
Karel Zak [Tue, 18 Jul 2023 08:05:03 +0000 (10:05 +0200)] 
Merge branch 'wip/rishi/libmount-handle-failure-to-apply-flags-as-part-of-mount' of https://github.com/debarshiray/util-linux

* 'wip/rishi/libmount-handle-failure-to-apply-flags-as-part-of-mount' of https://github.com/debarshiray/util-linux:
  libmount: handle failure to apply flags as part of a mount operation

2 years agoMerge branch 'lsfd--revise-help-message' of https://github.com/masatake/util-linux
Karel Zak [Tue, 18 Jul 2023 08:03:35 +0000 (10:03 +0200)] 
Merge branch 'lsfd--revise-help-message' of https://github.com/masatake/util-linux

* 'lsfd--revise-help-message' of https://github.com/masatake/util-linux:
  lsfd: show default columns in the help message
  lsfd: update the help message for XMODE column
  lsfd: introduce -H, --list-columns option for making help messages short
  lsfd: (man) fix the form for the optional argument of --inet option
  lsfd: rearrange the aligment of the help messages
  lsfd: use the specified output stream for printing help messages

2 years agoMerge branch 'ci/codeql-path-injection' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 18 Jul 2023 08:02:52 +0000 (10:02 +0200)] 
Merge branch 'ci/codeql-path-injection' of https://github.com/t-8ch/util-linux

* 'ci/codeql-path-injection' of https://github.com/t-8ch/util-linux:
  ci: disable cpp/path-injection rule

2 years agoMerge branch 'raidrevert' of https://github.com/Vogtinator/util-linux
Karel Zak [Tue, 18 Jul 2023 08:02:06 +0000 (10:02 +0200)] 
Merge branch 'raidrevert' of https://github.com/Vogtinator/util-linux

* 'raidrevert' of https://github.com/Vogtinator/util-linux:
  Revert "libblkid: try LUKS2 first when probing"

2 years agoMerge branch 'lsclocks/dynamic-clock' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 18 Jul 2023 08:01:02 +0000 (10:01 +0200)] 
Merge branch 'lsclocks/dynamic-clock' of https://github.com/t-8ch/util-linux

* 'lsclocks/dynamic-clock' of https://github.com/t-8ch/util-linux:
  lsclocks: automatically discover dynamic clocks
  lsclocks: add support for dynamic clocks
  lsclocks: split out data function
  lsclocks: add COL_TYPE

2 years agoMerge branch 'libblkid/bcachefs-major-minor' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 18 Jul 2023 07:59:38 +0000 (09:59 +0200)] 
Merge branch 'libblkid/bcachefs-major-minor' of https://github.com/t-8ch/util-linux

* 'libblkid/bcachefs-major-minor' of https://github.com/t-8ch/util-linux:
  libblkid: (bcachefs) adapt to major.minor version

2 years agolibsmartcols: don't include hidden headers in column width calculation
Thomas Weißschuh [Mon, 17 Jul 2023 19:26:45 +0000 (21:26 +0200)] 
libsmartcols: don't include hidden headers in column width calculation

Fixes #2380

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolsfd: avoid passing NULL to qsort()
Thomas Weißschuh [Mon, 17 Jul 2023 20:46:04 +0000 (22:46 +0200)] 
lsfd: avoid passing NULL to qsort()

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agocolumn: fix memory leak
Thomas Weißschuh [Mon, 17 Jul 2023 19:07:18 +0000 (21:07 +0200)] 
column: fix memory leak

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agoswapon: (man) fix --priority description
Karel Zak [Mon, 17 Jul 2023 12:15:33 +0000 (14:15 +0200)] 
swapon: (man) fix --priority description

It's not true anymore that Linux uses -1 as the default. I could be
also another negative number (default is -2 for the first swap since
kernel commit a2468cc9bfdff6139f59ca896671e5819ff5f94a).

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2188894
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolsfd: show default columns in the help message
Masatake YAMATO [Wed, 12 Jul 2023 15:30:34 +0000 (00:30 +0900)] 
lsfd: show default columns in the help message

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolibmount: handle failure to apply flags as part of a mount operation
Debarshi Ray [Thu, 13 Jul 2023 09:07:27 +0000 (11:07 +0200)] 
libmount: handle failure to apply flags as part of a mount operation

If a mount operation with extra flags runs into an EPERM when applying
the flags, then mnt_context_get_mount_excode() returns 'Unknown error
5005' and MNT_EX_FAIL.  Here's an example:

Create a mount point on the host with 'nodev,nosuid,noexec':
  $ dd if=/dev/zero of=/var/tmp/loopfile bs=40960 count=1024
  $ sudo losetup --find /var/tmp/loopfile
  $ sudo mkfs.ext4 /dev/loop0
  $ sudo mkdir /mnt/a
  $ sudo mount -o nosuid,nodev,noexec /dev/loop0 /mnt/a

Check the mount options to be sure:
  $ findmnt --output OPTIONS,PROPAGATION /mnt/a
  OPTIONS                                  PROPAGATION
  rw,nosuid,nodev,noexec,relatime,seclabel shared

Enter a mount and user namespace:
  $ podman run \
        --interactive \
        --privileged \
        --rm \
        --tty \
        --volume /:/run/host:rslave \
        registry.fedoraproject.org/fedora:38 \
        /bin/bash

Try to bind mount the mount point from the host inside the namespace
with some extra flags:
  # mkdir ~/b
  # mount --bind -o ro /run/host/mnt/a ~/b
  mount: /root/b: filesystem was mounted, but any subsequent operation
      failed: Unknown error 5005.
  # echo $?
  32

It will be better to show something more human-readable than 'Unknown
error 5005'.

Secondly, an exit code of 32 means 'mount failure', which isn't quite
correct here.  The mount operation is split into two mount(2) calls,
where the first one uses MS_BIND to create the bind mount, and the
second uses MS_REMOUNT | MS_BIND | MS_RDONLY to apply the 'ro' flag.
Here, the first mount(2) does succeed:
  # findmnt --output OPTIONS,PROPAGATION ~/b
  OPTIONS                                  PROPAGATION
  rw,nosuid,nodev,noexec,relatime,seclabel private,slave

It's only the application of the 'ro' flag with the second mount(2) that
fails with an EPERM.  Hence, an exit code of 1 that means 'incorrect
invocation or permissions' seems more appropriate.

Signed-off-by: Debarshi Ray <rishi@fedoraproject.org>
2 years agoci: disable cpp/path-injection rule
Thomas Weißschuh [Wed, 12 Jul 2023 15:16:16 +0000 (17:16 +0200)] 
ci: disable cpp/path-injection rule

This rule fires for file operations on user-specified paths.
As this behavior is the very core of many util-linux utilities it is a
false positive.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolsfd: update the help message for XMODE column
Masatake YAMATO [Wed, 12 Jul 2023 15:16:08 +0000 (00:16 +0900)] 
lsfd: update the help message for XMODE column

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: introduce -H, --list-columns option for making help messages short
Masatake YAMATO [Wed, 12 Jul 2023 15:14:10 +0000 (00:14 +0900)] 
lsfd: introduce -H, --list-columns option for making help messages short

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: (man) fix the form for the optional argument of --inet option
Masatake YAMATO [Wed, 12 Jul 2023 15:02:12 +0000 (00:02 +0900)] 
lsfd: (man) fix the form for the optional argument of --inet option

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: rearrange the aligment of the help messages
Masatake YAMATO [Wed, 12 Jul 2023 15:01:25 +0000 (00:01 +0900)] 
lsfd: rearrange the aligment of the help messages

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: use the specified output stream for printing help messages
Masatake YAMATO [Wed, 12 Jul 2023 14:53:54 +0000 (23:53 +0900)] 
lsfd: use the specified output stream for printing help messages

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsclocks: automatically discover dynamic clocks
Thomas Weißschuh [Tue, 11 Jul 2023 11:36:19 +0000 (13:36 +0200)] 
lsclocks: automatically discover dynamic clocks

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolsclocks: add support for dynamic clocks
Thomas Weißschuh [Fri, 30 Jun 2023 11:32:18 +0000 (13:32 +0200)] 
lsclocks: add support for dynamic clocks

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolsclocks: split out data function
Thomas Weißschuh [Fri, 30 Jun 2023 11:16:42 +0000 (13:16 +0200)] 
lsclocks: split out data function

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolsclocks: add COL_TYPE
Thomas Weißschuh [Tue, 11 Jul 2023 11:16:00 +0000 (13:16 +0200)] 
lsclocks: add COL_TYPE

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agoRevert "libblkid: try LUKS2 first when probing"
Fabian Vogt [Wed, 12 Jul 2023 13:48:27 +0000 (15:48 +0200)] 
Revert "libblkid: try LUKS2 first when probing"

mdadm superblocks before 1.1 are placed at the end of the device, which
means that the data contained inside the array starts at offset 0. For
LUKS inside MD, blkid falsely detects this as plain LUKS instead of a
linux_raid_member. This causes e.g. dracut to not assemble the array
during boot and system startup fails.

This reverts commit b8889c0a214aeb3dd47bf1ab280fe5534b64d2aa.

2 years agoMerge branch 'lsclocks/ns-offset' of https://github.com/t-8ch/util-linux
Karel Zak [Wed, 12 Jul 2023 08:05:06 +0000 (10:05 +0200)] 
Merge branch 'lsclocks/ns-offset' of https://github.com/t-8ch/util-linux

* 'lsclocks/ns-offset' of https://github.com/t-8ch/util-linux:
  lsclocks: add NS_OFFSET column

2 years agonsenter: fix possible NULL dereferece [coverity scan]
Karel Zak [Wed, 12 Jul 2023 07:56:17 +0000 (09:56 +0200)] 
nsenter: fix possible NULL dereferece [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibblkid: (bcachefs) adapt to major.minor version
Thomas Weißschuh [Sun, 9 Jul 2023 18:03:57 +0000 (20:03 +0200)] 
libblkid: (bcachefs) adapt to major.minor version

The version superblock field has been split into a major and minor
version part in the upstream code.
Adapt libblkid to it.

Link: https://lore.kernel.org/linux-bcachefs/20230709171551.2349961-11-kent.overstreet@linux.dev/
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agoMerge branch 'python312' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 11 Jul 2023 10:05:37 +0000 (12:05 +0200)] 
Merge branch 'python312' of https://github.com/t-8ch/util-linux

* 'python312' of https://github.com/t-8ch/util-linux:
  libmount: (python): work around python 3.12 bug
  build-sys: add AX_COMPARE_VERSION

2 years agoMerge branch 'lsfd--multiplexed-flag-of-XMODE-column' of https://github.com/masatake...
Karel Zak [Tue, 11 Jul 2023 10:01:00 +0000 (12:01 +0200)] 
Merge branch 'lsfd--multiplexed-flag-of-XMODE-column' of https://github.com/masatake/util-linux

* 'lsfd--multiplexed-flag-of-XMODE-column' of https://github.com/masatake/util-linux:
  tests: (lsfd) add a case testing 'm' flag in XMODE column
  lsfd: add 'm' flag representing "multiplexed by epoll_wait(2)" to XMODE column
  lsfd: (man) fix the broken page output for the description of NAME column

2 years agodmesg: cleanup function names
Karel Zak [Tue, 11 Jul 2023 09:49:06 +0000 (11:49 +0200)] 
dmesg: cleanup function names

The function read_buffer() also prints data when reads from kmesg. The
name is pretty confusing for readers. Let's rename it.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agodmesg: Delete redundant pager setup
Karel Zak [Tue, 11 Jul 2023 09:40:39 +0000 (11:40 +0200)] 
dmesg: Delete redundant pager setup

The pager is necessary only for SYSLOG_ACTION_READ* actions (print
kernel messages). Let's remove redundant global initialization.

Based on patch from Dragan Simic.

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolib/pager: Apply pager-specific fixes only when needed
Dragan Simic [Tue, 4 Jul 2023 09:14:30 +0000 (11:14 +0200)] 
lib/pager: Apply pager-specific fixes only when needed

Currently defined output filter quirk fixes and environment variable
tweaks apply to less(1) only, so let's don't apply them when the pager
is actually configured to something else.

While there, rename the less(1)-specific callback function to make
clear what it applies to, and to make adding any posible additional
pager-specific callback functions a bit easier.

Signed-off-by: Dragan Simic <dsimic@manjaro.org>
2 years agolib/pager: Allow PAGER commands with options
Dragan Simic [Tue, 4 Jul 2023 09:14:28 +0000 (11:14 +0200)] 
lib/pager: Allow PAGER commands with options

It's quite common to have options in the commands specified in the
PAGER environment variable, to customize the behavior of the configured
output filter.  For example, someone might want to include the "-X"
option when less(1) is configured as the output filter, or might want
to specifically not include it, depending on the personal preferences.

For example, man(1), git(1) and bat(1) already allow and properly handle
the presence of any options in the configured output filter commands,
which assures that it's fine to do the same in util-linux.

Here's also a quotation from the description of the man(1) utility that
describes the PAGER environment variable, as found in The Single UNIX
Specification, version 4:

  PAGER
       Determine an output filtering command for writing the output
       to a terminal. Any string acceptable as a command_string operand
       to the sh -c command shall be valid. When standard output is
       a terminal device, the reference page output shall be piped
       through the command. If the PAGER variable is null or not set,
       the command shall be either more or another paginator utility
       documented in the system documentation.

This quotation just confirms, rather formally, that allowing options
in the output filter commands is a perfectly valid thing to do.

While there, perform a couple of minor cleanups as well, to make the
formatting of the code a tiny bit more consistent, and to slightly
improve one of the logged debug messages.

Signed-off-by: Dragan Simic <dsimic@manjaro.org>
2 years agotests: (lsfd) add a case testing 'm' flag in XMODE column
Masatake YAMATO [Mon, 10 Jul 2023 15:03:31 +0000 (00:03 +0900)] 
tests: (lsfd) add a case testing 'm' flag in XMODE column

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: add 'm' flag representing "multiplexed by epoll_wait(2)" to XMODE column
Masatake YAMATO [Mon, 10 Jul 2023 14:49:41 +0000 (23:49 +0900)] 
lsfd: add 'm' flag representing "multiplexed by epoll_wait(2)" to XMODE column

An example output:

    $ ./lsfd -p 3101482 -Q '(FD > 2)'
    COMMAND        PID   USER ASSOC  XMODE      TYPE       SOURCE MNTID INODE NAME
    test_mkfds 3101482 yamato     3 rw---- eventpoll anon_inodefs    15   106 tfds=4,5
    test_mkfds 3101482 yamato     4 r----m       CHR        mem:8    23     8 /dev/random
    test_mkfds 3101482 yamato     5 -w---m       CHR        mem:8    23     8 /dev/random

The fd 4 and 5 is multiplexed by 3, an evetpoll fd.
Therefore 'm' flags in XMODE column for fd 4 and 5 are set.

Just one character but 'm' may help users to understand the "IO structure"
of a process.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: (man) fix the broken page output for the description of NAME column
Masatake YAMATO [Mon, 10 Jul 2023 14:51:01 +0000 (23:51 +0900)] 
lsfd: (man) fix the broken page output for the description of NAME column

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agoiterate according to review comments.
Junichi Uekawa [Mon, 10 Jul 2023 12:14:56 +0000 (21:14 +0900)] 
iterate according to review comments.

2 years agolsclocks: add NS_OFFSET column
Thomas Weißschuh [Fri, 30 Jun 2023 20:23:55 +0000 (22:23 +0200)] 
lsclocks: add NS_OFFSET column

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agonsenter: add missing free()
Karel Zak [Mon, 10 Jul 2023 11:38:11 +0000 (13:38 +0200)] 
nsenter: add missing free()

Addresses: https://github.com/util-linux/util-linux/pull/2320
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'master' of https://github.com/u2386/util-linux
Karel Zak [Mon, 10 Jul 2023 11:35:16 +0000 (13:35 +0200)] 
Merge branch 'master' of https://github.com/u2386/util-linux

* 'master' of https://github.com/u2386/util-linux:
  nsenter: add option `-c` to join the cgroup of target process