[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: regression in cryptomount -u
From: |
Glenn Washburn |
Subject: |
Re: regression in cryptomount -u |
Date: |
Thu, 17 Aug 2023 15:31:52 -0500 |
On Thu, 17 Aug 2023 10:52:58 +0200
Olaf Hering <olaf@aepfle.de> wrote:
> Prior commit 3cf2e848bc03 ("disk/cryptodisk: Allows UUIDs to be compared
> in a dash-insensitive manner") the grub.cfg below worked as expected:
> create a menu, which if selected tries to open the specified partition
> and does further processing. In case the passphrase was wrong, it would
> just return and offer the menu again.
>
> With the commit above, the specified partition is opened, but cryptomount
> returns an error. As a result no further processing is done, the menu is
> shown again. It needs to be selected once more to do the actual processing.
>
> This change works for me:
>
> --- a/grub-core/disk/cryptodisk.c
> +++ b/grub-core/disk/cryptodisk.c
> @@ -1236,7 +1236,7 @@ grub_cryptodisk_scan_device (const char *name,
> dev = grub_cryptodisk_scan_device_real (name, source, cargs);
> if (dev)
> {
> - ret = (cargs->search_uuid != NULL && grub_strcasecmp
> (cargs->search_uuid, dev->uuid) == 0);
> + ret = cargs->search_uuid && !grub_uuidcasecmp(cargs->search_uuid,
> dev->uuid, sizeof(dev->uuid));
You confused me with the unnecessary changes here into thinking there
was a logic error. Yes, grub_strcasecmp should be replaced with
grub_uuidcasecmp here. Thanks for catching this. Would you like to send
a proper patch to the list or should I?
Glenn
> goto cleanup;
> }
>
>
>
> submenu x {
> insmod luks
> if cryptomount -u ${uuid_without_dashes} ; then
> do_work
> fi
> }
>
>
> Olaf