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>.
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
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>
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>
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
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>
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...
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).
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.
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
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.
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.
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
Karel Zak [Mon, 23 Jan 2023 13:09:27 +0000 (14:09 +0100)]
Merge branch 'bcachefs-fuzz' of https://github.com/t-8ch/util-linux
* 'bcachefs-fuzz' of https://github.com/t-8ch/util-linux:
libblkid: bcachefs: limit maximum size of read superblock
libblkid: iso9660: don't warn on isonum mismatch
libblkid: bcachefs: fix member_field_end
libblkid: bcachefs: validate size of member field
libblkid: bcachefs: fix field type
libblkid: bcachefs: add reproducer for oss-fuzz 55282
libblkid: bcachefs: fix endless loop