All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] disk/cryptodisk: Fix missing change when updating to use grub_uuidcasecmp
@ 2023-08-18 17:27 Glenn Washburn
  2023-08-27 12:09 ` Patrick Steinhardt
  0 siblings, 1 reply; 3+ messages in thread
From: Glenn Washburn @ 2023-08-18 17:27 UTC (permalink / raw)
  To: grub-devel, Daniel Kiper, ps; +Cc: Glenn Washburn, Olaf Hering

This was causing the cryptomount command to return failure even though
the crypto device was successfully added. Of course, this meant that any
script using the return code would behave unexpectedly.

Fixes: 3cf2e848bc03 (disk/cryptodisk: Allows UUIDs to be compared in a dash-insensitive manner)

Suggested-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Glenn Washburn <development@efficientek.com>
---
 grub-core/disk/cryptodisk.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/grub-core/disk/cryptodisk.c b/grub-core/disk/cryptodisk.c
index 34b67a705fbc..fb807e2a6a27 100644
--- a/grub-core/disk/cryptodisk.c
+++ b/grub-core/disk/cryptodisk.c
@@ -1236,7 +1236,8 @@ 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 != NULL
+	     && grub_uuidcasecmp (cargs->search_uuid, dev->uuid, sizeof (dev->uuid)) == 0);
       goto cleanup;
     }
 
-- 
2.34.1


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] disk/cryptodisk: Fix missing change when updating to use grub_uuidcasecmp
  2023-08-18 17:27 [PATCH] disk/cryptodisk: Fix missing change when updating to use grub_uuidcasecmp Glenn Washburn
@ 2023-08-27 12:09 ` Patrick Steinhardt
  2023-08-29 14:59   ` Daniel Kiper
  0 siblings, 1 reply; 3+ messages in thread
From: Patrick Steinhardt @ 2023-08-27 12:09 UTC (permalink / raw)
  To: Glenn Washburn; +Cc: grub-devel, Daniel Kiper, Olaf Hering


[-- Attachment #1.1: Type: text/plain, Size: 1333 bytes --]

On Fri, Aug 18, 2023 at 12:27:22PM -0500, Glenn Washburn wrote:
> This was causing the cryptomount command to return failure even though
> the crypto device was successfully added. Of course, this meant that any
> script using the return code would behave unexpectedly.
> 
> Fixes: 3cf2e848bc03 (disk/cryptodisk: Allows UUIDs to be compared in a dash-insensitive manner)
> 
> Suggested-by: Olaf Hering <olaf@aepfle.de>
> Signed-off-by: Glenn Washburn <development@efficientek.com>

This change looks good to me, thanks!

Reviewed-by: Patrich Steinhardt <ps@pks.im>

> ---
>  grub-core/disk/cryptodisk.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/grub-core/disk/cryptodisk.c b/grub-core/disk/cryptodisk.c
> index 34b67a705fbc..fb807e2a6a27 100644
> --- a/grub-core/disk/cryptodisk.c
> +++ b/grub-core/disk/cryptodisk.c
> @@ -1236,7 +1236,8 @@ 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 != NULL
> +	     && grub_uuidcasecmp (cargs->search_uuid, dev->uuid, sizeof (dev->uuid)) == 0);
>        goto cleanup;
>      }
>  
> -- 
> 2.34.1
> 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 141 bytes --]

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] disk/cryptodisk: Fix missing change when updating to use grub_uuidcasecmp
  2023-08-27 12:09 ` Patrick Steinhardt
@ 2023-08-29 14:59   ` Daniel Kiper
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Kiper @ 2023-08-29 14:59 UTC (permalink / raw)
  To: Patrick Steinhardt; +Cc: Glenn Washburn, grub-devel, Olaf Hering

On Sun, Aug 27, 2023 at 02:09:08PM +0200, Patrick Steinhardt wrote:
> On Fri, Aug 18, 2023 at 12:27:22PM -0500, Glenn Washburn wrote:
> > This was causing the cryptomount command to return failure even though
> > the crypto device was successfully added. Of course, this meant that any
> > script using the return code would behave unexpectedly.
> >
> > Fixes: 3cf2e848bc03 (disk/cryptodisk: Allows UUIDs to be compared in a dash-insensitive manner)
> >
> > Suggested-by: Olaf Hering <olaf@aepfle.de>
> > Signed-off-by: Glenn Washburn <development@efficientek.com>
>
> This change looks good to me, thanks!
>
> Reviewed-by: Patrich Steinhardt <ps@pks.im>

Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Daniel

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-29 15:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-18 17:27 [PATCH] disk/cryptodisk: Fix missing change when updating to use grub_uuidcasecmp Glenn Washburn
2023-08-27 12:09 ` Patrick Steinhardt
2023-08-29 14:59   ` Daniel Kiper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.