[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 9/9] cryptodisk: Improve handling of partition name in cryptom
From: |
Glenn Washburn |
Subject: |
[PATCH v5 9/9] cryptodisk: Improve handling of partition name in cryptomount password prompt |
Date: |
Thu, 9 Dec 2021 11:14:58 -0600 |
Call grub_partition_get_name unconditionally to initialize the part
variable. Then part will only be NULL when grub_partition_get_name errors.
Note that when source->partition is NULL, then grub_partition_get_name
returns an allocated empty string. So no comma or partition will be printed,
as desired.
Signed-off-by: Glenn Washburn <development@efficientek.com>
---
grub-core/disk/cryptodisk.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/grub-core/disk/cryptodisk.c b/grub-core/disk/cryptodisk.c
index 99265097a..2381c3330 100644
--- a/grub-core/disk/cryptodisk.c
+++ b/grub-core/disk/cryptodisk.c
@@ -1021,11 +1021,10 @@ grub_cryptodisk_scan_device_real (const char *name,
{
/* Get the passphrase from the user, if no key data. */
askpass = 1;
- if (source->partition != NULL)
- part = grub_partition_get_name (source->partition);
+ part = grub_partition_get_name (source->partition);
grub_printf_ (N_("Enter passphrase for %s%s%s (%s): "), source->name,
source->partition != NULL ? "," : "",
- part != NULL ? part : "",
+ part != NULL ? part : N_("UNKNOWN"),
dev->uuid);
grub_free (part);
--
2.27.0
- [PATCH v5 3/9] cryptodisk: Return failure in cryptomount when no cryptodisk modules are loaded, (continued)
- [PATCH v5 3/9] cryptodisk: Return failure in cryptomount when no cryptodisk modules are loaded, Glenn Washburn, 2021/12/09
- [PATCH v5 5/9] cryptodisk: Improve cryptomount -u error message, Glenn Washburn, 2021/12/09
- [PATCH v5 7/9] cryptodisk: Refactor password input out of crypto dev modules into cryptodisk, Glenn Washburn, 2021/12/09
- [PATCH v5 6/9] cryptodisk: Add infrastructure to pass data from cryptomount to cryptodisk modules, Glenn Washburn, 2021/12/09
- [PATCH v5 8/9] cryptodisk: Move global variables into grub_cryptomount_args struct, Glenn Washburn, 2021/12/09
- [PATCH v5 9/9] cryptodisk: Improve handling of partition name in cryptomount password prompt,
Glenn Washburn <=
- Re: [PATCH v5 0/9] Refactor/improve cryptomount data passing to crypto modules, Daniel Kiper, 2021/12/20