change the grub2 user.cfg permission from 0700 to 0600

(cherry picked from commit 51015a43360dafb74461d8a6b32d089ed696c4ca)
This commit is contained in:
xihaochen 2022-03-22 10:45:15 +08:00 committed by openeuler-sync-bot
parent de9e3bb40e
commit bf44dfdc78
2 changed files with 30 additions and 1 deletions

View File

@ -4,7 +4,7 @@
%endif
Name: anaconda
Version: 33.19
Release: 41
Release: 42
Summary: Graphical system installer
License: GPLv2+ and MIT
URL: http://fedoraproject.org/wiki/Anaconda
@ -124,6 +124,7 @@ Patch9028: Change-sidebar-background-size.patch
Patch6078: bugfix-Cancel-planned-manual-update-of-system-time-on-turni.patch
Patch9029: support-use-sm3-crypt-user-password.patch
Patch6079: backport-remove-authconfig-support.patch
Patch6080: backport-change-the-grub2-user-cfg-permission-from-0700-to-0600.patch
%define dbusver 1.2.3
%define dnfver 3.6.0
@ -352,6 +353,12 @@ update-desktop-database &> /dev/null || :
%{_prefix}/libexec/anaconda/dd_*
%changelog
* Tue Mar 22 2022 xihaochen <xihaochen@h-partners.com> - 33.19-42
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:change the grub2 user.cfg permission from 0700 to 0600
* Sat Mar 05 2022 gaihuiying <eaglegai@163.com> - 33.19-41
- Type:bugfix
- CVE:NA

View File

@ -0,0 +1,22 @@
From 7db645b89c3c68fbd116dbb8c6e6c1b4ab8eeb07 Mon Sep 17 00:00:00 2001
From: bitcoffee <854182924@qq.com>
Date: Tue, 2 Mar 2021 16:11:35 +0800
Subject: [PATCH] change the grub2 user.cfg permission from 0600 to 0700
---
pyanaconda/modules/storage/bootloader/grub2.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/modules/storage/bootloader/grub2.py b/pyanaconda/modules/storage/bootloader/grub2.py
index add7dc97086..44b08e4dec9 100644
--- a/pyanaconda/modules/storage/bootloader/grub2.py
+++ b/pyanaconda/modules/storage/bootloader/grub2.py
@@ -310,7 +310,7 @@ def write_password_config(self):
return
users_file = "%s%s/%s" % (conf.target.system_root, self.config_dir, self._passwd_file)
- header = util.open_with_perm(users_file, "w", 0o700)
+ header = util.open_with_perm(users_file, "w", 0o600)
# XXX FIXME: document somewhere that the username is "root"
self._encrypt_password()
password_line = "GRUB2_PASSWORD=" + self.encrypted_password