Files
trustedgrub2/grub2-menu-unrestricted.patch
Michael Chang 7964a8a204 Accepting request 618457 from home:michael-chang:branches:Base:System
- Fix packed-not-aligned error on GCC 8 (bsc#1084632)
  * 0001-Fix-packed-not-aligned-error-on-GCC-8.patch

- Allow to execute menuentry unrestricted as default (fate#318574) (bsc#1052420)
  * added grub2-menu-unrestricted.patch

OBS-URL: https://build.opensuse.org/request/show/618457
OBS-URL: https://build.opensuse.org/package/show/Base:System/trustedgrub2?expand=0&rev=14
2018-06-22 09:21:05 +00:00

24 lines
705 B
Diff

Index: grub-2.02~beta2/grub-core/normal/menu.c
===================================================================
--- grub-2.02~beta2.orig/grub-core/normal/menu.c
+++ grub-2.02~beta2/grub-core/normal/menu.c
@@ -213,7 +213,17 @@ grub_menu_execute_entry(grub_menu_entry_
grub_size_t sz = 0;
if (entry->restricted)
- err = grub_auth_check_authentication (entry->users);
+ {
+ int auth_check = 1;
+ if (entry->users && entry->users[0] == 0)
+ {
+ const char *unr = grub_env_get ("unrestricted_menu");
+ if (unr && (unr[0] == '1' || unr[0] == 'y'))
+ auth_check = 0;
+ }
+ if (auth_check)
+ err = grub_auth_check_authentication (entry->users);
+ }
if (err)
{