guestfish, guestmount: enable networking for "--key ID:clevis"

Call the C-language helper key_store_requires_network() in guestfish and
guestmount.

(Short log for the "common" submodule, commit range
35467027f657..af6cb55bc58a:

Laszlo Ersek (12):
      options: fix UUID comparison logic bug in get_keys()
      mltools/tools_utils: remove unused function "key_store_to_cli"
      mltools/tools_utils: allow multiple "--key" options for OCaml tools too
      options: replace NULL-termination with number-of-elements in get_keys()
      options: wrap each passphrase from get_keys() into a struct
      options: add back-end for LUKS decryption with Clevis+Tang
      options: introduce selector type "key_clevis"
      options: generalize "--key" selector parsing for C-language utilities
      mltools/tools_utils-c: handle internal type error with abort()
      mltools/tools_utils: generalize "--key" selector parsing for OCaml utils
      options, mltools/tools_utils: parse "--key ID:clevis" options
      options, mltools/tools_utils: add helper for network dependency
).

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1809453
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Message-Id: <20220630122048.19335-4-lersek@redhat.com>
This commit is contained in:
Laszlo Ersek
2022-06-30 14:20:48 +02:00
parent 9a3e9a6c03
commit 6a5b44f538
3 changed files with 8 additions and 1 deletions

View File

@@ -348,6 +348,10 @@ main (int argc, char *argv[])
/* Do the guest drives and mountpoints. */
add_drives (drvs);
if (key_store_requires_network (ks) && guestfs_set_network (g, 1) == -1)
exit (EXIT_FAILURE);
if (guestfs_launch (g) == -1)
exit (EXIT_FAILURE);
if (inspector)