From: Glenn Washburn Date: Thu, 9 Dec 2021 17:14:52 +0000 (-0600) Subject: cryptodisk: Return failure in cryptomount when no cryptodisk modules are loaded X-Git-Tag: grub-2.12-rc1~513 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cabc36ce56c46a2c39e142f58585ebce3c88ac0e;p=thirdparty%2Fgrub.git cryptodisk: Return failure in cryptomount when no cryptodisk modules are loaded 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 Reviewed-by: Daniel Kiper --- 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;