Skip to contentSkip to conversation

normal: Cancel the authentication when the submenu returns to the parent menu

PATCH New zhouzilong 1 participant 1 message Dec 14, 2021

lore
Share & tools
lore

zhouzilong

author
#0 lore raw

PATCH 1/1 normal: Cancel the authentication when the submenu returns to the parent menu

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.

---
 grub-core/normal/menu.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
grub-core/normal/menu.c +10 -7
index 8397886fa..fc2ca6ff0 100644
@@ -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;
     }
Signature · 1 line
2.20.1