1 Star 0 Fork 100

ridedolphin/grub2

forked from src-openEuler/grub2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0109-Fix-getroot.c-s-trampolines.patch 1.29 KB
一键复制 编辑 原始数据 按行查看 历史
zhangqiumiao 提交于 2022-03-07 17:05 . update to version 2.06
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Fri, 28 Sep 2018 15:42:19 -0400
Subject: [PATCH] Fix getroot.c's trampolines.
This makes the stack executable on most of the grub utilities, which is
bad, and rpmdiff complains about it.
Signed-off-by: Peter Jones <pjones@redhat.com>
---
grub-core/osdep/linux/getroot.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c
index 9f730b35189..f0c503f43d3 100644
--- a/grub-core/osdep/linux/getroot.c
+++ b/grub-core/osdep/linux/getroot.c
@@ -1264,22 +1264,20 @@ grub_util_get_grub_dev_os (const char *os_dev)
return grub_dev;
}
+static void *mp = NULL;
+static void
+btrfs_mount_path_hook(const char *m)
+{
+ mp = strdup (m);
+}
char *
grub_util_get_btrfs_subvol (const char *path, char **mount_path)
{
- char *mp = NULL;
-
if (mount_path)
*mount_path = NULL;
- auto void
- mount_path_hook (const char *m)
- {
- mp = strdup (m);
- }
-
- grub_find_root_btrfs_mount_path_hook = mount_path_hook;
+ grub_find_root_btrfs_mount_path_hook = btrfs_mount_path_hook;
grub_free (grub_find_root_devices_from_mountinfo (path, NULL));
grub_find_root_btrfs_mount_path_hook = NULL;
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ridedolphin/grub2.git
git@gitee.com:ridedolphin/grub2.git
ridedolphin
grub2
grub2
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385