1 Star 0 Fork 49

yangqiming / grub2_4

forked from src-anolis-os / grub2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0191-Fix-grub-setpassword-o-s-output-path.patch 1.44 KB
一键复制 编辑 原始数据 按行查看 历史
geliwei 提交于 2022-04-13 15:15 . update to grub2-2.02-120.el8.src.rpm
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Andy Lutomirski <luto@kernel.org>
Date: Sun, 11 Jun 2017 19:17:40 -0400
Subject: [PATCH] Fix grub-setpassword -o's output path
The output path is set up in the command line parsing, but completely ignored
in the code that actually writes the files. This patch fixes that.
Signed-off-by: Peter Jones <pjones@redhat.com>
---
util/grub-setpassword.in | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/util/grub-setpassword.in b/util/grub-setpassword.in
index cf70257ee..5ebf50576 100644
--- a/util/grub-setpassword.in
+++ b/util/grub-setpassword.in
@@ -118,11 +118,11 @@ 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 "${grubdir}/user.cfg" 2>/dev/null || :
-chmod 0600 "${grubdir}/user.cfg" 2>/dev/null || :
-echo "GRUB2_PASSWORD=${MYPASS}" > "${grubdir}/user.cfg"
+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"
-if ! grep -q "^### BEGIN /etc/grub.d/01_users ###$" "${grubdir}/grub.cfg"; then
+if ! grep -q "^### BEGIN /etc/grub.d/01_users ###$" "${OUTPUT_PATH}/grub.cfg"; then
echo "WARNING: The current configuration lacks password support!"
echo "Update your configuration with @grub_mkconfig@ to support this feature."
fi
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yyangqiming/grub2_4.git
git@gitee.com:yyangqiming/grub2_4.git
yyangqiming
grub2_4
grub2_4
a8

搜索帮助

344bd9b3 5694891 D2dac590 5694891