Blame SOURCES/0122-Fix-getroot.c-s-trampolines.patch

5593c8
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
5593c8
From: Peter Jones <pjones@redhat.com>
5593c8
Date: Fri, 28 Sep 2018 15:42:19 -0400
5593c8
Subject: [PATCH] Fix getroot.c's trampolines.
5593c8
5593c8
This makes the stack executable on most of the grub utilities, which is
5593c8
bad, and rpmdiff complains about it.
5593c8
5593c8
Signed-off-by: Peter Jones <pjones@redhat.com>
5593c8
---
5593c8
 grub-core/osdep/linux/getroot.c | 16 +++++++---------
5593c8
 1 file changed, 7 insertions(+), 9 deletions(-)
5593c8
5593c8
diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c
1c6ba0
index 9f730b3518..f0c503f43d 100644
5593c8
--- a/grub-core/osdep/linux/getroot.c
5593c8
+++ b/grub-core/osdep/linux/getroot.c
5593c8
@@ -1264,22 +1264,20 @@ grub_util_get_grub_dev_os (const char *os_dev)
5593c8
   return grub_dev;
5593c8
 }
5593c8
 
5593c8
+static void *mp = NULL;
5593c8
+static void
5593c8
+btrfs_mount_path_hook(const char *m)
5593c8
+{
5593c8
+  mp = strdup (m);
5593c8
+}
5593c8
 
5593c8
 char *
5593c8
 grub_util_get_btrfs_subvol (const char *path, char **mount_path)
5593c8
 {
5593c8
-  char *mp = NULL;
5593c8
-
5593c8
   if (mount_path)
5593c8
     *mount_path = NULL;
5593c8
 
5593c8
-  auto void
5593c8
-  mount_path_hook (const char *m)
5593c8
-  {
5593c8
-    mp = strdup (m);
5593c8
-  }
5593c8
-
5593c8
-  grub_find_root_btrfs_mount_path_hook = mount_path_hook;
5593c8
+  grub_find_root_btrfs_mount_path_hook = btrfs_mount_path_hook;
5593c8
   grub_free (grub_find_root_devices_from_mountinfo (path, NULL));
5593c8
   grub_find_root_btrfs_mount_path_hook = NULL;
5593c8