From b5793c27c88daef4383f002dd0c340ce9ae2ed17 Mon Sep 17 00:00:00 2001
From: Qiumiao Zhang <zhangqiumiao1@huawei.com>
Date: Tue, 24 Dec 2024 02:37:58 +0000
Subject: [PATCH] fix not verifying grub.cfg when loading it

Fixes: c8b6446348a4 ("skip verification when not loading grub.cfg")

Signed-off-by: Qiumiao Zhang <zhangqiumiao1@huawei.com>
---
 grub-core/normal/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c
index edbea53..d7a6b79 100644
--- a/grub-core/normal/main.c
+++ b/grub-core/normal/main.c
@@ -133,7 +133,7 @@ read_config_file (const char *config)
     }
 
   /* Try to open the config file.  */
-  rawfile = grub_file_open (config, GRUB_FILE_TYPE_CONFIG);
+  rawfile = grub_file_open (config, GRUB_FILE_TYPE_SKIP_SIGNATURE);
   if (! rawfile)
     return 0;
 
@@ -369,7 +369,7 @@ grub_try_normal_prefix (const char *prefix)
        if (config)
          {
            grub_file_t file;
-           file = grub_file_open (config, GRUB_FILE_TYPE_SKIP_SIGNATURE);
+           file = grub_file_open (config, GRUB_FILE_TYPE_CONFIG);
            if (file)
              {
                grub_file_close (file);
-- 
2.33.0

