Skip to contentSkip to conversation

disk/cryptodisk: Fix missing change when updating to use grub_uuidcasecmp

PATCH In review Glenn Washburn 3 participants 3 messages Aug 18, 2023 – Aug 29, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 disk/cryptodisk: Fix missing change when updating to use grub_uuidcasecmp

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)
---
 grub-core/disk/cryptodisk.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
grub-core/disk/cryptodisk.c +2 -1
index 34b67a705fbc..fb807e2a6a27 100644
@@ -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;
     }
 
Signature · 7 lines
2.34.1


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Glenn Washburn

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)

This change looks good to me, thanks!

Quoted 21 lines
---
 grub-core/disk/cryptodisk.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
grub-core/disk/cryptodisk.c +2 -1
index 34b67a705fbc..fb807e2a6a27 100644
@@ -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;
     }
 
Signature · 1 line
2.34.1

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

Reviewed-by
#2 lore raw
Quoted 5 lines · Patrick Steinhardt
Quoted 4 lines · Glenn Washburn

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.

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

This change looks good to me, thanks!

Daniel

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel