grub-devel
[Top][All Lists]
Advanced

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

[PATCH v5 3/9] cryptodisk: Return failure in cryptomount when no cryptod


From: Glenn Washburn
Subject: [PATCH v5 3/9] cryptodisk: Return failure in cryptomount when no cryptodisk modules are loaded
Date: Thu, 9 Dec 2021 11:14:52 -0600

This displays an error notifying the user that they'll want to load a
backend module to make cryptomount useful.

Signed-off-by: Glenn Washburn <development@efficientek.com>
---
 grub-core/disk/cryptodisk.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/grub-core/disk/cryptodisk.c b/grub-core/disk/cryptodisk.c
index 9df3d310f..27491871a 100644
--- a/grub-core/disk/cryptodisk.c
+++ b/grub-core/disk/cryptodisk.c
@@ -1125,6 +1125,9 @@ grub_cmd_cryptomount (grub_extcmd_context_t ctxt, int 
argc, char **args)
   if (argc < 1 && !state[1].set && !state[2].set)
     return grub_error (GRUB_ERR_BAD_ARGUMENT, "device name required");
 
+  if (grub_cryptodisk_list == NULL)
+    return grub_error (GRUB_ERR_BAD_MODULE, "no cryptodisk modules loaded");
+
   if (state[0].set)
     {
       int found_uuid;
-- 
2.27.0




reply via email to

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