1 Star 0 Fork 50

yangqiming/grub2_3

forked from src-anolis-os/grub2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0248-blscfg-expand-grub_users-before-passing-to-grub_norm.patch 1.58 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: Javier Martinez Canillas <javierm@redhat.com>
Date: Wed, 21 Nov 2018 15:38:50 +0100
Subject: [PATCH] blscfg: expand grub_users before passing to
grub_normal_add_menu_entry()
The "grub_users" field from the BLS snippet file is used to specifcy the
users that are allowed to execute a given menu entry if the "superusers"
environment variable is set.
If the "grub_users" isn't set, the menu entry is unrestricted and it can
be executed without any authentication and if is set then only the users
defined in "grub_users" can execute the menu entry after authentication.
But this field can contain an environment variable so has to be expanded
or otherwise grub2 will wrongly assume that the user is "$var", and will
populate a menu entry that it's resctrited even when "$var" isn't set.
Resolves: rhbz#1650706
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
grub-core/commands/blscfg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c
index 42892cbfd..c432c6ba2 100644
--- a/grub-core/commands/blscfg.c
+++ b/grub-core/commands/blscfg.c
@@ -704,7 +704,7 @@ static void create_entry (struct bls_entry *entry)
initrds = bls_make_list (entry, "initrd", NULL);
hotkey = bls_get_val (entry, "grub_hotkey", NULL);
- users = bls_get_val (entry, "grub_users", NULL);
+ users = expand_val (bls_get_val (entry, "grub_users", NULL));
classes = bls_make_list (entry, "grub_class", NULL);
args = bls_make_list (entry, "grub_arg", &argc);
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yyangqiming/grub2_3.git
git@gitee.com:yyangqiming/grub2_3.git
yyangqiming
grub2_3
grub2_3
a8

搜索帮助