grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: regression in cryptomount -u


From: Daniel Kiper
Subject: Re: regression in cryptomount -u
Date: Thu, 17 Aug 2023 17:12:44 +0200
User-agent: NeoMutt/20170113 (1.7.2)

Adding Glenn and Patrick...

Olaf, please always CC at least original author of the patch...

Thanks for the report!

On Thu, Aug 17, 2023 at 10:52:58AM +0200, Olaf Hering 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));
>        goto cleanup;
>      }
>
>
>
> submenu x {
>   insmod luks
>   if cryptomount -u ${uuid_without_dashes} ; then
>     do_work
>   fi
> }

Daniel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]