]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
4 months agoinclude/list: add a macro for initializing list_head a declarative way
Masatake YAMATO [Sun, 9 Mar 2025 21:52:19 +0000 (06:52 +0900)] 
include/list: add a macro for initializing list_head a declarative way

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 months agolsfd: (refactor) add a helper function building ENDPOINTS strings for UNIX socket
Masatake YAMATO [Sun, 9 Mar 2025 21:40:01 +0000 (06:40 +0900)] 
lsfd: (refactor) add a helper function building ENDPOINTS strings for UNIX socket

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 months agolsfd: add a dummy entry for UNIX socket having no peer to the IPC table
Masatake YAMATO [Sun, 9 Mar 2025 03:48:34 +0000 (12:48 +0900)] 
lsfd: add a dummy entry for UNIX socket having no peer to the IPC table

With recvfrom(2) and sendto(2), we can use a UNIX datagram socket at
server side without assigning a peer address with connect(2). Here, I
call such sockets one-way sockets.

   # ss -x -p
   Netid State Recv-Q Send-Q        Local Address:Port  Peer Address:Port Process
   ...
   u_dgr ESTAB      0      0 /run/systemd/notify 13465               * 0  users:(("systemd",pid=1,fd=227))
   u_dgr ESTAB      0      0                   * 35438           * 13465  users:(("systemd-journal",pid=1280,fd=15))
   u_dgr ESTAB      0      0                   * 74792           * 13465  users:(("bluetoothd",pid=13874,fd=4))
   ...

The socket, opened with systemd as fd 227, is an example of one-way
socket (13465). It has 0 as "Peer Address:Port". From the side of
systemd process, there is no communication peers. However, the
sockets (35438 and 74792) opened with systemd-journal and bluetoothd
have the one-way socket (13465) as their communication peers.

We expect lsfd prints these connections if user specifies
-o+ENDPOINTS. This change and subsequent changes remove limitations in
this area.

In the early stage of lsfd process, lsfd collects information about
UNIX sockets on the system via unix-diag netlink. lsfd stores the
information to the IPC table. lsfd looks up the IPC table when
printing ENDPOINTS column.

With the original code, lsfd could not fill the ENDPOINTS columns
for sockets connecting to an one-way socket because lsfd did not
store one-way sockets to the IPC table.

  # ./original-lsfd -Q 'INODE == 35438 || INODE == 74792' -oCOMMAND,PID,TYPE,INODE,NAME,ENDPOINTS
  COMMAND           PID TYPE INODE NAME                       ENDPOINTS
  systemd-journal  1280 UNIX 35438 state=connected type=dgram
  bluetoothd      13874 UNIX 74792 state=connected type=dgram

With this change, lsfd can fill the ENDPOINTS columns for sockets
connecting to an one-way socket. The new code puts dummy entries for
the one-way sockets to the IPC table. The dummy entries help lsfd to
find the connections.

  # ./new-lsfd -Q 'INODE == 35438 || INODE == 74792' -oCOMMAND,PID,TYPE,INODE,NAME,ENDPOINTS
  COMMAND           PID TYPE INODE NAME                       ENDPOINTS
  systemd-journal  1280 UNIX 35438 state=connected type=dgram 1,systemd,227rw
  bluetoothd      13874 UNIX 74792 state=connected type=dgram 1,systemd,227rw

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 months agotests: (lsfd::mkfds-unix-dgram, refactor) split the test into subtests
Masatake YAMATO [Mon, 10 Mar 2025 16:21:16 +0000 (01:21 +0900)] 
tests: (lsfd::mkfds-unix-dgram, refactor) split the test into subtests

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 months agotests: add ts_is_in_docker as a helper function
Masatake YAMATO [Tue, 11 Mar 2025 16:32:34 +0000 (01:32 +0900)] 
tests: add ts_is_in_docker as a helper function

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 months agolsfd: (man) fix a typo
Masatake YAMATO [Tue, 11 Mar 2025 15:19:45 +0000 (00:19 +0900)] 
lsfd: (man) fix a typo

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4 months agoMerge branch 'hexdump' of https://github.com/eworm-de/util-linux
Karel Zak [Thu, 13 Mar 2025 09:20:36 +0000 (10:20 +0100)] 
Merge branch 'hexdump' of https://github.com/eworm-de/util-linux

* 'hexdump' of https://github.com/eworm-de/util-linux:
  meson: bring hexdump in line with others

4 months agotools: add checktarball-meson.sh
Karel Zak [Thu, 13 Mar 2025 09:12:26 +0000 (10:12 +0100)] 
tools: add checktarball-meson.sh

Simple script to check for missing meson.build files in the release tarball.

Addresses: https://github.com/util-linux/util-linux/issues/3460
Signed-off-by: Karel Zak <kzak@redhat.com>
4 months agoautotools: add missing meson.build files
Karel Zak [Thu, 13 Mar 2025 09:09:21 +0000 (10:09 +0100)] 
autotools: add missing meson.build files

Fixes: https://github.com/util-linux/util-linux/issues/3460
Signed-off-by: Karel Zak <kzak@redhat.com>
4 months agotools: add SPDX-License-Identifier
Karel Zak [Thu, 13 Mar 2025 08:54:45 +0000 (09:54 +0100)] 
tools: add SPDX-License-Identifier

Add an SPDX label to the newly added scripts.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agomeson: bring hexdump in line with others
Christian Hesse [Wed, 12 Mar 2025 13:06:14 +0000 (14:06 +0100)] 
meson: bring hexdump in line with others

Before it was different, and the executable was not installed.

5 months agolibsmartcols: add scols_filter_has_holder()
Karel Zak [Mon, 10 Mar 2025 14:32:58 +0000 (15:32 +0100)] 
libsmartcols: add scols_filter_has_holder()

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agoMerge branch 'github-issue-3442' of https://github.com/masatake/util-linux
Karel Zak [Mon, 10 Mar 2025 14:19:52 +0000 (15:19 +0100)] 
Merge branch 'github-issue-3442' of https://github.com/masatake/util-linux

* 'github-issue-3442' of https://github.com/masatake/util-linux:
  tests: (lsns) verify NETNSID column for namespaces with no process running
  lsns: make "-Q NETNSID ..." work even if NETNSID column is not enabled
  lsns: show NETNSID for namespaces with no process running
  lsns: (refactor) generalize the code for collecting netnsid information

5 months agoMerge branch 'master' of https://github.com/echoechoin/util-linux
Karel Zak [Mon, 10 Mar 2025 13:48:14 +0000 (14:48 +0100)] 
Merge branch 'master' of https://github.com/echoechoin/util-linux

* 'master' of https://github.com/echoechoin/util-linux:
  sys-utils/chmem: fix typo.

5 months agoMerge branch 'master' of https://github.com/jlinton/util-linux
Karel Zak [Mon, 10 Mar 2025 13:47:19 +0000 (14:47 +0100)] 
Merge branch 'master' of https://github.com/jlinton/util-linux

* 'master' of https://github.com/jlinton/util-linux:
  lscpu: New Arm part numbers

5 months agoexch: cosmetic code changes
Karel Zak [Mon, 10 Mar 2025 13:43:00 +0000 (14:43 +0100)] 
exch: cosmetic code changes

* Remove unnecessary dirfd (use AT_FDCWD directly)
* Remove unnecessary 'rc' variable

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agoMerge branch 'bugfix/exch-renameat2' of https://github.com/ThomasDevoogdt/util-linux
Karel Zak [Mon, 10 Mar 2025 13:32:40 +0000 (14:32 +0100)] 
Merge branch 'bugfix/exch-renameat2' of https://github.com/ThomasDevoogdt/util-linux

* 'bugfix/exch-renameat2' of https://github.com/ThomasDevoogdt/util-linux:
  exch: fix compile error if renameat2 is not present

5 months agotests: (lsns) verify NETNSID column for namespaces with no process running
Masatake YAMATO [Fri, 7 Mar 2025 22:27:31 +0000 (07:27 +0900)] 
tests: (lsns) verify NETNSID column for namespaces with no process running

This case tests the two changes about lsns:

- make "-Q NETNSID ..." work even if NETNSID column is not enabled, and
- show NETNSID for namespaces with no process running

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
5 months agolsns: make "-Q NETNSID ..." work even if NETNSID column is not enabled
Masatake YAMATO [Fri, 7 Mar 2025 21:42:18 +0000 (06:42 +0900)] 
lsns: make "-Q NETNSID ..." work even if NETNSID column is not enabled

With the original code, lsns didn't collect values for NETNSID
unless NETNSID column was enabled. As a result, a filter expression
referencing NETNSID value didn't work expectedly.

  # ip netns add X
  # ip netns set X 99999
  # lsns-original -Q 'NETNSID == "99999"
(PRINT NOTHING)
  # lsns-original -Q 'NETNSID == "99999" -o NETNSID
  NETNSID
    99999

With this change, lsns collects values for NETNSID if the
filter expression given to -Q option refers to NETNSID.

  # lsns-new -Q 'NETNSID == "99999"
            NS TYPE NPROCS PID USER COMMAND
    4026535564 net       0     root

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
5 months agolsns: show NETNSID for namespaces with no process running
Masatake YAMATO [Thu, 6 Mar 2025 23:44:30 +0000 (08:44 +0900)] 
lsns: show NETNSID for namespaces with no process running

Fixes #3445

The original code doesn't collect NETNSID for netns namespaces with no
process running.

A way to reproduce this issue:

    # ip netns delete X
    # ip netns add X
    # ip netns set X 117
    # ip netns show
    X (id: 117)
    netns-813c699f-4651-e5e9-6af4-cca568bf2c3a (id: 0)
    # stat /var/run/netns/X
      File: /var/run/netns/X
      Size: 0          Blocks: 0          IO Block: 4096   regular empty file
    Device: 0,4 Inode: 4026533679  Links: 1
    Access: (0444/-r--r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
    Context: system_u:object_r:nsfs_t:s0
    Access: 2025-03-06 00:29:58.598605182 +0900
    Modify: 2025-03-06 00:29:58.598605182 +0900
    Change: 2025-03-06 00:29:58.598605182 +0900
     Birth: -

    # ./lsns -P -o+NETNSID
    NS TYPE  NPROCS PID USER   COMMAND NETNSID
    4026533679 net        0     root
    4026534230 user       0     yamato

NS 4026533679 should have "117" as the value of NETNSID.

Though the original code defined netnsid member in struct
lsns_namespace, the member wasn't used at all. struct lsns_process had
a member having the same name.  The original code used only the one in
struct lsns_process.

This change utilizes the netnsid member in struct lsns_namespace.

I found another bug, so I will provide a test case for this fix in a
subsequent commit.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
5 months agolsns: (refactor) generalize the code for collecting netnsid information
Masatake YAMATO [Fri, 7 Mar 2025 22:59:21 +0000 (07:59 +0900)] 
lsns: (refactor) generalize the code for collecting netnsid information

This change is preparation for subsequent bug fixes.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
5 months agoexch: fix compile error if renameat2 is not present
Thomas Devoogdt [Thu, 6 Mar 2025 13:18:48 +0000 (14:18 +0100)] 
exch: fix compile error if renameat2 is not present

https://www.man7.org/linux/man-pages/man2/rename.2.html
Available since Linux 3.15 or glibc 2.28,
add a fallback for older systems.

My initial implementation did the exchange using a swap
file if both HAVE_RENAMEAT2 and SYS_renameat2 were absent.
But that is not really what is desired since exch is supposed
to be atomic. So simply return -1 renameat2 is available.

Signed-off-by: Thomas Devoogdt <thomas.devoogdt@barco.com>
5 months ago{configure.ac,meson.build}: conditionally build {enosys,setpriv} if seccomp is presen...
Thomas Devoogdt [Thu, 6 Mar 2025 10:49:12 +0000 (11:49 +0100)] 
{configure.ac,meson.build}: conditionally build {enosys,setpriv} if seccomp is present #3280

misc-utils/enosys.c:25:27: fatal error: linux/seccomp.h: No such file or directory
 #include <linux/seccomp.h>

Signed-off-by: Thomas Devoogdt <thomas.devoogdt@barco.com>
5 months agosys-utils/chmem: fix typo.
WanBingjiang [Fri, 7 Mar 2025 02:11:54 +0000 (10:11 +0800)] 
sys-utils/chmem: fix typo.

5 months agolscpu: New Arm part numbers
Jeremy Linton [Thu, 6 Mar 2025 18:17:30 +0000 (12:17 -0600)] 
lscpu: New Arm part numbers

Arm has announced the Cortex-A320 and published the TRM here:
https://developer.arm.com/documentation/109551

The Cortex-A520AE with a TRM here:
https://developer.arm.com/documentation/107726

The Cortex-A720AE with a TRM here:
https://developer.arm.com/documentation/102828

The Neoverse-V3AE with a TRM here:
https://developer.arm.com/documentation/101595

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
5 months agotools/git-grouped-log: sort output
Karel Zak [Thu, 6 Mar 2025 10:05:55 +0000 (11:05 +0100)] 
tools/git-grouped-log: sort output

Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit 0cd3a9030d9ad611ca7773280c55b9e9d2ccceed)

5 months agotools/git-tp-sync: update also po-man
Karel Zak [Thu, 6 Mar 2025 09:39:15 +0000 (10:39 +0100)] 
tools/git-tp-sync: update also po-man

Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit a7541e95b1396d4a80ca18fa4e3d9dcc56bc1561)

5 months agotools/git-tp-sync: fix checkout -f use
Karel Zak [Thu, 6 Mar 2025 09:23:36 +0000 (10:23 +0100)] 
tools/git-tp-sync: fix checkout -f use

Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit e21b9fa759b07b251b1e790ee5356dcdf46da55a)

5 months agotests: update lsmem outputs
Karel Zak [Thu, 6 Mar 2025 11:11:37 +0000 (12:11 +0100)] 
tests: update lsmem outputs

Addresses: 68c9f5578230b8a715204d7f05b52b65f97f808a
Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agohardlink: replace a strange word in an error message
Benno Schulenberg [Tue, 4 Mar 2025 16:08:06 +0000 (17:08 +0100)] 
hardlink: replace a strange word in an error message

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
5 months agolsmem: increase the available width for the summary text labels
Benno Schulenberg [Tue, 4 Mar 2025 16:08:05 +0000 (17:08 +0100)] 
lsmem: increase the available width for the summary text labels

This allows the subsequent numbers to get vertically aligned for
most translations too.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
5 months agotests: (lsns/nsfs) consider the cases that lsns returns multiple paths
Masatake YAMATO [Wed, 5 Mar 2025 14:25:52 +0000 (23:25 +0900)] 
tests: (lsns/nsfs) consider the cases that lsns returns multiple paths

Fixes #3442

If a target directory is bind-mount'ed, lsns returns multiple paths
as the value for NSFS column. This change considers this case.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
5 months agotests: (lsns/nsfs) check test_sysinfo helper
Masatake YAMATO [Tue, 4 Mar 2025 19:39:12 +0000 (04:39 +0900)] 
tests: (lsns/nsfs) check test_sysinfo helper

This check was missed though the command was used in
the test case.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
5 months agotests: improve test_sysinfo to check for NS_GET_NSTYPE usability
Karel Zak [Wed, 5 Mar 2025 08:53:34 +0000 (09:53 +0100)] 
tests: improve test_sysinfo to check for NS_GET_NSTYPE usability

Now the test checks if the kernel supports the NS_GET_NSTYPE ioctl,
but it seems that on some platforms it's implemented but does not work
as expected and returns ENOTTY.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agoMerge branch 'ci-fix-alt-arch-segfaults' of https://github.com/mrc0mmand/util-linux
Karel Zak [Tue, 4 Mar 2025 18:25:34 +0000 (19:25 +0100)] 
Merge branch 'ci-fix-alt-arch-segfaults' of https://github.com/mrc0mmand/util-linux

* 'ci-fix-alt-arch-segfaults' of https://github.com/mrc0mmand/util-linux:
  ci: bump uraimo/run-on-arch-action to v3
  Revert "ci: temporarily switch the alt-arch job worker to Ubuntu 22.04"

5 months agotests: check for ns-get*-ok
Karel Zak [Tue, 4 Mar 2025 18:07:43 +0000 (19:07 +0100)] 
tests: check for ns-get*-ok

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agoci: bump uraimo/run-on-arch-action to v3
Frantisek Sumsal [Tue, 4 Mar 2025 12:37:11 +0000 (13:37 +0100)] 
ci: bump uraimo/run-on-arch-action to v3

The latest v3 version should address the sporadic segfaults we've been
seeing (mainly on s390x).

5 months agoRevert "ci: temporarily switch the alt-arch job worker to Ubuntu 22.04"
Frantisek Sumsal [Tue, 4 Mar 2025 12:36:53 +0000 (13:36 +0100)] 
Revert "ci: temporarily switch the alt-arch job worker to Ubuntu 22.04"

This reverts commit c389f166e5c35e3a7d91205997b75bec5d4353fb.

5 months agoMerge branch 'github-issue-3432' of https://github.com/masatake/util-linux
Karel Zak [Tue, 4 Mar 2025 12:23:04 +0000 (13:23 +0100)] 
Merge branch 'github-issue-3432' of https://github.com/masatake/util-linux

* 'github-issue-3432' of https://github.com/masatake/util-linux:
  test_mkfds: disable ppoll multiplexer if sigset_t is not defined

5 months agoMerge branch 'PR/pidfd-cleanup' of https://github.com/karelzak/util-linux-work
Karel Zak [Tue, 4 Mar 2025 11:40:20 +0000 (12:40 +0100)] 
Merge branch 'PR/pidfd-cleanup' of https://github.com/karelzak/util-linux-work

* 'PR/pidfd-cleanup' of https://github.com/karelzak/util-linux-work:
  test_mkfds: remove local pidfd_open() fallback
  include/pidfd-utils: improve robustness

5 months agotest_mkfds: disable ppoll multiplexer if sigset_t is not defined
Masatake YAMATO [Tue, 4 Mar 2025 11:05:29 +0000 (20:05 +0900)] 
test_mkfds: disable ppoll multiplexer if sigset_t is not defined

Fixes #3432

The ppoll multiplexer requires RAW sigset_t type generally defined in
asm/linux.h. However, the parisc arch of the kernel older than
487fa28fa8b60417642ac58e8beda6e2509d18f9 didn't export the type to
the user space.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
5 months agoMerge branch 'PR/irq-misc' of https://github.com/karelzak/util-linux-work
Karel Zak [Tue, 4 Mar 2025 10:53:07 +0000 (11:53 +0100)] 
Merge branch 'PR/irq-misc' of https://github.com/karelzak/util-linux-work

* 'PR/irq-misc' of https://github.com/karelzak/util-linux-work:
  lsirq: add support for reading data from given file
  irqtop: support json output format
  irqtop: add max iteration support
  irqtop: add batch mode support

5 months agotest_mkfds: remove local pidfd_open() fallback
Karel Zak [Tue, 4 Mar 2025 10:44:16 +0000 (11:44 +0100)] 
test_mkfds: remove local pidfd_open() fallback

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agoinclude/pidfd-utils: improve robustness
Karel Zak [Tue, 4 Mar 2025 08:47:11 +0000 (09:47 +0100)] 
include/pidfd-utils: improve robustness

* remove global UL_HAVE_PIDFD, in many cases we need only subset of pidfd
  kernel API, rrather than all the functios

* improve #ifdefs for pidfd_*() direct syscalls

* improve dummy fallback to not redefine system header files

Fixes: https://github.com/util-linux/util-linux/issues/3437
Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agoMerge branch 'fallocate-options-excl' of https://github.com/aerusso/util-linux
Karel Zak [Tue, 4 Mar 2025 09:55:43 +0000 (10:55 +0100)] 
Merge branch 'fallocate-options-excl' of https://github.com/aerusso/util-linux

* 'fallocate-options-excl' of https://github.com/aerusso/util-linux:
  fallocate: rework incompatible options

5 months agocolumn: replace a mistaken word in an error message
Benno Schulenberg [Mon, 3 Mar 2025 10:21:37 +0000 (11:21 +0100)] 
column: replace a mistaken word in an error message

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
5 months agolsirq: add support for reading data from given file
Joe Jin [Fri, 28 Feb 2025 16:13:34 +0000 (08:13 -0800)] 
lsirq: add support for reading data from given file

This is helpful for analyzng data saved from other system.

Signed-off-by: Joe Jin <joe.jin@oracle.com>
Cc: Zhenwei Pi <pizhenwei@bytedance.com>
Cc: Sami Kerola <kerolasa@iki.fi>
Cc: Karel Zak <kzak@redhat.com>
5 months agoirqtop: support json output format
Joe Jin [Fri, 28 Feb 2025 16:13:33 +0000 (08:13 -0800)] 
irqtop: support json output format

Signed-off-by: Joe Jin <joe.jin@oracle.com>
Cc: Zhenwei Pi <pizhenwei@bytedance.com>
Cc: Sami Kerola <kerolasa@iki.fi>
Cc: Karel Zak <kzak@redhat.com>
5 months agoirqtop: add max iteration support
Joe Jin [Fri, 28 Feb 2025 16:13:32 +0000 (08:13 -0800)] 
irqtop: add max iteration support

Add support for setting the number of iterations. This is useful in
non-interactive mode.

Signed-off-by: Joe Jin <joe.jin@oracle.com>
Cc: Zhenwei Pi <pizhenwei@bytedance.com>
Cc: Sami Kerola <kerolasa@iki.fi>
Cc: Karel Zak <kzak@redhat.com>
5 months agoirqtop: add batch mode support
Joe Jin [Fri, 28 Feb 2025 16:13:31 +0000 (08:13 -0800)] 
irqtop: add batch mode support

Add batch mode support, which could be useful for sending output to
other programs or to a file.

Signed-off-by: Joe Jin <joe.jin@oracle.com>
Cc: Zhenwei Pi <pizhenwei@bytedance.com>
Cc: Sami Kerola <kerolasa@iki.fi>
Cc: Karel Zak <kzak@redhat.com>
5 months agoMerge branch 'libblkid/ddf' of https://github.com/t-8ch/util-linux
Karel Zak [Mon, 3 Mar 2025 08:23:24 +0000 (09:23 +0100)] 
Merge branch 'libblkid/ddf' of https://github.com/t-8ch/util-linux

* 'libblkid/ddf' of https://github.com/t-8ch/util-linux:
  libblkid: ddf_read: validate header checksum
  libc/crc32: make fill value of excluded area configurable
  libblkid: ddf_raid: drop little-endian handling
  libblkid: ddf_raid: respect constness of buffer

5 months agoMerge branch 'master' of https://github.com/echoechoin/util-linux
Karel Zak [Mon, 3 Mar 2025 08:23:11 +0000 (09:23 +0100)] 
Merge branch 'master' of https://github.com/echoechoin/util-linux

* 'master' of https://github.com/echoechoin/util-linux:
  misc-utils/lastlog2: Add option -a for listing active users only

5 months agofallocate: rework incompatible options
Antonio Russo [Sun, 2 Mar 2025 19:58:07 +0000 (12:58 -0700)] 
fallocate: rework incompatible options

Follow up to d95f9a6, addressing ordering requirements, natural
incompatibilities between various options, and limitations of
posix_fallocate.

5 months agolibblkid: ddf_read: validate header checksum
Thomas Weißschuh [Thu, 27 Feb 2025 17:16:03 +0000 (18:16 +0100)] 
libblkid: ddf_read: validate header checksum

The DDF header contains a checksum.

Validate it.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
5 months agolibc/crc32: make fill value of excluded area configurable
Thomas Weißschuh [Thu, 27 Feb 2025 17:16:01 +0000 (18:16 +0100)] 
libc/crc32: make fill value of excluded area configurable

A new user of crc32_exclude_offset() is going to be added which requires
a different fill value than the currently hardcoded "0".

Add a parameter where each caller can specify their own value.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
5 months agolibblkid: ddf_raid: drop little-endian handling
Thomas Weißschuh [Thu, 27 Feb 2025 17:15:56 +0000 (18:15 +0100)] 
libblkid: ddf_raid: drop little-endian handling

The DDF specification, both 1.2 and 2.0 require big-endian.
This is also what mdadm expects.

5.2 Byte Ordering

Each section of the DDF MUST be stored in big-endian format
(i.e., the more significant bytes of the section are stored in
lower addresses in relation to bytes of lesser significance).

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
5 months agolibblkid: ddf_raid: respect constness of buffer
Thomas Weißschuh [Thu, 27 Feb 2025 17:15:38 +0000 (18:15 +0100)] 
libblkid: ddf_raid: respect constness of buffer

The buffers returned by blkid_probe_get_buffer() are not allowed to be
modified. Respect this restriction when casting the buffer to other
pointer types.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
5 months agomisc-utils/lastlog2: Add option -a for listing active users only
WanBingjiang [Wed, 26 Feb 2025 07:17:19 +0000 (15:17 +0800)] 
misc-utils/lastlog2: Add option -a for listing active users only

5 months agosys-utils/lscpu: Change object type to SCOLS_JSON_STRING if data == "-"
WanBingjiang [Thu, 27 Feb 2025 07:13:37 +0000 (15:13 +0800)] 
sys-utils/lscpu: Change object type to SCOLS_JSON_STRING if data == "-"

5 months agoinclude/mount-api-utils: improve coding style
Karel Zak [Wed, 26 Feb 2025 10:50:47 +0000 (11:50 +0100)] 
include/mount-api-utils: improve coding style

Improve the alignment of comments and other elements.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agomount: (man) add info about info messages
Karel Zak [Wed, 26 Feb 2025 10:06:36 +0000 (11:06 +0100)] 
mount: (man) add info about info messages

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agoMerge branch 'PR/libmount-statmount-source' of https://github.com/karelzak/util-linux...
Karel Zak [Tue, 25 Feb 2025 11:54:23 +0000 (12:54 +0100)] 
Merge branch 'PR/libmount-statmount-source' of https://github.com/karelzak/util-linux-work

* 'PR/libmount-statmount-source' of https://github.com/karelzak/util-linux-work:
  libmount: add support for STATMOUNT_SB_SOURCE

5 months agolibmount: add support for STATMOUNT_SB_SOURCE
Karel Zak [Tue, 25 Feb 2025 10:48:14 +0000 (11:48 +0100)] 
libmount: add support for STATMOUNT_SB_SOURCE

* read mount source by statmount() 9requires kernel >=6.14
* add new STATMOUNT_* masks

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agofdisk: (man) add note about partition size calculation
Karel Zak [Tue, 25 Feb 2025 10:46:46 +0000 (11:46 +0100)] 
fdisk: (man) add note about partition size calculation

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agoscriptlive: improve some descriptions, markup, and grammar in the manpage
Benno Schulenberg [Mon, 24 Feb 2025 13:08:40 +0000 (14:08 +0100)] 
scriptlive: improve some descriptions, markup, and grammar in the manpage

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
5 months agoscriptlive: reduce two usage synopses to one simple one
Benno Schulenberg [Mon, 24 Feb 2025 13:08:39 +0000 (14:08 +0100)] 
scriptlive: reduce two usage synopses to one simple one

No synopsis can show all possible permutattions of arguments and
options, so do not even try and just give the most basic form,
without unneeded -t, -I, or -B.

Also, use angle brackets to show that <timingfile> and <typescript>
are placeholders.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
5 months agoscriptreplay: mark literal values in the man page in bold, not italic
Benno Schulenberg [Mon, 24 Feb 2025 13:08:38 +0000 (14:08 +0100)] 
scriptreplay: mark literal values in the man page in bold, not italic

Also, mention which keys can be used to speed up, slow down, and pause
the replay.  Shorten the description of '-s' as it is deprecated.  And
improve the description of '-t': it does not override the _timingfile_
positional argument, but takes the place of it, makes it unneeded.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
5 months agoscriptreplay: reduce two usage synopses to one, and drop the -t from it
Benno Schulenberg [Mon, 24 Feb 2025 13:08:37 +0000 (14:08 +0100)] 
scriptreplay: reduce two usage synopses to one, and drop the -t from it

Those two synopses still did not express several possible forms:

    scriptreplay -m.1 timings
    scriptreplay typescript -t timings -m.1
    ...

So, instead of trying to cover all possibilities, just give the
basic form of the command, which is clearest and most helpful.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
5 months agoscriptreplay: make Up/Down keys use a percentage instead of fixed amount
Benno Schulenberg [Mon, 24 Feb 2025 13:08:36 +0000 (14:08 +0100)] 
scriptreplay: make Up/Down keys use a percentage instead of fixed amount

Using a fixed 0.1 amount made each subsequent Down-arrow key slow things
down _more_, and each subsequent Up-arrow key speed things up _less_.
It's nicer when each subsequent keystroke has the same relative effect.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
5 months agoscriptreplay: indicate that <divisor> is conditional on <typescript>
Benno Schulenberg [Mon, 24 Feb 2025 13:08:35 +0000 (14:08 +0100)] 
scriptreplay: indicate that <divisor> is conditional on <typescript>

Also, use angle brackets to show that those words are placeholders,
not literals, and improve the descriptions of the key bindings.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
5 months agoMerge branch 'zramctl' of https://github.com/yuwata/util-linux
Karel Zak [Tue, 25 Feb 2025 07:30:11 +0000 (08:30 +0100)] 
Merge branch 'zramctl' of https://github.com/yuwata/util-linux

* 'zramctl' of https://github.com/yuwata/util-linux:
  zramctl: wait for device being initialized and unlocked by udevd

5 months agoMerge branch 'PR/libmount-fix-owner' of https://github.com/karelzak/util-linux-work
Karel Zak [Tue, 25 Feb 2025 07:29:42 +0000 (08:29 +0100)] 
Merge branch 'PR/libmount-fix-owner' of https://github.com/karelzak/util-linux-work

* 'PR/libmount-fix-owner' of https://github.com/karelzak/util-linux-work:
  Libmount: Fix removal of "owner" option when executed as root

5 months agoMerge branch 'PR/agetty-fix-ttyname' of https://github.com/karelzak/util-linux-work
Karel Zak [Tue, 25 Feb 2025 07:28:55 +0000 (08:28 +0100)] 
Merge branch 'PR/agetty-fix-ttyname' of https://github.com/karelzak/util-linux-work

* 'PR/agetty-fix-ttyname' of https://github.com/karelzak/util-linux-work:
  agetty: fix stdin conversion to tty name

5 months agoautotools: Fix use of mq_open and mq_close
Samuel Thibault [Tue, 25 Feb 2025 07:27:18 +0000 (08:27 +0100)] 
autotools: Fix use of mq_open and mq_close

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agoLibmount: Fix removal of "owner" option when executed as root
Karel Zak [Mon, 24 Feb 2025 13:04:53 +0000 (14:04 +0100)] 
Libmount: Fix removal of "owner" option when executed as root

When executed as root, libmount replaces the "owner" and "group" mount
options with "nosuid, nodev, ..." However, this can result in an
"invalid argument" error because libmount removes the unwanted options
first and then tries to address the location for the new options using
the already removed options. To fix this, we need to reverse the order
of operations.

Reported-by: hxinzhe <hxinzhe1024@163.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agoagetty: fix stdin conversion to tty name
Karel Zak [Mon, 24 Feb 2025 12:37:04 +0000 (13:37 +0100)] 
agetty: fix stdin conversion to tty name

Addresses: https://github.com/util-linux/util-linux/issues/3304
Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agotests: (flock::range-lock) add a case testing --start/--length
Masatake YAMATO [Fri, 21 Feb 2025 15:37:32 +0000 (00:37 +0900)] 
tests: (flock::range-lock) add a case testing --start/--length

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
5 months agoflock: support locking with byte-range
Masatake YAMATO [Fri, 21 Feb 2025 15:21:51 +0000 (00:21 +0900)] 
flock: support locking with byte-range

New options, --start and --length are for specifying the byte-range.
The options assume used with --fcntl option.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
5 months agotools/git-grouped-log: add script to generated git log
Karel Zak [Thu, 20 Feb 2025 13:48:30 +0000 (14:48 +0100)] 
tools/git-grouped-log: add script to generated git log

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agotools: improve in-repo check
Karel Zak [Wed, 19 Feb 2025 19:01:03 +0000 (20:01 +0100)] 
tools: improve in-repo check

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agotools/git-version-bump: add script to update hardcoded versions
Karel Zak [Wed, 19 Feb 2025 18:38:18 +0000 (19:38 +0100)] 
tools/git-version-bump: add script to update hardcoded versions

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agopo: merge changes
Karel Zak [Wed, 19 Feb 2025 17:55:32 +0000 (18:55 +0100)] 
po: merge changes

5 months agopo: update hr.po (from translationproject.org)
Božidar Putanec [Wed, 19 Feb 2025 17:55:23 +0000 (18:55 +0100)] 
po: update hr.po (from translationproject.org)

5 months agotools/git-tp-sync: require git
Karel Zak [Wed, 19 Feb 2025 17:52:20 +0000 (18:52 +0100)] 
tools/git-tp-sync: require git

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agotools/git-tp-sync: merge changes to PO files
Karel Zak [Wed, 19 Feb 2025 17:40:39 +0000 (18:40 +0100)] 
tools/git-tp-sync: merge changes to PO files

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agozramctl: wait for device being initialized and unlocked by udevd
Yu Watanabe [Fri, 14 Feb 2025 01:32:44 +0000 (10:32 +0900)] 
zramctl: wait for device being initialized and unlocked by udevd

systemd-udevd takes a lock during processing the uevent for a block
device. The kernel refuses 'reset' attribute for zram device is written
when the device node is opened. Hence, during systemd-udevd processes a
uevent for zram device, we cannot write 'reset' attribute.
Let's wait for the device being initialized and unlocked by udevd.

Note, there still exists a race window, as we need to release the lock
before writing 'reset' attribute. But, the situation should be better
now.

5 months agoautotools: remove tools/git-tp-sync-man
Karel Zak [Wed, 19 Feb 2025 14:53:00 +0000 (15:53 +0100)] 
autotools: remove tools/git-tp-sync-man

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agotools/git-tp-sync-man: remove obsolete script
Karel Zak [Wed, 19 Feb 2025 14:45:20 +0000 (15:45 +0100)] 
tools/git-tp-sync-man: remove obsolete script

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agotools/git-tp-sync: support multiple directories
Karel Zak [Wed, 19 Feb 2025 14:44:00 +0000 (15:44 +0100)] 
tools/git-tp-sync: support multiple directories

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agotools/git-tp-sync: reuse git ls-files calls
Karel Zak [Wed, 19 Feb 2025 11:41:12 +0000 (12:41 +0100)] 
tools/git-tp-sync: reuse git ls-files calls

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agotools/git-tp-sync: add --dry-run and --help
Karel Zak [Wed, 19 Feb 2025 11:33:58 +0000 (12:33 +0100)] 
tools/git-tp-sync: add --dry-run and --help

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agotools/git-tp-sync: Compare Revisions
Karel Zak [Wed, 19 Feb 2025 11:07:00 +0000 (12:07 +0100)] 
tools/git-tp-sync: Compare Revisions

The previous version required updating languages through the command
line, or it would download all PO files.

This commit improves the script by comparing the PO-Revision-Date in
the old and new versions, and only commits updated PO files.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agopo: upadte LINGUAS file
Karel Zak [Wed, 19 Feb 2025 10:00:41 +0000 (11:00 +0100)] 
po: upadte LINGUAS file

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agoMerge branch 'mess' of https://github.com/neheb/util-linux
Karel Zak [Wed, 19 Feb 2025 08:52:42 +0000 (09:52 +0100)] 
Merge branch 'mess' of https://github.com/neheb/util-linux

* 'mess' of https://github.com/neheb/util-linux:
  meson: demote two libraries to library

5 months agolsipc: doesn't mount /dev/mqueue
Prasanna Paithankar [Wed, 19 Feb 2025 06:12:08 +0000 (11:42 +0530)] 
lsipc: doesn't mount /dev/mqueue

Signed-off-by: Prasanna Paithankar <paithankarprasanna@gmail.com>
5 months agobuild-sys: keep the most recent version in NEWS
Karel Zak [Tue, 18 Feb 2025 22:03:17 +0000 (23:03 +0100)] 
build-sys: keep the most recent version in NEWS

This file is used as a fallback for tools/git-version-gen if tags or
git are not available.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agotools/git-version-gen: accept -start in version (as -rc)
Karel Zak [Tue, 18 Feb 2025 17:40:47 +0000 (18:40 +0100)] 
tools/git-version-gen: accept -start in version (as -rc)

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agobuild-sys: update version dates v2.42-start
Karel Zak [Tue, 18 Feb 2025 12:44:19 +0000 (13:44 +0100)] 
build-sys: update version dates

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agodocs: reduce and freeze NEWS file
Karel Zak [Tue, 18 Feb 2025 12:38:59 +0000 (13:38 +0100)] 
docs: reduce and freeze NEWS file

Originally, it was required by Automake. However, for a long time, we
have been using the "foreign" Automake option, so it is no longer
necessary. All the details can be found in the ReleaseNotes. Let's
keep it simple.

Signed-off-by: Karel Zak <kzak@redhat.com>
5 months agolibmount: fix table_init_listmount()
Karel Zak [Tue, 18 Feb 2025 12:08:03 +0000 (13:08 +0100)] 
libmount: fix table_init_listmount()

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