Karel Zak [Mon, 19 Sep 2022 10:38:06 +0000 (12:38 +0200)]
Merge branch 'linux_raid/checksum' of https://github.com/t-8ch/util-linux
* 'linux_raid/checksum' of https://github.com/t-8ch/util-linux:
libblkid: linux_raid: add checksum support
libblkid: mdraid: add test for version 1 superblock
Karel Zak [Mon, 19 Sep 2022 10:36:16 +0000 (12:36 +0200)]
Merge branch 'f2fs/fixes' of https://github.com/t-8ch/util-linux
* 'f2fs/fixes' of https://github.com/t-8ch/util-linux:
libblkid: f2fs: ensure checksum offset is within superblock
libblkid: f2fs: fix checksum initialization on big-endian
Karel Zak [Mon, 19 Sep 2022 09:39:09 +0000 (11:39 +0200)]
Revert "libblkid: luks: add checksum support"
See discussion at https://github.com/util-linux/util-linux/pull/1801
The change is unwanted by LUKS upstream developers, the checksum
functionality is designed for libcryptsetup internal use only.
Issues:
* introduces security issue (allocated buffer is not checked agaisnt
maximal value) - inserting LUKS2 device with header faking oversized
header size will cause allocating of huge amount of memory (perhaps
crash of blkid)
* we support JSON area up to 4MB in size (checksum covers also this part
that was not intended to be read by blkid) - calculating SHA256 for
such area is really not fast operation; readin of 4MB of data is waste
of resources either (that's why there is smaill 4k binary header)
* even if checksum check is disabled, it is calculated (complete waste
of time here)
* it does not support anything else that SHA256 (we can switch to different
hash or other algorithm later); blkid should not introduce such limits.
* checksum for the second heder is not calculated at all
Karel Zak [Tue, 13 Sep 2022 06:57:49 +0000 (08:57 +0200)]
Merge branch 'lsfd-refine-columns' of https://github.com/masatake/util-linux
* 'lsfd-refine-columns' of https://github.com/masatake/util-linux:
lsfd: cosmetic change
lsfd: (man) write about PIDFD.* columns
lsfd: show pid, comm, and nspid of pidfd in PIDFD.{PID,COMM,NSPID} columns
lsfd: (filter): accept '.' used in column names
tests: (lsfd) fix the potential problems reported by github-code-scan
tests: (lsfd) put double quote characters around variable expansions
lsfd: use NAME column to show cooked file names
lsfd: use TYPE column to show cooked file types
lsfd: show classes of anonyomous inodes in AINODECLASS column
lsfd: cosmetic changes
tests: (mkfds) add a factory for making an inotify fd
tests: (mkfds) cosmetic change, deleting an empty line
lsfd: show pid, comm, and nspid of pidfd in PIDFD.{PID,COMM,NSPID} columns
The values shown in the new columns are already shown in NAME column.
Showing these values together in the NAME column helps users
understand the pidfds opened quickly. However, the showing them
together is not suitable for machine processing. The newly introduced
columns are for machine processing.
This change splits the NAME column
into cooked NAME column and raw KNAME column.
KNAME represents the type information extracted from /proc/$pid/fd or
/proc/$pid/map_files. NAME is the same as KNAME but humans friendly
and talkative if a special handler is implemented for the type of the
file.
Peter Ujfalusi [Wed, 7 Sep 2022 05:41:41 +0000 (08:41 +0300)]
lib/timeutils: Require '@' prefix for seconds since the Epoch timestamp
Since the seconds since the Epoch is just a number it might be better to
require special prefix to indicate the intention that the user wants to
interpret the number as seconds since the Epoch.
Use the same '@' character as prefix as used by systemd.time to make it
easier to integrate in scripts intended to be used on systems with or
without systemd.
Fix also the initial support which discarded the seconds from the converted
timestamp.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
A. show quickly understandable information in limited display area, and
B. provide primitive raw information for post-process tools.
For the purpose A, summarizing information is nice. However, the
summarized information is not suitable for tools.
To satisfy the both requirements, I plan introducing new fields
with a new convention.
STTYPE represents the type information returned from stat(2).
TYPE is the same as STTYPE but two exceptions; TYPE is filled with
PROTONAME value if the target fd is a socket, or with AINODECLASS
value if the target fd is a anonymous inode.
Jakub Wilk [Wed, 7 Sep 2022 15:55:16 +0000 (17:55 +0200)]
Use "grep -E" instead of "egrep"
The egrep command has been deprecated since GNU grep 2.5.3
(released in 2007). In GNU grep 3.8, it issues an obsolescence warning:
https://git.savannah.gnu.org/cgit/grep.git/commit/?id=a9515624709865d4
Karel Zak [Mon, 5 Sep 2022 07:01:42 +0000 (09:01 +0200)]
lsblk: add PARTN column
Add PARTN column, the source for this column is ID_PART_ENTRY_NUMBER
from udev db, the original source of this information comes from
libblkid. There is also another PARTN in udevdb, but it's based on
data from kernel uevent.
Fixes: https://github.com/util-linux/util-linux/issues/1787 Signed-off-by: Karel Zak <kzak@redhat.com>
Jeremy Linton [Thu, 1 Sep 2022 21:52:30 +0000 (16:52 -0500)]
lscpu: Even more Arm part numbers
Arm has published further MIDR/part numbers on
https://developer.arm.com/ip-products/processors/cortex-a.
Some of the new ones have already been merged, so lets
fill in the gaps with A34, A65AE and X1C.
Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
Chris Webb [Wed, 24 Aug 2022 11:52:55 +0000 (12:52 +0100)]
unshare: Don't waste an ID when -r is used with --map-auto
When --map-root-user or --map-current-user are used with --map-auto, one of
the IDs from the first range in /etc/subuid and /etc/subgid is wasted and
left unmapped:
In the second unshare, only 99 of the 100 UIDs available from /etc/subuid
are actually mapped, whereas in the first unshare, all 100 delegated UIDs
are correctly mapped.
Distinguish auto mappings from manually-specified ones so they can be
handled correctly, while still ensuring explicit --map-users/groups that
overlap with the single mapping are correctly reduced in length because
of the hole that's punched:
Check whether magic.h header exists before defining HAVE_MAGIC.
Despite library availability there still can be missing header.
Current test doesn't cover that possibility which will lead compilation
to fail in case of separate sysroot.
Signed-off-by: Mateusz Marciniec <mateuszmar2@gmail.com> Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com>
Karel Zak [Fri, 19 Aug 2022 07:29:56 +0000 (09:29 +0200)]
Merge branch 'lsfd-pidfd' of https://github.com/masatake/util-linux
* 'lsfd-pidfd' of https://github.com/masatake/util-linux:
lsfd.1.adoc: write about how pidfds are represented in NAME column
lsfd: show pids targeted by pidfds in NAME column
lsfd: add a helper function to get 'struct proc' object for given pid
lsfd: introduce a method table for supporting various anon inodes
lsfd.1.adoc: write more about TYPE column
lsfd.1.adoc: fix a wrong formatting
lsfd.1.adoc: fix typos
lsfd.1.adoc: use monospace face instead of italic face
lsfd: delete __unused__ attr from a used parameter