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