search for: make_mapname

Displaying 20 results from an estimated 25 matches for "make_mapname".

2020 Mar 30
6
[PATCH common 0/4] options: Support Windows BitLocker (RHBZ#1808977).
Support transparent decryption/inspection of Windows guests encrypted with BitLocker encryption. This won't make much sense without the associated libguestfs patches which I will post momentarily. (Submodules, ho hum) Rich.
2020 Mar 30
0
[PATCH common 2/4] options: Generate cryptsetup mapnames beginning with "crypt..." not "luks..."
...quot;options.h" /** - * Make a LUKS map name from the partition name, - * eg. C<"/dev/vda2" =E<gt> "luksvda2"> + * Make a cryptsetup map name from the partition name, + * eg. C<"/dev/vda2" =E<gt> "cryptvda2"> */ -static void -make_mapname (const char *device, char *mapname, size_t len) +static char * +make_mapname (const char *device) { size_t i = 0; - - if (len < 5) - abort (); - strcpy (mapname, "luks"); - mapname += 4; - len -= 4; + char *ret; if (STRPREFIX (device, "/dev/")) - i = 5; +...
2020 Sep 07
5
[PATCH common v2 0/4] Windows BitLocker support.
For links to the original patch series, see: https://bugzilla.redhat.com/show_bug.cgi?id=1808977#c8 The original feedback was that ignoring errors from guestfs_luks_uuid would ignore legitimate errors from non-BitLocker disks, so I have modified this series so that errors are only ignored in the BitLocker case. As noted in the 4th patch there is no actual error in the BitLocker case, cryptsetup
2020 Oct 06
2
Re: [PATCH common v2 4/4] options: Ignore errors from guestfs_luks_uuid.
...CLEANUP_FREE char *type = guestfs_vfs_type (g, partitions[i]); > if (type && > (STREQ (type, "crypto_LUKS") || STREQ (type, "BitLocker"))) { >+ bool is_bitlocker = STREQ (type, "BitLocker"); > char mapname[32]; > make_mapname (partitions[i], mapname, sizeof mapname); > > #ifdef GUESTFS_HAVE_LUKS_UUID >- CLEANUP_FREE char *uuid = guestfs_luks_uuid (g, partitions[i]); >+ CLEANUP_FREE char *uuid; >+ if (!is_bitlocker) >+ uuid = guestfs_luks_uuid (g, partitions[i]); >+ else {...
2020 Oct 07
2
Re: [PATCH common v2 4/4] options: Ignore errors from guestfs_luks_uuid.
...s_type (g, partitions[i]); >> > if (type && >> > (STREQ (type, "crypto_LUKS") || STREQ (type, "BitLocker"))) { >> >+ bool is_bitlocker = STREQ (type, "BitLocker"); >> > char mapname[32]; >> > make_mapname (partitions[i], mapname, sizeof mapname); >> > >> >#ifdef GUESTFS_HAVE_LUKS_UUID >> >- CLEANUP_FREE char *uuid = guestfs_luks_uuid (g, partitions[i]); >> >+ CLEANUP_FREE char *uuid; >> >+ if (!is_bitlocker) >> >+ uuid = gue...
2016 Sep 19
0
[PATCH 1/3] fish: move disk decryption helpers in own file
...lude <stdlib.h> +#include <string.h> + +#include "c-ctype.h" + +#include "guestfs.h" + +#include "options.h" + +/** + * Make a LUKS map name from the partition name, + * eg. C<"/dev/vda2" =E<gt> "luksvda2"> + */ +static void +make_mapname (const char *device, char *mapname, size_t len) +{ + size_t i = 0; + + if (len < 5) + abort (); + strcpy (mapname, "luks"); + mapname += 4; + len -= 4; + + if (STRPREFIX (device, "/dev/")) + i = 5; + + for (; device[i] != '\0' && len >= 1; ++i)...
2020 Oct 06
0
Re: [PATCH common v2 4/4] options: Ignore errors from guestfs_luks_uuid.
...r *type = guestfs_vfs_type (g, partitions[i]); > > if (type && > > (STREQ (type, "crypto_LUKS") || STREQ (type, "BitLocker"))) { > >+ bool is_bitlocker = STREQ (type, "BitLocker"); > > char mapname[32]; > > make_mapname (partitions[i], mapname, sizeof mapname); > > > >#ifdef GUESTFS_HAVE_LUKS_UUID > >- CLEANUP_FREE char *uuid = guestfs_luks_uuid (g, partitions[i]); > >+ CLEANUP_FREE char *uuid; > >+ if (!is_bitlocker) > >+ uuid = guestfs_luks_uuid (g, parti...
2020 Oct 09
0
Re: [PATCH common v2 4/4] options: Ignore errors from guestfs_luks_uuid.
...s[i]); >>> > if (type && >>> > (STREQ (type, "crypto_LUKS") || STREQ (type, "BitLocker"))) { >>> >+ bool is_bitlocker = STREQ (type, "BitLocker"); >>> > char mapname[32]; >>> > make_mapname (partitions[i], mapname, sizeof mapname); >>> > >>> >#ifdef GUESTFS_HAVE_LUKS_UUID >>> >- CLEANUP_FREE char *uuid = guestfs_luks_uuid (g, partitions[i]); >>> >+ CLEANUP_FREE char *uuid; >>> >+ if (!is_bitlocker) >>>...
2020 Jan 22
2
Re: [PATCH] mltools, options: support --allow-discards when decrypting LUKS devices
...tion. *) Documentation here needs a short explanation of what the new allow_discards parameter does, and what the default is. > diff --git a/options/decrypt.c b/options/decrypt.c > index 683cf5e..0f24a7a 100644 > --- a/options/decrypt.c > +++ b/options/decrypt.c > @@ -71,7 +71,7 @@ make_mapname (const char *device, char *mapname, size_t len) > * encryption schemes. > */ > void > -inspect_do_decrypt (guestfs_h *g, struct key_store *ks) > +inspect_do_decrypt (guestfs_h *g, struct key_store *ks, int allowdiscards) > { > CLEANUP_FREE_STRING_LIST char **partitions...
2016 Sep 19
6
[PATCH 0/3] add crypto/LUKS support in some OCaml-based tools
Hi, this series refactors some guestfish code (not much), and exposes it via Common_utils, so it is possible to decrypt LUKS partitions when using virt-customize, virt-get-kernel, virt-sparsify, and virt-sysprep. This brings them closer in features with C tools. Most probably a couple more of other OCaml-based tools (virt-v2v to convert encrypted guests, and virt-builder to use encrypted
2020 Jan 22
0
Re: [PATCH] mltools, options: support --allow-discards when decrypting LUKS devices
...ion of what the > new allow_discards parameter does, and what the default is. > Will fix. > > > diff --git a/options/decrypt.c b/options/decrypt.c > > index 683cf5e..0f24a7a 100644 > > --- a/options/decrypt.c > > +++ b/options/decrypt.c > > @@ -71,7 +71,7 @@ make_mapname (const char *device, char *mapname, > size_t len) > > * encryption schemes. > > */ > > void > > -inspect_do_decrypt (guestfs_h *g, struct key_store *ks) > > +inspect_do_decrypt (guestfs_h *g, struct key_store *ks, int > allowdiscards) > > { > >...
2020 Mar 30
0
[PATCH common 3/4] options: Ignore errors from guestfs_luks_uuid.
...| 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/options/decrypt.c b/options/decrypt.c index 58f8df9..069a83f 100644 --- a/options/decrypt.c +++ b/options/decrypt.c @@ -83,7 +83,11 @@ inspect_do_decrypt (guestfs_h *g, struct key_store *ks) CLEANUP_FREE char *mapname = make_mapname (partitions[i]); #ifdef GUESTFS_HAVE_LUKS_UUID - CLEANUP_FREE char *uuid = guestfs_luks_uuid (g, partitions[i]); + /* This may fail for Windows BitLocker disks, so hide errors. */ + CLEANUP_FREE char *uuid; + guestfs_push_error_handler (g, NULL, NULL); + uuid = guestfs_l...
2020 Sep 07
0
[PATCH common v2 4/4] options: Ignore errors from guestfs_luks_uuid.
...ruct key_store *ks) CLEANUP_FREE char *type = guestfs_vfs_type (g, partitions[i]); if (type && (STREQ (type, "crypto_LUKS") || STREQ (type, "BitLocker"))) { + bool is_bitlocker = STREQ (type, "BitLocker"); char mapname[32]; make_mapname (partitions[i], mapname, sizeof mapname); #ifdef GUESTFS_HAVE_LUKS_UUID - CLEANUP_FREE char *uuid = guestfs_luks_uuid (g, partitions[i]); + CLEANUP_FREE char *uuid; + if (!is_bitlocker) + uuid = guestfs_luks_uuid (g, partitions[i]); + else { + /* This may fail f...
2019 Nov 29
0
[common PATCH 2/2] options: allow a UUID as identifier for --key
...| 6 +++--- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/options/decrypt.c b/options/decrypt.c index 3511d9f..683cf5e 100644 --- a/options/decrypt.c +++ b/options/decrypt.c @@ -86,7 +86,13 @@ inspect_do_decrypt (guestfs_h *g, struct key_store *ks) char mapname[32]; make_mapname (partitions[i], mapname, sizeof mapname); - CLEANUP_FREE_STRING_LIST char **keys = get_keys (ks, partitions[i]); +#ifdef GUESTFS_HAVE_LUKS_UUID + CLEANUP_FREE char *uuid = guestfs_luks_uuid (g, partitions[i]); +#else + const char *uuid = NULL; +#endif + + CLEANUP_FREE_STRING_L...
2020 Mar 10
2
[PATCH common] options: Require libguestfs >= 1.42.
...-git a/options/decrypt.c b/options/decrypt.c index 683cf5ed4..32ef29fd6 100644 --- a/options/decrypt.c +++ b/options/decrypt.c @@ -85,12 +85,7 @@ inspect_do_decrypt (guestfs_h *g, struct key_store *ks) if (type && STREQ (type, "crypto_LUKS")) { char mapname[32]; make_mapname (partitions[i], mapname, sizeof mapname); - -#ifdef GUESTFS_HAVE_LUKS_UUID CLEANUP_FREE char *uuid = guestfs_luks_uuid (g, partitions[i]); -#else - const char *uuid = NULL; -#endif CLEANUP_FREE_STRING_LIST char **keys = get_keys (ks, partitions[i], uuid); assert (guestfs...
2019 Nov 26
0
[PATCH common v2 2/3] options: Allow multiple --key parameters.
...RE); - int need_rescan = 0; - size_t i; + int need_rescan = 0, r; + size_t i, j; + for (i = 0; partitions[i] != NULL; ++i) { CLEANUP_FREE char *type = guestfs_vfs_type (g, partitions[i]); if (type && STREQ (type, "crypto_LUKS")) { char mapname[32]; make_mapname (partitions[i], mapname, sizeof mapname); - CLEANUP_FREE char *key = get_key (ks, partitions[i]); - /* XXX Should we call guestfs_luks_open_ro if readonly flag - * is set? This might break 'mount_ro'. - */ - if (guestfs_luks_open (g, partitions[i], key, mapname...
2020 Jan 22
0
[PATCH] mltools, options: support --allow-discards when decrypting LUKS devices
...decryption: look for any [crypto_LUKS] partitions and decrypt them, then rescan for VGs. This only works for Fedora whole-disk encryption. *) diff --git a/options/decrypt.c b/options/decrypt.c index 683cf5e..0f24a7a 100644 --- a/options/decrypt.c +++ b/options/decrypt.c @@ -71,7 +71,7 @@ make_mapname (const char *device, char *mapname, size_t len) * encryption schemes. */ void -inspect_do_decrypt (guestfs_h *g, struct key_store *ks) +inspect_do_decrypt (guestfs_h *g, struct key_store *ks, int allowdiscards) { CLEANUP_FREE_STRING_LIST char **partitions = guestfs_list_partitions (g);...
2019 Nov 12
0
[PATCH 2/2] options: Allow multiple --key parameters and default keys.
...RE); - int need_rescan = 0; - size_t i; + int need_rescan = 0, r; + size_t i, j; + for (i = 0; partitions[i] != NULL; ++i) { CLEANUP_FREE char *type = guestfs_vfs_type (g, partitions[i]); if (type && STREQ (type, "crypto_LUKS")) { char mapname[32]; make_mapname (partitions[i], mapname, sizeof mapname); - CLEANUP_FREE char *key = get_key (ks, partitions[i]); - /* XXX Should we call guestfs_luks_open_ro if readonly flag - * is set? This might break 'mount_ro'. - */ - if (guestfs_luks_open (g, partitions[i], key, mapname...
2019 Nov 29
8
[PATCH 0/1] Allow UUIDs for --key identifiers.
This combined patch series enables to decrypt LUKS devices on inspection by allowing the UUID of the LUKS device with the --key syntax. I opted for reusing the option instead of adding another one, as I think that device names and UUIDs are different enough that can be properly distinguished. A test for this (patch #4) can be applied only when the patches for common are applied, and the
2019 Nov 12
4
[PATCH 1/2] options: Fixes and enhancements to --key parsing.
The first patch fixes a rather serious bug, the second patch allows multiple --key parameters and default parameters. There is a third patch to libguestfs which adds a test, coming up. I did not yet review and fix the documentation. I think we need to centralize it in one place because at the moment the same documentation for --key is copy/pasted all over the tools. Rich.