grub-devel
[Top][All Lists]
Advanced

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

[PATCH] normal: Cancel the authentication when the submenu returns to th


From: zhouzilong
Subject: [PATCH] normal: Cancel the authentication when the submenu returns to the parent menu
Date: Tue, 14 Dec 2021 18:03:23 +0800

It could be confusing for the user to enter a menu entry with the 
"--Unrestricted" parameter set (no authentication required), but the user still 
needed to authenticate before returning to the parent menu via "ESC". This 
logic was probably incorrect, so I changed it.

Signed-off-by: zhouzilong <zhouzilong@uniontech.com>
---
 grub-core/normal/menu.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c
index 8397886fa..fc2ca6ff0 100644
--- a/grub-core/normal/menu.c
+++ b/grub-core/normal/menu.c
@@ -897,13 +897,16 @@ grub_show_menu (grub_menu_t menu, int nested, int 
autoboot)
       if (grub_normal_exit_level)
        break;
 
-      err2 = grub_auth_check_authentication (NULL);
-      if (err2)
-       {
-         grub_print_error ();
-         grub_errno = GRUB_ERR_NONE;
-         continue;
-       }
+      if (!nested)
+      {
+        err2 = grub_auth_check_authentication (NULL);
+        if (err2)
+               {
+                 grub_print_error ();
+                 grub_errno = GRUB_ERR_NONE;
+                 continue;
+               }
+      }
 
       break;
     }
-- 
2.20.1






reply via email to

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