| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We often used a pattern like if (!FLAGS_SET(flags, SD_JSON_FORMAT_OFF)),
which is rather verbose and also contains a double negative, which we try
to avoid. Add a little helper to avoid an explicit bit check.
This change clarifies an aditional thing: in some cases we treated
SD_JSON_FORMAT_OFF as a flag (flags & SD_JSON_FORMAT_OFF), while in other cases
we treated it as an independent enum value (flags == SD_JSON_FORMAT_OFF).
In the first form, flags like SD_JSON_FORMAT_SSE do _not_ turn the json
output on, while in the second form they do. Let's use the first form
everywhere.
No functional change intended.
Initially I wasn't sure if this helper should be made public or just internal,
but it seems such a common pattern that if we expose the flags, we might just
as well expose it too, to make life easier for any consumers.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is preparation for making our Varlink API a public API. Since our
Varlink API is built on top of our JSON API we need to make that public
first (it's a nice API, but JSON APIs there are already enough, this is
purely about the Varlink angle).
I made most of the json.h APIs public, and just placed them in
sd-json.h. Sometimes I wasn't so sure however, since the underlying data
structures would have to be made public too. If in doubt I didn#t risk
it, and moved the relevant API to src/libsystemd/sd-json/json-util.h
instead (without any sd_* symbol prefixes).
This is mostly a giant search/replace patch.
|
| |
|
|
|
|
|
|
|
|
| |
userns if possible
This opens the door for making the call work without privileges: if we
pass in a userns fd and DissectedImage that has mount fds then we can
acquire all information without privs.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
checking
let's make userspace verity signature checking optional. This adds a
dissection flag to enable the logic and patches through all our users to
enable it by default, thus effectively not changing anything from the
status quo ante. However, know we have a knob to turn this off in
certain scenarios.
|
|
|
|
|
|
| |
Adds a util function to sha256 an open fd (moved from dissect). Also
adds functions to check if a string contains a valid sha256 hash, and
parse it into a sha256 array.
|
| |
|
|
|
|
|
|
|
|
| |
If the image name is different from the filename then show it in the
output, since it's relevant for finding sysext/confext release files.
(Image name is typically the filename without the ".raw" suffix and
similar).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
So far, if some component mounts a DDI in some local mount namespace we
created a temporary mountpoint in /tmp/ for that. Let's instead use the
same directory inode in /run/ instead. This is safe, since if everything
runs in a local mount namespace (with propagation on /run/ off) then
they shouldn't fight for the inode. And it relieves us from having to
clean up the directory after use. Morever, it allows us to run without
/tmp/ mounted.
This only moves dissect-image.c and the dissec tool over. More stuff is
moved over later.
|
|
|
|
|
|
|
|
|
| |
We had both uid-range.h and uid-alloc-range.h. The latter now contains helpers
like {uid,gid}_is_{system,dynamic,container}(), uid_for_system_journal(), so
the existing name is outdated. I think the uid-range.[ch] should stay separate
because it has a bunch of helpers for parsing and printing of uid ranges. So
let's rename as in $subject to better reflect the contents of the file and make
the two sets of files harder to confuse.
|
| |
|
|
|
|
| |
CID#1533112
|
| |
|
|\
| |
| | |
device-util: introduce device_in_subsystem() and device_is_devtype() helper functions
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
| |
It's pointless showing info that isn#t going to survive the current
invocation, hence hide it.
The "partition number" column is more useful since it kinda shows the
same information, but without the device node name prefixed that is
local to the currentl invocation.
|
|
|
|
|
| |
The information is provided to us already in the structure now, hence
use it.
|
|
|
|
|
|
|
| |
The right-alignment was applied to the wrong column, because neither
ee8e497d249ab2e2df92aa024274f5b817270114 nor
1474d7ac2d308204e599a2502a8b5625bca76bcc updated the column count as
they should have.
|
| |
|
| |
|
|
|
|
|
|
| |
These tests are already done at two places, let's unify them in one
place, and tweak them slightly (specifically: require for considering a
DDI bootable in UEFI we also need need an init system inside).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reworks the image discovery logic, and conceptually allows DDIs
that are both confext and sysext to exist. Previously we'd only extract
one type of exension data from a DDI, with this we allow to extract both
if both exist.
This doesn't add support for true "multi-modal" DDIs, that qualify as
various things at once, it just lays some ground work that ensures we at
least can dissect such images.
This reworks 484d26dac1e8e543fc9e300e3c1fa36be0769f7d quite a bit.
This changes systemd-dissect's JSON output, but given the
version with the fields it changes/dops has never been released (as the
above patch was merged post-v254) this shouldn't be an issue.
|
|
|
|
|
|
|
|
| |
The ioctl() failure we handle gracefully, hence also reflect that in the
JSON output.
(While we are at it, bring JSON output into same order as textual
output, i.e. move uuid down a bit.)
|
|
|
|
|
| |
We show it in the human readable output, and we should include the same
data in the JSON output too.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
This adds support for the new fsmount() logic of the kernel: we'll first
create an unattached fsmount fd, and then in a second step attach this
to some real file system inode – as opposed to attaching file system
directly. The benefit of this is that we can pass the open fsmount fds
over some sockets if need be, to isolate the mounting code from the
attaching code.
|
|
|
|
|
|
| |
For some use cases we want to operate on the loop device that
systemd-dissect has attached the loop device to, so let's make that
easily accessible.
|
|
|
|
|
|
|
| |
The subvolumes set is a set of source inodes similar to how the
denylist hashmap contains source inodes as keys. It indicates
directories in the source tree that should become subvolumes in
the target tree.
|
|
|
|
|
|
| |
The script is mostly equivalent to 'mkdir -p' and 'ln -sfr'.
Let's replace it with install_emptydir() builtin function and
inline meson call.
|
| |
|
|
|
|
|
| |
Allow image wide systemd tool support for confext images by adding dissect
tool support for these images
|
| |
|
| |
|
|
|
|
|
|
| |
Let's make including hashes in the mtree output configurable to allow
speeding up the --mtree command in cases where file hashes are not
required.
|
|
|
|
|
|
| |
--copy-to, --copy-from, --list and --mtree are useful for image directories
as well as image files, so for those verbs, let's check if we were passed
a directory and skip all the image file setup if that's the case.
|
|
|
|
| |
In some places, "<n> bits" is used when more appropriate.
|
|
|
|
|
| |
Let's merge these two into a single function that can handle both
variants and more.
|
|
|
|
| |
Instead of _cleanup_(set_freep) or so.
|
|
|
|
|
| |
This output is already too long to fit on an normal terminal, and the
interesting parts are towards the top.
|
|
|
|
| |
As reported by Fossies.
|
|
|
|
|
|
|
|
|
| |
Addresses
https://github.com/systemd/systemd/pull/25608/commits/84be0c710d9d562f6d2cf986cc2a8ff4c98a138b#r1060130312,
https://github.com/systemd/systemd/pull/25608/commits/84be0c710d9d562f6d2cf986cc2a8ff4c98a138b#r1067927293, and
https://github.com/systemd/systemd/pull/25608/commits/84be0c710d9d562f6d2cf986cc2a8ff4c98a138b#r1067926416.
Follow-up for 84be0c710d9d562f6d2cf986cc2a8ff4c98a138b.
|
|
|
|
|
|
|
|
| |
If we don't find a single useful partition table, refusing dissection.
(Except in systemd-dissect, when we are supposed to show DDI
information, in that case allow this to run and show general DDI
information, i.e. size, UUID and name at least)
|
|
|
|
|
|
| |
This allows unprivileged validation of DDIs. Only superficial structure,
i.e. not mounting or so. This becomes particularly handy in the
integration tests, and to validate image policies.
|
| |
|