From 762ee78533329421b2b1da8ac9be355a133e1688 Mon Sep 17 00:00:00 2001 From: zhangqiumiao Date: Thu, 14 Apr 2022 16:21:15 +0800 Subject: [PATCH] fix grub2 password setting does not take effect (cherry picked from commit d97f925042d64cc2435e4615c3f0313b125af213) --- ...d-Always-use-boot-grub2-user.cfg-as-.patch | 42 ------------------- grub.patches | 1 - grub2.spec | 8 +++- 3 files changed, 7 insertions(+), 44 deletions(-) delete mode 100644 0191-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch diff --git a/0191-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch b/0191-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch deleted file mode 100644 index 7ecea22..0000000 --- a/0191-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Javier Martinez Canillas -Date: Mon, 5 Jul 2021 18:24:22 +0200 -Subject: [PATCH] grub-set-password: Always use /boot/grub2/user.cfg as - password default - -The GRUB configuration file is always placed in /boot/grub2/ now, even for -EFI. But the tool is still creating the user.cfg in the ESP and not there. - -Resolves: rhbz#1955294 - -Signed-off-by: Javier Martinez Canillas ---- - util/grub-set-password.in | 9 +-------- - 1 file changed, 1 insertion(+), 8 deletions(-) - -diff --git a/util/grub-set-password.in b/util/grub-set-password.in -index c0b5ebbfdc5..d8005e5a142 100644 ---- a/util/grub-set-password.in -+++ b/util/grub-set-password.in -@@ -1,11 +1,6 @@ - #!/bin/sh -e - --EFIDIR=$(grep ^ID= /etc/os-release | sed -e 's/^ID=//' -e 's/rhel/redhat/' -e 's/\"//g') --if [ -d /sys/firmware/efi/efivars/ ]; then -- grubdir=`echo "/@bootdirname@/efi/EFI/${EFIDIR}/" | sed 's,//*,/,g'` --else -- grubdir=`echo "/@bootdirname@/@grubdirname@" | sed 's,//*,/,g'` --fi -+grubdir=`echo "/@bootdirname@/@grubdirname@" | sed 's,//*,/,g'` - - PACKAGE_VERSION="@PACKAGE_VERSION@" - PACKAGE_NAME="@PACKAGE_NAME@" -@@ -116,8 +111,6 @@ if [ -z "${MYPASS}" ]; then - exit 1 - fi - --# on the ESP, these will fail to set the permissions, but it's okay because --# the directory is protected. - install -m 0600 /dev/null "${OUTPUT_PATH}/user.cfg" 2>/dev/null || : - chmod 0600 "${OUTPUT_PATH}/user.cfg" 2>/dev/null || : - echo "GRUB2_PASSWORD=${MYPASS}" > "${OUTPUT_PATH}/user.cfg" diff --git a/grub.patches b/grub.patches index 48c28a0..1653977 100644 --- a/grub.patches +++ b/grub.patches @@ -188,7 +188,6 @@ Patch0187: 0187-efinet-Add-DHCP-proxy-support.patch Patch0188: 0188-fs-ext2-Ignore-checksum-seed-incompat-feature.patch Patch0189: 0189-Don-t-update-the-cmdline-when-generating-legacy-menu.patch Patch0190: 0190-Suppress-gettext-error-message.patch -Patch0191: 0191-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch Patch0192: 0192-templates-Check-for-EFI-at-runtime-instead-of-config.patch Patch0193: 0193-efi-Print-an-error-if-boot-to-firmware-setup-is-not-.patch Patch0194: 0194-arm64-Fix-EFI-loader-kernel-image-allocation.patch diff --git a/grub2.spec b/grub2.spec index 7b1a4ed..9e66daa 100644 --- a/grub2.spec +++ b/grub2.spec @@ -14,7 +14,7 @@ Name: grub2 Epoch: 1 Version: 2.06 -Release: 4 +Release: 5 Summary: Bootloader with support for Linux, Multiboot and more License: GPLv3+ URL: http://www.gnu.org/software/grub/ @@ -432,6 +432,12 @@ fi %{_datadir}/man/man* %changelog +* Thu Apr 14 2022 zhangqiumiao - 2.06-5 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:fix grub2 password setting does not take effect + * Fri Mar 25 2022 zhangqiumiao - 2.06-4 - Type:bugfix - CVE:NA -- Gitee