]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
2 years agolsfd: (man) write about TCP6 related columns
Masatake YAMATO [Mon, 13 Feb 2023 13:48:28 +0000 (22:48 +0900)] 
lsfd: (man) write about TCP6 related columns

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: use extra information loaded from /proc/net/tcp6
Masatake YAMATO [Fri, 3 Feb 2023 05:03:23 +0000 (14:03 +0900)] 
lsfd: use extra information loaded from /proc/net/tcp6

Example output:

  # ./lsfd -Q '(TYPE == "TCPv6") and ((COMMAND == "sshd") or (COMMAND == "test_mkfds"))'
  COMMAND       PID USER ASSOC MODE  TYPE SOURCE MNTID   INODE NAME
  sshd         1137 root     4  rw- TCPv6 sockfs     9   34689 state=listen laddr=[::]:22
  test_mkfds 716926  jet     3  rw- TCPv6 sockfs     9 6042073 state=listen laddr=[::1]:12345
  test_mkfds 716926  jet     4  rw- TCPv6 sockfs     9 6042074 state=established laddr=[::1]:23456 raddr=[::1]:12345
  test_mkfds 716926  jet     5  rw- TCPv6 sockfs     9 6042075 state=established laddr=[::1]:12345 raddr=[::1]:23456

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: (man) fix typos
Masatake YAMATO [Mon, 13 Feb 2023 13:38:53 +0000 (22:38 +0900)] 
lsfd: (man) fix typos

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agoMerge branch 'kernel-doc-links' of https://github.com/nl6720/util-linux
Karel Zak [Fri, 17 Feb 2023 10:45:27 +0000 (11:45 +0100)] 
Merge branch 'kernel-doc-links' of https://github.com/nl6720/util-linux

* 'kernel-doc-links' of https://github.com/nl6720/util-linux:
  documentation: link to HTML versions of kernel docs on docs.kernel.org

2 years agoMerge branch 'lsfd-unix-including-spaces-in-path' of https://github.com/masatake...
Karel Zak [Fri, 17 Feb 2023 10:43:51 +0000 (11:43 +0100)] 
Merge branch 'lsfd-unix-including-spaces-in-path' of https://github.com/masatake/util-linux

* 'lsfd-unix-including-spaces-in-path' of https://github.com/masatake/util-linux:
  lsfd: read the UNIX socket path including white spaces correctly
  lsfd: prepare enough large buffer when reading /proc/net/unix

2 years agolibmount: add fsconfig() btrfs workaround
Karel Zak [Thu, 16 Feb 2023 12:44:24 +0000 (13:44 +0100)] 
libmount: add fsconfig() btrfs workaround

The new kernel mount API is not properly implemented in all FS
drivers. See strace output:

fsconfig(3, FSCONFIG_SET_STRING, "source", "/dev/sda", 0) = 0
fsconfig(3, FSCONFIG_SET_STRING, "context", "system_u:object_r:root_t:s0", 0) = 0
fsconfig(3, FSCONFIG_CMD_CREATE, NULL, NULL, 0) = -1 EINVAL (Invalid argument)

Reported-by: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibmount: support "recursive" argument for VFS attributes
Karel Zak [Wed, 15 Feb 2023 13:30:58 +0000 (14:30 +0100)] 
libmount: support "recursive" argument for VFS attributes

 mount  -o bind,ro=recursive,nosuid /foo /bar

sets all sub-mount to read-only, but only /bar will be nosuid.

Addresses: https://github.com/util-linux/util-linux/issues/1501
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agodocumentation: link to HTML versions of kernel docs on docs.kernel.org
nl6720 [Wed, 15 Feb 2023 13:28:42 +0000 (15:28 +0200)] 
documentation: link to HTML versions of kernel docs on docs.kernel.org

2 years agolsfd: read the UNIX socket path including white spaces correctly
Masatake YAMATO [Mon, 13 Feb 2023 19:03:27 +0000 (04:03 +0900)] 
lsfd: read the UNIX socket path including white spaces correctly

The original code uses '%s' scanf specifier to read lines in /proc/net/unix.
If white space is included in a path, lsfd could read only the first word of the path.
This commit fixes this bug.

Specifying the maximum length of path is suggested by Karel Zak <kzak@redhat.com>.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agoinclude: improve statx fallback
Karel Zak [Tue, 14 Feb 2023 11:04:41 +0000 (12:04 +0100)] 
include: improve statx fallback

Addresses: https://github.com/util-linux/util-linux/pull/2065
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolsfd: prepare enough large buffer when reading /proc/net/unix
Masatake YAMATO [Mon, 13 Feb 2023 18:59:35 +0000 (03:59 +0900)] 
lsfd: prepare enough large buffer when reading /proc/net/unix

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolast: use full size of the username
Karel Zak [Mon, 13 Feb 2023 15:22:23 +0000 (16:22 +0100)] 
last: use full size of the username

utmp uses 32 bytes for username, last(1) truncates it to 31 when calls getpwnam().

Reported-by: Radka Skvarilova <rskvaril@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoinclude: cleanup close_range fallback
Karel Zak [Mon, 13 Feb 2023 13:28:08 +0000 (14:28 +0100)] 
include: cleanup close_range fallback

* let's use && operator rather than if-if
* define HAVE_CLOSE_RANGE only if callback is really avalable

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoinclude: add fallback for statx
Karel Zak [Mon, 13 Feb 2023 13:25:26 +0000 (14:25 +0100)] 
include: add fallback for statx

Fixes: https://github.com/util-linux/util-linux/pull/2065
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'waitpid/cleanup' of https://github.com/t-8ch/util-linux
Karel Zak [Mon, 13 Feb 2023 12:42:05 +0000 (13:42 +0100)] 
Merge branch 'waitpid/cleanup' of https://github.com/t-8ch/util-linux

* 'waitpid/cleanup' of https://github.com/t-8ch/util-linux:
  waitpid: prettify options terminator
  waitpid: delete trailing whitespace
  waipid: print error message without pids
  waitpid: fix help alignment

2 years agoMerge branch 'lsfd-raw' of https://github.com/masatake/util-linux
Karel Zak [Mon, 13 Feb 2023 12:40:48 +0000 (13:40 +0100)] 
Merge branch 'lsfd-raw' of https://github.com/masatake/util-linux

* 'lsfd-raw' of https://github.com/masatake/util-linux:
  lsfd: remove redundant parentheses surrounding return values
  lsfd: rename tcp_state to l4_state and use the type instead of unsigned int
  lsfd: use SCNu16 format specifier instead of cast operations (unsigned short)
  lsfd: use extra information loaded from /proc/net/raw
  lsfd: make TCP and UDP related code L3 protocol neutral
  lsfd: refactor the usage of tcp_decode_state()
  lsfd: move the field representing connection state from tcp_xinfo to the L4 abstract layer
  lsfd: add methods to the L4 abstract layer for hidding differences in L3 protocols
  lsfd: implement code scanning lines in /proc/net/$proto as a method in the L4 abstract layer
  lsfd: introduce L4 abstract layer stacked on IP and IP6
  lsfd: fix wrong identifier namings (L3->L4)
  lsfd: move kernel32_to_cpu() front in the source file
  lsfd: remove an unused field from struct sock_xinfo_class
  lsfd: (man) fix the description of NAME fields for TCP and UDP sockets
  lsfd: adjust coding style, insert space after "switch" keyword

2 years agowaitpid: prettify options terminator
Thomas Weißschuh [Sat, 11 Feb 2023 04:29:01 +0000 (04:29 +0000)] 
waitpid: prettify options terminator

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agowaitpid: delete trailing whitespace
Thomas Weißschuh [Sat, 11 Feb 2023 04:25:20 +0000 (04:25 +0000)] 
waitpid: delete trailing whitespace

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agowaipid: print error message without pids
Thomas Weißschuh [Sat, 11 Feb 2023 04:24:41 +0000 (04:24 +0000)] 
waipid: print error message without pids

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agowaitpid: fix help alignment
Thomas Weißschuh [Sat, 11 Feb 2023 04:24:25 +0000 (04:24 +0000)] 
waitpid: fix help alignment

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolsfd: remove redundant parentheses surrounding return values
Masatake YAMATO [Fri, 10 Feb 2023 04:38:00 +0000 (13:38 +0900)] 
lsfd: remove redundant parentheses surrounding return values

Suggested-by: Thomas Weißschuh <thomas@t-8ch.de>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: rename tcp_state to l4_state and use the type instead of unsigned int
Masatake YAMATO [Fri, 10 Feb 2023 04:34:13 +0000 (13:34 +0900)] 
lsfd: rename tcp_state to l4_state and use the type instead of unsigned int

Suggested-by: Thomas Weißschuh <thomas@t-8ch.de>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: use SCNu16 format specifier instead of cast operations (unsigned short)
Masatake YAMATO [Fri, 10 Feb 2023 01:11:17 +0000 (10:11 +0900)] 
lsfd: use SCNu16 format specifier instead of cast operations (unsigned short)

Suggested-by: Thomas Weißschuh <thomas@t-8ch.de>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: use extra information loaded from /proc/net/raw
Masatake YAMATO [Wed, 1 Feb 2023 12:53:57 +0000 (21:53 +0900)] 
lsfd: use extra information loaded from /proc/net/raw

RAW.PROTOCOL field is added.

Thomas Weißschuh <thomas@t-8ch.de> suggested making the test
script executable.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: make TCP and UDP related code L3 protocol neutral
Masatake YAMATO [Thu, 2 Feb 2023 18:05:23 +0000 (03:05 +0900)] 
lsfd: make TCP and UDP related code L3 protocol neutral

So we can reuse the current L4 code when supporting IPv6.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: refactor the usage of tcp_decode_state()
Masatake YAMATO [Fri, 3 Feb 2023 00:32:01 +0000 (09:32 +0900)] 
lsfd: refactor the usage of tcp_decode_state()

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: move the field representing connection state from tcp_xinfo to the L4 abstract...
Masatake YAMATO [Thu, 2 Feb 2023 17:23:08 +0000 (02:23 +0900)] 
lsfd: move the field representing connection state from tcp_xinfo to the L4 abstract layer

So we can reuse the code related to the field in
udp, raw, tcp6, udp6, and raw6.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: add methods to the L4 abstract layer for hidding differences in L3 protocols
Masatake YAMATO [Thu, 2 Feb 2023 16:55:29 +0000 (01:55 +0900)] 
lsfd: add methods to the L4 abstract layer for hidding differences in L3 protocols

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: implement code scanning lines in /proc/net/$proto as a method in the L4 abstrac...
Masatake YAMATO [Thu, 2 Feb 2023 16:26:42 +0000 (01:26 +0900)] 
lsfd: implement code scanning lines in /proc/net/$proto as a method in the L4 abstract layer

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: introduce L4 abstract layer stacked on IP and IP6
Masatake YAMATO [Thu, 2 Feb 2023 16:06:28 +0000 (01:06 +0900)] 
lsfd: introduce L4 abstract layer stacked on IP and IP6

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: fix wrong identifier namings (L3->L4)
Masatake YAMATO [Fri, 10 Feb 2023 03:49:37 +0000 (12:49 +0900)] 
lsfd: fix wrong identifier namings (L3->L4)

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolibblkid: bcachefs: fix new magic detection
Thomas Weißschuh [Fri, 10 Feb 2023 03:37:48 +0000 (03:37 +0000)] 
libblkid: bcachefs: fix new magic detection

The new bcache-specific magic value was wrong and the new testcase
didn't actually use this magic.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agoumount: don't ignore --quiet for non-root users
Karel Zak [Thu, 9 Feb 2023 13:11:00 +0000 (14:11 +0100)] 
umount: don't ignore --quiet for non-root users

The command line option --quiet suppresses 'not mounted' error
messages. This does not work for non-root users because libmount does
not call umount(2) syscall, and in this case, the library returns
-EPERM.

Fixes: https://github.com/util-linux/util-linux/issues/2060
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibfdisk: (gpt) remove unnecessary code
Karel Zak [Wed, 8 Feb 2023 15:21:32 +0000 (16:21 +0100)] 
libfdisk: (gpt) remove unnecessary code

The function gpt_sizeof_entries() already checks for limits.

Fixes: https://github.com/util-linux/util-linux/issues/2057
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agocal: (man) fix -c
Karel Zak [Wed, 8 Feb 2023 15:01:12 +0000 (16:01 +0100)] 
cal: (man) fix -c

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'cal-columns' of https://github.com/t-8ch/util-linux
Karel Zak [Wed, 8 Feb 2023 14:57:12 +0000 (15:57 +0100)] 
Merge branch 'cal-columns' of https://github.com/t-8ch/util-linux

* 'cal-columns' of https://github.com/t-8ch/util-linux:
  cal: allow to specifiy columns
  cal: support arbitrary amount of months per row

2 years agoMerge branch 'fix_comment_in_scriptlive' of https://github.com/8vasu/util-linux
Karel Zak [Wed, 8 Feb 2023 14:49:20 +0000 (15:49 +0100)] 
Merge branch 'fix_comment_in_scriptlive' of https://github.com/8vasu/util-linux

* 'fix_comment_in_scriptlive' of https://github.com/8vasu/util-linux:
  Fix minor typo in comment.

2 years agolsfd: move kernel32_to_cpu() front in the source file
Masatake YAMATO [Thu, 2 Feb 2023 16:25:17 +0000 (01:25 +0900)] 
lsfd: move kernel32_to_cpu() front in the source file

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: remove an unused field from struct sock_xinfo_class
Masatake YAMATO [Thu, 2 Feb 2023 16:03:13 +0000 (01:03 +0900)] 
lsfd: remove an unused field from struct sock_xinfo_class

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: (man) fix the description of NAME fields for TCP and UDP sockets
Masatake YAMATO [Fri, 3 Feb 2023 14:59:07 +0000 (23:59 +0900)] 
lsfd: (man) fix the description of NAME fields for TCP and UDP sockets

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: adjust coding style, insert space after "switch" keyword
Masatake YAMATO [Sun, 5 Feb 2023 21:59:38 +0000 (06:59 +0900)] 
lsfd: adjust coding style, insert space after "switch" keyword

2 years agoFix minor typo in comment.
Soumendra Ganguly [Sun, 5 Feb 2023 21:07:37 +0000 (15:07 -0600)] 
Fix minor typo in comment.

Signed-off-by: Soumendra Ganguly <soumendraganguly@gmail.com>
2 years agolsfd: don't require nsfs to be mounted
Thomas Weißschuh [Fri, 3 Feb 2023 18:12:31 +0000 (18:12 +0000)] 
lsfd: don't require nsfs to be mounted

nsfs only gets mounted in fairly specific circumstances[0].

[0] https://unix.stackexchange.com/a/559723

Suggested-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolsfd: make self_netns_sb static
Thomas Weißschuh [Sat, 4 Feb 2023 03:50:06 +0000 (03:50 +0000)] 
lsfd: make self_netns_sb static

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolsfd: run netfs test
Thomas Weißschuh [Fri, 3 Feb 2023 18:14:38 +0000 (18:14 +0000)] 
lsfd: run netfs test

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolsfd: skip test mkfds-netns in qemu-user
Thomas Weißschuh [Sat, 4 Feb 2023 02:09:28 +0000 (02:09 +0000)] 
lsfd: skip test mkfds-netns in qemu-user

qemu-user does not implement ioctl(SIOCGSKNS)

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agogit: ignore m4/libtool.m4.orig
Yegor Yefremov [Mon, 30 Jan 2023 10:34:53 +0000 (11:34 +0100)] 
git: ignore m4/libtool.m4.orig

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2 years agoagetty: don't ignore --noclear when re-print issue file
Karel Zak [Thu, 2 Feb 2023 15:46:46 +0000 (16:46 +0100)] 
agetty: don't ignore --noclear when re-print issue file

The system network interface changes generate events that may force
agetty to re-print the issue file. The options --noclear should be
ignored in this case.

Fixes: https://github.com/util-linux/util-linux/issues/2051
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'lsfd-minor-updates' of https://github.com/masatake/util-linux
Karel Zak [Thu, 2 Feb 2023 15:33:53 +0000 (16:33 +0100)] 
Merge branch 'lsfd-minor-updates' of https://github.com/masatake/util-linux

* 'lsfd-minor-updates' of https://github.com/masatake/util-linux:
  lsfd: use skip_space()
  lsfd: use "struct in_addr" to represent IPv4 addresses
  lsfd: don't put a spcae between a function and its arguments
  lsfd: delete a redundant cast operation
  tests: (mkfds) fix typos in error messages
  tests: (mkfds) fix typos in factory descriptions
  tests: (mkfds) check the privilege required in the factory to run

2 years agoinclude/cctype: fix License header
Karel Zak [Thu, 2 Feb 2023 15:20:43 +0000 (16:20 +0100)] 
include/cctype: fix License header

This file has been originally imported from gnulib with GPL header,
but it's now available with LGPLv2+ now (since gnulib commit https://git.savannah.gnu.org/cgit/gnulib.git/commit/lib/c-ctype.h?id=5ffa144085078c72e7d60759ab2d6100b04cd2c2).

Fixes: https://github.com/util-linux/util-linux/issues/2050
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agocal: allow to specifiy columns
Thomas Weißschuh [Sat, 21 Jan 2023 01:28:12 +0000 (01:28 +0000)] 
cal: allow to specifiy columns

Replaces #117

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agocal: support arbitrary amount of months per row
Thomas Weißschuh [Sat, 21 Jan 2023 02:04:38 +0000 (02:04 +0000)] 
cal: support arbitrary amount of months per row

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolsfd: use skip_space()
Masatake YAMATO [Sat, 28 Jan 2023 03:09:02 +0000 (12:09 +0900)] 
lsfd: use skip_space()

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: use "struct in_addr" to represent IPv4 addresses
Masatake YAMATO [Tue, 24 Jan 2023 22:30:31 +0000 (07:30 +0900)] 
lsfd: use "struct in_addr" to represent IPv4 addresses

So we can use macros defined in netinet/in.h.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: don't put a spcae between a function and its arguments
Masatake YAMATO [Wed, 1 Feb 2023 17:34:20 +0000 (02:34 +0900)] 
lsfd: don't put a spcae between a function and its arguments

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: delete a redundant cast operation
Masatake YAMATO [Tue, 24 Jan 2023 22:30:31 +0000 (07:30 +0900)] 
lsfd: delete a redundant cast operation

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agotests: (mkfds) fix typos in error messages
Masatake YAMATO [Tue, 31 Jan 2023 12:07:22 +0000 (21:07 +0900)] 
tests: (mkfds) fix typos in error messages

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agotests: (mkfds) fix typos in factory descriptions
Masatake YAMATO [Sat, 28 Jan 2023 23:31:27 +0000 (08:31 +0900)] 
tests: (mkfds) fix typos in factory descriptions

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agotests: (mkfds) check the privilege required in the factory to run
Masatake YAMATO [Wed, 1 Feb 2023 12:44:46 +0000 (21:44 +0900)] 
tests: (mkfds) check the privilege required in the factory to run

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agoMerge branch 'patch-1' of https://github.com/ThomasKaiser/util-linux
Karel Zak [Wed, 1 Feb 2023 11:25:12 +0000 (12:25 +0100)] 
Merge branch 'patch-1' of https://github.com/ThomasKaiser/util-linux

2 years agochrt: (man) fix indention and properly mark examples
Karel Zak [Wed, 1 Feb 2023 11:22:59 +0000 (12:22 +0100)] 
chrt: (man) fix indention and properly mark examples

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'chrt-examples' of https://github.com/anarcat/util-linux
Karel Zak [Wed, 1 Feb 2023 11:16:04 +0000 (12:16 +0100)] 
Merge branch 'chrt-examples' of https://github.com/anarcat/util-linux

* 'chrt-examples' of https://github.com/anarcat/util-linux:
  add more concrete examples of how to use chrt(1)

2 years agolslogins: (man) add note about new accounts
Karel Zak [Tue, 31 Jan 2023 15:16:21 +0000 (16:16 +0100)] 
lslogins: (man) add note about new accounts

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolslogins: explain password statuses
Karel Zak [Tue, 31 Jan 2023 15:08:00 +0000 (16:08 +0100)] 
lslogins: explain password statuses

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoAdding older Apple cores based on XNU kernel source
ThomasKaiser [Tue, 31 Jan 2023 10:58:24 +0000 (11:58 +0100)] 
Adding older Apple cores based on XNU kernel source

Naming based on https://opensource.apple.com/source/xnu/xnu-7195.81.3/osfmk/arm/cpuid.h.auto.html and https://en.wikipedia.org/wiki/List_of_Apple_codenames#Apple-designed_processors

No idea about IDs of the new and more interesting Sawtooth and Everest cores in the A16 SoC. I'll leave this for the Asahi people to discover...

2 years agoadd more concrete examples of how to use chrt(1)
Antoine Beaupré [Thu, 26 Jan 2023 16:21:16 +0000 (11:21 -0500)] 
add more concrete examples of how to use chrt(1)

I've come looking at this manpage with the simple "how do I make this
process use realtime scheduling?" question and couldn't find a
definite answer. Of course, RT is more complicated than "just make
this real time": there's various queues and scheduling classes, but I
think it's worth giving a good, simple example that should basically
work.

In particular, my use case was "my audio is stuttering, is this a
scheduling problem?" By picking the RR scheduler, we set a realtime
scheduling priority that's lower than kernel threads (e.g. migration
is FF/99, irq is FF/50) so that we go above existing processes, but
without kicking out more critical systems.

This, of course, is a matter of taste, and the settings here are a
little arbitrary. I send this patch in the hope that either those are
accepted as canon (which would surprise me) or that someone comes up
with a more canonical example.

The "reset" example also seems like a more critical addition to the
manual.

Finally, I change the name of the section from USAGE to the more
standard EXAMPLES, as per man-pages(7).

2 years agoMerge branch 'test_blkid_fuzz' of https://github.com/t-8ch/util-linux
Karel Zak [Thu, 26 Jan 2023 16:01:10 +0000 (17:01 +0100)] 
Merge branch 'test_blkid_fuzz' of https://github.com/t-8ch/util-linux

* 'test_blkid_fuzz' of https://github.com/t-8ch/util-linux:
  libblkid: add test_blkid_fuzz_sample

2 years agoMerge branch 'chmod' of https://github.com/ferivoz/util-linux
Karel Zak [Thu, 26 Jan 2023 16:00:28 +0000 (17:00 +0100)] 
Merge branch 'chmod' of https://github.com/ferivoz/util-linux

* 'chmod' of https://github.com/ferivoz/util-linux:
  fsck.cramfs: fix error message

2 years agofsck.cramfs: check directory entry names
Samanta Navarro [Thu, 26 Jan 2023 11:56:42 +0000 (11:56 +0000)] 
fsck.cramfs: check directory entry names

Do not accept slashes in names or the special entries "." and ".." in
directories while extracting files.

[kzak@redhat.com: - add errx_path() to report the path]

Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agofsck.cramfs: fix error message
Samanta Navarro [Thu, 26 Jan 2023 11:55:33 +0000 (11:55 +0000)] 
fsck.cramfs: fix error message

The error message for a failing chmod call contains chown as reason.
Fix this by stating that chmod failed.

Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
2 years agolibblkid: add test_blkid_fuzz_sample
Thomas Weißschuh [Wed, 25 Jan 2023 17:21:18 +0000 (17:21 +0000)] 
libblkid: add test_blkid_fuzz_sample

This can be used to easily reproduce crashes produced by the fuzzers.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolibblkid: bcachefs: avoid overflow in address comparisions
Thomas Weißschuh [Wed, 25 Jan 2023 05:47:16 +0000 (05:47 +0000)] 
libblkid: bcachefs: avoid overflow in address comparisions

Adding the offset to the address may overflow and break the comparision,
use substraction instead.

Addresses: #2030
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolibblkid: bcachefs: simplify member field size validation
Thomas Weißschuh [Wed, 25 Jan 2023 05:40:15 +0000 (05:40 +0000)] 
libblkid: bcachefs: simplify member field size validation

We can avoid messing with pointers by just directly checking the size.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolibblkid: bcachefs: remove superfluous validations
Thomas Weißschuh [Wed, 25 Jan 2023 05:34:50 +0000 (05:34 +0000)] 
libblkid: bcachefs: remove superfluous validations

These checks are redundant as we already validated
* `dev_idx < bcs->nr_devices` in `probe_bcachefs()`
* `field + BYTES(field) < sb_end` in `probe_bcachefs_sb_fields()`
* `member_field_end(members, bcs->nr_devices - 1) == field + BYTES(field)`
  right above.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolibblkid: bcachefs: use uint64_t for structure length
Thomas Weißschuh [Wed, 25 Jan 2023 04:27:20 +0000 (04:27 +0000)] 
libblkid: bcachefs: use uint64_t for structure length

The value of "u64s" can overflow when multiplied by 8.
Use a larger type to avoid this.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agowhereis: add glob(7) support (new option -g)
Karel Zak [Wed, 25 Jan 2023 13:13:05 +0000 (14:13 +0100)] 
whereis: add glob(7) support (new option -g)

$ whereis -b -g 'find???'
find???: /usr/bin/findmnt /usr/bin/findscu

Fixes: https://github.com/util-linux/util-linux/issues/2021
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibblkid: align nilfs superblock [OSS-Fuzz 55382]
Karel Zak [Wed, 25 Jan 2023 12:37:05 +0000 (13:37 +0100)] 
libblkid: align nilfs superblock [OSS-Fuzz 55382]

Addresses: https://github.com/util-linux/util-linux/issues/2043
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agotools/config-gen: improve fuzzers
Karel Zak [Wed, 25 Jan 2023 12:36:47 +0000 (13:36 +0100)] 
tools/config-gen: improve fuzzers

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agodmesg: (man) add note about subsecond support
Karel Zak [Wed, 25 Jan 2023 11:57:50 +0000 (12:57 +0100)] 
dmesg: (man) add note about subsecond support

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'dmesg-subsecond' of https://github.com/t-8ch/util-linux
Karel Zak [Wed, 25 Jan 2023 11:40:30 +0000 (12:40 +0100)] 
Merge branch 'dmesg-subsecond' of https://github.com/t-8ch/util-linux

* 'dmesg-subsecond' of https://github.com/t-8ch/util-linux:
  dmesg: use subsecond granularity in iso format
  dmesg: add subsecond granularity for --since and --until
  lib/monotonic: get_suspended_time: use usec_t
  timeutils: add utilities for usec_t conversions
  dmesg: add test for --since and --until

2 years agofstrim: add --types to filter out by filesystem types
Karel Zak [Tue, 24 Jan 2023 18:03:15 +0000 (19:03 +0100)] 
fstrim: add --types to filter out by filesystem types

Fixes: https://github.com/util-linux/util-linux/issues/2040
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibmount: don't require return argument in get-like functions
Karel Zak [Tue, 24 Jan 2023 17:35:21 +0000 (18:35 +0100)] 
libmount: don't require return argument in get-like functions

Fixes: https://github.com/util-linux/util-linux/issues/2039
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolsblk: use sysfs_blkdev_is_removable()
Karel Zak [Tue, 24 Jan 2023 16:38:49 +0000 (17:38 +0100)] 
lsblk: use sysfs_blkdev_is_removable()

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolib/sysfs: fix semantics of blkdev_is_hotpluggable
Thomas Weißschuh [Wed, 11 Jan 2023 19:10:57 +0000 (19:10 +0000)] 
lib/sysfs: fix semantics of blkdev_is_hotpluggable

This is now decoubled from the kernels notion of a removable *block*
device and instead uses removable kobjects.
This is the correct semantic for hotpluggable devices.

2 years agoeject: also use sysfs_blkdev_is_removable
Thomas Weißschuh [Wed, 11 Jan 2023 18:14:03 +0000 (18:14 +0000)] 
eject: also use sysfs_blkdev_is_removable

It correctly represents devices that can be ejected.

2 years agolib/sysfs: add TODO about removable usb devices
Thomas Weißschuh [Wed, 11 Jan 2023 18:17:35 +0000 (18:17 +0000)] 
lib/sysfs: add TODO about removable usb devices

The usage of the "removable" attribute by the USB subsystem is
incorrect.

2 years agolib/sysfs: add function blkdev_is_removable
Thomas Weißschuh [Wed, 11 Jan 2023 18:13:50 +0000 (18:13 +0000)] 
lib/sysfs: add function blkdev_is_removable

This exactly represents the kernels notion of a "removable" blockdevice.
That is, the device itself is persistent but can contain some sort of
medium that can be changed at runtime.
Specifically it is *not* hotpluggable.

2 years agoinclude/c: add functions to print from signal handlers
Karel Zak [Tue, 24 Jan 2023 16:05:25 +0000 (17:05 +0100)] 
include/c: add functions to print from signal handlers

Addresses: https://github.com/util-linux/util-linux/pull/2019
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agodmesg: use subsecond granularity in iso format
Thomas Weißschuh [Sat, 21 Jan 2023 00:44:14 +0000 (00:44 +0000)] 
dmesg: use subsecond granularity in iso format

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agodmesg: add subsecond granularity for --since and --until
Thomas Weißschuh [Fri, 20 Jan 2023 06:18:36 +0000 (06:18 +0000)] 
dmesg: add subsecond granularity for --since and --until

Fixes #1708

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolib/monotonic: get_suspended_time: use usec_t
Thomas Weißschuh [Sat, 21 Jan 2023 00:21:10 +0000 (00:21 +0000)] 
lib/monotonic: get_suspended_time: use usec_t

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agotimeutils: add utilities for usec_t conversions
Thomas Weißschuh [Sat, 21 Jan 2023 00:28:30 +0000 (00:28 +0000)] 
timeutils: add utilities for usec_t conversions

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agodmesg: add test for --since and --until
Thomas Weißschuh [Fri, 20 Jan 2023 06:10:48 +0000 (06:10 +0000)] 
dmesg: add test for --since and --until

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agoMerge branch 'signal_safety' of https://github.com/crrodriguez/util-linux
Karel Zak [Tue, 24 Jan 2023 15:45:42 +0000 (16:45 +0100)] 
Merge branch 'signal_safety' of https://github.com/crrodriguez/util-linux

* 'signal_safety' of https://github.com/crrodriguez/util-linux:
  sulogin: only assign to variables written by signal handlers
  hardlink: calling putchar is off-limits on a signal handler
  hardlink: last_signal should be a volatile sig_atomic_t
  pg: calling exit on signal handler is not allowed
  lib:pager: fix signal safety issues
  write: signal_received should be volatile qualified
  flock: timeout_expired must be volatile qualified
  last: should not use errx/warnx on signal handlers
  su-common: bool is a distinct type in c2x
  fsck: only assign to cancel_requested
  fsck: use sig_atomic_t type fot signal handler global vars

2 years agolib/timeutils: set TZ=GMT for unit test
Karel Zak [Tue, 24 Jan 2023 15:42:42 +0000 (16:42 +0100)] 
lib/timeutils: set TZ=GMT for unit test

It seems better to explicitly set timezone rather than assume some
default libc behavior and system setting.

Addresses: https://github.com/util-linux/util-linux/pull/2025
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'parsetimestamp-usec' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 24 Jan 2023 15:20:25 +0000 (16:20 +0100)] 
Merge branch 'parsetimestamp-usec' of https://github.com/t-8ch/util-linux

* 'parsetimestamp-usec' of https://github.com/t-8ch/util-linux:
  lib/timeutils: parse_timestamp: parse usecs
  lib/timeutils: parse_timestamp: fix second parsing
  lib/timeutils: parse_timestamp: add unittests
  lib/timeutils: parse_timestamp: allow fixed reference time
  ci: update shellcheck
  ci: disable shellcheck warning for unused variables

2 years agoMerge branch 'patch-1' of https://github.com/ThomasKaiser/util-linux
Karel Zak [Tue, 24 Jan 2023 15:19:39 +0000 (16:19 +0100)] 
Merge branch 'patch-1' of https://github.com/ThomasKaiser/util-linux

* 'patch-1' of https://github.com/ThomasKaiser/util-linux:
  Change ThunderX3T110 core name to ThunderX3-T110
  Add missing Exynos M5 core
  Add missing Cavium cores
  Add missing Ampere cores
  Add missing ARM-cores
  Add HiSilicon's 0x48/0xd40 Cortex-A76 variant.
  Add exynos-m4
  Add 53/002:Samsung Exynos-m3

2 years agolib/timeutils: parse_timestamp: parse usecs
Thomas Weißschuh [Fri, 20 Jan 2023 02:18:30 +0000 (02:18 +0000)] 
lib/timeutils: parse_timestamp: parse usecs

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolib/timeutils: parse_timestamp: fix second parsing
Thomas Weißschuh [Fri, 20 Jan 2023 02:43:34 +0000 (02:43 +0000)] 
lib/timeutils: parse_timestamp: fix second parsing

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolib/timeutils: parse_timestamp: add unittests
Thomas Weißschuh [Fri, 20 Jan 2023 02:13:36 +0000 (02:13 +0000)] 
lib/timeutils: parse_timestamp: add unittests

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>