mirror of
https://src.fedoraproject.org/rpms/grub2.git
synced 2024-11-24 14:32:58 +00:00
3b94406a9e
CVE-2020-10713 CVE-2020-14308 CVE-2020-14309 CVE-2020-14310 CVE-2020-14311 CVE-2020-15705 CVE-2020-15706 CVE-2020-15707 Signed-off-by: Peter Jones <pjones@redhat.com>
53 lines
1.8 KiB
Diff
53 lines
1.8 KiB
Diff
From e1a1226abd8f579b411b715639ab8e0abedc0f0a Mon Sep 17 00:00:00 2001
|
|
From: Fritz Elfert <fritz@fritz-elfert.de>
|
|
Date: Sun, 12 Jan 2020 22:07:52 +0100
|
|
Subject: [PATCH 194/237] Fix savedefault with blscfg
|
|
|
|
The GRUB_SAVEDEFAULT option was ignored on a BLS configuration. Fix it by
|
|
making the menu entries populated from the BLS files to call savedefault
|
|
if a save_default environment variable has been set to "true".
|
|
|
|
This variable is set by grub2-mkconfig to the value in GRUB_SAVEDEFAULT.
|
|
---
|
|
grub-core/commands/blscfg.c | 5 ++++-
|
|
util/grub.d/10_linux.in | 4 ++++
|
|
2 files changed, 8 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c
|
|
index 8c6dd91be10..f2c1fd0733d 100644
|
|
--- a/grub-core/commands/blscfg.c
|
|
+++ b/grub-core/commands/blscfg.c
|
|
@@ -821,11 +821,14 @@ static void create_entry (struct bls_entry *entry)
|
|
tmp = grub_stpcpy (tmp, "\n");
|
|
}
|
|
|
|
- src = grub_xasprintf ("load_video\n"
|
|
+ const char *sdval = grub_env_get("save_default");
|
|
+ bool savedefault = ((NULL != sdval) && (grub_strcmp(sdval, "true") == 0));
|
|
+ src = grub_xasprintf ("%sload_video\n"
|
|
"set gfxpayload=keep\n"
|
|
"insmod gzio\n"
|
|
"linux %s%s%s%s\n"
|
|
"%s",
|
|
+ savedefault ? "savedefault\n" : "",
|
|
GRUB_BOOT_DEVICE, clinux, options ? " " : "", options ? options : "",
|
|
initrd ? initrd : "");
|
|
|
|
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
|
|
index 9e015c2c134..d5319300e04 100644
|
|
--- a/util/grub.d/10_linux.in
|
|
+++ b/util/grub.d/10_linux.in
|
|
@@ -138,6 +138,10 @@ EOF
|
|
if [ -n "${GRUB_EARLY_INITRD_LINUX_CUSTOM}" ]; then
|
|
${grub_editenv} - set early_initrd="${GRUB_EARLY_INITRD_LINUX_CUSTOM}"
|
|
fi
|
|
+
|
|
+ if [ -n "${GRUB_SAVEDEFAULT}" ]; then
|
|
+ ${grub_editenv} - set save_default="${GRUB_SAVEDEFAULT}"
|
|
+ fi
|
|
fi
|
|
|
|
exit 0
|
|
--
|
|
2.26.2
|
|
|