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